at_sample_ml305.c 1.3 KB

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