ADCBuf driver implementation for a MSP432E4 analog-to-digital converter.
============================================================================
The ADCBuf header file should be included in an application as follows:
Refer to ADCBuf.h for a complete description of APIs & example use.
#include <stdint.h>
#include <stdbool.h>
#include <ti/drivers/ADCBuf.h>
#include <ti/drivers/dpl/HwiP.h>
#include <ti/drivers/dpl/SemaphoreP.h>
#include <ti/drivers/dma/UDMAMSP432E4.h>
#include <ti/devices/msp432e4/driverlib/adc.h>
Go to the source code of this file.
Data Structures | |
struct | ADCBufMSP432E4_ParamsExtension |
MSP432E4 specfic extension to ADCBuf_Params. More... | |
struct | ADCBufMSP432E4_Channels |
ADCBufMSP432E4 Channel setting These fields define channel-specific settings: GPIO, reference voltage, temperature mode, etc. These settings happen when ADCBuf_convert() is called. More... | |
struct | ADCBufMSP432E4_HWAttrsV1 |
ADCBufMSP432E4 Hardware attributes These fields are populated by PinMux tool but user is allowed to change for different channels setting. More... | |
struct | ADCBufMSP432E4_Object |
ADCBufMSP432E4 Object. More... | |
struct | ADCBufMSP432E4_TimerSettings |
Macros | |
#define | ADCBufMSP432E4_PB_4_A10 ((10 << 16) | 0x5910) /* ch 10, port B, pin 4 */ |
#define | ADCBufMSP432E4_PB_5_A11 ((11 << 16) | 0x5920) /* ch 11, port B, pin 5 */ |
#define | ADCBufMSP432E4_PD_0_A15 ((15 << 16) | 0x5B01) /* ch 15, port D, pin 0 */ |
#define | ADCBufMSP432E4_PD_1_A14 ((14 << 16) | 0x5B02) /* ch 14, port D, pin 1 */ |
#define | ADCBufMSP432E4_PD_2_A13 ((13 << 16) | 0x5B04) /* ch 13, port D, pin 2 */ |
#define | ADCBufMSP432E4_PD_3_A12 ((12 << 16) | 0x5B08) /* ch 12, port D, pin 3 */ |
#define | ADCBufMSP432E4_PD_4_A7 ((7 << 16) | 0x5B10) /* ch 7, port D, pin 4 */ |
#define | ADCBufMSP432E4_PD_5_A6 ((6 << 16) | 0x5B20) /* ch 6, port D, pin 5 */ |
#define | ADCBufMSP432E4_PD_6_A5 ((5 << 16) | 0x5B40) /* ch 5, port D, pin 6 */ |
#define | ADCBufMSP432E4_PD_7_A4 ((4 << 16) | 0x5B80) /* ch 4, port D, pin 7 */ |
#define | ADCBufMSP432E4_PE_0_A3 ((3 << 16) | 0x5C01) /* ch 3, port E, pin 0 */ |
#define | ADCBufMSP432E4_PE_1_A2 ((2 << 16) | 0x5C02) /* ch 2, port E, pin 1 */ |
#define | ADCBufMSP432E4_PE_2_A1 ((1 << 16) | 0x5C04) /* ch 1, port E, pin 2 */ |
#define | ADCBufMSP432E4_PE_3_A0 ((0 << 16) | 0x5C08) /* ch 0, port E, pin 3 */ |
#define | ADCBufMSP432E4_PE_4_A9 ((9 << 16) | 0x5C10) /* ch 9, port E, pin 4 */ |
#define | ADCBufMSP432E4_PE_5_A8 ((8 << 16) | 0x5C20) /* ch 8, port E, pin 5 */ |
#define | ADCBufMSP432E4_PE_6_A20 ((20 << 16) | 0x5C40) /* ch 20, port E, pin 6 */ |
#define | ADCBufMSP432E4_PE_7_A21 ((21 << 16) | 0x5C80) /* ch 21, port E, pin 7 */ |
#define | ADCBufMSP432E4_PK_0_A16 ((16 << 16) | 0x6101) /* ch 16, port K, pin 0 */ |
#define | ADCBufMSP432E4_PK_1_A17 ((17 << 16) | 0x6102) /* ch 17, port K, pin 1 */ |
#define | ADCBufMSP432E4_PK_2_A18 ((18 << 16) | 0x6104) /* ch 18, port K, pin 2 */ |
#define | ADCBufMSP432E4_PK_3_A19 ((19 << 16) | 0x6108) /* ch 19, port K, pin 3 */ |
#define | ADCBufMSP432E4_PP_6_A22 ((22 << 16) | 0x6540) /* ch 22, port P, pin 6 */ |
#define | ADCBufMSP432E4_PP_7_A23 ((23 << 16) | 0x6580) /* ch 23, port P, pin 7 */ |
#define | ADCBufMSP432E4_PIN_NONE 0 |
#define | MSP432E4_NUM_ADC_CHANNELS (24) |
#define | ADCBufMSP432E4_SEQUENCER_COUNT 4 |
Typedefs | |
typedef enum ADCBufMSP432E4_SequencePriorities | ADCBufMSP432E4_SequencePriorities |
ADCBufMSP432E4 Sequencer Priorities These fields are used by ADCBufMSP432E4_HWAttrsV1 to specify the sequencer priority. The priority range is 0-3, any value greater than 3 will disable the sequencer. More... | |
typedef enum ADCBufMSP432E4_Sequencer | ADCBufMSP432E4_Sequencer |
ADCBufMSP432E4 Sequencer These fields are used by ADCBufMSP432E4_HWAttrsV1 to specify which ADC sequencer the user wants to use. More... | |
typedef enum ADCBufMSP432E4_InternalSourceMode | ADCBufMSP432E4_InternalSourceMode |
ADCBufMSP432E4 Internal Source Mode These fields are used by ADCBufMSP432E4_HWAttrsV1 to specify if a internal source mode is selected, i.e. temperature sensor. More... | |
typedef enum ADCBufMSP432E4_DifferentialMode | ADCBufMSP432E4_DifferentialMode |
ADCBufMSP432E4 Differential Mode These fields are used by ADCBufMSP432E4_HWAttrsV1 to specify if ADC differential sampling mode is selected. More... | |
typedef enum ADCBufMSP432E4_TriggerSource | ADCBufMSP432E4_TriggerSource |
ADCBufMSP432E4 trigger source These fields are used by ADCBufMSP432E4_HWAttrsV1 to specify the trigger source for the ADC. More... | |
typedef enum ADCBufMSP432E4_Phase | ADCBufMSP432E4_Phase |
ADCBufMSP432E4 phase delay These fields are used by ADCBufMSP432E4_HWAttrsV1 to specify the phase delay for the ADC module. More... | |
typedef enum ADCBufMSP432E4_SamplingDuration | ADCBufMSP432E4_SamplingDuration |
ADCMSP432E4 sampling duration These fields define the MSP432E4 ADC sampling duration (sample and hold time) in the pulse width unit. User can specify the differnt sampling duration in the ADCBufMSP432E4_ParamsExtension when opening the ADC. More... | |
typedef enum ADCBufMSP432E4_ReferenceSource | ADCBufMSP432E4_ReferenceSource |
ADCBufMSP432E4 reference source These fields are used by ADCBufMSP432E4_HWAttrsV1 to specify the reference voltage for each channel. More... | |
typedef struct ADCBufMSP432E4_ParamsExtension | ADCBufMSP432E4_ParamsExtension |
MSP432E4 specfic extension to ADCBuf_Params. More... | |
typedef struct ADCBufMSP432E4_Channels | ADCBufMSP432E4_Channels |
ADCBufMSP432E4 Channel setting These fields define channel-specific settings: GPIO, reference voltage, temperature mode, etc. These settings happen when ADCBuf_convert() is called. More... | |
typedef struct ADCBufMSP432E4_HWAttrsV1 | ADCBufMSP432E4_HWAttrsV1 |
ADCBufMSP432E4 Hardware attributes These fields are populated by PinMux tool but user is allowed to change for different channels setting. More... | |
typedef struct ADCBufMSP432E4_Object | ADCBufMSP432E4_Object |
ADCBufMSP432E4 Object. More... | |
typedef struct ADCBufMSP432E4_TimerSettings | ADCBufMSP432E4_TimerSettings |
Enumerations | |
enum | ADCBufMSP432E4_SequencePriorities { ADCBufMSP432E4_Priority_0 = 0, ADCBufMSP432E4_Priority_1 = 1, ADCBufMSP432E4_Priority_2 = 2, ADCBufMSP432E4_Priority_3 = 3, ADCBufMSP432E4_Seq_Disable = 4 } |
ADCBufMSP432E4 Sequencer Priorities These fields are used by ADCBufMSP432E4_HWAttrsV1 to specify the sequencer priority. The priority range is 0-3, any value greater than 3 will disable the sequencer. More... | |
enum | ADCBufMSP432E4_Sequencer { ADCBufMSP432E4_Seq_0 = 0, ADCBufMSP432E4_Seq_1 = 1, ADCBufMSP432E4_Seq_2 = 2, ADCBufMSP432E4_Seq_3 = 3 } |
ADCBufMSP432E4 Sequencer These fields are used by ADCBufMSP432E4_HWAttrsV1 to specify which ADC sequencer the user wants to use. More... | |
enum | ADCBufMSP432E4_InternalSourceMode { ADCBufMSP432E4_INTERNAL_SOURCE_MODE_OFF = 0, ADCBufMSP432E4_TEMPERATURE_MODE = ADC_CTL_TS } |
ADCBufMSP432E4 Internal Source Mode These fields are used by ADCBufMSP432E4_HWAttrsV1 to specify if a internal source mode is selected, i.e. temperature sensor. More... | |
enum | ADCBufMSP432E4_DifferentialMode { ADCBufMSP432E4_SINGLE_ENDED = 0, ADCBufMSP432E4_DIFFERENTIAL = ADC_CTL_D } |
ADCBufMSP432E4 Differential Mode These fields are used by ADCBufMSP432E4_HWAttrsV1 to specify if ADC differential sampling mode is selected. More... | |
enum | ADCBufMSP432E4_TriggerSource { ADCBufMSP432E4_SOFTWARE_AUTOMATIC_TRIGGER = ADC_TRIGGER_ALWAYS, ADCBufMSP432E4_TIMER_TRIGGER = ADC_TRIGGER_TIMER } |
ADCBufMSP432E4 trigger source These fields are used by ADCBufMSP432E4_HWAttrsV1 to specify the trigger source for the ADC. More... | |
enum | ADCBufMSP432E4_Phase { ADCBufMSP432E4_Phase_Delay_0 = ADC_PHASE_0, ADCBufMSP432E4_Phase_Delay_22_5 = ADC_PHASE_22_5, ADCBufMSP432E4_Phase_Delay_45 = ADC_PHASE_45, ADCBufMSP432E4_Phase_Delay_67_5 = ADC_PHASE_67_5, ADCBufMSP432E4_Phase_Delay_90 = ADC_PHASE_90, ADCBufMSP432E4_Phase_Delay_112_5 = ADC_PHASE_112_5, ADCBufMSP432E4_Phase_Delay_135 = ADC_PHASE_135, ADCBufMSP432E4_Phase_Delay_157_5 = ADC_PHASE_157_5, ADCBufMSP432E4_Phase_Delay_180 = ADC_PHASE_180, ADCBufMSP432E4_Phase_Delay_202_5 = ADC_PHASE_202_5, ADCBufMSP432E4_Phase_Delay_225 = ADC_PHASE_225, ADCBufMSP432E4_Phase_Delay_247_5 = ADC_PHASE_247_5, ADCBufMSP432E4_Phase_Delay_270 = ADC_PHASE_270, ADCBufMSP432E4_Phase_Delay_292_5 = ADC_PHASE_292_5, ADCBufMSP432E4_Phase_Delay_315 = ADC_PHASE_315, ADCBufMSP432E4_Phase_Delay_337_5 = ADC_PHASE_337_5 } |
ADCBufMSP432E4 phase delay These fields are used by ADCBufMSP432E4_HWAttrsV1 to specify the phase delay for the ADC module. More... | |
enum | ADCBufMSP432E4_SamplingDuration { ADCBufMSP432E4_SamplingDuration_PULSE_WIDTH_4 = ADC_CTL_SHOLD_4, ADCBufMSP432E4_SamplingDuration_PULSE_WIDTH_8 = ADC_CTL_SHOLD_8, ADCBufMSP432E4_SamplingDuration_PULSE_WIDTH_16 = ADC_CTL_SHOLD_16, ADCBufMSP432E4_SamplingDuration_PULSE_WIDTH_32 = ADC_CTL_SHOLD_32, ADCBufMSP432E4_SamplingDuration_PULSE_WIDTH_64 = ADC_CTL_SHOLD_64, ADCBufMSP432E4_SamplingDuration_PULSE_WIDTH_128 = ADC_CTL_SHOLD_128, ADCBufMSP432E4_SamplingDuration_PULSE_WIDTH_256 = ADC_CTL_SHOLD_256 } |
ADCMSP432E4 sampling duration These fields define the MSP432E4 ADC sampling duration (sample and hold time) in the pulse width unit. User can specify the differnt sampling duration in the ADCBufMSP432E4_ParamsExtension when opening the ADC. More... | |
enum | ADCBufMSP432E4_ReferenceSource { ADCBufMSP432E4_VREF_INTERNAL = ADC_REF_INT, ADCBufMSP432E4_VREF_EXTERNAL_3V = ADC_REF_EXT_3V } |
ADCBufMSP432E4 reference source These fields are used by ADCBufMSP432E4_HWAttrsV1 to specify the reference voltage for each channel. More... | |
Variables | |
const ADCBuf_FxnTable | ADCBufMSP432E4_fxnTable |
#define ADCBufMSP432E4_PB_4_A10 ((10 << 16) | 0x5910) /* ch 10, port B, pin 4 */ |
#define ADCBufMSP432E4_PB_5_A11 ((11 << 16) | 0x5920) /* ch 11, port B, pin 5 */ |
#define ADCBufMSP432E4_PD_0_A15 ((15 << 16) | 0x5B01) /* ch 15, port D, pin 0 */ |
#define ADCBufMSP432E4_PD_1_A14 ((14 << 16) | 0x5B02) /* ch 14, port D, pin 1 */ |
#define ADCBufMSP432E4_PD_2_A13 ((13 << 16) | 0x5B04) /* ch 13, port D, pin 2 */ |
#define ADCBufMSP432E4_PD_3_A12 ((12 << 16) | 0x5B08) /* ch 12, port D, pin 3 */ |
#define ADCBufMSP432E4_PD_4_A7 ((7 << 16) | 0x5B10) /* ch 7, port D, pin 4 */ |
#define ADCBufMSP432E4_PD_5_A6 ((6 << 16) | 0x5B20) /* ch 6, port D, pin 5 */ |
#define ADCBufMSP432E4_PD_6_A5 ((5 << 16) | 0x5B40) /* ch 5, port D, pin 6 */ |
#define ADCBufMSP432E4_PD_7_A4 ((4 << 16) | 0x5B80) /* ch 4, port D, pin 7 */ |
#define ADCBufMSP432E4_PE_0_A3 ((3 << 16) | 0x5C01) /* ch 3, port E, pin 0 */ |
#define ADCBufMSP432E4_PE_1_A2 ((2 << 16) | 0x5C02) /* ch 2, port E, pin 1 */ |
#define ADCBufMSP432E4_PE_2_A1 ((1 << 16) | 0x5C04) /* ch 1, port E, pin 2 */ |
#define ADCBufMSP432E4_PE_3_A0 ((0 << 16) | 0x5C08) /* ch 0, port E, pin 3 */ |
#define ADCBufMSP432E4_PE_4_A9 ((9 << 16) | 0x5C10) /* ch 9, port E, pin 4 */ |
#define ADCBufMSP432E4_PE_5_A8 ((8 << 16) | 0x5C20) /* ch 8, port E, pin 5 */ |
#define ADCBufMSP432E4_PE_6_A20 ((20 << 16) | 0x5C40) /* ch 20, port E, pin 6 */ |
#define ADCBufMSP432E4_PE_7_A21 ((21 << 16) | 0x5C80) /* ch 21, port E, pin 7 */ |
#define ADCBufMSP432E4_PK_0_A16 ((16 << 16) | 0x6101) /* ch 16, port K, pin 0 */ |
#define ADCBufMSP432E4_PK_1_A17 ((17 << 16) | 0x6102) /* ch 17, port K, pin 1 */ |
#define ADCBufMSP432E4_PK_2_A18 ((18 << 16) | 0x6104) /* ch 18, port K, pin 2 */ |
#define ADCBufMSP432E4_PK_3_A19 ((19 << 16) | 0x6108) /* ch 19, port K, pin 3 */ |
#define ADCBufMSP432E4_PP_6_A22 ((22 << 16) | 0x6540) /* ch 22, port P, pin 6 */ |
#define ADCBufMSP432E4_PP_7_A23 ((23 << 16) | 0x6580) /* ch 23, port P, pin 7 */ |
#define ADCBufMSP432E4_PIN_NONE 0 |
#define MSP432E4_NUM_ADC_CHANNELS (24) |
#define ADCBufMSP432E4_SEQUENCER_COUNT 4 |
ADCBufMSP432E4 Sequencer Priorities These fields are used by ADCBufMSP432E4_HWAttrsV1 to specify the sequencer priority. The priority range is 0-3, any value greater than 3 will disable the sequencer.
typedef enum ADCBufMSP432E4_Sequencer ADCBufMSP432E4_Sequencer |
ADCBufMSP432E4 Sequencer These fields are used by ADCBufMSP432E4_HWAttrsV1 to specify which ADC sequencer the user wants to use.
ADCBufMSP432E4 Internal Source Mode These fields are used by ADCBufMSP432E4_HWAttrsV1 to specify if a internal source mode is selected, i.e. temperature sensor.
ADCBufMSP432E4 Differential Mode These fields are used by ADCBufMSP432E4_HWAttrsV1 to specify if ADC differential sampling mode is selected.
typedef enum ADCBufMSP432E4_TriggerSource ADCBufMSP432E4_TriggerSource |
ADCBufMSP432E4 trigger source These fields are used by ADCBufMSP432E4_HWAttrsV1 to specify the trigger source for the ADC.
typedef enum ADCBufMSP432E4_Phase ADCBufMSP432E4_Phase |
ADCBufMSP432E4 phase delay These fields are used by ADCBufMSP432E4_HWAttrsV1 to specify the phase delay for the ADC module.
ADCMSP432E4 sampling duration These fields define the MSP432E4 ADC sampling duration (sample and hold time) in the pulse width unit. User can specify the differnt sampling duration in the ADCBufMSP432E4_ParamsExtension when opening the ADC.
ADCBufMSP432E4 reference source These fields are used by ADCBufMSP432E4_HWAttrsV1 to specify the reference voltage for each channel.
typedef struct ADCBufMSP432E4_ParamsExtension ADCBufMSP432E4_ParamsExtension |
MSP432E4 specfic extension to ADCBuf_Params.
To use non-default MSP432E4 specific parameters when calling ADCBuf_open(), a pointer to an instance of this struct must be specified in ADCBuf_Params::custom. Alternatively, these values can be set using the ADCBuf_control() function after calling ADCBuf_open().
typedef struct ADCBufMSP432E4_Channels ADCBufMSP432E4_Channels |
ADCBufMSP432E4 Channel setting These fields define channel-specific settings: GPIO, reference voltage, temperature mode, etc. These settings happen when ADCBuf_convert() is called.
typedef struct ADCBufMSP432E4_HWAttrsV1 ADCBufMSP432E4_HWAttrsV1 |
ADCBufMSP432E4 Hardware attributes These fields are populated by PinMux tool but user is allowed to change for different channels setting.
A sample structure is shown below:
typedef struct ADCBufMSP432E4_Object ADCBufMSP432E4_Object |
ADCBufMSP432E4 Object.
The application must not access any member variables of this structure!
typedef struct ADCBufMSP432E4_TimerSettings ADCBufMSP432E4_TimerSettings |
ADCBufMSP432E4 Sequencer Priorities These fields are used by ADCBufMSP432E4_HWAttrsV1 to specify the sequencer priority. The priority range is 0-3, any value greater than 3 will disable the sequencer.
Enumerator | |
---|---|
ADCBufMSP432E4_Priority_0 | |
ADCBufMSP432E4_Priority_1 | |
ADCBufMSP432E4_Priority_2 | |
ADCBufMSP432E4_Priority_3 | |
ADCBufMSP432E4_Seq_Disable |
ADCBufMSP432E4 Sequencer These fields are used by ADCBufMSP432E4_HWAttrsV1 to specify which ADC sequencer the user wants to use.
Enumerator | |
---|---|
ADCBufMSP432E4_Seq_0 | |
ADCBufMSP432E4_Seq_1 | |
ADCBufMSP432E4_Seq_2 | |
ADCBufMSP432E4_Seq_3 |
ADCBufMSP432E4 Internal Source Mode These fields are used by ADCBufMSP432E4_HWAttrsV1 to specify if a internal source mode is selected, i.e. temperature sensor.
Enumerator | |
---|---|
ADCBufMSP432E4_INTERNAL_SOURCE_MODE_OFF | |
ADCBufMSP432E4_TEMPERATURE_MODE |
ADCBufMSP432E4 Differential Mode These fields are used by ADCBufMSP432E4_HWAttrsV1 to specify if ADC differential sampling mode is selected.
Enumerator | |
---|---|
ADCBufMSP432E4_SINGLE_ENDED | |
ADCBufMSP432E4_DIFFERENTIAL |
ADCBufMSP432E4 trigger source These fields are used by ADCBufMSP432E4_HWAttrsV1 to specify the trigger source for the ADC.
Enumerator | |
---|---|
ADCBufMSP432E4_SOFTWARE_AUTOMATIC_TRIGGER | |
ADCBufMSP432E4_TIMER_TRIGGER |
enum ADCBufMSP432E4_Phase |
ADCBufMSP432E4 phase delay These fields are used by ADCBufMSP432E4_HWAttrsV1 to specify the phase delay for the ADC module.
ADCMSP432E4 sampling duration These fields define the MSP432E4 ADC sampling duration (sample and hold time) in the pulse width unit. User can specify the differnt sampling duration in the ADCBufMSP432E4_ParamsExtension when opening the ADC.
ADCBufMSP432E4 reference source These fields are used by ADCBufMSP432E4_HWAttrsV1 to specify the reference voltage for each channel.
Enumerator | |
---|---|
ADCBufMSP432E4_VREF_INTERNAL | |
ADCBufMSP432E4_VREF_EXTERNAL_3V |
const ADCBuf_FxnTable ADCBufMSP432E4_fxnTable |