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