at_device_bc28.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright (c) 2006-2022, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2020-02-12 luhuadong first version
  9. */
  10. #ifndef __AT_DEVICE_BC28_H__
  11. #define __AT_DEVICE_BC28_H__
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #include <stdlib.h>
  16. #include <at_device.h>
  17. /* The maximum number of sockets supported by the BC28 device */
  18. #define AT_DEVICE_BC28_SOCKETS_NUM 7
  19. #define IP_ADDR_SIZE_MAX 16
  20. #define AT_DEVICE_BC28_MIN_SOCKET BC28_SAMPLE_MIN_SOCKET
  21. #define BC28_AT_CLIENT_BAUD_RATE BC28_SAMPLE_BAUD_RATE
  22. struct at_device_bc28
  23. {
  24. char *device_name;
  25. char *client_name;
  26. int power_pin; /* BC28 has not power_en, it should be reset pin */
  27. int power_status_pin; /* ADC */
  28. size_t recv_bufsz;
  29. struct at_device device;
  30. void *socket_data;
  31. void *user_data;
  32. rt_bool_t power_status;
  33. rt_bool_t sleep_status;
  34. };
  35. #ifdef AT_USING_SOCKET
  36. /* bc28 device socket initialize */
  37. int bc28_socket_init(struct at_device *device);
  38. /* bc28 device class socket register */
  39. int bc28_socket_class_register(struct at_device_class *class);
  40. #endif /* AT_USING_SOCKET */
  41. #ifdef __cplusplus
  42. }
  43. #endif
  44. #endif /* __AT_DEVICE_BC28_H__ */