|
precision-converters-firmware
|
#include <stdio.h>#include "ad4134_support.h"#include "no_os_gpio.h"#include "no_os_error.h"#include "no_os_delay.h"#include "app_config.h"#include "ad4134_iio.h"#include "stm32_tdm_support.h"
Macros | |
| #define | GPIO_MIN_DBNCE_CNT (2U) |
| #define | ODR_TRIGGER_WAIT_DBNCE_CNT (20000U) |
| #define | DUAL_CHN_MODE_OFFSET (2) |
| #define | LT6373_GPIO_DIR_CTRL_VAL 0xFF |
| #define | LT6373_GPIO_DATA_VAL 0x84 |
| #define | DCLK_FREQ_SELECT 3 |
| #define | MCLK_FREQ (48000000) |
| #define | MCLK_DIVISOR (2) |
| #define | ODR_INT_VAL (uint32_t)(MCLK_FREQ / MCLK_DIVISOR / SAMPLING_RATE) |
| #define | ODR_VAL_INT_LSB (uint8_t)(ODR_INT_VAL) |
| #define | ODR_VAL_INT_MID (uint8_t)(ODR_INT_VAL >> 8) |
| #define | ODR_VAL_INT_MSB (uint8_t)(ODR_INT_VAL >> 16) |
| #define | ODR_VAL_FLT_LSB 0x00 |
| #define | ODR_VAL_FLT_MID0 0x00 |
| #define | ODR_VAL_FLT_MID1 0x00 |
| #define | ODR_VAL_FLT_MSB 0x00 |
Functions | |
| int32_t | ad7134_data_capture_init (struct ad713x_dev *dev) |
| Perform the data capture initialization. | |
| int32_t | ad7134_read_data (uint16_t *adc_data, uint8_t curr_chn) |
| Read ADC data over DOUT0 and DOUT1 pins using bit-banging method. | |
| int32_t | ad7134_read_tdm_data (uint16_t *adc_data, uint8_t curr_chn) |
| Read ADC data over SAI TDM Peripheral. | |
| int32_t | ad7134_read_all_channels (uint16_t *chn_data) |
| Read all chahnnels over DOUT0 and DOUT1 pins using bit-banging method. | |
| int32_t | ad7134_perform_conv_and_read_sample (uint8_t input_chn, uint16_t *adc_data) |
| Read ADC single sample data. | |
| #define DCLK_FREQ_SELECT 3 |
| #define DUAL_CHN_MODE_OFFSET (2) |
| #define GPIO_MIN_DBNCE_CNT (2U) |
| #define LT6373_GPIO_DATA_VAL 0x84 |
| #define LT6373_GPIO_DIR_CTRL_VAL 0xFF |
| #define MCLK_DIVISOR (2) |
| #define MCLK_FREQ (48000000) |
| #define ODR_INT_VAL (uint32_t)(MCLK_FREQ / MCLK_DIVISOR / SAMPLING_RATE) |
| #define ODR_TRIGGER_WAIT_DBNCE_CNT (20000U) |
| #define ODR_VAL_FLT_LSB 0x00 |
| #define ODR_VAL_FLT_MID0 0x00 |
| #define ODR_VAL_FLT_MID1 0x00 |
| #define ODR_VAL_FLT_MSB 0x00 |
| #define ODR_VAL_INT_LSB (uint8_t)(ODR_INT_VAL) |
| #define ODR_VAL_INT_MID (uint8_t)(ODR_INT_VAL >> 8) |
| #define ODR_VAL_INT_MSB (uint8_t)(ODR_INT_VAL >> 16) |
| int32_t ad7134_data_capture_init | ( | struct ad713x_dev * | dev | ) |
Perform the data capture initialization.
| dev[in] | - AD7134 Device descriptor. |
This function configures the AD7134 registers to capture the data

| int32_t ad7134_perform_conv_and_read_sample | ( | uint8_t | input_chn, |
| uint16_t * | adc_data | ||
| ) |
Read ADC single sample data.
| input_chn[in] | - Channel for which data is to read |
| adc_data[out] | - Pointer to adc data read variable |
| int32_t ad7134_read_all_channels | ( | uint16_t * | chn_data | ) |
Read all chahnnels over DOUT0 and DOUT1 pins using bit-banging method.
| chn_data[out] | - Pointer to adc data read variable |

| int32_t ad7134_read_data | ( | uint16_t * | adc_data, |
| uint8_t | curr_chn | ||
| ) |
Read ADC data over DOUT0 and DOUT1 pins using bit-banging method.
| adc_data[out] | - Pointer to adc data read variable |
| curr_chn[in] | - Channel for which data is to read |

| int32_t ad7134_read_tdm_data | ( | uint16_t * | adc_data, |
| uint8_t | curr_chn | ||
| ) |
Read ADC data over SAI TDM Peripheral.
| adc_data[out] | - Pointer to adc data read variable |
| curr_chn[in] | - Channel for which data is to read |
