#include "buses.h"
Defines | |
| #define | serIsGetReady() busRxBufHasData(BUSID_SER1) |
| #define | serRxBufEmpty() busIsRxBufEmpty(BUSID_SER1) |
Functions | |
| void | serDisable (void) |
| void | serEnable (void) |
| BYTE | serGetByte (void) |
| void | serInit (void) |
| void | serPut2Bytes (BYTE b1, BYTE b2) |
| void | serPutByte (BYTE c) |
| void | serPutByteHex (BYTE c) |
| void | serPutDebugMsgRomStr (BYTE debugCode, BYTE msgCode, ROM char *msgString) |
| void | serPutRomString (ROM char *str) |
| void | serPutRomStringAndNull (ROM char *str) |
| void | serPutString (BYTE *s) |
| void | serPutStringAndNull (BYTE *str) |
| void | serReset (void) |
| void | serRxIsr (void) |
| void | serService (void) |
| void | serTxIsr (void) |
//********************************************************************* //-------------- busser1 Configuration -------------------- //********************************************************************* //Comment this line if the transmit routines should NOT wait for the bytes to be send via //USART if tx buffer is full #define SER_WAIT_FOR_TXBUF //Uncomment this line if the application does NOT configure the USART //#define BAUD_RATE 9600ul
| #define serIsGetReady | ( | ) | busRxBufHasData(BUSID_SER1) |
Are there any bytes in the receive buffer.
| #define serRxBufEmpty | ( | ) | busIsRxBufEmpty(BUSID_SER1) |
Are there any bytes in the receive buffer.
| void serDisable | ( | void | ) |
Disables the serial port
| void serEnable | ( | void | ) |
Enables the serial port AND . Can only be called after serInit() has been called.
| BYTE serGetByte | ( | void | ) |
Get the next byte in the RX buffer. Before calling this function, the serIsGetReady() function should be called to check if there is any data available on the serial port.
| void serInit | ( | void | ) |
Initialize this module
Sent the given two bytes via the USART.
| b1 | The first byte to be sent. | |
| b2 | The second byte to be sent. |
| void serPutByte | ( | BYTE | c | ) |
Send the given byte to the USART. It is added to the transmit buffer, and asynchronously transmitted.
| c | Byte to write out on the serial port |
| void serPutByteHex | ( | BYTE | c | ) |
Send the ASCII hex value of the given byte to the USART. It is added to the transmit buffer, and asynchronously transmitted. For example, if c=11, then "0B" will be sent to the USART
| c | Byte to write out on the serial port |
Sent the given debug message to the USART. The following is sent: [debugCode][msgCode][msgString]
| debugCode | The Debug Message's "Debug Code". This will be the first byte sent. | |
| msgCode | The Debug Message's "Message Code". This will be the second byte sent. | |
| msgString | The Debug Message's "Message String", has to be a NULL terminated string. This will be sent after the msgCode. |
| void serPutRomString | ( | ROM char * | str | ) |
Transmit a NULL terminated string. It is added to the transmit buffer, and asynchronously transmitted. The NULL is NOT sent!
| str | Null terminated string to write out on the serial port |
| void serPutRomStringAndNull | ( | ROM char * | str | ) |
Transmit a NULL terminated string. It is added to the transmit buffer, and asynchronously transmitted. The NULL is ALSO sent!
| str | Null terminated string to write out on the serial port |
| void serPutString | ( | BYTE * | s | ) |
Transmit a NULL terminated string. It is added to the transmit buffer, and asynchronously transmitted. The NULL is NOT sent!
| s | Null terminated string to write out on the serial port |
| void serPutStringAndNull | ( | BYTE * | str | ) |
Transmit a NULL terminated string. It is added to the transmit buffer, and asynchronously transmitted. The NULL is ALSO sent!
| str | Null terminated string to write out on the serial port |
| void serReset | ( | void | ) |
Resets this module, and empties all buffers.
| void serRxIsr | ( | void | ) |
Called in the USART RX ISR
| void serService | ( | void | ) |
Service this module
| void serTxIsr | ( | void | ) |
Called in the USART TX ISR
1.5.8