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 #include "mbed_uart.h"
23 #include "mbed_spi.h"
24 #include "mbed_i2c.h"
25 #include "mbed_gpio.h"
26 #include "mbed_gpio_irq.h"
27 #include "mbed_pwm.h"
28 
29 /******************************************************************************/
30 /********************** Macros and Constants Definition ***********************/
31 /******************************************************************************/
32 
33 /* Pin mapping of SDP-K1 w.r.t Arduino connector */
34 #define SPI_CSB ARDUINO_UNO_D10
35 #define SPI_HOST_SDO ARDUINO_UNO_D11
36 #define SPI_HOST_SDI ARDUINO_UNO_D12
37 #define SPI_SCK ARDUINO_UNO_D13
38 
39 #define I2C_SCL ARDUINO_UNO_D15
40 #define I2C_SDA ARDUINO_UNO_D14
41 
42 /* GPIO Pins for the Pin control mode in AD777x */
43 #define GPIO_RESET_PIN ARDUINO_UNO_D2
44 #define GPIO_MODE0_PIN 0 // Unused
45 #define GPIO_MODE1_PIN 0 // Unused
46 #define GPIO_MODE2_PIN 0 // Unused
47 #define GPIO_MODE3_PIN 0 // Unused
48 
49 #define GPIO_DCLK0_PIN 0 // Unused
50 #define GPIO_DCLK1_PIN 0 // Unused
51 #define GPIO_DCLK2_PIN 0 // Unused
52 #define GPIO_SYNC_IN_PIN ARDUINO_UNO_D0
53 #define GPIO_CONVST_SAR_PIN ARDUINO_UNO_D1
54 
55 #define GPIO_DRDY_PIN ARDUINO_UNO_D8
56 #define GPIO_ERROR_LED LED1 // Red LED
57 #define EXT_MCLK_PIN ARDUINO_UNO_D3
58 
59 /* Port names (Unused) */
60 #define GPIO_DRDY_PORT 0
61 #define GPIO_RESET_PORT 0
62 #define GPIO_MODE0_PORT 0
63 #define GPIO_MODE1_PORT 0
64 #define GPIO_MODE2_PORT 0
65 #define GPIO_MODE3_PORT 0
66 #define GPIO_DCLK0_PORT 0
67 #define GPIO_DCLK1_PORT 0
68 #define GPIO_DCLK2_PORT 0
69 #define GPIO_CONVST_PORT 0
70 #define GPIO_SYNC_PORT 0
71 #define GPIO_ERROR_LED_PORT 0
72 
73 #define IRQ_INT_ID GPIO_IRQ_ID1
74 #define DRDY_IRQ_CTRL_ID 0
75 #define UART_DEVICE_ID 0
76 #define SPI_DEVICE_ID 0
77 #define I2C_DEVICE_ID 0
78 #define MCLK_PWM_ID 0
79 
80 /* Common Pin mapping of UART */
81 #define UART_TX CONSOLE_TX
82 #define UART_RX CONSOLE_RX
83 
84 /* Define the Sampling Frequency. It needs to be noted that the
85  * maximum sampling frequency attainable in SPI Mode is
86  * only 12ksps. This restriction is due to the time taken
87  * by the SPI drivers to read the data of all the 8 channels
88  * available on the SPI line. Occurrence of successive interrupts
89  * during the SPI read time posts a restriction on the maximum
90  * achievable ODR on the software */
91 #define AD777x_SAMPLING_FREQUENCY 12000
92 
93 /******************************************************************************/
94 /********************** Public/Extern Declarations ****************************/
95 /******************************************************************************/
96 
97 extern struct mbed_uart_init_param mbed_uart_extra_init_params;
98 extern struct mbed_uart_init_param mbed_vcom_extra_init_params;
99 extern struct mbed_spi_init_param mbed_spi_extra_init_params;
100 extern struct mbed_i2c_init_param mbed_i2c_extra_init_params;
101 extern struct mbed_gpio_init_param mbed_gpio_reset_extra_init_params;
102 extern struct mbed_gpio_init_param mbed_gpio_mode0_extra_init_params;
103 extern struct mbed_gpio_init_param mbed_gpio_mode1_extra_init_params;
104 extern struct mbed_gpio_init_param mbed_gpio_mode2_extra_init_params;
105 extern struct mbed_gpio_init_param mbed_gpio_mode3_extra_init_params;
106 extern struct mbed_gpio_init_param mbed_gpio_dclk0_extra_init_params;
107 extern struct mbed_gpio_init_param mbed_gpio_dclk1_extra_init_params;
108 extern struct mbed_gpio_init_param mbed_gpio_dclk2_extra_init_params;
109 extern struct mbed_gpio_init_param mbed_gpio_sync_in_extra_init_params;
110 extern struct mbed_gpio_init_param mbed_gpio_convst_sar_extra_init_params;
111 extern struct mbed_gpio_init_param mbed_gpio_drdy_extra_init_params;
112 extern struct mbed_gpio_init_param mbed_gpio_error_extra_init_params;
113 extern struct mbed_gpio_irq_init_param mbed_trigger_gpio_irq_init_params;
114 extern struct mbed_pwm_init_param mbed_pwm_init_params;
116 
117 #endif /* APP_CONFIG_MBED_H_ */
118 
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_pwm_init_param mbed_pwm_init_params
Definition: app_config_mbed.c:70
struct mbed_i2c_init_param mbed_i2c_extra_init_params
Definition: app_config_mbed.c:69
struct mbed_gpio_init_param mbed_gpio_reset_extra_init_params
Definition: app_config_mbed.c:76
struct mbed_gpio_init_param mbed_gpio_mode0_extra_init_params
Definition: app_config_mbed.c:71
struct mbed_gpio_init_param mbed_gpio_mode1_extra_init_params
Definition: app_config_mbed.c:75
struct mbed_gpio_init_param mbed_gpio_convst_sar_extra_init_params
Definition: app_config_mbed.c:103
struct mbed_gpio_init_param mbed_gpio_error_extra_init_params
Definition: app_config_mbed.c:111
struct mbed_gpio_init_param mbed_gpio_dclk0_extra_init_params
Definition: app_config_mbed.c:87
struct mbed_gpio_init_param mbed_gpio_drdy_extra_init_params
Definition: app_config_mbed.c:107
struct mbed_gpio_init_param mbed_gpio_sync_in_extra_init_params
Definition: app_config_mbed.c:99
struct mbed_gpio_init_param mbed_gpio_dclk1_extra_init_params
Definition: app_config_mbed.c:91
struct mbed_gpio_init_param mbed_gpio_dclk2_extra_init_params
Definition: app_config_mbed.c:95
struct mbed_gpio_init_param mbed_gpio_mode3_extra_init_params
Definition: app_config_mbed.c:83
struct mbed_gpio_init_param mbed_gpio_mode2_extra_init_params
Definition: app_config_mbed.c:79
void ad777x_configure_intr_priority(void)
Configure the interrupt priorities.
Definition: app_config_mbed.c:135