no-OS
Loading...
Searching...
No Matches
aducm3029_adc.h File Reference

Interface of aducm3029_adc.c. More...

#include <stdint.h>
Include dependency graph for aducm3029_adc.h:

Classes

struct  adc_init_param
 This can be extended in the future, no utility for the moment. More...
 

Macros

#define ADUCM3029_ADC_NUM_CH   6
 
#define ADUCM3029_CH(x)
 

Functions

int32_t aducm3029_adc_update_active_channels (struct adc_desc *desc, uint32_t mask)
 Activate adc channels.
 
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.
 
int32_t aducm3029_adc_init (struct adc_desc **desc, struct adc_init_param *param)
 Allocate adc_desc and initialize adc.
 
int32_t aducm3029_adc_remove (struct adc_desc *desc)
 Dealocate resources allocated by aducm3029_adc_init.
 

Detailed Description

Interface of aducm3029_adc.c.

Author
Mihail Chindris (mihai.nosp@m.l.ch.nosp@m.indri.nosp@m.s@an.nosp@m.alog..nosp@m.com)

Copyright 2020(c) Analog Devices, Inc.

SPDX-License-Identifier: BSD-3-Clause

Macro Definition Documentation

◆ ADUCM3029_ADC_NUM_CH

#define ADUCM3029_ADC_NUM_CH   6

◆ ADUCM3029_CH

#define ADUCM3029_CH ( x)
Value:
(1 << x)

Function Documentation

◆ aducm3029_adc_init()

int32_t aducm3029_adc_init ( struct adc_desc ** desc,
struct adc_init_param * param )

Allocate adc_desc and initialize adc.

Parameters
desc- Adc descriptor
param- Initialization parameter
Returns
0 in case of success, negative value otherwise.

◆ 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.

Parameters
desc- Adc descriptor
buff- Buffer where to store data. The available size should be number of activated channels * nb_samples.
nb_samples- Number of samples to read for each channel.
Returns
0 in case of success, negative value otherwise.

◆ aducm3029_adc_remove()

int32_t aducm3029_adc_remove ( struct adc_desc * desc)

Dealocate resources allocated by aducm3029_adc_init.

Parameters
desc- Adc descriptor
Returns
0

◆ aducm3029_adc_update_active_channels()

int32_t aducm3029_adc_update_active_channels ( struct adc_desc * desc,
uint32_t mask )

Activate adc channels.

Parameters
desc- Adc descriptor
mask- Channels to activates. Use ADUCM3029_CH define
Returns
0 in case of success, negative value otherwise.