MCUSW
|
This file contains interface header for ADC MCAL driver.
Go to the source code of this file.
Data Structures | |
struct | Adc_ChannelConfigType |
Structure containing parameters for ADC MCAL channel configuration. In term of ADC hardware, this represents the step configuration. There are ADC_NUM_CHANNEL steps in the ADC hardware and each step could be mapped to an actual hardware input channel. More... | |
struct | Adc_GroupConfigType |
ADC Group configuration structure. More... | |
struct | Adc_HwUnitConfigType |
ADC Hardware unit configuration structure. More... | |
struct | Adc_ConfigType |
ADC config structure. More... | |
struct | Adc_RegisterReadbackType |
ADC register readback structure. More... | |
Macros | |
#define | ADC_DEF_CHANNEL_RESOLUTION ((uint8) 12U) |
The default channel resolution supported by the current ADC hardware. No other value is supported by the hardware. More... | |
#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. More... | |
#define | ADC_MIN_CHANNEL_ID (0U) |
Minimum value of channel ID. More... | |
#define | ADC_MAX_CHANNEL_ID (ADC_NUM_CHANNEL - 1U) |
Maximum value of channel ID. More... | |
#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. More... | |
#define | ADC_MIN_HW_CHANNEL_ID (0U) |
Minimum value of HW channel ID. More... | |
#define | ADC_MAX_HW_CHANNEL_ID (ADC_NUM_HW_CHANNEL - 1U) |
Maximum value of HW channel ID. More... | |
#define | ADC_MIN_OPEN_DELAY (0x00U) |
Minimum value of open delay. More... | |
#define | ADC_MAX_OPEN_DELAY (0x3FFFFU) |
Maximum value of open delay. More... | |
#define | ADC_MIN_SAMPLE_DELAY (0x00U) |
Minimum value of sample delay. More... | |
#define | ADC_MAX_SAMPLE_DELAY (0xFFU) |
Maximum value of sample delay. More... | |
#define | ADC_MIN_RANGE (0x00U) |
Minimum value of range. More... | |
#define | ADC_MAX_RANGE (0xFFFU) |
Maximum value of range. More... | |
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. More... | |
#define | ADC_SW_MINOR_VERSION (0U) |
Driver Implementation Minor Version. More... | |
#define | ADC_SW_PATCH_VERSION (1U) |
Driver Implementation Patch Version. More... | |
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. More... | |
#define | ADC_AR_RELEASE_MINOR_VERSION (3U) |
AUTOSAR Minor version specification implemented by ADC Driver. More... | |
#define | ADC_AR_RELEASE_REVISION_VERSION (1U) |
AUTOSAR Patch version specification implemented by ADC Driver. More... | |
ADC Driver ID Info | |
#define | ADC_VENDOR_ID ((uint16) 44U) |
Texas Instruments Vendor ID. More... | |
#define | ADC_MODULE_ID ((uint16) 123U) |
ADC Driver Module ID. More... | |
#define | ADC_INSTANCE_ID ((uint8) 0U) |
ADC Driver Instance ID. More... | |
ADC Error Codes | |
Error codes returned by ADC functions | |
#define | ADC_E_UNINIT ((uint8) 0x0AU) |
API service used without module initiali-zation. More... | |
#define | ADC_E_BUSY ((uint8) 0x0BU) |
API service called during ongoing process. More... | |
#define | ADC_E_IDLE ((uint8) 0x0CU) |
API service called while no conversion is ongoing. More... | |
#define | ADC_E_ALREADY_INITIALIZED ((uint8) 0x0DU) |
API Adc_Init service called while the ADC driver has already been initialized. More... | |
#define | ADC_E_PARAM_CONFIG ((uint8) 0x0EU) |
API service called with incorrect configuration parameter. More... | |
#define | ADC_E_PARAM_POINTER ((uint8) 0x14U) |
API servcie called with invalid data buffer pointer. More... | |
#define | ADC_E_PARAM_GROUP ((uint8) 0x15U) |
API servcie called with invalid group ID. More... | |
#define | ADC_E_WRONG_CONV_MODE ((uint8) 0x16U) |
API servcie called on a group with conversion mode configured as continuous. More... | |
#define | ADC_E_WRONG_TRIGG_SRC ((uint8) 0x17U) |
API servcie called for group with wrong trigger source. More... | |
#define | ADC_E_NOTIF_CAPABILITY ((uint8) 0x18U) |
Enable/disable notification function for a group whose configuration set has no notification available. More... | |
#define | ADC_E_BUFFER_UNINIT ((uint8) 0x19U) |
Conversion started and result buffer pointer is not initialized. More... | |
#define | ADC_E_NOT_DISENGAGED ((uint8) 0x1AU) |
One or more ADC group/channel not in IDLE state. More... | |
#define | ADC_E_POWER_STATE_NOT_SUPPORTED ((uint8) 0x1BU) |
Unsupported power state request. More... | |
#define | ADC_E_TRANSITION_NOT_POSSIBLE ((uint8) 0x1CU) |
Requested power state can not be reached directly. More... | |
#define | ADC_E_PERIPHERAL_NOT_PREPARED ((uint8) 0x1DU) |
ADC not prepared for target power state. More... | |
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 | |
#define | ADC_SID_INIT ((uint8) 0x00U) |
Adc_Init() API Service ID. More... | |
#define | ADC_SID_DEINIT ((uint8) 0x01U) |
Adc_DeInit() API Service ID. More... | |
#define | ADC_SID_START_GROUP_CONVERSION ((uint8) 0x02U) |
Adc_StartGroupConversion() API Service ID. More... | |
#define | ADC_SID_STOP_GROUP_CONVERSION ((uint8) 0x03U) |
Adc_StopGroupConversion() API Service ID. More... | |
#define | ADC_SID_READ_GROUP ((uint8) 0x04U) |
Adc_ReadGroup() API Service ID. More... | |
#define | ADC_SID_ENABLE_HARDWARE_TRIGGER ((uint8) 0x05U) |
Adc_EnableHardwareTrigger() API Service ID. More... | |
#define | ADC_SID_DISABLE_HARDWARE_TRIGGER ((uint8) 0x06U) |
Adc_DisableHardwareTrigger() API Service ID. More... | |
#define | ADC_SID_ENABLE_GROUP_NOTIFICATION ((uint8) 0x07U) |
Adc_EnableGroupNotification() API Service ID. More... | |
#define | ADC_SID_DISABLE_GROUP_NOTIFICATION ((uint8) 0x08U) |
Adc_DisableGroupNotification() API Service ID. More... | |
#define | ADC_SID_GET_GROUP_STATUS ((uint8) 0x09U) |
Adc_GetGroupStatus() API Service ID. More... | |
#define | ADC_SID_GET_VERSION_INFO ((uint8) 0x0AU) |
Adc_GetVersionInfo() API Service ID. More... | |
#define | ADC_SID_GET_STREAM_LAST_POINTER ((uint8) 0x0BU) |
Adc_GetStreamLastPointer() API Service ID. More... | |
#define | ADC_SID_SETUP_RESULT_BUFFER ((uint8) 0x0CU) |
Adc_SetupResultBuffer() API Service ID. More... | |
#define | ADC_SID_SET_POWER_STATE ((uint8) 0x10U) |
Adc_SetPowerState() API Service ID. More... | |
#define | ADC_SID_GET_CURRENT_POWER_STATE ((uint8) 0x11U) |
Adc_GetCurrentPowerState() API Service ID. More... | |
#define | ADC_SID_GET_TARGET_POWER_STATE ((uint8) 0x12U) |
Adc_GetTargetPowerState() API Service ID. More... | |
#define | ADC_SID_PREPARE_POWER_STATE ((uint8) 0x13U) |
Adc_PreparePowerState() API Service ID. More... | |
#define | ADC_SID_MAIN_POWER_TRANSITION_MANAGER ((uint8) 0x14U) |
Adc_Main_PowerTransitionManager() API Service ID. More... | |
#define | ADC_SID_IOHWAB_NOTIFICATION ((uint8) 0x20U) |
IoHwAb_AdcNotification() API Service ID. More... | |
#define | ADC_SID_IOHWAB_NOTIFY_READY_FOR_POWER_STATE ((uint8) 0x70U) |
IoHwAb_Adc_NotifyReadyForPowerState() API Service ID. More... | |
Typedefs | |
typedef uint8 | Adc_ChannelType |
Numeric ID of an ADC channel. More... | |
typedef uint8 | Adc_GroupType |
Numeric ID of an ADC channel group. More... | |
typedef uint32 | Adc_ValueGroupType |
Type for reading the converted values of a channel group (raw, without further scaling, right aligned). More... | |
typedef uint32 | Adc_PrescaleType |
Type of clock prescaler factor. More... | |
typedef uint16 | Adc_ConversionTimeType |
Type of conversion time, i.e. the time during which the sampled analogue value is converted into digital representation. More... | |
typedef uint16 | Adc_SamplingTimeType |
Type of sampling time, i.e. the time during which the value is sampled (in clockcycles). More... | |
typedef uint8 | Adc_ResolutionType |
Type of channel resolution in number of bits. More... | |
typedef uint8 | Adc_GroupPriorityType |
Priority level of the channel. Lowest priority is 0. More... | |
typedef uint32 | Adc_GroupDefType |
Type of assignment of channels to a channel group. More... | |
typedef uint16 | Adc_StreamNumSampleType |
Type for configuring the number of group conversions in streaming access mode (in single access mode, parameter is 1). More... | |
typedef uint8 | Adc_HwTriggerTimerType |
Type for the value of the ADC module embedded timer. More... | |
typedef uint8 | Adc_HWUnitType |
Specifies the identification (ID) for a ADC Hardware microcontroller peripheral (unit) More... | |
typedef uint8 | Adc_RefSelType |
Specifies the Reference select for functional internal diagnostic debug mode. More... | |
typedef void(* | Adc_GroupEndNotifyType) (void) |
Typedef for group end notification function pointer. More... | |
Enumerations | |
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... | |
Functions | |
void | Adc_Init (const Adc_ConfigType *CfgPtr) |
Service for ADC initialization. More... | |
void | Adc_DeInit (void) |
This service sets all ADC HW Units to a state comparable to their power on reset state. More... | |
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. More... | |
Adc_StatusType | Adc_GetGroupStatus (Adc_GroupType Group) |
Returns the conversion status of the requested ADC Channel group. More... | |
Adc_StreamNumSampleType | Adc_GetStreamLastPointer (Adc_GroupType Group, Adc_ValueGroupType **PtrToSamplePtr) |
Returns the number of valid samples per channel, stored in the result buffer. More... | |
void | Adc_StartGroupConversion (Adc_GroupType Group) |
Starts the conversion of all channels of the requested ADC Channel group. More... | |
void | Adc_StopGroupConversion (Adc_GroupType Group) |
Stops the conversion of the requested ADC Channel group. More... | |
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. More... | |
void | Adc_EnableGroupNotification (Adc_GroupType Group) |
Enables the notification mechanism for the requested ADC Channel group. More... | |
void | Adc_DisableGroupNotification (Adc_GroupType Group) |
Disables the notification mechanism for the requested ADC Channel group. More... | |
void | Adc_GetVersionInfo (Std_VersionInfoType *versioninfo) |
This service returns the version information of this module. More... | |
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. More... | |
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. More... | |
Std_ReturnType | Adc_DisableInternalDiagnostic (Adc_GroupType Group) |
This function disables the Functional Internal Diagnostic Debug mode. More... | |