mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-02-06 00:45:22 +08:00
[device]Detailed classification of devices types (#5769)
This commit is contained in:
@@ -77,7 +77,7 @@ rt_err_t rt_hw_adc_register(rt_adc_device_t device, const char *name, const stru
|
||||
rt_err_t result = RT_EOK;
|
||||
RT_ASSERT(ops != RT_NULL && ops->convert != RT_NULL);
|
||||
|
||||
device->parent.type = RT_Device_Class_Miscellaneous;
|
||||
device->parent.type = RT_Device_Class_ADC;
|
||||
device->parent.rx_indicate = RT_NULL;
|
||||
device->parent.tx_complete = RT_NULL;
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ rt_err_t rt_hw_dac_register(rt_dac_device_t device, const char *name, const stru
|
||||
rt_err_t result = RT_EOK;
|
||||
RT_ASSERT(ops != RT_NULL && ops->convert != RT_NULL);
|
||||
|
||||
device->parent.type = RT_Device_Class_Miscellaneous;
|
||||
device->parent.type = RT_Device_Class_DAC;
|
||||
device->parent.rx_indicate = RT_NULL;
|
||||
device->parent.tx_complete = RT_NULL;
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ const static struct rt_device_ops pin_ops =
|
||||
|
||||
int rt_device_pin_register(const char *name, const struct rt_pin_ops *ops, void *user_data)
|
||||
{
|
||||
_hw_pin.parent.type = RT_Device_Class_Miscellaneous;
|
||||
_hw_pin.parent.type = RT_Device_Class_Pin;
|
||||
_hw_pin.parent.rx_indicate = RT_NULL;
|
||||
_hw_pin.parent.tx_complete = RT_NULL;
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ rt_err_t rt_device_pwm_register(struct rt_device_pwm *device, const char *name,
|
||||
device->parent.control = _pwm_control;
|
||||
#endif /* RT_USING_DEVICE_OPS */
|
||||
|
||||
device->parent.type = RT_Device_Class_Miscellaneous;
|
||||
device->parent.type = RT_Device_Class_PWM;
|
||||
device->ops = ops;
|
||||
device->parent.user_data = (void *)user_data;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user