no-OS
adc.h
Go to the documentation of this file.
1 /***************************************************************************/
40 #ifndef ADUCM3029_ADC_H
41 #define ADUCM3029_ADC_H
42 
43 #include <stdint.h>
44 
45 
46 #define ADUCM3029_ADC_NUM_CH 6
47 #define ADUCM3029_CH(x) (1 << x)
48 
49 struct adc_desc;
50 
56  /* To add options in the future */
57  uint32_t reserved;
58 };
59 
60 /* Activate channels for reading */
62  uint32_t mask);
63 
64 /* Read adc channels */
65 int32_t aducm3029_adc_read(struct adc_desc *desc, uint16_t *buff,
66  uint32_t nb_samples);
67 
68 /* Initialize the ADC */
69 int32_t aducm3029_adc_init(struct adc_desc **desc,
70  struct adc_init_param *param);
71 
72 /* Free the resources allocated by adc_init(). */
73 int32_t aducm3029_adc_remove(struct adc_desc *desc);
74 
75 #endif
adc_init_param
This can be extended in the future, no utility for the moment.
Definition: adc.h:55
hweight8
uint32_t hweight8(uint32_t word)
aducm3029_adc_init
int32_t aducm3029_adc_init(struct adc_desc **desc, struct adc_init_param *param)
Allocate adc_desc and initialize adc.
Definition: adc.c:126
adc_desc::ch_mask
uint32_t ch_mask
Definition: adc.c:59
adc_desc
Adc descriptor.
Definition: adc.c:53
adc.h
Interface of adc.c.
aducm3029_adc_update_active_channels
int32_t aducm3029_adc_update_active_channels(struct adc_desc *desc, uint32_t mask)
Activate adc channels.
Definition: adc.c:68
adc_desc::dev
ADI_ADC_HANDLE dev
Definition: adc.c:57
aducm3029_adc_update_active_channels
int32_t aducm3029_adc_update_active_channels(struct adc_desc *desc, uint32_t mask)
Activate adc channels.
Definition: adc.c:68
ADUCM3029_DEV_ID
#define ADUCM3029_DEV_ID
Definition: adc.c:47
error.h
Error codes definition.
adc_init_param::reserved
uint32_t reserved
Definition: adc.h:57
aducm3029_adc_read
int32_t aducm3029_adc_read(struct adc_desc *desc, uint16_t *buff, uint32_t nb_samples)
Read adc data. aducm3029_adc_update_active_channels should be called in order to enable channeles.
Definition: adc.c:88
aducm3029_adc_read
int32_t aducm3029_adc_read(struct adc_desc *desc, uint16_t *buff, uint32_t nb_samples)
Read adc data. aducm3029_adc_update_active_channels should be called in order to enable channeles.
Definition: adc.c:88
NULL
#define NULL
Definition: wrapper.h:64
SUCCESS
#define SUCCESS
Definition: error.h:52
aducm3029_adc_remove
int32_t aducm3029_adc_remove(struct adc_desc *desc)
Dealocate resources allocated by aducm3029_adc_init.
Definition: adc.c:191
UNUSED_PARAM
#define UNUSED_PARAM(x)
Definition: util.h:112
aducm3029_adc_init
int32_t aducm3029_adc_init(struct adc_desc **desc, struct adc_init_param *param)
Allocate adc_desc and initialize adc.
Definition: adc.c:126
adc_desc::dev_mem
uint8_t dev_mem[ADI_ADC_MEMORY_SIZE]
Definition: adc.c:55
aducm3029_adc_remove
int32_t aducm3029_adc_remove(struct adc_desc *desc)
Dealocate resources allocated by aducm3029_adc_init.
Definition: adc.c:191
util.h
Implementation of utility functions.