📄 adc_interface.h
字号:
gAdcErrModuleBusy_c - if the module is busy (the module was programmed to sample data from
ADC pins and was turned ON).
gAdcErrNullPointer_c - if adcConfig parameter is NULL.
gAdcErrNoError_c - in rest.
Revision history:
Date Author Comments
---------- ---------------------- -------
31.07.2007 B04839 Created
*/
extern AdcErr_t Adc_SetConfig(const AdcConfig_t *adcConfig);
/*================================================================================================*/
/*===== Adc_SetConvCtrl =====*/
/**
@brief Set the conversion control of the ADC module specified as parameter.
@param AdcModule_t adcModule - input parameter: instance of the ADC module (primary/secondary
ADC module) that will be configured.
@param const AdcConvCtrl_t *adcConvCtrl - input parameter: pointer to a structure containing the
configuration parameters.
@return parameter of type AdcErr_t with following possible values:
gAdcErrWrongParameter - if the adcModule value is grater or equal than gAdcMaxModule_c.
gAdcErrNullPointer_c - if adcConfig parameter is NULL.
gAdcErrNoError_c - in rest.
Revision history:
Date Author Comments
---------- ---------------------- -------
31.07.2007 B04839 Created
*/
extern AdcErr_t Adc_SetConvCtrl(AdcModule_t adcModule, const AdcConvCtrl_t *adcConvCtrl);
/*================================================================================================*/
/*===== Adc_SetCompCtrl =====*/
/**
@brief Set the conversion control of the ADC module specified as parameter.
@param const AdcCompCtrl_t* adcCompCtrl - input parameter: pointer to a structure containing the
comparison configuration parameters.
@return parameter of type AdcErr_t with following possible values:
gAdcErrNullPointer_c - if adcConfig parameter is NULL.
gAdcErrNoError_c - in rest.
Revision history:
Date Author Comments
---------- ---------------------- -------
31.07.2007 B04839 Created
*/
extern AdcErr_t Adc_SetCompCtrl(const AdcCompCtrl_t *adcCompCtrl);
/*================================================================================================*/
/*===== Adc_SetFifoCtrl =====*/
/**
@brief Set the threshold of the ADC FIFO.
@param uint8_t adcFifoThreshold - input parameter: value of the FIFO treshold.
@return parameter of type AdcErr_t with following possible values:
gAdcErrWrongParameter_c - if the value of adcFifoThreshold exceeds maximum value of the threshold (7).
gAdcErrNoError_c - in rest.
Revision history:
Date Author Comments
---------- ---------------------- -------
31.07.2007 B04839 Created
*/
extern AdcErr_t Adc_SetFifoCtrl(uint8_t adcFifoThreshold);
/*================================================================================================*/
/*===== Adc_GetFifoStatus =====*/
/**
@brief Get the FIFO status (empty/full/filled) and the fill level.
@param AdcFifoStatus_t *fifoStatus - output parameter: pointer to a memory location where the
current FIFO status value will be placed.
@param uint8_t *adcFifoLevel - output parameter: pointer to a memory location where the
current FIFO level value will be placed.
@return parameter of type AdcErr_t with following possible values:
gAdcErrNullPointer_c - if fifoStatus or adcFifoLevel parameter is NULL.
gAdcErrNoError_c - in rest.
Revision history:
Date Author Comments
---------- ---------------------- -------
31.07.2007 B04839 Created
*/
extern AdcErr_t Adc_GetFifoStatus(AdcFifoStatus_t *fifoStatus, uint8_t *adcFifoLevel);
/*================================================================================================*/
/*===== Adc_ReadFifoData =====*/
/**
@brief Read data from the ADC FIFO.
@param AdcFifoData_t *adcFifoData - output parameter: pointer to a memory location where FIFO
data will be placed.
@return parameter of type AdcErr_t with following possible values:
gAdcErrNullPointer_c - if adcFifoData parameter is NULL.
gAdcErrNoError_c - in rest.
Revision history:
Date Author Comments
---------- ---------------------- -------
31.07.2007 B04839 Created
*/
extern AdcErr_t Adc_ReadFifoData(AdcFifoData_t *adcFifoData);
/*================================================================================================*/
/*===== Adc_StartManualConv =====*/
/**
@brief Configure the manual conversion mode of the ADC.
@param AdcModule_t adcModule - input parameter: instance of the ADC module (primary/secondary
ADC module) that will be configured for manual conversion.
@param AdcChannel_t adcChannel - input parameter: channel that will be sampled in manual mode.
@return parameter of type AdcErr_t with following possible values:
gAdcErrWrongParameter_c - if the adcModule value is grater or equal than gAdcMaxModule_c.
gAdcInvalidOp_c - if the current ADC mode is not manual conversion mode.
gAdcErrModuleBusy_c - if the function is called before reading the result of the previous started
conversion.
gAdcErrNoError_c - in rest.
Revision history:
Date Author Comments
---------- ---------------------- -------
31.07.2007 B04839 Created
*/
extern AdcErr_t Adc_StartManualConv(AdcModule_t adcModule, AdcChannel_t adcChannel);
/*================================================================================================*/
/*===== Adc_ManualRead =====*/
/**
@brief Get the conversion result value after manual mode was set and configured.
@param AdcModule_t adcModule - input parameter: instance of the ADC module (primary/secondary
ADC module) that will be configured for manual conversion.
@param uint16_t* adcConvResult - output parameter: pointer to a memory location where the
result of the manual conversion is placed.
@return parameter of type AdcErr_t with following possible values:
gAdcErrWrongParameter_c - if the adcModule value is grater or equal than gAdcMaxModule_c.
gAdcInvalidOp_c - if the current ADC mode is not manual conversion mode.
gAdcErrModuleBusy_c - if the function is called before reading the result of the previous started
conversion.
gAdcErrNullPointer_c - if adcConvResult parameter is NULL.
gAdcErrNoError_c - in rest.
Revision history:
Date Author Comments
---------- ---------------------- -------
31.07.2007 B04839 Created
*/
extern AdcErr_t Adc_ManualRead(AdcModule_t adcModule, uint16_t *adcConvResult);
/*================================================================================================*/
/*===== Adc_SetCallback =====*/
/**
@brief Set the callbacks for ADC events.
@param AdcEvent_t adcEvent - input parameter: the ADC event wherefore the callback is set.
@param AdcEvCallback_t pCallbackFunction - input parameter: pointer to a memory address of the event
callback.
@return parameter of type AdcErr_t with following possible values:
gAdcErrWrongParameter_c - if the adcEvent value is grater or equal than gAdcMaxEvent_c.
gAdcErrNullPointer_c - if pCallbackFunction parameter is NULL.
gAdcErrNoError_c - in rest.
Revision history:
Date Author Comments
---------- ---------------------- -------
31.07.2007 B04839 Created
*/
extern AdcErr_t Adc_SetCallback(AdcEvent_t adcEvent, AdcEvCallback_t pCallbackFunction);
/*================================================================================================*/
/*===== Adc_Isr =====*/
/**
@brief AdC interrupt service routine.
@param None
@return None
Revision history:
Date Author Comments
---------- ---------------------- -------
31.07.2007 B04839 Created
*/
/*================================================================================================*/
extern void Adc_Isr(void);
#endif /* _ADC_INTERFACE_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -