no-OS
|
#include <stdlib.h>
#include <errno.h>
#include "ad405x.h"
#include "no_os_delay.h"
#include "no_os_print_log.h"
Functions | |
int | ad405x_write (struct ad405x_dev *dev, uint8_t reg_addr, uint8_t reg_val) |
Write device register. More... | |
int | ad405x_read (struct ad405x_dev *dev, uint8_t reg_addr, uint8_t *reg_val) |
Read device register. More... | |
int | ad405x_update_bits (struct ad405x_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t reg_val) |
Update specific register bits. More... | |
int | ad405x_exit_command (struct ad405x_dev *dev) |
Send EXIT command. More... | |
int | ad405x_reset_pattern_command (struct ad405x_dev *dev) |
int | ad405x_soft_reset (struct ad405x_dev *dev) |
Software reset the device. More... | |
int | ad405x_set_adc_mode (struct ad405x_dev *dev) |
Enter ADC Mode. More... | |
int | ad405x_set_burst_averaging_mode (struct ad405x_dev *dev) |
Enter Burst Averaging Mode. More... | |
int | ad405x_set_averaging_mode (struct ad405x_dev *dev) |
Enter Averaging Mode. More... | |
int | ad405x_set_config_mode (struct ad405x_dev *dev) |
Enter Config Mode. More... | |
int | ad405x_set_operation_mode (struct ad405x_dev *dev, enum ad405x_operation_mode mode) |
Set operation mode. More... | |
int | ad405x_convst (struct ad405x_dev *dev) |
Toggle the CNV pin to start a conversion. More... | |
int | ad405x_spi_data_read (struct ad405x_dev *dev, int32_t *data) |
Read conversion data. More... | |
int | ad405x_read_val (struct ad405x_dev *dev, int32_t *data) |
Trigger conversion and read data. More... | |
int | ad405x_set_sample_rate (struct ad405x_dev *dev, enum ad405x_sample_rate rate) |
Select sample rate for Burst and Autonomous Modes. More... | |
int | ad405x_set_averaging_filter_length (struct ad405x_dev *dev, enum ad405x_avg_filter_l length) |
Set averaging filter window length. More... | |
enum ad405x_avg_filter_l | ad405x_get_averaging_filter_length (struct ad405x_dev *dev) |
Get averaging filter window length. More... | |
int | ad405x_set_dev_en_polarity (struct ad405x_dev *dev, enum ad405x_dev_en_polarity polarity) |
Set DEV_EN signal polarity. More... | |
enum ad405x_dev_en_polarity | ad405x_get_dev_en_polarity (struct ad405x_dev *dev) |
Get DEV_EN signal polarity. More... | |
int | ad405x_enable_invert_on_chop (struct ad405x_dev *dev) |
Enable INVERT_ON_CHOP. More... | |
int | ad405x_disable_invert_on_chop (struct ad405x_dev *dev) |
Disable INVERT_ON_CHOP. More... | |
enum ad405x_invert_on_chop | ad405x_get_invert_on_chop_state (struct ad405x_dev *dev) |
Get INVERT_ON_CHOP setting. More... | |
int | ad405x_set_gp_mode (struct ad405x_dev *dev, enum ad405x_gp_select gp, enum ad405x_gp_mode mode) |
Set GP mode. More... | |
enum ad405x_gp_mode | ad405x_get_gp_mode (struct ad405x_dev *dev, enum ad405x_gp_select gp) |
Get GP mode setting. More... | |
int | ad405x_set_data_format (struct ad405x_dev *dev, enum ad405x_out_data_format data_format) |
Set output data format. More... | |
int | ad405x_init (struct ad405x_dev **device, struct ad405x_init_param init_param) |
Initialize the device. More... | |
int | ad405x_remove (struct ad405x_dev *dev) |
Remove the device and release resources. More... | |
int ad405x_convst | ( | struct ad405x_dev * | dev | ) |
Toggle the CNV pin to start a conversion.
dev | - The device structure. |
CNV High Time 10 ns
int ad405x_disable_invert_on_chop | ( | struct ad405x_dev * | dev | ) |
Disable INVERT_ON_CHOP.
dev | - The device structure. |
int ad405x_enable_invert_on_chop | ( | struct ad405x_dev * | dev | ) |
Enable INVERT_ON_CHOP.
dev | - The device structure. |
int ad405x_exit_command | ( | struct ad405x_dev * | dev | ) |
Send EXIT command.
dev- | The device structure. |
enum ad405x_avg_filter_l ad405x_get_averaging_filter_length | ( | struct ad405x_dev * | dev | ) |
Get averaging filter window length.
dev | - The device structure. |
enum ad405x_dev_en_polarity ad405x_get_dev_en_polarity | ( | struct ad405x_dev * | dev | ) |
Get DEV_EN signal polarity.
dev | - The device structure. |
enum ad405x_gp_mode ad405x_get_gp_mode | ( | struct ad405x_dev * | dev, |
enum ad405x_gp_select | gp | ||
) |
Get GP mode setting.
G
dev | - The device structure. |
gp | - GP1/GP0 select. |
enum ad405x_invert_on_chop ad405x_get_invert_on_chop_state | ( | struct ad405x_dev * | dev | ) |
Get INVERT_ON_CHOP setting.
dev | - The device structure. |
int ad405x_init | ( | struct ad405x_dev ** | device, |
struct ad405x_init_param | init_param | ||
) |
Initialize the device.
device | - The device structure. |
init_param | - The structure that contains the device initial parameters. |
int ad405x_read | ( | struct ad405x_dev * | dev, |
uint8_t | reg_addr, | ||
uint8_t * | reg_val | ||
) |
Read device register.
dev | - The device structure. |
reg_addr | - The register address. |
reg_val | - The data read from the register. |
int ad405x_read_val | ( | struct ad405x_dev * | dev, |
int32_t * | data | ||
) |
Trigger conversion and read data.
dev | - The device structure. |
data | - Pointer to location of buffer where to store the data. |
int ad405x_remove | ( | struct ad405x_dev * | dev | ) |
Remove the device and release resources.
dev | - The device structure. |
int ad405x_reset_pattern_command | ( | struct ad405x_dev * | dev | ) |
Send RESET pattern command.
dev- | The device structure. |
int ad405x_set_adc_mode | ( | struct ad405x_dev * | dev | ) |
Enter ADC Mode.
dev | - The device structure. |
int ad405x_set_averaging_filter_length | ( | struct ad405x_dev * | dev, |
enum ad405x_avg_filter_l | length | ||
) |
Set averaging filter window length.
dev | - The device structure. |
length | - Averaging filter window length. |
int ad405x_set_averaging_mode | ( | struct ad405x_dev * | dev | ) |
Enter Averaging Mode.
dev | - The device structure. |
int ad405x_set_burst_averaging_mode | ( | struct ad405x_dev * | dev | ) |
Enter Burst Averaging Mode.
dev | - The device structure. |
int ad405x_set_config_mode | ( | struct ad405x_dev * | dev | ) |
Enter Config Mode.
dev | - The device structure. |
int ad405x_set_data_format | ( | struct ad405x_dev * | dev, |
enum ad405x_out_data_format | data_format | ||
) |
Set output data format.
dev | - The device structure. |
data_format | - format select. |
int ad405x_set_dev_en_polarity | ( | struct ad405x_dev * | dev, |
enum ad405x_dev_en_polarity | polarity | ||
) |
Set DEV_EN signal polarity.
dev | - The device structure. |
polarity | - DEV_EN signal polarity. |
int ad405x_set_gp_mode | ( | struct ad405x_dev * | dev, |
enum ad405x_gp_select | gp, | ||
enum ad405x_gp_mode | mode | ||
) |
Set GP mode.
dev | - The device structure. |
gp | - GP1/GP0 select. |
mode | - mode select. |
int ad405x_set_operation_mode | ( | struct ad405x_dev * | dev, |
enum ad405x_operation_mode | mode | ||
) |
Set operation mode.
dev | - The device structure. |
mode | - Operation mode. |
int ad405x_set_sample_rate | ( | struct ad405x_dev * | dev, |
enum ad405x_sample_rate | rate | ||
) |
Select sample rate for Burst and Autonomous Modes.
dev | - The device structure. |
rate | - Sample rate. |
int ad405x_soft_reset | ( | struct ad405x_dev * | dev | ) |
Software reset the device.
dev | - The device structure. |
int ad405x_spi_data_read | ( | struct ad405x_dev * | dev, |
int32_t * | data | ||
) |
Read conversion data.
dev | - The device structure. |
data | - Pointer to location of buffer where to store the data. |
int ad405x_update_bits | ( | struct ad405x_dev * | dev, |
uint8_t | reg_addr, | ||
uint8_t | mask, | ||
uint8_t | reg_val | ||
) |
Update specific register bits.
dev | - The device structure. |
reg_addr | - The register address. |
mask | - Specific bits mask. |
reg_val | - The data to be written. |
int ad405x_write | ( | struct ad405x_dev * | dev, |
uint8_t | reg_addr, | ||
uint8_t | reg_val | ||
) |
Write device register.
dev- | The device structure. |
reg_addr | - The register address. |
reg_val | - The data to be written. |