1
0

rtlink_dev.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2021-06-15 Sherman the first version
  9. */
  10. #include <rtthread.h>
  11. #include <rtlink.h>
  12. #define RT_LINK_RX_NONBLOCKING 0x1000
  13. #define RT_LINK_RX_BLOCKING 0x2000
  14. #define RT_LINK_TX_NONBLOCKING 0x4000
  15. #define RT_LINK_TX_BLOCKING 0x8000
  16. #define RT_LINK_DEVICE_MASK 0xf000
  17. struct rtlink_recv_list
  18. {
  19. void *data;
  20. rt_size_t size;
  21. rt_size_t index;
  22. struct rt_slist_node list;
  23. };
  24. struct rt_link_device
  25. {
  26. struct rt_device parent;
  27. struct rt_link_service service;
  28. struct rt_slist_node recv_head; /* recv data list, struct rtlink_recv_list */
  29. };
  30. /*
  31. * rtlink device register
  32. */
  33. rt_err_t rt_link_dev_register(struct rt_link_device *rtlink,
  34. const char *name,
  35. rt_uint32_t flag,
  36. void *data);