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