Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stm32] Uart: Add transmission complete flag #856

Merged
merged 1 commit into from
May 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/modm/platform/uart/stm32/uart_hal.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ public:
static inline bool
isTransmitRegisterEmpty();

/// Returns true if the transmission of a frame containing data is complete
static inline bool
isTransmissionComplete();

static inline void
enableInterruptVector(bool enable, uint32_t priority);

Expand Down
10 changes: 10 additions & 0 deletions src/modm/platform/uart/stm32/uart_hal_impl.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,16 @@ bool
%% endif
}

bool
{{ hal }}::isTransmissionComplete()
{
%% if extended_driver
return {{ peripheral }}->ISR & USART_ISR_TC;
%% else
return {{ peripheral }}->SR & USART_SR_TC;
%% endif
}

void
{{ hal }}::enableInterruptVector(bool enable, uint32_t priority)
{
Expand Down