precision-converters-firmware
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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_spi.h"
21#include "stm32_uart.h"
22#include "stm32_irq.h"
23#include "stm32_uart_stdio.h"
24#include "main.h"
25
26/******************************************************************************/
27/********************** Macros and Constants Definition ***********************/
28/******************************************************************************/
29
30/* Note: The SDP-K1 board with the STM32F469NI MCU has been used
31* for developing the firmware. The below parameters will change depending
32* on the controller used. */
33
42//#define SDP_120
43
44#ifdef SDP_120
45
46/* STM32 SPI Specific parameters */
47#define SPI_DEVICE_ID 1 // SPI1
48#define SPI_CS_PORT 0 // GPIO Port A
49#define SPI_SS 15 // PA_15
50#else
51#define SPI_DEVICE_ID 5 // SPI5
52#define SPI_CS_PORT 1 // GPIO Port B
53#define SPI_SS 9 // PB_9
54#endif
55
56/* STM32 UART specific parameters */
57#define APP_UART_HANDLE &huart5
58#define UART_IRQ_ID UART5_IRQn
59
60/* Max SPI Clock Speed */
61#define MAX_SPI_CLK 2000000
62
63/* platform ops */
64#define spi_ops stm32_spi_ops
65#define uart_ops stm32_uart_ops
66
67/******************************************************************************/
68/********************** Public/Extern Declarations ****************************/
69/******************************************************************************/
70
71extern struct no_os_uart_desc *uart_desc;
72extern UART_HandleTypeDef huart5;
73
74extern struct stm32_uart_init_param stm32_uart_extra_init_params;
75extern struct stm32_spi_init_param stm32_spi_extra_init_params;
76
77extern void stm32_system_init(void);
78extern int32_t check_escape_key_pressed();
79
80#endif // APP_CONFIG_STM32_H_
UART_HandleTypeDef huart5
void stm32_system_init(void)
Initialize the STM32 system peripherals.
Definition app_config_stm32.c:174
struct stm32_uart_init_param stm32_uart_extra_init_params
Definition app_config_stm32.c:51
struct stm32_spi_init_param stm32_spi_extra_init_params
Definition app_config_stm32.c:61
int32_t check_escape_key_pressed()
Determines if the Escape key was pressed.
Definition app_config_stm32.c:69
struct no_os_uart_desc * uart_desc
Definition app_config.c:97