SBAA288A July   2018  – January 2019 ADS7142

 

  1.   TM4C1294 interface to ADS7142 software library
    1.     Trademarks
    2. 1 Introduction
    3. 2 Hardware
    4. 3 Software
      1. 3.1 Header Files
      2. 3.2 ADS7142 Device Functional Modes Overview
      3. 3.3 Software Functions
    5. 4 Using the Software
      1. 4.1 Prerequisites
      2. 4.2 Getting Started
      3. 4.3 Using the Library
    6. 5 Main Routines and Test Data
      1. 5.1 Manual Mode
      2. 5.2 Autonomous Mode With Pre-Alert
      3. 5.3 Autonomous Mode With Post-Alert
      4. 5.4 Autonomous Mode With Start Burst Data
      5. 5.5 Autonomous Mode With Stop Burst Data
      6. 5.6 High Precision Mode
    7. 6 References
  2.   Revision History

Header Files

To aid in interfacing the ADS7142 device, TI has produced a source code library that eliminates the need to write low-level interface functions that configure the core of the TM4C1294NCPDT. This library provides a boost in the development of a TM4C/ADS7142-based product, saving time and quickly progressing an applications project. This library is designed to be used with any TM4C device after appropriate software changes. An I2C master can be implemented using one of ten modules within the TM4C1294. The library provides a number of header files that define digital masks to access each piece of hardware on the device.

The library has been implemented so that digital masks are interchangeable. If a piece of hardware must be accessed, simply find the correct global variable name for that mask and place that name as an argument in the desired function calls. The software designer must then be thorough in replacing all instances of these masks to reflect the desired access to a certain piece of hardware. There are header files specific to each of the hardware components.

Table 1 describes the hardware definition header files.

Table 1. Hardware Definition Files

Filename Description
hw_i2c.h This file contains macros used specifically to access the TM4C master and slave hardware, including register locations and commonly used masks for use with these registers.
hw_memmap.h This file contains definitions specific to the TM4C device. Primarily, the port and pin masks used to access all of the device peripherals. Definitions for UART0-UART7, I2C0-I2C9, TIMER, and GPIO are included among others.
hw_types.h This file contains helper macros for determining silicon revisions for TM4C devices. These macros are used by the driver library at run-time to create necessary conditional blocks that allow a single version of the Driverlib binary code to support multiple (all) Tiva silicon revisions.
hw_ints.h This file contains the interrupt assignments on TIVA C series devices. Class interrupts and fault interrupts are included for user enable in firmware.
hw_gpio.h This file contains the definitions and macros for the GPIO hardware. A set of register offset masks define the GPIO capabilities and features.
ADS7142RegisterMap.h This file contains all of the register masks and value masks to interface and configure the ADS7142 using the host MCU. This file contains all of the command opcodes and function declarations used to develop the device functional modes main routines.

Hardware definition files are important for defining hardware attributes and mapping them to callable system variables in software. In order to enable communication with the target MCU, driver files must be implemented. Table 2 describes the driver library files to be used for communication with the TM4C1294.

Table 2. Driver Library Files

Filename Description
gpio.h This file contains values that can be passed to application programming interfaces (APIs) that configure the GPIO modules.
i2c.h This file contains important I2C Master Command masks used to perform I2C transmission and receive. It also contains macros and APIs for advanced I2C module features on the host MCU.
pin_map.h This driver file contains the mapping of peripherals to pins for all the TIVA C series parts.
sysctl.h This file contains system control directives for selection of clocks/pll and crystal frequencies as well as values to be used with control APIs. API prototypes for system control are also included in this file.
i2c.c Driver file for the I2C block. Contains low-level functions that allow the user to configure the I2C modules on the core of the host device.