12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- #ifndef __DEBUG_USART_H
- #define __DEBUG_USART_H
- #include "stm32f2xx.h"
- #include <stdio.h>
- #include "sys_data.h"
- //#define USART_BAUDRATE 9600 //눔왯꺼景쪽
- //#define USART3_RX_GPIO_PORT GPIOD
- //#define USART3_RX_GPIO_CLK RCC_AHB1Periph_GPIOD
- //#define USART3_RX_PIN GPIO_Pin_8
- //#define USART3_RX_AF GPIO_AF_USART3
- //#define USART3_RX_SOURCE GPIO_PinSource8
- //#define USART3_TX_GPIO_PORT GPIOD
- //#define USART3_TX_GPIO_CLK RCC_AHB1Periph_GPIOD
- //#define USART3_TX_PIN GPIO_Pin_9
- //#define USART3_TX_AF GPIO_AF_USART3
- //#define USART3_TX_SOURCE GPIO_PinSource9
- //232多신땍屢
- #define USART_232 USART1
- #define USART_232_CLK RCC_APB2Periph_USART1
- #define USART_232_BAUDRATE 115200 //눔왯꺼景쪽
- #define USART_232_RX_GPIO_PORT GPIOA
- #define USART_232_RX_GPIO_CLK RCC_AHB1Periph_GPIOA
- #define USART_232_RX_PIN GPIO_Pin_10
- #define USART_232_RX_AF GPIO_AF_USART1
- #define USART_232_RX_SOURCE GPIO_PinSource10
- #define USART_232_TX_GPIO_PORT GPIOA
- #define USART_232_TX_GPIO_CLK RCC_AHB1Periph_GPIOA
- #define USART_232_TX_PIN GPIO_Pin_9
- #define USART_232_TX_AF GPIO_AF_USART1
- #define USART_232_TX_SOURCE GPIO_PinSource9
- #define USART_232_IRQHandler USART1_IRQHandler
- #define USART_232_IRQ USART1_IRQn
- void USART3_config(void);
- // 꿎桿刻절
- void USART_485_config(void);
- void USART_485_DE_TX(void);
- void USART_485_DE_RX(void);
- //485多신땍屢
- #define USART_485 USART3
- #define USART_485_CLK RCC_APB1Periph_USART3
- #define USART_485_BAUDRATE 9600 //눔왯꺼景쪽
- #define USART_485_RX_GPIO_PORT GPIOC
- #define USART_485_RX_GPIO_CLK RCC_AHB1Periph_GPIOC
- #define USART_485_RX_PIN GPIO_Pin_11
- #define USART_485_RX_AF GPIO_AF_USART3
- #define USART_485_RX_SOURCE GPIO_PinSource11
- #define USART_485_TX_GPIO_PORT GPIOC
- #define USART_485_TX_GPIO_CLK RCC_AHB1Periph_GPIOC
- #define USART_485_TX_PIN GPIO_Pin_10
- #define USART_485_TX_AF GPIO_AF_USART3
- #define USART_485_TX_SOURCE GPIO_PinSource10
- #define USART_485_IRQHandler USART3_IRQHandler
- #define USART_485_IRQ USART3_IRQn
- //485왠齡多신
- #define USART_485_DE_GPIO_PORT GPIOC
- #define USART_485_DE_GPIO_CLK RCC_AHB1Periph_GPIOC
- #define USART_485_DE_PIN GPIO_Pin_12
- #endif /* __USART1_H */
|