Synergy Software Package User's Manual

#include <r_adc_api.h>

Data Fields

ssp_err_t(* open )(adc_ctrl_t *const p_ctrl, adc_cfg_t const *const p_cfg)
 
ssp_err_t(* scanCfg )(adc_ctrl_t *const p_ctrl, adc_channel_cfg_t const *const p_channel_cfg)
 
ssp_err_t(* scanStart )(adc_ctrl_t *const p_ctrl)
 
ssp_err_t(* scanStop )(adc_ctrl_t *const p_ctrl)
 
ssp_err_t(* scanStatusGet )(adc_ctrl_t *const p_ctrl)
 
ssp_err_t(* read )(adc_ctrl_t *const p_ctrl, adc_register_t const reg_id, uint16_t *const p_data)
 
ssp_err_t(* read32 )(adc_ctrl_t *const p_ctrl, adc_register_t const reg_id, uint32_t *const p_data)
 
ssp_err_t(* sampleStateCountSet )(adc_ctrl_t *const p_ctrl, adc_sample_state_t *p_sample)
 
ssp_err_t(* calibrate )(adc_ctrl_t *const p_ctrl, void *const p_extend)
 
ssp_err_t(* offsetSet )(adc_ctrl_t *const p_ctrl, adc_register_t const reg_id, int32_t const offset)
 
ssp_err_t(* close )(adc_ctrl_t *const p_ctrl)
 
ssp_err_t(* infoGet )(adc_ctrl_t *const p_ctrl, adc_info_t *const p_adc_info)
 
ssp_err_t(* versionGet )(ssp_version_t *const p_version)
 

Detailed Description

ADC functions implemented at the HAL layer will follow this API.

Field Documentation

◆ calibrate

ssp_err_t(* adc_api_t::calibrate) (adc_ctrl_t *const p_ctrl, void *const p_extend)

Calibrate ADC or associated PGA (programmable gain amplifier). The driver may require implementation specific arguments to the p_extend input. Not supported for all implementations. See implementation for details.

Implemented as
Parameters
[in]p_ctrlPointer to control handle structure
[in]p_extendPointer to implementation specific arguments

◆ close

ssp_err_t(* adc_api_t::close) (adc_ctrl_t *const p_ctrl)

Close the specified ADC unit by ending any scan in progress, disabling interrupts, and removing power to the specified A/D unit.

Implemented as
Parameters
[in]p_ctrlPointer to control handle structure

◆ infoGet

ssp_err_t(* adc_api_t::infoGet) (adc_ctrl_t *const p_ctrl, adc_info_t *const p_adc_info)

Return the ADC data register address of the first (lowest number) channel and the total number of bytes to be read in order for the DTC/DMAC to read the conversion results of all configured channels. Return the temperature sensor calibration and slope data.

Implemented as
Parameters
[in]p_ctrlPointer to control handle structure
[out]p_adc_infoPointer to ADC information structure

◆ offsetSet

ssp_err_t(* adc_api_t::offsetSet) (adc_ctrl_t *const p_ctrl, adc_register_t const reg_id, int32_t const offset)

Set offset for input PGA configured for differential input. Not supported for all implementations. See implementation for details.

Implemented as
Parameters
[in]p_ctrlPointer to control handle structure
[in]reg_idADC channel to read (see enumeration adc_register_t)
[in]offsetSee implementation for details.

◆ open

ssp_err_t(* adc_api_t::open) (adc_ctrl_t *const p_ctrl, adc_cfg_t const *const p_cfg)

Initialize ADC Unit; apply power, set the operational mode, trigger sources, interrupt priority, and configurations common to all channels and sensors.

Implemented as
Precondition
Configure peripheral clocks, ADC pins and IRQs prior to calling this function.
Parameters
[in]p_ctrlPointer to control handle structure
[in]p_cfgPointer to configuration structure

◆ read

ssp_err_t(* adc_api_t::read) (adc_ctrl_t *const p_ctrl, adc_register_t const reg_id, uint16_t *const p_data)

Read ADC conversion result.

Implemented as
Parameters
[in]p_ctrlPointer to control handle structure
[in]reg_idADC channel to read (see enumeration adc_register_t)
[in]p_dataPointer to variable to load value into.

◆ read32

ssp_err_t(* adc_api_t::read32) (adc_ctrl_t *const p_ctrl, adc_register_t const reg_id, uint32_t *const p_data)

Read ADC conversion result into a 32-bit word.

Implemented as
Parameters
[in]p_ctrlPointer to control handle structure
[in]reg_idADC channel to read (see enumeration adc_register_t)
[in]p_dataPointer to variable to load value into.

◆ sampleStateCountSet

ssp_err_t(* adc_api_t::sampleStateCountSet) (adc_ctrl_t *const p_ctrl, adc_sample_state_t *p_sample)

Set the sample state count for the specified channel. Not supported for all implementations. See implementation for details.

Implemented as
Parameters
[in]p_ctrlPointer to control handle structure
[in]p_samplePointer to the ADC channels and corresponding sample states to be set

◆ scanCfg

ssp_err_t(* adc_api_t::scanCfg) (adc_ctrl_t *const p_ctrl, adc_channel_cfg_t const *const p_channel_cfg)

Configure the scan including the channels, groups and scan triggers to be used for the unit that was initialized in the open call. Some configurations are not supported for all implementations. See implementation for details.

Implemented as
Parameters
[in]p_ctrlPointer to control handle structure
[in]p_channel_cfgPointer to scan configuration structure

◆ scanStart

ssp_err_t(* adc_api_t::scanStart) (adc_ctrl_t *const p_ctrl)

Start the scan (in case of a software trigger), or enable the hardware trigger.

Implemented as
Parameters
[in]p_ctrlPointer to control handle structure

◆ scanStatusGet

ssp_err_t(* adc_api_t::scanStatusGet) (adc_ctrl_t *const p_ctrl)

Check scan status.

Implemented as
Parameters
[in]p_ctrlPointer to control handle structure

◆ scanStop

ssp_err_t(* adc_api_t::scanStop) (adc_ctrl_t *const p_ctrl)

Stop the ADC scan (in case of a software trigger), or disable the hardware trigger.

Implemented as
Parameters
[in]p_ctrlPointer to control handle structure

◆ versionGet

ssp_err_t(* adc_api_t::versionGet) (ssp_version_t *const p_version)

Retrieve the API version.

Implemented as
Precondition
This function retrieves the API version.
Parameters
[in]p_versionPointer to version structure

The documentation for this struct was generated from the following file: