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