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