Example program for EVAL-AD4130
Dependencies: tempsensors sdp_k1_sdram
app/app_config_mbed.h@2:7b2b268ea49c, 22 months ago (annotated)
- Committer:
- Mahesh Phalke
- Date:
- Wed Jul 20 18:12:00 2022 +0530
- Revision:
- 2:7b2b268ea49c
Initial firmware commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Mahesh Phalke |
2:7b2b268ea49c | 1 | /***************************************************************************//** |
Mahesh Phalke |
2:7b2b268ea49c | 2 | * @file app_config_mbed.h |
Mahesh Phalke |
2:7b2b268ea49c | 3 | * @brief Header file for Mbed platform configurations |
Mahesh Phalke |
2:7b2b268ea49c | 4 | ******************************************************************************** |
Mahesh Phalke |
2:7b2b268ea49c | 5 | * Copyright (c) 2021-22 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 | #ifndef APP_CONFIG_MBED_H_ |
Mahesh Phalke |
2:7b2b268ea49c | 14 | #define APP_CONFIG_MBED_H_ |
Mahesh Phalke |
2:7b2b268ea49c | 15 | |
Mahesh Phalke |
2:7b2b268ea49c | 16 | /******************************************************************************/ |
Mahesh Phalke |
2:7b2b268ea49c | 17 | /***************************** Include Files **********************************/ |
Mahesh Phalke |
2:7b2b268ea49c | 18 | /******************************************************************************/ |
Mahesh Phalke |
2:7b2b268ea49c | 19 | |
Mahesh Phalke |
2:7b2b268ea49c | 20 | #include <stdint.h> |
Mahesh Phalke |
2:7b2b268ea49c | 21 | #include <PinNames.h> |
Mahesh Phalke |
2:7b2b268ea49c | 22 | |
Mahesh Phalke |
2:7b2b268ea49c | 23 | #include "no_os_gpio.h" |
Mahesh Phalke |
2:7b2b268ea49c | 24 | #include "mbed_uart.h" |
Mahesh Phalke |
2:7b2b268ea49c | 25 | #include "mbed_irq.h" |
Mahesh Phalke |
2:7b2b268ea49c | 26 | #include "mbed_gpio_irq.h" |
Mahesh Phalke |
2:7b2b268ea49c | 27 | #include "mbed_spi.h" |
Mahesh Phalke |
2:7b2b268ea49c | 28 | #include "mbed_gpio.h" |
Mahesh Phalke |
2:7b2b268ea49c | 29 | |
Mahesh Phalke |
2:7b2b268ea49c | 30 | /******************************************************************************/ |
Mahesh Phalke |
2:7b2b268ea49c | 31 | /********************** Macros and Constants Definition ***********************/ |
Mahesh Phalke |
2:7b2b268ea49c | 32 | /******************************************************************************/ |
Mahesh Phalke |
2:7b2b268ea49c | 33 | |
Mahesh Phalke |
2:7b2b268ea49c | 34 | /* Select b/w Arduino or SDP-120 pin header (default is Arduino) */ |
Mahesh Phalke |
2:7b2b268ea49c | 35 | //#define SDP_120 |
Mahesh Phalke |
2:7b2b268ea49c | 36 | |
Mahesh Phalke |
2:7b2b268ea49c | 37 | #ifdef SDP_120 |
Mahesh Phalke |
2:7b2b268ea49c | 38 | /* Pin mapping of SDP-K1 w.r.t SDP-120 connector */ |
Mahesh Phalke |
2:7b2b268ea49c | 39 | #define SPI_CSB SDP_SPI_CS_A |
Mahesh Phalke |
2:7b2b268ea49c | 40 | #define SPI_HOST_SDO SDP_SPI_MOSI |
Mahesh Phalke |
2:7b2b268ea49c | 41 | #define SPI_HOST_SDI SDP_SPI_MISO |
Mahesh Phalke |
2:7b2b268ea49c | 42 | #define SPI_SCK SDP_SPI_SCK |
Mahesh Phalke |
2:7b2b268ea49c | 43 | |
Mahesh Phalke |
2:7b2b268ea49c | 44 | #define MBED_CONV_MON SDP_GPIO_1 |
Mahesh Phalke |
2:7b2b268ea49c | 45 | #else |
Mahesh Phalke |
2:7b2b268ea49c | 46 | /* Pin mapping of SDP-K1 w.r.t Arduino connector */ |
Mahesh Phalke |
2:7b2b268ea49c | 47 | #define SPI_CSB ARDUINO_UNO_D10 |
Mahesh Phalke |
2:7b2b268ea49c | 48 | #define SPI_HOST_SDO ARDUINO_UNO_D11 |
Mahesh Phalke |
2:7b2b268ea49c | 49 | #define SPI_HOST_SDI ARDUINO_UNO_D12 |
Mahesh Phalke |
2:7b2b268ea49c | 50 | #define SPI_SCK ARDUINO_UNO_D13 |
Mahesh Phalke |
2:7b2b268ea49c | 51 | |
Mahesh Phalke |
2:7b2b268ea49c | 52 | #define MBED_CONV_MON ARDUINO_UNO_D2 |
Mahesh Phalke |
2:7b2b268ea49c | 53 | #endif |
Mahesh Phalke |
2:7b2b268ea49c | 54 | |
Mahesh Phalke |
2:7b2b268ea49c | 55 | #if defined(AD4130_WLCSP_PACKAGE_TYPE) |
Mahesh Phalke |
2:7b2b268ea49c | 56 | #define CONV_MON MBED_CONV_MON |
Mahesh Phalke |
2:7b2b268ea49c | 57 | #else |
Mahesh Phalke |
2:7b2b268ea49c | 58 | #define CONV_MON ARDUINO_UNO_D2 // Conversion interrupt source pin (The selected interrupt source pin |
Mahesh Phalke |
2:7b2b268ea49c | 59 | // e.g. MCLK or GPIO needs to be tied to D2 pin on Arduino header). |
Mahesh Phalke |
2:7b2b268ea49c | 60 | // The selection of interrupt source is done in 'iio_data_capture_init' function |
Mahesh Phalke |
2:7b2b268ea49c | 61 | #endif |
Mahesh Phalke |
2:7b2b268ea49c | 62 | |
Mahesh Phalke |
2:7b2b268ea49c | 63 | /* Common pin mapping on SDP-K1 */ |
Mahesh Phalke |
2:7b2b268ea49c | 64 | #define UART_TX CONSOLE_TX |
Mahesh Phalke |
2:7b2b268ea49c | 65 | #define UART_RX CONSOLE_RX |
Mahesh Phalke |
2:7b2b268ea49c | 66 | #define LED_GPO LED3 |
Mahesh Phalke |
2:7b2b268ea49c | 67 | |
Mahesh Phalke |
2:7b2b268ea49c | 68 | /* Select FS scaler value for the default user config mode. |
Mahesh Phalke |
2:7b2b268ea49c | 69 | * This is not a max FS value that can be set into device but rather a value to |
Mahesh Phalke |
2:7b2b268ea49c | 70 | * achieve max approximate ODR in the firmware for a given platform/setup. |
Mahesh Phalke |
2:7b2b268ea49c | 71 | * Max ODR is derived by testing the firmware on SDP-K1 controller board |
Mahesh Phalke |
2:7b2b268ea49c | 72 | * @10Mhz SPI clock. The max possible ODR can vary from board to board and |
Mahesh Phalke |
2:7b2b268ea49c | 73 | * data continuity is not guaranteed above this ODR on IIO client */ |
Mahesh Phalke |
2:7b2b268ea49c | 74 | #define FS_CONFIG_VALUE 1 // ODR = 2.4KSPS |
Mahesh Phalke |
2:7b2b268ea49c | 75 | |
Mahesh Phalke |
2:7b2b268ea49c | 76 | /******************************************************************************/ |
Mahesh Phalke |
2:7b2b268ea49c | 77 | /********************** Public/Extern Declarations ****************************/ |
Mahesh Phalke |
2:7b2b268ea49c | 78 | /******************************************************************************/ |
Mahesh Phalke |
2:7b2b268ea49c | 79 | |
Mahesh Phalke |
2:7b2b268ea49c | 80 | extern struct mbed_gpio_irq_init_param mbed_ext_int_extra_init_params; |
Mahesh Phalke |
2:7b2b268ea49c | 81 | extern struct mbed_uart_init_param mbed_uart_extra_init_params; |
Mahesh Phalke |
2:7b2b268ea49c | 82 | extern struct mbed_spi_init_param mbed_spi_extra_init_params; |
Mahesh Phalke |
2:7b2b268ea49c | 83 | |
Mahesh Phalke |
2:7b2b268ea49c | 84 | #endif /* APP_CONFIG_MBED_H_ */ |