Initial commit
mbed-dev-master/hal/can_helper.h@0:bb348c97df44, 2020-09-16 (annotated)
- Committer:
- lypinator
- Date:
- Wed Sep 16 01:11:49 2020 +0000
- Revision:
- 0:bb348c97df44
Added PWM
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lypinator | 0:bb348c97df44 | 1 | |
lypinator | 0:bb348c97df44 | 2 | /** \addtogroup hal */ |
lypinator | 0:bb348c97df44 | 3 | /** @{*/ |
lypinator | 0:bb348c97df44 | 4 | /* mbed Microcontroller Library |
lypinator | 0:bb348c97df44 | 5 | * Copyright (c) 2006-2013 ARM Limited |
lypinator | 0:bb348c97df44 | 6 | * |
lypinator | 0:bb348c97df44 | 7 | * Licensed under the Apache License, Version 2.0 (the "License"); |
lypinator | 0:bb348c97df44 | 8 | * you may not use this file except in compliance with the License. |
lypinator | 0:bb348c97df44 | 9 | * You may obtain a copy of the License at |
lypinator | 0:bb348c97df44 | 10 | * |
lypinator | 0:bb348c97df44 | 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
lypinator | 0:bb348c97df44 | 12 | * |
lypinator | 0:bb348c97df44 | 13 | * Unless required by applicable law or agreed to in writing, software |
lypinator | 0:bb348c97df44 | 14 | * distributed under the License is distributed on an "AS IS" BASIS, |
lypinator | 0:bb348c97df44 | 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
lypinator | 0:bb348c97df44 | 16 | * See the License for the specific language governing permissions and |
lypinator | 0:bb348c97df44 | 17 | * limitations under the License. |
lypinator | 0:bb348c97df44 | 18 | */ |
lypinator | 0:bb348c97df44 | 19 | #ifndef MBED_CAN_HELPER_H |
lypinator | 0:bb348c97df44 | 20 | #define MBED_CAN_HELPER_H |
lypinator | 0:bb348c97df44 | 21 | |
lypinator | 0:bb348c97df44 | 22 | #if DEVICE_CAN |
lypinator | 0:bb348c97df44 | 23 | |
lypinator | 0:bb348c97df44 | 24 | #ifdef __cplusplus |
lypinator | 0:bb348c97df44 | 25 | extern "C" { |
lypinator | 0:bb348c97df44 | 26 | #endif |
lypinator | 0:bb348c97df44 | 27 | |
lypinator | 0:bb348c97df44 | 28 | /** |
lypinator | 0:bb348c97df44 | 29 | * |
lypinator | 0:bb348c97df44 | 30 | * \enum CANFormat |
lypinator | 0:bb348c97df44 | 31 | * |
lypinator | 0:bb348c97df44 | 32 | * \brief Values that represent CAN Format |
lypinator | 0:bb348c97df44 | 33 | **/ |
lypinator | 0:bb348c97df44 | 34 | enum CANFormat { |
lypinator | 0:bb348c97df44 | 35 | CANStandard = 0, |
lypinator | 0:bb348c97df44 | 36 | CANExtended = 1, |
lypinator | 0:bb348c97df44 | 37 | CANAny = 2 |
lypinator | 0:bb348c97df44 | 38 | }; |
lypinator | 0:bb348c97df44 | 39 | typedef enum CANFormat CANFormat; |
lypinator | 0:bb348c97df44 | 40 | |
lypinator | 0:bb348c97df44 | 41 | /** |
lypinator | 0:bb348c97df44 | 42 | * |
lypinator | 0:bb348c97df44 | 43 | * \enum CANType |
lypinator | 0:bb348c97df44 | 44 | * |
lypinator | 0:bb348c97df44 | 45 | * \brief Values that represent CAN Type |
lypinator | 0:bb348c97df44 | 46 | **/ |
lypinator | 0:bb348c97df44 | 47 | enum CANType { |
lypinator | 0:bb348c97df44 | 48 | CANData = 0, |
lypinator | 0:bb348c97df44 | 49 | CANRemote = 1 |
lypinator | 0:bb348c97df44 | 50 | }; |
lypinator | 0:bb348c97df44 | 51 | typedef enum CANType CANType; |
lypinator | 0:bb348c97df44 | 52 | |
lypinator | 0:bb348c97df44 | 53 | /** |
lypinator | 0:bb348c97df44 | 54 | * |
lypinator | 0:bb348c97df44 | 55 | * \struct CAN_Message |
lypinator | 0:bb348c97df44 | 56 | * |
lypinator | 0:bb348c97df44 | 57 | * \brief Holder for single CAN message. |
lypinator | 0:bb348c97df44 | 58 | * |
lypinator | 0:bb348c97df44 | 59 | **/ |
lypinator | 0:bb348c97df44 | 60 | struct CAN_Message { |
lypinator | 0:bb348c97df44 | 61 | unsigned int id; // 29 bit identifier |
lypinator | 0:bb348c97df44 | 62 | unsigned char data[8]; // Data field |
lypinator | 0:bb348c97df44 | 63 | unsigned char len; // Length of data field in bytes |
lypinator | 0:bb348c97df44 | 64 | CANFormat format; // Format ::CANFormat |
lypinator | 0:bb348c97df44 | 65 | CANType type; // Type ::CANType |
lypinator | 0:bb348c97df44 | 66 | }; |
lypinator | 0:bb348c97df44 | 67 | typedef struct CAN_Message CAN_Message; |
lypinator | 0:bb348c97df44 | 68 | |
lypinator | 0:bb348c97df44 | 69 | #ifdef __cplusplus |
lypinator | 0:bb348c97df44 | 70 | }; |
lypinator | 0:bb348c97df44 | 71 | #endif |
lypinator | 0:bb348c97df44 | 72 | |
lypinator | 0:bb348c97df44 | 73 | #endif |
lypinator | 0:bb348c97df44 | 74 | |
lypinator | 0:bb348c97df44 | 75 | #endif // MBED_CAN_HELPER_H |
lypinator | 0:bb348c97df44 | 76 | |
lypinator | 0:bb348c97df44 | 77 | /** @}*/ |