Serial#
Common bootloader serial definitions.
See bootloader-serial.h for source code.
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.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| void | N/A | 
serPutFlush#
void serPutFlush (void )
Flush the transmiter.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| void | N/A | 
serPutChar#
void serPutChar (uint8_t ch)
Transmit a character.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| uint8_t | N/A | ch | A character.  | 
serPutStr#
void serPutStr (const char * str)
Transmit a string.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| const char * | N/A | str | A string.  | 
serPutBuf#
void serPutBuf (const uint8_t buf, uint8_t size)
Transmit a buffer.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| const uint8_t | N/A | buf | A buffer.  | 
| uint8_t | N/A | size | Length of buffer.  | 
serPutDecimal#
void serPutDecimal (uint16_t val)
Transmit a 16bit value in decimal.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| uint16_t | N/A | val | The data to print.  | 
serPutHex#
void serPutHex (uint8_t byte)
Transmit a byte as hex.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| uint8_t | N/A | byte | A byte.  | 
serPutHexInt#
void serPutHexInt (uint16_t word)
Transmit a 16bit integer as hex.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| uint16_t | N/A | word | A 16bit integer.  | 
serCharAvailable#
bool serCharAvailable (void )
Determine if a character is available.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| void | N/A | 
Returns
true if a character is available, false otherwise.
serGetChar#
uint8_t serGetChar (uint8_t * ch)
Get a character if available, otherwise return an error.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| uint8_t * | 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.
serGetFlush#
void serGetFlush (void )
Flush the receiver.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| void | N/A |