precision-converters-firmware
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_spi.h"
25 #include "mbed_gpio.h"
26 #include "mbed_pwm.h"
27 #include "mbed_irq.h"
28 #include "mbed_gpio_irq.h"
29 
30 /******************************************************************************/
31 /********************** Macros and Constants Definition ***********************/
32 /******************************************************************************/
33 
34 /* Pin mapping of SDP-K1 w.r.t Arduino connector */
35 #define SPI_CSB ARDUINO_UNO_D10
36 #define SPI_HOST_SDO ARDUINO_UNO_D11
37 #define SPI_HOST_SDI ARDUINO_UNO_D12
38 #define SPI_SCK ARDUINO_UNO_D13
39 
40 #define LDAC_PIN ARDUINO_UNO_D9
41 #define RESET_PIN ARDUINO_UNO_D8
42 
43 /* Common pin mapping on SDP-K1 */
44 #define UART_TX CONSOLE_TX
45 #define UART_RX CONSOLE_RX
46 
47 /* Port names (Unused) */
48 #define LDAC_PORT 0
49 #define RESET_PORT 0
50 
51 /* Redefine the init params structure mapping w.r.t. platform */
52 #define uart_extra_init_params mbed_uart_init_params
53 #define vcom_extra_init_params mbed_vcom_init_params
54 #define spi_extra_init_params mbed_spi_init_params
55 #define spi_extra_init_params_without_sw_csb mbed_spi_init_params_without_sw_csb
56 #define ldac_pwm_extra_init_params mbed_pwm_init_params
57 #define ext_int_extra_init_params mbed_trigger_gpio_irq_init_params
58 #define gpio_ldac_extra_init_params mbed_gpio_ldac_init_params
59 #define gpio_reset_extra_init_params mbed_gpio_reset_init_params
60 #define gpio_ops mbed_gpio_ops
61 #define spi_ops mbed_spi_ops
62 #define uart_ops mbed_uart_ops
63 #define vcom_ops mbed_virtual_com_ops
64 #define irq_platform_ops mbed_gpio_irq_ops
65 #define pwm_ops mbed_pwm_ops
66 #define SPI_MODULE 0 // Unused macro
67 #define trigger_gpio_handle 0 // Unused macro
68 #define LDAC_PWM_ID 0 // Unused macro
69 #define IRQ_CTRL_ID 0 // Unused macro
70 #define SPI_DEVICE_ID 0 // Unused macro
71 #define TRIGGER_INT_ID GPIO_IRQ_ID1
72 #define MAX_SPI_SCLK 22500000
73 
74 /* Define the max possible sampling rate for a given platform.
75  * Note: Max possible sampling rate is 45.45 KSPS.
76  * This is derived by testing the firmware on SDP-K1 controller board with STM32F469NI MCU
77  * using GCC and ARM compilers. The max possible sampling rate can vary from board to board */
78 #define MAX_SAMPLING_RATE (45454)
79 #define LDAC_PWM_DUTY_CYCLE (80)
80 
81 /******************************************************************************/
82 /********************** Public/Extern Declarations ****************************/
83 /******************************************************************************/
84 
85 extern struct mbed_uart_init_param mbed_uart_init_params;
86 extern struct mbed_uart_init_param mbed_vcom_init_params;
87 extern struct mbed_spi_init_param mbed_spi_init_params;
88 extern struct mbed_spi_init_param mbed_spi_init_params_without_sw_csb;
89 extern struct mbed_pwm_init_param mbed_pwm_init_params;
90 extern struct mbed_gpio_irq_init_param mbed_trigger_gpio_irq_init_params;
91 extern struct mbed_gpio_init_param mbed_gpio_ldac_init_params;
92 extern struct mbed_gpio_init_param mbed_gpio_reset_init_params;
93 
94 #endif /* APP_CONFIG_MBED_H_ */
struct mbed_gpio_irq_init_param mbed_trigger_gpio_irq_init_params
Definition: app_config_mbed.c:65
struct mbed_spi_init_param mbed_spi_init_params
Definition: app_config_mbed.c:53
struct mbed_uart_init_param mbed_vcom_init_params
Definition: app_config_mbed.c:41
struct mbed_spi_init_param mbed_spi_init_params_without_sw_csb
Definition: app_config_mbed.c:62
struct mbed_gpio_init_param mbed_gpio_reset_init_params
Definition: app_config_mbed.c:85
struct mbed_gpio_init_param mbed_gpio_ldac_init_params
Definition: app_config_mbed.c:80
struct mbed_pwm_init_param mbed_pwm_init_params
Definition: app_config_mbed.c:70
struct mbed_uart_init_param mbed_uart_init_params
Definition: app_config_mbed.c:30