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
964 B
54 lines
964 B
#pragma once
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
#include "znordic.h"
|
|
typedef struct {
|
|
/**
|
|
* @brief
|
|
*
|
|
* loffstate:[4:0] RLD_STAT IN2N_OFF IN2P_OFF IN1N_OFF IN1P_OFF
|
|
* ch1data: 有符号数据
|
|
* ch2data: 有符号数据
|
|
*/
|
|
|
|
uint8_t loffstate;
|
|
|
|
uint8_t gpio0;
|
|
uint8_t gpio1;
|
|
|
|
uint32_t ch1data;
|
|
uint32_t ch2data;
|
|
} ads129x_capture_data_t;
|
|
|
|
typedef struct {
|
|
nrf_drv_spi_t* spi;
|
|
uint32_t cspin;
|
|
uint32_t startpin;
|
|
uint32_t drdypin;
|
|
uint32_t pwdnpin;
|
|
} ads129x_cfg_t;
|
|
|
|
/**
|
|
* @brief 初始化SPI
|
|
*/
|
|
uint8_t ads129x_init(ads129x_cfg_t* cfg);
|
|
|
|
// uint8_t ads129x_start_capture(bool test);
|
|
uint8_t ads129x_stop_capture();
|
|
uint8_t ads129x_start_capture();
|
|
|
|
void ads129x_write_reg(uint8_t addr, uint8_t val);
|
|
uint8_t ads129x_read_reg(uint8_t addr);
|
|
|
|
void ads129x_read_data(ads129x_capture_data_t* rddata);
|
|
|
|
uint8_t ads129x_get_lead_off_state();
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|