IIO firmware for the AD4110
Dependencies: tempsensors sdp_k1_sdram
app/ad4110_current_mode_config.c@0:6ca37a8f8ba9, 2022-07-27 (annotated)
- Committer:
- Janani Sunil
- Date:
- Wed Jul 27 17:04:15 2022 +0530
- Revision:
- 0:6ca37a8f8ba9
Initial implementation for AD4110 IIO Firmware
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Janani Sunil | 0:6ca37a8f8ba9 | 1 | /*************************************************************************//** |
Janani Sunil | 0:6ca37a8f8ba9 | 2 | * @file ad4110_current_mode_config.c |
Janani Sunil | 0:6ca37a8f8ba9 | 3 | * @brief Current mode user configurations module for AD4110 IIO firmware |
Janani Sunil | 0:6ca37a8f8ba9 | 4 | ****************************************************************************** |
Janani Sunil | 0:6ca37a8f8ba9 | 5 | * Copyright (c) 2022 Analog Devices, Inc. |
Janani Sunil | 0:6ca37a8f8ba9 | 6 | * All rights reserved. |
Janani Sunil | 0:6ca37a8f8ba9 | 7 | * |
Janani Sunil | 0:6ca37a8f8ba9 | 8 | * This software is proprietary to Analog Devices, Inc. and its licensors. |
Janani Sunil | 0:6ca37a8f8ba9 | 9 | * By using this software you agree to the terms of the associated |
Janani Sunil | 0:6ca37a8f8ba9 | 10 | * Analog Devices Software License Agreement. |
Janani Sunil | 0:6ca37a8f8ba9 | 11 | *****************************************************************************/ |
Janani Sunil | 0:6ca37a8f8ba9 | 12 | |
Janani Sunil | 0:6ca37a8f8ba9 | 13 | /******************************************************************************/ |
Janani Sunil | 0:6ca37a8f8ba9 | 14 | /***************************** Include Files **********************************/ |
Janani Sunil | 0:6ca37a8f8ba9 | 15 | /******************************************************************************/ |
Janani Sunil | 0:6ca37a8f8ba9 | 16 | |
Janani Sunil | 0:6ca37a8f8ba9 | 17 | #include "ad4110.h" |
Janani Sunil | 0:6ca37a8f8ba9 | 18 | #include "app_config.h" |
Janani Sunil | 0:6ca37a8f8ba9 | 19 | |
Janani Sunil | 0:6ca37a8f8ba9 | 20 | /******************************************************************************/ |
Janani Sunil | 0:6ca37a8f8ba9 | 21 | /********************** Macros and Constants Definition ***********************/ |
Janani Sunil | 0:6ca37a8f8ba9 | 22 | /******************************************************************************/ |
Janani Sunil | 0:6ca37a8f8ba9 | 23 | |
Janani Sunil | 0:6ca37a8f8ba9 | 24 | /******************************************************************************/ |
Janani Sunil | 0:6ca37a8f8ba9 | 25 | /********************** Variables and User Defined Data Types *****************/ |
Janani Sunil | 0:6ca37a8f8ba9 | 26 | /******************************************************************************/ |
Janani Sunil | 0:6ca37a8f8ba9 | 27 | |
Janani Sunil | 0:6ca37a8f8ba9 | 28 | |
Janani Sunil | 0:6ca37a8f8ba9 | 29 | /* AD4110-1 Init parameters*/ |
Janani Sunil | 0:6ca37a8f8ba9 | 30 | struct ad4110_init_param ad4110_current_mode_init_params = { |
Janani Sunil | 0:6ca37a8f8ba9 | 31 | .spi_init = { |
Janani Sunil | 0:6ca37a8f8ba9 | 32 | .max_speed_hz = 10000000, |
Janani Sunil | 0:6ca37a8f8ba9 | 33 | .chip_select = SPI_CSB, |
Janani Sunil | 0:6ca37a8f8ba9 | 34 | .mode = NO_OS_SPI_MODE_3, |
Janani Sunil | 0:6ca37a8f8ba9 | 35 | .extra = &spi_extra_init_params, |
Janani Sunil | 0:6ca37a8f8ba9 | 36 | .platform_ops = &spi_platform_ops |
Janani Sunil | 0:6ca37a8f8ba9 | 37 | }, |
Janani Sunil | 0:6ca37a8f8ba9 | 38 | .volt_ref = AD4110_EXT_REF, |
Janani Sunil | 0:6ca37a8f8ba9 | 39 | .data_stat = AD4110_DISABLE, |
Janani Sunil | 0:6ca37a8f8ba9 | 40 | .data_length = AD4110_DATA_WL24, |
Janani Sunil | 0:6ca37a8f8ba9 | 41 | .afe_crc_en = AD4110_AFE_CRC_DISABLE, |
Janani Sunil | 0:6ca37a8f8ba9 | 42 | .adc_crc_en = AD4110_ADC_CRC_DISABLE, |
Janani Sunil | 0:6ca37a8f8ba9 | 43 | .op_mode = AD4110_CURRENT_MODE_EXT_R_SEL, |
Janani Sunil | 0:6ca37a8f8ba9 | 44 | .gain = GAIN_CH, |
Janani Sunil | 0:6ca37a8f8ba9 | 45 | .sync = AD4110_SYNC_EN, |
Janani Sunil | 0:6ca37a8f8ba9 | 46 | .afe_clk = AD4110_AFE_ADC_CLOCKED, |
Janani Sunil | 0:6ca37a8f8ba9 | 47 | .adc_clk = AD4110_ADC_INT_CLK_CLKIO, |
Janani Sunil | 0:6ca37a8f8ba9 | 48 | .addr = 0, |
Janani Sunil | 0:6ca37a8f8ba9 | 49 | .bipolar = true, |
Janani Sunil | 0:6ca37a8f8ba9 | 50 | .analog_input_buff = ENABLE_FULL_BUFFER, |
Janani Sunil | 0:6ca37a8f8ba9 | 51 | .odr = AD4110_ODR_SEL, |
Janani Sunil | 0:6ca37a8f8ba9 | 52 | .order = sinc5_sinc1 |
Janani Sunil | 0:6ca37a8f8ba9 | 53 | } ; |