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_i2c.h"
25#include "stm32_uart_stdio.h"
26#include "main.h"
27
28/******************************************************************************/
29/********************** Macros and Constants Definition ***********************/
30/******************************************************************************/
31
32/* Note: The SDP-K1 board with the STM32F469NI MCU has been used
33* for developing the firmware. The below parameters will change depending
34* on the controller used. */
35
36//#define ARDUINO
37
38/* SPI Pins on SDP-K1-Arduino Interface */
39#ifdef ARDUINO
40#define SPI_DEVICE_ID 1 // SPI1
41#define SPI_CS_PORT 0 // GPIO Port A
42#define SPI_CSB 15 // PA_15
43#define I2C_DEVICE_ID 1 // I2C1
44#else // Default- SDP_120 Interface
45/* SPI Pins on SDP-K1-SDP-120 Interface */
46#define SPI_DEVICE_ID 5 // SPI5
47#define SPI_CS_PORT 1 // GPIO Port B
48#define SPI_CSB 9 // PA_15
49#define I2C_DEVICE_ID 3 // I2C3
50#endif
51
52#define I2C_TIMING 0 // (Unused)
53
54/* STM32 UART specific parameters */
55#define APP_UART_HANDLE &huart5
56#define UART_IRQ_ID UART5_IRQn
57
58#define GAIN_PIN 11 // PG_11
59#define GAIN_PORT 6 // GPIO PORT G
60
61#define RESET_PIN 15 // PB_15
62#define RESET_PORT 1 // GPIO Port B
63
64#define LDAC_PIN 10 // PG_10
65#define LDAC_PORT 6 // GPIO PORT G
66
67#define ADDR0_PIN 10 // PA_10
68#define ADDR0_PORT 0 // GPIO PORT A
69
70/* platform ops */
71#define spi_ops stm32_spi_ops
72#define uart_ops stm32_uart_ops
73#define gpio_ops stm32_gpio_ops
74#define i2c_ops stm32_i2c_ops
75
76/******************************************************************************/
77/********************** Public/Extern Declarations ****************************/
78/******************************************************************************/
79
80extern struct no_os_uart_desc *uart_desc;
81extern UART_HandleTypeDef huart5;
82
83extern struct stm32_uart_init_param stm32_uart_extra_init_params;
84extern struct stm32_spi_init_param stm32_spi_extra_init_params;
85extern struct stm32_i2c_init_param stm32_i2c_extra_init_params;
86
87extern void stm32_system_init(void);
88
89#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_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
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