Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: sdp_k1_sdram
app/app_config_mbed.h@2:007533849deb, 2022-07-21 (annotated)
- Committer:
- Mahesh Phalke
- Date:
- Thu Jul 21 16:45:24 2022 +0530
- Revision:
- 2:007533849deb
Initial firmware commit
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Mahesh Phalke |
2:007533849deb | 1 | /***************************************************************************//** |
| Mahesh Phalke |
2:007533849deb | 2 | * @file app_config_mbed.h |
| Mahesh Phalke |
2:007533849deb | 3 | * @brief Header file for Mbed platform configurations |
| Mahesh Phalke |
2:007533849deb | 4 | ******************************************************************************** |
| Mahesh Phalke |
2:007533849deb | 5 | * Copyright (c) 2021-22 Analog Devices, Inc. |
| Mahesh Phalke |
2:007533849deb | 6 | * All rights reserved. |
| Mahesh Phalke |
2:007533849deb | 7 | * |
| Mahesh Phalke |
2:007533849deb | 8 | * This software is proprietary to Analog Devices, Inc. and its licensors. |
| Mahesh Phalke |
2:007533849deb | 9 | * By using this software you agree to the terms of the associated |
| Mahesh Phalke |
2:007533849deb | 10 | * Analog Devices Software License Agreement. |
| Mahesh Phalke |
2:007533849deb | 11 | *******************************************************************************/ |
| Mahesh Phalke |
2:007533849deb | 12 | |
| Mahesh Phalke |
2:007533849deb | 13 | #ifndef APP_CONFIG_MBED_H_ |
| Mahesh Phalke |
2:007533849deb | 14 | #define APP_CONFIG_MBED_H_ |
| Mahesh Phalke |
2:007533849deb | 15 | |
| Mahesh Phalke |
2:007533849deb | 16 | /******************************************************************************/ |
| Mahesh Phalke |
2:007533849deb | 17 | /***************************** Include Files **********************************/ |
| Mahesh Phalke |
2:007533849deb | 18 | /******************************************************************************/ |
| Mahesh Phalke |
2:007533849deb | 19 | |
| Mahesh Phalke |
2:007533849deb | 20 | #include <stdint.h> |
| Mahesh Phalke |
2:007533849deb | 21 | #include <PinNames.h> |
| Mahesh Phalke |
2:007533849deb | 22 | |
| Mahesh Phalke |
2:007533849deb | 23 | #include "mbed_uart.h" |
| Mahesh Phalke |
2:007533849deb | 24 | #include "mbed_irq.h" |
| Mahesh Phalke |
2:007533849deb | 25 | #include "mbed_spi.h" |
| Mahesh Phalke |
2:007533849deb | 26 | #include "mbed_pwm.h" |
| Mahesh Phalke |
2:007533849deb | 27 | #include "mbed_gpio.h" |
| Mahesh Phalke |
2:007533849deb | 28 | |
| Mahesh Phalke |
2:007533849deb | 29 | #if defined(TARGET_SDP_K1) |
| Mahesh Phalke |
2:007533849deb | 30 | #include "sdram_sdpk1.h" |
| Mahesh Phalke |
2:007533849deb | 31 | #endif |
| Mahesh Phalke |
2:007533849deb | 32 | |
| Mahesh Phalke |
2:007533849deb | 33 | /******************************************************************************/ |
| Mahesh Phalke |
2:007533849deb | 34 | /********************** Macros and Constants Definition ***********************/ |
| Mahesh Phalke |
2:007533849deb | 35 | /******************************************************************************/ |
| Mahesh Phalke |
2:007533849deb | 36 | |
| Mahesh Phalke |
2:007533849deb | 37 | /* Pin mapping of SDP-K1 w.r.t Arduino connector */ |
| Mahesh Phalke |
2:007533849deb | 38 | #define SPI_CSB ARDUINO_UNO_D10 |
| Mahesh Phalke |
2:007533849deb | 39 | #define SPI_HOST_SDO ARDUINO_UNO_D11 |
| Mahesh Phalke |
2:007533849deb | 40 | #define SPI_HOST_SDI ARDUINO_UNO_D12 |
| Mahesh Phalke |
2:007533849deb | 41 | #define SPI_SCK ARDUINO_UNO_D13 |
| Mahesh Phalke |
2:007533849deb | 42 | |
| Mahesh Phalke |
2:007533849deb | 43 | /* Pins used to trigger and/or read a new (periodic) conversion event */ |
| Mahesh Phalke |
2:007533849deb | 44 | #define PWM_TRIGGER ARDUINO_UNO_D3 |
| Mahesh Phalke |
2:007533849deb | 45 | #define INT_EVENT ARDUINO_UNO_D3 |
| Mahesh Phalke |
2:007533849deb | 46 | |
| Mahesh Phalke |
2:007533849deb | 47 | /* Common pin mapping on SDP-K1 */ |
| Mahesh Phalke |
2:007533849deb | 48 | #define UART_TX CONSOLE_TX |
| Mahesh Phalke |
2:007533849deb | 49 | #define UART_RX CONSOLE_RX |
| Mahesh Phalke |
2:007533849deb | 50 | #define LED_GPO LED3 |
| Mahesh Phalke |
2:007533849deb | 51 | |
| Mahesh Phalke |
2:007533849deb | 52 | /* Define the max possible sampling (or output data) rate for a given platform. |
| Mahesh Phalke |
2:007533849deb | 53 | * This is also used to find the time period to trigger a periodic conversion event. |
| Mahesh Phalke |
2:007533849deb | 54 | * Note: Max possible ODR is 62.5KSPS per channel for continuous data capture on |
| Mahesh Phalke |
2:007533849deb | 55 | * IIO client. This is derived by testing the firmware on SDP-K1 controller board |
| Mahesh Phalke |
2:007533849deb | 56 | * @22Mhz SPI clock. The max possible ODR can vary from board to board and |
| Mahesh Phalke |
2:007533849deb | 57 | * data continuity is not guaranteed above this ODR on IIO oscilloscope */ |
| Mahesh Phalke |
2:007533849deb | 58 | #define SAMPLING_RATE (62500) |
| Mahesh Phalke |
2:007533849deb | 59 | #define CONV_TRIGGER_PERIOD_NSEC (((float)(1.0 / SAMPLING_RATE) * 1000000) * 1000) |
| Mahesh Phalke |
2:007533849deb | 60 | #define CONV_TRIGGER_DUTY_CYCLE_NSEC (CONV_TRIGGER_PERIOD_NSEC / 2) |
| Mahesh Phalke |
2:007533849deb | 61 | |
| Mahesh Phalke |
2:007533849deb | 62 | /******************************************************************************/ |
| Mahesh Phalke |
2:007533849deb | 63 | /********************** Public/Extern Declarations ****************************/ |
| Mahesh Phalke |
2:007533849deb | 64 | /******************************************************************************/ |
| Mahesh Phalke |
2:007533849deb | 65 | |
| Mahesh Phalke |
2:007533849deb | 66 | extern struct mbed_irq_init_param mbed_ext_int_extra_init_params; |
| Mahesh Phalke |
2:007533849deb | 67 | extern struct mbed_pwm_init_param mbed_pwm_extra_init_params; |
| Mahesh Phalke |
2:007533849deb | 68 | extern struct mbed_uart_init_param mbed_uart_extra_init_params; |
| Mahesh Phalke |
2:007533849deb | 69 | extern struct mbed_spi_init_param mbed_spi_extra_init_params; |
| Mahesh Phalke |
2:007533849deb | 70 | |
| Mahesh Phalke |
2:007533849deb | 71 | #endif /* APP_CONFIG_MBED_H_ */ |