summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2017-12-24 00:00:18 +0800
committerBernard Xiong <[email protected]>2017-12-24 00:06:29 +0800
commit8ff8436fcde1d525cea6719b1f16cd29bc22c617 (patch)
tree78879b3c213f889ad659e9f97caeb9e462698c21 /include
parente1da54e513f973c6073eef5f076e589b679b0736 (diff)
[Kernel] Add device_create/destroy api
Diffstat (limited to 'include')
-rw-r--r--include/rtdef.h18
-rw-r--r--include/rtthread.h4
2 files changed, 4 insertions, 18 deletions
diff --git a/include/rtdef.h b/include/rtdef.h
index 52cc60f553..dd6f93a7f0 100644
--- a/include/rtdef.h
+++ b/include/rtdef.h
@@ -359,34 +359,16 @@ typedef struct rt_object *rt_object_t; /**< Type for kernel obj
enum rt_object_class_type
{
RT_Object_Class_Thread = 0, /**< The object is a thread. */
-#ifdef RT_USING_SEMAPHORE
RT_Object_Class_Semaphore, /**< The object is a semaphore. */
-#endif
-#ifdef RT_USING_MUTEX
RT_Object_Class_Mutex, /**< The object is a mutex. */
-#endif
-#ifdef RT_USING_EVENT
RT_Object_Class_Event, /**< The object is a event. */
-#endif
-#ifdef RT_USING_MAILBOX
RT_Object_Class_MailBox, /**< The object is a mail box. */
-#endif
-#ifdef RT_USING_MESSAGEQUEUE
RT_Object_Class_MessageQueue, /**< The object is a message queue. */
-#endif
-#ifdef RT_USING_MEMHEAP
RT_Object_Class_MemHeap, /**< The object is a memory heap */
-#endif
-#ifdef RT_USING_MEMPOOL
RT_Object_Class_MemPool, /**< The object is a memory pool. */
-#endif
-#ifdef RT_USING_DEVICE
RT_Object_Class_Device, /**< The object is a device */
-#endif
RT_Object_Class_Timer, /**< The object is a timer. */
-#ifdef RT_USING_MODULE
RT_Object_Class_Module, /**< The object is a module. */
-#endif
RT_Object_Class_Unknown, /**< The object is unknown. */
RT_Object_Class_Static = 0x80 /**< The object is a static object. */
};
diff --git a/include/rtthread.h b/include/rtthread.h
index f0f3303778..61cd82d97e 100644
--- a/include/rtthread.h
+++ b/include/rtthread.h
@@ -409,6 +409,10 @@ rt_err_t rt_device_register(rt_device_t dev,
const char *name,
rt_uint16_t flags);
rt_err_t rt_device_unregister(rt_device_t dev);
+
+rt_device_t rt_device_create(int type, int attach_size);
+void rt_device_destroy(rt_device_t device);
+
rt_err_t rt_device_init_all(void);
rt_err_t