Go to the source code of this file.
Defines | |
#define | DEFAULT_UART 1 |
outString() end-of-line behavior | |
#define | SERIAL_EOL_CR_LF 0 |
#define | SERIAL_EOL_CR 1 |
#define | SERIAL_EOL_LF 2 |
#define | SERIAL_EOL_DEFAULT SERIAL_EOL_LF |
Functions | |
uint8 | inChar (void) |
void | outString (const char *psz_s) |
uint16 | inString (char *psz_buff, int16 u16_maxCount) |
uint16 | inStringEcho (char *psz_buff, int16 u16_maxCount) |
void | outChar (uint8 u8_c) |
void | outUint8 (uint8 u8_x) |
void | outUint16 (uint16 u16_x) |
void | outUint32 (uint32 u32_x) |
void | outUint8Decimal (uint8 u8_x) |
void | outUint16Decimal (uint16 u16_x) |
uint8 | isCharReady (void) |
uint8 | inCharEcho (void) |
void | configDefaultUART (uint32 u32_baudRate) |
Definition in file pic24_serial.h.
#define DEFAULT_UART 1 |
Defines the default UART which the configUART() function initializes and which serial I/O is directed to until the
Definition at line 88 of file pic24_serial.h.
#define SERIAL_EOL_CR 1 |
Set SERIAL_EOL_DEFAULT to this value to send a carriage return only ("\r") to end a line.
Definition at line 57 of file pic24_serial.h.
#define SERIAL_EOL_CR_LF 0 |
Set SERIAL_EOL_DEFAULT to this value to send a CR with every LF in outString. PuTTY uses this, expects "\n\r".
Definition at line 52 of file pic24_serial.h.
#define SERIAL_EOL_DEFAULT SERIAL_EOL_LF |
This macro defines end-of-line output behavior when the outString() function is passed a new line ("\n"). Set this to either SERIAL_EOL_CR_LF, SERIAL_EOL_CR, or SERIAL_EOL_LF.
Definition at line 72 of file pic24_serial.h.
#define SERIAL_EOL_LF 2 |
Set SERIAL_EOL_DEFAULT to this value to sends a new line only ("\n"). This works for Bully Bootloader, MPLAB SIM, TeraTerm, RealTerm.
Definition at line 64 of file pic24_serial.h.
void configDefaultUART | ( | uint32 | u32_baudRate | ) |
Configures a UART based compiler setting of DEFAULT_UART and sets __C30_UART to the default UART. If you want to configure a different UART, then call the configUARTx function explicitly.
u32_baudRate | The baud rate to use. |
Definition at line 343 of file pic24_serial.c.
uint8 inChar | ( | void | ) |
Read a character from the serial port. This function blocks until a character is read. The serial port used is selected by the __C30_UART variable, which defaults to 1.
Definition at line 273 of file pic24_serial.c.
uint8 inCharEcho | ( | void | ) |
Same as inChar(), except echo character that is back to console
Definition at line 301 of file pic24_serial.c.
Reads a string into psz_buff, assumes psz_buff can hold at least u16_maxCount+1 characters. String reading halts when either a newline or carriage return is read, or u16_maxCount characters is read. The return string is always null-terminated. The return count does not includes the null terminator. An input string of just '
' returns a null string.
psz_buff | pointer to buffer for storing string read from console | |
u16_maxCount | maximum number of characters to read from console. |
Definition at line 136 of file pic24_serial.c.
Same as inString(), except echoes characters to console as they are read.
Definition at line 143 of file pic24_serial.c.
uint8 isCharReady | ( | void | ) |
Determine if a character is ready to be read from the serial port.
Definition at line 312 of file pic24_serial.c.
void outChar | ( | uint8 | u8_c | ) |
Write a character to the serial port. This function blocks until a character is written. The UART used is determined by the __C30_UART variable, which defaults to 1.
u8_c | Character to write |
Definition at line 54 of file pic24_serial.c.
void outString | ( | const char * | psz_s | ) |
Write a null-terminated string to the serial port. See file documentation for End-of-line behavior when passed a "\n" (newline).
psz_s | Pointer to null-terminated string to print. |
Definition at line 86 of file pic24_serial.c.
void outUint16 | ( | uint16 | u16_x | ) |
Output u16_x as formatted hex value with leading "0x".
u16_x | value to output. |
Definition at line 172 of file pic24_serial.c.
void outUint16Decimal | ( | uint16 | u16_x | ) |
Output u16_x as decimal value.
u16_x | value to output. |
Definition at line 238 of file pic24_serial.c.
void outUint32 | ( | uint32 | u32_x | ) |
Output u32_x as formatted hex value with leading "0x".
u32_x | value to output. |
Definition at line 186 of file pic24_serial.c.
void outUint8 | ( | uint8 | u8_x | ) |
Output u8_x as formatted hex value with leading "0x".
u8_x | value to output. |
Definition at line 163 of file pic24_serial.c.
void outUint8Decimal | ( | uint8 | u8_x | ) |
Output u8_x as decimal value.
u8_x | value to output. |
Definition at line 203 of file pic24_serial.c.