Forked repository for pushing changes to EVAL-AD4696
Dependencies: platform_drivers
app/app_config_mbed.h@1:8792acb5a039, 2021-09-30 (annotated)
- Committer:
- pmallick
- Date:
- Thu Sep 30 11:01:05 2021 +0530
- Revision:
- 1:8792acb5a039
AD4696 IIO Application- Initial Revision
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
pmallick | 1:8792acb5a039 | 1 | /***************************************************************************//** |
pmallick | 1:8792acb5a039 | 2 | * @file app_config_mbed.h |
pmallick | 1:8792acb5a039 | 3 | * @brief Header file for Mbed platform configurations |
pmallick | 1:8792acb5a039 | 4 | ******************************************************************************** |
pmallick | 1:8792acb5a039 | 5 | * Copyright (c) 2021 Analog Devices, Inc. |
pmallick | 1:8792acb5a039 | 6 | * All rights reserved. |
pmallick | 1:8792acb5a039 | 7 | * |
pmallick | 1:8792acb5a039 | 8 | * This software is proprietary to Analog Devices, Inc. and its licensors. |
pmallick | 1:8792acb5a039 | 9 | * By using this software you agree to the terms of the associated |
pmallick | 1:8792acb5a039 | 10 | * Analog Devices Software License Agreement. |
pmallick | 1:8792acb5a039 | 11 | *******************************************************************************/ |
pmallick | 1:8792acb5a039 | 12 | |
pmallick | 1:8792acb5a039 | 13 | #ifndef APP_CONFIG_MBED_H_ |
pmallick | 1:8792acb5a039 | 14 | #define APP_CONFIG_MBED_H_ |
pmallick | 1:8792acb5a039 | 15 | |
pmallick | 1:8792acb5a039 | 16 | /******************************************************************************/ |
pmallick | 1:8792acb5a039 | 17 | /***************************** Include Files **********************************/ |
pmallick | 1:8792acb5a039 | 18 | /******************************************************************************/ |
pmallick | 1:8792acb5a039 | 19 | |
pmallick | 1:8792acb5a039 | 20 | #include <stdint.h> |
pmallick | 1:8792acb5a039 | 21 | #include <PinNames.h> |
pmallick | 1:8792acb5a039 | 22 | |
pmallick | 1:8792acb5a039 | 23 | #include "uart_extra.h" |
pmallick | 1:8792acb5a039 | 24 | #include "irq_extra.h" |
pmallick | 1:8792acb5a039 | 25 | #include "spi_extra.h" |
pmallick | 1:8792acb5a039 | 26 | #include "gpio_extra.h" |
pmallick | 1:8792acb5a039 | 27 | |
pmallick | 1:8792acb5a039 | 28 | /******************************************************************************/ |
pmallick | 1:8792acb5a039 | 29 | /********************** Macros and Constants Definition ***********************/ |
pmallick | 1:8792acb5a039 | 30 | /******************************************************************************/ |
pmallick | 1:8792acb5a039 | 31 | |
pmallick | 1:8792acb5a039 | 32 | /* Pin mapping for AD4696 w.r.t Arduino Headers */ |
pmallick | 1:8792acb5a039 | 33 | #define SPI_CSB D10 |
pmallick | 1:8792acb5a039 | 34 | #define SPI_HOST_SDO D11 |
pmallick | 1:8792acb5a039 | 35 | #define SPI_HOST_SDI D12 |
pmallick | 1:8792acb5a039 | 36 | #define SPI_SCK D13 |
pmallick | 1:8792acb5a039 | 37 | |
pmallick | 1:8792acb5a039 | 38 | /* Common pin mapping on SDP-K1 */ |
pmallick | 1:8792acb5a039 | 39 | #define UART_TX USBTX |
pmallick | 1:8792acb5a039 | 40 | #define UART_RX USBRX |
pmallick | 1:8792acb5a039 | 41 | |
pmallick | 1:8792acb5a039 | 42 | /* Pins used to trigger, reset and/or read a new (periodic) conversion event */ |
pmallick | 1:8792acb5a039 | 43 | #define RESET_PIN D5 |
pmallick | 1:8792acb5a039 | 44 | #define BUSY_PIN D7 |
pmallick | 1:8792acb5a039 | 45 | #define CONVST_PIN D6 |
pmallick | 1:8792acb5a039 | 46 | |
pmallick | 1:8792acb5a039 | 47 | /* Define the max possible sampling (or output data) rate for a given platform. |
pmallick | 1:8792acb5a039 | 48 | * This is also used to find the time period to trigger a periodic conversion event. |
pmallick | 1:8792acb5a039 | 49 | * Note: Max possible ODR is 62.5KSPS per channel for continuous data capture on |
pmallick | 1:8792acb5a039 | 50 | * IIO client. This is derived by testing the firmware on SDP-K1 controller board |
pmallick | 1:8792acb5a039 | 51 | * @22Mhz SPI clock. The max possible ODR can vary from board to board and |
pmallick | 1:8792acb5a039 | 52 | * data continuity is not guaranteed above this ODR on IIO oscilloscope */ |
pmallick | 1:8792acb5a039 | 53 | #define SAMPLING_RATE (62500) |
pmallick | 1:8792acb5a039 | 54 | #define CONV_TRIGGER_PERIOD_NSEC (((float)(1.0 / SAMPLING_RATE) * 1000000) * 1000) |
pmallick | 1:8792acb5a039 | 55 | #define CONV_TRIGGER_DUTY_CYCLE_NSEC (CONV_TRIGGER_PERIOD_NSEC / 10) |
pmallick | 1:8792acb5a039 | 56 | |
pmallick | 1:8792acb5a039 | 57 | /******************************************************************************/ |
pmallick | 1:8792acb5a039 | 58 | /********************** Public/Extern Declarations ****************************/ |
pmallick | 1:8792acb5a039 | 59 | /******************************************************************************/ |
pmallick | 1:8792acb5a039 | 60 | |
pmallick | 1:8792acb5a039 | 61 | extern mbed_gpio_init_param mbed_gpio_bsy_extra_init_params; |
pmallick | 1:8792acb5a039 | 62 | extern mbed_irq_init_param mbed_ext_int_extra_init_params; |
pmallick | 1:8792acb5a039 | 63 | extern mbed_uart_init_param mbed_uart_extra_init_params; |
pmallick | 1:8792acb5a039 | 64 | extern mbed_spi_init_param mbed_spi_extra_init_params; |
pmallick | 1:8792acb5a039 | 65 | |
pmallick | 1:8792acb5a039 | 66 | #endif /* APP_CONFIG_MBED_H_ */ |