|
Zephyr API Documentation 4.3.0-rc1
A Scalable Open Source RTOS
|
Decodes a single raw data buffer. More...
#include <zephyr/drivers/adc.h>
Data Fields | |
| int(* | get_frame_count )(const uint8_t *buffer, uint32_t channel, uint16_t *frame_count) |
| Get the number of frames in the current buffer. | |
| int(* | get_size_info )(struct adc_dt_spec adc_spec, uint32_t channel, size_t *base_size, size_t *frame_size) |
| Get the size required to decode a given channel. | |
| int(* | decode )(const uint8_t *buffer, uint32_t channel, uint32_t *fit, uint16_t max_count, void *data_out) |
Decode up to max_count samples from the buffer. | |
| bool(* | has_trigger )(const uint8_t *buffer, enum adc_trigger_type trigger) |
| Check if the given trigger type is present. | |
Decodes a single raw data buffer.
| int(* adc_decoder_api::decode) (const uint8_t *buffer, uint32_t channel, uint32_t *fit, uint16_t max_count, void *data_out) |
Decode up to max_count samples from the buffer.
Decode samples of channel across multiple frames. If there exist multiple instances of the same channel, channel_index is used to differentiate them.
| [in] | buffer | The buffer provided on the RTIO context |
| [in] | channel | The channel to decode |
| [in,out] | fit | The current frame iterator |
| [in] | max_count | The maximum number of channels to decode. |
| [out] | data_out | The decoded data |
| int(* adc_decoder_api::get_frame_count) (const uint8_t *buffer, uint32_t channel, uint16_t *frame_count) |
Get the number of frames in the current buffer.
| [in] | buffer | The buffer provided on the RTIO context. |
| [in] | channel | The channel to get the count for |
| [out] | frame_count | The number of frames on the buffer (at least 1) |
| int(* adc_decoder_api::get_size_info) (struct adc_dt_spec adc_spec, uint32_t channel, size_t *base_size, size_t *frame_size) |
Get the size required to decode a given channel.
When decoding a single frame, use base_size. For every additional frame, add another frame_size. As an example, to decode 3 frames use: 'base_size + 2 * frame_size'.
| [in] | adc_spec | ADC Specs |
| [in] | channel | The channel to query |
| [out] | base_size | The size of decoding the first frame |
| [out] | frame_size | The additional size of every additional frame |
| bool(* adc_decoder_api::has_trigger) (const uint8_t *buffer, enum adc_trigger_type trigger) |
Check if the given trigger type is present.
| [in] | buffer | The buffer provided on the RTIO context |
| [in] | trigger | The trigger type in question |