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