CC3200 Peripheral Driver Library User's Guide
1.2.0
|
Functions | |
void | UARTParityModeSet (unsigned long ulBase, unsigned long ulParity) |
unsigned long | UARTParityModeGet (unsigned long ulBase) |
void | UARTFIFOLevelSet (unsigned long ulBase, unsigned long ulTxLevel, unsigned long ulRxLevel) |
void | UARTFIFOLevelGet (unsigned long ulBase, unsigned long *pulTxLevel, unsigned long *pulRxLevel) |
void | UARTConfigSetExpClk (unsigned long ulBase, unsigned long ulUARTClk, unsigned long ulBaud, unsigned long ulConfig) |
void | UARTConfigGetExpClk (unsigned long ulBase, unsigned long ulUARTClk, unsigned long *pulBaud, unsigned long *pulConfig) |
void | UARTEnable (unsigned long ulBase) |
void | UARTDisable (unsigned long ulBase) |
void | UARTFIFOEnable (unsigned long ulBase) |
void | UARTFIFODisable (unsigned long ulBase) |
void | UARTModemControlSet (unsigned long ulBase, unsigned long ulControl) |
void | UARTModemControlClear (unsigned long ulBase, unsigned long ulControl) |
unsigned long | UARTModemControlGet (unsigned long ulBase) |
unsigned long | UARTModemStatusGet (unsigned long ulBase) |
void | UARTFlowControlSet (unsigned long ulBase, unsigned long ulMode) |
unsigned long | UARTFlowControlGet (unsigned long ulBase) |
void | UARTTxIntModeSet (unsigned long ulBase, unsigned long ulMode) |
unsigned long | UARTTxIntModeGet (unsigned long ulBase) |
tBoolean | UARTCharsAvail (unsigned long ulBase) |
tBoolean | UARTSpaceAvail (unsigned long ulBase) |
long | UARTCharGetNonBlocking (unsigned long ulBase) |
long | UARTCharGet (unsigned long ulBase) |
tBoolean | UARTCharPutNonBlocking (unsigned long ulBase, unsigned char ucData) |
void | UARTCharPut (unsigned long ulBase, unsigned char ucData) |
void | UARTBreakCtl (unsigned long ulBase, tBoolean bBreakState) |
tBoolean | UARTBusy (unsigned long ulBase) |
void | UARTIntRegister (unsigned long ulBase, void(*pfnHandler)(void)) |
void | UARTIntUnregister (unsigned long ulBase) |
void | UARTIntEnable (unsigned long ulBase, unsigned long ulIntFlags) |
void | UARTIntDisable (unsigned long ulBase, unsigned long ulIntFlags) |
unsigned long | UARTIntStatus (unsigned long ulBase, tBoolean bMasked) |
void | UARTIntClear (unsigned long ulBase, unsigned long ulIntFlags) |
void | UARTDMAEnable (unsigned long ulBase, unsigned long ulDMAFlags) |
void | UARTDMADisable (unsigned long ulBase, unsigned long ulDMAFlags) |
unsigned long | UARTRxErrorGet (unsigned long ulBase) |
void | UARTRxErrorClear (unsigned long ulBase) |
void UARTBreakCtl | ( | unsigned long | ulBase, |
tBoolean | bBreakState | ||
) |
Causes a BREAK to be sent.
ulBase | is the base address of the UART port. |
bBreakState | controls the output level. |
Calling this function with bBreakState set to true asserts a break condition on the UART. Calling this function with bBreakState set to false removes the break condition. For proper transmission of a break command, the break must be asserted for at least two complete frames.
tBoolean UARTBusy | ( | unsigned long | ulBase | ) |
Determines whether the UART transmitter is busy or not.
ulBase | is the base address of the UART port. |
Allows the caller to determine whether all transmitted bytes have cleared the transmitter hardware. If false is returned, the transmit FIFO is empty and all bits of the last transmitted character, including all stop bits, have left the hardware shift register.
long UARTCharGet | ( | unsigned long | ulBase | ) |
Waits for a character from the specified port.
ulBase | is the base address of the UART port. |
This function gets a character from the receive FIFO for the specified port. If there are no characters available, this function waits until a character is received before returning.
long UARTCharGetNonBlocking | ( | unsigned long | ulBase | ) |
Receives a character from the specified port.
ulBase | is the base address of the UART port. |
This function gets a character from the receive FIFO for the specified port.
void UARTCharPut | ( | unsigned long | ulBase, |
unsigned char | ucData | ||
) |
Waits to send a character from the specified port.
ulBase | is the base address of the UART port. |
ucData | is the character to be transmitted. |
This function sends the character ucData to the transmit FIFO for the specified port. If there is no space available in the transmit FIFO, this function waits until there is space available before returning.
tBoolean UARTCharPutNonBlocking | ( | unsigned long | ulBase, |
unsigned char | ucData | ||
) |
Sends a character to the specified port.
ulBase | is the base address of the UART port. |
ucData | is the character to be transmitted. |
This function writes the character ucData to the transmit FIFO for the specified port. This function does not block, so if there is no space available, then a false is returned, and the application must retry the function later.
tBoolean UARTCharsAvail | ( | unsigned long | ulBase | ) |
Determines if there are any characters in the receive FIFO.
ulBase | is the base address of the UART port. |
This function returns a flag indicating whether or not there is data available in the receive FIFO.
void UARTConfigGetExpClk | ( | unsigned long | ulBase, |
unsigned long | ulUARTClk, | ||
unsigned long * | pulBaud, | ||
unsigned long * | pulConfig | ||
) |
Gets the current configuration of a UART.
ulBase | is the base address of the UART port. |
ulUARTClk | is the rate of the clock supplied to the UART module. |
pulBaud | is a pointer to storage for the baud rate. |
pulConfig | is a pointer to storage for the data format. |
The baud rate and data format for the UART is determined, given an explicitly provided peripheral clock (hence the ExpClk suffix). The returned baud rate is the actual baud rate; it may not be the exact baud rate requested or an ``official'' baud rate. The data format returned in pulConfig is enumerated the same as the ulConfig parameter of UARTConfigSetExpClk().
The peripheral clock is the same as the processor clock. The frequency of the system clock is the value returned by SysCtlClockGet(), or it can be explicitly hard coded if it is constant and known (to save the code/execution overhead of a call to SysCtlClockGet()).
void UARTConfigSetExpClk | ( | unsigned long | ulBase, |
unsigned long | ulUARTClk, | ||
unsigned long | ulBaud, | ||
unsigned long | ulConfig | ||
) |
Sets the configuration of a UART.
ulBase | is the base address of the UART port. |
ulUARTClk | is the rate of the clock supplied to the UART module. |
ulBaud | is the desired baud rate. |
ulConfig | is the data format for the port (number of data bits, number of stop bits, and parity). |
This function configures the UART for operation in the specified data format. The baud rate is provided in the ulBaud parameter and the data format in the ulConfig parameter.
The ulConfig parameter is the logical OR of three values: the number of data bits, the number of stop bits, and the parity. UART_CONFIG_WLEN_8, UART_CONFIG_WLEN_7, UART_CONFIG_WLEN_6, and UART_CONFIG_WLEN_5 select from eight to five data bits per byte (respectively). UART_CONFIG_STOP_ONE and UART_CONFIG_STOP_TWO select one or two stop bits (respectively). UART_CONFIG_PAR_NONE, UART_CONFIG_PAR_EVEN, UART_CONFIG_PAR_ODD, UART_CONFIG_PAR_ONE, and UART_CONFIG_PAR_ZERO select the parity mode (no parity bit, even parity bit, odd parity bit, parity bit always one, and parity bit always zero, respectively).
The peripheral clock is the same as the processor clock. The frequency of the system clock is the value returned by SysCtlClockGet(), or it can be explicitly hard coded if it is constant and known (to save the code/execution overhead of a call to SysCtlClockGet()).
void UARTDisable | ( | unsigned long | ulBase | ) |
Disables transmitting and receiving.
ulBase | is the base address of the UART port. |
This function clears the UARTEN, TXE, and RXE bits, waits for the end of transmission of the current character, and flushes the transmit FIFO.
void UARTDMADisable | ( | unsigned long | ulBase, |
unsigned long | ulDMAFlags | ||
) |
Disable UART DMA operation.
ulBase | is the base address of the UART port. |
ulDMAFlags | is a bit mask of the DMA features to disable. |
This function is used to disable UART DMA features that were enabled by UARTDMAEnable(). The specified UART DMA features are disabled. The ulDMAFlags parameter is the logical OR of any of the following values:
void UARTDMAEnable | ( | unsigned long | ulBase, |
unsigned long | ulDMAFlags | ||
) |
Enable UART DMA operation.
ulBase | is the base address of the UART port. |
ulDMAFlags | is a bit mask of the DMA features to enable. |
The specified UART DMA features are enabled. The UART can be configured to use DMA for transmit or receive, and to disable receive if an error occurs. The ulDMAFlags parameter is the logical OR of any of the following values:
void UARTEnable | ( | unsigned long | ulBase | ) |
Enables transmitting and receiving.
ulBase | is the base address of the UART port. |
This function sets the UARTEN, TXE, and RXE bits, and enables the transmit and receive FIFOs.
void UARTFIFODisable | ( | unsigned long | ulBase | ) |
Disables the transmit and receive FIFOs.
ulBase | is the base address of the UART port. |
This functions disables the transmit and receive FIFOs in the UART.
void UARTFIFOEnable | ( | unsigned long | ulBase | ) |
Enables the transmit and receive FIFOs.
ulBase | is the base address of the UART port. |
This functions enables the transmit and receive FIFOs in the UART.
void UARTFIFOLevelGet | ( | unsigned long | ulBase, |
unsigned long * | pulTxLevel, | ||
unsigned long * | pulRxLevel | ||
) |
Gets the FIFO level at which interrupts are generated.
ulBase | is the base address of the UART port. |
pulTxLevel | is a pointer to storage for the transmit FIFO level, returned as one of UART_FIFO_TX1_8, UART_FIFO_TX2_8, UART_FIFO_TX4_8, UART_FIFO_TX6_8, or UART_FIFO_TX7_8. |
pulRxLevel | is a pointer to storage for the receive FIFO level, returned as one of UART_FIFO_RX1_8, UART_FIFO_RX2_8, UART_FIFO_RX4_8, UART_FIFO_RX6_8, or UART_FIFO_RX7_8. |
This function gets the FIFO level at which transmit and receive interrupts are generated.
void UARTFIFOLevelSet | ( | unsigned long | ulBase, |
unsigned long | ulTxLevel, | ||
unsigned long | ulRxLevel | ||
) |
Sets the FIFO level at which interrupts are generated.
ulBase | is the base address of the UART port. |
ulTxLevel | is the transmit FIFO interrupt level, specified as one of UART_FIFO_TX1_8, UART_FIFO_TX2_8, UART_FIFO_TX4_8, UART_FIFO_TX6_8, or UART_FIFO_TX7_8. |
ulRxLevel | is the receive FIFO interrupt level, specified as one of UART_FIFO_RX1_8, UART_FIFO_RX2_8, UART_FIFO_RX4_8, UART_FIFO_RX6_8, or UART_FIFO_RX7_8. |
This function sets the FIFO level at which transmit and receive interrupts are generated.
unsigned long UARTFlowControlGet | ( | unsigned long | ulBase | ) |
Returns the UART hardware flow control mode currently in use.
ulBase | is the base address of the UART port. |
This function returns the current hardware flow control mode.
void UARTFlowControlSet | ( | unsigned long | ulBase, |
unsigned long | ulMode | ||
) |
Sets the UART hardware flow control mode to be used.
ulBase | is the base address of the UART port. |
ulMode | indicates the flow control modes to be used. This parameter is a logical OR combination of values UART_FLOWCONTROL_TX and UART_FLOWCONTROL_RX to enable hardware transmit (CTS) and receive (RTS) flow control or UART_FLOWCONTROL_NONE to disable hardware flow control. |
This function sets the required hardware flow control modes. If ulMode contains flag UART_FLOWCONTROL_TX, data is only transmitted if the incoming CTS signal is asserted. If ulMode contains flag UART_FLOWCONTROL_RX, the RTS output is controlled by the hardware and is asserted only when there is space available in the receive FIFO. If no hardware flow control is required, UART_FLOWCONTROL_NONE should be passed.
void UARTIntClear | ( | unsigned long | ulBase, |
unsigned long | ulIntFlags | ||
) |
Clears UART interrupt sources.
ulBase | is the base address of the UART port. |
ulIntFlags | is a bit mask of the interrupt sources to be cleared. |
The specified UART interrupt sources are cleared, so that they no longer assert. This function must be called in the interrupt handler to keep the interrupt from being recognized again immediately upon exit.
The ulIntFlags parameter has the same definition as the ulIntFlags parameter to UARTIntEnable().
void UARTIntDisable | ( | unsigned long | ulBase, |
unsigned long | ulIntFlags | ||
) |
Disables individual UART interrupt sources.
ulBase | is the base address of the UART port. |
ulIntFlags | is the bit mask of the interrupt sources to be disabled. |
This function disables the indicated UART interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.
The ulIntFlags parameter has the same definition as the ulIntFlags parameter to UARTIntEnable().
void UARTIntEnable | ( | unsigned long | ulBase, |
unsigned long | ulIntFlags | ||
) |
Enables individual UART interrupt sources.
ulBase | is the base address of the UART port. |
ulIntFlags | is the bit mask of the interrupt sources to be enabled. |
This function enables the indicated UART interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.
The ulIntFlags parameter is the logical OR of any of the following:
void UARTIntRegister | ( | unsigned long | ulBase, |
void(*)(void) | pfnHandler | ||
) |
Registers an interrupt handler for a UART interrupt.
ulBase | is the base address of the UART port. |
pfnHandler | is a pointer to the function to be called when the UART interrupt occurs. |
This function does the actual registering of the interrupt handler. This function enables the global interrupt in the interrupt controller; specific UART interrupts must be enabled via UARTIntEnable(). It is the interrupt handler's responsibility to clear the interrupt source.
unsigned long UARTIntStatus | ( | unsigned long | ulBase, |
tBoolean | bMasked | ||
) |
Gets the current interrupt status.
ulBase | is the base address of the UART port. |
bMasked | is false if the raw interrupt status is required and true if the masked interrupt status is required. |
This function returns the interrupt status for the specified UART. Either the raw interrupt status or the status of interrupts that are allowed to reflect to the processor can be returned.
void UARTIntUnregister | ( | unsigned long | ulBase | ) |
Unregisters an interrupt handler for a UART interrupt.
ulBase | is the base address of the UART port. |
This function does the actual unregistering of the interrupt handler. It clears the handler to be called when a UART interrupt occurs. This function also masks off the interrupt in the interrupt controller so that the interrupt handler no longer is called.
void UARTModemControlClear | ( | unsigned long | ulBase, |
unsigned long | ulControl | ||
) |
Clears the states of the RTS modem control signals.
ulBase | is the base address of the UART port. |
ulControl | is a bit-mapped flag indicating which modem control bits should be set. |
This function clears the states of the RTS modem handshake outputs from the UART.
The ulControl parameter is the logical OR of any of the following:
unsigned long UARTModemControlGet | ( | unsigned long | ulBase | ) |
Gets the states of the RTS modem control signals.
ulBase | is the base address of the UART port. |
This function returns the current states of each of the UART modem control signal, RTS.
void UARTModemControlSet | ( | unsigned long | ulBase, |
unsigned long | ulControl | ||
) |
Sets the states of the RTS modem control signals.
ulBase | is the base address of the UART port. |
ulControl | is a bit-mapped flag indicating which modem control bits should be set. |
This function sets the states of the RTS modem handshake outputs from the UART.
The ulControl parameter is the logical OR of any of the following:
unsigned long UARTModemStatusGet | ( | unsigned long | ulBase | ) |
Gets the states of the CTS modem status signal.
ulBase | is the base address of the UART port. |
This function returns the current states of the UART modem status signal, CTS.
unsigned long UARTParityModeGet | ( | unsigned long | ulBase | ) |
Gets the type of parity currently being used.
ulBase | is the base address of the UART port. |
This function gets the type of parity used for transmitting data and expected when receiving data.
void UARTParityModeSet | ( | unsigned long | ulBase, |
unsigned long | ulParity | ||
) |
Sets the type of parity.
ulBase | is the base address of the UART port. |
ulParity | specifies the type of parity to use. |
This function sets the type of parity to use for transmitting and expect when receiving. The ulParity parameter must be one of UART_CONFIG_PAR_NONE, UART_CONFIG_PAR_EVEN, UART_CONFIG_PAR_ODD, UART_CONFIG_PAR_ONE, or UART_CONFIG_PAR_ZERO. The last two allow direct control of the parity bit; it is always either one or zero based on the mode.
void UARTRxErrorClear | ( | unsigned long | ulBase | ) |
Clears all reported receiver errors.
ulBase | is the base address of the UART port. |
This function is used to clear all receiver error conditions reported via UARTRxErrorGet(). If using the overrun, framing error, parity error or break interrupts, this function must be called after clearing the interrupt to ensure that later errors of the same type trigger another interrupt.
unsigned long UARTRxErrorGet | ( | unsigned long | ulBase | ) |
Gets current receiver errors.
ulBase | is the base address of the UART port. |
This function returns the current state of each of the 4 receiver error sources. The returned errors are equivalent to the four error bits returned via the previous call to UARTCharGet() or UARTCharGetNonBlocking() with the exception that the overrun error is set immediately the overrun occurs rather than when a character is next read.
tBoolean UARTSpaceAvail | ( | unsigned long | ulBase | ) |
Determines if there is any space in the transmit FIFO.
ulBase | is the base address of the UART port. |
This function returns a flag indicating whether or not there is space available in the transmit FIFO.
unsigned long UARTTxIntModeGet | ( | unsigned long | ulBase | ) |
Returns the current operating mode for the UART transmit interrupt.
ulBase | is the base address of the UART port. |
This function returns the current operating mode for the UART transmit interrupt. The return value is UART_TXINT_MODE_EOT if the transmit interrupt is currently set to be asserted once the transmitter is completely idle - the transmit FIFO is empty and all bits, including any stop bits, have cleared the transmitter. The return value is UART_TXINT_MODE_FIFO if the interrupt is set to be asserted based upon the level of the transmit FIFO.
void UARTTxIntModeSet | ( | unsigned long | ulBase, |
unsigned long | ulMode | ||
) |
Sets the operating mode for the UART transmit interrupt.
ulBase | is the base address of the UART port. |
ulMode | is the operating mode for the transmit interrupt. It may be UART_TXINT_MODE_EOT to trigger interrupts when the transmitter is idle or UART_TXINT_MODE_FIFO to trigger based on the current transmit FIFO level. |
This function allows the mode of the UART transmit interrupt to be set. By default, the transmit interrupt is asserted when the FIFO level falls past a threshold set via a call to UARTFIFOLevelSet(). Alternatively, if this function is called with ulMode set to UART_TXINT_MODE_EOT, the transmit interrupt is asserted once the transmitter is completely idle - the transmit FIFO is empty and all bits, including any stop bits, have cleared the transmitter.