generated from zephyrproject-rtos/example-application
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b8cb1df
commit b5e4dae
Showing
4 changed files
with
28 additions
and
22 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include "uart.h" | ||
|
||
void usart1_setup(void) | ||
{ | ||
SYSCFG_CFGR1 |= SYSCFG_CFGR1_PA11_RMP; | ||
gpio_mode_setup(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO9); | ||
gpio_set_af(GPIOA, GPIO_AF1, GPIO9); | ||
|
||
/* Setup USART parameters. */ | ||
usart_set_baudrate(USART1, 115200); | ||
usart_set_databits(USART1, 8); | ||
usart_set_parity(USART1, USART_PARITY_NONE); | ||
usart_set_stopbits(USART1, USART_CR2_STOPBITS_1); | ||
usart_set_mode(USART1, USART_MODE_TX); | ||
usart_set_flow_control(USART1, USART_FLOWCONTROL_NONE); | ||
|
||
/* Finally enable the USART. */ | ||
usart_enable(USART1); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#include <libopencm3/stm32/usart.h> | ||
#include <libopencm3/stm32/syscfg.h> | ||
#include <libopencm3/stm32/gpio.h> | ||
|
||
void usart1_setup(void); |