sick_dt35/User/device/ads8864.h
2025-04-02 16:20:48 +08:00

30 lines
871 B
C

#pragma once
/* Includes ----------------------------------------------------------------- */
#include <stdint.h>
/* Exported constants ------------------------------------------------------- */
/* Exported macro ----------------------------------------------------------- */
/* Exported types ----------------------------------------------------------- */
//近10次ADC数据
typedef struct {
uint16_t adc_data[10]; // ADC 数据
} Ads8864_Raw_t;
// 滤波后的ADC数据
typedef struct {
uint16_t adc_data;
} Ads8864_Filtered_t;
// ADC数据结构体
typedef struct {
Ads8864_Raw_t raw; // 原始数据
Ads8864_Filtered_t filtered; // 滤波后的数据
} Ads8864_t;
extern Ads8864_t ads8864_data; // 声明全局变量
/* Exported functions prototypes -------------------------------------------- */
void ads8864_Init(void);
uint16_t Ads8864_Read(void);