13#ifndef APP_CONFIG_STM32_H_
14#define APP_CONFIG_STM32_H_
22#include "stm32_uart.h"
23#include "stm32_gpio.h"
25#if (INTERFACE_MODE != SPI_DMA_MODE)
26#include "stm32_gpio_irq.h"
31#if (INTERFACE_MODE == SPI_DMA_MODE)
35#if defined (TARGET_SDP_K1)
36#include "stm32_usb_uart.h"
43#if defined (TARGET_SDP_K1)
45#define HW_CARRIER_NAME SDP-K1
49#define STM32_SPI_CS_PORT 0
56#define APP_UART_HANDLE &huart5
57#define UART_IRQ_ID UART5_IRQn
65#define DIG_AUX_1_PORT 6
66#define DIG_AUX_2_PORT 6
67#define SYNC_INB_PORT 6
68#define SYNC_INB_PORT_ID GPIOG
70#define GPIO_TRIGGER_INT_PORT EXTI_GPIOG
75#define AD469x_DMA_NUM_CHANNELS 2
77#define Rx_DMA_IRQ_ID DMA2_Stream0_IRQn
78#define AD469x_TxDMA_CHANNEL_NUM DMA_CHANNEL_7
79#define AD469x_RxDMA_CHANNEL_NUM DMA_CHANNEL_3
82#define TX_TRIGGER_TIMER_ID 8
84#define TX_TRIGGER_PERIOD 2250
85#define TX_TRIGGER_DUTY_RATIO 240
86#define TIMER_8_PRESCALER 0
87#define TIMER_8_CLK_DIVIDER 1
88#define TIMER_CHANNEL_1 1
91#define HW_CARRIER_NAME NUCLEO-H563ZI
95#define STM32_SPI_CS_PORT 3
102#define APP_UART_HANDLE &huart3
108#define LED_GPO LED1_GREEN_Pin
110#define DIG_AUX_1_PORT 6
111#define DIG_AUX_2_PORT 6
112#define SYNC_INB_PORT 4
114#define GPIO_TRIGGER_INT_PORT EXTI_GPIOG
119#define I2C_TIMING 0x00000E14
122#define TDM_DATA_SIZE 32
123#define TDM_SLOTS_PER_FRAME 1
124#define TDM_FS_ACTIVE_LENGTH 8
127#define TDM_N_SAMPLES_DMA_READ 800
130#define TDM_DMA_READ_SIZE TDM_N_SAMPLES_DMA_READ * TDM_SLOTS_PER_FRAME/2
132#define STM32_SAI_BASE SAI1_Block_A
135#if (INTERFACE_MODE == SPI_INTERRUPT_MODE)
136#define FS_CONFIG_VALUE FS_SINC5_AVG_24_KSPS
137#define AD4170_MAX_SAMPLING_RATE 24000
139#if defined (DEV_AD4170)
140#define FS_CONFIG_VALUE FS_SINC5_512_KSPS
141#define AD4170_MAX_SAMPLING_RATE 500000
142#elif defined (DEV_AD4190)
143#define FS_CONFIG_VALUE FS_SINC3_62P5_KSPS
144#define AD4170_MAX_SAMPLING_RATE 62500
148#define TICKER_INTERRUPT_PERIOD_uSEC (0)
151#define AD4170_MAX_SPI_SPEED 20000000
167#if !defined (TARGET_SDP_K1)
168extern UART_HandleTypeDef
huart3;
170extern UART_HandleTypeDef
huart5;
187extern struct stm32_spi_desc*
sdesc;
189#if (INTERFACE_MODE == SPI_DMA_MODE)
struct no_os_pwm_desc * pwm_desc
Definition app_config.c:106
int stm32_timer_stop(void)
Stop generating timer signals.
Definition app_config_stm32.c:279
UART_HandleTypeDef huart5
DMA_HandleTypeDef hdma_tim8_ch1
struct stm32_dma_channel rxdma_channel
Definition app_config_stm32.c:134
USBD_HandleTypeDef hUsbDeviceHS
void stm32_system_init(void)
Initialize the STM32 system peripherals.
Definition app_config_stm32.c:174
void tim8_config(void)
Configure Tx Trigger timer for slave mode operation, one-pulse mode and to generate DMA requests.
Definition app_config_stm32.c:243
struct stm32_pwm_init_param stm32_tx_trigger_extra_init_params
Definition app_config_stm32.c:98
int stm32_abort_dma_transfer(void)
Abort DMA Transfers.
Definition app_config_stm32.c:313
struct stm32_usb_uart_init_param stm32_vcom_extra_init_params
Definition app_config_stm32.c:38
DMA_HandleTypeDef hdma_spi1_rx
struct stm32_gpio_irq_init_param stm32_trigger_gpio_irq_init_params
Definition app_config_stm32.c:43
struct stm32_dma_channel txdma_channel
Definition app_config_stm32.c:31
uint32_t rxdma_ndtr
Definition app_config_stm32.c:177
int dma_cycle_count
Definition app_config_stm32.c:171
struct stm32_uart_init_param stm32_uart_extra_init_params
Definition app_config_stm32.c:51
void update_buff(uint32_t *local_buf, uint32_t *buf_start_addr)
Update buffer index.
Definition app_config_stm32.c:291
struct stm32_spi_init_param stm32_spi_extra_init_params
Definition app_config_stm32.c:61
uint8_t local_buf[MAX_LOCAL_BUF_SIZE]
Definition ad405x_iio.c:173
struct stm32_gpio_init_param stm32_csb_gpio_extra_init_params
Definition app_config_stm32.c:93
struct stm32_gpio_init_param stm32_sync_inb_gpio_extra_init_params
Definition app_config_stm32.c:73
volatile struct iio_device_data * iio_dev_data_g
Definition ad405x_iio.c:323
uint32_t nb_of_samples_g
Definition ad4170_iio.c:385
struct stm32_tdm_init_param stm32_tdm_extra_init_params
Definition app_config_stm32.c:87
void ad4170_dma_rx_half_cplt(SAI_HandleTypeDef *hsai)
SAI DMA Receive Half Complete Callback function.
Definition app_config_stm32.c:207
struct stm32_gpio_init_param stm32_dig_aux2_gpio_extra_init_params
Definition app_config_stm32.c:67
volatile bool ad4170_dma_buff_full
Definition ad4170_iio.c:394
struct stm32_i2c_init_param stm32_i2c_extra_init_params
Definition app_config_stm32.c:99
void ad4170_spi_dma_rx_half_cplt_callback(DMA_HandleTypeDef *hdma)
Callback function to flag the capture of Half the number of requested samples.
Definition app_config_stm32.c:303
struct iio_device_data * ad4170_iio_dev_data
Definition ad4170_iio.c:319
struct stm32_spi_desc * sdesc
Definition app_config_stm32.c:144
void tim8_init(struct no_os_pwm_desc *pwm_desc)
Initialize Tx trigger advanced PWM parameters.
Definition app_config_stm32.c:397
uint8_t num_of_active_channels
Definition ad4170_iio.c:183
void ad4170_spi_dma_rx_cplt_callback(DMA_HandleTypeDef *hdma)
Callback function to flag the capture of number of requested samples.
Definition app_config_stm32.c:266
bool data_capture_operation
Definition ad4170_iio.c:337
volatile bool tdm_read_started
Definition ad4170_iio.c:330
UART_HandleTypeDef huart3
struct stm32_gpio_init_param stm32_dig_aux1_gpio_extra_init_params
Definition app_config_stm32.c:61
volatile uint32_t * buff_start_addr
Definition ad405x_iio.c:170
int32_t data_read
Definition ad405x_iio.c:329
struct stm32_gpio_init_param stm32_trigger_gpio_extra_init_params
Definition app_config_stm32.c:55
struct no_os_dma_init_param ad4170_dma_init_param
Definition app_config.c:181
void MX_USB_DEVICE_Init(void)
void ad4170_dma_rx_cplt(SAI_HandleTypeDef *hsai)
SAI DMA Receive Complete Callback function.
Definition app_config_stm32.c:224
Configuration file of nanodac firmware example program.