You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
956 B

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. #pragma once
  2. #ifdef __cplusplus
  3. extern "C" {
  4. #endif
  5. #include <stdbool.h>
  6. #include <stdint.h>
  7. #include "znordic.h"
  8. typedef struct {
  9. /**
  10. * @brief
  11. *
  12. * loffstate:[4:0] RLD_STAT IN2N_OFF IN2P_OFF IN1N_OFF IN1P_OFF
  13. * ch1data: з
  14. * ch2data: з
  15. */
  16. uint8_t loffstate;
  17. uint8_t gpio0;
  18. uint8_t gpio1;
  19. uint32_t ch1data;
  20. uint32_t ch2data;
  21. } ads129x_capture_data_t;
  22. typedef struct {
  23. nrf_drv_spi_t* spi;
  24. uint32_t cspin;
  25. uint32_t startpin;
  26. uint32_t drdypin;
  27. uint32_t pwdnpin;
  28. } ads129x_cfg_t;
  29. /**
  30. * @brief ʼSPI
  31. */
  32. uint8_t ads129x_init(ads129x_cfg_t* cfg);
  33. uint8_t ads129x_start_capture(bool test);
  34. uint8_t ads129x_stop_capture();
  35. uint8_t ads129x_enter_low_power_mode();
  36. uint8_t ads129x_enter_lead_off_detect_mode();
  37. uint8_t ads129x_data_is_ready();
  38. void ads129x_read_data(ads129x_capture_data_t* rddata);
  39. uint8_t ads129x_get_lead_off_state();
  40. #ifdef __cplusplus
  41. }
  42. #endif