PIC24 Support Libraries
|
Go to the source code of this file.
Functions | |
static int16_t | stdioOpen (void) |
int _LIBC_FUNCTION | open (const char *name, int access, int mode) |
int _LIBC_FUNCTION | read (int handle, void *buffer, unsigned int len) |
int _LIBC_FUNCTION | write (int handle, void *buffer, unsigned int len) |
int _LIBC_FUNCTION | close (int handle) |
long _LIBC_FUNCTION | lseek (int handle, long offset, int origin) |
STDIO UART support functions
Definition in file pic24_stdio_uart.c.
int _LIBC_FUNCTION close | ( | int | handle | ) |
Stub required by fclose().
handle | not used. |
Definition at line 369 of file pic24_stdio_uart.c.
long _LIBC_FUNCTION lseek | ( | int | handle, |
long | offset, | ||
int | origin | ||
) |
Stub required by rewind() and fseek().
handle | not used. |
offset | not used. |
origin | not used. |
Definition at line 382 of file pic24_stdio_uart.c.
int _LIBC_FUNCTION open | ( | const char * | name, |
int | access, | ||
int | mode | ||
) |
Initiate I/O on UART specified by name
name | of file (UART) to open. Limited to "stdin", "stdout", "stderr", "uart1", "uart2", "uart3", and "uart4". UART number specified by __C30_UART is reserved and can only be opened as stdin, stdout, and stderr. |
access | is a bit field. Default, 0x0, is for binary read. Set it to include 0x4000 for character translation mode: input - possible break on '\r' and '\n' - See SERIAL_BREAK_NL and SERIAL_BREAK_CR. output - possible substitutions for '\n' - See SERIAL_EOL_CR and SERIAL_EOL_CR_LF. If desired, OR it with 0x1 for write, or 0x2 for read and write. |
mode | not used |
Definition at line 215 of file pic24_stdio_uart.c.
int _LIBC_FUNCTION read | ( | int | handle, |
void * | buffer, | ||
unsigned int | len | ||
) |
Input len characters from UART specified for handle to buffer. Uses mode specified via open(). If handle is for stdin, calls open() with character translation read access as needed.
handle | specifies UART to read from. |
buffer | storage for read characters. |
len | maximum number of characters to read. |
Definition at line 295 of file pic24_stdio_uart.c.
|
static |
Check __C30_UART for the UART to use. If set to 1, for example, then set up stdin, stdout, and stderr for UART1 and call configUART1() if not currently enabled.
Definition at line 143 of file pic24_stdio_uart.c.
Referenced by open().
int _LIBC_FUNCTION write | ( | int | handle, |
void * | buffer, | ||
unsigned int | len | ||
) |
Output len characters from buffer to UART specified for handle. Uses mode specified via open(). If handle is for stdout or stderr, calls open() with character translation write access as needed.
handle | specifies UART to write to. |
buffer | contains characters to write. |
len | number of characters to write. |
Definition at line 333 of file pic24_stdio_uart.c.