| 전자부품 데이터시트 검색엔진 |
|
AN4018 데이터시트(PDF) 19 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN4018 데이터시트(HTML) 19 Page - STMicroelectronics |
|
19 / 23 page ![]() DocID022544 Rev 3 19/23 AN4018 Example to configure the communication protocol Appendix C Example to configure the communication protocol C.1 Configure the STM32Fx family serial layer Follow the STM32Fx family USART configuration used inside the serial layer to communicate with a PLM device: Usart ' USART3 USART_RX_GPIO ' GPIO_Pin_11_PORT_B USART_TX_GPIO ' GPIO_Pin_10_PORT_B The part of the code to modify is: /*-----------------------------------------------------------*/ /* Serial Define */ #define USART USART3 #define USART_PORT GPIOB #define USART_TX GPIO_Pin_10 #define USART_RX GPIO_Pin_11 #define USART_TR GPIO_Pin_9 #define USART_IRQ USART3_IRQn #define RCC_APBPeriph_USART RCC_APB1Periph_USART3 #define RCC_APBPeriph_USART_ClockCmd(Periph_USART,value) RCC_APB1PeriphClockCmd(Periph_USART,value) #define RCC_APBPeriph_GPIO RCC_APB2Periph_GPIOB #define RCC_APBPeriph_GPIO_ClockCmd(Periph_GPIO,value) RCC_APB2PeriphClockCmd(Periph_GPIO,value) /*------------------------------------------------------------*/ The names "RCC_APB2Periph_GPIOB", "GPIO_Pin_x", "USART3" ecc. The names are defined in the STM32F10x_StdPeriph_Driver. Furthermore, it is necessary to call the function “vUARTInterruptHandler()” defined in serial.c in the appropriate InterruptServiceRoutine. The following example shows the ISR of USART3 in the Interrupt file of the STM32Fx family library: Example: void PPP_IRQHandler(void) { } void UART4_IRQHandler(void) { } void USART3_IRQHandler(void) { vUARTInterruptHandler(); } void USART1_IRQHandler(void) |
|
|
링크 URL |
| ALLDATASHEET 가 귀하에 도움이 되셨나요? [ DONATE ] |
Alldatasheet는? | 광고문의 | 운영자에게 연락하기 | 개인정보취급방침 | 링크 투 데이터시트 | 링크교환 | 제조사별 검색 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |