SDCard version
Fork of gr-peach-opencv-project-sd-card by
hal/can_helper.h@167:2ee3e82cb6f5, 2017-07-21 (annotated)
- Committer:
- thedo
- Date:
- Fri Jul 21 01:26:54 2017 +0000
- Revision:
- 167:2ee3e82cb6f5
gr-peach-opencv-project-sd-card
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
thedo | 167:2ee3e82cb6f5 | 1 | |
thedo | 167:2ee3e82cb6f5 | 2 | /** \addtogroup hal */ |
thedo | 167:2ee3e82cb6f5 | 3 | /** @{*/ |
thedo | 167:2ee3e82cb6f5 | 4 | /* mbed Microcontroller Library |
thedo | 167:2ee3e82cb6f5 | 5 | * Copyright (c) 2006-2013 ARM Limited |
thedo | 167:2ee3e82cb6f5 | 6 | * |
thedo | 167:2ee3e82cb6f5 | 7 | * Licensed under the Apache License, Version 2.0 (the "License"); |
thedo | 167:2ee3e82cb6f5 | 8 | * you may not use this file except in compliance with the License. |
thedo | 167:2ee3e82cb6f5 | 9 | * You may obtain a copy of the License at |
thedo | 167:2ee3e82cb6f5 | 10 | * |
thedo | 167:2ee3e82cb6f5 | 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
thedo | 167:2ee3e82cb6f5 | 12 | * |
thedo | 167:2ee3e82cb6f5 | 13 | * Unless required by applicable law or agreed to in writing, software |
thedo | 167:2ee3e82cb6f5 | 14 | * distributed under the License is distributed on an "AS IS" BASIS, |
thedo | 167:2ee3e82cb6f5 | 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
thedo | 167:2ee3e82cb6f5 | 16 | * See the License for the specific language governing permissions and |
thedo | 167:2ee3e82cb6f5 | 17 | * limitations under the License. |
thedo | 167:2ee3e82cb6f5 | 18 | */ |
thedo | 167:2ee3e82cb6f5 | 19 | #ifndef MBED_CAN_HELPER_H |
thedo | 167:2ee3e82cb6f5 | 20 | #define MBED_CAN_HELPER_H |
thedo | 167:2ee3e82cb6f5 | 21 | |
thedo | 167:2ee3e82cb6f5 | 22 | #if DEVICE_CAN |
thedo | 167:2ee3e82cb6f5 | 23 | |
thedo | 167:2ee3e82cb6f5 | 24 | #ifdef __cplusplus |
thedo | 167:2ee3e82cb6f5 | 25 | extern "C" { |
thedo | 167:2ee3e82cb6f5 | 26 | #endif |
thedo | 167:2ee3e82cb6f5 | 27 | |
thedo | 167:2ee3e82cb6f5 | 28 | enum CANFormat { |
thedo | 167:2ee3e82cb6f5 | 29 | CANStandard = 0, |
thedo | 167:2ee3e82cb6f5 | 30 | CANExtended = 1, |
thedo | 167:2ee3e82cb6f5 | 31 | CANAny = 2 |
thedo | 167:2ee3e82cb6f5 | 32 | }; |
thedo | 167:2ee3e82cb6f5 | 33 | typedef enum CANFormat CANFormat; |
thedo | 167:2ee3e82cb6f5 | 34 | |
thedo | 167:2ee3e82cb6f5 | 35 | enum CANType { |
thedo | 167:2ee3e82cb6f5 | 36 | CANData = 0, |
thedo | 167:2ee3e82cb6f5 | 37 | CANRemote = 1 |
thedo | 167:2ee3e82cb6f5 | 38 | }; |
thedo | 167:2ee3e82cb6f5 | 39 | typedef enum CANType CANType; |
thedo | 167:2ee3e82cb6f5 | 40 | |
thedo | 167:2ee3e82cb6f5 | 41 | struct CAN_Message { |
thedo | 167:2ee3e82cb6f5 | 42 | unsigned int id; // 29 bit identifier |
thedo | 167:2ee3e82cb6f5 | 43 | unsigned char data[8]; // Data field |
thedo | 167:2ee3e82cb6f5 | 44 | unsigned char len; // Length of data field in bytes |
thedo | 167:2ee3e82cb6f5 | 45 | CANFormat format; // 0 - STANDARD, 1- EXTENDED IDENTIFIER |
thedo | 167:2ee3e82cb6f5 | 46 | CANType type; // 0 - DATA FRAME, 1 - REMOTE FRAME |
thedo | 167:2ee3e82cb6f5 | 47 | }; |
thedo | 167:2ee3e82cb6f5 | 48 | typedef struct CAN_Message CAN_Message; |
thedo | 167:2ee3e82cb6f5 | 49 | |
thedo | 167:2ee3e82cb6f5 | 50 | #ifdef __cplusplus |
thedo | 167:2ee3e82cb6f5 | 51 | }; |
thedo | 167:2ee3e82cb6f5 | 52 | #endif |
thedo | 167:2ee3e82cb6f5 | 53 | |
thedo | 167:2ee3e82cb6f5 | 54 | #endif |
thedo | 167:2ee3e82cb6f5 | 55 | |
thedo | 167:2ee3e82cb6f5 | 56 | #endif // MBED_CAN_HELPER_H |
thedo | 167:2ee3e82cb6f5 | 57 | |
thedo | 167:2ee3e82cb6f5 | 58 | /** @}*/ |
thedo | 167:2ee3e82cb6f5 | 59 |