标签:
本文采用的芯片为STM32F103RCT6
温度芯片为MAX6675
模拟spi之前写过
里面的部分代码摘取的正点原子的函数库:sys、uart、delay等文件
原理图
max6675.h
#ifndef __MAX6675_H
#define __MAX6675_H
#include "stm32f10x.h"
#include "sys.h"
void max6675_init(void); //初始化max6675模块
u8 max6675_readWriteByte(u8 TxData);
u16 max6675_readbits_II(void);
float max6675_readTemp(void);
#endif
max6675.c
#include "max6675.h"
#include "spi.h"
#include "sys.h"
#include "delay.h"
#include "usart.h"
/*max6675初始化程序*/
void max6675_init(void){
GPIO_InitTypeDef GPIO_InitStructure;