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

Detailed Description

UART driver implementation for a EUSCIA 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 EUSCI controller in UART mode. It uses the APIs for a EUSCIA controller.


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

Go to the source code of this file.

Data Structures

struct  UARTEUSCIA_BaudrateConfig
 UARTEUSCIA Baudrate configuration. More...
 
struct  UARTEUSCIA_HWAttrs
 UARTEUSCIA Hardware attributes. More...
 
struct  UARTEUSCIA_Object
 UARTEUSCIA Object. More...
 

Typedefs

typedef struct UARTEUSCIA_BaudrateConfig UARTEUSCIA_BaudrateConfig
 UARTEUSCIA Baudrate configuration. More...
 
typedef struct UARTEUSCIA_HWAttrs UARTEUSCIA_HWAttrs
 UARTEUSCIA Hardware attributes. More...
 
typedef struct UARTEUSCIA_Object UARTEUSCIA_Object
 UARTEUSCIA Object. More...
 
typedef struct UARTEUSCIA_ObjectUARTEUSCIA_Handle
 

Variables

const UART_FxnTable UARTEUSCIA_fxnTable
 

Typedef Documentation

UARTEUSCIA Baudrate configuration.

This structure is used to specifiy the eusci 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 UARTEUSCIA_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 };

UARTEUSCIA 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 UARTEUSCIA_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 UARTEUSCIA_HWAttrs uartUSCIAHWAttrs[] = {
16  {
17  .baseAddr = EUSCI_A0_BASE,
18  .clockSource = EUSCI_A_UART_CLOCKSOURCE_SMCLK,
19  .bitOrder = EUSCI_A_UART_LSB_FIRST,
20  .numBaudrateEntries = sizeof(uartUSCIABaudrates/UARTEUSCIA_BaudrateConfig),
21  .baudrateLUT = uartUSCIABaudrates
22  },
23  {
24  .baseAddr = EUSCI_A1_BASE,
25  .clockSource = EUSCI_A_UART_CLOCKSOURCE_SMCLK,
26  .bitOrder = EUSCI_A_UART_LSB_FIRST,
27  .numBaudrateEntries = sizeof(uartUSCIABaudrates/UARTEUSCIA_BaudrateConfig),
28  .baudrateLUT = uartUSCIABaudrates
29  },
30 };

UARTEUSCIA Object.

Not intended to be used by the user.

Variable Documentation

const UART_FxnTable UARTEUSCIA_fxnTable
Copyright 2016, Texas Instruments Incorporated