Lab 1 Program C

Dependents:   Lab1C

Fork of mbed by -deleted-

Committer:
mattsims12
Date:
Tue Sep 29 03:04:58 2015 +0000
Revision:
44:1c5f591fce58
Parent:
27:7110ebee3484
Lab 1 Program C

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rolf.meyer@arm.com 11:1c1ebd0324fa 1 /* mbed Microcontroller Library - can_helper
rolf.meyer@arm.com 11:1c1ebd0324fa 2 * Copyright (c) 2009 ARM Limited. All rights reserved.
rolf.meyer@arm.com 11:1c1ebd0324fa 3 */
rolf.meyer@arm.com 11:1c1ebd0324fa 4
rolf.meyer@arm.com 11:1c1ebd0324fa 5 #ifndef MBED_CAN_HELPER_H
rolf.meyer@arm.com 11:1c1ebd0324fa 6 #define MBED_CAN_HELPER_H
rolf.meyer@arm.com 11:1c1ebd0324fa 7
rolf.meyer@arm.com 11:1c1ebd0324fa 8 #ifdef __cplusplus
rolf.meyer@arm.com 11:1c1ebd0324fa 9 extern "C" {
rolf.meyer@arm.com 11:1c1ebd0324fa 10 #endif
rolf.meyer@arm.com 11:1c1ebd0324fa 11
rolf.meyer@arm.com 11:1c1ebd0324fa 12 enum CANFormat {
rolf.meyer@arm.com 11:1c1ebd0324fa 13 CANStandard = 0,
rolf.meyer@arm.com 11:1c1ebd0324fa 14 CANExtended = 1
rolf.meyer@arm.com 11:1c1ebd0324fa 15 };
emilmont 27:7110ebee3484 16 typedef enum CANFormat CANFormat;
rolf.meyer@arm.com 11:1c1ebd0324fa 17
rolf.meyer@arm.com 11:1c1ebd0324fa 18 enum CANType {
rolf.meyer@arm.com 11:1c1ebd0324fa 19 CANData = 0,
rolf.meyer@arm.com 11:1c1ebd0324fa 20 CANRemote = 1
rolf.meyer@arm.com 11:1c1ebd0324fa 21 };
emilmont 27:7110ebee3484 22 typedef enum CANType CANType;
rolf.meyer@arm.com 11:1c1ebd0324fa 23
rolf.meyer@arm.com 11:1c1ebd0324fa 24 struct CAN_Message {
rolf.meyer@arm.com 11:1c1ebd0324fa 25 unsigned int id; // 29 bit identifier
rolf.meyer@arm.com 11:1c1ebd0324fa 26 unsigned char data[8]; // Data field
rolf.meyer@arm.com 11:1c1ebd0324fa 27 unsigned char len; // Length of data field in bytes
rolf.meyer@arm.com 11:1c1ebd0324fa 28 CANFormat format; // 0 - STANDARD, 1- EXTENDED IDENTIFIER
rolf.meyer@arm.com 11:1c1ebd0324fa 29 CANType type; // 0 - DATA FRAME, 1 - REMOTE FRAME
rolf.meyer@arm.com 11:1c1ebd0324fa 30 };
emilmont 27:7110ebee3484 31 typedef struct CAN_Message CAN_Message;
rolf.meyer@arm.com 11:1c1ebd0324fa 32
rolf.meyer@arm.com 11:1c1ebd0324fa 33 #ifdef __cplusplus
rolf.meyer@arm.com 11:1c1ebd0324fa 34 };
rolf.meyer@arm.com 11:1c1ebd0324fa 35 #endif
rolf.meyer@arm.com 11:1c1ebd0324fa 36
rolf.meyer@arm.com 11:1c1ebd0324fa 37 #endif // MBED_CAN_HELPER_H