25 #ifdef CONFIG_USE_PANEL_NUCLEOF401RE 26 #define BOARD_NAME "NucleoF401RE" 28 #ifdef CONFIG_USE_PANEL_DISCOVERY 29 #define BOARD_NAME "STM32F4Discovery" 40 #ifdef CONFIG_USE_PANEL_CENTERPANEL 47 #define BOARD_LED_BLUE_PORT GPIOE 48 #define BOARD_LED_BLUE_PIN GPIO_PIN_5 50 #define BOARD_LED_GREEN_PORT GPIOE 51 #define BOARD_LED_GREEN_PIN GPIO_PIN_6 53 #define BOARD_LED_RED_PORT GPIOA 54 #define BOARD_LED_RED_PIN GPIO_PIN_8 56 #define LED_PORT_CLK_ENABLES() \ 57 __GPIOA_CLK_ENABLE(); \ 62 #define BOARD_LED_LOGIC_HIGH_IS_ON 1 64 #endif //#ifdef CONFIG_USE_PANEL_CENTERPANEL 68 #ifdef CONFIG_USE_PANEL_DISCOVERY 74 #define LED_NUM_MIN (1) 75 #define LED_NUM_MAX (3) 77 #define BOARD_LED_BLUE_PORT GPIOD 78 #define BOARD_LED_BLUE_PIN GPIO_PIN_15 79 #define BOARD_LED_GREEN_PORT GPIOD 80 #define BOARD_LED_GREEN_PIN GPIO_PIN_12 81 #define BOARD_LED_RED_PORT GPIOD 82 #define BOARD_LED_RED_PIN GPIO_PIN_14 84 #define LED_PORT_CLK_ENABLES() __GPIOD_CLK_ENABLE() 87 #define LED_RED_ON() HAL_GPIO_WritePin(BOARD_LED_RED_PORT,BOARD_LED_RED_PIN,GPIO_PIN_SET) 88 #define LED_BLUE_ON() HAL_GPIO_WritePin(BOARD_LED_BLUE_PORT,BOARD_LED_BLUE_PIN,GPIO_PIN_SET) 89 #define LED_GREEN_ON() HAL_GPIO_WritePin(BOARD_LED_GREEN_PORT,BOARD_LED_GREEN_PIN,GPIO_PIN_SET) 91 #define LED_RED_OFF() HAL_GPIO_WritePin(BOARD_LED_RED_PORT,BOARD_LED_RED_PIN,GPIO_PIN_RESET) 92 #define LED_BLUE_OFF() HAL_GPIO_WritePin(BOARD_LED_BLUE_PORT,BOARD_LED_BLUE_PIN,GPIO_PIN_RESET) 93 #define LED_GREEN_OFF() HAL_GPIO_WritePin(BOARD_LED_GREEN_PORT,BOARD_LED_GREEN_PIN,GPIO_PIN_RESET) 95 #define LED_RED_TOGGLE() HAL_GPIO_TogglePin(BOARD_LED_RED_PORT,BOARD_LED_RED_PIN) 96 #define LED_BLUE_TOGGLE() HAL_GPIO_TogglePin(BOARD_LED_BLUE_PORT,BOARD_LED_BLUE_PIN) 97 #define LED_GREEN_TOGGLE() HAL_GPIO_TogglePin(BOARD_LED_GREEN_PORT,BOARD_LED_GREEN_PIN) 99 #define LED_RED_STATUS() HAL_GPIO_ReadPin(BOARD_LED_RED_PORT,BOARD_LED_RED_PIN) 100 #define LED_BLUE_STATUS() HAL_GPIO_ReadPin(BOARD_LED_BLUE_PORT,BOARD_LED_BLUE_PIN) 101 #define LED_GREEN_STATUS() HAL_GPIO_ReadPin(BOARD_LED_GREEN_PORT,BOARD_LED_GREEN_PIN) 103 #endif //#ifdef CONFIG_USE_PANEL_CENTERPANEL 107 #if defined(CONFIG_MODULE_LED_ENABLE) && defined(CONFIG_USE_PANEL_NUCLEOF401RE) 111 #define LED_NUM_MIN (1) 112 #define LED_NUM_MAX (1) 114 #define BOARD_LED_GREEN_PORT GPIOA 115 #define BOARD_LED_GREEN_PIN GPIO_PIN_5 117 #define LED_PORT_CLK_ENABLES() __GPIOA_CLK_ENABLE() 120 #define LED_BLUE_ON() 121 #define LED_GREEN_ON() HAL_GPIO_WritePin(BOARD_LED_GREEN_PORT,BOARD_LED_GREEN_PIN,GPIO_PIN_SET) 123 #define LED_RED_OFF() 124 #define LED_BLUE_OFF() 125 #define LED_GREEN_OFF() HAL_GPIO_WritePin(BOARD_LED_GREEN_PORT,BOARD_LED_GREEN_PIN,GPIO_PIN_RESET) 128 #define LED_RED_TOGGLE() 129 #define LED_BLUE_TOGGLE() 130 #define LED_GREEN_TOGGLE() HAL_GPIO_TogglePin(BOARD_LED_GREEN_PORT,BOARD_LED_GREEN_PIN) 132 #define LED_RED_STATUS() 133 #define LED_BLUE_STATUS() 134 #define LED_GREEN_STATUS() HAL_GPIO_ReadPin(BOARD_LED_GREEN_PORT,BOARD_LED_GREEN_PIN) 139 #if !defined(CONFIG_MODULE_LED_ENABLE) 143 #define LED_BLUE_ON() 144 #define LED_GREEN_ON() 145 #define LED_RED_OFF() 146 #define LED_BLUE_OFF() 147 #define LED_GREEN_OFF() 148 #define LED_RED_TOGGLE() 149 #define LED_BLUE_TOGGLE() 150 #define LED_GREEN_TOGGLE() 151 #define LED_RED_STATUS() 152 #define LED_BLUE_STATUS() 153 #define LED_GREEN_STATUS() 170 #ifdef CONFIG_USE_PANEL_NODESMALL 171 #define TIMx_BLUE TIM16 172 #define TIMx_BLUE_CLK_ENABLE() __TIM16_CLK_ENABLE() 173 #define TIMx_GREEN TIM17 174 #define TIMx_GREEN_CLK_ENABLE() __TIM17_CLK_ENABLE() 176 #define TIMER_CLK_ENABLES() __TIM16_CLK_ENABLE(); \ 180 #define LED_BLUE_TIMER_CHANNEL TIM_CHANNEL_1 181 #define LED_GREEN_TIMER_CHANNEL TIM_CHANNEL_1 183 #define TIMx_LED_BLUE_GPIO_AF GPIO_AF2_TIM16 184 #define TIMx_LED_GREEN_GPIO_AF GPIO_AF2_TIM17 190 #ifdef CONFIG_USE_PANEL_NODEMEDIUM 192 #define TIMx_BLUE TIM4 193 #define TIMx_BLUE_CLK_ENABLE() __TIM4_CLK_ENABLE() 194 #define TIMx_GREEN TIM4 195 #define TIMx_GREEN_CLK_ENABLE() __TIM4_CLK_ENABLE() 196 #define TIMx_RED TIM3 197 #define TIMx_RED_CLK_ENABLE() __TIM3_CLK_ENABLE() 199 #define TIMER_CLK_ENABLES() __TIM3_CLK_ENABLE(); \ 203 #define LED_BLUE_TIMER_CHANNEL TIM_CHANNEL_2 204 #define LED_GREEN_TIMER_CHANNEL TIM_CHANNEL_1 205 #define LED_RED_TIMER_CHANNEL TIM_CHANNEL_2 208 #define TIMx_LED_BLUE_GPIO_AF GPIO_AF2_TIM4 209 #define TIMx_LED_GREEN_GPIO_AF GPIO_AF2_TIM4 210 #define TIMx_LED_RED_GPIO_AF GPIO_AF2_TIM3 222 #ifdef CONFIG_USE_PANEL_NODESMALL 225 #define BOARD_USE_ADC ADC1 228 #define ADC_COMMON_PORT GPIOA 229 #define ADC_COMMON_CLK_ENABLE() __GPIOA_CLK_ENABLE() 232 #define ADC_BUFFER_SIZE ( 5 ) 239 #define ADC_SENSOR_LIGHT_PORT GPIOA 240 #define ADC_SENSOR_LIGHT_CLK RCC_AHB1Periph_GPIOA 241 #define ADC_SENSOR_LIGHT_PIN GPIO_PIN_1 242 #define ADC_SENSOR_LIGHT_CHANNEL ADC_CHANNEL_1 249 #define ADC_SENSOR_MICROPHONE_PORT GPIOA 250 #define ADC_SENSOR_MICROPHONE_CLK RCC_AHB1Periph_GPIOA 251 #define ADC_SENSOR_MICROPHONE_PIN GPIO_PIN_6 252 #define ADC_SENSOR_MICROPHONE_CHANNEL ADC_CHANNEL_6 258 #define ADC_VSOURCE_PORT GPIOA 259 #define ADC_VSOURCE_CLK RCC_AHB1Periph_GPIOA 260 #define ADC_VSOURCE_PIN GPIO_PIN_7 261 #define ADC_VSOURCE_CHANNEL ADC_CHANNEL_7 264 #define ADC_TEMPSENSOR_CHANNEL ADC_CHANNEL_16 265 #define ADC_VREFINT_CHANNEL ADC_CHANNEL_17 268 #endif // CONFIG_USE_PANEL_NODEMSMALL 272 #ifdef CONFIG_USE_PANEL_NODEMEDIUM 276 #define BOARD_USE_ADC ADC1 279 #define ADC_COMMON_PORT GPIOB | GPIOC 280 #define ADC_COMMON_CLK_ENABLE() \ 281 __GPIOB_CLK_ENABLE(); \ 285 #define ADC_BUFFER_SIZE ( 5 ) 293 #define ADC_SENSOR_LIGHT_PORT GPIOC 294 #define ADC_SENSOR_LIGHT_PIN GPIO_PIN_0 295 #define ADC_SENSOR_LIGHT_CHANNEL ADC_CHANNEL_10 302 #define ADC_SENSOR_MICROPHONE_PORT GPIOC 303 #define ADC_SENSOR_MICROPHONE_PIN GPIO_PIN_1 304 #define ADC_SENSOR_MICROPHONE_CHANNEL ADC_CHANNEL_11 311 #define ADC_SENSOR_PROXIMITY_PORT GPIOC 312 #define ADC_SENSOR_PROXIMITY_PIN GPIO_PIN_2 313 #define ADC_SENSOR_PROXIMITY_CHANNEL ADC_CHANNEL_12 320 #define ADC_VSOURCE_PORT GPIOB 321 #define ADC_VSOURCE_PIN GPIO_PIN_12 322 #define ADC_VSOURCE_CHANNEL ADC_CHANNEL_18 328 #define ADC_TEMPSENSOR_CHANNEL ADC_CHANNEL_16 329 #define ADC_VREFINT_CHANNEL ADC_CHANNEL_17 332 #endif // CONFIG_USE_PANEL_NODEMEDIUM 336 #if defined(CONFIG_USE_PANEL_DISCOVERY) || defined(CONFIG_USE_PANEL_NUCLEOF401RE) 340 #define ADC_BUFFER_SIZE ( 3 ) 344 #define ADCx_CLK_ENABLE() __HAL_RCC_ADC1_CLK_ENABLE() 345 #define DMAx_CLK_ENABLE() __HAL_RCC_DMA2_CLK_ENABLE() 346 #define ADCx_CHANNEL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE() 349 #define ADCx_CHANNEL_PIN_1 GPIO_PIN_1 350 #define ADCx_CHANNEL_PIN_2 GPIO_PIN_2 351 #define ADCx_CHANNEL_PIN_3 GPIO_PIN_3 352 #define ADCx_CHANNEL_GPIO_PORT GPIOA 355 #define ADCx_CHANNEL_1 ADC_CHANNEL_1 356 #define ADCx_CHANNEL_2 ADC_CHANNEL_2 357 #define ADCx_CHANNEL_3 ADC_CHANNEL_3 360 #define ADCx_DMA_CHANNEL DMA_CHANNEL_0 361 #define ADCx_DMA_STREAM DMA2_Stream0 364 #define ADCx_DMA_IRQn DMA2_Stream0_IRQn 365 #define ADCx_DMA_IRQHandler DMA2_Stream0_IRQHandler 368 #define ADC_DMA_PREEMT_PRIORITY 13 369 #define ADC_DMA_SUB_PRIORITY 0 372 #define COMMON_ADC_VOLTAGE_MAX (3.3f) 373 #define COMMON_ADC_RESOLUTION_MAX (4095U) 385 #if defined(CONFIG_USE_PANEL_DISCOVERY) || defined(CONFIG_USE_PANEL_NUCLEOF401RE) 391 #define DACx_CHANNEL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE() 392 #define DACx_CLK_ENABLE() __HAL_RCC_DAC_CLK_ENABLE() 395 #define DACx_CHANNEL1_PIN GPIO_PIN_4 396 #define DACx_CHANNEL1_GPIO_PORT GPIOA 398 #define DACx_CHANNEL2_PIN GPIO_PIN_5 399 #define DACx_CHANNEL2_GPIO_PORT GPIOA 401 #define DACx_CHANNEL1 DAC_CHANNEL_1 402 #define DACx_CHANNEL2 DAC_CHANNEL_2 405 #define COMMON_DAC_MAX_VOLTAGE 3.3f 406 #define COMMON_DAC_DA_MAX_VALUE 4095 423 #ifdef CONFIG_USE_PANEL_NODESMALL 425 #define BUTTON_RIGHT_GPIO_PORT GPIOA 426 #define BUTTON_RIGHT_GPIO_CLK RCC_AHB1Periph_GPIOA 427 #define BUTTON_RIGHT_GPIO_PIN GPIO_PIN_0 428 #define BUTTON_UP_GPIO_PORT GPIOB 429 #define BUTTON_UP_GPIO_CLK RCC_AHB1Periph_GPIOB 430 #define BUTTON_UP_GPIO_PIN GPIO_PIN_14 431 #define BUTTON_DOWN_GPIO_PORT GPIOB 432 #define BUTTON_DOWN_GPIO_CLK RCC_AHB1Periph_GPIOB 433 #define BUTTON_DOWN_GPIO_PIN GPIO_PIN_12 434 #define BUTTON_LEFT_GPIO_PORT GPIOB 435 #define BUTTON_LEFT_GPIO_CLK RCC_AHB1Periph_GPIOB 436 #define BUTTON_LEFT_GPIO_PIN GPIO_PIN_13 440 #define BUTTON_CLK_ENABLES() \ 441 __GPIOA_CLK_ENABLE(); \ 449 #ifdef CONFIG_USE_PANEL_NODEMEDIUM 451 #define BUTTON_RIGHT_GPIO_PORT GPIOA 452 #define BUTTON_RIGHT_GPIO_CLK RCC_AHB1Periph_GPIOA 453 #define BUTTON_RIGHT_GPIO_PIN GPIO_PIN_0 455 #define BUTTON_UP_GPIO_PORT GPIOD 456 #define BUTTON_UP_GPIO_CLK RCC_AHB1Periph_GPIOD 457 #define BUTTON_UP_GPIO_PIN GPIO_PIN_2 459 #define BUTTON_DOWN_GPIO_PORT GPIOC 460 #define BUTTON_DOWN_GPIO_CLK RCC_AHB1Periph_GPIOC 461 #define BUTTON_DOWN_GPIO_PIN GPIO_PIN_13 463 #define BUTTON_LEFT_GPIO_PORT GPIOB 464 #define BUTTON_LEFT_GPIO_CLK RCC_AHB1Periph_GPIOB 465 #define BUTTON_LEFT_GPIO_PIN GPIO_PIN_9 469 #define BUTTON_CLK_ENABLES() \ 470 __GPIOA_CLK_ENABLE(); \ 471 __GPIOB_CLK_ENABLE(); \ 472 __GPIOC_CLK_ENABLE(); \ 473 __GPIOD_CLK_ENABLE() \ 476 #endif // #ifdef CONFIG_USE_PANEL_NODEMEDIUM 480 #ifdef CONFIG_USE_PANEL_CENTERPANEL 487 #define BUTTON_RIGHT_GPIO_PORT GPIOA 488 #define BUTTON_RIGHT_GPIO_CLK RCC_AHB1Periph_GPIOA 489 #define BUTTON_RIGHT_GPIO_PIN GPIO_PIN_0 491 #define BUTTON_UP_GPIO_PORT GPIOC 492 #define BUTTON_UP_GPIO_CLK RCC_AHB1Periph_GPIOC 493 #define BUTTON_UP_GPIO_PIN GPIO_PIN_7 495 #define BUTTON_DOWN_GPIO_PORT GPIOC 496 #define BUTTON_DOWN_GPIO_CLK RCC_AHB1Periph_GPIOC 497 #define BUTTON_DOWN_GPIO_PIN GPIO_PIN_8 499 #define BUTTON_LEFT_GPIO_PORT GPIOC 500 #define BUTTON_LEFT_GPIO_CLK RCC_AHB1Periph_GPIOC 501 #define BUTTON_LEFT_GPIO_PIN GPIO_PIN_9 505 #define BUTTON_CLK_ENABLES() \ 506 __GPIOA_CLK_ENABLE(); \ 510 #endif // #ifdef CONFIG_USE_PANEL_CENTERPANEL 514 #ifdef CONFIG_USE_PANEL_DISCOVERY 518 #define BUTTON_USER_GPIO_PORT GPIOA 519 #define BUTTON_USER_GPIO_PIN GPIO_PIN_0 521 #define BUTTON_CLK_ENABLES() __GPIOA_CLK_ENABLE() 524 #define BUTTON_USER_EXTI_IRQn EXTI0_IRQn 525 #define BUTTON_USER_INTERRUPT_PREEMT_PRIORITY 10 526 #define BUTTON_USER_INTERRUPT_SUB_PRIORITY 0 532 #ifdef CONFIG_USE_PANEL_NUCLEOF401RE 536 #define BUTTON_USER_GPIO_PORT GPIOC 537 #define BUTTON_USER_GPIO_PIN GPIO_PIN_13 539 #define BUTTON_CLK_ENABLES() __GPIOC_CLK_ENABLE() 542 #define BUTTON_USER_EXTI_IRQn EXTI15_10_IRQn 543 #define BUTTON_USER_INTERRUPT_PREEMT_PRIORITY 10 544 #define BUTTON_USER_INTERRUPT_SUB_PRIORITY 0 554 #ifdef CONFIG_MODULE_ADC_ENABLE 561 #define TEMPERATURE_I2C_TEMP_ADDRESS ((uint16_t)( 0x0000 | (1<<6) | (1 << 3 ) ) ) 567 #define TEMPERATURE_I2C_REGISTER_TEMP ((uint8_t)0x00) 569 #endif // CONFIG_MODULE_ADC_ENABLE 571 #ifdef CONFIG_USE_PANEL_NODESMALL 573 #define I2Cx_CLK_ENABLE() __I2C1_CLK_ENABLE() 574 #define DMAx_CLK_ENABLE() __DMA1_CLK_ENABLE() 575 #define I2Cx_SDA_GPIO_CLK_ENABLE() __GPIOB_CLK_ENABLE() 576 #define I2Cx_SCL_GPIO_CLK_ENABLE() __GPIOB_CLK_ENABLE() 578 #define I2Cx_FORCE_RESET() __I2C1_FORCE_RESET() 579 #define I2Cx_RELEASE_RESET() __I2C1_RELEASE_RESET() 587 #define I2Cx_TIMING 0x00301D28 598 #define I2Cx_SCL_PIN GPIO_PIN_10 599 #define I2Cx_SCL_GPIO_PORT GPIOB 600 #define I2Cx_SCL_AF GPIO_AF1_I2C1 602 #define I2Cx_SDA_PIN GPIO_PIN_11 603 #define I2Cx_SDA_GPIO_PORT GPIOB 604 #define I2Cx_SDA_AF GPIO_AF1_I2C1 608 #define I2Cx_TX_DMA_INSTANCE DMA1_Channel2 609 #define I2Cx_RX_DMA_INSTANCE DMA1_Channel3 612 #define I2Cx_DMA_TX_IRQn DMA1_Channel2_3_IRQn 613 #define I2Cx_DMA_RX_IRQn DMA1_Channel2_3_IRQn 614 #define I2Cx_DMA_TX_RX_IRQHandler DMA1_Channel2_3_IRQHandler 622 #endif // #ifdef CONFIG_USE_PANEL_NODESMALL 626 #ifdef CONFIG_USE_PANEL_NODEMEDIUM 629 #define I2Cx_CLK_ENABLE() __I2C2_CLK_ENABLE() 630 #define DMAx_CLK_ENABLE() __DMA1_CLK_ENABLE() 631 #define I2Cx_SDA_GPIO_CLK_ENABLE() __GPIOB_CLK_ENABLE() 632 #define I2Cx_SCL_GPIO_CLK_ENABLE() __GPIOB_CLK_ENABLE() 634 #define I2Cx_FORCE_RESET() __I2C1_FORCE_RESET() 635 #define I2Cx_RELEASE_RESET() __I2C1_RELEASE_RESET() 643 #define I2Cx_TIMING 0x00301D28 654 #define I2Cx_SCL_PIN GPIO_PIN_10 655 #define I2Cx_SCL_GPIO_PORT GPIOB 656 #define I2Cx_SCL_AF GPIO_AF4_I2C2 658 #define I2Cx_SDA_PIN GPIO_PIN_11 659 #define I2Cx_SDA_GPIO_PORT GPIOB 660 #define I2Cx_SDA_AF GPIO_AF4_I2C2 664 #define I2Cx_TX_DMA_INSTANCE DMA1_Channel2 665 #define I2Cx_RX_DMA_INSTANCE DMA1_Channel3 668 #define I2Cx_DMA_TX_IRQn DMA1_Channel2_3_IRQn 669 #define I2Cx_DMA_RX_IRQn DMA1_Channel2_3_IRQn 670 #define I2Cx_DMA_TX_RX_IRQHandler DMA1_Channel2_3_IRQHandler 677 #endif // #ifdef CONFIG_USE_PANEL_NODEMEDIUM 687 #ifdef CONFIG_USE_PANEL_NODESMALL 690 #define FLASH_SPIx SPI1 692 #define SPIx_CLK_ENABLE() __SPI1_CLK_ENABLE() 694 #define FLASH_SPIx_PINS_CLK_ENABLES() \ 695 __GPIOA_CLK_ENABLE(); \ 700 #define FLASH_SPI_CS PB7 701 #define FLASH_SPI_WP PB6 702 #define FLASH_SPI_HOLD PA15 705 #define FLASH_SPI_CS_GPIO_PIN GPIO_PIN_7 706 #define FLASH_SPI_CS_GPIO_PORT GPIOB 707 #define FLASH_SPI_WP_GPIO_PIN GPIO_PIN_6 708 #define FLASH_SPI_WP_GPIO_PORT GPIOB 709 #define FLASH_SPI_HOLD_GPIO_PIN GPIO_PIN_15 710 #define FLASH_SPI_HOLD_GPIO_PORT GPIOA 714 #define SPIx_FORCE_RESET() __SPI1_FORCE_RESET() 715 #define SPIx_RELEASE_RESET() __SPI1_RELEASE_RESET() 718 #define SPIx_SCK_PIN GPIO_PIN_3 719 #define SPIx_SCK_GPIO_PORT GPIOB 720 #define SPIx_SCK_AF GPIO_AF0_SPI1 721 #define SPIx_MISO_PIN GPIO_PIN_4 722 #define SPIx_MISO_GPIO_PORT GPIOB 723 #define SPIx_MISO_AF GPIO_AF0_SPI1 724 #define SPIx_MOSI_PIN GPIO_PIN_5 725 #define SPIx_MOSI_GPIO_PORT GPIOB 726 #define SPIx_MOSI_AF GPIO_AF0_SPI1 732 #ifdef CONFIG_USE_PANEL_NODEMEDIUM 745 #define FLASH_SPIx SPI1 748 #define FLASH_SPIx_PINS_CLK_ENABLES() \ 749 __GPIOA_CLK_ENABLE(); \ 753 #define SPIx_CLK_ENABLE() __SPI1_CLK_ENABLE() 756 #define SPIx_FORCE_RESET() __SPI1_FORCE_RESET() 757 #define SPIx_RELEASE_RESET() __SPI1_RELEASE_RESET() 761 #define SPIx_SCK_PIN GPIO_PIN_5 762 #define SPIx_SCK_GPIO_PORT GPIOA 763 #define SPIx_SCK_AF GPIO_AF5_SPI1 764 #define SPIx_MISO_PIN GPIO_PIN_6 765 #define SPIx_MISO_GPIO_PORT GPIOA 766 #define SPIx_MISO_AF GPIO_AF5_SPI1 767 #define SPIx_MOSI_PIN GPIO_PIN_7 768 #define SPIx_MOSI_GPIO_PORT GPIOA 769 #define SPIx_MOSI_AF GPIO_AF5_SPI1 772 #define FLASH_SPI_CS_GPIO_PIN GPIO_PIN_0 773 #define FLASH_SPI_CS_GPIO_PORT GPIOB 774 #define FLASH_SPI_WP_GPIO_PIN GPIO_PIN_1 775 #define FLASH_SPI_WP_GPIO_PORT GPIOB 776 #define FLASH_SPI_HOLD_GPIO_PIN GPIO_PIN_4 777 #define FLASH_SPI_HOLD_GPIO_PORT GPIOA 780 #endif // CONFIG_USE_PANEL_NODEMEDIUM 790 #if ( CONFIG_USE_PANEL_NODEMEDIUM || CONFIG_USE_PANEL_CENTERPANEL ) 798 #define DEBUG_USARTx USART1 803 #define DEBUG_USART_CLK_ENABLES() \ 804 __USART1_CLK_ENABLE(); \ 808 #define DEBUG_USART_TX_GPIO_PORT GPIOA 809 #define DEBUG_USART_TX_GPIO_PIN GPIO_PIN_9 811 #define DEBUG_USART_RX_GPIO_PORT GPIOA 812 #define DEBUG_USART_RX_GPIO_PIN GPIO_PIN_10 814 #define DEBUG_USART_AF GPIO_AF7_USART1 818 #define DEBUG_USARTx_IRQn USART1_IRQn 819 #define DEBUG_USARTx_IRQHandler USART1_IRQHandler 821 #define DEBUG_USART_PREEMT_PRIORITY 10 822 #define DEBUG_USART_SUB_PRIORITY 0 828 #if defined(CONFIG_USE_PANEL_DISCOVERY) || defined(CONFIG_USE_PANEL_NUCLEOF401RE) 835 #define DEBUG_USARTx USART6 837 #define DEBUG_USART_CLK_ENABLES() \ 838 __USART6_CLK_ENABLE(); \ 842 #define DEBUG_USART_TX_GPIO_PORT GPIOC 843 #define DEBUG_USART_TX_GPIO_PIN GPIO_PIN_6 845 #define DEBUG_USART_RX_GPIO_PORT GPIOC 846 #define DEBUG_USART_RX_GPIO_PIN GPIO_PIN_7 848 #define DEBUG_USART_AF GPIO_AF8_USART6 850 #define DEBUG_USART_BAUDRATE 9600 854 #define DEBUG_USARTx_IRQn USART6_IRQn 855 #define DEBUG_USARTx_IRQHandler USART6_IRQHandler 857 #define DEBUG_USART_PREEMT_PRIORITY 10 858 #define DEBUG_USART_SUB_PRIORITY 0 871 #ifdef CONFIG_USE_PANEL_NODESMALL 880 #define ESP8266_USARTx USART1 884 #define ESP8266_USART_CLK_ENABLES() \ 885 __USART1_CLK_ENABLE(); \ 890 #define ESP8266_USART_TX_GPIO_PORT GPIOA 891 #define ESP8266_USART_TX_GPIO_PIN GPIO_PIN_9 893 #define ESP8266_USART_RX_GPIO_PORT GPIOA 894 #define ESP8266_USART_RX_GPIO_PIN GPIO_PIN_10 896 #define ESP8266_USART_AF GPIO_AF1_USART1 899 #define ESP8266_USARTx_IRQn USART1_IRQn 900 #define ESP8266_USARTx_IRQHandler USART1_IRQHandler 903 #define ESP8266_USART_PREEMT_PRIORITY 2 904 #define ESP8266_USART_SUB_PRIORITY 0 906 #define ESP8266_USART_BAUDRATE 9600 909 #endif // #ifdef CONFIG_USE_PANEL_NODESMALL 913 #ifdef CONFIG_USE_PANEL_NODEMEDIUM 919 #define ESP8266_USARTx USART2 922 #define ESP8266_USART_CLK_ENABLES() \ 923 __USART2_CLK_ENABLE(); \ 928 #define ESP8266_USART_TX_GPIO_PORT GPIOA 929 #define ESP8266_USART_TX_GPIO_PIN GPIO_PIN_2 931 #define ESP8266_USART_RX_GPIO_PORT GPIOA 932 #define ESP8266_USART_RX_GPIO_PIN GPIO_PIN_3 934 #define ESP8266_USART_AF GPIO_AF7_USART2 937 #define ESP8266_USARTx_IRQn USART2_IRQn 938 #define ESP8266_USARTx_IRQHandler USART2_IRQHandler 940 #define ESP8266_USART_PREEMT_PRIORITY 14 941 #define ESP8266_USART_SUB_PRIORITY 0 943 #define ESP8266_USART_BAUDRATE 9600 947 #endif // #ifdef CONFIG_USE_PANEL_NODEMEDIUM 951 #ifdef CONFIG_USE_PANEL_CENTERPANEL 957 #define ESP8266_USARTx USART2 959 #define ESP8266_USART_CLK_ENABLES() \ 960 __USART2_CLK_ENABLE(); \ 964 #define ESP8266_USART_TX_GPIO_PORT GPIOA 965 #define ESP8266_USART_TX_GPIO_PIN GPIO_PIN_2 967 #define ESP8266_USART_RX_GPIO_PORT GPIOA 968 #define ESP8266_USART_RX_GPIO_PIN GPIO_PIN_3 970 #define ESP8266_USART_AF GPIO_AF7_USART2 973 #define ESP8266_USARTx_IRQn USART2_IRQn 974 #define ESP8266_USARTx_IRQHandler USART2_IRQHandler 976 #define ESP8266_USART_PREEMT_PRIORITY 14 977 #define ESP8266_USART_SUB_PRIORITY 0 979 #define ESP8266_USART_BAUDRATE 9600 982 #endif // #ifdef CONFIG_USE_PANEL_CENTERPANEL 992 #ifdef CONFIG_USE_PANEL_NODESMALL 1002 #define ESP8266_GPIO0_GPIO_PIN GPIO_PIN_12 1003 #define ESP8266_GPIO0_GPIO_PORT GPIOA 1004 #define ESP8266_RST_GPIO_PIN GPIO_PIN_11 1005 #define ESP8266_RST_GPIO_PORT GPIOA 1007 #define ESP8266_CH_GPIO_PIN GPIO_PIN_8 1008 #define ESP8266_CH_GPIO_PORT GPIOA 1009 #define ESP8266_GPIO2_GPIO_PIN GPIO_PIN_15 1010 #define ESP8266_GPIO2_GPIO_PORT GPIOB 1013 #define ESP8266_PINS_CLK_ENABLES() \ 1014 __GPIOB_CLK_ENABLE(); \ 1015 __GPIOA_CLK_ENABLE() 1017 #endif // #ifdef CONFIG_USE_PANEL_NODESMALL 1021 #ifdef CONFIG_USE_PANEL_NODEMEDIUM 1032 #define ESP8266_GPIO0_GPIO_PIN GPIO_PIN_1 1033 #define ESP8266_GPIO0_GPIO_PORT GPIOA 1034 #define ESP8266_RST_GPIO_PIN GPIO_PIN_3 1035 #define ESP8266_RST_GPIO_PORT GPIOC 1037 #define ESP8266_CH_GPIO_PIN GPIO_PIN_9 1038 #define ESP8266_CH_GPIO_PORT GPIOC 1039 #define ESP8266_GPIO2_GPIO_PIN GPIO_PIN_8 1040 #define ESP8266_GPIO2_GPIO_PORT GPIOA 1043 #define ESP8266_PINS_CLK_ENABLES() \ 1044 __GPIOA_CLK_ENABLE(); \ 1045 __GPIOC_CLK_ENABLE() 1049 #endif // #ifdef CONFIG_USE_PANEL_NODEMEDIUM 1053 #ifdef CONFIG_USE_PANEL_CENTERPANEL 1064 #define ESP8266_GPIO0_GPIO_PORT GPIOC 1065 #define ESP8266_GPIO0_GPIO_PIN GPIO_PIN_13 1067 #define ESP8266_RST_GPIO_PORT GPIOE 1068 #define ESP8266_RST_GPIO_PIN GPIO_PIN_2 1070 #define ESP8266_CH_GPIO_PORT GPIOB 1071 #define ESP8266_CH_GPIO_PIN GPIO_PIN_9 1073 #define ESP8266_GPIO2_GPIO_PORT GPIOB 1074 #define ESP8266_GPIO2_GPIO_PIN GPIO_PIN_8 1078 #define ESP8266_PINS_CLK_ENABLES() \ 1079 __GPIOB_CLK_ENABLE(); \ 1080 __GPIOC_CLK_ENABLE(); \ 1081 __GPIOE_CLK_ENABLE() 1085 #endif // #ifdef CONFIG_USE_PANEL_CENTERPANEL 1107 #ifdef CONFIG_USE_PANEL_NODEMEDIUM 1109 #define RELAY_1_GPIO_PORT GPIOC 1110 #define RELAY_1_GPIO_PIN GPIO_PIN_11 1112 #define RELAY_2_GPIO_PORT GPIOC 1113 #define RELAY_2_GPIO_PIN GPIO_PIN_10 1117 #define RELAY_PINS_CLK_ENABLES() \ 1118 __GPIOC_CLK_ENABLE() 1127 #define SENSOR_PINS_CLK_ENABLES() \ 1128 __GPIOB_CLK_ENABLE(); \ 1129 __GPIOC_CLK_ENABLE() 1133 #define SENSOR_MOTION_GPIO_PORT GPIOC 1134 #define SENSOR_MOTION_GPIO_PIN GPIO_PIN_12 1137 #define SENSOR_SOUND_IMPACT_GPIO_PORT GPIOB 1138 #define SENSOR_SOUND_IMPACT_GPIO_PIN GPIO_PIN_14 1146 #ifdef CONFIG_USE_PANEL_CENTERPANEL 1155 #define RELAY_1_GPIO_PORT GPIOD 1156 #define RELAY_1_GPIO_PIN GPIO_PIN_4 1158 #define RELAY_2_GPIO_PORT GPIOD 1159 #define RELAY_2_GPIO_PIN GPIO_PIN_3 1163 #define RELAY_PINS_CLK_ENABLES() \ 1164 __GPIOD_CLK_ENABLE() 1176 #ifdef CONFIG_MODULE_RASPBERRYPI_ENABLE 1180 #define RASPBERRYPI_USARTx USART1 1182 #define RASPBERRYPI_USART_CLK_ENABLES() \ 1183 __USART1_CLK_ENABLE(); \ 1184 __GPIOA_CLK_ENABLE() 1187 #define RASPBERRYPI_USART_TX_GPIO_PORT GPIOA 1188 #define RASPBERRYPI_USART_TX_GPIO_PIN GPIO_PIN_9 1190 #define RASPBERRYPI_USART_RX_GPIO_PORT GPIOA 1191 #define RASPBERRYPI_USART_RX_GPIO_PIN GPIO_PIN_10 1193 #define RASPBERRYPI_USART_AF GPIO_AF7_USART1 1195 #define RASPBERRYPI_USARTx_IRQn USART1_IRQn 1196 #define RASPBERRYPI_USARTx_IRQHandler USART1_IRQHandler 1198 #define RASPBERRYPI_USART_PREEMT_PRIORITY 14 1199 #define RASPBERRYPI_USART_SUB_PRIORITY 0