EasyManua.ls Logo

Texas Instruments CC3235 SimpleLink Series - Ulchannel Tags; 13.5 Initialization and Configuration; 13.6 Peripheral Library Apis for ADC Operation

Texas Instruments CC3235 SimpleLink Series
799 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
www.ti.com
Initialization and Configuration
479
SWRU543–January 2019
Submit Documentation Feedback
Copyright © 2019, Texas Instruments Incorporated
Analog-to-Digital Converter (ADC)
13.5 Initialization and Configuration
This section provides a pseudocode for the host initialization and configuration example, of the ADC
channels.
1. Set the pin type as ADC for the required pin.
PinTypeADC(PIN_58, 0xFF)
2. Enable the ADC channel ADCChannel.
Enable(ADC_BASE, ADC_CH_1)
3. Optionally configure internal timer for time-stamping.
ADCTimerConfig(ADC_BASE, 2^17)
ADCTimerEnable(ADC_BASE)
4. Enable the ADC module.
ADCEnable(ADC_BASE)
5. Read out the ADC samples using the code that follows:
if( ADCFIFOLvlGet(ADC_BASE, ADC_CH_1) )
{
ulSample = ADCFIFORead(ADC_BASE, ADC_CH_1)
}
13.6 Peripheral Library APIs for ADC Operation
13.6.1 Overview
Four out of the eight channels of the ADC in the CC32xx are used internally for the SimpleLink subsystem
(NWP and Wi-Fi). TI encourages applications to access the four external ADC channels through the
peripheral library APIs. These APIs have been designed for optimal ADC operation of the four ADC
channels available to the user, along with the internal ADC channels used for internal functionality of the
device. In this section, the emphasis is on understanding the ADC APIs provided in the CC32xx Software
Development Kit (Peripheral Library). This section lists the software APIs hosted in CC32xx SDK
(Peripheral Library) that can be used by the user for easy access to ADC operation.
13.6.2 Configuring the ADC Channels
Configuration options for the application developer include:
• Enable the channel of interest (assuming the user has programmed the appropriate pins as mentioned
in the device data sheet). Most importantly, the device pin is configured as an analog pin.
• Data transfer – CPU (FIFO Level Check and FIFO Read) or DMA
• Set up interrupts.
• Set up timer for time-stamping samples.
Table 13-24 and Table 13-25 serve as references for values used for ulChannel and ulIntFlags,
respectively.
Table 13-24. ulChannel Tags
Tag Value
ADC_CH_0 0x00000000
ADC_CH_1 0x00000008
ADC_CH_2 0x00000010
ADC_CH_3 0x00000018

Table of Contents