no-OS
parameters.h
Go to the documentation of this file.
1 /***************************************************************************/
35 #ifndef __PARAMETERS_H__
36 #define __PARAMETERS_H__
37 
38 /******************************************************************************/
39 /***************************** Include Files **********************************/
40 /******************************************************************************/
41 #include "stm32_hal.h"
42 #include "stm32_irq.h"
43 #include "stm32_gpio_irq.h"
44 #include "stm32_spi.h"
45 #include "stm32_gpio.h"
46 #include "stm32_uart.h"
47 #include "stm32_uart_stdio.h"
48 #include "no_os_units.h"
49 
50 /******************************************************************************/
51 /********************** Macros and Constants Definitions **********************/
52 /******************************************************************************/
53 extern UART_HandleTypeDef huart5;
54 #ifdef IIO_SUPPORT
55 #define INTC_DEVICE_ID 0
56 #endif
57 
58 #define XSTR(x) STR(x)
59 #define STR(x) #x
60 
61 #define UART_IRQ_ID UART5_IRQn
62 
63 #define UART_DEVICE_ID 5
64 #define UART_BAUDRATE 115200
65 #define UART_EXTRA &uart_extra_ip
66 #define UART_OPS &stm32_uart_ops
67 
68 
69 #define SPI_DEVICE_ID 1
70 #define SPI_BAUDRATE 45000000 /* multiples of sysclk */
71 #define SPI_CS 15
72 #define SPI_CS_PORT GPIO_PORT_A
73 #define SPI_OPS &stm32_spi_ops
74 #define SPI_EXTRA &spi_extra_ip
75 
76 #define GPIO_OPS &stm32_gpio_ops
77 #define GPIO_EXTRA NULL
78 #define GPIO_CNV 10
79 #define GPIO_CNV_PORT GPIO_PORT_A
80 #define GPIO_PORT_A 0
81 
82 #define SAMPLES_PER_CHANNEL 1000
83 #define BYTES_PER_SAMPLE 4 /* one sample contains all channels */
84 #define MAX_SIZE_BASE_ADDR (SAMPLES_PER_CHANNEL * BYTES_PER_SAMPLE)
85 
86 /* time to xfer 1 byte */
87 #define TX_PWM_PERIOD_NS (( 8 * KILO) / ((SPI_BAUDRATE / MEGA ) - 1))
88 #define TX_PWM_DUTY_NS 1 /* dont care */
89 #define TX_PWM_REPS (BYTES_PER_SAMPLE - 1)
90 
91 /* time to transfer a sample */
92 #define CS_PWM_PERIOD_NS ((TX_PWM_PERIOD_NS * BYTES_PER_SAMPLE) + CS_PWM_DUTY_NS + 200)
93 #define CS_PWM_DUTY_NS 30 /* quiet time, from datasheet */
94 
95 /* sample rate */
96 #define TRIGGER_PERIOD_NS (CS_PWM_PERIOD_NS + TRIGGER_DUTY_NS)
97 #define TRIGGER_DUTY_NS 20
98 #define TRIGGER_PWM_ID 1
99 
100 #define PWM_OPS &stm32_pwm_ops
101 #define TRIGGER_PWM_EXTRA &trigger_pwm_extra_init_params
102 
104 extern struct stm32_spi_init_param spi_extra_ip;
106 
107 #define CLKGEN_INIT NULL
108 #define OFFLOAD_INIT NULL
109 #define SPI_ENGINE_INIT NULL
110 #define DCACHE_INVALIDATE NULL
111 
112 
113 #endif /* __PARAMETERS_H__ */
stm32_spi_init_param
Structure holding the initialization parameters for stm32 platform specific SPI parameters.
Definition: stm32_spi.h:51
no_os_units.h
Header file of Units.
uart_extra_ip
struct xil_uart_init_param uart_extra_ip
Definition: parameters.c:40
stm32_spi.h
Header file for the stm32 spi driver.
stm32_uart_init_param
Specific initialization parameters for stm32 UART.
Definition: stm32_uart.h:46
trigger_pwm_extra_init_params
struct stm32_pwm_init_param trigger_pwm_extra_init_params
Definition: parameters.c:77
stm32_uart.h
Header file of UART driver for STM32.
stm32_uart_stdio.h
Header file of stm32 UART driver stdout/stdin redirection.
stm32_irq.h
Header file for stm32 irq specifics.
stm32_gpio.h
Header file for stm32 gpio specifics.
stm32_pwm_init_param
Structure holding the STM32 PWM parameters.
Definition: stm32_pwm.h:82
spi_extra_ip
struct stm32_spi_init_param spi_extra_ip
Definition: parameters.c:138
stm32_gpio_irq.h
Header file for stm32 gpio irq specifics.
huart5
UART_HandleTypeDef huart5
stm32_hal.h