mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-09-29 05:17:33 +00:00
Improve doxygen comments
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
/**
|
||||
* @brief Wrapper for HAL GPIO pins.
|
||||
*
|
||||
* Define **STA_HAL_GPIO_ENABLE** in `<sta/config.hpp>` to enable module.
|
||||
* Configuration:
|
||||
* STA_HAL_GPIO_ENABLE: Enable module
|
||||
*/
|
||||
#ifndef STA_HAL_GPIO_PIN_HPP
|
||||
#define STA_HAL_GPIO_PIN_HPP
|
||||
@@ -10,8 +11,7 @@
|
||||
#ifdef STA_HAL_GPIO_ENABLE
|
||||
|
||||
#include <sta/gpio_pin.hpp>
|
||||
|
||||
#include <main.h>
|
||||
#include <sta/hal.hpp>
|
||||
|
||||
|
||||
namespace sta
|
||||
|
@@ -1,9 +1,10 @@
|
||||
/**
|
||||
* @brief Implementations for `SpiInterface` and `SpiDevice` using HAL.
|
||||
*
|
||||
* Define **STA_HAL_SPI_ENABLE** in `<sta/config.hpp>` to enable module.
|
||||
* Configuration:
|
||||
* STA_HAL_SPI_ENABLE: Enable module
|
||||
*
|
||||
* Requires **STA_HAL_GPIO_ENABLE**.
|
||||
* Requires **HAL_GPIO** module.
|
||||
*/
|
||||
#ifndef STA_HAL_SPI_HPP
|
||||
#define STA_HAL_SPI_HPP
|
||||
@@ -15,11 +16,11 @@
|
||||
#error "HAL GPIO required"
|
||||
#endif // !STA_HAL_GPIO_ENABLE
|
||||
|
||||
#include <sta/hal.hpp>
|
||||
#include <sta/spi_device.hpp>
|
||||
#include <sta/hal/clocks.hpp>
|
||||
#include <sta/hal/gpio_pin.hpp>
|
||||
|
||||
#include <main.h>
|
||||
|
||||
|
||||
namespace sta
|
||||
{
|
||||
@@ -88,36 +89,18 @@ namespace sta
|
||||
} // namespace sta
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get function returning PCLK frequency.
|
||||
* @brief Get SPI interface info struct for HAL handle.
|
||||
*
|
||||
* @param n Index of peripheral clock
|
||||
*/
|
||||
#define STA_HAL_GET_PCLK_FREQ_FN(n) HAL_RCC_GetPCLK ## n ## Freq
|
||||
|
||||
/**
|
||||
* @brief Get SPI interface info struct.
|
||||
* Requires STA_HAL_<handle>_PCLK_IDX to be defined for the MCU.
|
||||
* MCU mappings are found in `core` -> sta/mcu/.hpp files.
|
||||
*
|
||||
* Check the MCUs Reference Manual RCC register documentation to see which
|
||||
* peripheral clock is used.
|
||||
*
|
||||
* @param n Index of SPI interface (e.g. 2 for SPI2)
|
||||
* @param pclk Index of peripheral clock used by SPI interface
|
||||
* @param handle SPI interface handle
|
||||
*/
|
||||
#define STA_HAL_SPI_INFO_MANUAL(n, pclk) sta::HalSpiInterfaceInfo{&hspi ## n, STA_HAL_GET_PCLK_FREQ_FN(pclk)}
|
||||
|
||||
/**
|
||||
* @brief Get SPI interface info struct.
|
||||
*
|
||||
* Requires STA_HAL_SPI_n_PCLK_IDX set to idx of PCLK used by the interface.
|
||||
*
|
||||
* Check the MCUs Reference Manual RCC register documentation to see which
|
||||
* peripheral clock is used.
|
||||
*
|
||||
* @param n Index of SPI interface (e.g. 2 for SPI2)
|
||||
*/
|
||||
#define STA_HAL_SPI_INFO(n) STA_HAL_SPI_INFO_MANUAL(n, STA_HAL_SPI_ ## n ## _PCLK_IDX)
|
||||
#define STA_HAL_SPI_INFO(handle) sta::HalSpiInterfaceInfo{&handle, STA_HAL_GET_HANDLE_PCLK_FREQ_FN(handle)}
|
||||
|
||||
|
||||
#endif // STA_HAL_SPI_ENABLE
|
||||
|
@@ -1,10 +1,9 @@
|
||||
/**
|
||||
* @brief Implementation of UART using HAL.
|
||||
*
|
||||
* Define **STA_HAL_UART_ENABLE** in `<sta/config.hpp>` to enable module.
|
||||
*
|
||||
* To use a HAL UART instance (e.g. UART1) for `<sta/debug_serial.hpp>` define:
|
||||
* #define STA_HAL_UART_DEBUG_SERIAL huart1
|
||||
* Configuration:
|
||||
* STA_HAL_UART_ENABLE: Enable module
|
||||
* STA_HAL_UART_DEBUG_SERIAL: Create global `sta::DebugSerial` object using this UART instance
|
||||
*/
|
||||
#ifndef STA_HAL_UART_HPP
|
||||
#define STA_HAL_UART_HPP
|
||||
@@ -12,10 +11,9 @@
|
||||
#include <sta/config.hpp>
|
||||
#ifdef STA_HAL_UART_ENABLE
|
||||
|
||||
#include <sta/hal.hpp>
|
||||
#include <sta/uart.hpp>
|
||||
|
||||
#include <main.h>
|
||||
|
||||
|
||||
namespace sta
|
||||
{
|
||||
|
Reference in New Issue
Block a user