资源简介
stm32,arduino单片机通过max31865传感器pt100测温,软件spi通信,串口1输出,TQFN-20-EP封装AD17
代码片段和文件信息
/***************************************************
This is a library for the Adafruit PT100/P1000 RTD Sensor w/MAX31865
Designed specifically to work with the Adafruit RTD Sensor
----> https://www.adafruit.com/products/3328
This sensor uses SPI to communicate 4 pins are required to
interface
Adafruit invests time and resources providing this open source code
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license all text above must be included in any redistribution
****************************************************/
#include “Adafruit_MAX31865.h“
#ifdef __AVR
#include
#elif defined(ESP8266)
#include
#endif
#include
#include
static SPISettings max31865_spisettings = SPISettings(500000 MSBFIRST SPI_MODE1);
// Software (bitbang) SPI
Adafruit_MAX31865::Adafruit_MAX31865(int8_t spi_cs int8_t spi_mosi int8_t spi_miso int8_t spi_clk) {
_sclk = spi_clk;
_cs = spi_cs;
_miso = spi_miso;
_mosi = spi_mosi;
}
// Hardware SPI init
Adafruit_MAX31865::Adafruit_MAX31865(int8_t spi_cs) {
_cs = spi_cs;
_sclk = _miso = _mosi = -1;
}
boolean Adafruit_MAX31865::begin(max31865_numwires_t wires) {
pinMode(_cs OUTPUT);
digitalWrite(_cs HIGH);
if (_sclk != -1) {
//define pin modes
pinMode(_sclk OUTPUT);
digitalWrite(_sclk LOW);
pinMode(_mosi OUTPUT);
pinMode(_miso INPUT);
} else {
//start and configure hardware SPI
SPI.begin();
}
for (uint8_t i=0; i<16; i++) {
// readRegister8(i);
}
setWires(wires);
enableBias(false);
autoConvert(false);
clearFault();
//Serial.print(“config: “); Serial.println(readRegister8(MAX31856_CONFIG_REG) HEX);
return true;
}
uint8_t Adafruit_MAX31865::readFault(void) {
return readRegister8(MAX31856_FAULTSTAT_REG);
}
void Adafruit_MAX31865::clearFault(void) {
uint8_t t = readRegister8(MAX31856_CONFIG_REG);
t &= ~0x2C;
t |= MAX31856_CONFIG_FAULTSTAT;
writeRegister8(MAX31856_CONFIG_REG t);
}
void Adafruit_MAX31865::enableBias(boolean b) {
uint8_t t = readRegister8(MAX31856_CONFIG_REG);
if (b) {
t |= MAX31856_CONFIG_BIAS; // enable bias
} else {
t &= ~MAX31856_CONFIG_BIAS; // disable bias
}
writeRegister8(MAX31856_CONFIG_REG t);
}
void Adafruit_MAX31865::autoConvert(boolean b) {
uint8_t t = readRegister8(MAX31856_CONFIG_REG);
if (b) {
t |= MAX31856_CONFIG_MODEAUTO; // enable autoconvert
} else {
t &= ~MAX31856_CONFIG_MODEAUTO; // disable autoconvert
}
writeRegister8(MAX31856_CONFIG_REG t);
}
void Adafruit_MAX31865::setWires(max31865_numwires_t wires ) {
uint8_t t = readRegister8(MAX31856_CONFIG_REG);
if (wires == MAX31865_3WIRE) {
t |= MAX31856_CONFIG_3WIRE;
} else {
// 2 or 4 wire
t &= ~MAX31856_CONFIG_3WIRE;
}
writeRegister8(MAX31856_CONFIG_REG t);
}
float Adafruit
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 5933 2016-11-15 11:15 max31865资料\Adafruit_MAX31865-master\Adafruit_MAX31865-master\Adafruit_MAX31865.cpp
文件 2725 2016-11-15 11:15 max31865资料\Adafruit_MAX31865-master\Adafruit_MAX31865-master\Adafruit_MAX31865.h
文件 2254 2016-11-15 11:15 max31865资料\Adafruit_MAX31865-master\Adafruit_MAX31865-master\examples\max31865\max31865.ino
文件 327 2016-11-15 11:15 max31865资料\Adafruit_MAX31865-master\Adafruit_MAX31865-master\library.properties
文件 69 2016-11-15 11:15 max31865资料\Adafruit_MAX31865-master\Adafruit_MAX31865-master\README.md
文件 568 2016-11-15 11:15 max31865资料\Adafruit_MAX31865-master\Adafruit_MAX31865-master\README.txt
文件 861533 2016-11-16 22:27 max31865资料\MAX31865.pdf
文件 1254447 2018-08-31 03:53 max31865资料\MAX31865_中文规格书.pdf
文件 17273 2010-06-07 10:25 max31865资料\STM32f103PT100\CORE\core_cm3.c
文件 85714 2011-02-09 14:59 max31865资料\STM32f103PT100\CORE\core_cm3.h
文件 15503 2011-03-10 10:52 max31865资料\STM32f103PT100\CORE\startup_stm32f10x_hd.s
文件 8982 2011-03-10 10:47 max31865资料\STM32f103PT100\FWLIB\inc\misc.h
文件 21690 2011-03-10 10:47 max31865资料\STM32f103PT100\FWLIB\inc\stm32f10x_adc.h
文件 7555 2011-03-10 10:47 max31865资料\STM32f103PT100\FWLIB\inc\stm32f10x_bkp.h
文件 27559 2011-03-10 10:47 max31865资料\STM32f103PT100\FWLIB\inc\stm32f10x_can.h
文件 6573 2011-03-10 10:47 max31865资料\STM32f103PT100\FWLIB\inc\stm32f10x_cec.h
文件 2162 2011-03-10 10:47 max31865资料\STM32f103PT100\FWLIB\inc\stm32f10x_crc.h
文件 15233 2011-03-10 10:47 max31865资料\STM32f103PT100\FWLIB\inc\stm32f10x_dac.h
文件 3818 2011-03-10 10:47 max31865资料\STM32f103PT100\FWLIB\inc\stm32f10x_dbgmcu.h
文件 20754 2011-03-10 10:47 max31865资料\STM32f103PT100\FWLIB\inc\stm32f10x_dma.h
文件 6824 2011-03-10 10:47 max31865资料\STM32f103PT100\FWLIB\inc\stm32f10x_exti.h
文件 25445 2011-03-10 10:47 max31865资料\STM32f103PT100\FWLIB\inc\stm32f10x_flash.h
文件 27016 2011-03-10 10:47 max31865资料\STM32f103PT100\FWLIB\inc\stm32f10x_fsmc.h
文件 20175 2011-03-10 10:47 max31865资料\STM32f103PT100\FWLIB\inc\stm32f10x_gpio.h
文件 30029 2011-03-10 10:47 max31865资料\STM32f103PT100\FWLIB\inc\stm32f10x_i2c.h
文件 3828 2011-03-10 10:47 max31865资料\STM32f103PT100\FWLIB\inc\stm32f10x_iwdg.h
文件 4383 2011-03-10 10:47 max31865资料\STM32f103PT100\FWLIB\inc\stm32f10x_pwr.h
文件 30452 2011-03-10 10:47 max31865资料\STM32f103PT100\FWLIB\inc\stm32f10x_rcc.h
文件 3857 2011-03-10 10:47 max31865资料\STM32f103PT100\FWLIB\inc\stm32f10x_rtc.h
文件 21863 2011-03-10 10:47 max31865资料\STM32f103PT100\FWLIB\inc\stm32f10x_sdio.h
............此处省略221个文件信息
相关资源
- Keil5下的STM32F407程序
- STM32L152 RTC 读取时间和日期
- STM32固件库使用手册(中文版)
- stm32F103C8外部flash图片显示
- STM32 GPIO和定时器 模拟串口
- ZLIB解压缩STM32工程
- STM32控制sg90舵机代码.rar
- 手环(一)---计步、速度等等.rar
- STM32F103 ADC测电压 代码
- Mini_oneNET.zip
- zw_qq_39340220-10661258-stm32机械手臂小车
- 基于STM32的室内温度控制系统.doc
- stm32f103测量pm2.5源码
- 基于stm32的闹钟rtc
- 轩微科技STM32编程器控制平台.rar
- MQ7浓度采集程序
- ds18b20测温例程tm4c123x
- zw_OLED-STM32F4-IIC.zip
- 基于STM32篮球比赛计分
- STM32F103C8T6与MQTT通信的源码
- USART基于hal库stm32f407串口通讯.rar
- stm32之传感器DHT11.zip
- STM32F4基于HAL库的LCD显示实验
- STM32硬件IIC主机例程以读写EEPROM为例
- MLX90614红外测温仪软件设计.rar
- STM32F103C8T6读取DS18B20串口显示程序.r
- MLX90614(GY906)____STM32F103ZET6
- Bad Apple.zip
- stm32f4+ov5640颜色识别.zip
- stm32 modbus 协议程序
评论
共有 条评论