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