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<36>ο<EFBFBD><CEBF><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
#define RREF (430) //400<30><30>
|
|||
|
|
|||
|
|
|||
|
/* MAX31865<36><35><EFBFBD>ƿ<EFBFBD> */
|
|||
|
#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 <20><>ʼ<EFBFBD><CABC>,<2C><><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>
|
|||
|
void MAX31865_Cfg(void); //MAX31865 <20><><EFBFBD><EFBFBD>
|
|||
|
float MAX31865_GetTemp(void);//MAX31865 <20><>ȡ<EFBFBD>¶<EFBFBD>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
#endif
|
|||
|
|