SD card interface
mbed-export/can_helper.h@0:22612ae617a0, 2012-10-08 (annotated)
- Committer:
- lharoon
- Date:
- Mon Oct 08 11:14:07 2012 +0000
- Revision:
- 0:22612ae617a0
1st edition
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lharoon | 0:22612ae617a0 | 1 | /* mbed Microcontroller Library - can_helper |
lharoon | 0:22612ae617a0 | 2 | * Copyright (c) 2009 ARM Limited. All rights reserved. |
lharoon | 0:22612ae617a0 | 3 | */ |
lharoon | 0:22612ae617a0 | 4 | |
lharoon | 0:22612ae617a0 | 5 | #ifndef MBED_CAN_HELPER_H |
lharoon | 0:22612ae617a0 | 6 | #define MBED_CAN_HELPER_H |
lharoon | 0:22612ae617a0 | 7 | |
lharoon | 0:22612ae617a0 | 8 | #ifdef __cplusplus |
lharoon | 0:22612ae617a0 | 9 | extern "C" { |
lharoon | 0:22612ae617a0 | 10 | #endif |
lharoon | 0:22612ae617a0 | 11 | |
lharoon | 0:22612ae617a0 | 12 | enum CANFormat { |
lharoon | 0:22612ae617a0 | 13 | CANStandard = 0, |
lharoon | 0:22612ae617a0 | 14 | CANExtended = 1 |
lharoon | 0:22612ae617a0 | 15 | }; |
lharoon | 0:22612ae617a0 | 16 | typedef enum CANFormat CANFormat; |
lharoon | 0:22612ae617a0 | 17 | |
lharoon | 0:22612ae617a0 | 18 | enum CANType { |
lharoon | 0:22612ae617a0 | 19 | CANData = 0, |
lharoon | 0:22612ae617a0 | 20 | CANRemote = 1 |
lharoon | 0:22612ae617a0 | 21 | }; |
lharoon | 0:22612ae617a0 | 22 | typedef enum CANType CANType; |
lharoon | 0:22612ae617a0 | 23 | |
lharoon | 0:22612ae617a0 | 24 | struct CAN_Message { |
lharoon | 0:22612ae617a0 | 25 | unsigned int id; // 29 bit identifier |
lharoon | 0:22612ae617a0 | 26 | unsigned char data[8]; // Data field |
lharoon | 0:22612ae617a0 | 27 | unsigned char len; // Length of data field in bytes |
lharoon | 0:22612ae617a0 | 28 | CANFormat format; // 0 - STANDARD, 1- EXTENDED IDENTIFIER |
lharoon | 0:22612ae617a0 | 29 | CANType type; // 0 - DATA FRAME, 1 - REMOTE FRAME |
lharoon | 0:22612ae617a0 | 30 | }; |
lharoon | 0:22612ae617a0 | 31 | typedef struct CAN_Message CAN_Message; |
lharoon | 0:22612ae617a0 | 32 | |
lharoon | 0:22612ae617a0 | 33 | #ifdef __cplusplus |
lharoon | 0:22612ae617a0 | 34 | }; |
lharoon | 0:22612ae617a0 | 35 | #endif |
lharoon | 0:22612ae617a0 | 36 | |
lharoon | 0:22612ae617a0 | 37 | #endif // MBED_CAN_HELPER_H |