PIC24 Support Libraries
|
This file contains macros, prototypes, and definitions for Microchip PIC24 Family specific communications on ESOS. More...
Go to the source code of this file.
Macros | |
#define | IS_CHAR_READY_UART1() U1STAbits.URXDA |
#define | IS_TRANSMIT_BUFFER_FULL_UART1() U1STAbits.UTXBF |
#define | IS_TRANSMIT_COMPLETE_UART1() U1STAbits.TRMT |
Constants for the UxMODE.PDSEL bitfield | |
Use with CONFIG_PDSEL_UART1. | |
#define | UXMODE_PDSEL_8DATA_NOPARITY 0 |
#define | UXMODE_PDSEL_8DATA_EVENPARITY 1 |
#define | UXMODE_PDSEL_8DATA_ODDPARITY 2 |
#define | UXMODE_PDSEL_9DATA_NOPARITY 3 |
Functions | |
static void | CONFIG_BAUDRATE_UART1 (uint32_t baudRate) |
static void | CONFIG_PDSEL_UART1 (uint8_t u8_pdsel) |
static void | CONFIG_STOPBITS_UART1 (uint8_t u8_numStopbits) |
static void | ENABLE_UART1 () |
void | __esos_configUART1 (uint32_t u32_baudRate) |
static void | WAIT_UNTIL_TRANSMIT_COMPLETE_UART1 () |
This file contains macros, prototypes, and definitions for Microchip PIC24 Family specific communications on ESOS.
This file contains routines which configure and use the UARTs on the PIC. See pic24_serial.h for higher-level routines, which should typically be called by the user rather than these routines.
Definition in file esos_pic24_rs232.h.
#define IS_CHAR_READY_UART1 | ( | ) | U1STAbits.URXDA |
Determine if a character is available in the UART's receive buffer.
Definition at line 138 of file esos_pic24_rs232.h.
#define IS_TRANSMIT_BUFFER_FULL_UART1 | ( | ) | U1STAbits.UTXBF |
Determine if a the transmit buffer is full.
Definition at line 144 of file esos_pic24_rs232.h.
#define IS_TRANSMIT_COMPLETE_UART1 | ( | ) | U1STAbits.TRMT |
Determines if all characters placed in the UART have been sent. Returns 1 if the last transmission has completed, or 0 if a transmission is in progress or queued in the transmit buffer.
Definition at line 151 of file esos_pic24_rs232.h.
Referenced by WAIT_UNTIL_TRANSMIT_COMPLETE_UART1().
|
inlinestatic |
The underlying PIC24 HW libraries choose a default baudrate appropriate to the chosen MCU model. Only uncomment the line below if you want ESOS to build the UART with a "non-standard" baudrate. Used by configUART1 to set up the UART.
#define DEFAULT_BAUDRATE 9600
Configure the UART's baud rate, based on FCY. Note that the value computed is truncated, not rounded, since this is done using integer arithmetic. That is, BRG = truncate(FCY/16/baud - 1), giving an actual baud rate of FCY/16/(reg + 1).
NOTE: this code sets BRGH=0 (16 clocks for each bit). Be careful about using BRGH=1 - this uses only four clock periods to sample each bit and can be very intolerant of baud rate error - you may see framing errors.
baudRate | Desired baud rate. |
Definition at line 92 of file esos_pic24_rs232.h.
Referenced by __esos_configUART1().
|
inlinestatic |
Select the parity and number of data bits for the UART. Use constants UXMODE_PDSEL_8DATA_NOPARITY and following.
u8_pdsel | Parity and number of data bits. |
Definition at line 113 of file esos_pic24_rs232.h.
Referenced by __esos_configUART1().
|
inlinestatic |
Select the number of stop bits for this UART. Valid values are 1 or 2.
u8_numStopbits | Number of stop bits. |
Definition at line 122 of file esos_pic24_rs232.h.
|
inlinestatic |
Enable RX, TX for UART.
Definition at line 128 of file esos_pic24_rs232.h.
|
inlinestatic |
Waits until all characters placed in the UART have been sent.
Definition at line 165 of file esos_pic24_rs232.h.