at_device_bc28.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. * 2020-02-12 luhuadong first version
  9. * 2022-11-9 wangcheng support bc28 low version firmware
  10. */
  11. #ifndef __AT_DEVICE_BC28_H__
  12. #define __AT_DEVICE_BC28_H__
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. #include <stdlib.h>
  17. #include <at_device.h>
  18. /* The maximum number of sockets supported by the BC28 device */
  19. #define AT_DEVICE_BC28_SOCKETS_NUM 7
  20. #define IP_ADDR_SIZE_MAX 16
  21. #define AT_DEVICE_BC28_MIN_SOCKET BC28_SAMPLE_MIN_SOCKET
  22. #define BC28_AT_CLIENT_BAUD_RATE BC28_SAMPLE_BAUD_RATE
  23. struct at_device_bc28
  24. {
  25. char *device_name;
  26. char *client_name;
  27. int power_pin; /* BC28 has not power_en, it should be reset pin */
  28. int power_status_pin; /* ADC */
  29. size_t recv_bufsz;
  30. struct at_device device;
  31. void *socket_data;
  32. void *user_data;
  33. rt_bool_t power_status;
  34. rt_bool_t sleep_status;
  35. };
  36. #ifdef AT_USING_SOCKET
  37. /* bc28 device socket initialize */
  38. int bc28_socket_init(struct at_device *device);
  39. /* bc28 device class socket register */
  40. int bc28_socket_class_register(struct at_device_class *class);
  41. #endif /* AT_USING_SOCKET */
  42. #ifdef __cplusplus
  43. }
  44. #endif
  45. #endif /* __AT_DEVICE_BC28_H__ */