Created
January 26, 2016 14:25
-
-
Save Novakov/e85b72837cdb52f8d54c to your computer and use it in GitHub Desktop.
EFM32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USART_InitAsync_TypeDef init = USART_INITASYNC_DEFAULT; | |
init.enable = usartDisable; | |
CMU_ClockEnable(cmuClock_USART1, true); | |
GPIO_PinModeSet(gpioPortD, 0, gpioModePushPull, 1); | |
GPIO_PinModeSet(gpioPortD, 1, gpioModeInput, 0); | |
USART_InitAsync(USART, &init); | |
USART->ROUTE = USART_ROUTE_LOCATION_LOC1 | USART_ROUTE_RXPEN | USART_ROUTE_TXPEN; | |
USART->CTRL = USART_CTRL_AUTOTX; | |
USART_IntClear(USART, _USART_IF_MASK); | |
USART_IntEnable(USART, USART_IF_RXDATAV); | |
USART_Enable(USART, usartEnable); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment