precision-converters-firmware
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
app_config_mbed.h
Go to the documentation of this file.
1/***************************************************************************/
13#ifndef APP_CONFIG_MBED_H_
14#define APP_CONFIG_MBED_H_
15
16/******************************************************************************/
17/***************************** Include Files **********************************/
18/******************************************************************************/
19
20#include <stdint.h>
21#include <PinNames.h>
22
23#include "no_os_gpio.h"
24#include "mbed_uart.h"
25#include "mbed_irq.h"
26#include "mbed_gpio_irq.h"
27#include "mbed_spi.h"
28#include "mbed_gpio.h"
29#include "mbed_i2c.h"
30
31/******************************************************************************/
32/********************** Macros and Constants Definition ***********************/
33/******************************************************************************/
34
35/* Select b/w Arduino or SDP-120 pin header (default is Arduino) */
36//#define SDP_120
37
38#ifdef SDP_120
39/* Pin mapping of SDP-K1 w.r.t SDP-120 connector */
40#define SPI_CSB SDP_SPI_CS_A
41#define SPI_HOST_SDO SDP_SPI_MOSI
42#define SPI_HOST_SDI SDP_SPI_MISO
43#define SPI_SCK SDP_SPI_SCK
44#define I2C_SCL SDP_I2C_SCL
45#define I2C_SDA SDP_I2C_SDA
46
47#define MBED_CONV_MON SDP_GPIO_1
48#else
49/* Pin mapping of SDP-K1 w.r.t Arduino connector */
50#define SPI_CSB ARDUINO_UNO_D10
51#define SPI_HOST_SDO ARDUINO_UNO_D11
52#define SPI_HOST_SDI ARDUINO_UNO_D12
53#define SPI_SCK ARDUINO_UNO_D13
54#define I2C_SCL ARDUINO_UNO_D15
55#define I2C_SDA ARDUINO_UNO_D14
56
57#define MBED_CONV_MON ARDUINO_UNO_D2
58#endif
59
60#if defined(AD4130_WLCSP_PACKAGE_TYPE)
61#define CONV_MON MBED_CONV_MON
62#else
63#define CONV_MON ARDUINO_UNO_D2 // Conversion interrupt source pin (The selected interrupt source pin
64// e.g. MCLK or GPIO needs to be tied to D2 pin on Arduino header).
65// The selection of interrupt source is done in 'iio_data_capture_init' function
66#endif
67
68/* Common pin mapping on SDP-K1 */
69#define UART_TX CONSOLE_TX
70#define UART_RX CONSOLE_RX
71#define LED_GPO LED3
72
73/* Select FS scaler value for the default user config mode.
74 * This is not a max FS value that can be set into device but rather a value to
75 * achieve max approximate ODR in the firmware for a given platform/setup.
76 * Max ODR is derived by testing the firmware on SDP-K1 controller board
77 * @10Mhz SPI clock. The max possible ODR can vary from board to board and
78 * data continuity is not guaranteed above this ODR on IIO client */
79#define FS_CONFIG_VALUE 1 // ODR = 2.4KSPS
80
81/* LVGL tick time period for Mbed platform */
82#define LVGL_TICK_TIME_US 5000
83#define LVGL_TICK_TIME_MS (LVGL_TICK_TIME_US / 1000)
84
85/******************************************************************************/
86/********************** Public/Extern Declarations ****************************/
87/******************************************************************************/
88
89extern struct mbed_gpio_irq_init_param mbed_trigger_gpio_irq_init_params;
90extern struct mbed_gpio_init_param mbed_trigger_gpio_extra_init_params;
91extern struct mbed_uart_init_param mbed_uart_extra_init_params;
92extern struct mbed_uart_init_param mbed_vcom_extra_init_params;
93extern struct mbed_spi_init_param mbed_spi_extra_init_params;
94extern struct mbed_i2c_init_param mbed_i2c_extra_init_params;
95extern struct mbed_irq_init_param mbed_ticker_int_extra_init_params;
96
97void lvgl_tick_callback(void *ctx);
98
99#endif /* APP_CONFIG_MBED_H_ */
struct mbed_gpio_init_param mbed_trigger_gpio_extra_init_params
Definition app_config_mbed.c:61
struct mbed_gpio_irq_init_param mbed_trigger_gpio_irq_init_params
Definition app_config_mbed.c:65
struct mbed_uart_init_param mbed_vcom_extra_init_params
Definition app_config_mbed.c:42
struct mbed_uart_init_param mbed_uart_extra_init_params
Definition app_config_mbed.c:31
struct mbed_spi_init_param mbed_spi_extra_init_params
Definition app_config_mbed.c:54
struct mbed_i2c_init_param mbed_i2c_extra_init_params
Definition app_config_mbed.c:69
void lvgl_tick_callback(void *ctx)
lvgl tick update callback function for pocket lab
Definition app_config.c:141
struct mbed_irq_init_param mbed_ticker_int_extra_init_params
Definition app_config_mbed.c:65