123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- /**
- * @file hal_adc.h
- * @author Xiao, Lifan (xiaolf6@midea.com)
- * @brief
- * @version 0.1
- * @date 2021-08-09
- *
- * @copyright Copyright (c) 2021
- *
- */
- #ifndef _HAL_ADC_H_
- #define _HAL_ADC_H_
- #include "hal_config.h"
- /****************************************************************
- *
- * Standard Interface
- *
- * *************************************************************/
- /******************************/
- /* Global Interface Variables */
- /******************************/
- /* !!!Important!!! */
- /* Interface Variable Should Not Be Modified By Application */
- /**
- * @brief The raw sampling results
- *
- */
- extern uint16_t *Hal_Adc_RawResults;
- /**
- * @brief The scaled sampling results, calculated by y=a(x+b)
- *
- */
- extern int32_t *Hal_Adc_ScaledResults;
- /*************************/
- /* Global Interface Hook */
- /*************************/
- /**
- * @brief Function hook called at the end of the sampling
- *
- */
- extern void (*Hal_Adc_SamplingCompleteHook)();
- /**************************************/
- /* Platform Layer Interface Functions */
- /**************************************/
- /**
- * @brief Init adc module
- *
- */
- void Hal_Adc_Init();
- /**
- * @brief Read sampling results from the adc peripheral
- *
- */
- void Hal_Adc_Read();
- /**
- * @brief Set the scale of the specified channel
- *
- * @param scale in format q17.15
- * @param channel channel index
- */
- void Hal_Adc_SetScale(int32_t scale, uint8_t channel);
- /**
- * @brief Set the offset of the specified channel
- *
- * @param offset in range 0...4096
- * @param channel channel index
- */
- void Hal_Adc_SetOffset(int16_t offset, uint8_t channel);
- #endif
|