HL-PDJ-1/app/Inc/drv_saadc.h
xiaozhengsheng 6df0f7d96e 初始版本
2025-08-19 09:49:41 +08:00

46 lines
1.5 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/********************************************************************
Copyright (c) 2021 Xiangyu Medical Co.Ltd. All rights reserved.
FileName : drv_saadc.h
Author : zhangdawei
Version : V1.0
Date :
Note :
History :
********************************************************************/
/* Includes ------------------------------------------------------*/
#ifndef DRV_SAADC_H__
#define DRV_SAADC_H__
#include "nrf_drv_timer.h"
#include "nrf_drv_saadc.h"
#include "IoControl.h"
/* Public define -------------------------------------------------*/
#define SAADC_BATTERY_CHANNEL 1 // 电池电压检测通道
#define SAADC_ELECTRODE_CHANNEL 2 // 电极片脱落电压
#define SAADC_RMS_SAMPLE_CHANNEL 0 // 肌电采样通道
#define AD_RAW_MAX 50
/* Public typedef ------------------------------------------------*/
typedef struct
{
//float AdRaw[AD_RAW_MAX+50];//原始值数组
float EmgValue;//计算值
unsigned char emgCnt;
}emg_data_t;
/* Public constants ----------------------------------------------*/
/* Public variables ----------------------------------------------*/
extern uint8_t Battery_Percentage;
/* Public function prototypes ------------------------------------*/
void battery_adc_init(void);
void timer1_output_ctrl_init(void);
void rms_saadc_init(void);
void PPIEegAdcInit(void);
void timer3_rms_init(void);
void timer3_rms_stop(void);
void timer3_rms_start(void);
void CalculateBatteryPower(void);
#endif
/*************************** END OF FILE ***************************/