at_sample_ml305.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. #include <at_device_ml305.h>
  11. #define LOG_TAG "at.sample.ml305"
  12. #include <at_log.h>
  13. #define ML305_SAMPLE_DEIVCE_NAME "ml3050"
  14. #ifndef ML305_SAMPLE_CLIENT_NAME
  15. #define ML305_SAMPLE_CLIENT_NAME "uart3"
  16. #endif
  17. #if !defined (ML305_SAMPLE_POWER_PIN)
  18. #define ML305_SAMPLE_POWER_PIN 0x1C
  19. #endif
  20. #if !defined (ML305_SAMPLE_STATUS_PIN)
  21. #define ML305_SAMPLE_STATUS_PIN 0x1E
  22. #endif
  23. #if !defined (ML305_SAMPLE_RECV_BUFF_LEN)
  24. #define ML305_SAMPLE_RECV_BUFF_LEN 4096
  25. #endif
  26. #if !defined (AT_DEVICE_CLASS_ML305)
  27. #define AT_DEVICE_CLASS_ML305 0xFFFFU
  28. #endif
  29. static struct at_device_ml305 ml3050 =
  30. {
  31. ML305_SAMPLE_DEIVCE_NAME,
  32. ML305_SAMPLE_CLIENT_NAME,
  33. ML305_SAMPLE_POWER_PIN,
  34. ML305_SAMPLE_STATUS_PIN,
  35. ML305_SAMPLE_RECV_BUFF_LEN,
  36. };
  37. static int ml305_device_register(void)
  38. {
  39. struct at_device_ml305 *ml305 = &ml3050;
  40. return at_device_register(&(ml305->device),
  41. ml305->device_name,
  42. ml305->client_name,
  43. AT_DEVICE_CLASS_ML305,
  44. (void *) ml305);
  45. }
  46. INIT_APP_EXPORT(ml305_device_register);