at_sample_n720.c 1.4 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. * 2019-12-13 qiyongzhong first version
  9. */
  10. #include <at_device_n720.h>
  11. #define LOG_TAG "at.sample.n720"
  12. #include <at_log.h>
  13. #define N720_SAMPLE_DEIVCE_NAME "n720"
  14. #ifndef N720_SAMPLE_CLIENT_NAME
  15. #define N720_SAMPLE_CLIENT_NAME "uart4"
  16. #endif
  17. #ifndef N720_SAMPLE_POWER_PIN
  18. #define N720_SAMPLE_POWER_PIN 23
  19. #endif
  20. #ifndef N720_SAMPLE_STATUS_PIN
  21. #define N720_SAMPLE_STATUS_PIN -1
  22. #endif
  23. #ifndef N720_SAMPLE_WAKEUP_PIN
  24. #define N720_SAMPLE_WAKEUP_PIN -1
  25. #endif
  26. #ifndef N720_SAMPLE_RECV_BUFF_LEN
  27. #define N720_SAMPLE_RECV_BUFF_LEN 512
  28. #endif
  29. static struct at_device_n720 _dev =
  30. {
  31. N720_SAMPLE_DEIVCE_NAME,
  32. N720_SAMPLE_CLIENT_NAME,
  33. N720_SAMPLE_POWER_PIN,
  34. N720_SAMPLE_STATUS_PIN,
  35. N720_SAMPLE_WAKEUP_PIN,
  36. N720_SAMPLE_RECV_BUFF_LEN,
  37. RT_NULL,
  38. };
  39. static int n720_device_register(void)
  40. {
  41. struct at_device_n720 *n720 = &_dev;
  42. return at_device_register(&(n720->device),
  43. n720->device_name,
  44. n720->client_name,
  45. AT_DEVICE_CLASS_N720,
  46. (void *) n720);
  47. }
  48. INIT_APP_EXPORT(n720_device_register);