Lab 1 Program C

Dependents:   Lab1C

Fork of mbed by -deleted-

Committer:
rolf.meyer@arm.com
Date:
Fri Aug 28 12:10:11 2009 +0000
Revision:
11:1c1ebd0324fa
Child:
27:7110ebee3484
A shiny new version

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 * rmeyer
rolf.meyer@arm.com 11:1c1ebd0324fa 4 */
rolf.meyer@arm.com 11:1c1ebd0324fa 5
rolf.meyer@arm.com 11:1c1ebd0324fa 6 #ifndef MBED_CAN_HELPER_H
rolf.meyer@arm.com 11:1c1ebd0324fa 7 #define MBED_CAN_HELPER_H
rolf.meyer@arm.com 11:1c1ebd0324fa 8
rolf.meyer@arm.com 11:1c1ebd0324fa 9 #ifdef __cplusplus
rolf.meyer@arm.com 11:1c1ebd0324fa 10 extern "C" {
rolf.meyer@arm.com 11:1c1ebd0324fa 11 #endif
rolf.meyer@arm.com 11:1c1ebd0324fa 12
rolf.meyer@arm.com 11:1c1ebd0324fa 13 typedef enum CANFormat CANFormat;
rolf.meyer@arm.com 11:1c1ebd0324fa 14 enum CANFormat {
rolf.meyer@arm.com 11:1c1ebd0324fa 15 CANStandard = 0,
rolf.meyer@arm.com 11:1c1ebd0324fa 16 CANExtended = 1
rolf.meyer@arm.com 11:1c1ebd0324fa 17 };
rolf.meyer@arm.com 11:1c1ebd0324fa 18
rolf.meyer@arm.com 11:1c1ebd0324fa 19 typedef enum CANType CANType;
rolf.meyer@arm.com 11:1c1ebd0324fa 20 enum CANType {
rolf.meyer@arm.com 11:1c1ebd0324fa 21 CANData = 0,
rolf.meyer@arm.com 11:1c1ebd0324fa 22 CANRemote = 1
rolf.meyer@arm.com 11:1c1ebd0324fa 23 };
rolf.meyer@arm.com 11:1c1ebd0324fa 24
rolf.meyer@arm.com 11:1c1ebd0324fa 25 typedef struct CAN_Message CAN_Message;
rolf.meyer@arm.com 11:1c1ebd0324fa 26 struct CAN_Message {
rolf.meyer@arm.com 11:1c1ebd0324fa 27 unsigned int id; // 29 bit identifier
rolf.meyer@arm.com 11:1c1ebd0324fa 28 unsigned char data[8]; // Data field
rolf.meyer@arm.com 11:1c1ebd0324fa 29 unsigned char len; // Length of data field in bytes
rolf.meyer@arm.com 11:1c1ebd0324fa 30 CANFormat format; // 0 - STANDARD, 1- EXTENDED IDENTIFIER
rolf.meyer@arm.com 11:1c1ebd0324fa 31 CANType type; // 0 - DATA FRAME, 1 - REMOTE FRAME
rolf.meyer@arm.com 11:1c1ebd0324fa 32 };
rolf.meyer@arm.com 11:1c1ebd0324fa 33
rolf.meyer@arm.com 11:1c1ebd0324fa 34 #ifdef __cplusplus
rolf.meyer@arm.com 11:1c1ebd0324fa 35 };
rolf.meyer@arm.com 11:1c1ebd0324fa 36 #endif
rolf.meyer@arm.com 11:1c1ebd0324fa 37
rolf.meyer@arm.com 11:1c1ebd0324fa 38 #endif // MBED_CAN_HELPER_H