Updated gitignore and added spatz utilities

This commit is contained in:
dario
2024-06-27 16:29:30 +02:00
committed by dario
parent 9eddbaa30f
commit fe3e5d38e4
5 changed files with 112 additions and 3 deletions

View File

@@ -0,0 +1,56 @@
#ifndef STA_CORE_SPATZ_HPP
#define STA_CORE_SPATZ_HPP
#include <sta/config.hpp>
#ifdef STA_SPATZ_ENABLED
#include <sta/debug/debug.hpp>
#ifndef STA_DEBUGGING_ENABLED
# error "Cannot use SPATZ without debugging being enabled."
#endif // STA_DEBUGGING_ENABLED
#include <sta/mutex.hpp>
namespace sta
{
namespace spatz
{
/**
* @brief Initialize SPATZ for in-the-loop testing.
*
* @param mutex A mutex used to make SPATZ thread-safe.
*/
void init(Mutex * mutex);
/**
* @brief Request bytes for a specific sensor id via the printable.
*
* @param id The id of the sensor to request data for.
* @param buffer The byte buffer to write the data to.
* @param length The number of the bytes to request.
*/
void request(uint8_t id, uint8_t * buffer, size_t length);
/**
* @brief Request floats for a specific sensor id via the printable.
*
* @param id The id of the sensor to request data for.
* @param buffer The float buffer to write the data to.
* @param length The number of floats to request.
*/
void request(uint8_t id, float * buffer, size_t length);
/**
* @brief Request doubles for a specific sensor id via the printable.
*
* @param id The id of the sensor to request data for.
* @param buffer The double buffer to write the data to.
* @param length The number of doubles to request.
*/
void request(uint8_t id, double * buffer, size_t length);
} // namespace spatz
} // namespace sta
#endif // STA_SPATZ_ENABLED
#endif // STA_CORE_SPATZ_HPP