at_sample_n720.c 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * File : at_sample_n720.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. * Change Logs:
  21. * Date Author Notes
  22. * 2019-12-13 qiyongzhong first version
  23. */
  24. #include <at_device_n720.h>
  25. #define LOG_TAG "at.sample.n720"
  26. #include <at_log.h>
  27. #define N720_SAMPLE_DEIVCE_NAME "n720"
  28. #ifndef N720_SAMPLE_CLIENT_NAME
  29. #define N720_SAMPLE_CLIENT_NAME "uart4"
  30. #endif
  31. #ifndef N720_SAMPLE_POWER_PIN
  32. #define N720_SAMPLE_POWER_PIN 23
  33. #endif
  34. #ifndef N720_SAMPLE_STATUS_PIN
  35. #define N720_SAMPLE_STATUS_PIN -1
  36. #endif
  37. #ifndef N720_SAMPLE_WAKEUP_PIN
  38. #define N720_SAMPLE_WAKEUP_PIN -1
  39. #endif
  40. #ifndef N720_SAMPLE_RECV_BUFF_LEN
  41. #define N720_SAMPLE_RECV_BUFF_LEN 512
  42. #endif
  43. static struct at_device_n720 _dev =
  44. {
  45. N720_SAMPLE_DEIVCE_NAME,
  46. N720_SAMPLE_CLIENT_NAME,
  47. N720_SAMPLE_POWER_PIN,
  48. N720_SAMPLE_STATUS_PIN,
  49. N720_SAMPLE_WAKEUP_PIN,
  50. N720_SAMPLE_RECV_BUFF_LEN,
  51. RT_NULL,
  52. };
  53. static int n720_device_register(void)
  54. {
  55. struct at_device_n720 *n720 = &_dev;
  56. return at_device_register(&(n720->device),
  57. n720->device_name,
  58. n720->client_name,
  59. AT_DEVICE_CLASS_N720,
  60. (void *) n720);
  61. }
  62. INIT_APP_EXPORT(n720_device_register);