this is testing

Committer:
pmallick
Date:
Thu Jan 14 18:54:16 2021 +0530
Revision:
0:3afcd581558d
this is testing

Who changed what in which revision?

UserRevisionLine numberNew contents of line
pmallick 0:3afcd581558d 1 /*************************************************************************//**
pmallick 0:3afcd581558d 2 * @file app_config.h
pmallick 0:3afcd581558d 3 * @brief Configuration file for AD7606 device applications
pmallick 0:3afcd581558d 4 ******************************************************************************
pmallick 0:3afcd581558d 5 * Copyright (c) 2020 Analog Devices, Inc.
pmallick 0:3afcd581558d 6 *
pmallick 0:3afcd581558d 7 * All rights reserved.
pmallick 0:3afcd581558d 8 *
pmallick 0:3afcd581558d 9 * This software is proprietary to Analog Devices, Inc. and its licensors.
pmallick 0:3afcd581558d 10 * By using this software you agree to the terms of the associated
pmallick 0:3afcd581558d 11 * Analog Devices Software License Agreement.
pmallick 0:3afcd581558d 12 *****************************************************************************/
pmallick 0:3afcd581558d 13
pmallick 0:3afcd581558d 14 #ifndef _APP_CONFIG_H_
pmallick 0:3afcd581558d 15 #define _APP_CONFIG_H_
pmallick 0:3afcd581558d 16
pmallick 0:3afcd581558d 17 #include <stdint.h>
pmallick 0:3afcd581558d 18 #include <PinNames.h>
pmallick 0:3afcd581558d 19
pmallick 0:3afcd581558d 20 // **** Note for User: ACTIVE_DEVICE selection ****//
pmallick 0:3afcd581558d 21 /* Define the device type here from the list of below device type defines
pmallick 0:3afcd581558d 22 * (one at a time. Defining more than one device can result into compile error).
pmallick 0:3afcd581558d 23 * e.g. #define DEV_AD7606B -> This will make AD7606B as an ACTIVE_DEVICE.
pmallick 0:3afcd581558d 24 * The ACTIVE_DEVICE is default set to AD7606B if device type is not defined.
pmallick 0:3afcd581558d 25 * */
pmallick 0:3afcd581558d 26
pmallick 0:3afcd581558d 27 #define DEV_AD7606B
pmallick 0:3afcd581558d 28
pmallick 0:3afcd581558d 29
pmallick 0:3afcd581558d 30 #if defined(DEV_AD7605_4)
pmallick 0:3afcd581558d 31 #define ACTIVE_DEVICE ID_AD7605_4
pmallick 0:3afcd581558d 32 #define ACTIVE_DEVICE_NAME "AD7605-4-phy"
pmallick 0:3afcd581558d 33 #elif defined(DEV_AD7606_4)
pmallick 0:3afcd581558d 34 #define ACTIVE_DEVICE ID_AD7606_4
pmallick 0:3afcd581558d 35 #define ACTIVE_DEVICE_NAME "AD7606-4-phy"
pmallick 0:3afcd581558d 36 #elif defined(DEV_AD7606_6)
pmallick 0:3afcd581558d 37 #define ACTIVE_DEVICE ID_AD7606_6
pmallick 0:3afcd581558d 38 #define ACTIVE_DEVICE_NAME "AD7606-6-phy"
pmallick 0:3afcd581558d 39 #elif defined(DEV_AD7606_8)
pmallick 0:3afcd581558d 40 #define ACTIVE_DEVICE ID_AD7606_8
pmallick 0:3afcd581558d 41 #define ACTIVE_DEVICE_NAME "AD7606-8-phy"
pmallick 0:3afcd581558d 42 #elif defined(DEV_AD7606B)
pmallick 0:3afcd581558d 43 #define ACTIVE_DEVICE ID_AD7606B
pmallick 0:3afcd581558d 44 #define ACTIVE_DEVICE_NAME "AD7606B-phy"
pmallick 0:3afcd581558d 45 #elif defined(DEV_AD7606C_16)
pmallick 0:3afcd581558d 46 #define ACTIVE_DEVICE ID_AD7606C_16
pmallick 0:3afcd581558d 47 #define ACTIVE_DEVICE_NAME "AD7606C-16-phy"
pmallick 0:3afcd581558d 48 #elif defined(DEV_AD7606C_18)
pmallick 0:3afcd581558d 49 #define ACTIVE_DEVICE ID_AD7606C_18
pmallick 0:3afcd581558d 50 #define ACTIVE_DEVICE_NAME "AD7606C-18-phy"
pmallick 0:3afcd581558d 51 #elif defined(DEV_AD7608)
pmallick 0:3afcd581558d 52 #define ACTIVE_DEVICE ID_AD7608
pmallick 0:3afcd581558d 53 #define ACTIVE_DEVICE_NAME "AD7608-phy"
pmallick 0:3afcd581558d 54 #elif defined(DEV_AD7609)
pmallick 0:3afcd581558d 55 #define ACTIVE_DEVICE ID_AD7609
pmallick 0:3afcd581558d 56 #define ACTIVE_DEVICE_NAME "AD7609-phy"
pmallick 0:3afcd581558d 57 #else
pmallick 0:3afcd581558d 58 #warning No/Unsupported ADxxxxy symbol defined. AD7606B defined
pmallick 0:3afcd581558d 59 #define DEV_AD7606B
pmallick 0:3afcd581558d 60 #define ACTIVE_DEVICE ID_AD7606B
pmallick 0:3afcd581558d 61 #define ACTIVE_DEVICE_NAME "AD7606B-phy"
pmallick 0:3afcd581558d 62 #endif
pmallick 0:3afcd581558d 63
pmallick 0:3afcd581558d 64
pmallick 0:3afcd581558d 65 #if defined(DEV_AD7605_4)
pmallick 0:3afcd581558d 66 #define NO_OF_CHANNELS 4
pmallick 0:3afcd581558d 67 #define ADC_RESOLUTION 16
pmallick 0:3afcd581558d 68 #elif defined(DEV_AD7606_4)
pmallick 0:3afcd581558d 69 #define NO_OF_CHANNELS 4
pmallick 0:3afcd581558d 70 #define ADC_RESOLUTION 16
pmallick 0:3afcd581558d 71 #elif defined(DEV_AD7606_6)
pmallick 0:3afcd581558d 72 #define NO_OF_CHANNELS 6
pmallick 0:3afcd581558d 73 #define ADC_RESOLUTION 16
pmallick 0:3afcd581558d 74 #elif defined(DEV_AD7606_8)
pmallick 0:3afcd581558d 75 #define NO_OF_CHANNELS 8
pmallick 0:3afcd581558d 76 #define ADC_RESOLUTION 16
pmallick 0:3afcd581558d 77 #elif defined(DEV_AD7606B)
pmallick 0:3afcd581558d 78 #define NO_OF_CHANNELS 8
pmallick 0:3afcd581558d 79 #define ADC_RESOLUTION 16
pmallick 0:3afcd581558d 80 #elif defined(DEV_AD7606C_16)
pmallick 0:3afcd581558d 81 #define NO_OF_CHANNELS 8
pmallick 0:3afcd581558d 82 #define ADC_RESOLUTION 16
pmallick 0:3afcd581558d 83 #elif defined(DEV_AD7606C_18)
pmallick 0:3afcd581558d 84 #define NO_OF_CHANNELS 8
pmallick 0:3afcd581558d 85 #define ADC_RESOLUTION 18
pmallick 0:3afcd581558d 86 #elif defined(DEV_AD7608)
pmallick 0:3afcd581558d 87 #define NO_OF_CHANNELS 8
pmallick 0:3afcd581558d 88 #define ADC_RESOLUTION 18
pmallick 0:3afcd581558d 89 #elif defined(DEV_AD7609)
pmallick 0:3afcd581558d 90 #define NO_OF_CHANNELS 8
pmallick 0:3afcd581558d 91 #define ADC_RESOLUTION 18
pmallick 0:3afcd581558d 92 #else
pmallick 0:3afcd581558d 93 /* Default config for AD7606B */
pmallick 0:3afcd581558d 94 #define NO_OF_CHANNELS 8
pmallick 0:3afcd581558d 95 #define ADC_RESOLUTION 16
pmallick 0:3afcd581558d 96 #endif
pmallick 0:3afcd581558d 97
pmallick 0:3afcd581558d 98 /* ADC max count (full scale value) for unipolar inputs */
pmallick 0:3afcd581558d 99 #define ADC_MAX_COUNT_UNIPOLAR (uint32_t)((1 << ADC_RESOLUTION) - 1)
pmallick 0:3afcd581558d 100
pmallick 0:3afcd581558d 101 /* ADC max count (full scale value) for bipolar inputs */
pmallick 0:3afcd581558d 102 #define ADC_MAX_COUNT_BIPOLAR (uint32_t)(1 << (ADC_RESOLUTION-1))
pmallick 0:3afcd581558d 103
pmallick 0:3afcd581558d 104 // Pin mapping of AD7606 w.r.t Arduino (reference: PinNames.h)
pmallick 0:3afcd581558d 105 #define SPI_SS D10
pmallick 0:3afcd581558d 106 #define SPI_MOSI D11
pmallick 0:3afcd581558d 107 #define SPI_MISO D12
pmallick 0:3afcd581558d 108 #define SPI_SCK D13
pmallick 0:3afcd581558d 109
pmallick 0:3afcd581558d 110 #define UART_TX USBTX
pmallick 0:3afcd581558d 111 #define UART_RX USBRX
pmallick 0:3afcd581558d 112
pmallick 0:3afcd581558d 113 #define OSR0_PIN D2
pmallick 0:3afcd581558d 114 #define OSR1_PIN D3
pmallick 0:3afcd581558d 115 #define OSR2_PIN D4
pmallick 0:3afcd581558d 116 #define RESET_PIN D5
pmallick 0:3afcd581558d 117 #define CONVST_PIN D6
pmallick 0:3afcd581558d 118 #define BUSY_PIN D7
pmallick 0:3afcd581558d 119 #define RANGE_PIN D8
pmallick 0:3afcd581558d 120 #define STDBY_PIN D9
pmallick 0:3afcd581558d 121
pmallick 0:3afcd581558d 122 #define LED_GREEN LED3
pmallick 0:3afcd581558d 123
pmallick 0:3afcd581558d 124
pmallick 0:3afcd581558d 125 #endif //_APP_CONFIG_H_