Backup 1

Committer:
borlanic
Date:
Tue Apr 24 11:45:18 2018 +0000
Revision:
0:02dd72d1d465
BaBoRo_test2 - backup 1

Who changed what in which revision?

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