![]() |
no-OS
|
Implementation of iio_adis.c. More...
#include "iio_adis_internals.h"#include "no_os_delay.h"#include "no_os_units.h"#include <stdio.h>#include <string.h>#include "adis.h"#include "adis_internals.h"#include "iio_trigger.h"Macros | |
| #define | ADIS_BURST_DATA_SEL_0_CHN_MASK NO_OS_GENMASK(5, 0) |
| #define | ADIS_BURST_DATA_SEL_1_CHN_MASK NO_OS_GENMASK(12, 7) |
Functions | |
| int | adis_iio_read_reg (void *dev, uint32_t reg, uint32_t *readval) |
| Wrapper for reading adis register. | |
| int | adis_iio_write_reg (void *dev, uint32_t reg, uint32_t writeval) |
| Wrapper for writing to adis register. | |
| int | adis_iio_read_raw (void *dev, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t priv) |
| Handles the read request for raw attribute. | |
| int | adis_iio_read_scale (void *dev, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t priv) |
| Handles the read request for scale attribute. | |
| int | adis_iio_read_offset (void *dev, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t priv) |
| Handles the read request for offset attribute. | |
| int | adis_iio_read_calibbias (void *dev, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t priv) |
| Handles the read request for calibbias attribute. | |
| int | adis_iio_write_calibbias (void *dev, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t priv) |
| Handles the write request for calibbias attribute. | |
| int | adis_iio_read_calibscale (void *dev, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t priv) |
| Handles the read request for calibscale attribute. | |
| int | adis_iio_write_calibscale (void *dev, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t priv) |
| Handles the write request for calibscale attribute. | |
| int | adis_iio_read_lpf (void *dev, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t priv) |
| Handles the read request for lpf attribute. | |
| int | adis_iio_write_lpf (void *dev, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t priv) |
| Handles the write request for lpf attribute. | |
| int | adis_iio_read_sampling_freq (void *dev, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t priv) |
| Handles the read request for sampling frequency attribute. | |
| int | adis_iio_write_sampling_freq (void *dev, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t priv) |
| Handles the write request for sampling frequency attribute. | |
| int | adis_iio_read_gyro_meas_range (struct adis_iio_dev *iio_adis, char *buf) |
| Reads gyroscope measurement range value and returns it in char format. | |
| int | adis_iio_read_debug_attrs (void *dev, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t priv) |
| Handles the read request for debug attributes. | |
| int | adis_iio_write_debug_attrs (void *dev, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t priv) |
| Handles the write request for debug attributes. | |
| int | adis_iio_pre_enable (void *dev, uint32_t mask) |
| API to be called before trigger is enabled. | |
| int | adis_iio_post_disable (void *dev) |
| API to be called after trigger is disabled. | |
| int | adis_iio_trigger_handler (struct iio_device_data *dev_data) |
| Handles trigger: reads one data-set and writes it to the buffer. | |
| int | adis_iio_trigger_handler_with_fifo (struct iio_device_data *dev_data) |
| Handles trigger: reads all available samples in FIFO and writes them to the buffer. | |
Variables | |
| struct iio_attribute | adis_dev_attrs [] |
| struct iio_attribute | adis_iio_anglvel_attrs [] |
| struct iio_attribute | adis_iio_accel_attrs [] |
| struct iio_attribute | adis_iio_temp_attrs [] |
| struct iio_attribute | adis_iio_delta_angl_attrs [] |
| struct iio_attribute | adis_iio_delta_vel_attrs [] |
Implementation of iio_adis.c.
Copyright 2023(c) Analog Devices, Inc.
SPDX-License-Identifier: BSD-3-Clause
| #define ADIS_BURST_DATA_SEL_0_CHN_MASK NO_OS_GENMASK(5, 0) |
| #define ADIS_BURST_DATA_SEL_1_CHN_MASK NO_OS_GENMASK(12, 7) |
| int adis_iio_post_disable | ( | void * | dev | ) |
API to be called after trigger is disabled.
| dev | - The iio device structure. |
| int adis_iio_pre_enable | ( | void * | dev, |
| uint32_t | mask ) |
API to be called before trigger is enabled.
| dev | - The iio device structure. |
| mask | - The active channels mask. |
| int adis_iio_read_calibbias | ( | void * | dev, |
| char * | buf, | ||
| uint32_t | len, | ||
| const struct iio_ch_info * | channel, | ||
| intptr_t | priv ) |
Handles the read request for calibbias attribute.
| dev | - The iio device structure. |
| buf | - Command buffer to be filled with requested data. |
| len | - Length of the received command buffer in bytes. |
| channel | - Command channel info. |
| priv | - Command attribute id. |
| int adis_iio_read_calibscale | ( | void * | dev, |
| char * | buf, | ||
| uint32_t | len, | ||
| const struct iio_ch_info * | channel, | ||
| intptr_t | priv ) |
Handles the read request for calibscale attribute.
| dev | - The iio device structure. |
| buf | - Command buffer to be filled with requested data. |
| len | - Length of the received command buffer in bytes. |
| channel | - Command channel info. |
| priv | - Command attribute id. |
| int adis_iio_read_debug_attrs | ( | void * | dev, |
| char * | buf, | ||
| uint32_t | len, | ||
| const struct iio_ch_info * | channel, | ||
| intptr_t | priv ) |
Handles the read request for debug attributes.
| dev | - The iio device structure. |
| buf | - Command buffer to be filled with requested data. |
| len | - Length of the received command buffer in bytes. |
| channel | - Command channel info. |
| priv | - Command attribute id. |
| int adis_iio_read_gyro_meas_range | ( | struct adis_iio_dev * | iio_adis, |
| char * | buf ) |
Reads gyroscope measurement range value and returns it in char format.
| iio_adis | - The iio adis device. |
| buf | - The gyroscope measurement range value in char format. |
| int adis_iio_read_lpf | ( | void * | dev, |
| char * | buf, | ||
| uint32_t | len, | ||
| const struct iio_ch_info * | channel, | ||
| intptr_t | priv ) |
Handles the read request for lpf attribute.
| dev | - The iio device structure. |
| buf | - Command buffer to be filled with requested data. |
| len | - Length of the received command buffer in bytes. |
| channel | - Command channel info. |
| priv | - Command attribute id. |
| int adis_iio_read_offset | ( | void * | dev, |
| char * | buf, | ||
| uint32_t | len, | ||
| const struct iio_ch_info * | channel, | ||
| intptr_t | priv ) |
Handles the read request for offset attribute.
| dev | - The iio device structure. |
| buf | - Command buffer to be filled with requested data. |
| len | - Length of the received command buffer in bytes. |
| channel | - Command channel info. |
| priv | - Command attribute id. |
| int adis_iio_read_raw | ( | void * | dev, |
| char * | buf, | ||
| uint32_t | len, | ||
| const struct iio_ch_info * | channel, | ||
| intptr_t | priv ) |
Handles the read request for raw attribute.
| dev | - The iio device structure. |
| buf | - Command buffer to be filled with requested data. |
| len | - Length of the received command buffer in bytes. |
| channel | - Command channel info. |
| priv | - Command attribute id. |
| int adis_iio_read_reg | ( | void * | dev, |
| uint32_t | reg, | ||
| uint32_t * | readval ) |
Wrapper for reading adis register.
| dev | - The iio device structure. |
| reg | - Address of the register to be read from. |
| readval | - Read data. |
| int adis_iio_read_sampling_freq | ( | void * | dev, |
| char * | buf, | ||
| uint32_t | len, | ||
| const struct iio_ch_info * | channel, | ||
| intptr_t | priv ) |
Handles the read request for sampling frequency attribute.
| dev | - The iio device structure. |
| buf | - Command buffer to be filled with requested data. |
| len | - Length of the received command buffer in bytes. |
| channel | - Command channel info. |
| priv | - Command attribute id. |
| int adis_iio_read_scale | ( | void * | dev, |
| char * | buf, | ||
| uint32_t | len, | ||
| const struct iio_ch_info * | channel, | ||
| intptr_t | priv ) |
Handles the read request for scale attribute.
| dev | - The iio device structure. |
| buf | - Command buffer to be filled with requested data. |
| len | - Length of the received command buffer in bytes. |
| channel | - Command channel info. |
| priv | - Command attribute id. |
| int adis_iio_trigger_handler | ( | struct iio_device_data * | dev_data | ) |
Handles trigger: reads one data-set and writes it to the buffer.
| dev_data | - The iio device data structure. |
| int adis_iio_trigger_handler_with_fifo | ( | struct iio_device_data * | dev_data | ) |
Handles trigger: reads all available samples in FIFO and writes them to the buffer.
| dev_data | - The iio device data structure. |
| int adis_iio_write_calibbias | ( | void * | dev, |
| char * | buf, | ||
| uint32_t | len, | ||
| const struct iio_ch_info * | channel, | ||
| intptr_t | priv ) |
Handles the write request for calibbias attribute.
| dev | - The iio device structure. |
| buf | - Command buffer to be filled with the data to be written. |
| len | - Length of the received command buffer in bytes. |
| channel | - Command channel info. |
| priv | - Command attribute id. |
| int adis_iio_write_calibscale | ( | void * | dev, |
| char * | buf, | ||
| uint32_t | len, | ||
| const struct iio_ch_info * | channel, | ||
| intptr_t | priv ) |
Handles the write request for calibscale attribute.
| dev | - The iio device structure. |
| buf | - Command buffer to be filled with the data to be written. |
| len | - Length of the received command buffer in bytes. |
| channel | - Command channel info. |
| priv | - Command attribute id. |
| int adis_iio_write_debug_attrs | ( | void * | dev, |
| char * | buf, | ||
| uint32_t | len, | ||
| const struct iio_ch_info * | channel, | ||
| intptr_t | priv ) |
Handles the write request for debug attributes.
| dev | - The iio device structure. |
| buf | - Command buffer to be filled with the data to be written. |
| len | - Length of the received command buffer in bytes. |
| channel | - Command channel info. |
| priv | - Command attribute id. |
| int adis_iio_write_lpf | ( | void * | dev, |
| char * | buf, | ||
| uint32_t | len, | ||
| const struct iio_ch_info * | channel, | ||
| intptr_t | priv ) |
Handles the write request for lpf attribute.
| dev | - The iio device structure. |
| buf | - Command buffer to be filled with the data to be written. |
| len | - Length of the received command buffer in bytes. |
| channel | - Command channel info. |
| priv | - Command attribute id. |
| int adis_iio_write_reg | ( | void * | dev, |
| uint32_t | reg, | ||
| uint32_t | writeval ) |
Wrapper for writing to adis register.
| dev | - The iio device structure. |
| reg | - Address of the register to be written to. |
| writeval | - Data to be written. |
| int adis_iio_write_sampling_freq | ( | void * | dev, |
| char * | buf, | ||
| uint32_t | len, | ||
| const struct iio_ch_info * | channel, | ||
| intptr_t | priv ) |
Handles the write request for sampling frequency attribute.
| dev | - The iio device structure. |
| buf | - Command buffer to be filled with the data to be written. |
| len | - Length of the received command buffer in bytes. |
| channel | - Command channel info. |
| priv | - Command attribute id. |
| struct iio_attribute adis_dev_attrs[] |
| struct iio_attribute adis_iio_accel_attrs[] |
| struct iio_attribute adis_iio_anglvel_attrs[] |
| struct iio_attribute adis_iio_delta_angl_attrs[] |
| struct iio_attribute adis_iio_delta_vel_attrs[] |
| struct iio_attribute adis_iio_temp_attrs[] |