SimpleLink MCU SDK Driver API Reference

Table of Contents


TI-Drivers Overview

TI-Drivers is a collective of peripheral drivers for TI's SimpleLink portfolio. The drivers are centered around a portable application programming interface (API) which enables seamless migration across the SimpleLink SDK portfolio. Unless specifically stated otherwise, TI-Drivers are designed to be thread safe and work seamlessly inside of a real time operating system (RTOS) application. All TI-Driver implementations utilize the Power driver APIs to ensure low power consumption at all times. The drivers support TI-RTOS (SYS/BIOS) and NoRTOS with examples provided for each variant. Lastly, the drivers are supported by SysConfig to enable easy re-configuration of the drivers.

Features:
  • Portable APIs
  • Native support for TI-RTOS and NoRTOS usage
  • Thread safe APIs
  • SysConfig support
  • Example usage
  • Power driver support
Driver Initialization

TI-Driver APIs follow a common initialization model. This model typically consists of:

  1. Init
  2. Open
  3. Use
  4. Close

Each driver documents how to initialize, open, use, and close the driver. Unless otherwise stated, the initialization function, Driver_init, may be called multiple times by the application. It is only required that the initialization is done once. For drivers which have an open function, Driver_open, it must be called per instance of the driver to be used. Each instance of the driver corresponds to a unique index in the Driver Configuration, Driver_config. Multiple software entities may use the same driver concurrently. For example, a Bluetooth or WiFi stack may utilize a driver instance. The application may concurrently use the same driver assuming it has opened a unique instance of the driver. Let's examine the ADC driver for example.

#include <ti/drivers/ADC.h>
// Define name for ADC index
// This is an index into the ADC_config[] array
#define ADC_INSTANCE 0
// One-time init of ADC driver
// Initialize optional ADC parameters
ADC_Params_init(&params);
// Open ADC instance for usage
// Sample the analog pin
ADC_convert(adcHandle, &result);
// Convert the sample to microvolts
resultUv = ADC_convertToMicroVolts(adcHandle, result);
ADC_close(adcHandle);

A couple observations from this code example:

  1. We need to include the ADC driver header file.
  2. We define a name for our ADC instance. This definition typically comes from ti_drivers_config.h (previously Board.h) and corresponds to an index in the ADC_config array. Our definition corresponds to the zero index of this array. (See: Driver Configuration)
  3. We have to call the initialization function, ADC_init().
  4. We have to create a handle for our ADC driver instance. This is done by calling ADC_open() with our desired config index. Once a handle has been created the driver instance is ready for use. Each index can only be opened once!
  1. In this simple example, we use the ADC_convert() API.
  2. A driver instance can be closed and re-open.

For our simple example, that's all we need. However, for full details on the ADC--and other drivers, reference the Drivers and Documentation section below.


Drivers and Documentation

Shown below is a matrix of available drivers and documentation.

Note
Please view the Device Specific driver implementations as they may contain or exclude certain features that are defined in the top level interfaces.
TI-Drivers Implementations
Driver Interfaces CC13XX & CC26XX
Implementations
Module
Interfaces
Supported Device
Wildcards
ADC.h ADCCC26XX.h ADC CC13XX, CC26XX
ADCBuf.h ADCBufCC26X2.h ADC CC13X2, CC26X2, CC13X2X7, CC26X2X7, CC13X1, CC26X1, CC13X4, CC26X3, CC26X4
ADCBufCC26XX.h CC13XX, CC26XX
AESCBC.h AESCBCCC26XX.h AES CC13XX, CC26XX
AESCCM.h AESCCMCC26X2.h AESCCM CC13X2, CC26X2, CC13X2X7, CC26X2X7, CC13X1, CC26X1,
AESCCMCC26X4.h CC13X4, CC26X3, CC26X4
AESCTR.h AESCTRCC26XX.h AES CC13XX, CC26XX
AESCTRDRBG.h AESCTRDRBGXX.h AES CC13XX, CC26XX
AESECB.h AESECBCC26XX.h AES CC13XX, CC26XX
AESGCM.h AESGCMCC26X2.h AESGCM CC13X2, CC26X2, CC13X2X7, CC26X2X7
AESGCMCC26X4.h CC13X4, CC26X3, CC26X4
DAC DACCC26X2.h DAC CC13X2, CC26X2, CC13X2X7, CC26X2X7, CC13X1, CC26X1, CC13X4, CC26X3, CC26X4
DMA UDMACC26XX.h µDMA CC13XX, CC26XX
ECDH.h ECDHCC26X2.h PKA CC13X2, CC26X2, CC13X2X7, CC26X2X7 CC13X4, CC26X3, CC26X4
ECDHCC26X1.h SW CC13X1, CC26X1
ECDSA.h ECDSACC26X2.h PKA CC13X2, CC26X2, CC13X2X7, CC26X2X7,CC13X4, CC26X3, CC26X4
ECDSACC26X1.h SW CC13X1, CC26X1
ECJPAKE.h ECJPAKECC26X2.h PKA CC13X2, CC26X2, CC13X2X7, CC26X2X7, CC13X4, CC26X3, CC26X4
EDDSA.h EDDSACC26X2.h PKA CC13X2, CC26X2, CC13X2X7, CC26X2X7, CC13X4, CC26X3, CC26X4
GPIO.h GPIOCC26XX.h IOC
PINCC26XX.h
CC13XX, CC26XX
GPTimer GPTimerCC26XX.h General-Purpose Timers CC13XX, CC26XX
I2C.h I2CCC26XX.h I2C CC13XX, CC26XX
I2S.h I2SCC26XX.h I2S CC13XX, CC26XX
ITM.h ITMCC26XX.h Instrumentation Trace Macrocell CC13XX, CC26XX
NVS.h NVSCC26XX.h VIMS CC13XX, CC26XX
NVSRAM.h
NVSSPI25X.h SSI
PDM PDMCC26XX.h PDM CC13XX, CC26XX
PIN.h PINCC26XX.h IOC CC13X0, CC26X0, CC13X2, CC26X2, CC13X2X7, CC26X2X7, CC13X1, CC26X1
Power.h PowerCC26X2.h Power, Reset, and Clock Management CC13X2, CC26X2, CC13X2X7, CC26X2X7, CC13X1, CC26X1, CC13X4, CC26X3, CC26X4
PWM.h PWMTimerCC26XX.h General-Purpose Timer
GPTimerCC26XX.h
CC13XX, CC26XX
SHA2.h SHA2CC26X2.h SHA2 CC13X2, CC26X2, CC13X2X7, CC26X2X7, CC13X4, CC26X3, CC26X4
SHA2CC26X1.h SW CC13X1, CC26X1
SD.h SDSPI.h SSI
SPI.h
CC13XX, CC26XX
SPI.h SPICC26X2DMA.h SPI CC13X2, CC26X2, CC13X2X7, CC26X2X7, CC13X1, CC26X1,
SPICC26X4DMA.h CC13X4, CC26X3, CC26X4
Temperature.h TemperatureCC26X2.h Battery Monitor and
Temperature Sensor (BATMON)
CC13X2, CC26X2, CC13X2X7, CC26X2X7, CC13X1, CC26X1, CC13X4, CC26X3, CC26X4
Timer.h TimerCC26XX.h General-Purpose Timer
GPTimerCC26XX.h
CC13XX, CC26XX
TRNG.h TRNGCC26XX.h TRNG CC13XX, CC26XX
UART.h UARTCC26XX.h
UARTCC26X2.h
UART CC13XX, CC26XX
UART2.h UART2CC26X2.h UART CC13X2, CC26X2, CC13X2X7, CC26X2X7, CC13X1, CC26X1, CC13X4, CC26X3, CC26X4
Watchdog.h WatchdogCC26XX.h Watchdog Timer CC13XX, CC26XX
TI-Drivers Implementations by Device
Driver Interface CC26X0 CC26X1 CC26X2 CC26X2X7 CC26X3 CC26X4 CC13X0 CC13X1 CC13X2 CC13X2X7 CC13X4
ADC.h ADCCC26XX.h ADCCC26XX.h ADCCC26XX.h ADCCC26XX.h ADCCC26XX.h ADCCC26XX.h ADCCC26XX.h ADCCC26XX.h ADCCC26XX.h ADCCC26XX.h ADCCC26XX.h
ADCBuf.h ADCBufCC26XX.h ADCBufCC26X2.h ADCBufCC26X2.h ADCBufCC26X2.h ADCBufCC26X2.h ADCBufCC26X2.h ADCBufCC26XX.h ADCBufCC26X2.h ADCBufCC26X2.h ADCBufCC26X2.h ADCBufCC26X2.h
AESCBC.h AESCBCCC26XX.h AESCBCCC26XX.h AESCBCCC26XX.h AESCBCCC26XX.h AESCBCCC26XX.h AESCBCCC26XX.h AESCBCCC26XX.h AESCBCCC26XX.h AESCBCCC26XX.h AESCBCCC26XX.h AESCBCCC26XX.h
AESCCM.h AESCCMCC26XX.h AESCCMCC26XX.h AESCCMCC26XX.h AESCCMCC26XX.h AESCCMCC26XX.h AESCCMCC26X4.h AESCCMCC26X4.h AESCCMCC26XX.h AESCCMCC26XX.h AESCCMCC26XX.h AESCCMCC26X4.h
AESCTR.h AESCTRCC26XX.h AESCTRCC26XX.h AESCTRCC26XX.h AESCTRCC26XX.h AESCTRCC26XX.h AESCTRCC26XX.h AESCTRCC26XX.h AESCTRCC26XX.h AESCTRCC26XX.h AESCTRCC26XX.h AESCTRCC26XX.h
AESCTRDRBG.h AESCTRDRBGXX.h AESCTRDRBGXX.h AESCTRDRBGXX.h AESCTRDRBGXX.h AESCTRDRBGXX.h AESCTRDRBGXX.h AESCTRDRBGXX.h AESCTRDRBGXX.h AESCTRDRBGXX.h AESCTRDRBGXX.h AESCTRDRBGXX.h
AESECB.h AESECBCC26XX.h AESECBCC26XX.h AESECBCC26XX.h AESECBCC26XX.h AESECBCC26XX.h AESECBCC26XX.h AESECBCC26XX.h AESECBCC26XX.h AESECBCC26XX.h AESECBCC26XX.h AESECBCC26XX.h
AESGCM.h N/A N/A AESGCMCC26XX.h AESGCMCC26XX.h AESGCMCC26X4.h AESGCMCC26X4.h N/A N/A AESGCMCC26XX.h AESGCMCC26XX.h AESGCMCC26X4.h
DAC.h N/A DACCC26X2.h DACCC26X2.h DACCC26X2.h DACCC26X2.h DACCC26X2.h N/A DACCC26X2.h DACCC26X2.h DACCC26X2.h DACCC26X2.h
DMA UDMACC26XX.h UDMACC26XX.h UDMACC26XX.h UDMACC26XX.h UDMACC26XX.h UDMACC26XX.h UDMACC26XX.h UDMACC26XX.h UDMACC26XX.h UDMACC26XX.h UDMACC26XX.h
ECDH.h N/A ECDHCC26X1.h ECDHCC26X2.h ECDHCC26X2.h ECDHCC26X2.h ECDHCC26X2.h N/A ECDHCC26X1.h ECDHCC26X2.h ECDHCC26X2.h ECDHCC26X2.h
ECDSA.h N/A ECDSACC26X1.h ECDSACC26X2.h ECDSACC26X2.h ECDSACC26X2.h ECDSACC26X2.h N/A ECDSACC26X1.h ECDSACC26X2.h ECDSACC26X2.h ECDSACC26X2.h
ECJPAKE.h N/A N/A ECJPAKECC26X2.h ECJPAKECC26X2.h ECJPAKECC26X2.h ECJPAKECC26X2.h N/A N/A ECJPAKECC26X2.h ECJPAKECC26X2.h ECJPAKECC26X2.h
EDDSA.h N/A N/A EDDSACC26X2.h EDDSACC26X2.h EDDSACC26X2.h EDDSACC26X2.h N/A N/A EDDSACC26X2.h EDDSACC26X2.h EDDSACC26X2.h
GPIO.h GPIOCC26XX.h GPIOCC26XX.h GPIOCC26XX.h GPIOCC26XX.h GPIOCC26XX.h GPIOCC26XX.h GPIOCC26XX.h GPIOCC26XX.h GPIOCC26XX.h GPIOCC26XX.h GPIOCC26XX.h
GPTimer GPTimerCC26XX.h GPTimerCC26XX.h GPTimerCC26XX.h GPTimerCC26XX.h GPTimerCC26XX.h GPTimerCC26XX.h GPTimerCC26XX.h GPTimerCC26XX.h GPTimerCC26XX.h GPTimerCC26XX.h GPTimerCC26XX.h
I2C.h I2CCC26XX.h I2CCC26XX.h I2CCC26XX.h I2CCC26XX.h I2CCC26XX.h I2CCC26XX.h I2CCC26XX.h I2CCC26XX.h I2CCC26XX.h I2CCC26XX.h I2CCC26XX.h
I2S.h I2SCC26XX.h I2SCC26XX.h I2SCC26XX.h I2SCC26XX.h I2SCC26XX.h I2SCC26XX.h I2SCC26XX.h I2SCC26XX.h I2SCC26XX.h I2SCC26XX.h I2SCC26XX.h
ITM.h ITMCC26XX.h ITMCC26XX.h ITMCC26XX.h ITMCC26XX.h ITMCC26XX.h ITMCC26XX.h ITMCC26XX.h ITMCC26XX.h ITMCC26XX.h ITMCC26XX.h ITMCC26XX.h
NVS.h NVSCC26XX.h NVSCC26XX.h NVSCC26XX.h NVSCC26XX.h NVSCC26XX.h NVSCC26XX.h NVSCC26XX.h NVSCC26XX.h NVSCC26XX.h NVSCC26XX.h NVSCC26XX.h
NVSRAM.h NVSRAM.h NVSRAM.h NVSRAM.h NVSRAM.h NVSRAM.h NVSRAM.h NVSRAM.h NVSRAM.h NVSRAM.h NVSRAM.h
NVSSPI25X.h NVSSPI25X.h NVSSPI25X.h NVSSPI25X.h NVSSPI25X.h NVSSPI25X.h NVSSPI25X.h NVSSPI25X.h NVSSPI25X.h NVSSPI25X.h NVSSPI25X.h
PDM PDMCC26XX.h PDMCC26XX.h PDMCC26XX.h PDMCC26XX.h PDMCC26XX.h PDMCC26XX.h PDMCC26XX.h PDMCC26XX.h PDMCC26XX.h PDMCC26XX.h PDMCC26XX.h
PIN.h PINCC26XX.h PINCC26XX.h PINCC26XX.h PINCC26XX.h N/A N/A PINCC26XX.h PINCC26XX.h PINCC26XX.h PINCC26XX.h N/A
Power.h PowerCC26XX.h PowerCC26X2.h PowerCC26X2.h PowerCC26X2.h PowerCC26XX.h PowerCC26X2.h PowerCC26X2.h PowerCC26X2.h PowerCC26X2.h PowerCC26X2.h PowerCC26X2.h
PWM.h PWMTimerCC26XX.h PWMTimerCC26XX.h PWMTimerCC26XX.h PWMTimerCC26XX.h PWMTimerCC26XX.h PWMTimerCC26XX.h PWMTimerCC26XX.h PWMTimerCC26XX.h PWMTimerCC26XX.h PWMTimerCC26XX.h PWMTimerCC26XX.h
SHA2.h N/A SHA2CC26X1.h SHA2CC26X2.h SHA2CC26X2.h SHA2CC26X2.h SHA2CC26X2.h N/A SHA2CC26X1.h SHA2CC26X2.h SHA2CC26X2.h SHA2CC26X2.h
SD.h SDSPI.h SDSPI.h SDSPI.h SDSPI.h SDSPI.h SDSPI.h SDSPI.h SDSPI.h SDSPI.h
SPI.h SPICC26XXDMA.h SPICC26X2DMA.h SPICC26X2DMA.h SPICC26X2DMA.h SPICC26X4DMA.h SPICC26X4DMA.h SPICC26XXDMA.h SPICC26X2DMA.h SPICC26X2DMA.h SPICC26X2DMA.h SPICC26X4DMA.h
Temperature.h N/A TemperatureCC26X2.h TemperatureCC26X2.h TemperatureCC26X2.h TemperatureCC26X2.h TemperatureCC26X2.h N/A TemperatureCC26X2.h TemperatureCC26X2.h TemperatureCC26X2.h TemperatureCC26X2.h
Timer.h TimerCC26XX.h TimerCC26XX.h TimerCC26XX.h TimerCC26XX.h TimerCC26XX.h TimerCC26XX.h TimerCC26XX.h TimerCC26XX.h
TRNG.h TRNGCC26XX.h TRNGCC26XX.h TRNGCC26XX.h TRNGCC26XX.h TRNGCC26XX.h TRNGCC26XX.h TRNGCC26XX.h TRNGCC26XX.h
UART.h UARTCC26XX.h UARTCC26XX.h
UARTCC26X2.h
UARTCC26XX.h
UARTCC26X2.h
UARTCC26XX.h
UARTCC26X2.h
N/A N/A UARTCC26XX.h UARTCC26XX.h
UARTCC26X2.h
UARTCC26XX.h
UARTCC26X2.h
UARTCC26XX.h
UARTCC26X2.h
N/A
UART2.h N/A UART2CC26X2.h UART2CC26X2.h UART2CC26X2.h UART2CC26X2.h UART2CC26X2.h N/A UART2CC26X2.h UART2CC26X2.h UART2CC26X2.h UART2CC26X2.h
Watchdog.h WatchdogCC26XX.h WatchdogCC26XX.h WatchdogCC26XX.h WatchdogCC26XX.h WatchdogCC26XX.h WatchdogCC26XX.h WatchdogCC26XX.h WatchdogCC26XX.h WatchdogCC26XX.h WatchdogCC26XX.h WatchdogCC26XX.h

Display Driver

The Display driver is designed to abstract operations & considerations specific to a given output method.

Display Driver Interface Implementations
Display.h DisplayDogm1286.h
DisplayHost.h
DisplayExt.h
DisplayUart.h


Driver Apps

These helper apps utilize TI drivers and are available to user applications.

Modules Interfaces Descriptions
Button.h GPIO.h Provides an API for button-like hardware attached to device pins.
LED.h GPIO.h Provides an API for LEDs attached to device pins.
PWM.h


Driver Utilities

These utilities are helper modules available to drivers.

Module Description
List.h Double linked list
Random.h Fast and light-weight pseudo random number generator
RingBuf.h Array-based ring buffer for bytes
SDFatFS.h Wrapper to enable the use of file systems for the SD driver.
SPIFFSNVS.h Enables NVS as the physical layer to read/write memory for the SPIFFS file system


Driver Configuration

The generic driver interface defines a configuration structure using the typedef keyword. The name of this declared type follows the naming pattern <driver>_Config. A driver is configured by declaring an array of this configuration data structure. Each config array index contains pointers to other data objects necessary for the driver to function at runtime. These data objects may include a hardware attributes, a function table, and object memory. Multiple indexes of the config array should not share these data objects--with the exception of the function table. Each index of the config array supports an independent instance of the driver.

Warning
The declared array, <driver>_Config, must have a specific C identifier. This identifies follows the case-sensitive pattern <driver>_config.
The configuration must also contain a count of indexes in the <driver>_config. This must also have a specific C identifier following the case-sensitive pattern <driver>_count. The data type must be a uint_least8_t.

The driver interface is joined together during the link process at build time. The <driver>_config and <driver>_count symbols are resolved.


Driver Configuration Files

The driver configuration files contain all driver configurations needed by TI-Drivers at runtime. The SysConfig tool is used to automatically generate the TI-Driver's configuration files. Two files are presently generated for TI-Drivers:


Driver Objects

The driver objects are device specific structures that hold data for an instance of a driver. The driver objects are used exclusively by the driver and should never be accessed by the application. Device specific drivers define an object structure as a new type using the typedef keyword. Each index in a driver's configuration will contain a pointer to a driver object.


Driver Hardware Attributes

The hardware attributes, also commonly referred to as HWAttrs, are device specific settings that typically do not change during runtime operation of a driver. The hardware attributes also aid in abstracting the generic driver interface from the device specific hardware. Device specific drivers define a hardware attribute structure as a new type using the typedef keyword. Each index in a driver's configuration will contain a pointer to a hardware attribute structure.


Driver Function Table

The function pointer table is a structure simply containing pointers to functions. Each index in a driver's configuration will contain a pointer to a function pointer table. The TI-Driver's interface uses function pointers to abstract a generic driver from a device specific driver. Each device specific driver declares a default function pointer table which may be referenced by default in the driver's configuration.


NoRTOS Framework Module

The NoRTOS framework module is provided to enable use of drivers without an underlying operating system. The module provides interfaces used by drivers to perform delays, block execution, register interrupts and more.

© Copyright 1995-2022, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale