-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] DM Device IDA management #9534
Comments
Update IDs: #define MASTER_ID_CUSTOM 0
/* Block */
#define MASTER_ID_NVME 1
#define MASTER_ID_SCSI_SD 2
#define MASTER_ID_SCSI_CDROM 3
#define MASTER_ID_SDIO 4
#define MASTER_ID_VIRTUAL_BLOCK 5
/* Char */
#define MASTER_ID_RPMSG_EPT 11
#define MASTER_ID_RPMSG_CHAR 12
#define MASTER_ID_SERIAL 13
/* Clock Timer */
#define MASTER_ID_HWTIMER 21
#define MASTER_ID_PTP 22
#define MASTER_ID_RTC 23
/* Graphic Display */
#define MASTER_ID_GRAPHIC_BACKLIGHT 31
#define MASTER_ID_GRAPHIC_FRAMEBUFFER 32
#define MASTER_ID_LED 33
/* Hardware Monitor */
#define MASTER_ID_DVFS 41
#define MASTER_ID_SENSOR 42
#define MASTER_ID_THERMAL 43
#define MASTER_ID_WATCHDOG 44
/* I2C */
#define MASTER_ID_I2C_BUS 51
#define MASTER_ID_I2C_DEV 52
/* IO Contorl */
#define MASTER_ID_ADC 61
#define MASTER_ID_DAC 62
#define MASTER_ID_PIN 63
#define MASTER_ID_PWM 64
/* Memory */
#define MASTER_ID_MEM 71
#define MASTER_ID_MTD 72
/* MISC */
#define MASTER_ID_MISC 81
/* Multimedia */
#define MASTER_ID_AUDIO 91
/* Net */
#define MASTER_ID_CAN 101
#define MASTER_ID_ETH 102
#define MASTER_ID_PHY 103
#define MASTER_ID_WLAN 104
/* Input */
#define MASTER_ID_INPUT 111
#define MASTER_ID_TOUCH 112
/* Security */
#define MASTER_ID_HWCRYPTO 121
#define MASTER_ID_RNG 122
#define MASTER_ID_TEE 123
/* SPI */
#define MASTER_ID_SPI_BUS 131
#define MASTER_ID_SPI_DEV 132
/* TTY */
#define MASTER_ID_TTY 141
#define MASTER_ID_TTY_SLAVES 142
#define MASTER_ID_TTY_ALTERNATE 143
#define MASTER_ID_PTMX 144
/* USB */
#define MASTER_ID_USB_DEV 151
#define MASTER_ID_USB_BUS 152
#define MASTER_ID_USB_OTG 153 |
话说是不是也可以把通过设备号实现的 device_find 功能加上呢? |
可以的,对于应用来说,可以根据设备号直接查找自己想要的设备,而不需要在乎平台给设备的命名或分类如何很有必要: /**
* @brief This function will return the specified master id and device id of device.
*
* @param master_id is the master id (0, 255] of device
*
* @param device_id is the device id [-1, 255] of device, when device_id is -1, the function will end when find the first device.
*
* @return the device object or RT_NULL
*/
rt_device_t rt_dm_device_find(int master_id, int device_id); |
GuEe-GUI
added a commit
to GuEe-GUI/rt-thread
that referenced
this issue
Oct 23, 2024
Drivers can manage their own IDs without having to concern themselves with the register/unregister in system Link: RT-Thread#9534 Signed-off-by: GuEe-GUI <[email protected]>
GuEe-GUI
added a commit
to GuEe-GUI/rt-thread
that referenced
this issue
Oct 23, 2024
Drivers can manage their own IDs without having to concern themselves with the register/unregister in system Link: RT-Thread#9534 Signed-off-by: GuEe-GUI <[email protected]>
GuEe-GUI
added a commit
to GuEe-GUI/rt-thread
that referenced
this issue
Oct 23, 2024
Drivers can manage their own IDs without having to concern themselves with the register/unregister in system Link: RT-Thread#9534 Signed-off-by: GuEe-GUI <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe problem solved by the proposed feature
rt_device identity: a master id - device id
There are some IDs:
The IDA management API:
Example:
Drivers can manage their own IDs without having to concern themselves with the register/unregister in system. IDA management API can used to other identity like name:
Describe your preferred solution
No response
Describe possible alternatives
No response
The text was updated successfully, but these errors were encountered: