diff --git a/include/sta/enum_flags.hpp b/include/sta/enum_flags.hpp index 0ef7101..c480698 100644 --- a/include/sta/enum_flags.hpp +++ b/include/sta/enum_flags.hpp @@ -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: diff --git a/include/sta/fifo_buffer.hpp b/include/sta/fifo_buffer.hpp index b0db3a8..e9fc768 100644 --- a/include/sta/fifo_buffer.hpp +++ b/include/sta/fifo_buffer.hpp @@ -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); /** diff --git a/include/sta/intf/can/controller.hpp b/include/sta/intf/can/controller.hpp index f666a2b..389dee0 100644 --- a/include/sta/intf/can/controller.hpp +++ b/include/sta/intf/can/controller.hpp @@ -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 #include diff --git a/include/sta/intf/can/id.hpp b/include/sta/intf/can/id.hpp index 7c1d653..4a453e3 100644 --- a/include/sta/intf/can/id.hpp +++ b/include/sta/intf/can/id.hpp @@ -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 diff --git a/include/sta/intf/spi_interface.hpp b/include/sta/intf/spi_interface.hpp index 8ba7962..047df2d 100644 --- a/include/sta/intf/spi_interface.hpp +++ b/include/sta/intf/spi_interface.hpp @@ -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); diff --git a/include/sta/intf/time.hpp b/include/sta/intf/time.hpp index 3ef23f2..2dd772a 100644 --- a/include/sta/intf/time.hpp +++ b/include/sta/intf/time.hpp @@ -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 diff --git a/include/sta/printable_uart.hpp b/include/sta/printable_uart.hpp index b3d3be0..38c2912 100644 --- a/include/sta/printable_uart.hpp +++ b/include/sta/printable_uart.hpp @@ -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); diff --git a/include/sta/spi_device.hpp b/include/sta/spi_device.hpp index 88770cb..fad753d 100644 --- a/include/sta/spi_device.hpp +++ b/include/sta/spi_device.hpp @@ -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. *