25 #ifdef DRV_ADC_MODULE_ENABLED 127 ptDriver->
ptDevice = s_apDeviceAddressTable[0];
412 uint32_t ulIndexLoop;
414 if((ptDriver == NULL) || (ptSequencer == NULL))
614 if(ptSequencer == NULL)
650 if(ptSequencer == NULL)
680 if(ptSequencer == NULL)
725 if(ptSequencer == NULL)
754 if(ptSequencer == NULL)
784 uint32_t ulMadc_Seq_Mx = 0ul;
786 if(ptSequencer == NULL)
821 switch (eMeasurement)
876 uint32_t Madc_Seq_Status = 0ul;
878 if(ptSequencer == NULL)
914 uint32_t Madc_Seq_Result_Current = 0ul;
916 if(ptSequencer == NULL)
926 if(pulSample != NULL)
962 uint32_t Madc_Seq_Result_Last = 0ul;
964 if(ptSequencer == NULL)
974 if(pulSample != NULL)
1018 if((ptSequencer == NULL) || (pulSampleSeries == NULL) || (tSize < 2))
1051 uint32_t ulRawValue;
1052 uint16_t* pusSample;
1117 if(ptSequencer == 0 || ptSequencer->
ptDevice != s_apSubDeviceAddressTable[ulDeviceOffset])
1119 ((
DRV_ADC_SEQ_DEVICE_T * const ) s_apSubDeviceAddressTable[ulDeviceOffset])->madc_seq_ms_en = 0ul;
1127 switch (ulIrqMasked)
1152 #define DRV_ACD_IRQHandler_Generator(id, _) DRV_Default_IRQHandler_Function_Generator(MADC ## id ## _IRQHandler ,DRV_ACD_IRQ_Inline_Handler,DRV_ADC_SEQ_DEVICE_ID_ADC ## id) #define DRV_ADC_SEQ_DEVICE_IRQ_LIST
#define madc_seq1_madc_seq_result_current_val_Msk
DRV_ADC_STATE_MEASUREMENT_E eActiveMeasurement
DRV_CALLBACK_F fnWrapCallback
DRV_ADC_SEQ_CONFIGURATION_T tConfiguration
#define madc_seq0_madc_seq_m1_adr_offset_Msk
#define DRV_DEF_REPEAT_EVAL(...)
struct madc_Type::@4208::@4221 madc_adc01_static_cfg_b
#define madc_seq1_madc_seq_result_current_valid_Msk
struct madc_Type::@4210::@4222 madc_adc23_static_cfg_b
Structure containing the state of the adc sequencer.
struct DRV_ADC_HANDLE_Ttag DRV_ADC_HANDLE_T
Type definition of the adc handle structure.
DRV_ADC_STATIC_CFG_T tStaticCfg23
#define madc_seq1_madc_seq_result_last_valid_Msk
#define madc_seq1_madc_seq_result_current_val_Pos
#define madc_seq0_madc_seq_irq_masked_m5_cmpl_Pos
#define madc_seq0_madc_seq_irq_masked_m7_cmpl_Pos
#define DRV_LOCK_INITIALIZER
Initializer of the type to be locked as rvalue is in default the mutex initializer.
void * pMeasurementCompleteCallbackHandle[DRV_ADC_MEASUREMENTS_MAX]
__IOM uint32_t madc_seq_m4
DRV_ADC_SEQ_MEAS_INPUT_CHANNEL_E
Input channel multiplexer setting.
#define madc_seq1_madc_seq_result_last_val_Msk
__IOM uint32_t madc_seq_tracking_time_mux0
DRV_STATUS_E DRV_ADC_Seq_Init(DRV_ADC_SEQ_HANDLE_T *const ptSequencer, DRV_ADC_HANDLE_T *const ptDriver)
Initializes the adc sequencer and its handle by the given configuration.
void DRV_NVIC_DisableIRQ(IRQn_Type IRQn)
This method disables a given interrupt.
#define DRV_ADC_SEQ_DEVICE_COUNT
DRV_ADC_SEQ_DEVICE_ID_E eDeviceID
#define madc_seq0_madc_seq_result_current_mnr_Pos
#define madc_seq0_madc_seq_irq_masked_m0_cmpl_Pos
struct madc_seq0_Type::@4245::@4292 madc_seq_ms_en_b
__IOM uint32_t madc_seq_tracking_time_mux5
__IOM uint32_t madc_seq_m0
#define madc_seq1_madc_seq_status_m_nr_Msk
DRV_STATUS_E DRV_ADC_Seq_Start(DRV_ADC_SEQ_HANDLE_T *const ptSequencer)
Starts the given adc sequencer.
struct madc_seq0_Type::@4249::@4294 madc_seq_m0_b
struct madc_seq0_Type::@4227::@4283 madc_seq_cfg_b
DRV_ADC_SEQ_CHANNEL_TRACKING_TIME_E eChannelTrackingTime[DRV_ADC_INPUTS_MAX]
#define madc_seq0_madc_seq_m6_adr_offset_Msk
DRV_ADC_SEQ_MEASUREMENT_E
Measurements of the sequencer.
DRV_ADC_HANDLE_T * ptParent
struct madc_seq0_Type::@4251::@4295 madc_seq_m1_b
The handle of the driver.
void * pSequenceCompleteCallbackHandle
void DRV_NVIC_EnableIRQ(IRQn_Type IRQn)
This method enables a given interrupt.
DRV_ADC_DEVICE_T * ptDevice
#define DRV_ADC_SEQ_DEVICE_LIST
#define DRV_ADC_MEASUREMENTS_MAX
DRV_STATUS_E DRV_ADC_Seq_GetLastSample(DRV_ADC_SEQ_HANDLE_T *const ptSequencer, uint32_t *const pulSample, uint8_t *const pbMeasNr)
Stores the last sample of the the given adc.
DRV_ADC_SEQ_CLK_SYNC_E eClkSync
DRV_ADC_SEQ_CONTINUOUS_MODE_E
Continuous or Single Shot mode of the device and api.
DRV_ADC_SEQ_MEAS_OVERSAMPLING_E eOversample
__IM uint32_t madc_seq_status
DRV_CALLBACK_F fnSequenceCompleteCallback
__IOM uint32_t madc_seq_irq_mask_reset
DRV_STATUS_E DRV_ADC_Start(DRV_ADC_HANDLE_T *const ptDriver, DRV_ADC_SEQ_DEVICE_MSK_E eSequencerMask)
Starts the sequencers given by the mask (software trigger).
DRV_ADC_SEQ_MEAS_T tMeasurement[DRV_ADC_MEASUREMENTS_MAX]
#define madc_seq0_madc_seq_cmd_run_Msk
DRV_STATUS_E DRV_ADC_Seq_GetState(DRV_ADC_SEQ_HANDLE_T *const ptSequencer, DRV_ADC_STATE_T *const ptState)
Aquires the state of the given adc sequencer.
#define madc_seq0_madc_seq_m0_oversample_Pos
__IOM uint32_t madc_seq_m1
DRV_STATUS_E DRV_ADC_Driver_DeInit(DRV_ADC_HANDLE_T *const ptDriver)
Deinitializes the adc device and handle.
DRV_ADC_SEQ_32Bit_MODE_E e32BitMode
#define DRV_ADC_DEVICE_COUNT
__IOM uint32_t madc_seq_irq_raw
#define DRV_LOCK(__HANDLE__)
A function calling the trylock of the mutex and returning locked in case it is blocked.
static DRV_ADC_DEVICE_T *const s_apDeviceAddressTable[DRV_ADC_DEVICE_COUNT]
Table of the device addresses.
DRV_ADC_SEQ_DMA_MODE_E eDmaModeDisable
__IM uint32_t madc_seq_result_last
struct madc_seq0_Type::@4261::@4300 madc_seq_m6_b
__IOM uint32_t madc_seq_m6
__IOM uint32_t madc_start
DRV_ADC_SEQ_VREF_VDD3_E eVrefVdd3
#define madc_seq0_madc_seq_result_current_val_Msk
__IOM uint32_t madc_seq_m3
__STATIC_INLINE void DRV_ACD_IRQ_SaveResult(DRV_ADC_SEQ_HANDLE_T *const ptSequencer, DRV_ADC_SEQ_MEASUREMENT_E const eMeasurement)
#define madc_seq0_madc_seq_irq_masked_m1_cmpl_Pos
#define madc_seq0_madc_seq_irq_masked_seq_cmpl_Pos
DRV_ADC_VREF_BUFFER_E eVrefBufferEnable
#define DRV_ADC_INPUTS_MAX
DRV_STATUS_E DRV_ADC_Seq_GetSample(DRV_ADC_SEQ_HANDLE_T *const ptSequencer, uint32_t *const pulSample, uint8_t *const pbMeasNr)
Stores the current acquired sample of the the given adc.
__IOM uint32_t madc_seq_irq_mask_set
DRV_ADC_SEQ_MEAS_OVERSAMPLING_E
Number of samples minus one to sum for this measurement i.e. 0:sum 1 samples, 1:sum 2 samples...
This file contains all the functions prototypes for the peripheral module driver. ...
#define DRV_ADC_DEVICE_LIST
DRV_ADC_CLK_PERIOD_E eAdcClckPeriod
DRV_ADC_SEQ_CLK_PERIOD_E eClkPeriod
DRV_STATUS_E DRV_ADC_Stop(DRV_ADC_HANDLE_T *const ptDriver, DRV_ADC_SEQ_DEVICE_MSK_E eSequencerMask)
Stops the sequencers given by the mask.
#define madc_seq0_madc_seq_irq_masked_m6_cmpl_Pos
DRV_ADC_SEQ_BASE_ADDRESS_E eBaseAdr
DRV_STATUS_E DRV_ADC_Seq_DeInit(DRV_ADC_SEQ_HANDLE_T *const ptSequencer)
Deinitializes the adc sequencer and its handle.
static DRV_ADC_SEQ_HANDLE_T * s_apHandleAddressTable[DRV_ADC_SEQ_DEVICE_COUNT]
Used for mapping the handle to an interrupt.
static IRQn_Type const s_apHandleIRQnTable[DRV_ADC_SEQ_DEVICE_COUNT]
Table of the IRQ vector numbers.
__IOM uint32_t madc_seq_tracking_time_mux7
__IOM uint32_t madc_seq_ms_baseadr
struct madc_seq0_Type::@4265::@4302 madc_seq_cmd_b
#define DRV_ADC_SEQ_CATCHED_NO_RESULT
Result was not accessible after the measurement.
__IOM uint32_t madc_seq_m5
struct madc_seq0_Type::@4263::@4301 madc_seq_m7_b
#define madc_seq0_madc_seq_irq_masked_m3_cmpl_Pos
__IM uint32_t madc_seq_result_current
__IOM uint32_t madc_seq_tracking_time_mux2
DRV_ADC_SEQ_BUFFER_T tBuffer
#define madc_seq0_madc_seq_irq_masked_m4_cmpl_Pos
__IOM uint32_t madc_seq_tracking_time_mux4
DRV_ADC_STATE_MEASUREMENT_E
The enumeration for the available measurements.
DRV_ADC_POWER_DOWN_E ePowerDown
void(* DRV_CALLBACK_F)(void *pvDriverHandle, void *pvUserHandle)
The definition of callbacks used in the driver.
#define madc_seq0_madc_seq_m0_adr_offset_Msk
DRV_ADC_SEQ_HANDLE_T * aptAdcSequencer[4]
#define madc_seq0_madc_seq_irq_masked_m2_cmpl_Pos
struct madc_Type::@4206::@4220 madc_cfg_b
DRV_STATUS_E
DRV Status structures definition.
DRV_ADC_SEQ_DEVICE_MSK_E
The adc sequencer device IDs.
#define madc_seq0_madc_seq_m0_trigger_Pos
DRV_CALLBACK_F fnMeasurementCompleteCallback[DRV_ADC_MEASUREMENTS_MAX]
#define madc_seq1_madc_seq_result_last_mnr_Msk
DRV_STATUS_E DRV_ADC_Seq_Reset(DRV_ADC_SEQ_HANDLE_T *const ptSequencer)
Reset the given adc sequencer.
DRV_ADC_STATIC_CFG_T tStaticCfg01
__IOM uint32_t madc_seq_tracking_time_mux3
#define madc_seq1_madc_seq_result_current_mnr_Pos
__IOM uint32_t madc_seq_cmd
struct madc_seq0_Type::@4253::@4296 madc_seq_m2_b
struct madc_seq0_Type::@4255::@4297 madc_seq_m3_b
#define madc_seq0_madc_seq_m4_adr_offset_Msk
#define madc_seq0_madc_seq_m7_adr_offset_Msk
__IOM uint32_t madc_seq_m2
DRV_ADC_SEQ_DEVICE_T * ptDevice
DRV_ADC_SEQ_MEAS_ADR_OFFSET_E eAdrOffset
The handle of the ADC driver.
__STATIC_INLINE void DRV_ACD_IRQ_Inline_Handler(DRV_ADC_SEQ_DEVICE_ID_E const eDeviceID)
void DRV_NVIC_ClearPendingIRQ(IRQn_Type IRQn)
This method clears the pending state of a given interrupt.
#define madc_seq1_madc_seq_result_last_mnr_Pos
#define madc_seq0_madc_seq_m0_mux_Pos
__IOM uint32_t madc_seq_m7
DRV_STATUS_E DRV_ADC_Driver_Init(DRV_ADC_HANDLE_T *const ptDriver)
Initializes the adc device and handle by the given configuration.
#define DRV_ACD_IRQHandler_Generator(id, _)
#define madc_seq0_madc_seq_result_last_val_Msk
#define madc_seq0_madc_seq_m0_mux_Msk
DRV_ADC_SEQ_MEAS_TRIGGER_E
Trigger condition for measurement.
#define madc_seq1_madc_seq_status_m_nr_Pos
volatile uint32_t ulPosition
__IOM uint32_t madc_seq_tracking_time_mux6
#define madc_seq0_madc_seq_m3_adr_offset_Msk
#define madc_seq1_madc_seq_result_current_mnr_Msk
__IOM uint32_t madc_seq_tracking_time_mux1
#define madc_seq1_madc_seq_status_adc_half_clock_cycle_Msk
DRV_STATUS_E DRV_ADC_Seq_SetSampleSeriesBuffer(DRV_ADC_SEQ_HANDLE_T *const ptSequencer, uint16_t *pulSampleSeries, size_t tSize, DRV_CALLBACK_F fnCallback, void *pUser)
Stores a series of aquired sample of the given adc.
DRV_STATUS_E DRV_ADC_Seq_SetMode(DRV_ADC_SEQ_HANDLE_T *const ptSequencer, DRV_ADC_SEQ_CONTINUOUS_MODE_E eMode)
Set mode of the sequencer.
struct madc_seq0_Type::@4257::@4298 madc_seq_m4_b
#define DRV_UNLOCK(__HANDLE__)
The release function used.
struct DRV_ADC_SEQ_HANDLE_Ttag DRV_ADC_SEQ_HANDLE_T
Type definition of the adc sequencer handle structure.
DRV_ADC_SEQ_MEAS_ENABLE_E eEnable
DRV_ADC_SOFT_RESET_E eSoftReset
DRV_ADC_CONFIGURATION_T tConfiguration
DRV_STATUS_E DRV_ADC_Seq_Stop(DRV_ADC_SEQ_HANDLE_T *const ptSequencer)
Stops the given adc sequencer.
void * pWrapCallbackkHandle
#define madc_seq0_madc_seq_m0_trigger_Msk
DRV_STATUS_E DRV_ADC_Seq_Meas_ChangeConfig(DRV_ADC_SEQ_HANDLE_T *const ptSequencer, DRV_ADC_SEQ_MEASUREMENT_E eMeasurement, DRV_ADC_SEQ_MEAS_INPUT_CHANNEL_E eInputChannel, DRV_ADC_SEQ_MEAS_OVERSAMPLING_E eOversampling, DRV_ADC_SEQ_MEAS_TRIGGER_E eTrigger)
Changes the parameters of the given adc sequencer measurement.
DRV_ADC_SEQ_MEAS_TRIGGER_E eTrigger
DRV_ADC_SEQ_CLK_PHASE_E eClkPhase
#define madc_seq1_madc_seq_result_last_val_Pos
#define madc_seq0_madc_seq_result_last_mnr_Pos
#define madc_seq0_madc_seq_m5_adr_offset_Msk
DRV_OPERATION_MODE_E eOperationMode
static DRV_ADC_SEQ_DEVICE_T *const s_apSubDeviceAddressTable[DRV_ADC_SEQ_DEVICE_COUNT]
Table of the sequencer addresses.
#define madc_seq0_madc_seq_m0_oversample_Msk
#define madc_seq1_madc_seq_status_adc_half_clock_cycle_Pos
struct madc_seq0_Type::@4259::@4299 madc_seq_m5_b
DRV_ADC_SEQ_MEAS_INPUT_CHANNEL_E eInputChannel
#define madc_seq0_madc_seq_m2_adr_offset_Msk
DRV_ADC_SEQ_CONTINUOUS_MODE_E eContinuousMode