13 #ifndef APP_CONFIG_STM32_H_
14 #define APP_CONFIG_STM32_H_
21 #include "stm32_uart.h"
22 #include "stm32_spi.h"
23 #include "stm32_gpio.h"
24 #include "stm32_irq.h"
25 #include "stm32_pwm.h"
26 #include "stm32_gpio_irq.h"
36 #define HW_CARRIER_NAME SDP_K1
39 #define APP_UART_HANDLE &huart5
40 #define UART_IRQ_ID UART5_IRQn
47 #define GPIO_TRIGGER_INT_PORT 1
48 #define SPI_DMA_TX_STOP_PWM_GPIO_PIN 12
49 #define SPI_DMA_TX_STOP_PWM_GPIO_PORT 3
52 #define SPI_DEVICE_ID 1
54 #define STM32_SPI_CS_PORT 0
57 #define IRQ_CTRL_ID 15
58 #define TRIGGER_INT_ID 15
59 #define trigger_gpio_handle 0
60 #define LDAC_GPIO_PRIORITY 1
63 #define LDAC_PWM_ID 12
64 #define LDAC_PWM_CHANNEL 2
65 #define LDAC_PWM_CLK_DIVIDER 2
68 #define SPI_DMA_TX_STOP_PWM_ID 4
69 #define SPI_DMA_TX_STOP_PWM_PRESCALER 0
70 #define SPI_DMA_TX_STOP_PWM_CHANNEL 1
71 #define SPI_DMA_TX_STOP_PWM_CLK_DIVIDER 2
74 #define spi_extra_init_params stm32_spi_init_params
75 #define spi_extra_init_params_without_sw_csb stm32_spi_init_params_without_sw_csb
76 #define uart_extra_init_params stm32_uart_init_params
77 #define ldac_pwm_extra_init_params stm32_ldac_pwm_init_params
78 #define spi_dma_tx_stop_pwm_extra_init_params stm32_spi_dma_tx_stop_pwm_init_params
79 #define gpio_ldac_extra_init_params stm32_gpio_ldac_init_params
80 #define spi_dma_tx_stop_pwm_gpio_extra_init_params stm32_spi_dma_tx_stop_pwm_gpio_init_params
81 #define gpio_reset_extra_init_params stm32_gpio_reset_init_params
82 #define ext_int_extra_init_params stm32_trigger_gpio_irq_init_params
85 #define irq_platform_ops stm32_gpio_irq_ops
86 #define gpio_ops stm32_gpio_ops
87 #define spi_ops stm32_spi_ops
88 #define pwm_ops stm32_pwm_ops
89 #define uart_ops stm32_uart_ops
95 #if (INTERFACE_MODE == SPI_DMA)
96 #define MAX_SAMPLING_RATE 274423
97 #define LDAC_PWM_DUTY_CYCLE 99
98 #define MAX_SPI_SCLK 11250000
99 #define LDAC_PWM_PRESCALER 0
100 #define SPI_DMA_TX_STOP_PWM_DUTY_CYCLE 50
102 #define MAX_SAMPLING_RATE 21593
103 #define LDAC_PWM_DUTY_CYCLE 50
104 #define MAX_SPI_SCLK 22500000
105 #define LDAC_PWM_PRESCALER 3
116 extern struct stm32_gpio_init_param
121 extern UART_HandleTypeDef
huart5;
122 extern SPI_HandleTypeDef
hspi1;
123 extern TIM_HandleTypeDef
htim4;
127 struct iio_device_data* iio_dev_data, uint16_t num_of_bytes_transfer,
#define NUMBER_OF_CHANNELS
Definition: app_config.h:83
struct stm32_pwm_init_param stm32_spi_dma_tx_stop_pwm_init_params
Definition: app_config_stm32.c:82
UART_HandleTypeDef huart5
struct stm32_gpio_init_param stm32_gpio_ldac_init_params
Definition: app_config_stm32.c:52
struct stm32_pwm_init_param stm32_ldac_pwm_init_params
Definition: app_config_stm32.c:72
struct stm32_spi_init_param stm32_spi_init_params
Definition: app_config_stm32.c:40
struct stm32_spi_init_param stm32_spi_init_params_without_sw_csb
Definition: app_config_stm32.c:46
uint32_t spi_dma_tx_stop_pwm_frquency[NUMBER_OF_CHANNELS]
Definition: app_config_stm32.h:124
int32_t stm32_spi_dma_enable(struct stm32_spi_desc *spidesc, struct iio_device_data *iio_dev_data, uint16_t num_of_bytes_transfer, uint8_t start_addr)
Enables SPI DMA to move data from iio buffer to SPI TX buffer.
Definition: app_config_stm32.c:175
struct stm32_gpio_init_param stm32_gpio_reset_init_params
Definition: app_config_stm32.c:67
int32_t stm32_spi_dma_disable(struct stm32_spi_desc *spidesc)
Disable SPI DMA which move data from iio buffer to SPI TX buffer.
Definition: app_config_stm32.c:223
struct stm32_gpio_irq_init_param stm32_trigger_gpio_irq_init_params
Definition: app_config_stm32.c:35
struct stm32_uart_init_param stm32_uart_init_params
Definition: app_config_stm32.c:30
struct stm32_gpio_init_param stm32_spi_dma_tx_stop_pwm_gpio_init_params
Definition: app_config_stm32.c:60
Configuration file of nanodac firmware example program.