//ads1298.h
#ifndef __ADS1298_H
#define __ADS1298_H
#include "stm32f10x.h"
#define ADS1298_FRAM 27			//3 + 3*8 = 27接收数据格式 24bit + 24bit * 8
/****************Opcode Command**********************/
//System Commands
#define WAKEUP 0x02
#define STANDBY 0x04
#define RESET 0x06
#define START 0x08
#define STOP 0x0a
//Data Read Commands
#define RDATAC 0x10
#define SDATAC 0x11
#define RDATA 0x12
//Register Read Commands
#define REG_NUM 0x00
#define RREG_Register 0x20
#define WREG_Register 0x40
/******************end oof the file*********************/
#define	PWDN_SET	    GPIOB->BSRR = GPIO_Pin_1       
#define	PWDN_RESET	    GPIOB->BRR  = GPIO_Pin_1        //上电选择， 低有效

#define	IC_SET	        GPIOB->BSRR = GPIO_Pin_0  	   
#define	IC_RESET    	GPIOB->BRR = GPIO_Pin_0         //复位选择， 低有效

#define	START_SET    	GPIOA->BSRR = GPIO_Pin_4        //开始转换， 高有效
#define	START_RESET	    GPIOA->BRR = GPIO_Pin_4 

void ADS1298_Delayms(uint16_t pms);
void ADS1298_TIME_Config(void);
void ADS1298_RESET(void);
void ADS1298_GPIO_Config(void);
void ADS1298_NVIC_Config(void);
void ADS1298_DMA_Config(void);
void ADS1298_MODE_Config(void);
void ADS1298_Init(void);

void ADS1298_RegSet(void);//寄存器配置
void ADS1298_RDATAC_Mode(uint8_t pmode);
void ADS1298_Debug_Reg(uint8_t preg);
void ADS1298_Debug_Sign(void);
#endif
/*********************end of the file**************************/
