This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 3382752b40cc6ff56dcbc8a3c33f973557b50c6a
Author: zhaohaiyang1 <[email protected]>
AuthorDate: Thu Jun 20 14:11:02 2024 +0800

    nuttx/can: add can controller state setting and getting in uppercan.
    
    add can controller state setting and getting in uppercan.
    
    Signed-off-by: zhaohaiyang1 <[email protected]>
---
 include/nuttx/can/can.h | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/include/nuttx/can/can.h b/include/nuttx/can/can.h
index 9ded0040f9..ae007d16a3 100644
--- a/include/nuttx/can/can.h
+++ b/include/nuttx/can/can.h
@@ -257,6 +257,26 @@
  *                   is returned with the errno variable set to indicate the
  *                   nature of the error.
  *   Dependencies:   None
+ *
+ * CANIOC_SET_STATE
+ *   Description:    Set specfic can controller state
+ *
+ *   Argument:       A pointer to an enumeration type that describes the CAN
+ *                   state
+ *   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_GET_STATE
+ *   Description:    Get specfic can controller state
+ *
+ *   Argument:       A pointer to an enumeration type that describes the CAN
+ *                   state
+ *   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)
@@ -274,6 +294,8 @@
 #define CANIOC_IFLUSH             _CANIOC(13)
 #define CANIOC_OFLUSH             _CANIOC(14)
 #define CANIOC_IOFLUSH            _CANIOC(15)
+#define CANIOC_SET_STATE          _CANIOC(16)
+#define CANIOC_GET_STATE          _CANIOC(17)
 
 #define CAN_FIRST                 0x0001         /* First common command */
 #define CAN_NCMDS                 15             /* 16 common commands   */
@@ -449,6 +471,14 @@
 #define CAN_FILTER_DUAL           1  /* Dual address match */
 #define CAN_FILTER_RANGE          2  /* Match a range of addresses */
 
+/* the state is default state. Indicates that the can controller is closed */
+
+#define CAN_STATE_STOP            0
+
+/* Indicates that the can controller is in the awake state */
+
+#define CAN_STATE_START           1
+
 /* CAN bit timing support ***************************************************/
 
 #define CAN_BITTIMING_NOMINAL     0  /* Specifies nominal bittiming */

Reply via email to