资源简介
网上很多都是基于F1的,不能直接用于F4,故改写后分享
代码片段和文件信息
#include “Mlx90614.h“
#include “Systick.h“
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
#define ACK 0
#define NACK 1
#define SA 0x00 //Slave address ??MLX90614????0x00????????0x5a
#define RAM_ACCESS 0x00 //RAM access command
#define EEPROM_ACCESS 0x20 //EEPROM access command
#define RAM_TOBJ1 0x07 //To1 address in the eeprom
#define SMBUS_PORT GPIOB
#define SMBUS_SCK GPIO_Pin_4
#define SMBUS_SDA GPIO_Pin_3
#define RCC_AHB1Periph_SMBUS_PORT RCC_AHB1Periph_GPIOB
#define SMBUS_SCK_H() SMBUS_PORT->BSRRL = SMBUS_SCK
#define SMBUS_SCK_L() SMBUS_PORT->BSRRH = SMBUS_SCK
#define SMBUS_SDA_H() SMBUS_PORT->BSRRL = SMBUS_SDA
#define SMBUS_SDA_L() SMBUS_PORT->BSRRH = SMBUS_SDA
#define SMBUS_SDA_PIN() SMBUS_PORT->IDR & SMBUS_SDA
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/*******************************************************************************
* Function Name : SMBus_StartBit
* Description : Generate START condition on SMBus
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void SMBus_StartBit(void)
{
SMBus_SDA_OUTMode();
Delay_us(2);
SMBUS_SDA_H(); // Set SDA line
SMBus_Delay(1); // Wait a few microseconds
SMBUS_SCK_H(); // Set SCL line
SMBus_Delay(5); // Generate bus free time between Stop
SMBUS_SDA_L(); // Clear SDA line
SMBus_Delay(10); // Hold time after (Repeated) Start
// Condition. After this period the first clock is generated.
//(Thd:sta=4.0us min)
SMBUS_SCK_L(); // Clear SCL line
SMBus_Delay(2); // Wait a few microseconds
}
/*******************************************************************************
* Function Name : SMBus_StopBit
* Description : Generate STOP condition on SMBus
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void SMBus_StopBit(void)
{
SMBus_SDA_OUTMode();
Delay_us(2);
SMBUS_SCK_L(); // Clear SCL line
SMBus_Delay(5); // Wait a few microseconds
SMBUS_SDA_L(); // Clear SDA line
SMBus_Delay(5); // Wait a few microseconds
SMBUS_SCK_H(); // Set SCL line
SMBus_Delay(5); // Stop condition setup time(Tsu:sto=4.0us min)
SMBUS_SDA_H(); // Set SDA line
}
/*****
相关资源
- MLX90614红外温度传感器程序,并用液晶
- mlx90614中文资料
- 单片机89c52与MLX90614红外的测温程序
- MLX90614红外测温仪软件设计.rar
- MLX90614(GY906)____STM32F103ZET6
- MLX90614中文手册
- mlx90614红外测温传感器stm32f103rct6
- 基于STM32F407的MLX90614驱动程序(寄存器
- MLX90614红外温度传感器完整资料及工程
- MLX90614非接触式红外测温测试代码
- STM32F103mini-MLX90614工程文件
- MLX90614(GY906)___STM32F407ZGT6
- 基于STM32的MLX90614测温显示.rar
- 已完成的按键+红外测温+oled - 副本.
- stm32+MLX90614测温代码.rar
- STM32红外测温MLX90614.rar
- 已测试基于STM32的MLX90614程序
- 基于Arduino的AMLX90614非接触式温度程序
- MLX90614 STM32的驱动
- mlx90614红外无接触测温测试通过.rar
- STM32驱动max30102和MLX90614程序
- STC12C5A60S2与MLX90614红外温度传感器程序
- stm32f1对MLX90614ESF读取数据
- MLX90614红外测温 STM32完整工程文件
- MLX90614驱动程序
- 基于51单片机的MLX90614红外测温仪实验
- STM8红外温度传感器MLX90614源代码
- 额温枪电路设计原理图(附赠官方M
- mlx90614非接触式红外传感器温度采集
- STM32F4+MLX90614
评论
共有 条评论