33 lines
731 B
C
33 lines
731 B
C
//
|
|
// Created by dell on 24-9-26.
|
|
//
|
|
|
|
#ifndef MLX90614_H
|
|
#define MLX90614_H
|
|
|
|
#include "gd32e23x.h"
|
|
|
|
#define I2C_SPEED 100000
|
|
#define IR_I2C I2C0
|
|
#define RCU_IR_GPIO RCU_GPIOF
|
|
#define RCU_I2C RCU_I2C0
|
|
#define I2C_SCL_PORT GPIOF
|
|
#define I2C_SCL_PIN GPIO_PIN_1
|
|
#define I2C_SDA_PORT GPIOF
|
|
#define I2C_SDA_PIN GPIO_PIN_0
|
|
#define I2C_GPIO_AF GPIO_AF_1
|
|
|
|
#define I2C_TIME_OUT (uint16_t)(5000)
|
|
|
|
#define SLAVE_ADDR (0x5A << 1)
|
|
#define REG_ADDR_OBJ_TEMP 0x07
|
|
#define REG_ADDR_AMB_TEMP 0x06
|
|
|
|
/* function declarations */
|
|
/* this function configures I2C Peripheral & GPIO AF for I2C */
|
|
void MLX90614_I2CConfig(void);
|
|
/* this function reads object temperature */
|
|
uint16_t MLX90614_GetObjectTemperature(void);
|
|
|
|
#endif //MLX90614_H
|