//********************************************************************* //-------------- Serint Configuration -------------------- //********************************************************************* #define SER_RXBUF_SIZE 32 //Size of Rx buffer, must be 8,16,32,64,128 or 256 #define SER_TXBUF_SIZE 32 //Size of TX buffer, must be 8,16,32,64,128 or 256 //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 9600 //USART BAUD rate //Comment this line if the application does NOT configures the USART #define APP_CONFIGURES_SERPORT //Our application does all serial port configuration!
Defines | |
| #define | SER_RXBUF_SIZE 32 |
| #define | SER_TXBUF_SIZE 32 |
| #define | SER_USE_INTERRUPT |
| #define | SERINT_RXBUF_OVERRUN 0x01 |
| #define | SERINT_TXBUF_OVERRUN 0x10 |
| #define | serIsGetReady() (idxSerRxbufPut != idxSerRxbufGet) |
| #define | serRxBufEmpty() (idxSerRxbufPut == idxSerRxbufGet) |
| #define | SPBRG_VAL ( ((CLOCK_FREQ/BAUD_RATE)/64) - 1) |
| #define | USART_USE_BRGH_LOW |
Functions | |
| void | serEnable (void) |
| BYTE | serGetByte (void) |
| BYTE | serGetStat (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) |
Variables | |
| BYTE | idxSerRxbufGet |
| BYTE | idxSerRxbufPut |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Are there any bytes in the receive buffer.
|
|
|
Are there any bytes in the receive buffer.
|
|
|
|
|
|
|
|
|
Enables the serial port AND . Can only be called after serInit() has been called. |
|
|
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.
|
|
|
Get the current status of this module
|
|
|
Initialize this module |
|
||||||||||||
|
Sent the given two bytes via the USART.
|
|
|
Send the given byte to the USART. It is added to the transmit buffer, and asynchronously transmitted.
|
|
|
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
|
|
||||||||||||||||
|
Sent the given debug message to the USART. The following is sent: [debugCode][msgCode][msgString]
|
|
|
Transmit a NULL terminated string. It is added to the transmit buffer, and asynchronously transmitted. The NULL is NOT sent!
|
|
|
Transmit a NULL terminated string. It is added to the transmit buffer, and asynchronously transmitted. The NULL is ALSO sent!
|
|
|
Transmit a NULL terminated string. It is added to the transmit buffer, and asynchronously transmitted. The NULL is NOT sent!
|
|
|
Transmit a NULL terminated string. It is added to the transmit buffer, and asynchronously transmitted. The NULL is ALSO sent!
|
|
|
Resets this module, and empties all buffers. |
|
|
Called in the USART RX ISR |
|
|
Service this module |
|
|
Called in the USART TX ISR |
|
|
|
|
|
|
1.4.5