Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
adc_arch.h File Reference

Driver for the analog to digital converters in Linux based systems. More...

Go to the source code of this file.

Data Structures

struct  adc_t
 

Functions

void adc_enable (struct adc_t *adc, uint8_t value)
 Start or stop the ADC readings. More...
 
int adc_read (struct adc_t *adc, uint16_t *buf, uint16_t size)
 Read the ADC buffer from the driver. More...
 

Detailed Description

Driver for the analog to digital converters in Linux based systems.

Definition in file adc_arch.h.


Data Structure Documentation

◆ adc_t

struct adc_t

Definition at line 34 of file adc_arch.h.

Data Fields
uint16_t buf_length ADC buffer length.
uint8_t * channels Channels used in the iio device.
uint8_t channels_cnt Amount of channels.
uint8_t dev_id The iio device ID.

Function Documentation

◆ adc_enable()

void adc_enable ( struct adc_t adc,
uint8_t  value 
)

Start or stop the ADC readings.

Parameters
[in]*adcThe ADC to start the readings for
[in]value1 to enable and 0 to disable

Definition at line 101 of file adc_arch.c.

References adc_t::dev_id, and write_sysfs_int().

Referenced by sonar_bebop_read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adc_read()

int adc_read ( struct adc_t adc,
uint16_t buf,
uint16_t  size 
)

Read the ADC buffer from the driver.

Parameters
[in]*adcThe adc you want to read from
[out]*bufOutput values
[in]sizeThe amount of bytes you want to read

Definition at line 113 of file adc_arch.c.

References adc_t::dev_id, and fd.

Referenced by sonar_bebop_read().

+ Here is the caller graph for this function: