RTEMS CAN/CAN FD Stack
Loading...
Searching...
No Matches
can-bittiming.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0 OR GPL-2.0-or-later */
2
12/*
13 * Copyright (C) 2023-2024 Michal Lenc <michallenc@seznam.cz>
14 * Implementation is based on original LinCAN - Linux CAN bus driver
15 * Part of OrtCAN project https://ortcan.sourceforge.net/
16 * Copyright (C) 2002-2009 DCE FEE CTU Prague <http://control.fel.cvut.cz>
17 * Copyright (C) 2002-2024 Pavel Pisa <pisa@cmp.felk.cvut.cz>
18 * Copyright (C) 2005 Stanislav Marek
19 *
20 * Redistribution and use in source and binary forms, with or without
21 * modification, are permitted provided that the following conditions
22 * are met:
23 * 1. Redistributions of source code must retain the above copyright
24 * notice, this list of conditions and the following disclaimer.
25 * 2. Redistributions in binary form must reproduce the above copyright
26 * notice, this list of conditions and the following disclaimer in the
27 * documentation and/or other materials provided with the distribution.
28 *
29 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
30 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
33 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
34 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
35 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
36 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
37 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
38 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39 * POSSIBILITY OF SUCH DAMAGE.
40 */
41
42#ifndef _DEV_CAN_CAN_BITTIMING_H
43#define _DEV_CAN_CAN_BITTIMING_H
44
54#define RTEMS_CAN_BITTIME_NOMINAL ( 0 )
58#define RTEMS_CAN_BITTIME_DATA ( 1 )
59
71#define RTEMS_CAN_BITTIME_FROM_BITRATE ( 0 )
75#define RTEMS_CAN_BITTIME_FROM_PRECOMPUTED ( 1 )
76
89 const char *name;
93 uint32_t tseg1_min;
97 uint32_t tseg1_max;
101 uint32_t tseg2_min;
105 uint32_t tseg2_max;
109 uint32_t sjw_max;
113 uint32_t brp_min;
117 uint32_t brp_max;
121 uint32_t brp_inc;
122};
123
133 uint32_t bitrate;
137 uint32_t sample_point;
141 uint32_t tq;
145 uint32_t prop_seg;
149 uint32_t phase_seg1;
153 uint32_t phase_seg2;
157 uint32_t sjw;
161 uint32_t brp;
162};
163
174 uint16_t type;
180 uint16_t from;
186};
187
198 uint16_t type;
209};
210
211#endif /* _DEV_CAN_CAN_BITTIMING_H */
This structure is used to represent CAN bit timing constants.
Definition: can-bittiming.h:85
uint32_t tseg2_max
This member holds maximal possible TSEG2 value.
Definition: can-bittiming.h:105
uint32_t tseg2_min
This member holds mimimal possible TSEG2 value.
Definition: can-bittiming.h:101
uint32_t sjw_max
This member holds maximal possible Sync Jump Width value.
Definition: can-bittiming.h:109
uint32_t brp_min
This member holds mimimal possible Bit Rate Prescaler value.
Definition: can-bittiming.h:113
uint32_t brp_max
This member holds maximal possible Bit Rate Prescaler value.
Definition: can-bittiming.h:117
const char * name
This member holds the controller's name.
Definition: can-bittiming.h:89
uint32_t brp_inc
This member holds Bit Rate Prescaler initial value.
Definition: can-bittiming.h:121
uint32_t tseg1_min
This member holds mimimal possible TSEG1 value.
Definition: can-bittiming.h:93
uint32_t tseg1_max
This member holds maximal possible TSEG1 value.
Definition: can-bittiming.h:97
This structure is used to represent CAN bit timing.
Definition: can-bittiming.h:129
uint32_t sjw
This member holds Sync Jump Width value.
Definition: can-bittiming.h:157
uint32_t sample_point
This member holds CAN sample point.
Definition: can-bittiming.h:137
uint32_t tq
This member holds time quantum value.
Definition: can-bittiming.h:141
uint32_t phase_seg1
This member holds phase segment 1.
Definition: can-bittiming.h:149
uint32_t brp
This member holds Bit Rate Prescaler value.
Definition: can-bittiming.h:161
uint32_t prop_seg
This member holds propagation segment.
Definition: can-bittiming.h:145
uint32_t phase_seg2
This member holds phase segment 2.
Definition: can-bittiming.h:153
uint32_t bitrate
This member holds CAN bitrate.
Definition: can-bittiming.h:133
This structure is used to get CAN bit timing values via IOCTL call.
Definition: can-bittiming.h:192
uint16_t type
This member specifies which bittiming is to be set (nominal, data) RTEMS_CAN_BITTIME_NOMINAL - nomina...
Definition: can-bittiming.h:198
struct rtems_can_bittiming bittiming
This member holds the rtems_can_bittiming structure. This represents currently set values.
Definition: can-bittiming.h:203
struct rtems_can_bittiming_const bittiming_const
This member holds the rtems_can_bittiming_const structure. This represents maximum and minimal possib...
Definition: can-bittiming.h:208
This structure is used to set CAN bit timing values via IOCTL call.
Definition: can-bittiming.h:168
uint16_t from
This member specifies the source of bit timing constants RTEMS_CAN_BITTIME_FROM_BITRATE - calculate f...
Definition: can-bittiming.h:180
uint16_t type
This member specifies which bittiming is to be set (nominal, data) RTEMS_CAN_BITTIME_NOMINAL - nomina...
Definition: can-bittiming.h:174
struct rtems_can_bittiming bittiming
This member holds the rtems_can_bittiming structure. This is used to specify bitrate or precomputed v...
Definition: can-bittiming.h:185