Example program for EVAL-AD4130

Dependencies:   tempsensors sdp_k1_sdram

Committer:
Mahesh Phalke
Date:
Wed Jul 20 18:12:00 2022 +0530
Revision:
2:7b2b268ea49c
Initial firmware commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Mahesh Phalke 2:7b2b268ea49c 1 /*************************************************************************//**
Mahesh Phalke 2:7b2b268ea49c 2 * @file ad4130_thermocouple_config.c
Mahesh Phalke 2:7b2b268ea49c 3 * @brief Thermocouple user configurations file for AD4130 device
Mahesh Phalke 2:7b2b268ea49c 4 ******************************************************************************
Mahesh Phalke 2:7b2b268ea49c 5 * Copyright (c) 2022 Analog Devices, Inc.
Mahesh Phalke 2:7b2b268ea49c 6 * All rights reserved.
Mahesh Phalke 2:7b2b268ea49c 7 *
Mahesh Phalke 2:7b2b268ea49c 8 * This software is proprietary to Analog Devices, Inc. and its licensors.
Mahesh Phalke 2:7b2b268ea49c 9 * By using this software you agree to the terms of the associated
Mahesh Phalke 2:7b2b268ea49c 10 * Analog Devices Software License Agreement.
Mahesh Phalke 2:7b2b268ea49c 11 *****************************************************************************/
Mahesh Phalke 2:7b2b268ea49c 12
Mahesh Phalke 2:7b2b268ea49c 13 /******************************************************************************/
Mahesh Phalke 2:7b2b268ea49c 14 /***************************** Include Files **********************************/
Mahesh Phalke 2:7b2b268ea49c 15 /******************************************************************************/
Mahesh Phalke 2:7b2b268ea49c 16
Mahesh Phalke 2:7b2b268ea49c 17 #include "app_config.h"
Mahesh Phalke 2:7b2b268ea49c 18
Mahesh Phalke 2:7b2b268ea49c 19 /******************************************************************************/
Mahesh Phalke 2:7b2b268ea49c 20 /********************** Macros and Constants Definition ***********************/
Mahesh Phalke 2:7b2b268ea49c 21 /******************************************************************************/
Mahesh Phalke 2:7b2b268ea49c 22
Mahesh Phalke 2:7b2b268ea49c 23 /******************************************************************************/
Mahesh Phalke 2:7b2b268ea49c 24 /********************** Variables and User Defined Data Types *****************/
Mahesh Phalke 2:7b2b268ea49c 25 /******************************************************************************/
Mahesh Phalke 2:7b2b268ea49c 26
Mahesh Phalke 2:7b2b268ea49c 27 /* AD4130 device initialization parameters */
Mahesh Phalke 2:7b2b268ea49c 28 struct ad413x_init_param ad4130_thermocouple_config_params = {
Mahesh Phalke 2:7b2b268ea49c 29 .spi_init = &spi_init_params,
Mahesh Phalke 2:7b2b268ea49c 30
Mahesh Phalke 2:7b2b268ea49c 31 /* Setup (Preset) Configurations */
Mahesh Phalke 2:7b2b268ea49c 32 .preset = {
Mahesh Phalke 2:7b2b268ea49c 33 // Setup 0 (Chn0)
Mahesh Phalke 2:7b2b268ea49c 34 {
Mahesh Phalke 2:7b2b268ea49c 35 .ref_buf = {
Mahesh Phalke 2:7b2b268ea49c 36 .ref_buf_p_en = true,
Mahesh Phalke 2:7b2b268ea49c 37 .ref_buf_m_en = true,
Mahesh Phalke 2:7b2b268ea49c 38 },
Mahesh Phalke 2:7b2b268ea49c 39 .ref_sel = AD413X_REFOUT_AVSS,
Mahesh Phalke 2:7b2b268ea49c 40 .gain = AD413X_GAIN_128,
Mahesh Phalke 2:7b2b268ea49c 41 .filter = AD4130_FILTER_TYPE,
Mahesh Phalke 2:7b2b268ea49c 42 .s_time = AD413X_32_MCLK
Mahesh Phalke 2:7b2b268ea49c 43 },
Mahesh Phalke 2:7b2b268ea49c 44 // Setup 1 (Chn1)
Mahesh Phalke 2:7b2b268ea49c 45 {
Mahesh Phalke 2:7b2b268ea49c 46 .ref_buf = {
Mahesh Phalke 2:7b2b268ea49c 47 .ref_buf_p_en = true,
Mahesh Phalke 2:7b2b268ea49c 48 .ref_buf_m_en = true,
Mahesh Phalke 2:7b2b268ea49c 49 },
Mahesh Phalke 2:7b2b268ea49c 50 #if defined(USE_CJC_AS_RTD)
Mahesh Phalke 2:7b2b268ea49c 51 .ref_sel = AD413X_REFIN1,
Mahesh Phalke 2:7b2b268ea49c 52 .iout0_exc_current = AD413X_EXC_200UA,
Mahesh Phalke 2:7b2b268ea49c 53 #else
Mahesh Phalke 2:7b2b268ea49c 54 .ref_sel = AD413X_REFOUT_AVSS,
Mahesh Phalke 2:7b2b268ea49c 55 #endif
Mahesh Phalke 2:7b2b268ea49c 56 .gain = AD413X_GAIN_1,
Mahesh Phalke 2:7b2b268ea49c 57 .filter = AD4130_FILTER_TYPE,
Mahesh Phalke 2:7b2b268ea49c 58 .s_time = AD413X_32_MCLK
Mahesh Phalke 2:7b2b268ea49c 59 },
Mahesh Phalke 2:7b2b268ea49c 60 },
Mahesh Phalke 2:7b2b268ea49c 61
Mahesh Phalke 2:7b2b268ea49c 62 /* Chnnel Configurations */
Mahesh Phalke 2:7b2b268ea49c 63 .ch = {
Mahesh Phalke 2:7b2b268ea49c 64 // Chn0 (TC)
Mahesh Phalke 2:7b2b268ea49c 65 {
Mahesh Phalke 2:7b2b268ea49c 66 .preset = AD413X_PRESET_0,
Mahesh Phalke 2:7b2b268ea49c 67 .enable = 1,
Mahesh Phalke 2:7b2b268ea49c 68 .ain_p = AD413X_AIN2,
Mahesh Phalke 2:7b2b268ea49c 69 .ain_m = AD413X_AIN3
Mahesh Phalke 2:7b2b268ea49c 70 },
Mahesh Phalke 2:7b2b268ea49c 71 // Chn1 (CJC)
Mahesh Phalke 2:7b2b268ea49c 72 {
Mahesh Phalke 2:7b2b268ea49c 73 .preset = AD413X_PRESET_1,
Mahesh Phalke 2:7b2b268ea49c 74 .enable = 1,
Mahesh Phalke 2:7b2b268ea49c 75 .ain_p = AD413X_AIN4,
Mahesh Phalke 2:7b2b268ea49c 76 .ain_m = AD413X_AIN5,
Mahesh Phalke 2:7b2b268ea49c 77 #if defined(USE_CJC_AS_RTD)
Mahesh Phalke 2:7b2b268ea49c 78 .iout0_exc_input = AD413X_AIN0,
Mahesh Phalke 2:7b2b268ea49c 79 #endif
Mahesh Phalke 2:7b2b268ea49c 80 },
Mahesh Phalke 2:7b2b268ea49c 81 },
Mahesh Phalke 2:7b2b268ea49c 82
Mahesh Phalke 2:7b2b268ea49c 83 .chip_id = AD4130_8,
Mahesh Phalke 2:7b2b268ea49c 84 .mclk = AD413X_INT_76_8_KHZ_OUT_OFF,
Mahesh Phalke 2:7b2b268ea49c 85 .bipolar = true,
Mahesh Phalke 2:7b2b268ea49c 86 .int_ref = AD413X_INTREF_1_25V,
Mahesh Phalke 2:7b2b268ea49c 87 .standby_ctrl = {
Mahesh Phalke 2:7b2b268ea49c 88 .standby_int_ref_en = true,
Mahesh Phalke 2:7b2b268ea49c 89 .standby_vbias_en = true
Mahesh Phalke 2:7b2b268ea49c 90 },
Mahesh Phalke 2:7b2b268ea49c 91 .v_bias = NO_OS_BIT(2), // V_Bias on AIN2
Mahesh Phalke 2:7b2b268ea49c 92 .data_stat = 0,
Mahesh Phalke 2:7b2b268ea49c 93 .spi_crc_en = 0
Mahesh Phalke 2:7b2b268ea49c 94 };