Move CAN interface to STA Core library

This commit is contained in:
Henrik Stickann
2022-05-09 21:25:44 +02:00
parent 92e3dd474b
commit e2854fceee
7 changed files with 529 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
/**
* @file
* @brief CAN frame headers.
*/
#ifndef STA_INTF_CAN_HEADERS_HPP
#define STA_INTF_CAN_HEADERS_HPP
#include <sta/intf/can/id.hpp>
#include <cstdint>
namespace sta
{
/**
* @defgroup canHeader Frame headers
* @ingroup canAPI
* @brief CAN header types for transmitted / received frames.
*/
/**
* @brief CAN TX frame header.
*
* @ingroup canHeader
*/
struct CanTxHeader
{
CanFrameId id; /**< Frame ID */
uint8_t payloadLength; /**< Size of data to send */
};
/**
* @brief CAN RX frame header.
*
* @ingroup canHeader
*/
struct CanRxHeader
{
CanFrameId id; /**< Frame ID */
uint8_t payloadLength; /**< Size of received data */
uint32_t timestamp; /**< RX timestamp */
uint8_t filter; /**< RX filter match */
};
} // namespace sta
#endif // STA_INTF_CAN_HEADERS_HPP