mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers can_helper.h Source File

can_helper.h

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