MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_device_control

Function rt_device_control

components/drivers/core/device.c:419–432  ·  view source on GitHub ↗

* @brief This function will perform a variety of control functions on devices. * * @param dev is the pointer of device driver structure. * * @param cmd is the command sent to device. * * @param arg is the argument of command. * * @return the result, -RT_ENOSYS for failed. */

Source from the content-addressed store, hash-verified

417 * @return the result, -RT_ENOSYS for failed.
418 */
419rt_err_t rt_device_control(rt_device_t dev, int cmd, void *arg)
420{
421 /* parameter check */
422 RT_ASSERT(dev != RT_NULL);
423 RT_ASSERT(rt_object_get_type(&dev->parent) == RT_Object_Class_Device);
424
425 /* call device_write interface */
426 if (device_control != RT_NULL)
427 {
428 return device_control(dev, cmd, arg);
429 }
430
431 return -RT_ENOSYS;
432}
433RTM_EXPORT(rt_device_control);
434
435/**

Callers 15

_function_enableFunction · 0.85
speaker_entryFunction · 0.85
mic_entryFunction · 0.85
sys_device_controlFunction · 0.85
fb_controlFunction · 0.85
fb_initFunction · 0.85
serial_fops_ioctlFunction · 0.85
serial_fops_ioctlFunction · 0.85
serial_fops_readFunction · 0.85
serial_fops_writeFunction · 0.85
serial_fops_flushFunction · 0.85
_restore_serialFunction · 0.85

Calls 1

rt_object_get_typeFunction · 0.85

Tested by 15

test_itemFunction · 0.68
test_itemFunction · 0.68
test_itemFunction · 0.68
test_itemFunction · 0.68
drawareaFunction · 0.68
showcolorFunction · 0.68
uart_tx_demoFunction · 0.68
uart_rx_demoFunction · 0.68
test_ts_controlFunction · 0.68
test_rtc_alarmFunction · 0.68
test_hwtimerFunction · 0.68
idle_hookFunction · 0.68