d95cce5cf2
CS 引脚加内部上拉防止干扰误触发;新增 ads1256_recover() 在检测到 寄存器被改写时重写关键配置并验证恢复。
16 lines
443 B
C
16 lines
443 B
C
#pragma once
|
|
#include <stdint.h>
|
|
|
|
/* sensor.c 切换通道时需要此寄存器地址 */
|
|
#define ADS1256_REG_MUX 0x01
|
|
|
|
int ads1256_init(void);
|
|
int ads1256_wait_drdy(uint16_t timeout_ms);
|
|
void ads1256_write_reg(uint8_t reg, uint8_t val);
|
|
uint8_t ads1256_read_reg(uint8_t reg);
|
|
void ads1256_sync_wakeup(void);
|
|
int ads1256_hwreset(void);
|
|
int32_t ads1256_read_data(void);
|
|
void ads1256_write_cmd(uint8_t cmd);
|
|
int ads1256_recover(int max_retries);
|