Doxygen support

This commit is contained in:
@CarlWachter 2023-12-29 19:39:14 +01:00
parent 7ebc2e5d1e
commit 7eede5faaa
5 changed files with 2708 additions and 7 deletions

2630
docs/Doxyfile Normal file

File diff suppressed because it is too large Load Diff

View File

@ -13,20 +13,34 @@
#ifndef STA_TACOS_MANAGER_PRIORITY
# error "Manger task priority not specified in config.hpp"
#else
#else
#include <set>
#include <list>
#include <memory>
#include <sta/tacos/thread.hpp>
/**
* @defgroup tacos_manager Manager Task
* @ingroup tacos
* @brief Manager task for TACOS.
*/
namespace sta
{
namespace tacos
{
/**
* @brief Manager class for Tacos.
*
* @ingroup tacos_manager
*/
class Manager : public TacosThread
{
public:
/**
* @brief Get the singleton instance of the manager.
*/
static Manager* instance()
{
static CGuard g;
@ -41,7 +55,7 @@ namespace sta
}
/**
*
* @brief Register a thread to be managed by the manager.
*/
void registerThread(std::shared_ptr<TacosThread> thread, std::list<uint16_t> states);
@ -71,12 +85,26 @@ namespace sta
//~Manager();
/**
* @brief Forces only threads of current state to run.
*/
void updateThreads();
/**
* @brief Starts all threads which should be running in the given state. Does nothing if the state is already running.
*/
void startThreads(uint16_t state);
/**
* @brief Stops all threads which should not be running in the given state.
*/
void stopThreads(uint16_t state);
/**
* @brief Pointers to all threads which are managed by the manager.
*
* @ingroup tacos_manager
*/
std::set<std::shared_ptr<TacosThread>> threads_[STA_TACOS_NUM_STATES];
};
} // namespace tacos

View File

@ -8,6 +8,11 @@
#ifndef INCLUDE_STA_TACOS_STARTUP_HPP_
#define INCLUDE_STA_TACOS_STARTUP_HPP_
/**
* @defgroup tacos TACOS
* @brief TACOS library.
*/
namespace sta
{
namespace tacos

View File

@ -10,7 +10,6 @@
#include <sta/config.hpp>
#ifndef STA_TACOS_NUM_STATES
# error "Number of states wasn't defined in config.hpp"
#else
@ -20,6 +19,7 @@
# define STA_TACOS_INITIAL_STATE 0
#endif
#define STA_TACOS_STATEMACHINE_QUEUE_LENGTH 4
// State transition happened because of
@ -41,10 +41,21 @@
#include <tuple>
/**
* @defgroup tacos_statemachine Statemachine Task
* @ingroup tacos
* @brief Statemachine task for TACOS.
*/
namespace sta
{
namespace tacos
{
/**
* @brief Event flags for state transitions.
*
* @ingroup tacos_statemachine
*/
enum EventFlags
{
NORMAL = 0x1U,
@ -54,6 +65,11 @@ namespace sta
ALL = NORMAL | FORCED | TIMEOUT | STARTUP
};
/**
* @brief State transition structure.
*
* @ingroup tacos_statemachine
*/
struct StateTransition
{
uint16_t from;
@ -62,7 +78,11 @@ namespace sta
uint32_t lockout;
};
/**
* @brief Statemachine implementation for Tacos.
*
* @ingroup tacos_statemachine
*/
class Statemachine : public TacosThread
{
public:
@ -139,6 +159,8 @@ namespace sta
private:
/**
* @brief Starts the lockoutTimer for the desired duration.
*
* @param millis The duration of the timer in milliseconds.
*/
void setLockoutTimer(uint32_t millis);

View File

@ -12,16 +12,26 @@
#include <sta/rtos/thread.hpp>
/**
* @defgroup tacos_thread TACOS Thread
* @ingroup tacos
* @brief TACOS Thread class.
*/
namespace sta
{
namespace tacos
{
/**
* @brief Abstract class for thread implementations in Tacos.
*
* @ingroup tacos_thread
*/
class TacosThread : public RtosThread
{
public:
/**
*
* @brief Create a new thread with the given name and priority.
*/
TacosThread(const char* name, osPriority_t prio);
@ -41,11 +51,13 @@ namespace sta
/**
* @brief Get the currently running instance.
*
* @return The currently running instance id.
*/
osThreadId_t getInstance();
/**
*
* @brief Get the name of this thread.
*/
const char* getName() const;
@ -65,10 +77,14 @@ namespace sta
/**
* @brief The body of the thread's loop. Has to be implemented by the user.
* This function is called repeatedly until termination is requested.
*/
virtual void func() = 0;
/**
* @brief This function is executed when the thread is terminated. Has to be implemented by the user.
* This function should free all ressources used by this thread.
*/
virtual void cleanup();
private: