2024-07-18 08:31:44 +00:00
|
|
|
|
#ifndef __HP203B_H__
|
|
|
|
|
#define __HP203B_H__
|
2024-07-10 09:19:00 +00:00
|
|
|
|
|
2024-07-18 08:31:44 +00:00
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Includes ------------------------------------------------------------------*/
|
|
|
|
|
#include "main.h"
|
2024-11-09 01:25:43 +00:00
|
|
|
|
#include "comm_types.h"
|
2024-07-18 08:31:44 +00:00
|
|
|
|
|
|
|
|
|
#define IIC_SDA_PIN GPIO_PIN_4
|
|
|
|
|
#define IIC_SDA_PORT GPIOB
|
|
|
|
|
#define IIC_SCL_PIN GPIO_PIN_7
|
|
|
|
|
#define IIC_SCL_PORT GPIOA
|
|
|
|
|
|
2024-07-18 10:15:50 +00:00
|
|
|
|
#define HP20X_ADDRESSCMD 0x77<<1 //CSB PIN = 0<><30><EFBFBD>͵<EFBFBD>ƽ
|
2024-07-10 09:19:00 +00:00
|
|
|
|
|
2024-07-18 08:31:44 +00:00
|
|
|
|
#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
|
2024-07-10 09:19:00 +00:00
|
|
|
|
|
2024-07-18 08:31:44 +00:00
|
|
|
|
#define HP20X_CONVERT_OSR1024 0x48
|
|
|
|
|
|
|
|
|
|
void hp203_set_mode();
|
2024-11-23 04:05:21 +00:00
|
|
|
|
BOOL get_HP203_data(float* tempdata, float* press);
|
2024-07-18 08:31:44 +00:00
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
2024-07-10 09:19:00 +00:00
|
|
|
|
#endif
|
2024-07-18 08:31:44 +00:00
|
|
|
|
#endif /*__ __HP203B_H__ */
|
|
|
|
|
|