Index: firmware/App/Services/SystemComm.h =================================================================== diff -u -rde5a0d43bdef611d963d11855bc958a8d8899a09 -r101bf85b0b425e919b01b4b7fabcbd15fd5bbde5 --- firmware/App/Services/SystemComm.h (.../SystemComm.h) (revision de5a0d43bdef611d963d11855bc958a8d8899a09) +++ firmware/App/Services/SystemComm.h (.../SystemComm.h) (revision 101bf85b0b425e919b01b4b7fabcbd15fd5bbde5) @@ -22,22 +22,30 @@ #include "CommBuffers.h" #include "MsgQueues.h" +/** + * @defgroup SystemComm SystemComm + * @brief System communication module. Manages incoming and outgoing CAN frames. + * + * @addtogroup SystemComm + * @{ + */ + // ********** public definitions ********** -#define MESSAGE_SYNC_BYTE 0xA5 +#define MESSAGE_SYNC_BYTE 0xA5 ///< Denali message syncronization byte. -#define CAN_MESSAGE_PAYLOAD_SIZE 8 +#define CAN_MESSAGE_PAYLOAD_SIZE 8 ///< CAN frame payload size (in bytes). #ifdef DEBUG_ENABLED #define PC_MESSAGE_PACKET_SIZE 8 #endif -#define MSG_ID_ACK 0xFFFF -#define MSG_ACK_BIT 0x8000 -#define MAX_MSG_SEQ_NO 0x7FFF -#define MIN_MSG_SEQ_NO 0x0001 -#define MAX_ACK_MSG_SIZE ( sizeof( MESSAGE_WRAPPER_T ) + 1 + CAN_MESSAGE_PAYLOAD_SIZE ) // must hold full (wrapped) message + sync + any CAN padding +#define MSG_ID_ACK 0xFFFF ///< Denali message ID for acknowledging received messages (when required). +#define MSG_ACK_BIT 0x8000 ///< ACK bit in sequence number that indicates an ACK is required. +#define MAX_MSG_SEQ_NO 0x7FFF ///< Maximum sequence number for Denali message (then wraps to 1). +#define MIN_MSG_SEQ_NO 0x0001 ///< Minimum sequence number for Denali message. +#define MAX_ACK_MSG_SIZE ( sizeof( MESSAGE_WRAPPER_T ) + 1 + CAN_MESSAGE_PAYLOAD_SIZE ) ///< Maximum size (in bytes) of Denali message including full (wrapped) message + sync + any CAN padding) -typedef COMM_BUFFER_T CAN_MESSAGE_BOX_T; // the CAN comm buffers align with the active CAN message boxes +typedef COMM_BUFFER_T CAN_MESSAGE_BOX_T; ///< the CAN comm buffers align with the active CAN message boxes // ********** public function prototypes ********** @@ -49,11 +57,16 @@ void handleUARTMsgRecvPacketInterrupt( void ); void handleUARTMsgXmitPacketInterrupt( void ); #endif +BOOL isCANBoxForXmit( CAN_MESSAGE_BOX_T srcCANBox ); +BOOL isCANBoxForRecv( CAN_MESSAGE_BOX_T srcCANBox ); void checkInFromDG( void ); void checkInFromUI( void ); BOOL isDGCommunicating( void ); BOOL isUICommunicating( void ); -BOOL uiCommunicated( void ); +BOOL uiCommunicated( void ); +BOOL isHDOnlyCANNode( void ); BOOL addMsgToPendingACKList( MESSAGE_T *msg, COMM_BUFFER_T channel, U08 *msgData, U32 len ); + +/**@}*/ #endif