Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
be588c2f
Commit
be588c2f
authored
7 years ago
by
Vincent Dupont
Browse files
Options
Downloads
Patches
Plain Diff
cpu/stm32_common: use pseudomodule for UART HW FC
parent
a295b0eb
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cpu/stm32_common/include/periph_cpu_common.h
+1
-1
1 addition, 1 deletion
cpu/stm32_common/include/periph_cpu_common.h
cpu/stm32_common/periph/uart.c
+2
-2
2 additions, 2 deletions
cpu/stm32_common/periph/uart.c
makefiles/pseudomodules.inc.mk
+3
-0
3 additions, 0 deletions
makefiles/pseudomodules.inc.mk
with
6 additions
and
3 deletions
cpu/stm32_common/include/periph_cpu_common.h
+
1
−
1
View file @
be588c2f
...
@@ -263,7 +263,7 @@ typedef struct {
...
@@ -263,7 +263,7 @@ typedef struct {
uint8_t dma_stream; /**< DMA stream used for TX */
uint8_t dma_stream; /**< DMA stream used for TX */
uint8_t dma_chan; /**< DMA channel used for TX */
uint8_t dma_chan; /**< DMA channel used for TX */
#endif
#endif
#ifdef UART
_USE
_HW_FC
#ifdef
MODULE_STM32_PERIPH_
UART_HW_FC
gpio_t
cts_pin
;
/**< CTS pin - set to GPIO_UNDEF when not using HW flow control */
gpio_t
cts_pin
;
/**< CTS pin - set to GPIO_UNDEF when not using HW flow control */
gpio_t
rts_pin
;
/**< RTS pin */
gpio_t
rts_pin
;
/**< RTS pin */
#ifndef CPU_FAM_STM32F1
#ifndef CPU_FAM_STM32F1
...
...
This diff is collapsed.
Click to expand it.
cpu/stm32_common/periph/uart.c
+
2
−
2
View file @
be588c2f
...
@@ -73,7 +73,7 @@ int uart_init(uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg)
...
@@ -73,7 +73,7 @@ int uart_init(uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg)
gpio_init_af
(
uart_config
[
uart
].
rx_pin
,
uart_config
[
uart
].
rx_af
);
gpio_init_af
(
uart_config
[
uart
].
rx_pin
,
uart_config
[
uart
].
rx_af
);
#endif
#endif
}
}
#ifdef UART
_USE
_HW_FC
#ifdef
MODULE_STM32_PERIPH_
UART_HW_FC
if
(
uart_config
[
uart
].
cts_pin
!=
GPIO_UNDEF
)
{
if
(
uart_config
[
uart
].
cts_pin
!=
GPIO_UNDEF
)
{
gpio_init
(
uart_config
[
uart
].
cts_pin
,
GPIO_IN
);
gpio_init
(
uart_config
[
uart
].
cts_pin
,
GPIO_IN
);
gpio_init
(
uart_config
[
uart
].
rts_pin
,
GPIO_OUT
);
gpio_init
(
uart_config
[
uart
].
rts_pin
,
GPIO_OUT
);
...
@@ -109,7 +109,7 @@ int uart_init(uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg)
...
@@ -109,7 +109,7 @@ int uart_init(uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg)
dev
(
uart
)
->
CR1
=
(
USART_CR1_UE
|
USART_CR1_TE
);
dev
(
uart
)
->
CR1
=
(
USART_CR1_UE
|
USART_CR1_TE
);
}
}
#ifdef UART
_USE
_HW_FC
#ifdef
MODULE_STM32_PERIPH_
UART_HW_FC
if
(
uart_config
[
uart
].
cts_pin
!=
GPIO_UNDEF
)
{
if
(
uart_config
[
uart
].
cts_pin
!=
GPIO_UNDEF
)
{
/* configure hardware flow control */
/* configure hardware flow control */
dev
(
uart
)
->
CR3
=
(
USART_CR3_RTSE
|
USART_CR3_CTSE
);
dev
(
uart
)
->
CR3
=
(
USART_CR3_RTSE
|
USART_CR3_CTSE
);
...
...
This diff is collapsed.
Click to expand it.
makefiles/pseudomodules.inc.mk
+
3
−
0
View file @
be588c2f
...
@@ -87,3 +87,6 @@ PSEUDOMODULES += sx1276
...
@@ -87,3 +87,6 @@ PSEUDOMODULES += sx1276
# add all pseudo random number generator variants as pseudomodules
# add all pseudo random number generator variants as pseudomodules
PSEUDOMODULES
+=
prng_%
PSEUDOMODULES
+=
prng_%
# STM32 periph pseudomodules
PSEUDOMODULES
+=
stm32_periph_%
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment