/** * @file * @brief Implementation of UART using STM32 HAL. */ #ifndef STA_CORE_STM32_UART_HPP #define STA_CORE_STM32_UART_HPP /** * @defgroup stm32UART UART * @ingroup stm32 * @brief STM32 UART module. */ // Only enable module on STM32 platform w/ HAL UART module enabled #include #ifdef STA_PLATFORM_STM32 # include # ifdef HAL_UART_MODULE_ENABLED # define STA_STM32_UART_ENABLED # endif // HAL_UART_MODULE_ENABLED #endif // STA_PLATFORM_STM32 #if defined(STA_STM32_UART_ENABLED) || defined(DOXYGEN) #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_ENABLED #endif // STA_CORE_STM32_UART_HPP