no-OS
parameters.h
Go to the documentation of this file.
1 /***************************************************************************/
34 #ifndef __PARAMETERS_H__
35 #define __PARAMETERS_H__
36 
37 /******************************************************************************/
38 /***************************** Include Files **********************************/
39 /******************************************************************************/
40 #include "stm32_hal.h"
41 #include "stm32_irq.h"
42 #include "stm32_gpio_irq.h"
43 #include "stm32_spi.h"
44 #include "stm32_gpio.h"
45 #include "stm32_uart.h"
46 #include "stm32_uart_stdio.h"
47 #include "no_os_units.h"
48 
49 /******************************************************************************/
50 /********************** Macros and Constants Definitions **********************/
51 /******************************************************************************/
52 extern UART_HandleTypeDef huart5;
53 #define SAMPLES_PER_CHANNEL_PLATFORM 2000
54 #define MAX_SIZE_BASE_ADDR (SAMPLES_PER_CHANNEL_PLATFORM * 2 * sizeof(uint32_t))
55 
56 #ifdef IIO_SUPPORT
57 #define INTC_DEVICE_ID 0
58 #endif
59 
60 #define UART_IRQ_ID UART5_IRQn
61 
62 #define UART_DEVICE_ID 5
63 #define UART_BAUDRATE 115200
64 #define UART_EXTRA &ad463x_uart_extra_ip
65 #define UART_OPS &stm32_uart_ops
66 
67 #define SPI_DEVICE_ID 1
68 #define SPI_BAUDRATE 20000000
69 #define SPI_CS 15
70 #define SPI_CS_PORT GPIO_PORT_A
71 #define SPI_OPS &stm32_spi_ops
72 #define SPI_EXTRA &ad463x_spi_extra_ip
73 
74 #define GPIO_OPS &stm32_gpio_ops
75 #define GPIO_EXTRA NULL
76 
77 #define GPIO_RESETN_1 11
78 #define GPIO_RESETN_PORT GPIO_PORT_A
79 
80 #define GPIO_PORT_G 6
81 #define GPIO_CNV 10
82 #define GPIO_CNV_PORT GPIO_PORT_A
83 
84 #define DCACHE_INVALIDATE NULL
85 #define GPIO_PORT_A 0
86 
89 
92 
93 /* ad4630 in interleave mode */
94 #define BYTES_PER_SAMPLE 6
95 
96 /* time to xfer 1 byte */
97 #define TX_PWM_PERIOD_NS (((( 8 * KILO) / (SPI_BAUDRATE / MEGA ))) + 50)
98 #define TX_PWM_DUTY_NS 1 /* dont care */
99 #define TX_PWM_REPS (BYTES_PER_SAMPLE - 1) /* 6 bytes of data 1 cycle + 5 reps */
100 
101 /* time to transfer 6 bytes + cnv period */
102 #define CS_PWM_PERIOD_NS ((TX_PWM_PERIOD_NS * BYTES_PER_SAMPLE) + CS_PWM_DUTY_NS)
103 #define CS_PWM_DUTY_NS 300 /* cnv time, from datasheet */
104 
105 /* sample rate
106  * limited by spi baudrate, might need to limit to chip datasheet for higher spi rate
107  */
108 #define MAX_SAMPLE_RATE_PERIOD_NS (CS_PWM_PERIOD_NS + TRIGGER_DUTY_NS)
109 #define TRIGGER_PERIOD_NS MAX_SAMPLE_RATE_PERIOD_NS
110 #define TRIGGER_DUTY_NS 100 /* cnv min high time from datasheet */
111 
112 #define PWM_OPS &stm32_pwm_ops
113 #define PWM_EXTRA &cnv_pwm_extra_init_params
114 #define PWM_GPIO_EXTRA &cnv_pwm_gpio_extra_init_params
115 #define NO_OS_PWM_ID 1
116 #endif /* __PARAMETERS_H__ */
stm32_spi_init_param
Structure holding the initialization parameters for stm32 platform specific SPI parameters.
Definition: stm32_spi.h:51
ad463x_spi_extra_ip
struct stm32_spi_init_param ad463x_spi_extra_ip
Definition: parameters.c:144
ad463x_uart_extra_ip
struct stm32_uart_init_param ad463x_uart_extra_ip
Definition: parameters.c:47
no_os_units.h
Header file of Units.
cnv_pwm_extra_init_params
struct stm32_pwm_init_param cnv_pwm_extra_init_params
Definition: parameters.c:82
stm32_spi.h
Header file for the stm32 spi driver.
stm32_gpio_init_param
Structure holding the initialization parameters for stm32 platform.
Definition: stm32_gpio.h:44
stm32_uart_init_param
Specific initialization parameters for stm32 UART.
Definition: stm32_uart.h:46
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.
cnv_pwm_gpio_extra_init_params
struct stm32_gpio_init_param cnv_pwm_gpio_extra_init_params
Definition: parameters.c:76
stm32_gpio.h
Header file for stm32 gpio specifics.
stm32_pwm_init_param
Structure holding the STM32 PWM parameters.
Definition: stm32_pwm.h:82
stm32_gpio_irq.h
Header file for stm32 gpio irq specifics.
huart5
UART_HandleTypeDef huart5
stm32_hal.h