precision-converters-firmware
app_config_stm32.h
Go to the documentation of this file.
1 /***************************************************************************/
13 #ifndef APP_CONFIG_STM32_H_
14 #define APP_CONFIG_STM32_H_
15 
16 /******************************************************************************/
17 /***************************** Include Files **********************************/
18 /******************************************************************************/
19 
20 #include "stm32_uart.h"
21 #include "stm32_spi.h"
22 #include "stm32_i2c.h"
23 #include "stm32_gpio.h"
24 #include "stm32_gpio_irq.h"
25 #include "main.h"
26 
27 /******************************************************************************/
28 /********************** Macros and Constants Definition ***********************/
29 /******************************************************************************/
30 
31 /* Note: The SDP-K1 board with the STM32F469NI MCU has been used
32 * for developing the firmware. The below parameters will change depending
33 * on the controller used. */
34 #define HW_CARRIER_NAME SDP-K1
35 
36 /* STM32 SPI Specific parameters */
37 #define MAX_SPI_BAUDRATE 10000000
38 #define SPI_DEVICE_ID 1 // SPI1
39 #define SPI_CS_PORT 0 // GPIO Port A
40 #define SPI_CSB 15 // PA_15
41 
42 /* STM32 UART specific parameters */
43 #define APP_UART_HANDLE &huart5
44 
45 /* UART Device ID */
46 #define UART_IRQ_ID UART5_IRQn
47 
48 /* I2C Device ID */
49 #define I2C_DEVICE_ID 1 // I2C1
50 
51 #define I2C_TIMING 0 // (Unused)
52 
53 /* RDY specific Port and Pin */
54 #define RDY_PORT 6 // Port G
55 #define RDY_PIN 11 // PG_11
56 
57 /* Sync specific Port and Pin */
58 #define SYNC_PORT 6 // Port G
59 #define SYNC_PIN 9 // PG_9
60 
61 /* Priority for Ready Interrupt */
62 #define RDY_GPIO_PRIORITY 1
63 
64 /******************************************************************************/
65 /********************** Variables and User Defined Data Types *****************/
66 /******************************************************************************/
67 extern I2C_HandleTypeDef hi2c1;
68 extern SPI_HandleTypeDef hspi1;
69 extern struct stm32_uart_init_param stm32_uart_extra_init_params;
70 extern struct stm32_spi_init_param stm32_spi_extra_init_params;
71 extern struct stm32_i2c_init_param stm32_i2c_extra_init_params;
72 extern struct stm32_gpio_irq_init_param stm32_trigger_gpio_irq_init_params;
73 extern struct stm32_gpio_init_param stm32_gpio_sync_extra_init_params;
74 extern UART_HandleTypeDef huart5;
75 extern void stm32_system_init();
76 
77 #endif // APP_CONFIG_STM32_H_
UART_HandleTypeDef huart5
SPI_HandleTypeDef hspi1
struct stm32_gpio_irq_init_param stm32_trigger_gpio_irq_init_params
Definition: app_config_stm32.c:35
void stm32_system_init(void)
Initialize the STM32 system peripherals.
Definition: app_config_stm32.c:111
struct stm32_uart_init_param stm32_uart_extra_init_params
Definition: app_config_stm32.c:49
struct stm32_spi_init_param stm32_spi_extra_init_params
Definition: app_config_stm32.c:54
I2C_HandleTypeDef hi2c1
struct stm32_i2c_init_param stm32_i2c_extra_init_params
Definition: app_config_stm32.c:99
struct stm32_gpio_init_param stm32_gpio_sync_extra_init_params
Definition: app_config_stm32.c:46