Index: firmware/App/Services/MsgQueues.h =================================================================== diff -u -rde5a0d43bdef611d963d11855bc958a8d8899a09 -r8dad6fab1c33602ad94908fd31b8b15153a9eb6e --- firmware/App/Services/MsgQueues.h (.../MsgQueues.h) (revision de5a0d43bdef611d963d11855bc958a8d8899a09) +++ firmware/App/Services/MsgQueues.h (.../MsgQueues.h) (revision 8dad6fab1c33602ad94908fd31b8b15153a9eb6e) @@ -20,38 +20,52 @@ #include "HDCommon.h" +/** + * @defgroup MsgQueues MsgQueues + * @brief The message queues module provides queuing services for + * incoming CAN messages. + * + * @addtogroup MsgQueues + * @{ + */ + // ********** public definitions ********** -#define MAX_MSG_PAYLOAD_SIZE 100 // bytes - +#define MAX_MSG_PAYLOAD_SIZE 100 ///< bytes + +/// Enumeration of message queues. typedef enum Msg_Queues { - MSG_Q_IN = 0, - NUM_OF_MSG_QUEUES + MSG_Q_IN = 0, ///< Incoming CAN message queue. + NUM_OF_MSG_QUEUES ///< Number of message queues. } MSG_QUEUE_T; -#pragma pack(push,1) +#pragma pack(push,1) + +/// Record structure for message header. typedef struct { - S16 seqNo; // sequence # (and ACK required bit) of message - U16 msgID; // ID of message - U08 payloadLen; // length of payload in bytes + S16 seqNo; ///< sequence number (and ACK required bit) of message + U16 msgID; ///< ID of message + U08 payloadLen; ///< length of payload in bytes } MESSAGE_HEADER_T; - + +/// Record structure for a message (header + payload). typedef struct { - MESSAGE_HEADER_T hdr; // message header - U08 payload[ MAX_MSG_PAYLOAD_SIZE ]; // message payload + MESSAGE_HEADER_T hdr; ///< message header + U08 payload[ MAX_MSG_PAYLOAD_SIZE ]; ///< message payload } MESSAGE_T; - + +/// Record structure for a wrapped message (message + CRC). typedef struct { - MESSAGE_T msg; // message - U08 crc; // message CRC + MESSAGE_T msg; ///< message + U08 crc; ///< message CRC } MESSAGE_WRAPPER_T; #pragma pack(pop) -#define MESSAGE_OVERHEAD_SIZE (sizeof(MESSAGE_HEADER_T) + sizeof(U08)) +#define MESSAGE_OVERHEAD_SIZE (sizeof(MESSAGE_HEADER_T) + sizeof(U08)) ///< Byte size of a message's overhead (fixed at 6 bytes). // ********** public function prototypes ********** @@ -63,4 +77,6 @@ void blankMessage( MESSAGE_T *message ); void blankMessageInWrapper( MESSAGE_WRAPPER_T *message ); +/**@}*/ + #endif