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_gpio.h"
24#include "stm32_uart_stdio.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
35//#define ARDUINO
36
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/* LDAC Parameters */
42#define HW_LDACB 7 // PG_7
43#define HW_LDACB_PORT 6 // GPIO Port G
44#else
45/* STM32 SPI Specific parameters */
46#define SPI_DEVICE_ID 5 // SPI5
47#define SPI_CS_PORT 1 // GPIO Port B
48#define SPI_CSB 9 // PB_9
49/* LDAC Parameters */
50#define HW_LDACB 0 // PJ_0
51#define HW_LDACB_PORT 9 // GPIO Port J
52#endif
53
54/* STM32 UART specific parameters */
55#define APP_UART_HANDLE &huart5
56#define UART_IRQ_ID UART5_IRQn
57
58/* Max SPI Clk Speed */
59#define MAX_SPI_CLK 2500000
60
61/* platform ops */
62#define spi_ops stm32_spi_ops
63#define uart_ops stm32_uart_ops
64#define gpio_ops stm32_gpio_ops
65
66/******************************************************************************/
67/********************** Public/Extern Declarations ****************************/
68/******************************************************************************/
69
70extern struct no_os_uart_desc *uart_desc;
71extern UART_HandleTypeDef huart5;
72
73extern struct stm32_uart_init_param stm32_uart_extra_init_params;
74extern struct stm32_spi_init_param stm32_spi_extra_init_params;
75extern struct stm32_gpio_init_param stm32_gpio_ldac_init_params;
76
77extern void stm32_system_init(void);
78
79#endif // APP_CONFIG_STM32_H_
UART_HandleTypeDef huart5
struct stm32_gpio_init_param stm32_gpio_ldac_init_params
Definition app_config_stm32.c:59
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