![]() |
MCUSW
|
The ADC Driver MCAL provides low level access to ADC peripheral present on Device.
The ADC Driver implements a standardized interface specified in the AUTOSAR_SWS_ADCDriver document.
Only the following combinations of modes are supported:
Following combinations of modes are not supported:
Sub Modules | |
ADC Configuration | |
Data Structures | |
struct | Adc_GroupLogEntryType |
ADC log structure per group entry. More... | |
ADC Error Codes | |
Error codes returned by ADC functions | |
typedef uint8 | Adc_ChannelType |
Numeric ID of an ADC channel. | |
typedef uint8 | Adc_GroupType |
Numeric ID of an ADC channel group. | |
typedef uint32 | Adc_ValueGroupType |
Type for reading the converted values of a channel group (raw, without further scaling, right aligned). | |
typedef uint32 | Adc_PrescaleType |
Type of clock prescaler factor. | |
typedef uint16 | Adc_ConversionTimeType |
Type of conversion time, i.e. the time during which the sampled analogue value is converted into digital representation. | |
typedef uint16 | Adc_SamplingTimeType |
Type of sampling time, i.e. the time during which the value is sampled (in clockcycles). | |
typedef uint8 | Adc_ResolutionType |
Type of channel resolution in number of bits. | |
typedef uint8 | Adc_GroupPriorityType |
Priority level of the channel. Lowest priority is 0. | |
typedef uint32 | Adc_GroupDefType |
Type of assignment of channels to a channel group. | |
typedef uint16 | Adc_StreamNumSampleType |
Type for configuring the number of group conversions in streaming access mode (in single access mode, parameter is 1). | |
typedef uint8 | Adc_HwTriggerTimerType |
Type for the value of the ADC module embedded timer. | |
typedef uint8 | Adc_HWUnitType |
Specifies the identification (ID) for a ADC Hardware microcontroller peripheral (unit) | |
typedef uint8 | Adc_RefSelType |
Specifies the Reference select for functional internal diagnostic debug mode. | |
#define | ADC_E_UNINIT ((uint8) 0x0AU) |
API service used without module initiali-zation. | |
#define | ADC_E_BUSY ((uint8) 0x0BU) |
API service called during ongoing process. | |
#define | ADC_E_IDLE ((uint8) 0x0CU) |
API service called while no conversion is ongoing. | |
#define | ADC_E_ALREADY_INITIALIZED ((uint8) 0x0DU) |
API Adc_Init service called while the ADC driver has already been initialized. | |
#define | ADC_E_PARAM_CONFIG ((uint8) 0x0EU) |
API service called with incorrect configuration parameter. | |
#define | ADC_E_PARAM_POINTER ((uint8) 0x14U) |
API servcie called with invalid data buffer pointer. | |
#define | ADC_E_PARAM_GROUP ((uint8) 0x15U) |
API servcie called with invalid group ID. | |
#define | ADC_E_WRONG_CONV_MODE ((uint8) 0x16U) |
API servcie called on a group with conversion mode configured as continuous. | |
#define | ADC_E_WRONG_TRIGG_SRC ((uint8) 0x17U) |
API servcie called for group with wrong trigger source. | |
#define | ADC_E_NOTIF_CAPABILITY ((uint8) 0x18U) |
Enable/disable notification function for a group whose configuration set has no notification available. | |
#define | ADC_E_BUFFER_UNINIT ((uint8) 0x19U) |
Conversion started and result buffer pointer is not initialized. | |
#define | ADC_E_NOT_DISENGAGED ((uint8) 0x1AU) |
One or more ADC group/channel not in IDLE state. | |
#define | ADC_E_POWER_STATE_NOT_SUPPORTED ((uint8) 0x1BU) |
Unsupported power state request. | |
#define | ADC_E_TRANSITION_NOT_POSSIBLE ((uint8) 0x1CU) |
Requested power state can not be reached directly. | |
#define | ADC_E_PERIPHERAL_NOT_PREPARED ((uint8) 0x1DU) |
ADC not prepared for target power state. | |
ADC Service Ids | |
The Service Id is one of the argument to Det_ReportError function and is used to identify the source of the error | |
typedef void(* | Adc_GroupEndNotifyType) (void) |
Typedef for group end notification function pointer. | |
void | Adc_Init (const Adc_ConfigType *CfgPtr) |
Service for ADC initialization. | |
void | Adc_DeInit (void) |
This service sets all ADC HW Units to a state comparable to their power on reset state. | |
Std_ReturnType | Adc_SetupResultBuffer (Adc_GroupType Group, const Adc_ValueGroupType *DataBufferPtr) |
This service initializes ADC driver with the group specific result buffer start address where the conversion results will be stored. | |
Adc_StatusType | Adc_GetGroupStatus (Adc_GroupType Group) |
Returns the conversion status of the requested ADC Channel group. | |
Adc_StreamNumSampleType | Adc_GetStreamLastPointer (Adc_GroupType Group, Adc_ValueGroupType **PtrToSamplePtr) |
Returns the number of valid samples per channel, stored in the result buffer. | |
void | Adc_StartGroupConversion (Adc_GroupType Group) |
Starts the conversion of all channels of the requested ADC Channel group. | |
void | Adc_StopGroupConversion (Adc_GroupType Group) |
Stops the conversion of the requested ADC Channel group. | |
Std_ReturnType | Adc_ReadGroup (Adc_GroupType Group, Adc_ValueGroupType *DataBufferPtr) |
Reads the group conversion result of the last completed conversion round of the requested group and stores the channel values starting at the DataBufferPtr address. | |
void | Adc_EnableGroupNotification (Adc_GroupType Group) |
Enables the notification mechanism for the requested ADC Channel group. | |
void | Adc_DisableGroupNotification (Adc_GroupType Group) |
Disables the notification mechanism for the requested ADC Channel group. | |
void | Adc_GetVersionInfo (Std_VersionInfoType *versioninfo) |
This service returns the version information of this module. | |
Std_ReturnType | Adc_RegisterReadback (Adc_HWUnitType HWUnit, Adc_RegisterReadbackType *RegRbPtr) |
This function reads the important registers of the hardware unit and returns the value in the structure. | |
Std_ReturnType | Adc_EnableInternalDiagnostic (Adc_GroupType Group, Adc_RefSelType RefSelect) |
This function enables the Functional Internal Diagnostic Debug mode and selects a known voltage source(REFP or VMID) that connects to the AFE. | |
Std_ReturnType | Adc_DisableInternalDiagnostic (Adc_GroupType Group) |
This function disables the Functional Internal Diagnostic Debug mode. | |
#define | ADC_SID_INIT ((uint8) 0x00U) |
Adc_Init() API Service ID. | |
#define | ADC_SID_DEINIT ((uint8) 0x01U) |
Adc_DeInit() API Service ID. | |
#define | ADC_SID_START_GROUP_CONVERSION ((uint8) 0x02U) |
Adc_StartGroupConversion() API Service ID. | |
#define | ADC_SID_STOP_GROUP_CONVERSION ((uint8) 0x03U) |
Adc_StopGroupConversion() API Service ID. | |
#define | ADC_SID_READ_GROUP ((uint8) 0x04U) |
Adc_ReadGroup() API Service ID. | |
#define | ADC_SID_ENABLE_HARDWARE_TRIGGER ((uint8) 0x05U) |
Adc_EnableHardwareTrigger() API Service ID. | |
#define | ADC_SID_DISABLE_HARDWARE_TRIGGER ((uint8) 0x06U) |
Adc_DisableHardwareTrigger() API Service ID. | |
#define | ADC_SID_ENABLE_GROUP_NOTIFICATION ((uint8) 0x07U) |
Adc_EnableGroupNotification() API Service ID. | |
#define | ADC_SID_DISABLE_GROUP_NOTIFICATION ((uint8) 0x08U) |
Adc_DisableGroupNotification() API Service ID. | |
#define | ADC_SID_GET_GROUP_STATUS ((uint8) 0x09U) |
Adc_GetGroupStatus() API Service ID. | |
#define | ADC_SID_GET_VERSION_INFO ((uint8) 0x0AU) |
Adc_GetVersionInfo() API Service ID. | |
#define | ADC_SID_GET_STREAM_LAST_POINTER ((uint8) 0x0BU) |
Adc_GetStreamLastPointer() API Service ID. | |
#define | ADC_SID_SETUP_RESULT_BUFFER ((uint8) 0x0CU) |
Adc_SetupResultBuffer() API Service ID. | |
#define | ADC_SID_SET_POWER_STATE ((uint8) 0x10U) |
Adc_SetPowerState() API Service ID. | |
#define | ADC_SID_GET_CURRENT_POWER_STATE ((uint8) 0x11U) |
Adc_GetCurrentPowerState() API Service ID. | |
#define | ADC_SID_GET_TARGET_POWER_STATE ((uint8) 0x12U) |
Adc_GetTargetPowerState() API Service ID. | |
#define | ADC_SID_PREPARE_POWER_STATE ((uint8) 0x13U) |
Adc_PreparePowerState() API Service ID. | |
#define | ADC_SID_MAIN_POWER_TRANSITION_MANAGER ((uint8) 0x14U) |
Adc_Main_PowerTransitionManager() API Service ID. | |
#define | ADC_SID_IOHWAB_NOTIFICATION ((uint8) 0x20U) |
IoHwAb_AdcNotification() API Service ID. | |
#define | ADC_SID_IOHWAB_NOTIFY_READY_FOR_POWER_STATE ((uint8) 0x70U) |
IoHwAb_Adc_NotifyReadyForPowerState() API Service ID. | |
enum | Adc_StatusType { ADC_IDLE , ADC_BUSY , ADC_COMPLETED , ADC_STREAM_COMPLETED } |
Current status of the conversion of the requested ADC Channel group. More... | |
enum | Adc_TriggerSourceType { ADC_TRIGG_SRC_SW , ADC_TRIGG_SRC_HW } |
Type for configuring the trigger source for an ADC Channel group. More... | |
enum | Adc_GroupConvModeType { ADC_CONV_MODE_ONESHOT , ADC_CONV_MODE_CONTINUOUS } |
Type for configuring the conversion mode of an ADC Channel group. More... | |
enum | Adc_StreamBufferModeType { ADC_STREAM_BUFFER_LINEAR , ADC_STREAM_BUFFER_CIRCULAR } |
Type for configuring the streaming access mode buffer type. More... | |
enum | Adc_GroupAccessModeType { ADC_ACCESS_MODE_SINGLE , ADC_ACCESS_MODE_STREAMING } |
Type for configuring the access mode to group conversion results. More... | |
enum | Adc_HwTriggerSignalType { ADC_HW_TRIG_RISING_EDGE , ADC_HW_TRIG_FALLING_EDGE , ADC_HW_TRIG_BOTH_EDGES } |
Type for configuring on which edge of the hardware trigger signal the driver should react, i.e. start the conversion. More... | |
enum | Adc_PriorityImplementationType { ADC_PRIORITY_NONE , ADC_PRIORITY_HW , ADC_PRIORITY_HW_SW } |
Type for configuring the prioritization mechanism. More... | |
enum | Adc_GroupReplacementType { ADC_GROUP_REPL_ABORT_RESTART , ADC_GROUP_REPL_SUSPEND_RESUME } |
Replacement mechanism, which is used on ADC group level, if a group conversion is interrupted by a group which has a higher priority. More... | |
enum | Adc_ChannelRangeSelectType { ADC_RANGE_UNDER_LOW , ADC_RANGE_BETWEEN , ADC_RANGE_OVER_HIGH , ADC_RANGE_ALWAYS , ADC_RANGE_NOT_UNDER_LOW , ADC_RANGE_NOT_BETWEEN , ADC_RANGE_NOT_OVER_HIGH } |
In case of active limit checking: defines which conversion values are taken into account related to the boardes defined with AdcChannelLowLimit and AdcChannelHighLimit. More... | |
enum | Adc_ResultAlignmentType { ADC_ALIGN_LEFT , ADC_ALIGN_RIGHT } |
Type for alignment of ADC raw results in ADC result buffer (left/right alignment). More... | |
enum | Adc_PowerStateType { ADC_FULL_POWER , ADC_ZERO_POWER } |
Power state currently active or set as target power state. More... | |
enum | Adc_PowerStateRequestResultType { ADC_SERVICE_ACCEPTED , ADC_NOT_INIT , ADC_SEQUENCE_ERROR , ADC_HW_FAILURE , ADC_POWER_STATE_NOT_SUPP , ADC_TRANS_NOT_POSSIBLE } |
Result of the requests related to power state transitions. More... | |
enum | Adc_AveragingMode { ADC_AVERAGING_MODE_NONE , ADC_AVERAGING_MODE_2_SAMPLES , ADC_AVERAGING_MODE_4_SAMPLES , ADC_AVERAGING_MODE_8_SAMPLES , ADC_AVERAGING_MODE_16_SAMPLES } |
Enum to number of samplings to average. ADC allows user to program the number of samplings to average. More... | |
void | Adc_IntISR_Fun (Adc_ChannelType AdcChannel) |
ADC ISR. | |
ADC Driver Module SW Version Info | |
Defines for ADC Driver version used for compatibility checks | |
#define | ADC_SW_MAJOR_VERSION (9U) |
Driver Implementation Major Version. | |
#define | ADC_SW_MINOR_VERSION (2U) |
Driver Implementation Minor Version. | |
#define | ADC_SW_PATCH_VERSION (0U) |
Driver Implementation Patch Version. | |
ADC Driver Module AUTOSAR Version Info | |
Defines for ADC Driver AUTOSAR version used for compatibility checks | |
#define | ADC_AR_RELEASE_MAJOR_VERSION (4U) |
AUTOSAR Major version specification implemented by ADC Driver. | |
#define | ADC_AR_RELEASE_MINOR_VERSION (3U) |
AUTOSAR Minor version specification implemented by ADC Driver. | |
#define | ADC_AR_RELEASE_REVISION_VERSION (1U) |
AUTOSAR Patch version specification implemented by ADC Driver. | |
ADC Driver ID Info | |
#define | ADC_VENDOR_ID ((uint16) 44U) |
Texas Instruments Vendor ID. | |
#define | ADC_MODULE_ID ((uint16) 123U) |
ADC Driver Module ID. | |
#define | ADC_INSTANCE_ID ((uint8) 0U) |
ADC Driver Instance ID. | |
#define | ADC_DEF_CHANNEL_RESOLUTION ((Adc_ResolutionType) 12U) |
The default channel resolution supported by the current ADC hardware. No other value is supported by the hardware. | |
#define | ADC_NUM_CHANNEL (10U) |
Number of MCAL channels - in terms of ADC HW, this represents the number of hardware steps. Note: In terms of ADC IP number of steps is 16. Due to AUTOSAR specification, the channel ID's should be unique i.e each channel Id and actual HW channel should have one to one mapping. So ADC_NUM_CHANNEL is fixed to 9 as number of actual HW channels available is also 9. | |
#define | ADC_MIN_CHANNEL_ID (0U) |
Minimum value of channel ID. | |
#define | ADC_MAX_CHANNEL_ID (ADC_NUM_CHANNEL - 1U) |
Maximum value of channel ID. | |
#define | ADC_NUM_HW_CHANNEL (10U) |
Number of actual HW channels - in terms of ADC HW, this represents the actual channel input to the ADC module. Note: This is a fixed value as per the ADC module and can't be changed. | |
#define | ADC_MIN_HW_CHANNEL_ID (0U) |
Minimum value of HW channel ID. | |
#define | ADC_MAX_HW_CHANNEL_ID (ADC_NUM_HW_CHANNEL - 1U) |
Maximum value of HW channel ID. | |
#define | ADC_MIN_OPEN_DELAY (0x00U) |
Minimum value of open delay. | |
#define | ADC_MAX_OPEN_DELAY (0x3FFFFU) |
Maximum value of open delay. | |
#define | ADC_MIN_SAMPLE_DELAY (0x00U) |
Minimum value of sample delay. | |
#define | ADC_MAX_SAMPLE_DELAY (0xFFU) |
Maximum value of sample delay. | |
#define | ADC_MIN_RANGE (0x00U) |
Minimum value of range. | |
#define | ADC_MAX_RANGE (0xFFFU) |
Maximum value of range. | |
#define ADC_SW_MAJOR_VERSION (9U) |
Driver Implementation Major Version.
#define ADC_SW_MINOR_VERSION (2U) |
Driver Implementation Minor Version.
#define ADC_SW_PATCH_VERSION (0U) |
Driver Implementation Patch Version.
#define ADC_AR_RELEASE_MAJOR_VERSION (4U) |
AUTOSAR Major version specification implemented by ADC Driver.
#define ADC_AR_RELEASE_MINOR_VERSION (3U) |
AUTOSAR Minor version specification implemented by ADC Driver.
#define ADC_AR_RELEASE_REVISION_VERSION (1U) |
AUTOSAR Patch version specification implemented by ADC Driver.
#define ADC_VENDOR_ID ((uint16) 44U) |
Texas Instruments Vendor ID.
#define ADC_MODULE_ID ((uint16) 123U) |
ADC Driver Module ID.
#define ADC_INSTANCE_ID ((uint8) 0U) |
ADC Driver Instance ID.
#define ADC_DEF_CHANNEL_RESOLUTION ((Adc_ResolutionType) 12U) |
The default channel resolution supported by the current ADC hardware. No other value is supported by the hardware.
#define ADC_NUM_CHANNEL (10U) |
Number of MCAL channels - in terms of ADC HW, this represents the number of hardware steps. Note: In terms of ADC IP number of steps is 16. Due to AUTOSAR specification, the channel ID's should be unique i.e each channel Id and actual HW channel should have one to one mapping. So ADC_NUM_CHANNEL is fixed to 9 as number of actual HW channels available is also 9.
#define ADC_MIN_CHANNEL_ID (0U) |
Minimum value of channel ID.
#define ADC_MAX_CHANNEL_ID (ADC_NUM_CHANNEL - 1U) |
Maximum value of channel ID.
#define ADC_NUM_HW_CHANNEL (10U) |
Number of actual HW channels - in terms of ADC HW, this represents the actual channel input to the ADC module. Note: This is a fixed value as per the ADC module and can't be changed.
#define ADC_MIN_HW_CHANNEL_ID (0U) |
Minimum value of HW channel ID.
#define ADC_MAX_HW_CHANNEL_ID (ADC_NUM_HW_CHANNEL - 1U) |
Maximum value of HW channel ID.
#define ADC_MIN_OPEN_DELAY (0x00U) |
Minimum value of open delay.
#define ADC_MAX_OPEN_DELAY (0x3FFFFU) |
Maximum value of open delay.
#define ADC_MIN_SAMPLE_DELAY (0x00U) |
Minimum value of sample delay.
#define ADC_MAX_SAMPLE_DELAY (0xFFU) |
Maximum value of sample delay.
#define ADC_MIN_RANGE (0x00U) |
Minimum value of range.
#define ADC_MAX_RANGE (0xFFFU) |
Maximum value of range.
#define ADC_E_UNINIT ((uint8) 0x0AU) |
API service used without module initiali-zation.
#define ADC_E_BUSY ((uint8) 0x0BU) |
API service called during ongoing process.
#define ADC_E_IDLE ((uint8) 0x0CU) |
API service called while no conversion is ongoing.
#define ADC_E_ALREADY_INITIALIZED ((uint8) 0x0DU) |
API Adc_Init service called while the ADC driver has already been initialized.
#define ADC_E_PARAM_CONFIG ((uint8) 0x0EU) |
API service called with incorrect configuration parameter.
#define ADC_E_PARAM_POINTER ((uint8) 0x14U) |
API servcie called with invalid data buffer pointer.
#define ADC_E_PARAM_GROUP ((uint8) 0x15U) |
API servcie called with invalid group ID.
#define ADC_E_WRONG_CONV_MODE ((uint8) 0x16U) |
API servcie called on a group with conversion mode configured as continuous.
#define ADC_E_WRONG_TRIGG_SRC ((uint8) 0x17U) |
API servcie called for group with wrong trigger source.
#define ADC_E_NOTIF_CAPABILITY ((uint8) 0x18U) |
Enable/disable notification function for a group whose configuration set has no notification available.
#define ADC_E_BUFFER_UNINIT ((uint8) 0x19U) |
Conversion started and result buffer pointer is not initialized.
#define ADC_E_NOT_DISENGAGED ((uint8) 0x1AU) |
One or more ADC group/channel not in IDLE state.
#define ADC_E_POWER_STATE_NOT_SUPPORTED ((uint8) 0x1BU) |
Unsupported power state request.
#define ADC_E_TRANSITION_NOT_POSSIBLE ((uint8) 0x1CU) |
Requested power state can not be reached directly.
#define ADC_E_PERIPHERAL_NOT_PREPARED ((uint8) 0x1DU) |
ADC not prepared for target power state.
#define ADC_SID_INIT ((uint8) 0x00U) |
Adc_Init() API Service ID.
#define ADC_SID_DEINIT ((uint8) 0x01U) |
Adc_DeInit() API Service ID.
#define ADC_SID_START_GROUP_CONVERSION ((uint8) 0x02U) |
Adc_StartGroupConversion() API Service ID.
#define ADC_SID_STOP_GROUP_CONVERSION ((uint8) 0x03U) |
Adc_StopGroupConversion() API Service ID.
#define ADC_SID_READ_GROUP ((uint8) 0x04U) |
Adc_ReadGroup() API Service ID.
#define ADC_SID_ENABLE_HARDWARE_TRIGGER ((uint8) 0x05U) |
Adc_EnableHardwareTrigger() API Service ID.
#define ADC_SID_DISABLE_HARDWARE_TRIGGER ((uint8) 0x06U) |
Adc_DisableHardwareTrigger() API Service ID.
#define ADC_SID_ENABLE_GROUP_NOTIFICATION ((uint8) 0x07U) |
Adc_EnableGroupNotification() API Service ID.
#define ADC_SID_DISABLE_GROUP_NOTIFICATION ((uint8) 0x08U) |
Adc_DisableGroupNotification() API Service ID.
#define ADC_SID_GET_GROUP_STATUS ((uint8) 0x09U) |
Adc_GetGroupStatus() API Service ID.
#define ADC_SID_GET_VERSION_INFO ((uint8) 0x0AU) |
Adc_GetVersionInfo() API Service ID.
#define ADC_SID_GET_STREAM_LAST_POINTER ((uint8) 0x0BU) |
Adc_GetStreamLastPointer() API Service ID.
#define ADC_SID_SETUP_RESULT_BUFFER ((uint8) 0x0CU) |
Adc_SetupResultBuffer() API Service ID.
#define ADC_SID_SET_POWER_STATE ((uint8) 0x10U) |
Adc_SetPowerState() API Service ID.
#define ADC_SID_GET_CURRENT_POWER_STATE ((uint8) 0x11U) |
Adc_GetCurrentPowerState() API Service ID.
#define ADC_SID_GET_TARGET_POWER_STATE ((uint8) 0x12U) |
Adc_GetTargetPowerState() API Service ID.
#define ADC_SID_PREPARE_POWER_STATE ((uint8) 0x13U) |
Adc_PreparePowerState() API Service ID.
#define ADC_SID_MAIN_POWER_TRANSITION_MANAGER ((uint8) 0x14U) |
Adc_Main_PowerTransitionManager() API Service ID.
#define ADC_SID_IOHWAB_NOTIFICATION ((uint8) 0x20U) |
IoHwAb_AdcNotification() API Service ID.
#define ADC_SID_IOHWAB_NOTIFY_READY_FOR_POWER_STATE ((uint8) 0x70U) |
IoHwAb_Adc_NotifyReadyForPowerState() API Service ID.
typedef uint8 Adc_ChannelType |
Numeric ID of an ADC channel.
typedef uint8 Adc_GroupType |
Numeric ID of an ADC channel group.
typedef uint32 Adc_ValueGroupType |
Type for reading the converted values of a channel group (raw, without further scaling, right aligned).
Note: Even though the resolution for this ADC HW is 10-bit, we set this to 32-bit integer as the register read access is 32-bit.
typedef uint32 Adc_PrescaleType |
Type of clock prescaler factor.
typedef uint16 Adc_ConversionTimeType |
Type of conversion time, i.e. the time during which the sampled analogue value is converted into digital representation.
typedef uint16 Adc_SamplingTimeType |
Type of sampling time, i.e. the time during which the value is sampled (in clockcycles).
typedef uint8 Adc_ResolutionType |
Type of channel resolution in number of bits.
typedef uint8 Adc_GroupPriorityType |
Priority level of the channel. Lowest priority is 0.
typedef uint32 Adc_GroupDefType |
Type of assignment of channels to a channel group.
typedef uint16 Adc_StreamNumSampleType |
Type for configuring the number of group conversions in streaming access mode (in single access mode, parameter is 1).
typedef uint8 Adc_HwTriggerTimerType |
Type for the value of the ADC module embedded timer.
typedef uint8 Adc_HWUnitType |
Specifies the identification (ID) for a ADC Hardware microcontroller peripheral (unit)
typedef uint8 Adc_RefSelType |
Specifies the Reference select for functional internal diagnostic debug mode.
typedef void(* Adc_GroupEndNotifyType) (void) |
Typedef for group end notification function pointer.
enum Adc_StatusType |
Current status of the conversion of the requested ADC Channel group.
Type for configuring the conversion mode of an ADC Channel group.
Type for configuring the streaming access mode buffer type.
Type for configuring on which edge of the hardware trigger signal the driver should react, i.e. start the conversion.
Note: This feature is not supported in this driver
Replacement mechanism, which is used on ADC group level, if a group conversion is interrupted by a group which has a higher priority.
In case of active limit checking: defines which conversion values are taken into account related to the boardes defined with AdcChannelLowLimit and AdcChannelHighLimit.
Note: This feature is not supported yet.
enum Adc_PowerStateType |
Result of the requests related to power state transitions.
enum Adc_AveragingMode |
Enum to number of samplings to average. ADC allows user to program the number of samplings to average.
void Adc_IntISR_Fun | ( | Adc_ChannelType | AdcChannel | ) |
ADC ISR.
void Adc_Init | ( | const Adc_ConfigType * | CfgPtr | ) |
Service for ADC initialization.
* Service name : Adc_Init * Syntax : void Adc_Init( const Adc_ConfigType* CfgPtr ) * Mode : Supervisor Mode (Privileged Mode) * Service ID[hex] : 0x00 * Sync/Async : Synchronous * Reentrancy : Non Reentrant * Parameters (in) : Pointer to configuration set in Variant PB * (Variant PC requires a NULL_PTR). * Parameters (inout) : None * Parameters (out) : None * Return value : None * Description : Initializes the ADC hardware units and driver *
void Adc_DeInit | ( | void | ) |
This service sets all ADC HW Units to a state comparable to their power on reset state.
* Service name : Adc_DeInit * Syntax : void Adc_DeInit(void) * Mode : Supervisor Mode (Privileged Mode) * Service ID[hex] : 0x01 * Sync/Async : Synchronous * Reentrancy : Non Reentrant * Parameters (in) : None * Parameters (inout) : None * Parameters (out) : None * Return value : None * Description : Returns all ADC HW Units to a state comparable to * their power on reset state *
Std_ReturnType Adc_SetupResultBuffer | ( | Adc_GroupType | Group, |
const Adc_ValueGroupType * | DataBufferPtr ) |
This service initializes ADC driver with the group specific result buffer start address where the conversion results will be stored.
* Service name : Adc_SetupResultBuffer * Syntax : Std_ReturnType Adc_SetupResultBuffer( * Adc_GroupType Group, * Adc_ValueGroupType* DataBufferPtr) * Mode : User Mode (Non-Privileged Mode) * Service ID[hex] : 0x0C * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : Group - Numeric ID of requested ADC channel group. * DataBufferPtr - pointer to result data buffer * Parameters (inout) : None * Parameters (out) : None * Return value : Std_ReturnType * E_OK: result buffer pointer initialized correctly * E_NOT_OK: operation failed or development error occured * Description : Initializes ADC driver with the group specific result * buffer start address where the conversion results * will be stored. The application has to ensure that * the application buffer, where DataBufferPtr points * to, can hold all the conversion results of the * specified group. The initialization with * Adc_SetupResultBuffer is required after reset, * before a group conversion can be started. *
Adc_StatusType Adc_GetGroupStatus | ( | Adc_GroupType | Group | ) |
Returns the conversion status of the requested ADC Channel group.
* Service name : Adc_GetGroupStatus * Syntax : Adc_StatusType Adc_GetGroupStatus( Adc_GroupType Group ) * Mode : User Mode (Non-Privileged Mode) * Service ID[hex] : 0x09 * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : Group - Numeric ID of requested ADC channel group. * Parameters (inout) : None * Parameters (out) : None * Return value : Adc_StatusType - Conversion status for the requested * group * Description : Returns the conversion status of the requested ADC * Channel group. *
Adc_StreamNumSampleType Adc_GetStreamLastPointer | ( | Adc_GroupType | Group, |
Adc_ValueGroupType ** | PtrToSamplePtr ) |
Returns the number of valid samples per channel, stored in the result buffer.
* Service name : Adc_GetStreamLastPointer * Syntax : Adc_StreamNumSampleType Adc_GetStreamLastPointer( * Adc_GroupType Group, * Adc_ValueGroupType** PtrToSamplePtr ) * Mode : User Mode (Non-Privileged Mode) * Service ID[hex] : 0x0B * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : Group - Numeric ID of requested ADC channel group. * Parameters (inout) : None * Parameters (out) : PtrToSamplePtr - Pointer to result buffer pointer. * Return value : Adc_StreamNumSampleType - Number of valid samples * per channel * Description : Returns the number of valid samples per channel, * stored in the result buffer. Reads a pointer, * pointing to a position in the group result buffer. * With the pointer position, the results of all group * channels of the last completed conversion round can * be accessed. With the pointer and the return value, * all valid group conversion results can be accessed * (the user has to take the layout of the result buffer * into account). *
void Adc_StartGroupConversion | ( | Adc_GroupType | Group | ) |
Starts the conversion of all channels of the requested ADC Channel group.
* Service name : Adc_StartGroupConversion * Syntax : void Adc_StartGroupConversion( Adc_GroupType Group ) * Mode : Supervisor Mode (Privileged Mode) * Service ID[hex] : 0x02 * Sync/Async : Asynchronous * Reentrancy : Reentrant * Parameters (in) : Group - Numeric ID of requested ADC Channel group. * Parameters (inout) : None * Parameters (out) : None * Return value : None * Description : Starts the conversion of all channels of the * requested ADC Channel group. *
void Adc_StopGroupConversion | ( | Adc_GroupType | Group | ) |
Stops the conversion of the requested ADC Channel group.
* Service name : Adc_StopGroupConversion * Syntax : void Adc_StopGroupConversion( Adc_GroupType Group ) * Mode : Supervisor Mode (Privileged Mode) * Service ID[hex] : 0x03 * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : Group - Numeric ID of requested ADC Channel group. * Parameters (inout) : None * Parameters (out) : None * Return value : None * Description : Stops the conversion of the requested ADC Channel * group. *
Std_ReturnType Adc_ReadGroup | ( | Adc_GroupType | Group, |
Adc_ValueGroupType * | DataBufferPtr ) |
Reads the group conversion result of the last completed conversion round of the requested group and stores the channel values starting at the DataBufferPtr address.
* Service name : Adc_ReadGroup * Syntax : Std_ReturnType Adc_ReadGroup( * Adc_GroupType Group, * Adc_ValueGroupType* DataBufferPtr ) * Mode : User Mode (Non-Privileged Mode) * Service ID[hex] : 0x04 * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : Group - Numeric ID of requested ADC channel group. * DataBufferPtr - ADC results of all channels of the * selected group are stored in the data buffer * addressed with the pointer * Parameters (inout) : None * Parameters (out) : None * Return value : Std_ReturnType * E_OK: results are available and written to the data buffer * E_NOT_OK: no results are available or development error occured * Description : Reads the group conversion result of the last * completed conversion round of the requested group * and stores the channel values starting at the * DataBufferPtr address. The group channel values are * stored in ascending channel number order (in contrast * to the storage layout of the result buffer if * streaming access is configured). *
void Adc_EnableGroupNotification | ( | Adc_GroupType | Group | ) |
Enables the notification mechanism for the requested ADC Channel group.
* Service name : Adc_EnableGroupNotification * Syntax : void Adc_EnableGroupNotification( Adc_GroupType Group ) * Mode : User Mode (Non-Privileged Mode) * Service ID[hex] : 0x07 * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : Group - Numeric ID of requested ADC channel group. * Parameters (inout) : None * Parameters (out) : None * Return value : None * Description : Enables the notification mechanism for the requested * ADC Channel group. *
void Adc_DisableGroupNotification | ( | Adc_GroupType | Group | ) |
Disables the notification mechanism for the requested ADC Channel group.
* Service name : Adc_DisableGroupNotification * Syntax : void Adc_DisableGroupNotification( Adc_GroupType Group ) * Mode : User Mode (Non-Privileged Mode) * Service ID[hex] : 0x08 * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : Group - Numeric ID of requested ADC channel group. * Parameters (inout) : None * Parameters (out) : None * Return value : None * Description : Disables the notification mechanism for the requested * ADC Channel group. *
void Adc_GetVersionInfo | ( | Std_VersionInfoType * | versioninfo | ) |
This service returns the version information of this module.
* Service name : Adc_GetVersionInfo * Syntax : void Adc_GetVersionInfo( Std_VersionInfoType* versioninfo ) * Mode : User Mode (Non-Privileged Mode) * Service ID[hex] : 0x0A * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : None * Parameters (inout) : None * Parameters (out) : versioninfo - Pointer to where to store the version * information of this module * Return value : None * Description : Returns the version information of this module *
Std_ReturnType Adc_RegisterReadback | ( | Adc_HWUnitType | HWUnit, |
Adc_RegisterReadbackType * | RegRbPtr ) |
This function reads the important registers of the hardware unit and returns the value in the structure.
This API should be called after Adc_Init is called. Otherwise this API will return E_NOT_OK.
This API could be used to readback the register contents after Adc_Init and then the readback value could be compared during ADC execution to check the correctness of the HW unit. Since this API is used for this purpose, the register returned are the ones which doesn't change after init based on conv or channel config.
* Service name : Adc_RegisterReadback * Mode : Supervisor Mode (Privileged Mode) * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : HWUnit - ADC Hardware microcontroller peripheral * unit ID. If this is invalid, then the API will * return E_NOT_OK. * Parameters (inout) : RegRbPtr - Pointer to where to store the readback * values. If this pointer is NULL_PTR, then the API * will return E_NOT_OK. * Return value : Std_ReturnType * E_OK: Register read back has been done * E_NOT_OK: Register read back failed *
Std_ReturnType Adc_EnableInternalDiagnostic | ( | Adc_GroupType | Group, |
Adc_RefSelType | RefSelect ) |
This function enables the Functional Internal Diagnostic Debug mode and selects a known voltage source(REFP or VMID) that connects to the AFE.
* Service name : Adc_EnableInternalDiagnostic * Mode : Supervisor Mode (Privileged Mode) * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : Group - Numeric ID of requested ADC channel group. * If this is invalid, then the API will return E_NOT_OK. * RefSelect - Reference select for functional internal * diagnostic debug mode. * 0 = VMID * 1 = REFP * Parameters (inout) : None * Return value : Std_ReturnType * E_OK: Functional Internal Diagnostic Debug Mode * has been enabled Successfully. * E_NOT_OK: Functional Internal Diagnostic Debug Mode * enable failed. *
Std_ReturnType Adc_DisableInternalDiagnostic | ( | Adc_GroupType | Group | ) |
This function disables the Functional Internal Diagnostic Debug mode.
* Service name : Adc_DisableInternalDiagnostic * Mode : Supervisor Mode (Privileged Mode) * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : Group - Numeric ID of requested ADC channel group. * If this is invalid, then the API will return E_NOT_OK. * Parameters (inout) : None * Return value : Std_ReturnType * E_OK: Functional Internal Diagnostic Debug Mode * has been disabled Successfully. * E_NOT_OK: Functional Internal Diagnostic Debug Mode * disable failed. *