37 lines
855 B
C
37 lines
855 B
C
#ifndef __HP203B_H__
|
|
#define __HP203B_H__
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* Includes ------------------------------------------------------------------*/
|
|
#include "main.h"
|
|
#include "comm_types.h"
|
|
|
|
#define IIC_SDA_PIN GPIO_PIN_4
|
|
#define IIC_SDA_PORT GPIOB
|
|
#define IIC_SCL_PIN GPIO_PIN_7
|
|
#define IIC_SCL_PORT GPIOA
|
|
|
|
#define HP20X_ADDRESSCMD 0x77<<1 //CSB PIN = 0£¬µÍµçƽ
|
|
|
|
#define HP20X_READ_P 0x30 //read_p command
|
|
#define HP20X_READ_A 0x31 //read_a command
|
|
#define HP20X_READ_T 0x32 //read_t command
|
|
#define HP20X_READ_PT 0x10 //read_pt command
|
|
#define HP20X_READ_AT 0x11 //read_at command
|
|
|
|
#define HP20X_CONVERT_OSR1024 0x48
|
|
|
|
void hp203_set_mode();
|
|
float Hp203bReadPressure(void);
|
|
BOOL get_press_data(void);
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif /*__ __HP203B_H__ */
|
|
|