|
SmartSnippets DA1459x SDK
|
Go to the documentation of this file.
44 #if (dg_configGPADC_ADAPTER == 1)
67 #ifndef CONFIG_GPADC_USE_ASYNC_TRANSACTIONS
68 #define CONFIG_GPADC_USE_ASYNC_TRANSACTIONS (1)
82 #if dg_configUSE_SYS_ADC
83 #define CONFIG_GPADC_USE_SYNC_TRANSACTIONS (1)
85 #ifndef CONFIG_GPADC_USE_SYNC_TRANSACTIONS
86 #define CONFIG_GPADC_USE_SYNC_TRANSACTIONS (1)
114 #define HW_GPADC_1 ((void *)GPADC_BASE)
123 const HW_GPADC_ID
id;
137 AD_GPADC_ERROR_NONE = 0,
138 AD_GPADC_ERROR_HANDLE_INVALID = -1,
139 AD_GPADC_ERROR_CHANGE_NOT_ALLOWED = -2,
140 AD_GPADC_ERROR_ADAPTER_NOT_OPEN = -3,
141 AD_GPADC_ERROR_CONFIG_INVALID = -4,
142 AD_GPADC_ERROR_ASYNC_READ_IN_PROGRESS = -5,
143 AD_GPADC_ERROR_TIMEOUT = -6,
144 AD_GPADC_ERROR_OTHER = -7,
145 AD_GPADC_ERROR_IO_CFG_INVALID = -8,
165 #if (CONFIG_GPADC_USE_SYNC_TRANSACTIONS == 1)
184 #if (CONFIG_GPADC_USE_ASYNC_TRANSACTIONS == 1)
Definition of API for the GPADC Low Level Driver.
int ad_gpadc_io_config(const HW_GPADC_ID id, const ad_gpadc_io_conf_t *io, AD_IO_CONF_STATE state)
Initialize controller pins to on / off io configuration.
int16_t hw_gpadc_convert_to_celsius_x100_util(const hw_gpadc_config_t *cfg, uint16_t raw_val)
Convert a 16-bit, left-aligned, raw value to temperature. For accurate conversions using this functio...
int ad_gpadc_conv_to_mvolt(const ad_gpadc_driver_conf_t *drv, uint32_t raw_value)
Convert raw value read from GPADC to voltage in mV. The same configuration which was used to obtain t...
const ad_gpadc_io_conf_t * io
Definition: ad_gpadc.h:124
uint16_t ad_gpadc_get_source_max(const ad_gpadc_driver_conf_t *drv)
Return maximum value that can be read for ADC source.
AD_GPADC_ERROR
enum with return values of API calls
Definition: ad_gpadc.h:136
OS abstraction layer API.
GPADC controller configuration.
Definition: ad_gpadc.h:122
ad_gpadc_handle_t ad_gpadc_open(const ad_gpadc_controller_conf_t *conf)
Open GPADC controller.
int ad_gpadc_close(ad_gpadc_handle_t p, bool force)
Close GPADC controller.
void(* ad_gpadc_user_cb)(void *user_data, int value)
GPADC adapter callback function.
Definition: ad_gpadc.h:154
void * ad_gpadc_handle_t
GPADC Handle returned by ad_gpadc_open()
Definition: ad_gpadc.h:131
ad_io_conf_t input0
Definition: ad_gpadc.h:97
Adapters shared definitions.
AD_IO_CONF_STATE
Adapters IO configuration state.
Definition: ad.h:65
int ad_gpadc_reconfig(const ad_gpadc_handle_t p, const ad_gpadc_driver_conf_t *drv)
Reconfigure GPADC controller.
void ad_gpadc_init(void)
Initialize GPADC adapter and some required variables.
ADC configuration.
Definition: hw_gpadc_v2.h:159
ad_io_conf_t input1
Definition: ad_gpadc.h:98
const HW_GPADC_ID id
Definition: ad_gpadc.h:123
int ad_gpadc_read_nof_conv(const ad_gpadc_handle_t handle, int nof_conv, uint16_t *outbuf)
Read synchronously nof_conv conversions from the selected source.
uint16_t ad_gpadc_conv_raw_to_batt_mvolt(const ad_gpadc_driver_conf_t *drv, uint32_t raw_value)
Convert raw value read from GPADC to battery voltage in mV. The same configuration which was used to ...
Definition of API for the GPIO Low Level Driver.
__STATIC_FORCEINLINE int ad_gpadc_conv_to_temp_x100(const ad_gpadc_driver_conf_t *drv, uint16_t raw_value)
Convert raw value read from GPADC to temperature value in hundredths of degree Celsius.
Definition: ad_gpadc.h:290
const ad_gpadc_driver_conf_t * drv
Definition: ad_gpadc.h:125
Adapters IO configuration.
Definition: ad.h:104
struct ad_gpadc_io_conf ad_gpadc_io_conf_t
GPADC I/O configuration.
GPADC I/O configuration.
Definition: ad_gpadc.h:96
struct ad_gpadc_controller_conf ad_gpadc_controller_conf_t
GPADC controller configuration.
int ad_gpadc_read_nof_conv_async(const ad_gpadc_handle_t handle, int nof_conv, uint16_t *outbuf, ad_gpadc_user_cb read_async_cb, void *user_data)
Read asynchronously nof_conv conversions from the selected source.
hw_gpadc_config_t ad_gpadc_driver_conf_t
GPADC driver configuration.
Definition: ad_gpadc.h:109