at_sample_ec200x.c 991 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. * 2019-12-13 qiyongzhong first version
  9. */
  10. #include <at_device_ec200x.h>
  11. #define LOG_TAG "at.sample.ec200x"
  12. #include <at_log.h>
  13. #define EC200X_SAMPLE_DEIVCE_NAME "ec200x"
  14. static struct at_device_ec200x _dev =
  15. {
  16. EC200X_SAMPLE_DEIVCE_NAME,
  17. EC200X_SAMPLE_CLIENT_NAME,
  18. EC200X_SAMPLE_POWER_PIN,
  19. EC200X_SAMPLE_STATUS_PIN,
  20. EC200X_SAMPLE_WAKEUP_PIN,
  21. EC200X_SAMPLE_RECV_BUFF_LEN,
  22. };
  23. static int ec200x_device_register(void)
  24. {
  25. struct at_device_ec200x *ec200x = &_dev;
  26. return at_device_register(&(ec200x->device),
  27. ec200x->device_name,
  28. ec200x->client_name,
  29. AT_DEVICE_CLASS_EC200X,
  30. (void *) ec200x);
  31. }
  32. INIT_APP_EXPORT(ec200x_device_register);