This is a data logger program to be implemented with an instrument amplifier.
Data_Logger_V100/mbed/can_helper.h@0:d75ca4e39672, 2017-04-04 (annotated)
- Committer:
- KISScientific
- Date:
- Tue Apr 04 18:01:11 2017 +0000
- Revision:
- 0:d75ca4e39672
This is a data logger program.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
KISScientific | 0:d75ca4e39672 | 1 | /* mbed Microcontroller Library - can_helper |
KISScientific | 0:d75ca4e39672 | 2 | * Copyright (c) 2009 ARM Limited. All rights reserved. |
KISScientific | 0:d75ca4e39672 | 3 | * rmeyer |
KISScientific | 0:d75ca4e39672 | 4 | */ |
KISScientific | 0:d75ca4e39672 | 5 | |
KISScientific | 0:d75ca4e39672 | 6 | #ifndef MBED_CAN_HELPER_H |
KISScientific | 0:d75ca4e39672 | 7 | #define MBED_CAN_HELPER_H |
KISScientific | 0:d75ca4e39672 | 8 | |
KISScientific | 0:d75ca4e39672 | 9 | #ifdef __cplusplus |
KISScientific | 0:d75ca4e39672 | 10 | extern "C" { |
KISScientific | 0:d75ca4e39672 | 11 | #endif |
KISScientific | 0:d75ca4e39672 | 12 | |
KISScientific | 0:d75ca4e39672 | 13 | typedef enum CANFormat CANFormat; |
KISScientific | 0:d75ca4e39672 | 14 | enum CANFormat { |
KISScientific | 0:d75ca4e39672 | 15 | CANStandard = 0, |
KISScientific | 0:d75ca4e39672 | 16 | CANExtended = 1 |
KISScientific | 0:d75ca4e39672 | 17 | }; |
KISScientific | 0:d75ca4e39672 | 18 | |
KISScientific | 0:d75ca4e39672 | 19 | typedef enum CANType CANType; |
KISScientific | 0:d75ca4e39672 | 20 | enum CANType { |
KISScientific | 0:d75ca4e39672 | 21 | CANData = 0, |
KISScientific | 0:d75ca4e39672 | 22 | CANRemote = 1 |
KISScientific | 0:d75ca4e39672 | 23 | }; |
KISScientific | 0:d75ca4e39672 | 24 | |
KISScientific | 0:d75ca4e39672 | 25 | typedef struct CAN_Message CAN_Message; |
KISScientific | 0:d75ca4e39672 | 26 | struct CAN_Message { |
KISScientific | 0:d75ca4e39672 | 27 | unsigned int id; // 29 bit identifier |
KISScientific | 0:d75ca4e39672 | 28 | unsigned char data[8]; // Data field |
KISScientific | 0:d75ca4e39672 | 29 | unsigned char len; // Length of data field in bytes |
KISScientific | 0:d75ca4e39672 | 30 | CANFormat format; // 0 - STANDARD, 1- EXTENDED IDENTIFIER |
KISScientific | 0:d75ca4e39672 | 31 | CANType type; // 0 - DATA FRAME, 1 - REMOTE FRAME |
KISScientific | 0:d75ca4e39672 | 32 | }; |
KISScientific | 0:d75ca4e39672 | 33 | |
KISScientific | 0:d75ca4e39672 | 34 | #ifdef __cplusplus |
KISScientific | 0:d75ca4e39672 | 35 | }; |
KISScientific | 0:d75ca4e39672 | 36 | #endif |
KISScientific | 0:d75ca4e39672 | 37 | |
KISScientific | 0:d75ca4e39672 | 38 | #endif // MBED_CAN_HELPER_H |