PEController BSP v4
Board Support Package for PEController from Taraz Technologies
 
Loading...
Searching...
No Matches
Functions
BSP » ADC

Functions

void BSP_ADC_SetDefaultParams (adc_processed_data_t *_processedAdcData, adc_raw_data_t *_rawAdcData)
 Set default parameters for the ADC.
 
void BSP_ADC_RefreshData (void)
 Updates the data parameters and data sharing items.
 
void BSP_ADC_Init (adc_acq_mode_t _type, adc_cont_config_t *_contConfig, volatile adc_raw_data_t *_rawAdcData, volatile adc_processed_data_t *_processedAdcData)
 Initializes the ADC drivers.
 
adc_measures_tBSP_ADC_Run (void)
 Starts the ADC conversion.
 
void BSP_ADC_Stop (void)
 Stops the ADC conversions.
 
void BSP_ADC_DeInit (void)
 De-initialize the ADC drivers.
 
timer_trigger_src_t BSP_ADC_SetInputOutputTrigger (tim_in_trigger_config_t *_slaveConfig, tim_out_trigger_config_t *_masterConfig, float _fs)
 Sets the input and output trigger functions for the ADC.
 
device_err_t BSP_ADC_UpdateConfig (adc_info_t *_info, float _fs, int _channelIndex, float _freq, float _sensitivity, float _offset, data_units_t _unit)
 Update the configurations for the ADC.
 
void BSP_ADC_ComputeStatsInBulk (adc_processed_data_t *_processedAdcData, float _fs)
 Call this function periodically to compute the statistics of the signals.
 
void BSP_ADC_ConfigStorage (state_storage_client_t *_config)
 Configures the storage client information.
 

Detailed Description

Function Documentation

◆ BSP_ADC_ComputeStatsInBulk()

void BSP_ADC_ComputeStatsInBulk ( adc_processed_data_t _processedAdcData,
float  _fs 
)
extern
Parameters
_processedAdcDataPointer to the processed data structure.
_fsSampling frequency of the ADC.

◆ BSP_ADC_ConfigStorage()

void BSP_ADC_ConfigStorage ( state_storage_client_t _config)
extern
Note
Before calling this function set the _config->arg parameter to system processedAdcData structure.
Parameters
_configPointer to the relevant configuration to be filled.

◆ BSP_ADC_Init()

void BSP_ADC_Init ( adc_acq_mode_t  _type,
adc_cont_config_t _contConfig,
volatile adc_raw_data_t _rawAdcData,
volatile adc_processed_data_t _processedAdcData 
)
extern
Parameters
_typeADC_MODE_SINGLE or ADC_MODE_CONT for single or continuous conversions respectively
_contConfigadc_cont_config_t contains the continuous transfer configuration
_rawAdcDataPointer to the raw ADC data container
_processedAdcDataPointer to the processed ADC data container

◆ BSP_ADC_RefreshData()

void BSP_ADC_RefreshData ( void  )
extern
Note
Should be called frequently to avoid data missing.

◆ BSP_ADC_Run()

adc_measures_t * BSP_ADC_Run ( void  )
extern

For single conversion mode performs and provides the results in a blocking way. For continuous conversion mode starts the conversions, after each conversion adc_cont_config_t.callback will be called

Returns
adc_measures_t_t* For single conversion mode returns the pointer to the acquired values. Returns NULL for continuous conversion mode

◆ BSP_ADC_SetDefaultParams()

void BSP_ADC_SetDefaultParams ( adc_processed_data_t _processedAdcData,
adc_raw_data_t _rawAdcData 
)
extern
Parameters
_processedAdcDataPointer to the processed ADC data container
_rawAdcDataPointer to the raw ADC data container

◆ BSP_ADC_SetInputOutputTrigger()

timer_trigger_src_t BSP_ADC_SetInputOutputTrigger ( tim_in_trigger_config_t _slaveConfig,
tim_out_trigger_config_t _masterConfig,
float  _fs 
)
extern
Note
Currently only the TIM_TRGI_TYPE_RST, TIM_TRGI_TYPE_START and TIM_TRGI_TYPE_RESET_AND_START functionalities are available for this timer synchronization. Delays can't be added in master or slave mode triggering through OC1. –TODO– Add list of possible timers for triggering in different modes.
Parameters
_slaveConfigConfiguration for the slave. Send NULL if no slave functionality needed.
_masterConfigConfiguration for the master. Send NULL if no master functionality needed.
_fsRequired sampling frequency of the ADC converter
Returns
timer_trigger_src_t Trigger source if configuration required as master else returns NULL.

◆ BSP_ADC_UpdateConfig()

device_err_t BSP_ADC_UpdateConfig ( adc_info_t _info,
float  _fs,
int  _channelIndex,
float  _freq,
float  _sensitivity,
float  _offset,
data_units_t  _unit 
)
extern
Parameters
_infoADC information
_fsADC sampling frequency
_channelIndexADC channel index
_freqDesired frequency
_sensitivityDesired sensitivity
_offsetDesired offset
_unitDesired unit
Returns
ERR_OK if setting successful else device_err_t.