BSPACM
20150113
Board Support Package for ARM Cortex-M Microcontrollers
|
File-descriptor capabilities associated with UART/CONSOLE peripherals. More...
Go to the source code of this file.
Functions | |
hBSPACMnewlibFDOPSfile | hBSPACMnewlibFDOPSdriverUARTbind (hBSPACMperiphUART usp) |
sBSPACMnewlibFDOPSfile * | fBSPACMnewlibFDOPSdriverCONSOLE (const char *pathname, int flags) |
Variables | |
const sBSPACMperiphUARTconfiguration | xBSPACMnewlibFDOPSconsoleConfiguration |
File-descriptor capabilities associated with UART/CONSOLE peripherals.
sBSPACMnewlibFDOPSfile* fBSPACMnewlibFDOPSdriverCONSOLE | ( | const char * | pathname, |
int | flags | ||
) |
A driver function to support /dev/console
as a UART.
The UART will be configured at a peripheral-specific speed. This should be 115200 8N1 for most UARTs, but if a low-speed peripheral is selected it may be 9600 8N1.
This should be placed into xBSPACMnewlibFDOPSdriver if the BSPACM board default UART is to be recognized as the console device for stdin/stdout/stderr.
Because there is only one console device, but it may need to be referenced by multiple descriptors, the returned structure is reference counted. The associated UART is deconfigured and the structure released only when no descriptors still reference it.
If the console device was already bound to a non-console descriptor through hBSPACMnewlibFDOPSdriverUARTbind(), the call will fail with errno
set to EBUSY
.
pathname | the path that was passed to open(). This function returns a null pointer if pathname is not equal to "/dev/console" . |
flags | ignored |
hBSPACMnewlibFDOPSfile hBSPACMnewlibFDOPSdriverUARTbind | ( | hBSPACMperiphUART | usp | ) |
Utility function to bind a UART peripheral to file descriptor state.
This function allocates a file descriptor state object, assigns usp
into its dev field, and assigning the standard UART operations table.
usp
refers to the default console device, and that device is already open, the call will fail with errno
set to EBUSY. Similarly, successfully binding the default console device through this API will prevent fBSPACMnewlibFDOPSdriverCONSOLE() from succeeding.usp | a pointer to a UART peripheral. The peripheral is not configured by this function. (The peripheral is deconfigured by the implementation of close() in the operations table assigned by this function. |
const sBSPACMperiphUARTconfiguration xBSPACMnewlibFDOPSconsoleConfiguration |
The configuration that will be used by the console driver.