forked
Embed:
(wiki syntax)
Show/hide line numbers
can_helper.h
00001 00002 /** \addtogroup hal */ 00003 /** @{*/ 00004 /* mbed Microcontroller Library 00005 * Copyright (c) 2006-2013 ARM Limited 00006 * 00007 * Licensed under the Apache License, Version 2.0 (the "License"); 00008 * you may not use this file except in compliance with the License. 00009 * You may obtain a copy of the License at 00010 * 00011 * http://www.apache.org/licenses/LICENSE-2.0 00012 * 00013 * Unless required by applicable law or agreed to in writing, software 00014 * distributed under the License is distributed on an "AS IS" BASIS, 00015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00016 * See the License for the specific language governing permissions and 00017 * limitations under the License. 00018 */ 00019 #ifndef MBED_CAN_HELPER_H 00020 #define MBED_CAN_HELPER_H 00021 00022 #if DEVICE_CAN 00023 00024 #ifdef __cplusplus 00025 extern "C" { 00026 #endif 00027 00028 /** 00029 * 00030 * \enum CANFormat 00031 * 00032 * \brief Values that represent CAN Format 00033 **/ 00034 enum CANFormat { 00035 CANStandard = 0, 00036 CANExtended = 1, 00037 CANAny = 2 00038 }; 00039 typedef enum CANFormat CANFormat; 00040 00041 /** 00042 * 00043 * \enum CANType 00044 * 00045 * \brief Values that represent CAN Type 00046 **/ 00047 enum CANType { 00048 CANData = 0, 00049 CANRemote = 1 00050 }; 00051 typedef enum CANType CANType; 00052 00053 /** 00054 * 00055 * \struct CAN_Message 00056 * 00057 * \brief Holder for single CAN message. 00058 * 00059 **/ 00060 struct CAN_Message { 00061 unsigned int id; // 29 bit identifier 00062 unsigned char data[8]; // Data field 00063 unsigned char len; // Length of data field in bytes 00064 CANFormat format; // Format ::CANFormat 00065 CANType type; // Type ::CANType 00066 }; 00067 typedef struct CAN_Message CAN_Message; 00068 00069 #ifdef __cplusplus 00070 }; 00071 #endif 00072 00073 #endif 00074 00075 #endif // MBED_CAN_HELPER_H 00076 00077 /** @}*/
Generated on Tue Jul 12 2022 16:02:31 by 1.7.2