mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 21:36:28 +08:00
Add some CAN mode IOCTL calls. These will be useful for device autotest when the application boots. They are redundant with the CONFIG_CAN_LOOPBACK option, which can now just be interpreted as a default setting.
This commit is contained in:
committed by
Gregory Nutt
parent
82c890db23
commit
16fe8ba342
+36
-1
@@ -74,6 +74,8 @@
|
|||||||
* CONFIG_CAN_LOOPBACK - A CAN driver may or may not support a loopback
|
* CONFIG_CAN_LOOPBACK - A CAN driver may or may not support a loopback
|
||||||
* mode for testing. If the driver does support loopback mode, the setting
|
* mode for testing. If the driver does support loopback mode, the setting
|
||||||
* will enable it. (If the driver does not, this setting will have no effect).
|
* will enable it. (If the driver does not, this setting will have no effect).
|
||||||
|
* The loopback mode may be changed later by ioctl() if the driver supports the
|
||||||
|
* CANIOC_SET_CONNMODES ioctl command.
|
||||||
* CONFIG_CAN_TXREADY - Add support for the can_txready() callback. This is needed
|
* CONFIG_CAN_TXREADY - Add support for the can_txready() callback. This is needed
|
||||||
* only for CAN hardware the supports an separate H/W TX message FIFO. The call
|
* only for CAN hardware the supports an separate H/W TX message FIFO. The call
|
||||||
* back is needed to keep the S/W FIFO and the H/W FIFO in sync. Work queue
|
* back is needed to keep the S/W FIFO and the H/W FIFO in sync. Work queue
|
||||||
@@ -163,6 +165,24 @@
|
|||||||
* is returned with the errno variable set to indicate the
|
* is returned with the errno variable set to indicate the
|
||||||
* nature of the error.
|
* nature of the error.
|
||||||
* Dependencies: None
|
* Dependencies: None
|
||||||
|
*
|
||||||
|
* CANIOC_GET_CONNMODES:
|
||||||
|
* Description: Get the current bus connection modes
|
||||||
|
* Argument: A pointer to a write-able instance of struct
|
||||||
|
* canioc_connmodes_s in which the new bus modes 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_CONNMODES:
|
||||||
|
* Description: Set new bus connection modes values
|
||||||
|
* Argument: A pointer to a read-able instance of struct
|
||||||
|
* canioc_connmodes_s in which the new bus modes 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_RTR _CANIOC(1)
|
||||||
@@ -172,12 +192,14 @@
|
|||||||
#define CANIOC_ADD_EXTFILTER _CANIOC(5)
|
#define CANIOC_ADD_EXTFILTER _CANIOC(5)
|
||||||
#define CANIOC_DEL_STDFILTER _CANIOC(6)
|
#define CANIOC_DEL_STDFILTER _CANIOC(6)
|
||||||
#define CANIOC_DEL_EXTFILTER _CANIOC(7)
|
#define CANIOC_DEL_EXTFILTER _CANIOC(7)
|
||||||
|
#define CANIOC_GET_CONNMODE _CANIOC(8)
|
||||||
|
#define CANIOC_SET_CONNMODE _CANIOC(9)
|
||||||
|
|
||||||
/* CANIOC_USER: Device specific ioctl calls can be supported with cmds greater
|
/* CANIOC_USER: Device specific ioctl calls can be supported with cmds greater
|
||||||
* than this value
|
* than this value
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define CANIOC_USER _CANIOC(8)
|
#define CANIOC_USER _CANIOC(10)
|
||||||
|
|
||||||
/* Convenience macros ***************************************************************/
|
/* Convenience macros ***************************************************************/
|
||||||
|
|
||||||
@@ -547,6 +569,19 @@ struct canioc_bittiming_s
|
|||||||
uint8_t bt_sjw; /* Synchronization Jump Width in time quanta */
|
uint8_t bt_sjw; /* Synchronization Jump Width in time quanta */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* CANIOC_GET_CONNMODES/CANIOC_SET_CONNMODES: */
|
||||||
|
/* A CAN device may support loopback and silent mode. Both modes may not be
|
||||||
|
* settable independently.
|
||||||
|
*/
|
||||||
|
|
||||||
|
struct canioc_connmodes_s
|
||||||
|
{
|
||||||
|
uint8_t bm_loopback : 1; /* Enable reception of messages sent
|
||||||
|
* by this node.*/
|
||||||
|
uint8_t bm_silent : 1; /* Disable transmission of messages.
|
||||||
|
* The node still receives messages. */
|
||||||
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_CAN_EXTID
|
#ifdef CONFIG_CAN_EXTID
|
||||||
/* CANIOC_ADD_EXTFILTER: */
|
/* CANIOC_ADD_EXTFILTER: */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user