Header file of ADC Demo Driver.
More...
#include <stdint.h>
#include "iio_types.h"
#include "no_os_irq.h"
Header file of ADC Demo Driver.
- Author
- RNechita (ramon.nosp@m.a.ne.nosp@m.chita.nosp@m.@ana.nosp@m.log.c.nosp@m.om)
Copyright 2021(c) Analog Devices, Inc.
SPDX-License-Identifier: BSD-3-Clause
◆ MAX_ADC_ADDR
◆ TOTAL_ADC_CHANNELS
| #define TOTAL_ADC_CHANNELS 2 |
◆ iio_adc_demo_attributes
| Enumerator |
|---|
| ADC_CHANNEL_ATTR | |
| ADC_GLOBAL_ATTR | |
◆ adc_demo_init()
init function for the adc demo driver
- Parameters
-
| desc | - descriptor for the adc |
| param | - initialization param for adc |
- Returns
- 0 in case of success, negative error code otherwise.
◆ adc_demo_reg_read()
| int32_t adc_demo_reg_read |
( |
struct adc_demo_desc * | desc, |
|
|
uint8_t | reg_index, |
|
|
uint8_t * | readval ) |
read function for the adc demo driver
- Parameters
-
| desc | - descriptor for the adc |
| reg_index | - the address at which we want to read |
| readval- | the value read from register |
- Returns
- 0 in case of success, negative error code otherwise.
◆ adc_demo_reg_write()
| int32_t adc_demo_reg_write |
( |
struct adc_demo_desc * | desc, |
|
|
uint8_t | reg_index, |
|
|
uint8_t | writeval ) |
write function for the adc demo driver
- Parameters
-
| desc | - descriptor for the adc |
| reg_index | - the address at which we want to write |
| writeval | - the value to be written |
- Returns
- 0 in case of success, negative error code otherwise.
◆ adc_demo_remove()
free allocated resources
- Parameters
-
| desc | - descriptor for the adc |
- Returns
- 0 in case of success, -1 otherwise.
◆ adc_demo_trigger_handler()
Handles trigger: reads one data-set and writes it to the buffer.
- Parameters
-
| dev_data | - The iio device data structure. |
- Returns
- ret - Result of the handling procedure. In case of success, the size of the written data is returned.
◆ adc_submit_samples()
function for reading samples from the device.
- Parameters
-
| dev_data | - The iio device data structure. |
- Returns
- the number of read samples.
◆ close_adc_channels()
| int close_adc_channels |
( |
void * | dev | ) |
|
close all channels
- Parameters
-
| dev | - physical instance of an adc device |
- Returns
- 0 in case of success.
◆ update_adc_channels()
| int update_adc_channels |
( |
void * | dev, |
|
|
uint32_t | mask ) |
active adc channels
- Parameters
-
| dev | - descriptor for the adc |
| mask | - active channels mask |
- Returns
- 0 in case of success, -1 otherwise.
◆ sine_lut
| const uint16_t sine_lut[128] |
|
extern |