Platform drivers for Mbed.

Dependents:   EVAL-CN0535-FMCZ EVAL-CN0535-FMCZ EVAL-AD568x-AD569x EVAL-AD7606 ... more

Embed: (wiki syntax)

« Back to documentation index

adc_data_capture.h File Reference

adc_data_capture.h File Reference

Header for ADC data capture interfaces. More...

Go to the source code of this file.

Data Structures

struct  data_capture_ops
 Structure holding function pointers that points to device specific data capture functions. More...

Functions

int32_t read_single_sample (uint8_t input_chn, uint32_t *raw_data)
 Function to read the single ADC sample (raw data) for input channel.
size_t read_buffered_data (char *pbuf, size_t bytes, size_t offset, uint32_t active_chns_mask, uint8_t sample_size_in_bytes)
 Function to read and align the ADC buffered raw data.
void store_requested_samples_count (size_t bytes, uint8_t sample_size_in_bytes)
 Function to store the number of actul requested ADC samples from IIO client.
void start_data_capture (uint32_t ch_mask, uint8_t num_of_chns)
 Function to trigger ADC conversion for new READBUFF request from IIO client (for active channels)
void stop_data_capture (void)
 Function to stop ADC data capture.
void data_capture_callback (void *ctx, uint32_t event, void *extra)
 This is an ISR (Interrupt Service Routine) to monitor end of conversion event.

Detailed Description

Header for ADC data capture interfaces.

Copyright (c) 2021 Analog Devices, Inc. All rights reserved.

This software is proprietary to Analog Devices, Inc. and its licensors. By using this software you agree to the terms of the associated Analog Devices Software License Agreement.

Definition in file adc_data_capture.h.


Function Documentation

void data_capture_callback ( void *  ctx,
uint32_t  event,
void *  extra 
)

This is an ISR (Interrupt Service Routine) to monitor end of conversion event.

Parameters:
*ctx[in]- Callback context (unused)
event[in]- Callback event (unused)
extra[in]- Callback extra (unused)
Returns:
none

This is an Interrupt callback function/ISR invoked in synchronous/asynchronous manner depending upon the application implementation. The conversion results are read into acquisition buffer and control continue to sample next channel. This continues until conversion is stopped (through IIO client command)

Note:
This function also handles the logic to align the first channel data after every 'n' sample transmission. This is required to visualize data properly on IIO client application.

Definition at line 268 of file adc_data_capture.c.

size_t read_buffered_data ( char *  pbuf,
size_t  bytes,
size_t  offset,
uint32_t  active_chns_mask,
uint8_t  sample_size_in_bytes 
)

Function to read and align the ADC buffered raw data.

Parameters:
device[in]-Device instance
pbuf[out]- Buffer to load ADC raw data
bytes[in]- Number of bytes to be read
active_chns_mask[in]- Active channels mask
Returns:
Number of bytes read

Definition at line 218 of file adc_data_capture.c.

int32_t read_single_sample ( uint8_t  input_chn,
uint32_t *  raw_data 
)

Function to read the single ADC sample (raw data) for input channel.

Parameters:
input_chn[in]- Input channel to sample and read data for
raw_data[in,out]-ADC raw data
Returns:
SUCCESS in case of success, FAILURE otherwise

Definition at line 111 of file adc_data_capture.c.

void start_data_capture ( uint32_t  ch_mask,
uint8_t  num_of_chns 
)

Function to trigger ADC conversion for new READBUFF request from IIO client (for active channels)

Parameters:
ch_mask[in]- Channels to enable for data capturing
num_of_chns[in]- ADC channel count
Returns:
none

Definition at line 345 of file adc_data_capture.c.

void stop_data_capture ( void   )

Function to stop ADC data capture.

Returns:
none

Definition at line 403 of file adc_data_capture.c.

void store_requested_samples_count ( size_t  bytes,
uint8_t  sample_size_in_bytes 
)

Function to store the number of actul requested ADC samples from IIO client.

Parameters:
bytes[in]- Number of bytes corresponding to requested samples
sample_size_in_bytes[in]- Size of each sample in bytes (eqv to ADC resolution)
Returns:
none
Note:
The information about sample and buffer size is required for continuous data acquisition

Definition at line 153 of file adc_data_capture.c.