Update doc

This commit is contained in:
Henrik Stickann 2022-05-10 02:12:44 +02:00
parent e2854fceee
commit b73e03fddf
8 changed files with 120 additions and 17 deletions

View File

@ -21,7 +21,15 @@ namespace sta
using flag_type = F; /**< Enum type used for flag bits */
public:
/**
* @brief Default constructor.
*/
EnumFlags();
/**
* @brief Copy constructor.
*
* @param other Flags to copy
*/
EnumFlags(const EnumFlags & other);
/**
* @brief Construct from single flag.
@ -75,22 +83,62 @@ namespace sta
// Operator overloads
//
// Comparison
/**
* @brief Equal to operator.
*
* @param rhs Flags to compare
* @return True if flags are equal
*/
bool operator ==(const EnumFlags & rhs) const;
/**
* @brief Not equal to operator.
*
* @param rhs Flags to compare
* @return True if flags are not equal
*/
bool operator !=(const EnumFlags & rhs) const;
// Bitwise operators
/**
* @brief Bitwise AND operator.
*
* @param rhs Other flags
* @return Result of bitwise AND
*/
EnumFlags operator &(const EnumFlags & rhs) const;
/**
* @brief Bitwise OR operator.
*
* @param rhs Other flags
* @return Result of bitwise OR
*/
EnumFlags operator |(const EnumFlags & rhs) const;
// Assignment
/**
* @brief Bitwise AND assignment operator.
*
* @param rhs Other flags
* @return Reference to this
*/
EnumFlags & operator &=(const EnumFlags & rhs);
/**
* @brief Bitwise OR assignment operator.
*
* @param rhs Other flags
* @return Reference to this
*/
EnumFlags & operator |=(const EnumFlags & rhs);
// Conversion
/**
* @brief Explicitly convert flags to uint32_t.
*/
explicit operator uint32_t();
private:
/**
* @brief Construct from uint32_t flags.
*
* @param flags Flags
*/
EnumFlags(uint32_t flags);
private:

View File

@ -14,11 +14,26 @@ namespace sta
class FifoBuffer
{
public:
/**
* @brief FIFO size type.
*/
using size_type = Size;
/**
* @brief Max number of bytes in FIFO.
*/
static constexpr size_type MAX_SIZE = N;
public:
/**
* @brief Construct empty FIFO buffer.
*/
FifoBuffer();
/**
* @brief Construct FIFO buffer with initial data.
*
* @param buffer Source buffer
* @param size Buffer size
*/
FifoBuffer(const uint8_t * buffer, Size size);
/**

View File

@ -7,20 +7,15 @@
/**
* @defgroup can CAN
* @brief CAN Controller interface definition.
* @brief CAN controller driver interface.
*/
/**
* @defgroup canAPI API
* @ingroup can
* @brief Public library interface.
* @brief Public interface.
*/
/**
* @defgroup canBuildConfig Build config
* @ingroup can
* @brief Build configuration options.
*/
#include <sta/intf/can/filter.hpp>
#include <sta/intf/can/headers.hpp>

View File

@ -57,10 +57,46 @@ namespace sta
// Comparison operators
//
/**
* @brief Equal to operator.
*
* @param lhs Left hand side CAN ID
* @param rhs Right hand side CAN ID
* @return True if CAN IDs are equal
*
* @ingroup canID
*/
bool operator ==(const CanId & lhs, const CanId & rhs);
/**
* @brief Not equal to operator.
*
* @param lhs Left hand side CAN ID
* @param rhs Right hand side CAN ID
* @return True if CAN IDs are not equal
*
* @ingroup canID
*/
bool operator !=(const CanId & lhs, const CanId & rhs);
/**
* @brief Equal to operator.
*
* @param lhs Left hand side CAN Frame ID
* @param rhs Right hand side CAN Frame ID
* @return True if CAN Frame IDs are equal
*
* @ingroup canID
*/
bool operator ==(const CanFrameId & lhs, const CanFrameId & rhs);
/**
* @brief Not equal to operator.
*
* @param lhs Left hand side CAN Frame ID
* @param rhs Right hand side CAN Frame ID
* @return True if CAN Frame IDs are not equal
*
* @ingroup canID
*/
bool operator !=(const CanFrameId & lhs, const CanFrameId & rhs);
} // namespace sta

View File

@ -20,7 +20,6 @@ namespace sta
{
public:
/**
* @param settings SPI interface settings
* @param mutex Mutex object for managing shared access. Pass nullptr for no access control
*/
SpiInterface(Mutex * mutex = nullptr);

View File

@ -9,7 +9,17 @@
namespace sta
{
/**
* @brief Signature for millisecond precision time.
*
* @return Time in milliseconds
*/
using TimeMsFn = uint32_t (*)();
/**
* @brief Signature for microseconds precision time.
*
* @return Time in microseconds
*/
using TimeUsFn = uint32_t (*)();
} // namespace sta

View File

@ -90,7 +90,7 @@ namespace sta
* @brief Print string.
*
* @param str String buffer
* @parma length String length
* @param length String length
*/
void print(const char * str, size_t length);
@ -155,7 +155,7 @@ namespace sta
* @brief Print string followed by a new-line.
*
* @param str String buffer
* @parma length String length
* @param length String length
*/
void println(const char * str, size_t length);

View File

@ -20,8 +20,8 @@ namespace sta
{
public:
/**
* @param intf SPI hardware interface
* @param pin Chip select pin
* @param intf SPI hardware interface
* @param csPin Chip select pin
*/
SpiDevice(SpiInterface * intf, GpioPin * csPin);
@ -51,7 +51,7 @@ namespace sta
*
* @param value 16-bit value
*/
void transfer16(uint16_t data);
void transfer16(uint16_t value);
/**
* @brief Send data from buffer.
*