Common bootloader serial definitions. See Serial for detailed documentation.
License#
Copyright 2018 Silicon Laboratories Inc. www.silabs.com
The licensor of this software is Silicon Laboratories Inc. Your use of this software is governed by the terms of Silicon Labs Master Software License Agreement (MSLA) available at www.silabs.com/about-us/legal/master-software-license-agreement. This software is distributed to you in Source Code format and is governed by the sections of the MSLA applicable to Source Code.
/***************************************************************************/
#ifndef __BOOTLOADER_SERIAL_H__
#define __BOOTLOADER_SERIAL_H__
#ifndef MSD_BOOTLOADER
void serInit(void);
void serPutFlush(void);
void serPutChar(uint8_t ch);
void serPutStr(const char *str);
void serPutBuf(const uint8_t buf[], uint8_t size);
void serPutDecimal(uint16_t val);
void serPutHex(uint8_t byte);
void serPutHexInt(uint16_t word);
bool serCharAvailable(void);
uint8_t serGetChar(uint8_t* ch);
void serGetFlush(void);
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#ifdef BTL_HAS_EZSP_SPI
extern uint8_t preSpiComBufIndex;
#define serResetCharInput() preSpiComBufIndex = 0;
#endif
#endif
#else //MSD_BOOTLOADER
// clear serial calls
#define serInit(x) {}
#define serPutFlush(x)
#define serPutChar(x)
#define serPutStr(x)
#define serPutBuf(x)
#define serPutDecimal(x)
#define serPutHex(x) x
#define serPutHexInt(x)
#define serCharAvailable(x)
#define serGetChar(x)
#define serGetFlush(x)
#endif //MSD_BOOTLOADER
#endif //__BOOTLOADER_SERIAL_H__
Functions#
Initialize serial port.
Flush the transmiter.
Transmit a character.
Transmit a string.
Transmit a buffer.
Transmit a 16bit value in decimal.
Transmit a byte as hex.
Transmit a 16bit integer as hex.
Determine if a character is available.
Get a character if available, otherwise return an error.
Flush the receiver.
Function Documentation#
serInit#
void serInit (void )
Initialize serial port.
N/A |
32
of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/micro/cortexm3/common/bootloader-serial.h
serPutFlush#
void serPutFlush (void )
Flush the transmiter.
N/A |
36
of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/micro/cortexm3/common/bootloader-serial.h
serPutChar#
void serPutChar (uint8_t ch)
Transmit a character.
N/A | ch | A character. |
41
of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/micro/cortexm3/common/bootloader-serial.h
serPutStr#
void serPutStr (const char * str)
Transmit a string.
N/A | str | A string. |
46
of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/micro/cortexm3/common/bootloader-serial.h
serPutBuf#
void serPutBuf (const uint8_t buf, uint8_t size)
Transmit a buffer.
N/A | buf | A buffer. |
N/A | size | Length of buffer. |
52
of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/micro/cortexm3/common/bootloader-serial.h
serPutDecimal#
void serPutDecimal (uint16_t val)
Transmit a 16bit value in decimal.
N/A | val | The data to print. |
57
of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/micro/cortexm3/common/bootloader-serial.h
serPutHex#
void serPutHex (uint8_t byte)
Transmit a byte as hex.
N/A | byte | A byte. |
62
of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/micro/cortexm3/common/bootloader-serial.h
serPutHexInt#
void serPutHexInt (uint16_t word)
Transmit a 16bit integer as hex.
N/A | word | A 16bit integer. |
67
of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/micro/cortexm3/common/bootloader-serial.h
serCharAvailable#
bool serCharAvailable (void )
Determine if a character is available.
N/A |
Returns
true if a character is available, false otherwise.
72
of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/micro/cortexm3/common/bootloader-serial.h
serGetChar#
uint8_t serGetChar (uint8_t * ch)
Get a character if available, otherwise return an error.
N/A | ch | Pointer to a location where the received byte will be placed. |
Returns
BL_SUCCESS if a character was obtained, BL_ERR otherwise.
78
of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/micro/cortexm3/common/bootloader-serial.h
serGetFlush#
void serGetFlush (void )
Flush the receiver.
N/A |
82
of file /Users/vihuszar/Git/EmbeddedSoftware/super/platform/base/hal/micro/cortexm3/common/bootloader-serial.h