mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-08-02 17:31:53 +00:00
Update description and debug serial usage
This commit is contained in:
parent
b50cf07ce9
commit
9f2c73c9ab
@ -1,10 +1,10 @@
|
|||||||
/**
|
/**
|
||||||
* @brief Implementation for UART using HAL.
|
* @brief Implementation of UART using HAL.
|
||||||
*
|
*
|
||||||
* Define STA_HAL_UART_ENABLE in <sta/config.hpp> to enable.
|
* Define **STA_HAL_UART_ENABLE** in `<sta/config.hpp>` to enable module.
|
||||||
*
|
*
|
||||||
* To enable the global DebugSerial instance (example using UART1) define:
|
* To use a HAL UART instance (e.g. UART1) for `<sta/debug_serial.hpp>` define:
|
||||||
* #define STA_HAL_UART_DEBUG huart1
|
* #define STA_HAL_UART_DEBUG_SERIAL huart1
|
||||||
*/
|
*/
|
||||||
#ifndef STA_HAL_UART_HPP
|
#ifndef STA_HAL_UART_HPP
|
||||||
#define STA_HAL_UART_HPP
|
#define STA_HAL_UART_HPP
|
||||||
@ -37,14 +37,6 @@ namespace sta
|
|||||||
private:
|
private:
|
||||||
UART_HandleTypeDef * handle_; /**< UART handle */
|
UART_HandleTypeDef * handle_; /**< UART handle */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#ifdef STA_HAL_UART_DEBUG
|
|
||||||
/**
|
|
||||||
* @brief Global UART instance for debug output.
|
|
||||||
*/
|
|
||||||
extern HalUART DebugSerial;
|
|
||||||
#endif // STA_HAL_UART_DEBUG
|
|
||||||
} // namespace sta
|
} // namespace sta
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,16 +17,22 @@ namespace sta
|
|||||||
} // namespace sta
|
} // namespace sta
|
||||||
|
|
||||||
|
|
||||||
#ifdef STA_HAL_UART_DEBUG
|
#ifdef STA_HAL_UART_DEBUG_SERIAL
|
||||||
|
|
||||||
|
// Get extern declaration for DebugSerial because const namespace level variables have internal linkage by default
|
||||||
|
#include <sta/debug_serial.hpp>
|
||||||
|
|
||||||
#include <usart.h>
|
#include <usart.h>
|
||||||
|
|
||||||
namespace sta
|
namespace sta
|
||||||
{
|
{
|
||||||
HalUART DebugSerial(&STA_HAL_UART_DEBUG);
|
HalUART gHalDebugSerial(&STA_HAL_UART_DEBUG_SERIAL);
|
||||||
|
|
||||||
|
// Used by <sta/debug.hpp>
|
||||||
|
UART * const DebugSerial = &gHalDebugSerial;
|
||||||
} // namespace sta
|
} // namespace sta
|
||||||
|
|
||||||
#endif // STA_HAL_UART_DEBUG
|
#endif // STA_HAL_UART_DEBUG_SERIAL
|
||||||
|
|
||||||
|
|
||||||
#endif // STA_HAL_UART_ENABLE
|
#endif // STA_HAL_UART_ENABLE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user