at_device_ml307.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Copyright (c) 2006-2023, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2022-12-16 Jonas first version
  9. */
  10. #ifndef __ML307_DEVICE_H__
  11. #define __ML307_DEVICE_H__
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #include <stdlib.h>
  16. #include <at_device.h>
  17. #define ML307_AT_RESP_TIMEOUT RT_TICK_PER_SECOND
  18. /* The maximum number of sockets supported by the ml307 device */
  19. #define AT_DEVICE_ML307_SOCKETS_NUM 6
  20. struct at_device_ml307
  21. {
  22. char *device_name;
  23. char *client_name;
  24. int power_pin;
  25. int power_status_pin;
  26. size_t recv_buff_size;
  27. struct at_device device;
  28. void *user_data;
  29. };
  30. #ifdef AT_USING_SOCKET
  31. /* ml307 device socket initialize */
  32. int ml307_socket_init(struct at_device *device);
  33. /* ml307 device class socket register */
  34. int ml307_socket_class_register(struct at_device_class *class);
  35. #endif /* AT_USING_SOCKET */
  36. #ifdef __cplusplus
  37. }
  38. #endif
  39. #endif /* __AT_DEVICE_ML307_H__*/