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

Implementation of aducm3029_adc.c. More...

#include <drivers/adc/adi_adc.h>
#include "aducm3029_adc.h"
#include "no_os_error.h"
#include <stdio.h>
#include <stdlib.h>
#include "no_os_util.h"
#include "no_os_alloc.h"
Include dependency graph for aducm3029_adc.c:

Classes

struct  adc_desc
 Adc descriptor. More...
 

Macros

#define ADUCM3029_DEV_ID   0
 

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

Implementation 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_DEV_ID

#define ADUCM3029_DEV_ID   0

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.