Skip to content

Commit

Permalink
[stm32] Uart: Add transmission complete flag
Browse files Browse the repository at this point in the history
  • Loading branch information
strongly-typed committed May 1, 2022
1 parent 596eafa commit 0e3d280
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/modm/platform/uart/stm32/uart_hal.hpp.in
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
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

0 comments on commit 0e3d280

Please sign in to comment.