Mouse code for the MacroRat

Dependencies:   ITG3200 QEI

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  *
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 enum CANFormat {
00029     CANStandard = 0,
00030     CANExtended = 1,
00031     CANAny = 2
00032 };
00033 typedef enum CANFormat CANFormat;
00034 
00035 enum CANType {
00036     CANData   = 0,
00037     CANRemote = 1
00038 };
00039 typedef enum CANType CANType;
00040 
00041 struct CAN_Message {
00042     unsigned int   id;                 // 29 bit identifier
00043     unsigned char  data[8];            // Data field
00044     unsigned char  len;                // Length of data field in bytes
00045     CANFormat      format;             // 0 - STANDARD, 1- EXTENDED IDENTIFIER
00046     CANType        type;               // 0 - DATA FRAME, 1 - REMOTE FRAME
00047 };
00048 typedef struct CAN_Message CAN_Message;
00049 
00050 #ifdef __cplusplus
00051 };
00052 #endif
00053 
00054 #endif
00055 
00056 #endif // MBED_CAN_HELPER_H
00057 
00058 /** @}*/