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 <stdint.h>
21#include "stm32_uart.h"
22#include "stm32_usb_uart.h"
23#include "stm32_spi.h"
24#include "stm32_gpio.h"
25#include "stm32_i2c.h"
26#include "usb_device.h"
27#include "app_config.h"
28
29/******************************************************************************/
30/********************** Macros and Constants Definition ***********************/
31/******************************************************************************/
32
33/* Note: The SDP-K1 board with the STM32F469NI MCU has been used
34* for developing the firmware. The below parameters will change depending
35* on the controller used. */
36#define HW_CARRIER_NAME SDP_K1
37
38/* STM32 UART specific parameters */
39#define APP_UART_HANDLE &huart5
40#define UART_IRQ_ID UART5_IRQn
41#define UART_ID 0
42#define I2C_ID 1 // I2C1
43
44/* STM32 VCOM specific parameters */
45#define APP_UART_USB_HANDLE hUsbDeviceHS
46#define APP_UART_USB_IRQ OTG_HS_IRQn
47
48/* STM32 SPI Specific parameters */
49#define SPI_DEVICE_ID 1 //SPI1
50#define SPI_CSB 15 //PA15
51#define STM32_SPI_CS_PORT 0 //PORTA
52
53/* STM32 GPIO Specific parameters */
54#define RESET_GPIO_PORT 6
55#define RESET_GPIO_PIN 11
56
57#define LRDAC_GPIO_PORT 6
58#define LRDAC_GPIO_PIN 9
59
60#define WP_GPIO_PORT 6
61#define WP_GPIO_PIN 10
62
63#define DIS_GPIO_PORT 6
64#define DIS_GPIO_PIN 7
65
66#define INDEP_GPIO_PORT 0
67#define INDEP_GPIO_PIN 11
68
69/* Redefine the init params structure mapping wrt platform */
70#define spi_extra_init_params stm32_spi_init_params
71#define uart_extra_init_params stm32_uart_init_params
72#define vcom_extra_init_params stm32_vcom_extra_init_params
73#define reset_gpio_extra_init_params stm32_reset_gpio_init_params
74#define wp_gpio_extra_init_params stm32_wp_gpio_init_params
75#define lrdac_gpio_extra_init_params stm32_lrdac_gpio_init_params
76#define dis_gpio_extra_init_params stm32_dis_gpio_init_params
77#define indep_gpio_extra_init_params stm32_indep_gpio_init_params
78
79/* Platform Ops */
80#define irq_platform_ops stm32_gpio_irq_ops
81#define gpio_ops stm32_gpio_ops
82#define spi_ops stm32_spi_ops
83#define i2c_ops stm32_i2c_ops
84#define uart_ops stm32_uart_ops
85#define vcom_ops stm32_usb_uart_ops
86
87/******************************************************************************/
88/********************** Variables and User Defined Data Types *****************/
89/******************************************************************************/
90extern struct stm32_uart_init_param stm32_uart_init_params;
92extern struct stm32_gpio_irq_init_param stm32_trigger_gpio_irq_init_params;
93extern struct stm32_spi_init_param stm32_spi_init_params;
94extern struct stm32_gpio_init_param stm32_reset_gpio_init_params;
95extern struct stm32_gpio_init_param stm32_wp_gpio_init_params;
96extern struct stm32_gpio_init_param stm32_lrdac_gpio_init_params;
97extern struct stm32_gpio_init_param stm32_dis_gpio_init_params;
98extern struct stm32_gpio_init_param stm32_indep_gpio_init_params;
99
100extern UART_HandleTypeDef huart5;
101extern SPI_HandleTypeDef hspi1;
102extern USBD_HandleTypeDef hUsbDeviceHS;
103void stm32_system_init(void);
104extern void SystemClock_Config(void);
105#endif // APP_CONFIG_STM32_H_
UART_HandleTypeDef huart5
USBD_HandleTypeDef hUsbDeviceHS
struct stm32_spi_init_param stm32_spi_init_params
Definition app_config_stm32.c:48
void stm32_system_init(void)
Initialize the STM32 system peripherals.
Definition app_config_stm32.c:176
struct stm32_usb_uart_init_param stm32_vcom_extra_init_params
Definition app_config_stm32.c:38
struct stm32_gpio_irq_init_param stm32_trigger_gpio_irq_init_params
Definition app_config_stm32.c:43
struct stm32_uart_init_param stm32_uart_init_params
Definition app_config_stm32.c:33
SPI_HandleTypeDef hspi1
void SystemClock_Config(void)
struct stm32_gpio_init_param stm32_reset_gpio_init_params
Definition app_config_stm32.c:45
struct stm32_gpio_init_param stm32_wp_gpio_init_params
Definition app_config_stm32.c:50
struct stm32_gpio_init_param stm32_dis_gpio_init_params
Definition app_config_stm32.c:60
struct stm32_gpio_init_param stm32_indep_gpio_init_params
Definition app_config_stm32.c:65
struct stm32_gpio_init_param stm32_lrdac_gpio_init_params
Definition app_config_stm32.c:55
Configuration file of nanodac firmware example program.
VCOM driver for stm32 as a no_os_uart implementation.
Specific initialization parameters for stm32 UART over USB.
Definition stm32_usb_uart.h:27