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"
41#define HW_CARRIER_NAME SDP_K1
46#if defined (USE_PHY_COM_PORT)
47#define UART_IRQ UART5_IRQn
49#define UART_IRQ OTG_HS_IRQn
50#define CONSOLE_IRQ UART5_IRQn
52#define SPI_DEVICE_ID 1
54#define SPI_CS_PORT_BASE GPIOA
55#define SPI_CS_PORT_NUM 0
58#define CNV_PORT_BASE GPIOA
61#define RESET_PIN_NUM 9
62#define RESET_PORT_NUM 6
63#define TRIGGER_INT_ID BSY_PIN_NUM
64#define TRIGGER_GPIO_PORT 0
65#define TRIGGER_GPIO_PIN GP0_PIN_NUM
66#define MAX_SPI_BAUDRATE 22500000
69#define SPI_BURST_PWM_ID 12
70#define SPI_BURST_PWM_PORT 3
72#define gpio_ops stm32_gpio_ops
73#define spi_ops stm32_spi_ops
74#define i2c_ops stm32_i2c_ops
75#define vcom_ops stm32_usb_uart_ops
76#define uart_ops stm32_uart_ops
77#define pwm_ops stm32_pwm_ops
78#define dma_ops stm32_dma_ops
79#define trigger_gpio_irq_ops stm32_gpio_irq_ops
80#define trigger_gpio_handle 0
81#define vcom_extra_init_params stm32_vcom_extra_init_params
82#define uart_extra_init_params stm32_uart_extra_init_params
83#define spi_extra_init_params stm32_spi_extra_init_params
84#define gpio_input_extra_init_params stm32_gpio_input_extra_init_params
85#define gpio_output_extra_init_params stm32_gpio_output_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 i2c_extra_init_params stm32_i2c_extra_init_params
92#define spi_burst_extra_init_params stm32_spi_burst_pwm_gpio_extra_init_params
97#define TIMER_1_PRESCALER 1
98#define TIMER_1_CLK_DIVIDER 2
99#define CNV_TIMER_HANDLE htim1
102#define SPI_BURST_TIMER_ID 4
103#define TIMER_4_PRESCALER 1
104#define TIMER_4_CLK_DIVIDER 1
105#define SPI_BURST_TIMER_HANDLE htim4
108#define TIMER_CHANNEL_3 3
111#define TX_TRIGGER_TIMER_ID 8
112#define TX_TRIGGER_PERIOD 400
113#define TX_TRIGGER_DUTY_RATIO 30
114#define TX_TRIGGER_PRESCALER 0
115#define TX_TRIGGER_CLK_DIVIDER 2
116#define TIMER_CHANNEL_1 1
117#define TX_TRIGGER_TIMER_HANDLE htim8
119#define AD4692_DMA_NUM_CHANNELS 2
120#define Rx_DMA_IRQ_ID DMA2_Stream0_IRQn
121#define AD4692_TxDMA_CHANNEL_NUM DMA_CHANNEL_7
122#define AD4692_RxDMA_CHANNEL_NUM DMA_CHANNEL_3
127#define GPIO_IRQ_PRIORITY 1
134#define S_RATE_MANUAL_DMA (800000)
135#define S_RATE_MANUAL_INTR (50000)
138#define S_RATE_CNV_CLOCK_INTR_STD_AVG (6250)
139#define S_RATE_CNV_BURST_STD_AVG (5750)
140#define S_RATE_SPI_BURST_STD_AVG (5750)
143#define S_RATE_CNV_CLOCK_INTR_STD_ACC (5500)
144#define S_RATE_CNV_BURST_STD_ACC (5000)
145#define S_RATE_SPI_BURST_STD_ACC (5000)
148#define S_RATE_CNV_CLOCK_INTR_ADV_AVG (6250)
149#define S_RATE_CNV_BURST_ADV_AVG (4500)
150#define S_RATE_SPI_BURST_ADV_AVG (4500)
153#define S_RATE_CNV_CLOCK_INTR_ADV_ACC (5500)
154#define S_RATE_CNV_BURST_ADV_ACC (4000)
155#define S_RATE_SPI_BURST_ADV_ACC (4000)
163extern TIM_HandleTypeDef
htim1;
164extern TIM_HandleTypeDef
htim8;
165extern TIM_HandleTypeDef
htim4;
195extern UART_HandleTypeDef
huart5;
UART_HandleTypeDef huart5
DMA_HandleTypeDef hdma_tim8_ch1
struct stm32_dma_channel rxdma_channel
Definition app_config_stm32.c:137
USBD_HandleTypeDef hUsbDeviceHS
void stm32_system_init(void)
Initialize the STM32 system peripherals.
Definition app_config_stm32.c:178
struct stm32_pwm_init_param stm32_tx_trigger_extra_init_params
Definition app_config_stm32.c:100
int stm32_abort_dma_transfer(void)
Abort DMA Transfers.
Definition app_config_stm32.c:318
struct stm32_usb_uart_init_param stm32_vcom_extra_init_params
Definition app_config_stm32.c:39
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:166
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_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
uint8_t num_of_active_channels
Definition ad4170_iio.c:195
uint32_t nb_of_samples_g
Definition ad4170_iio.c:397
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:309
int ad4692_config_and_start_pwm(struct ad4692_desc *desc)
Configure and start PWM.
Definition app_config_stm32.c:207
void ad4692_stop_timer(void)
Stop timers and DMA transfers.
Definition app_config_stm32.c:238
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:291
struct stm32_gpio_init_param stm32_gpio_output_extra_init_params
Definition app_config_stm32.c:43
void stm32_tim4_init(void)
Initialize Timer 4.
Definition app_config_stm32.c:382
int32_t tx_trigger_init(void)
Initialize Tx Trigger Timer.
Definition app_config.c:421
struct stm32_gpio_init_param stm32_gpio_input_extra_init_params
Definition app_config_stm32.c:49
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:91
struct stm32_gpio_init_param stm32_spi_burst_pwm_gpio_extra_init_params
Definition app_config_stm32.c:72
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:175
struct stm32_pwm_init_param stm32_pwm_spi_burst_extra_init_params
Definition app_config_stm32.c:60
volatile bool ad4692_dma_buff_full
Definition ad4692_iio.c:404
void MX_USB_DEVICE_Init(void)
Header file of ad4692_iio.
Configuration file of nanodac firmware example program.
Extended support for STM32 PWM peripheral.
VCOM driver for stm32 as a no_os_uart implementation.
Specific initialization parameters for stm32 UART over USB.
Definition stm32_usb_uart.h:27