/** * @file * @brief Implementation of UART using STM32 HAL. */ #ifndef STA_STM32_UART_HPP #define STA_STM32_UART_HPP /** * @defgroup stm32UART UART * @ingroup stm32 * @brief STM32 UART module. */ #ifdef DOXYGEN /** * @def STA_STM32_UART_ENABLE * @brief Enable module. * * @ingroup stm32BuildConfig */ # define STA_STM32_UART_ENABLE /** * @def STA_STM32_UART_DEBUG_SERIAL * @brief Create global sta::DebugSerial object using this HAL UART instance. * * @ingroup stm32BuildConfig */ # define STA_STM32_UART_DEBUG_SERIAL #endif // DOXYGEN #include #ifdef STA_STM32_UART_ENABLE #include #include namespace sta { /** * @brief Implementation of UART interface using HAL. * * @ingroup stm32UART */ class STM32UART : public UART { public: /** * @param handle UART handle */ STM32UART(UART_HandleTypeDef * handle); void write(const uint8_t * buffer, size_t size) override; private: UART_HandleTypeDef * handle_; /**< UART handle */ }; } // namespace sta #endif // STA_STM32_UART_ENABLE #endif // STA_STM32_UART_HPP