5 #include "stm32f4xx_conf.h" 8 #define ARM_HW_TIMER_TIMx (TIM3) 9 #define ARM_HW_TIMER_TIMx_IRQ (TIM3_IRQn) 10 #define ARM_HW_TIMER_TIMx_RCC (RCC_APB1Periph_TIM3) 11 #define ARM_HW_TIMER_TIMx_IRQHandler (TIM3_IRQHandler) 21 #define USB_ID_PORT (GPIOA) 22 #define USB_ID_PIN (GPIO_PinSource10) 23 #define USB_DP_PORT (GPIOA) 24 #define USB_DP_PIN (GPIO_PinSource12) 25 #define USB_DM_PORT (GPIOA) 26 #define USB_DM_PIN (GPIO_PinSource11) 27 #define USB_FS_PORT (GPIOA) 28 #define USB_FS_PIN (GPIO_PinSource9) 29 #define USB_PSO_PORT (GPIOH) 30 #define USB_PSO_PIN (GPIO_PinSource5) 31 #define USB_GPIO_CLK (RCC_AHB2Periph_OTG_FS) 32 #define USB_ALTERNATE_FNC (GPIO_AF_OTG1_FS) 34 #define USB_OTG_FULL_SPEED (3) 35 #define DCFG_FRAME_INTERVAL (0) 36 #define USB_NUM_EP (4) 37 #define MAX_EPS (15) // + EP 0 39 #define RX0_FIFO_SIZE 128 40 #define TX0_FIFO_SIZE 64 41 #define TX1_FIFO_SIZE 128 42 #define TX2_FIFO_SIZE 0 43 #define TX3_FIFO_SIZE 0 49 #define COM0_VALIDITY (true) // validni 50 #define COM0_USART (USART3) 51 #define COM0_USART_CLK (RCC_APB1Periph_USART3) 52 #define COM0_USART_IRQHandler (USART3_IRQHandler) 53 #define COM0_USART_IRQ (USART3_IRQn) 54 #define COM0_USART_RX_GPIO_CLK (RCC_AHB1Periph_GPIOC) 55 #define COM0_USART_TX_GPIO_CLK (RCC_AHB1Periph_GPIOC) 56 #define COM0_USART_RX_GPIO_PORT (GPIOC) 57 #define COM0_USART_TX_GPIO_PORT (GPIOC) 58 #define COM0_USART_RX_PIN_SRC (GPIO_PinSource11) 59 #define COM0_USART_TX_PIN_SRC (GPIO_PinSource10) 60 #define COM0_USART_FC_RTS_GPIO_CLK (0)// neni(RCC_AHB1Periph_GPIOB) 61 #define COM0_USART_FC_CTS_GPIO_CLK (0)// neni(RCC_AHB1Periph_GPIOB) 62 #define COM0_USART_FC_RTS_GPIO_PORT (0)// neni(GPIOB) 63 #define COM0_USART_FC_CTS_GPIO_PORT (0)// neni(GPIOB) 64 #define COM0_USART_FC_RTS_PIN_SRC (0)// neni(GPIO_PinSource14) 65 #define COM0_USART_FC_CTS_PIN_SRC (0)// neni(GPIO_PinSource13) 66 #define COM0_USART_PIN_AF (GPIO_AF_USART3) 67 #define COM0_RS485_DIR_GPIO (0)// neni 68 #define COM0_RS485_DIR_PIN_SRC (0) 69 #define COM0_RS485_DIR_PIN_INVERT (false) 70 #define COM0_RS485_DIR_TX_DELAY (0) 71 #define COM0_RS485_BLOCK_RX_BY_TX (false) 72 #define COM0_SEND_BYTES_ECHO (false) 104 #define LOG_COM_PORT (0) 105 #define LOG_COM_BR (115200) 106 #define LOG_COM_PARITY (0) 111 #define LED0_PIN (GPIO_Pin_8) 112 #define LED0_GPIO_PORT (GPIOG) 113 #define LED0_GPIO_PUPD (GPIO_PuPd_UP) 114 #define LED0_GPIO_OTYPE (GPIO_OType_PP) 115 #define LED0_INVERT (TRUE) 117 #define LED1_PIN (GPIO_Pin_6) 118 #define LED1_GPIO_PORT (GPIOG) 119 #define LED1_GPIO_PUPD (GPIO_PuPd_UP) 120 #define LED1_GPIO_OTYPE (GPIO_OType_PP) 121 #define LED1_INVERT (TRUE) 123 #define LED2_PIN (GPIO_Pin_7) 124 #define LED2_GPIO_PORT (GPIOC ) 125 #define LED2_GPIO_PUPD (GPIO_PuPd_UP) 126 #define LED2_GPIO_OTYPE (GPIO_OType_PP) 127 #define LED2_INVERT (TRUE) 129 #define LED3_PIN (GPIO_Pin_9) 130 #define LED3_GPIO_PORT (GPIOI) 131 #define LED3_GPIO_PUPD (GPIO_PuPd_UP) 132 #define LED3_GPIO_OTYPE (GPIO_OType_PP) 133 #define LED3_INVERT (TRUE) 144 #define BUTTON0_PIN (GPIO_Pin_15) 145 #define BUTTON0_GPIO_PORT (GPIOG) 146 #define BUTTON0_GPIO_PUPD (GPIO_PuPd_UP) 147 #define BUTTON0_EXTI_LINE (EXTI_Line15) 148 #define BUTTON0_EXTI_PORT_SOURCE (EXTI_PortSourceGPIOG) 149 #define BUTTON0_EXTI_PIN_SOURCE (EXTI_PinSource15) 150 #define BUTTON0_EXTI_IRQn (EXTI15_10_IRQn) 151 #define BUTTON0_INVERT (true) 153 #define BUTTON1_PIN (GPIO_Pin_13) 154 #define BUTTON1_GPIO_PORT (GPIOC) 155 #define BUTTON1_GPIO_PUPD (GPIO_PuPd_UP) 156 #define BUTTON1_EXTI_LINE (EXTI_Line13) 157 #define BUTTON1_EXTI_PORT_SOURCE (EXTI_PortSourceGPIOC) 158 #define BUTTON1_EXTI_PIN_SOURCE (EXTI_PinSource13) 159 #define BUTTON1_EXTI_IRQn (EXTI15_10_IRQn) 160 #define BUTTON1_INVERT (true) const uint8_t LED_INVERT_ON_OFF[LEDn]
Definition: hal.c:39
const uint32_t COMn_USART_RX_GPIO_PORT[COMn]
Definition: hal.c:12
uint8_t COMn_RS485_DIR_PIN_SRC[COMn]
Definition: hal.c:28
const uint32_t BUTTONn_PORT[BUTTONn]
Definition: hal.c:42
const uint16_t LED_GPIO_PIN[LEDn]
Definition: hal.c:36
const bool BUTTONn_INVERT_ON_OFF[BUTTONn]
Definition: hal.c:48
const uint8_t COMn_USART_RX_PIN_SRC[COMn]
Definition: hal.c:14
const uint32_t COMn_USART_CLK[COMn]
Definition: hal.c:8
const uint16_t BUTTONn_EXTI_LINE[BUTTONn]
Definition: hal.c:45
const bool COMn_VALIDITY[COMn]
Definition: hal.c:6
#define BUTTONn
Definition: hal.h:142
const uint32_t COMn_USART_FC_RTS_GPIO_PORT[COMn]
Definition: hal.c:18
const uint32_t COMn_USART[COMn]
Definition: hal.c:7
void initClockTree()
Definition: hal.c:92
const IRQn COMn_USART_IRQ[COMn]
Definition: hal.c:9
const GPIOPuPd_TypeDef BUTTONn_PUPD[BUTTONn]
Definition: hal.c:44
const uint8_t COMn_USART_FC_CTS_PIN_SRC[COMn]
Definition: hal.c:21
const bool COMn_RS485_DIR_PIN_INVERT[COMn]
Definition: hal.c:29
const uint8_t COMn_USART_FC_RTS_PIN_SRC[COMn]
Definition: hal.c:20
const uint32_t COMn_USART_TX_GPIO_CLK[COMn]
Definition: hal.c:11
const GPIOOType_TypeDef LED_GPIO_OTYPE[LEDn]
Definition: hal.c:38
const GPIOPuPd_TypeDef LED_GPIO_PUPD[LEDn]
Definition: hal.c:37
const uint32_t COMn_USART_FC_CTS_GPIO_PORT[COMn]
Definition: hal.c:19
const uint8_t COMn_RS485_DIR_PIN_SRC_D[COMn]
Definition: hal.c:26
const bool COMn_RS485_BLOCK_RX_BY_TX[COMn]
Definition: hal.c:31
const uint32_t COMn_USART_FC_CTS_GPIO_CLK[COMn]
Definition: hal.c:17
const bool COMn_SEND_BYTES_ECHO[COMn]
Definition: hal.c:32
#define LEDn
Definition: hal.h:109
uint32_t getGPIO_EXTI_PortSource(GPIO_TypeDef *gpio)
Definition: hal.c:72
#define COMn
Definition: hal.h:47
const uint16_t BUTTONn_PIN[BUTTONn]
Definition: hal.c:43
const uint8_t COMn_RS485_DIR_PIN_SRC_C[COMn]
Definition: hal.c:24
const IRQn BUTTONn_IRQn[BUTTONn]
Definition: hal.c:47
const uint8_t BUTTONn_PIN_SOURCE[BUTTONn]
Definition: hal.c:46
const uint32_t COMn_RS485_DIR_GPIO_D[COMn]
Definition: hal.c:25
const uint32_t COMn_RS485_DIR_GPIO_C[COMn]
Definition: hal.c:23
const uint32_t LED_GPIO_PORT[LEDn]
Definition: hal.c:35
const uint32_t COMn_RS485_DIR_TX_DELAY[COMn]
Definition: hal.c:30
const uint8_t COMn_USART_PIN_AF[COMn]
Definition: hal.c:22
const uint32_t COMn_USART_TX_GPIO_PORT[COMn]
Definition: hal.c:13
const uint32_t COMn_USART_RX_GPIO_CLK[COMn]
Definition: hal.c:10
const uint8_t COMn_USART_TX_PIN_SRC[COMn]
Definition: hal.c:15
uint32_t getGPIO_AHB1_Clk(GPIO_TypeDef *gpio)
Definition: hal.c:52
uint32_t COMn_RS485_DIR_GPIO[COMn]
Definition: hal.c:27
const uint32_t COMn_USART_FC_RTS_GPIO_CLK[COMn]
Definition: hal.c:16