at_sample_m5311.c 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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-03-09 LXGMAX first version
  9. */
  10. #include <at_device_m5311.h>
  11. #define LOG_TAG "at.sample.m5311"
  12. #include <at_log.h>
  13. /* Requirement:
  14. * AT_CMD_MAX_LEN -> 2048
  15. * RT_SERIAL_RB_BUFSZ -> 4096
  16. * M5311_SAMPLE_RECV_BUFF_LEN -> 2048
  17. */
  18. #define M5311_SAMPLE_DEVICE_NAME "m5311"
  19. static struct at_device_m5311 nb_m5311 = {
  20. M5311_SAMPLE_DEVICE_NAME,
  21. M5311_SAMPLE_CLIENT_NAME,
  22. M5311_SAMPLE_POWER_PIN,
  23. M5311_SAMPLE_RECV_BUFF_LEN,
  24. };
  25. static int m5311_device_register(void)
  26. {
  27. struct at_device_m5311 *m5311 = &nb_m5311;
  28. return at_device_register(&(m5311->device),
  29. m5311->device_name,
  30. m5311->client_name,
  31. AT_DEVICE_CLASS_M5311,
  32. (void *) m5311);
  33. }
  34. INIT_APP_EXPORT(m5311_device_register);