13#ifndef APP_CONFIG_STM32_H_
14#define APP_CONFIG_STM32_H_
24#include "stm32_gpio_irq.h"
26#include "stm32_gpio.h"
27#include "stm32_uart.h"
40#define HW_CARRIER_NAME SDP_K1
45#if defined (USE_PHY_COM_PORT)
46#define UART_IRQ UART5_IRQn
48#define UART_IRQ OTG_HS_IRQn
49#define CONSOLE_IRQ UART5_IRQn
51#define SPI_DEVICE_ID 1
53#define SPI_CS_PORT_BASE GPIOA
54#define SPI_CS_PORT_NUM 0
57#define CNV_PORT_BASE GPIOA
60#define RESET_PIN_NUM 9
61#define RESET_PORT_NUM 6
62#define TRIGGER_INT_ID BSY_PIN_NUM
63#define TRIGGER_GPIO_PORT 0
64#define TRIGGER_GPIO_PIN GP0_PIN_NUM
65#define MAX_SPI_BAUDRATE 22500000
68#define SPI_BURST_PWM_ID 12
69#define SPI_BURST_PWM_PORT 3
71#define gpio_ops stm32_gpio_ops
72#define spi_ops stm32_spi_ops
73#define i2c_ops stm32_i2c_ops
74#define vcom_ops stm32_usb_uart_ops
75#define uart_ops stm32_uart_ops
76#define pwm_ops stm32_pwm_ops
77#define dma_ops stm32_dma_ops
78#define trigger_gpio_irq_ops stm32_gpio_irq_ops
79#define trigger_gpio_handle 0
80#define vcom_extra_init_params stm32_vcom_extra_init_params
81#define uart_extra_init_params stm32_uart_extra_init_params
82#define spi_extra_init_params stm32_spi_extra_init_params
83#define bsy_extra_init_params stm32_gpio_bsy_extra_init_params
84#define cnv_extra_init_params stm32_gpio_cnv_extra_init_params
85#define reset_extra_init_params stm32_gpio_reset_extra_init_params
86#define pwm_cnv_extra_init_params stm32_pwm_cnv_extra_init_params
87#define pwm_spi_burst_extra_init_params stm32_pwm_spi_burst_extra_init_params
88#define trigger_gpio_irq_extra_params stm32_gpio_irq_extra_init_params
89#define cnv_pwm_gpio_extra_init_params stm32_cnv_pwm_gpio_extra_init_params
90#define tx_trigger_extra_init_params stm32_tx_trigger_extra_init_params
91#define csb_gpio_extra_init_params stm32_csb_gpio_extra_init_params
92#define i2c_extra_init_params stm32_i2c_extra_init_params
93#define spi_burst_extra_init_params stm32_spi_burst_pwm_gpio_extra_init_params
98#define TIMER_1_PRESCALER 1
99#define TIMER_1_CLK_DIVIDER 2
100#define CNV_TIMER_HANDLE htim1
103#define SPI_BURST_TIMER_ID 4
104#define TIMER_4_PRESCALER 1
105#define TIMER_4_CLK_DIVIDER 1
106#define SPI_BURST_TIMER_HANDLE htim4
109#define TIMER_CHANNEL_3 3
112#define TX_TRIGGER_TIMER_ID 8
113#define TX_TRIGGER_PERIOD 400
114#define TX_TRIGGER_DUTY_RATIO 30
115#define TIMER_8_PRESCALER 0
116#define TIMER_8_CLK_DIVIDER 2
117#define TIMER_CHANNEL_1 1
118#define TX_TRIGGER_TIMER_HANDLE htim8
120#define AD4692_DMA_NUM_CHANNELS 2
121#define Rx_DMA_IRQ_ID DMA2_Stream0_IRQn
122#define AD4692_TxDMA_CHANNEL_NUM DMA_CHANNEL_7
123#define AD4692_RxDMA_CHANNEL_NUM DMA_CHANNEL_3
128#define GPIO_IRQ_PRIORITY 1
135#define S_RATE_MANUAL_DMA (800000)
136#define S_RATE_MANUAL_INTR (50000)
139#define S_RATE_CNV_CLOCK_INTR_STD_AVG (6250)
140#define S_RATE_CNV_BURST_STD_AVG (5750)
141#define S_RATE_SPI_BURST_STD_AVG (5750)
144#define S_RATE_CNV_CLOCK_INTR_STD_ACC (5500)
145#define S_RATE_CNV_BURST_STD_ACC (5000)
146#define S_RATE_SPI_BURST_STD_ACC (5000)
149#define S_RATE_CNV_CLOCK_INTR_ADV_AVG (6250)
150#define S_RATE_CNV_BURST_ADV_AVG (4500)
151#define S_RATE_SPI_BURST_ADV_AVG (4500)
154#define S_RATE_CNV_CLOCK_INTR_ADV_ACC (5500)
155#define S_RATE_CNV_BURST_ADV_ACC (4000)
156#define S_RATE_SPI_BURST_ADV_ACC (4000)
164extern TIM_HandleTypeDef
htim1;
165extern TIM_HandleTypeDef
htim8;
166extern TIM_HandleTypeDef
htim4;
198extern UART_HandleTypeDef
huart5;
UART_HandleTypeDef huart5
DMA_HandleTypeDef hdma_tim8_ch1
struct stm32_dma_channel rxdma_channel
Definition app_config_stm32.c:136
USBD_HandleTypeDef hUsbDeviceHS
void stm32_system_init(void)
Initialize the STM32 system peripherals.
Definition app_config_stm32.c:176
struct stm32_pwm_init_param stm32_tx_trigger_extra_init_params
Definition app_config_stm32.c:99
int stm32_abort_dma_transfer(void)
Abort DMA Transfers.
Definition app_config_stm32.c:315
struct stm32_usb_uart_init_param stm32_vcom_extra_init_params
Definition app_config_stm32.c:38
DMA_HandleTypeDef hdma_spi1_rx
uint32_t data_read
Definition app_support.c:49
struct stm32_i2c_init_param stm32_i2c_extra_init_params
Definition app_config_stm32.c:152
volatile int dma_cycle_count
Definition app_config_stm32.c:242
uint32_t rxdma_ndtr
Definition app_config_stm32.c:245
void update_buff(uint8_t *local_buf, uint8_t *buf_start_addr)
Update buffer index.
Definition app_config_stm32.c:499
struct stm32_gpio_init_param stm32_gpio_cnv_extra_init_params
Definition app_config_stm32.c:39
struct stm32_pwm_init_param stm32_pwm_cnv_extra_init_params
Definition app_config_stm32.c:190
struct stm32_uart_init_param stm32_uart_extra_init_params
Definition app_config_stm32.c:102
struct stm32_gpio_irq_init_param stm32_gpio_irq_extra_init_params
Definition app_config_stm32.c:156
volatile struct iio_device_data * iio_dev_data_g
Definition ad405x_iio.c:281
volatile uint8_t * buff_start_addr
Definition ad405x_iio.c:140
uint8_t local_buf[MAX_LOCAL_BUF_SIZE]
Definition ad405x_support.c:42
struct stm32_spi_init_param stm32_spi_extra_init_params
Definition app_config_stm32.c:43
struct stm32_dma_channel txdma_channel
Definition app_config_stm32.c:118
volatile uint32_t callback_count
Definition app_config_stm32.c:38
struct stm32_gpio_init_param stm32_csb_gpio_extra_init_params
Definition app_config_stm32.c:99
uint8_t num_of_active_channels
Definition ad4170_iio.c:195
uint32_t nb_of_samples_g
Definition ad4170_iio.c:397
void tim8_init(void)
Initialize Tx trigger advanced PWM parameters.
Definition app_config_stm32.c:367
void ad4692_spi_dma_rx_cplt_callback(DMA_HandleTypeDef *hdma)
Callback function to flag the capture of number of requested samples.
Definition app_config_stm32.c:312
int ad4692_config_and_start_pwm(struct ad4692_desc *desc)
Configure and start PWM.
Definition app_config_stm32.c:210
void ad4692_stop_timer(void)
Stop timers and DMA transfers.
Definition app_config_stm32.c:241
void ad4692_spi_dma_rx_half_cplt_callback(DMA_HandleTypeDef *hdma)
Callback function to flag the capture of number of requested samples.
Definition app_config_stm32.c:294
void stm32_tim4_init(void)
Initialize Timer 4.
Definition app_config_stm32.c:397
int32_t tx_trigger_init(void)
Initialize Tx Trigger Timer.
Definition app_config.c:360
struct iio_device_data * ad4692_iio_dev_data
void SystemClock_Config(void)
struct stm32_gpio_init_param stm32_cnv_pwm_gpio_extra_init_params
Definition app_config_stm32.c:93
struct stm32_gpio_init_param stm32_spi_burst_pwm_gpio_extra_init_params
Definition app_config_stm32.c:74
struct stm32_gpio_init_param stm32_gpio_bsy_extra_init_params
Definition app_config_stm32.c:51
struct no_os_dma_init_param ad4692_dma_init_param
Definition app_config.c:156
struct no_os_gpio_desc * csb_gpio_desc
Definition app_config.c:173
struct stm32_pwm_init_param stm32_pwm_spi_burst_extra_init_params
Definition app_config_stm32.c:62
volatile bool ad4692_dma_buff_full
Definition ad4692_iio.c:413
struct stm32_gpio_init_param stm32_gpio_reset_extra_init_params
Definition app_config_stm32.c:45
void MX_USB_DEVICE_Init(void)
Header file of ad4692_iio.
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