RTEMS 7.0-rc1
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
15/*
16 * Copyright (C) 2023-2024 Michal Lenc <michallenc@seznam.cz>
17 * Copyright (C) 2002-2009 DCE FEE CTU Prague
18 * Copyright (C) 2002-2024 Pavel Pisa <pisa@cmp.felk.cvut.cz>
19 * Copyright (C) 2005 Stanislav Marek
20 *
21 * Redistribution and use in source and binary forms, with or without
22 * modification, are permitted provided that the following conditions
23 * are met:
24 * 1. Redistributions of source code must retain the above copyright
25 * notice, this list of conditions and the following disclaimer.
26 * 2. Redistributions in binary form must reproduce the above copyright
27 * notice, this list of conditions and the following disclaimer in the
28 * documentation and/or other materials provided with the distribution.
29 *
30 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
31 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
34 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
35 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
36 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
37 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
38 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
39 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
40 * POSSIBILITY OF SUCH DAMAGE.
41 */
42
43#ifndef _DEV_CAN_CAN_BITTIMING_H
44#define _DEV_CAN_CAN_BITTIMING_H
45
55#define RTEMS_CAN_BITTIME_NOMINAL ( 0 )
59#define RTEMS_CAN_BITTIME_DATA ( 1 )
60
72#define RTEMS_CAN_BITTIME_FROM_BITRATE ( 0 )
76#define RTEMS_CAN_BITTIME_FROM_PRECOMPUTED ( 1 )
77
90 const char *name;
94 uint32_t tseg1_min;
98 uint32_t tseg1_max;
102 uint32_t tseg2_min;
106 uint32_t tseg2_max;
110 uint32_t sjw_max;
114 uint32_t brp_min;
118 uint32_t brp_max;
122 uint32_t brp_inc;
123};
124
134 uint32_t bitrate;
138 uint32_t sample_point;
142 uint32_t tq;
146 uint32_t prop_seg;
150 uint32_t phase_seg1;
154 uint32_t phase_seg2;
158 uint32_t sjw;
162 uint32_t brp;
163};
164
175 uint16_t type;
181 uint16_t from;
187};
188
199 uint16_t type;
210};
211
212#endif /* _DEV_CAN_CAN_BITTIMING_H */
This structure is used to represent CAN bit timing constants.
Definition: can-bittiming.h:86
uint32_t tseg2_max
This member holds maximal possible TSEG2 value.
Definition: can-bittiming.h:106
uint32_t tseg2_min
This member holds mimimal possible TSEG2 value.
Definition: can-bittiming.h:102
uint32_t sjw_max
This member holds maximal possible Sync Jump Width value.
Definition: can-bittiming.h:110
uint32_t brp_min
This member holds mimimal possible Bit Rate Prescaler value.
Definition: can-bittiming.h:114
uint32_t brp_max
This member holds maximal possible Bit Rate Prescaler value.
Definition: can-bittiming.h:118
const char * name
This member holds the controller's name.
Definition: can-bittiming.h:90
uint32_t brp_inc
This member holds Bit Rate Prescaler initial value.
Definition: can-bittiming.h:122
uint32_t tseg1_min
This member holds mimimal possible TSEG1 value.
Definition: can-bittiming.h:94
uint32_t tseg1_max
This member holds maximal possible TSEG1 value.
Definition: can-bittiming.h:98
This structure is used to represent CAN bit timing.
Definition: can-bittiming.h:130
uint32_t sjw
This member holds Sync Jump Width value.
Definition: can-bittiming.h:158
uint32_t sample_point
This member holds CAN sample point.
Definition: can-bittiming.h:138
uint32_t tq
This member holds time quantum value.
Definition: can-bittiming.h:142
uint32_t phase_seg1
This member holds phase segment 1.
Definition: can-bittiming.h:150
uint32_t brp
This member holds Bit Rate Prescaler value.
Definition: can-bittiming.h:162
uint32_t prop_seg
This member holds propagation segment.
Definition: can-bittiming.h:146
uint32_t phase_seg2
This member holds phase segment 2.
Definition: can-bittiming.h:154
uint32_t bitrate
This member holds CAN bitrate.
Definition: can-bittiming.h:134
This structure is used to get CAN bit timing values via IOCTL call.
Definition: can-bittiming.h:193
uint16_t type
This member specifies which bittiming is to be set (nominal, data) RTEMS_CAN_BITTIME_NOMINAL - nomina...
Definition: can-bittiming.h:199
struct rtems_can_bittiming bittiming
This member holds the rtems_can_bittiming structure. This represents currently set values.
Definition: can-bittiming.h:204
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:209
This structure is used to set CAN bit timing values via IOCTL call.
Definition: can-bittiming.h:169
uint16_t from
This member specifies the source of bit timing constants RTEMS_CAN_BITTIME_FROM_BITRATE - calculate f...
Definition: can-bittiming.h:181
uint16_t type
This member specifies which bittiming is to be set (nominal, data) RTEMS_CAN_BITTIME_NOMINAL - nomina...
Definition: can-bittiming.h:175
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:186