precision-converters-firmware
Loading...
Searching...
No Matches
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 "mbed_uart.h"
24#include "mbed_irq.h"
25#include "mbed_spi.h"
26#include "mbed_i2c.h"
27#include "mbed_pwm.h"
28#include "mbed_gpio.h"
29#include "mbed_gpio_irq.h"
30
31/******************************************************************************/
32/********************** Macros and Constants Definition ***********************/
33/******************************************************************************/
34
35/* Pin mapping of SDP-K1 w.r.t Arduino connector */
36#define SPI_CSB ARDUINO_UNO_D10
37#define SPI_HOST_SDO ARDUINO_UNO_D11
38#define SPI_HOST_SDI ARDUINO_UNO_D12
39#define SPI_SCK ARDUINO_UNO_D13
40
41#define I2C_SCL ARDUINO_UNO_D15
42#define I2C_SDA ARDUINO_UNO_D14
43
44/* Console pin mapping on SDP-K1 */
45#define UART_TX CONSOLE_TX
46#define UART_RX CONSOLE_RX
47
48/* LDAC and CLR pin mapping on SDP-K1*/
49#define LDAC_GPIO ARDUINO_UNO_D6
50#define CLEAR_GPIO ARDUINO_UNO_D4
51
52#define PWM_TRIGGER LDAC_GPIO
53
54/* Redefine platform ops mapping wrt Mbed platform */
55#define gpio_ops mbed_gpio_ops
56#define spi_ops mbed_spi_ops
57#define i2c_ops mbed_i2c_ops
58#define uart_ops mbed_uart_ops
59#define vcom_ops mbed_virtual_com_ops
60#define pwm_ops mbed_pwm_ops
61#define trigger_gpio_irq_ops mbed_gpio_irq_ops
62
63/* Unused macros */
64#define SPI_DEVICE_ID 0
65#define I2C_DEV_ID 0
66#define LDAC_PWM_ID 0
67#define CLEAR_GPIO_PORT 0
68#define LDAC_GPIO_PORT 0
69#define LDAC_PWM_ID 0
70#define IRQ_CTRL_ID 0
71#define UART_ID 0
72
73/* Max spi clk speed */
74#define MAX_SPI_CLK 12500000
75
76/* Define the max possible sampling (or update) rate for a given platform.
77 * Note: Max possible update rate is 58.82 KSPS per channel on IIO client.
78 * This is derived by testing the firmware on SDP-K1 controller board with STM32F469NI MCU
79 * using GCC and ARM compilers. The max possible update rate can vary from board to board and
80 * data continuity is not guaranteed above this update rate */
81#define MAX_SAMPLING_RATE (uint32_t)(58823)
82
83/******************************************************************************/
84/********************** Public/Extern Declarations ****************************/
85/******************************************************************************/
86
87extern struct mbed_uart_init_param mbed_uart_extra_init_params;
88extern struct mbed_uart_init_param mbed_vcom_extra_init_params;
89extern struct mbed_spi_init_param mbed_spi_extra_init_params;
90extern struct mbed_i2c_init_param mbed_i2c_extra_init_params;
91extern struct mbed_gpio_init_param mbed_ldac_gpio_init_params;
92extern struct mbed_gpio_init_param mbed_clear_gpio_init_params;
93extern struct mbed_gpio_irq_init_param mbed_trigger_gpio_irq_init_params;
94extern struct mbed_pwm_init_param mbed_pwm_extra_init_params;
95
96#endif /* APP_CONFIG_MBED_H_ */
struct mbed_pwm_init_param mbed_pwm_extra_init_params
Definition app_config_mbed.c:69
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
struct mbed_gpio_init_param mbed_clear_gpio_init_params
Definition app_config_mbed.c:72
struct mbed_gpio_init_param mbed_ldac_gpio_init_params
Definition app_config_mbed.c:67