This repository has been archived on 2026-02-22. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
can/Inc/mmr_can_msg_conversions.h
Stefano Calabretti efdd4655a3 Improvements (#11)
* Use default include

* Add conversions

* Add TryReceive
2022-04-11 15:50:56 +02:00

24 lines
752 B
C

/*
* mmr_can_msg_conversions.h
*
* Created on: Apr 11, 2022
* Author: Stefa
*/
#ifndef INC_MMR_CAN_MSG_CONVERSIONS_H_
#define INC_MMR_CAN_MSG_CONVERSIONS_H_
#include <stdint.h>
#define MMR_CAN_MsgToByte(msg) (*(uint8_t*)(msg.store))
#define MMR_CAN_MsgToInt16(msg) (*(int16_t*)(msg.store))
#define MMR_CAN_MsgToUint16(msg) (*(uint16_t*)(msg.store))
#define MMR_CAN_MsgToInt32(msg) (*(int32_t*)(msg.store))
#define MMR_CAN_MsgToUint32(msg) (*(uint32_t*)(msg.store))
#define MMR_CAN_MsgToInt64(msg) (*(int64_t*)(msg.store))
#define MMR_CAN_MsgToUint64(msg) (*(uint64_t*)(msg.store))
#define MMR_CAN_MsgToFloat(msg) (*(float*)(msg.store))
#define MMR_CAN_MsgToDouble(msg) (*(double*)(msg.store))
#endif /* INC_MMR_CAN_MSG_CONVERSIONS_H_ */