12 #ifndef SOURCE_CHIP_STM32_PERIPHERALS_USARTV1_INCLUDE_DISTORTOS_CHIP_CHIPUARTLOWLEVEL_HPP_ 13 #define SOURCE_CHIP_STM32_PERIPHERALS_USARTV1_INCLUDE_DISTORTOS_CHIP_CHIPUARTLOWLEVEL_HPP_ 43 #ifdef DISTORTOS_CHIP_USART1_ENABLE 46 static const Parameters usart1Parameters;
48 #endif // def DISTORTOS_CHIP_USART1_ENABLE 50 #ifdef DISTORTOS_CHIP_USART2_ENABLE 53 static const Parameters usart2Parameters;
55 #endif // def DISTORTOS_CHIP_USART2_ENABLE 57 #ifdef DISTORTOS_CHIP_USART3_ENABLE 60 static const Parameters usart3Parameters;
62 #endif // def DISTORTOS_CHIP_USART3_ENABLE 64 #ifdef DISTORTOS_CHIP_UART4_ENABLE 67 static const Parameters uart4Parameters;
69 #endif // def DISTORTOS_CHIP_UART4_ENABLE 71 #ifdef DISTORTOS_CHIP_UART5_ENABLE 74 static const Parameters uart5Parameters;
76 #endif // def DISTORTOS_CHIP_UART5_ENABLE 78 #ifdef DISTORTOS_CHIP_USART6_ENABLE 81 static const Parameters usart6Parameters;
83 #endif // def DISTORTOS_CHIP_USART6_ENABLE 85 #ifdef DISTORTOS_CHIP_UART7_ENABLE 88 static const Parameters uart7Parameters;
90 #endif // def DISTORTOS_CHIP_UART7_ENABLE 92 #ifdef DISTORTOS_CHIP_UART8_ENABLE 95 static const Parameters uart8Parameters;
97 #endif // def DISTORTOS_CHIP_UART8_ENABLE 99 #ifdef DISTORTOS_CHIP_UART9_ENABLE 102 static const Parameters uart9Parameters;
104 #endif // def DISTORTOS_CHIP_UART9_ENABLE 106 #ifdef DISTORTOS_CHIP_UART10_ENABLE 109 static const Parameters uart10Parameters;
111 #endif // def DISTORTOS_CHIP_UART10_ENABLE 166 std::pair<int, uint32_t>
start(devices::UartBase& uartBase, uint32_t baudRate, uint8_t characterLength,
187 int startRead(
void* buffer,
size_t size)
override;
206 int startWrite(
const void* buffer,
size_t size)
override;
297 #endif // SOURCE_CHIP_STM32_PERIPHERALS_USARTV1_INCLUDE_DISTORTOS_CHIP_CHIPUARTLOWLEVEL_HPP_ uint8_t *volatile readBuffer_
buffer to which the data is being written
Definition: ChipUartLowLevel.hpp:275
size_t stopRead() override
Stops asynchronous read operation.
Definition: STM32-USARTv1-ChipUartLowLevel.cpp:424
size_t stopWrite() override
Stops asynchronous write operation.
Definition: STM32-USARTv1-ChipUartLowLevel.cpp:437
bool isReadInProgress() const
Definition: ChipUartLowLevel.hpp:254
devices::UartBase * uartBase_
pointer to UartBase object associated with this one
Definition: ChipUartLowLevel.hpp:272
parameters for construction of UART low-level drivers
Definition: STM32-USARTv1-ChipUartLowLevel.cpp:59
constexpr ChipUartLowLevel(const Parameters ¶meters)
ChipUartLowLevel's constructor.
Definition: ChipUartLowLevel.hpp:119
~ChipUartLowLevel() override
ChipUartLowLevel's destructor.
Definition: STM32-USARTv1-ChipUartLowLevel.cpp:271
UartLowLevel class header.
const uint8_t *volatile writeBuffer_
buffer with data that is being transmitted
Definition: ChipUartLowLevel.hpp:284
volatile size_t readSize_
size of readBuffer_, bytes
Definition: ChipUartLowLevel.hpp:278
Definition: UartBase.hpp:30
const Parameters & parameters_
reference to configuration parameters
Definition: ChipUartLowLevel.hpp:269
Top-level namespace of distortos project.
Definition: buttons.hpp:33
int startWrite(const void *buffer, size_t size) override
Starts asynchronous write operation.
Definition: STM32-USARTv1-ChipUartLowLevel.cpp:384
volatile size_t writeSize_
size of writeBuffer_, bytes
Definition: ChipUartLowLevel.hpp:287
UartParity
Definition: UartParity.hpp:29
static constexpr uint8_t maxCharacterLength
maximum allowed value for UART character length
Definition: ChipUartLowLevel.hpp:39
Definition: UartLowLevel.hpp:35
Definition: ChipUartLowLevel.hpp:31
int stop() override
Stops low-level UART driver.
Definition: STM32-USARTv1-ChipUartLowLevel.cpp:410
volatile size_t readPosition_
current position in readBuffer_
Definition: ChipUartLowLevel.hpp:281
static constexpr uint8_t minCharacterLength
minimum allowed value for UART character length
Definition: ChipUartLowLevel.hpp:36
int startRead(void *buffer, size_t size) override
Starts asynchronous read operation.
Definition: STM32-USARTv1-ChipUartLowLevel.cpp:363
void interruptHandler()
Interrupt handler.
Definition: STM32-USARTv1-ChipUartLowLevel.cpp:280
volatile size_t writePosition_
current position in writeBuffer_
Definition: ChipUartLowLevel.hpp:290
std::pair< int, uint32_t > start(devices::UartBase &uartBase, uint32_t baudRate, uint8_t characterLength, devices::UartParity parity, bool _2StopBits) override
Starts low-level UART driver.
Definition: STM32-USARTv1-ChipUartLowLevel.cpp:323
bool isStarted() const
Definition: ChipUartLowLevel.hpp:245
bool isWriteInProgress() const
Definition: ChipUartLowLevel.hpp:263