Mbed OS Reference
Loading...
Searching...
No Matches
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 || FEATURE_EXPERIMENTAL_API
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29/**
30 *
31 * \enum CANFormat
32 *
33 * \brief Values that represent CAN Format
34**/
36 CANStandard = 0,
37 CANExtended = 1,
38 CANAny = 2
39};
40typedef enum CANFormat CANFormat;
41
42/**
43 *
44 * \enum CANType
45 *
46 * \brief Values that represent CAN Type
47**/
48enum CANType {
49 CANData = 0,
50 CANRemote = 1
51};
52typedef enum CANType CANType;
53
54/**
55 *
56 * \struct CAN_Message
57 *
58 * \brief Holder for single CAN message.
59 *
60**/
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};
68typedef 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