Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NuttX RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
f4grx
NuttX RTOS
Commits
28853e59
Commit
28853e59
authored
9 years ago
by
Gregory Nutt
Browse files
Options
Downloads
Patches
Plain Diff
CAN: Define IOCTL commands to get and set the bit timing values
parent
505d5f81
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
arch
+1
-1
1 addition, 1 deletion
arch
include/nuttx/can.h
+52
-9
52 additions, 9 deletions
include/nuttx/can.h
with
53 additions
and
10 deletions
arch
@
fba93b8a
Subproject commit
c4e2c4ec83f421469a3ef3f355fd56317e0ac595
Subproject commit
fba93b8a0fa0176c2df08835677e6f85adf75f4f
This diff is collapsed.
Click to expand it.
include/nuttx/can.h
+
52
−
9
View file @
28853e59
...
...
@@ -106,7 +106,7 @@
* Returned Value: A non-negative filter ID is returned on success.
* Otherwise -1 (ERROR) is returned with the errno
* variable set to indicate the nature of the error.
* Dependencies:
Requires CONFIG_CAN_EXID *not* defi
ne
d
* Dependencies:
No
ne
*
* CANIOC_ADD_EXTFILTER:
* Description: Add an address filter for a extended 29 bit address.
...
...
@@ -114,7 +114,7 @@
* Returned Value: A non-negative filter ID is returned on success.
* Otherwise -1 (ERROR) is returned with the errno
* variable set to indicate the nature of the error.
* Dependencies: Requires CONFIG_CAN_EXID=y
* Dependencies: Requires CONFIG_CAN_EX
T
ID=y
*
* CANIOC_DEL_STDFILTER:
* Description: Remove an address filter for a standard 11 bit address.
...
...
@@ -123,7 +123,7 @@
* Returned Value: Zero (OK) is returned on success. Otherwise -1 (ERROR)
* is returned with the errno variable set to indicate the
* nature of the error.
* Dependencies:
Requires CONFIG_CAN_EXID *not* defi
ne
d
* Dependencies:
No
ne
*
* CANIOC_DEL_EXTFILTER:
* Description: Remove an address filter for a standard 29 bit address.
...
...
@@ -132,20 +132,42 @@
* Returned Value: Zero (OK) is returned on success. Otherwise -1 (ERROR)
* is returned with the errno variable set to indicate the
* nature of the error.
* Dependencies: Requires CONFIG_CAN_EXID=y
* Dependencies: Requires CONFIG_CAN_EXTID=y
*
* CANIOC_GET_BITTIMING:
* Description: Return the current bit timing settings
* Argument: A pointer to a write-able instance of struct
* canioc_bittiming_s in which current bit timing values
* will be returned.
* Returned Value: Zero (OK) is returned on success. Otherwise -1 (ERROR)
* is returned with the errno variable set to indicate the
* nature of the error.
* Dependencies: None
*
* CANIOC_SET_BITTIMING:
* Description: Set new current bit timing values
* Argument: A pointer to a read-able instance of struct
* canioc_bittiming_s in which the new bit timing values
* are provided.
* Returned Value: Zero (OK) is returned on success. Otherwise -1 (ERROR)
* is returned with the errno variable set to indicate the
* nature of the error.
* Dependencies: None
*/
#define CANIOC_RTR _CANIOC(1)
#define CANIOC_ADD_STDFILTER _CANIOC(2)
#define CANIOC_ADD_EXTFILTER _CANIOC(3)
#define CANIOC_DEL_STDFILTER _CANIOC(4)
#define CANIOC_DEL_EXTFILTER _CANIOC(5)
#define CANIOC_GET_BITTIMING _CANIOC(2)
#define CANIOC_SET_BITTIMING _CANIOC(3)
#define CANIOC_ADD_STDFILTER _CANIOC(4)
#define CANIOC_ADD_EXTFILTER _CANIOC(5)
#define CANIOC_DEL_STDFILTER _CANIOC(6)
#define CANIOC_DEL_EXTFILTER _CANIOC(7)
/* CANIOC_USER: Device specific ioctl calls can be supported with cmds greater
* than this value
*/
#define CANIOC_USER _CANIOC(
6
)
#define CANIOC_USER _CANIOC(
8
)
/* Convenience macros ***************************************************************/
...
...
@@ -390,6 +412,7 @@ struct can_dev_s
};
/* Structures used with ioctl calls */
/* CANIOC_RTR: */
struct
canioc_rtr_s
{
...
...
@@ -397,7 +420,25 @@ struct canioc_rtr_s
FAR
struct
can_msg_s
*
ci_msg
;
/* The location to return the RTR response */
};
/* CANIOC_GET_BITTIMING/CANIOC_SET_BITTIMING: */
/* Bit time = Tquanta * (Sync_Seg + Prop_Seq + Phase_Seg1 + Phase_Seg2)
* = Tquanta * (TSEG1 + TSEG2 + 1)
* Where
* TSEG1 = Prop_Seq + Phase_Seg1
* TSEG2 = Phase_Seg2
*/
struct
canioc_bittiming_s
{
uint32_t
bt_baud
;
/* Bit rate = 1 / bit time */
uint8_t
bt_tseg1
;
/* TSEG1 in time quanta */
uint8_t
bt_tseg2
;
/* TSEG2 in time quanta */
uint8_t
bt_sjw
;
/* Synchronization Jump Width in time quanta */
};
#ifdef CONFIG_CAN_EXTID
/* CANIOC_ADD_EXTFILTER: */
struct
canioc_extfilter_s
{
uint32_t
xf_id1
;
/* 29-bit ID. For dual match or for the
...
...
@@ -409,6 +450,8 @@ struct canioc_extfilter_s
};
#endif
/* CANIOC_ADD_STDFILTER: */
struct
canioc_stdfilter_s
{
uint16_t
sf_id1
;
/* 11-bit ID. For dual match or for the
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment