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_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
34//#define ARDUINO
35
36/* STM32 SPI Specific parameters */
37#ifdef ARDUINO
38#define SPI_DEVICE_ID 1 // SPI1
39#define SPI_CS_PORT 0 // GPIO Port A
40#define SPI_CSB 15 // PA_15
41#else
42#define SPI_DEVICE_ID 5 // SPI5
43#define SPI_CS_PORT 1 // GPIO Port B
44#define SPI_CSB 9 // PB_9
45#endif
46
47/* STM32 UART specific parameters */
48#define APP_UART_HANDLE &huart5
49#define UART_IRQ_ID UART5_IRQn
50
51/* Max SPI CLK SPEED */
52#define MAX_SPI_CLK 2500000
53
54/* platform ops */
55#define spi_ops stm32_spi_ops
56#define uart_ops stm32_uart_ops
57
58/******************************************************************************/
59/********************** Public/Extern Declarations ****************************/
60/******************************************************************************/
61
62extern struct no_os_uart_desc *uart_desc;
63extern UART_HandleTypeDef huart5;
64
65extern struct stm32_uart_init_param stm32_uart_extra_init_params;
66extern struct stm32_spi_init_param stm32_spi_extra_init_params;
67
68extern void stm32_system_init(void);
69extern int32_t check_escape_key_pressed();
70
71#endif // APP_CONFIG_STM32_H_
UART_HandleTypeDef huart5
void stm32_system_init(void)
Initialize the STM32 system peripherals.
Definition app_config_stm32.c:176
struct stm32_uart_init_param stm32_uart_extra_init_params
Definition app_config_stm32.c:102
struct stm32_spi_init_param stm32_spi_extra_init_params
Definition app_config_stm32.c:46
struct no_os_uart_desc * uart_desc
Definition app_config.c:97
int32_t check_escape_key_pressed()
Determines if the Escape key was pressed.
Definition app_config_stm32.c:69