[device]Detailed classification of devices types (#5769)

This commit is contained in:
Tangyuxin
2022-04-06 21:12:39 +08:00
committed by GitHub
parent 782b9dd45a
commit da3d61e043
17 changed files with 88 additions and 75 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;