41 lines
1.3 KiB
C
41 lines
1.3 KiB
C
#ifndef __MAX31865_H
|
|
#define __MAX31865_H
|
|
|
|
#include "stm32f10x.h"
|
|
#include "math.h"
|
|
#include "usart_arb.h"
|
|
#include "delay.h"
|
|
|
|
/* MAX31865参考电阻 */
|
|
#define RREF (430) //400Ω
|
|
|
|
|
|
/* MAX31865控制口 */
|
|
#define MAX31865_CONTROL_PORT GPIOC
|
|
#define MAX31865_SDO GPIO_Pin_10
|
|
#define MAX31865_CS GPIO_Pin_12
|
|
#define MAX31865_SCLK GPIO_Pin_9
|
|
#define MAX31865_SDI GPIO_Pin_11
|
|
#define MAX31865_DRDY GPIO_Pin_13
|
|
|
|
#define MAX31865_CS_SET GPIO_WriteBit(MAX31865_CONTROL_PORT,MAX31865_CS,Bit_SET)
|
|
#define MAX31865_CS_CLR GPIO_WriteBit(MAX31865_CONTROL_PORT,MAX31865_CS,Bit_RESET)
|
|
#define MAX31865_SCLK_SET GPIO_WriteBit(MAX31865_CONTROL_PORT,MAX31865_SCLK,Bit_SET)
|
|
#define MAX31865_SCLK_CLR GPIO_WriteBit(MAX31865_CONTROL_PORT,MAX31865_SCLK,Bit_RESET)
|
|
#define MAX31865_SDI_SET GPIO_WriteBit(MAX31865_CONTROL_PORT,MAX31865_SDI,Bit_SET)
|
|
#define MAX31865_SDI_CLR GPIO_WriteBit(MAX31865_CONTROL_PORT,MAX31865_SDI,Bit_RESET)
|
|
|
|
#define MAX31865_SDO_READ GPIO_ReadInputDataBit(MAX31865_CONTROL_PORT,MAX31865_SDO)
|
|
#define MAX31865_DRDY_READ GPIO_ReadInputDataBit(MAX31865_CONTROL_PORT,MAX31865_DRDY)
|
|
|
|
void MAX31865_Init(void); //MAX31865 初始化,软件模拟
|
|
void MAX31865_Cfg(void); //MAX31865 配置
|
|
float MAX31865_GetTemp(void);//MAX31865 获取温度
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|