資源簡(jiǎn)介
STM32f103驅(qū)動(dòng)max 31856驅(qū)動(dòng)程序,全工程給出,實(shí)在得很。

代碼片段和文件信息
//?This?is?a?library?for?the?Maxim?MAX31856?thermocouple?IC
//?http://datasheets.maximintegrated.com/en/ds/MAX31856.pdf
//
//?Written?by?Peter?Easton?(www.whizoo.com)
//?Released?under?CC?BY-SA?3.0?license
//
//?Look?for?the?MAX31856?breakout?boards?on?www.whizoo.com?and?eBay?(madeatrade)
//?http://stores.ebay.com/madeatrade
//
//?Looking?to?build?yourself?a?reflow?oven???It?isn‘t?that?difficult?to
//?do!??Take?a?look?at?the?build?guide?here:
//?http://www.whizoo.com
//
//?Library?Implementation?Details
//?==============================
//?DRDY?and?FAULT?lines?are?not?used?in?this?driver.?DRDY?is?useful?for?low-power?mode?so?samples?are?only?taken?when
//?needed;?this?driver?assumes?power?isn‘t?an?issue.??The?FAULT?line?can?be?used?to?generate?an?interrupt?in?the?host
//?processor?when?a?fault?occurs.??This?library?reads?the?fault?register?every?time?a?reading?is?taken?and?will
//?return?a?fault?error?if?there?is?one.??The?MAX31856?has?sophisticated?usage?scenarios?involving?FAULT.??For
//?example?low?and?high?temperature?limits?can?be?set?and?the?FAULT?line?triggers?when?these?temperatures?are
//?breached.?This?is?beyond?the?scope?of?this?sample?library.??The?assumption?is?that?most?applications?will?be
//?polling?for?temperature?readings?-?but?it?is?good?to?know?these?features?are?supported?by?the?hardware.
//
//?The?MAX31856?differs?from?earlier?thermocouple?IC‘s?in?that?it?has?registers?that?must?be?configured?before
//?readings?can?be?taken.??This?makes?it?very?flexible?and?powerful?but?one?concern?is?power?loss?to?the?IC.??The?IC
//?should?be?as?close?to?the?cold?junction?as?possible?which?might?mean?there?is?a?cable?connecting?the?breakout
//?board?to?the?host?processor.??If?this?cable?is?disconnected?and?reconnected?(MAX31856?loses?power)?then?the
//?registers?must?be?reinitialized.??This?library?detects?this?condition?and?will?automatically?reconfigure?the
//?registers.??This?simplifies?the?software?running?on?the?host.
//
//?A?lot?of?configuration?options?appear?in?the?.H?file.??Of?particular?note?is?the?line?frequency?filtering?which
//?defaults?to?60Hz?(USA?and?others).??If?your?line?voltage?is?50Hz?you?should?set?CR0_NOISE_FILTER_50HZ.
//
//?This?library?handles?the?full?range?of?temperatures?including?negative?temperatures.
//
//
//?Change?History:
//?25?June?2015????????Initial?Version
//?31?July?2015????????Fixed?spelling?and?formatting?problems
#include “MAX31856.h“
//?Define?which?pins?are?connected?to?the?MAX31856.??The?DRDY?and?FAULT?outputs
//?from?the?MAX31856?are?not?used?in?this?library.
MAX31856::MAX31856(int?sdi?int?sdo?int?cs?int?clk)
{
????_sdi?=?sdi;
????_sdo?=?sdo;
????_cs?=?cs;
????_clk?=?clk;
????//?Initialize?all?the?data?pins
????pinMode(_sdi?OUTPUT);
????pinMode(_cs?OUTPUT);
????pinMode(_clk?OUTPUT);
????//?Use?a?pullup?on?the?data?line?to?be?able?to?detect?“no?communication“
????pinMode(_sdo?INPUT_PULLUP);
????//?Default?output?pins?state
????digitalWrite(_cs?HIGH);
????digitalWrite(_clk?HI
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2015-09-19?20:37??MAX31856-master\
?????目錄???????????0??2015-09-19?20:37??MAX31856-master\MAX31856\
?????文件????????9659??2015-09-02?06:15??MAX31856-master\MAX31856\MAX31856.cpp
?????文件????????4141??2015-09-02?06:15??MAX31856-master\MAX31856\MAX31856.h
?????目錄???????????0??2015-09-19?20:37??MAX31856-master\MAX31856\examples\
?????目錄???????????0??2016-08-29?11:09??MAX31856-master\MAX31856\examples\MAX31856\
?????文件????????4849??2016-08-29?11:09??MAX31856-master\MAX31856\examples\MAX31856\MAX31856.ino
?????文件????????2089??2015-09-02?06:15??MAX31856-master\MAX31856\keywords.txt
?????文件????????2810??2015-09-02?06:15??MAX31856-master\README
評(píng)論
共有 條評(píng)論