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