precision-converters-firmware
Loading...
Searching...
No Matches
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_irq.h"
25#include "stm32_gpio_irq.h"
26#include "no_os_irq.h"
27#include "main.h"
28/******************************************************************************/
29/********************** Macros and Constants Definition ***********************/
30/******************************************************************************/
31#ifdef STM32H563xx
32/* The below configurations are specific to STM32H563ZIT6 MCU on NUCLEO-H563ZI Board. */
33#define HW_CARRIER_NAME NUCLEO-H563ZI
34
35/* STM32 SPI Specific parameters */
36#define SPI_DEVICE_ID 1 // SPI1
37#define SPI_CS_PORT 3 // GPIO Port D
38#define SPI_CSB 14 // PD_14
39
40/* STM32 UART specific parameters */
41#define APP_UART_HANDLE huart3
42
43/* UART Device ID */
44#define UART_IRQ_ID USART3_IRQn
45
46/* RDY specific Port and Pin */
47#define RDY_PORT 5
48#define RDY_PIN 3
49
50#define RDY_GPIO_PRIORITY 1
51
52#define I2C_DEVICE_ID 1 // I2C1
53
54/* I2C timing register value for standard mode of operation
55 * Check here for more understanding on I2C timing register
56 * configuration: https://wiki.analog.com/resources/no-os/drivers/i2c */
57#define I2C_TIMING 0x00000E14
58
59#else
60/* The below configurations are specific to STM32769NI MCU on Disco-F769NI Board. */
61#define HW_CARRIER_NAME DISCO-F769NI
62
63/* STM32 SPI Specific parameters */
64#define SPI_DEVICE_ID 2 // SPI1
65#define SPI_CS_PORT 0 // GPIO Port D
66#define SPI_CSB 11 // PA_11
67
68/* STM32 UART specific parameters */
69#define APP_UART_HANDLE huart6
70
71/* UART Device ID */
72#define UART_IRQ_ID USART6_IRQn
73
74/* RDY specific Port and Pin */
75#define RDY_PORT 9 // GPIO Port J
76#define RDY_PIN 4 // PJ_4
77
78#define I2C_DEVICE_ID 1 // I2C1
79
80/* I2C timing register value for standard mode of operation
81 * Check here for more understanding on I2C timing register
82 * configuration: TODO*/
83#define I2C_TIMING 0x40912732
84
85/* Ticker for Pocket Lab */
86#define LVGL_TICK_TIME_US 5000
87#define LVGL_TICK_TIME_MS (LVGL_TICK_TIME_US / 1000)
88
89#endif
90/******************************************************************************/
91/********************** Variables and User Defined Data Types *****************/
92/******************************************************************************/
93
94extern struct stm32_uart_init_param stm32_uart_extra_init_params;
95extern struct stm32_spi_init_param stm32_spi_extra_init_params;
96extern struct stm32_i2c_init_param stm32_i2c_extra_init_params;
97extern struct stm32_gpio_irq_init_param stm32_trigger_gpio_irq_init_params;
98extern UART_HandleTypeDef APP_UART_HANDLE;
99
100extern void stm32_system_init();
101
102#endif // APP_CONFIG_STM32_H_
void stm32_system_init(void)
Initialize the STM32 system peripherals.
Definition app_config_stm32.c:176
struct stm32_gpio_irq_init_param stm32_trigger_gpio_irq_init_params
Definition app_config_stm32.c:43
struct stm32_i2c_init_param stm32_i2c_extra_init_params
Definition app_config_stm32.c:152
struct stm32_uart_init_param stm32_uart_extra_init_params
Definition app_config_stm32.c:102
#define APP_UART_HANDLE
Definition app_config_stm32.h:131
struct stm32_spi_init_param stm32_spi_extra_init_params
Definition app_config_stm32.c:43