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

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.