BSPACM
20150113
Board Support Package for ARM Cortex-M Microcontrollers
|
#include <bspacm/periph/uart.h>
Data Fields | |
int(* | configure )(sBSPACMperiphUARTstate *usp, const sBSPACMperiphUARTconfiguration *cfgp) |
int(* | hw_transmit )(sBSPACMperiphUARTstate *usp, uint8_t v) |
void(* | hw_txien )(sBSPACMperiphUARTstate *usp, int enablep) |
int(* | fifo_state )(sBSPACMperiphUARTstate *usp) |
The set of operations supported by UARTs.
The underlying implementation is specific to a vendor peripheral capable of acting like a UART.
int(* sBSPACMperiphUARToperations::configure) (sBSPACMperiphUARTstate *usp, const sBSPACMperiphUARTconfiguration *cfgp) |
Configure (or deconfigure) a UART.
usp | the UART peripheral state |
cfgp | if non-null, a pointer to information used to configure the peripheral. If null, a sign that the peripheral is no longer being used and should be shut down/deconfigured. |
int(* sBSPACMperiphUARToperations::fifo_state) (sBSPACMperiphUARTstate *usp) |
Determine whether there is anything pending in the device: material that has been received but not consumed by the application, or material that has been submitted for transmission but has not yet gone out over the channel.
usp | the UART abstraction being used |
int(* sBSPACMperiphUARToperations::hw_transmit) (sBSPACMperiphUARTstate *usp, uint8_t v) |
Attempt to transmit an octet by adding it to the hardware transmit FIFO.
usp | the UART abstraction being used |
v | the octet to be transmitted |
v
if the transmission was accepted by the hardware, otherwise a negative error code. void(* sBSPACMperiphUARToperations::hw_txien) (sBSPACMperiphUARTstate *usp, int enablep) |
Enable or disable the interrupt associated with UART transmission.
The management model of this implementation is that the UART transmit interrupt is enabled only when there is pending material in the software transmit fifo. Thus it is the caller's responsibility to queue data and enable the interrupt when hw_transmit fails.
Under normal circumstances the transmit interrupt is disabled within the interrupt handler when the software FIFO is emptied.
usp | the UART abstraction being used |
enablep | a non-zero value if the interrupt is to be enabled; a zero value will disable the interrupt (not a normal way to use this function). |