TI-RTOS Drivers  tidrivers_full_2_20_00_08
Data Structures | Typedefs | Variables
UARTUSCIA.h File Reference

Detailed Description

UART driver implementation for a USCIA peripheral.

============================================================================

The UART header file should be included in an application as follows:

Refer to UART.h for a complete description of APIs & example of use.

This UART driver implementation is designed to operate on a UCSI controller in UART mode. It uses the APIs for a USCIA controller.


#include <stdint.h>
#include <stdbool.h>
#include <ti/drivers/UART.h>
#include <ti/sysbios/knl/Semaphore.h>
Include dependency graph for UARTUSCIA.h:

Go to the source code of this file.

Data Structures

struct  UARTUSCIA_BaudrateConfig
 UARTUSCIA Baudrate configuration. More...
 
struct  UARTUSCIA_HWAttrs
 UARTUSCIA Hardware attributes. More...
 
struct  UARTUSCIA_Object
 UARTUSCIA Object. More...
 

Typedefs

typedef struct UARTUSCIA_BaudrateConfig UARTUSCIA_BaudrateConfig
 UARTUSCIA Baudrate configuration. More...
 
typedef struct UARTUSCIA_HWAttrs UARTUSCIA_HWAttrs
 UARTUSCIA Hardware attributes. More...
 
typedef struct UARTUSCIA_Object UARTUSCIA_Object
 UARTUSCIA Object. More...
 
typedef struct UARTUSCIA_ObjectUARTUSCIA_Handle
 

Variables

const UART_FxnTable UARTUSCIA_fxnTable
 

Typedef Documentation

UARTUSCIA Baudrate configuration.

This structure is used to specifiy the usci controller's clock divider settings to achieve the desired baudrate given the indicated clock input frequency. Divider values can be determined by referring to the MSP430 baudrate calculator. https://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSP430BaudRateConverter/index.html

A sample structure is shown below:

1 const UARTUSCIA_BaudrateConfig uartUSCIABaudrates[] = {
2  // Baudrate, input clock (Hz), Prescalar, UCBRFx, UCBRSx, oversampling
3  {
4  .outputBaudrate = 115200,
5  .inputClockFreq = 8192000,
6  .prescalar = 4,
7  .hwRegUCBRFx = 7,
8  .hwRegUCBRSx = 0,
9  .oversampling = 1
10  },
11  {9600, 8192000, 53, 5, 0, 1},
12  {9600, 32768, 3, 0, 3, 0},
13 };

UARTUSCIA Hardware attributes.

These fields are used by driverlib APIs and therefore must be populated by driverlib macro definitions. For MSP430Ware these definitions are found in:

  • inc/hw_memmap.h
  • usci_a_uart.h

A sample structure is shown below:

1 const UARTUSCIA_BaudrateConfig uartUSCIABaudrates[] = {
2  // Baudrate, input clock (Hz), UCBRx, UCBRFx, UCBRSx, oversampling
3  {
4  .outputBaudrate = 115200,
5  .inputClockFreq = 8192000,
6  .prescalar = 4,
7  .hwRegUCBRFx = 7,
8  .hwRegUCBRSx = 0,
9  .oversampling = 1
10  },
11  {9600, 8192000, 53, 5, 0, 1},
12  {9600, 32768, 3, 0, 3, 0},
13 };
14 
15 const UARTUSCIA_HWAttrs uartUSCIAHWAttrs[] = {
16  {
17  .baseAddr = USCI_A0_BASE,
18  .clockSource = USCI_A_UART_CLOCKSOURCE_SMCLK,
19  .bitOrder = USCI_A_UART_LSB_FIRST,
20  .numBaudrateEntries = sizeof(uartUSCIABaudrates/UARTUSCIA_BaudrateConfig),
21  .baudrateLUT = uartUSCIABaudrates
22  },
23  {
24  .baseAddr = USCI_A1_BASE,
25  .clockSource = USCI_A_UART_CLOCKSOURCE_SMCLK,
26  .bitOrder = USCI_A_UART_LSB_FIRST,
27  .numBaudrateEntries = sizeof(uartUSCIABaudrates/UARTUSCIA_BaudrateConfig),
28  .baudrateLUT = uartUSCIABaudrates
29  },
30 };

UARTUSCIA Object.

Not intended to be used by the user.

Variable Documentation

const UART_FxnTable UARTUSCIA_fxnTable
Copyright 2016, Texas Instruments Incorporated