nuttx/can: add can controller state setting and getting in uppercan.

add can controller state setting and getting in uppercan.

Signed-off-by: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
This commit is contained in:
zhaohaiyang1 2024-06-20 14:11:02 +08:00 committed by Lup Yuen Lee
parent ccddaa78c9
commit 2bb4ec0fd2

View File

@ -246,6 +246,26 @@
* 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_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) #define CANIOC_RTR _CANIOC(1)
@ -263,6 +283,8 @@
#define CANIOC_IFLUSH _CANIOC(13) #define CANIOC_IFLUSH _CANIOC(13)
#define CANIOC_OFLUSH _CANIOC(14) #define CANIOC_OFLUSH _CANIOC(14)
#define CANIOC_IOFLUSH _CANIOC(15) #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_FIRST 0x0001 /* First common command */
#define CAN_NCMDS 15 /* 16 common commands */ #define CAN_NCMDS 15 /* 16 common commands */
@ -438,6 +460,14 @@
#define CAN_FILTER_DUAL 1 /* Dual address match */ #define CAN_FILTER_DUAL 1 /* Dual address match */
#define CAN_FILTER_RANGE 2 /* Match a range of addresses */ #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 ***************************************************/ /* CAN bit timing support ***************************************************/
#define CAN_BITTIMING_NOMINAL 0 /* Specifies nominal bittiming */ #define CAN_BITTIMING_NOMINAL 0 /* Specifies nominal bittiming */