初始版本
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
#include "bsp.h"
|
||||
|
||||
#ifndef _CS1237_LEFTLOW_H_
|
||||
#define _CS1237_LEFTLOW_H_
|
||||
|
||||
#define READ_CONFIG_CMD 0x56
|
||||
#define WRITE_CONFIG_CMD 0x65
|
||||
|
||||
#define CONFIG_RST 0x0C
|
||||
|
||||
#define REFO_OFF 0x40
|
||||
#define REFO_ON 0x00
|
||||
|
||||
#define SPEED_SEL_10Hz 0x00
|
||||
#define SPEED_SEL_40Hz 0x10
|
||||
#define SPEED_SEL_640Hz 0x20
|
||||
#define SPEED_SEL6_1280Hz 0x30
|
||||
|
||||
#define PGA_SEL_1 0x00
|
||||
#define PGA_SEL_2 0x04
|
||||
#define PGA_SEL_64 0x08
|
||||
#define PGA_SEL_128 0x0C
|
||||
|
||||
#define CH_SEL_A 0x00
|
||||
//#define CH_SEL_B 0x01
|
||||
#define CH_SEL_TEMP 0x02
|
||||
#define CH_SEL_JUMP 0x03
|
||||
|
||||
/*Definition of conversion time corresponding to repeatability setting*/
|
||||
/*
|
||||
10Hz //建立时间300ms
|
||||
40Hz //建立时间75ms
|
||||
640Hz //建立时间6.25ms
|
||||
1280Hz //建立时间3.125ms
|
||||
*/
|
||||
#define tCon_10Hz 300 /* ms. */
|
||||
#define tCon_40Hz 75 /* ms. */
|
||||
#define tCon_640Hz 7 /* ms. */
|
||||
#define tCon_1280Hz 4 /* ms. */
|
||||
|
||||
#define PORT_A 1 //采集通道A
|
||||
//#define PORT_B 1 //采集通道B
|
||||
#define PORT_TEMP 0 //采集温度
|
||||
#define PORT_JUMP 0 //内短采集
|
||||
#define PACK_NUM 1 //一次采集的数据包数量
|
||||
#define FILTER_NUM 0 //滤波数
|
||||
|
||||
typedef enum{
|
||||
LLCS1237_STATUS_IDLE,
|
||||
LLCS1237_STATUS_START,
|
||||
LLCS1237_STATUS_DELAY,
|
||||
LLCS1237_STATUS_READ,
|
||||
LLCS1237_STATUS_WAIT_READ,
|
||||
LLCS1237_STATUS_CH_SEL,
|
||||
LLCS1237_STATUS_STOP,
|
||||
}LeftLowCS1237Status_m;
|
||||
|
||||
typedef struct{
|
||||
LeftLowCS1237Status_m Status;
|
||||
uint32_t CS1237Delay1mSCnt;
|
||||
|
||||
int32_t AinA_AD;//AINAad数据
|
||||
//int32_t AinB_AD;//AINBad数据
|
||||
int32_t Temp_AD;//温度ad数据
|
||||
int32_t Jump_AD;//内短ad数据
|
||||
}
|
||||
LEFTLOW_CS1237Var_t;
|
||||
|
||||
void LEFTLOW_CS1237_Init(void);
|
||||
void LEFTLOW_CS1237_IrqCallBack(void);
|
||||
void LEFTLOW_CS1237DataLoopCollect(void);
|
||||
void LEFTLOW_CS12371mSRoutine(void);
|
||||
void LEFTLOW_CS1237Start(void);
|
||||
void LEFTLOW_CS1237Stop(void);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user