mirror of
https://github.com/Ai-Thinker-Open/Ai-Thinker-Open_RTL8710BX_ALIOS_SDK.git
synced 2026-08-27 17:01:31 +00:00
rel_1.6.0 init
This commit is contained in:
commit
27b3e2883d
19359 changed files with 8093121 additions and 0 deletions
48
Living_SDK/include/hal/soc/adc.h
Normal file
48
Living_SDK/include/hal/soc/adc.h
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
|
||||
*/
|
||||
|
||||
#ifndef HAL_ADC_H
|
||||
#define HAL_ADC_H
|
||||
|
||||
typedef struct {
|
||||
uint32_t sampling_cycle; /* sampling period in number of ADC clock cycles */
|
||||
} adc_config_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t port; /* adc port */
|
||||
adc_config_t config; /* adc config */
|
||||
void *priv; /* priv data */
|
||||
} adc_dev_t;
|
||||
|
||||
/**
|
||||
* Initialises an ADC interface, Prepares an ADC hardware interface for sampling
|
||||
*
|
||||
* @param[in] adc the interface which should be initialised
|
||||
*
|
||||
* @return 0 : on success, EIO : if an error occurred with any step
|
||||
*/
|
||||
int32_t hal_adc_init(adc_dev_t *adc);
|
||||
|
||||
/**
|
||||
* Takes a single sample from an ADC interface
|
||||
*
|
||||
* @param[in] adc the interface which should be sampled
|
||||
* @param[out] output pointer to a variable which will receive the sample
|
||||
* @param[in] timeout ms timeout
|
||||
*
|
||||
* @return 0 : on success, EIO : if an error occurred with any step
|
||||
*/
|
||||
int32_t hal_adc_value_get(adc_dev_t *adc, void *output, uint32_t timeout);
|
||||
|
||||
/**
|
||||
* De-initialises an ADC interface, Turns off an ADC hardware interface
|
||||
*
|
||||
* @param[in] adc the interface which should be de-initialised
|
||||
*
|
||||
* @return 0 : on success, EIO : if an error occurred with any step
|
||||
*/
|
||||
int32_t hal_adc_finalize(adc_dev_t *adc);
|
||||
|
||||
#endif /* HAL_ADC_H */
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue