Showing preview only (3,086K chars total). Download the full file or copy to clipboard to get everything.
Repository: maxritter/diy-thermocam
Branch: master
Commit: 5e2e0c2ad745
Files: 250
Total size: 2.9 MB
Directory structure:
gitextract_mg_ibzep/
├── .github/
│ └── FUNDING.yml
├── .gitignore
├── LICENSE
├── README.MD
├── enclosure/
│ ├── 3.0/
│ │ ├── enclosure.skb
│ │ └── enclosure.skp
│ └── README.MD
├── firmware/
│ ├── 3.0/
│ │ ├── .gitignore
│ │ ├── include/
│ │ │ ├── battery.h
│ │ │ ├── bitmaps.h
│ │ │ ├── buttons.h
│ │ │ ├── colorschemes.h
│ │ │ ├── connection.h
│ │ │ ├── create.h
│ │ │ ├── display.h
│ │ │ ├── firststart.h
│ │ │ ├── fonts.h
│ │ │ ├── ft6206_touchscreen.h
│ │ │ ├── globaldefines.h
│ │ │ ├── globalvariables.h
│ │ │ ├── gui.h
│ │ │ ├── hardware.h
│ │ │ ├── lepton.h
│ │ │ ├── livemode.h
│ │ │ ├── load.h
│ │ │ ├── loadmenu.h
│ │ │ ├── mainmenu.h
│ │ │ ├── massstorage.h
│ │ │ ├── save.h
│ │ │ ├── sdcard.h
│ │ │ ├── settingsmenu.h
│ │ │ ├── temperature.h
│ │ │ ├── thermal.h
│ │ │ ├── touchscreen.h
│ │ │ ├── videomenu.h
│ │ │ └── xpt2046_touchscreen.h
│ │ ├── lib/
│ │ │ ├── ADC/
│ │ │ │ ├── ADC.cpp
│ │ │ │ ├── ADC.h
│ │ │ │ ├── ADC_Module.cpp
│ │ │ │ ├── ADC_Module.h
│ │ │ │ ├── ADC_util.h
│ │ │ │ ├── AnalogBufferDMA.cpp
│ │ │ │ ├── AnalogBufferDMA.h
│ │ │ │ ├── VREF.h
│ │ │ │ ├── atomic.h
│ │ │ │ └── settings_defines.h
│ │ │ ├── Bounce/
│ │ │ │ ├── Bounce.cpp
│ │ │ │ └── Bounce.h
│ │ │ ├── EEPROM/
│ │ │ │ ├── EEPROM.cpp
│ │ │ │ └── EEPROM.h
│ │ │ ├── LittleFS/
│ │ │ │ ├── LittleFS.cpp
│ │ │ │ ├── LittleFS.h
│ │ │ │ ├── LittleFS_NAND.cpp
│ │ │ │ └── littlefs/
│ │ │ │ ├── DESIGN.md
│ │ │ │ ├── LICENSE.md
│ │ │ │ ├── README.md
│ │ │ │ ├── SPEC.md
│ │ │ │ ├── lfs.c
│ │ │ │ ├── lfs.h
│ │ │ │ ├── lfs_util.c
│ │ │ │ └── lfs_util.h
│ │ │ ├── MTP/
│ │ │ │ ├── MTP.cpp
│ │ │ │ ├── MTP.h
│ │ │ │ ├── Storage.cpp
│ │ │ │ └── Storage.h
│ │ │ ├── Metro/
│ │ │ │ ├── Metro.cpp
│ │ │ │ └── Metro.h
│ │ │ ├── SD/
│ │ │ │ ├── library.properties
│ │ │ │ └── src/
│ │ │ │ ├── SD.cpp
│ │ │ │ └── SD.h
│ │ │ ├── SPI/
│ │ │ │ ├── SPI.cpp
│ │ │ │ └── SPI.h
│ │ │ ├── SdFat/
│ │ │ │ └── src/
│ │ │ │ ├── BufferedPrint.h
│ │ │ │ ├── DigitalIO/
│ │ │ │ │ ├── DigitalPin.h
│ │ │ │ │ ├── SoftSPI.h
│ │ │ │ │ ├── boards/
│ │ │ │ │ │ ├── AvrDevelopersGpioPinMap.h
│ │ │ │ │ │ ├── BobuinoGpioPinMap.h
│ │ │ │ │ │ ├── GpioPinMap.h
│ │ │ │ │ │ ├── LeonardoGpioPinMap.h
│ │ │ │ │ │ ├── MegaGpioPinMap.h
│ │ │ │ │ │ ├── SleepingBeautyGpioPinMap.h
│ │ │ │ │ │ ├── Standard1284GpioPinMap.h
│ │ │ │ │ │ ├── Teensy2GpioPinMap.h
│ │ │ │ │ │ ├── Teensy2ppGpioPinMap.h
│ │ │ │ │ │ └── UnoGpioPinMap.h
│ │ │ │ │ └── readme.txt
│ │ │ │ ├── ExFatLib/
│ │ │ │ │ ├── ExFatConfig.h
│ │ │ │ │ ├── ExFatDbg.cpp
│ │ │ │ │ ├── ExFatFile.cpp
│ │ │ │ │ ├── ExFatFile.h
│ │ │ │ │ ├── ExFatFilePrint.cpp
│ │ │ │ │ ├── ExFatFileWrite.cpp
│ │ │ │ │ ├── ExFatFormatter.cpp
│ │ │ │ │ ├── ExFatFormatter.h
│ │ │ │ │ ├── ExFatLib.h
│ │ │ │ │ ├── ExFatName.cpp
│ │ │ │ │ ├── ExFatPartition.cpp
│ │ │ │ │ ├── ExFatPartition.h
│ │ │ │ │ ├── ExFatVolume.cpp
│ │ │ │ │ ├── ExFatVolume.h
│ │ │ │ │ └── upcase.cpp
│ │ │ │ ├── FatLib/
│ │ │ │ │ ├── FatDbg.cpp
│ │ │ │ │ ├── FatFile.cpp
│ │ │ │ │ ├── FatFile.h
│ │ │ │ │ ├── FatFileLFN.cpp
│ │ │ │ │ ├── FatFilePrint.cpp
│ │ │ │ │ ├── FatFileSFN.cpp
│ │ │ │ │ ├── FatFormatter.cpp
│ │ │ │ │ ├── FatFormatter.h
│ │ │ │ │ ├── FatLib.h
│ │ │ │ │ ├── FatName.cpp
│ │ │ │ │ ├── FatPartition.cpp
│ │ │ │ │ ├── FatPartition.h
│ │ │ │ │ ├── FatVolume.cpp
│ │ │ │ │ └── FatVolume.h
│ │ │ │ ├── FreeStack.cpp
│ │ │ │ ├── FreeStack.h
│ │ │ │ ├── FsLib/
│ │ │ │ │ ├── FsFile.cpp
│ │ │ │ │ ├── FsFile.h
│ │ │ │ │ ├── FsFormatter.h
│ │ │ │ │ ├── FsLib.h
│ │ │ │ │ ├── FsNew.cpp
│ │ │ │ │ ├── FsNew.h
│ │ │ │ │ ├── FsVolume.cpp
│ │ │ │ │ └── FsVolume.h
│ │ │ │ ├── MinimumSerial.cpp
│ │ │ │ ├── MinimumSerial.h
│ │ │ │ ├── RingBuf.h
│ │ │ │ ├── SdCard/
│ │ │ │ │ ├── CPPLINT.cfg
│ │ │ │ │ ├── SdCard.h
│ │ │ │ │ ├── SdCardInfo.cpp
│ │ │ │ │ ├── SdCardInfo.h
│ │ │ │ │ ├── SdCardInterface.h
│ │ │ │ │ ├── SdSpiCard.cpp
│ │ │ │ │ ├── SdSpiCard.h
│ │ │ │ │ ├── SdioCard.h
│ │ │ │ │ ├── SdioTeensy.cpp
│ │ │ │ │ └── SdioTeensy.h
│ │ │ │ ├── SdFat.h
│ │ │ │ ├── SdFatConfig.h
│ │ │ │ ├── SpiDriver/
│ │ │ │ │ ├── SdSpiArduinoDriver.h
│ │ │ │ │ ├── SdSpiArtemis.cpp
│ │ │ │ │ ├── SdSpiAvr.h
│ │ │ │ │ ├── SdSpiBareUnoDriver.h
│ │ │ │ │ ├── SdSpiBaseClass.h
│ │ │ │ │ ├── SdSpiChipSelect.cpp
│ │ │ │ │ ├── SdSpiDriver.h
│ │ │ │ │ ├── SdSpiDue.cpp
│ │ │ │ │ ├── SdSpiESP.cpp
│ │ │ │ │ ├── SdSpiLibDriver.h
│ │ │ │ │ ├── SdSpiParticle.cpp
│ │ │ │ │ ├── SdSpiSTM32.cpp
│ │ │ │ │ ├── SdSpiSTM32Core.cpp
│ │ │ │ │ ├── SdSpiSoftDriver.h
│ │ │ │ │ └── SdSpiTeensy3.cpp
│ │ │ │ ├── common/
│ │ │ │ │ ├── ArduinoFiles.h
│ │ │ │ │ ├── CPPLINT.cfg
│ │ │ │ │ ├── CompileDateTime.h
│ │ │ │ │ ├── DebugMacros.h
│ │ │ │ │ ├── FmtNumber.cpp
│ │ │ │ │ ├── FmtNumber.h
│ │ │ │ │ ├── FsApiConstants.h
│ │ │ │ │ ├── FsBlockDevice.h
│ │ │ │ │ ├── FsBlockDeviceInterface.h
│ │ │ │ │ ├── FsCache.cpp
│ │ │ │ │ ├── FsCache.h
│ │ │ │ │ ├── FsDateTime.cpp
│ │ │ │ │ ├── FsDateTime.h
│ │ │ │ │ ├── FsName.cpp
│ │ │ │ │ ├── FsName.h
│ │ │ │ │ ├── FsStructs.cpp
│ │ │ │ │ ├── FsStructs.h
│ │ │ │ │ ├── FsUtf.cpp
│ │ │ │ │ ├── FsUtf.h
│ │ │ │ │ ├── PrintBasic.cpp
│ │ │ │ │ ├── PrintBasic.h
│ │ │ │ │ ├── SysCall.h
│ │ │ │ │ ├── upcase.cpp
│ │ │ │ │ └── upcase.h
│ │ │ │ ├── iostream/
│ │ │ │ │ ├── ArduinoStream.h
│ │ │ │ │ ├── StdioStream.cpp
│ │ │ │ │ ├── StdioStream.h
│ │ │ │ │ ├── StreamBaseClass.cpp
│ │ │ │ │ ├── bufstream.h
│ │ │ │ │ ├── fstream.h
│ │ │ │ │ ├── ios.h
│ │ │ │ │ ├── iostream.h
│ │ │ │ │ ├── istream.cpp
│ │ │ │ │ ├── istream.h
│ │ │ │ │ ├── ostream.cpp
│ │ │ │ │ └── ostream.h
│ │ │ │ └── sdios.h
│ │ │ ├── Time/
│ │ │ │ ├── DateStrings.cpp
│ │ │ │ ├── Time.cpp
│ │ │ │ ├── Time.h
│ │ │ │ ├── TimeLib.h
│ │ │ │ └── library.properties
│ │ │ └── Wire/
│ │ │ ├── Wire.cpp
│ │ │ ├── Wire.h
│ │ │ ├── WireIMXRT.cpp
│ │ │ ├── WireIMXRT.h
│ │ │ ├── WireKinetis.cpp
│ │ │ ├── WireKinetis.h
│ │ │ └── utility/
│ │ │ ├── twi.c
│ │ │ └── twi.h
│ │ ├── platformio.ini
│ │ └── src/
│ │ ├── general/
│ │ │ ├── colorschemes.cpp
│ │ │ └── globalvariables.cpp
│ │ ├── gui/
│ │ │ ├── bitmaps.cpp
│ │ │ ├── buttons.cpp
│ │ │ ├── firststart.cpp
│ │ │ ├── gui.cpp
│ │ │ ├── livemode.cpp
│ │ │ ├── loadmenu.cpp
│ │ │ ├── mainmenu.cpp
│ │ │ ├── settingsmenu.cpp
│ │ │ └── videomenu.cpp
│ │ ├── hardware/
│ │ │ ├── battery.cpp
│ │ │ ├── connection.cpp
│ │ │ ├── display/
│ │ │ │ ├── display.cpp
│ │ │ │ └── fonts.cpp
│ │ │ ├── hardware.cpp
│ │ │ ├── lepton.cpp
│ │ │ ├── massstorage.cpp
│ │ │ ├── sdcard.cpp
│ │ │ └── touchscreen/
│ │ │ ├── ft6206_touchscreen.cpp
│ │ │ ├── touchscreen.cpp
│ │ │ └── xpt2046_touchscreen.cpp
│ │ ├── main.cpp
│ │ └── thermal/
│ │ ├── create.cpp
│ │ ├── load.cpp
│ │ ├── save.cpp
│ │ ├── temperature.cpp
│ │ └── thermal.cpp
│ └── README.MD
├── pcb/
│ ├── 3.0/
│ │ ├── pcb.brd
│ │ └── pcb.sch
│ └── README.MD
└── software/
├── README.MD
├── thermal_analysis_software/
│ └── README.MD
├── thermal_data_viewer/
│ └── README.MD
├── thermal_live_viewer/
│ ├── 3.0/
│ │ ├── .gitignore
│ │ ├── main.py
│ │ ├── requirements.txt
│ │ ├── setup.py
│ │ └── src/
│ │ ├── __init__.py
│ │ ├── colorschemes.py
│ │ └── liveviewer.py
│ └── README.MD
└── video_converter/
└── README.MD
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms
github: maxritter
================================================
FILE: .gitignore
================================================
.DS_Store
__pycache__/
*.pyc
*.pyo
*.pyd
*.pyw
*.pyz
*.pywz
================================================
FILE: LICENSE
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{one line to give the program's name and a brief idea of what it does.}
Copyright (C) {year} {name of author}
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
{project} Copyright (C) {year} {fullname}
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
================================================
FILE: README.MD
================================================
# DIY-Thermocam
<img src="https://www.diy-thermocam.net/images/website/logo_text.png" width="500">
The DIY-Thermocam V3 is an open-source thermal imager based on the FLIR Lepton LWIR sensor.
Check out the official website for more information about the project: **[www.diy-thermocam.net](https://www.diy-thermocam.net/)**
**This repository contains:**
- **[Latest firmware releases](https://github.com/maxritter/diy-thermocam/releases)**
- **[Open-source firmware](https://github.com/maxritter/diy-thermocam/tree/master/firmware)**
- **[Desktop software](https://github.com/maxritter/diy-thermocam/tree/master/software)**
- **[Device enclosure](https://github.com/maxritter/diy-thermocam/tree/master/enclosure)**
- **[Printed circuit board](https://github.com/maxritter/diy-thermocam/tree/master/pcb)**
<img src="https://www.diy-thermocam.net/images/device/open.jpg" width="500">
================================================
FILE: enclosure/README.MD
================================================
# DIY-Thermocam - Enclosure
The enclosure has been designed with Google Sketchup in 3D and converted to 2D files to laser-cut them. The 2D SVG file can be opened with Inkscape.
================================================
FILE: firmware/3.0/.gitignore
================================================
.pio
.vscode
================================================
FILE: firmware/3.0/include/battery.h
================================================
/*
*
* BATTERY - Measure the lithium battery status
*
* DIY-Thermocam Firmware
*
* GNU General Public License v3.0
*
* Copyright by Max Ritter
*
* http://www.diy-thermocam.net
* https://github.com/maxritter/diy-thermocam
*
*/
#ifndef BATTERY_H
#define BATTERY_H
/*########################## PUBLIC PROCEDURES ################################*/
void checkBattery(bool start = false, bool calibrate = false);
int getLipoPerc(float vol);
#endif /* BATTERY_H */
================================================
FILE: firmware/3.0/include/bitmaps.h
================================================
/*
*
* BITMAPS - Icons and graphics shown inside the GUI
*
* DIY-Thermocam Firmware
*
* GNU General Public License v3.0
*
* Copyright by Max Ritter
*
* http://www.diy-thermocam.net
* https://github.com/maxritter/diy-thermocam
*
*/
#ifndef BITMAPS_H
#define BITMAPS_H
/*################# PUBLIC CONSTANTS, VARIABLES & DATA TYPES ##################*/
extern const uint16_t iconChangeColorPalette[];
extern const uint8_t iconChangeColorBMP[];
extern const uint16_t iconTempLimitsPalette[];
extern const uint8_t iconTempLimitsBMP[];
extern const uint16_t iconLoadMenuPalette[];
extern const uint8_t iconLoadMenuBMP[];
extern const uint16_t iconShutterPalette[];
extern const uint8_t iconShutterBMP[];
extern const uint16_t iconSettingsMenuPalette[];
extern const uint8_t iconSettingsMenuBMP[];
extern const uint16_t iconDisplaySettingsPalette[];
extern const uint8_t iconDisplaySettingsBMP[];
extern const uint16_t iconDisplayOffPalette[];
extern const uint8_t iconDisplayOffBMP[];
extern const uint16_t iconHotColdPalette[];
extern const uint8_t iconHotColdBMP[];
extern const uint16_t iconTempPointsPalette[];
extern const uint8_t iconTempPointsBMP[];
extern const uint16_t iconBWColors[];
extern const uint8_t iconBWBitmap[];
extern const uint16_t iconReturnColors[];
extern const uint8_t iconReturnBitmap[];
extern const uint16_t iconFWColors[];
extern const uint8_t iconFWBitmap[];
extern const uint16_t logoColors[];
extern const uint8_t logoBitmap[];
#endif /* BITMAPS_H */
================================================
FILE: firmware/3.0/include/buttons.h
================================================
/*
*
* Buttons - Touch buttons for the GUI
*
* DIY-Thermocam Firmware
*
* GNU General Public License v3.0
*
* Copyright by Max Ritter
*
* http://www.diy-thermocam.net
* https://github.com/maxritter/diy-thermocam
*
*/
#ifndef BUTTONS_H
#define BUTTONS_H
/*########################## PUBLIC PROCEDURES ################################*/
int buttons_addButton(uint16_t x, uint16_t y, uint16_t width, uint16_t height, const uint8_t* data, const uint16_t* palette, uint16_t flags = 0);
int buttons_addButton(uint16_t x, uint16_t y, uint16_t width, uint16_t height, char *label, uint16_t flags = 0, boolean largetouch = 0);
boolean buttons_buttonEnabled(int buttonID);
int buttons_checkButtons(boolean timeout = 0, boolean fast = 0);
void buttons_deleteAllButtons();
void buttons_deleteButton(int buttonID);
void buttons_disableButton(int buttonID, boolean redraw = 0);
void buttons_drawButtons();
void buttons_drawButton(int buttonID);
void buttons_enableButton(int buttonID, boolean redraw = 0);
void buttons_init();
void buttons_relabelButton(int buttonID, char *label, boolean redraw = 0);
void buttons_setActive(int buttonID);
void buttons_setButtonColors(word atxt, word iatxt, word brd, word brdhi, word back);
void buttons_setInactive(int buttonID);
void buttons_setSymbolFont(const uint8_t* font);
void buttons_setTextFont(const uint8_t* font);
#endif /* BUTTONS_H */
================================================
FILE: firmware/3.0/include/colorschemes.h
================================================
/*
*
* COLOR SCHEMES - Contains 19 different color schemes to display the thermal image
*
* DIY-Thermocam Firmware
*
* GNU General Public License v3.0
*
* Copyright by Max Ritter
*
* http://www.diy-thermocam.net
* https://github.com/maxritter/diy-thermocam
*
*/
#ifndef COLORSCHEMES_H
#define COLORSCHEMES_H
/*################# PUBLIC CONSTANTS, VARIABLES & DATA TYPES ##################*/
extern const byte colorMap_arctic[];
extern const byte colorMap_blackHot[];
extern const byte colorMap_blueRed[];
extern const byte colorMap_coldest[];
extern const byte colorMap_contrast[];
extern const byte colorMap_doubleRainbow[];
extern const byte colorMap_grayRed[];
extern const byte colorMap_glowBow[];
extern const byte colorMap_grayscale[];
extern const byte colorMap_hottest[];
extern const byte colorMap_ironblack[];
extern const byte colorMap_lava[];
extern const byte colorMap_medical[];
extern const byte colorMap_rainbow[];
extern const byte colorMap_wheel1[];
extern const byte colorMap_wheel2[];
extern const byte colorMap_wheel3[];
extern const byte colorMap_whiteHot[];
extern const byte colorMap_yellow[];
#endif /* COLORSCHEMES_H */
================================================
FILE: firmware/3.0/include/connection.h
================================================
/*
*
* CONNECTION - Communication protocol for the USB serial data transmission
*
* DIY-Thermocam Firmware
*
* GNU General Public License v3.0
*
* Copyright by Max Ritter
*
* http://www.diy-thermocam.net
* https://github.com/maxritter/diy-thermocam
*
*/
#ifndef CONNECTION_H
#define CONNECTION_H
/*################# PUBLIC CONSTANTS, VARIABLES & DATA TYPES ##################*/
//Start & Stop command
#define CMD_START 0x64
#define CMD_END 0xC8
#define CMD_INVALID 0x00
//Serial terminal commands
#define CMD_GET_RAWLIMITS 0x6E
#define CMD_GET_RAWDATA 0x6F
#define CMD_GET_CONFIGDATA 0x70
#define CMD_GET_CALIBDATA 0x72
#define CMD_GET_SPOTTEMP 0x73
#define CMD_GET_TEMPPOINTS 0x75
#define CMD_SET_SHUTTERRUN 0x78
#define CMD_SET_SHUTTERMODE 0x79
#define CMD_SET_FILTERTYPE 0x7A
#define CMD_GET_BATTERYSTATUS 0x7C
#define CMD_GET_DIAGNOSTIC 0x7F
#define CMD_GET_FWVERSION 0x81
#define CMD_SET_LIMITS 0x82
#define CMD_SET_TEXTCOLOR 0x83
#define CMD_SET_COLORSCHEME 0x84
#define CMD_SET_TEMPFORMAT 0x85
#define CMD_SET_SHOWSPOT 0x86
#define CMD_SET_SHOWCOLORBAR 0x87
#define CMD_SET_SHOWMINMAX 0x88
#define CMD_SET_TEMPPOINTS 0x89
#define CMD_GET_HWVERSION 0x8A
#define CMD_SET_ROTATION 0x8B
//Serial frame commands
#define CMD_FRAME_RAW 0x96
#define CMD_FRAME_COLOR 0x97
#define CMD_FRAME_DISPLAY 0x98
#define CMD_FRAME_SAVE 0x99
//Types of raw frame responses
#define FRAME_CAPTURE_THERMAL 0xB4
#define FRAME_CAPTURE_VIDEO 0xB6
#define FRAME_NORMAL 0xB7
/*########################## PUBLIC PROCEDURES ################################*/
void buttonHandler();
bool checkNoDisplay();
void checkSerial();
int getInt(String text);
void saveFrame();
void sendBatteryStatus();
void sendCalibrationData();
void sendConfigData();
void sendDiagnostic();
void sendDisplayFrame();
void sendFramebuffer();
void sendFrame(bool color);
void sendFWVersion();
void sendHardwareVersion();
void sendRawData(bool color = false);
void sendRawLimits();
void sendSpotTemp();
void sendTempPoints();
void serialConnect();
bool serialHandler();
void serialInit();
void serialOutput();
void setColorScheme();
void setFilterType();
void setLimits();
void setMinMax();
void setRotation();
void setShowColorbar();
void setShowSpot();
void setShutterMode();
void setTempFormat();
void setTempPoints();
void setTextColor();
void setTime();
bool touchHandler();
#endif /* CONNECTION_H */
================================================
FILE: firmware/3.0/include/create.h
================================================
/*
*
* CREATE - Functions to create and display the thermal frameBuffer
*
* DIY-Thermocam Firmware
*
* GNU General Public License v3.0
*
* Copyright by Max Ritter
*
* http://www.diy-thermocam.net
* https://github.com/maxritter/diy-thermocam
*
*/
#ifndef CREATE_H
#define CREATE_H
/*########################## PUBLIC PROCEDURES ################################*/
void boxFilter();
void calculatePointPos(int16_t* xpos, int16_t* ypos, uint16_t pixelIndex);
void clearTempPoints();
void convertColors(bool small = false);
void createThermalImg(bool small = false);
void gaussianFilter();
void getHotColdColors(byte* red, byte* green, byte* blue);
void getTouchPos(uint16_t* x, uint16_t* y);
void limitValues();
void refreshMinMax();
void refreshTempPoints();
void resizePixels(unsigned short* pixels, int w1, int h1, int w2, int h2);
void showTemperatures();
void smallToBigBuffer();
void tempPointFunction(bool remove = false);
#endif /* CREATE_H */
================================================
FILE: firmware/3.0/include/display.h
================================================
/*
*
* Display - ILI9341 SPI Display Module
*
* DIY-Thermocam Firmware
*
* GNU General Public License v3.0
*
* Copyright by Max Ritter
*
* http://www.diy-thermocam.net
* https://github.com/maxritter/diy-thermocam
*
*/
#ifndef DISPLAY_H
#define DISPLAY_H
/*################# PUBLIC CONSTANTS, VARIABLES & DATA TYPES ##################*/
#define LEFT 0
#define RIGHT 9999
#define CENTER 9998
#define PORTRAIT 0
#define LANDSCAPE 1
#define VGA_BLACK 0x0000
#define VGA_WHITE 0xFFFF
#define VGA_RED 0xF800
#define VGA_GREEN 0x0400
#define VGA_BLUE 0x001F
#define VGA_SILVER 0xC618
#define VGA_GRAY 0x8410
#define VGA_MAROON 0x8000
#define VGA_YELLOW 0xFE40
#define VGA_OLIVE 0x8400
#define VGA_LIME 0x07E0
#define VGA_AQUA 0xBE7F
#define VGA_TEAL 0x0410
#define VGA_NAVY 0x0010
#define VGA_FUCHSIA 0xF81F
#define VGA_PURPLE 0x8010
#define VGA_TRANSPARENT 0xFFFFFFFF
struct propFont
{
byte charCode;
int adjYOffset;
int width;
int height;
int xOffset;
int xDelta;
byte* dataPtr;
};
extern boolean display_writeToImage;
/*########################## PUBLIC PROCEDURES ################################*/
void display_clrScr();
void display_clrXY();
void display_convertFloat(char* buf, double num, int width, byte prec);
void display_drawBitmap(int x, int y, int w, int h, unsigned short *data);
void display_drawCircle(int x, int y, int radius);
void display_drawHLine(int x, int y, int l);
void display_drawLine(int x1, int y1, int x2, int y2);
void display_drawPixel(int x, int y);
void display_drawRect(int x1, int y1, int x2, int y2);
void display_drawRoundRect(int x1, int y1, int x2, int y2);
void display_drawVLine(int x, int y, int l);
void display_enterSleepMode();
void display_exitSleepMode();
void display_fillCircle(int x, int y, int radius);
void display_fillRect(int x1, int y1, int x2, int y2);
void display_fillRoundRect(int x1, int y1, int x2, int y2);
void display_fillScr(word color);
void display_fillScr(byte r, byte g, byte b);
word display_getBackColor();
boolean display_getCharPtr(byte c, propFont& fontChar);
word display_getColor();
int display_getFontHeight();
uint8_t* display_getFont();
uint8_t display_getFontXsize();
uint8_t display_getFontYsize();
int display_getStringWidth(char* str);
byte display_InitLCD();
void display_init();
void display_LCD_Write_DATA(char VH, char VL);
void display_printChar(byte c, int x, int y);
void display_printC(String st, int x, int y, uint32_t color = VGA_BLACK);
void display_printNumF(double num, byte dec, int x, int y, char divider = '.', int length = 0, char filler = ' ');
void display_printNumI(long num, int x, int y, int length = 0, char filler = ' ');
int display_printProportionalChar(byte c, int x, int y);
void display_print(char* st, int x, int y, int deg = 0);
void display_print(String st, int x, int y, int deg = 0);
uint8_t display_readcommand8(uint8_t c, uint8_t index = 0);
void display_rotateChar(byte c, int x, int y, int pos, int deg);
int display_rotatePropChar(byte c, int x, int y, int offset, int deg);
void display_setAddr(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1);
void display_setBackColor(byte r, byte g, byte b);
void display_setBackColor(uint32_t color);
void display_setColor(byte r, byte g, byte b);
void display_setColor(word color);
void display_setFont(const uint8_t* font);
void display_setPixel(word color);
void display_setRotation(uint8_t m);
void display_setXY(word x1, word y1, word x2, word y2);
void display_waitFifoEmpty();
void display_waitFifoNotFull();
void display_maybeUpdateTCR(uint32_t requested_tcr_state);
void display_waitTransmitComplete();
void display_writecommand_cont(uint8_t c);
void display_writecommand_last(uint8_t c);
void display_writedata16_cont(uint16_t d);
void display_writedata16_last(uint16_t d);
void display_writedata8_cont(uint8_t c);
void display_writedata8_last(uint8_t c);
void display_writeRect2BPP(int16_t x, int16_t y, int16_t w, int16_t h, const uint8_t* pixels, const uint16_t* palette);
void display_writeRect4BPP(int16_t x, int16_t y, int16_t w, int16_t h, const uint8_t* pixels, const uint16_t* palette);
void display_writeScreen(unsigned short *pcolors);
#endif /* DISPLAY_H */
================================================
FILE: firmware/3.0/include/firststart.h
================================================
/*
*
* FIRST START - Menu that is displayed on the first device start
*
* DIY-Thermocam Firmware
*
* GNU General Public License v3.0
*
* Copyright by Max Ritter
*
* http://www.diy-thermocam.net
* https://github.com/maxritter/diy-thermocam
*
*/
#ifndef FIRSTSTART_H
#define FIRSTSTART_H
/*########################## PUBLIC PROCEDURES ################################*/
boolean checkFirstStart();
boolean checkLiveModeHelper();
void firstFormat();
void firstStartComplete();
void firstStart();
void infoScreen(String* text, bool cont = true);
void liveModeHelper();
void stdEEPROMSet();
void tempFormatScreen();
void timeDateScreen();
void welcomeScreen();
void convertImageScreen();
#endif /* FIRSTSTART_H */
================================================
FILE: firmware/3.0/include/fonts.h
================================================
/*
*
* Fonts
*
* DIY-Thermocam Firmware
*
* GNU General Public License v3.0
*
* Copyright by Max Ritter
*
* http://www.diy-thermocam.net
* https://github.com/maxritter/diy-thermocam
*
*/
#ifndef FONTS_H
#define FONTS_H
/*################# PUBLIC CONSTANTS, VARIABLES & DATA TYPES ##################*/
extern const uint8_t smallFont[];
extern const uint8_t bigFont[];
#endif /* FONTS_H */
================================================
FILE: firmware/3.0/include/ft6206_touchscreen.h
================================================
/*
*
* FT6206 Touch controller
*
* DIY-Thermocam Firmware
*
* GNU General Public License v3.0
*
* Copyright by Max Ritter
*
* http://www.diy-thermocam.net
* https://github.com/maxritter/diy-thermocam
*
*/
/*################# PUBLIC CONSTANTS, VARIABLES & DATA TYPES ##################*/
#ifndef FT6206_TOUCHSCREEN_H
#define FT6206_TOUCHSCREEN_H
#define FT6206_ADDR 0x38
#define FT6206_G_FT5201ID 0xA8
#define FT6206_REG_NUMTOUCHES 0x02
#define FT6206_NUM_X 0x33
#define FT6206_NUM_Y 0x34
#define FT6206_REG_MODE 0x00
#define FT6206_REG_CALIBRATE 0x02
#define FT6206_REG_WORKMODE 0x00
#define FT6206_REG_FACTORYMODE 0x40
#define FT6206_REG_THRESHHOLD 0x80
#define FT6206_REG_POINTRATE 0x88
#define FT6206_REG_FIRMVERS 0xA6
#define FT6206_REG_CHIPID 0xA3
#define FT6206_REG_VENDID 0xA8
#define FT6206_DEFAULT_THRESSHOLD 128
/*########################## PUBLIC PROCEDURES ################################*/
class FT6206_Touchscreen {
public:
boolean begin(uint8_t thresh = FT6206_DEFAULT_THRESSHOLD);
void writeRegister8(uint8_t reg, uint8_t val);
uint8_t readRegister8(uint8_t reg);
void readData(uint16_t *x, uint16_t *y);
boolean touched(void);
TS_Point getPoint(void);
bool rotated = false;
private:
uint8_t touches;
uint16_t touchX[2], touchY[2], touchID[2];
};
#endif /* FT6206_TOUCHSCREEN_H */
================================================
FILE: firmware/3.0/include/globaldefines.h
================================================
/*
*
* GLOBAL DEFINES - Global defines, that are used firmware-wide
*
* DIY-Thermocam Firmware
*
* GNU General Public License v3.0
*
* Copyright by Max Ritter
*
* http://www.diy-thermocam.net
* https://github.com/maxritter/diy-thermocam
*
*/
#ifndef GLOBALDEFINES_H
#define GLOBALDEFINES_H
#ifdef __cplusplus
extern "C" {
#endif
/*################# PUBLIC CONSTANTS, VARIABLES & DATA TYPES ##################*/
//Pins
#define pin_button 2
#define pin_lepton_vsync 3
#define pin_touch_irq 5
#define pin_touch_cs 9
#define pin_lcd_dc 10
#define pin_mosi 11
#define pin_miso 12
#define pin_sck 13
#define pin_sda 18
#define pin_scl 19
#define pin_lcd_cs 21
#define pin_lcd_backlight 22
#define pin_bat_measure 23
#define pin_mosi1 26
#define pin_sck1 27
#define pin_lepton_cs 38
#define pin_miso1 39
#define pin_usb_measure A16
//FLIR Lepton sensor version
#define leptonVersion_2_5_shutter 0 //FLIR Lepton 2.5 Shuttered
#define leptonVersion_3_5_shutter 1 //FLIR Lepton 3.5 Shuttered
//Temperature format
#define tempFormat_celcius 0
#define tempFormat_fahrenheit 1
//Filter type
#define filterType_none 0
#define filterType_gaussian 1
#define filterType_box 2
//Display Min/Max Points
#define minMaxPoints_disabled 0
#define minMaxPoints_min 1
#define minMaxPoints_max 2
#define minMaxPoints_both 3
//Text color
#define textColor_white 0
#define textColor_black 1
#define textColor_red 2
#define textColor_green 3
#define textColor_blue 4
//Screen off time
#define screenOffTime_disabled 0
#define screenOffTime_5min 1
#define screenOffTime_20min 2
//Hot / cold
#define hotColdMode_disabled 0
#define hotColdMode_cold 1
#define hotColdMode_hot 2
//Hot / cold color
#define hotColdColor_white 0
#define hotColdColor_black 1
#define hotColdColor_red 2
#define hotColdColor_green 3
#define hotColdColor_blue 4
//Lepton Gain mode
#define lepton_gain_high 0
#define lepton_gain_low 1
//EEPROM registers
#define eeprom_leptonVersion 100
#define eeprom_tempFormat 101
#define eeprom_colorScheme 102
#define eeprom_convertEnabled 103
#define eeprom_spotEnabled 105
#define eeprom_colorbarEnabled 106
#define eeprom_batteryEnabled 107
#define eeprom_timeEnabled 108
#define eeprom_dateEnabled 109
#define eeprom_storageEnabled 111
#define eeprom_rotationVert 112
#define eeprom_textColor 114
#define eeprom_filterType 115
#define eeprom_minValue1Low 116
#define eeprom_minValue1High 117
#define eeprom_maxValue1Low 118
#define eeprom_maxValue1High 119
#define eeprom_minMax1Set 120
#define eeprom_adjComb1Left 121
#define eeprom_adjComb1Right 122
#define eeprom_adjComb1Up 123
#define eeprom_adjComb1Down 124
#define eeprom_adjComb1Alpha 125
#define eeprom_adjComb1Set 126
#define eeprom_minMaxPoints 127
#define eeprom_screenOffTime 128
#define eeprom_massStorage 129
#define eeprom_hotColdMode 135
#define eeprom_hotColdLevelLow 136
#define eeprom_hotColdLevelHigh 137
#define eeprom_hotColdColor 138
#define eeprom_firstStart 150
#define eeprom_liveHelper 151
#define eeprom_minValue2Low 154
#define eeprom_minValue2High 155
#define eeprom_maxValue2Low 156
#define eeprom_maxValue2High 157
#define eeprom_minMax2Set 158
#define eeprom_minValue3Low 159
#define eeprom_minValue3High 160
#define eeprom_maxValue3Low 161
#define eeprom_maxValue3High 162
#define eeprom_minMax3Set 163
#define eeprom_minMaxPreset 164
#define eeprom_noShutter 169
#define eeprom_batComp 170
#define eeprom_rotationHorizont 171
#define eeprom_minMax1Comp 172 //4 Byte (172-175)
#define eeprom_minMax2Comp 176 //4 Byte (176-179)
#define eeprom_minMax3Comp 180 //4 Byte (180-183)
#define eeprom_lepton_gain 184
#define eeprom_fwVersionLow 250
#define eeprom_fwVersionHigh 251
#define eeprom_setValue 200
//Presets for min/max
#define minMax_temporary 0
#define minMax_preset1 1
#define minMax_preset2 2
#define minMax_preset3 3
//Hardware diagnostic bit codes
#define diag_display 0
#define diag_touch 1
#define diag_sd 2
#define diag_bat 3
#define diag_lepton 4
#define diag_ok 255
//Color scheme numbers
#define colorSchemeTotal 19
#define colorScheme_arctic 0
#define colorScheme_blackHot 1
#define colorScheme_blueRed 2
#define colorScheme_coldest 3
#define colorScheme_contrast 4
#define colorScheme_doubleRainbow 5
#define colorScheme_grayRed 6
#define colorScheme_glowBow 7
#define colorScheme_grayscale 8
#define colorScheme_hottest 9
#define colorScheme_ironblack 10
#define colorScheme_lava 11
#define colorScheme_medical 12
#define colorScheme_rainbow 13
#define colorScheme_wheel1 14
#define colorScheme_wheel2 15
#define colorScheme_wheel3 16
#define colorScheme_whiteHot 17
#define colorScheme_yellow 18
//Image save marker
#define imgSave_disabled 0
#define imgSave_save 1
#define imgSave_set 2
#define imgSave_create 3
//Video save marker
#define videoSave_disabled 0
#define videoSave_menu 1
#define videoSave_recording 2
#define videoSave_processing 3
//Show menu state
#define showMenu_disabled 0
#define showMenu_desired 1
#define showMenu_opened 2
//Load touch decision marker
#define loadTouch_none 0
#define loadTouch_find 1
#define loadTouch_delete 2
#define loadTouch_previous 3
#define loadTouch_next 4
#define loadTouch_exit 5
#define loadTouch_convert 6
#define loadTouch_middle 7
#ifdef __cplusplus
}
#endif
#endif /* GLOBALDEFINES_H */
================================================
FILE: firmware/3.0/include/globalvariables.h
================================================
/*
*
* GLOBAL VARIABLES - Global variable declarations, that are used firmware-wide
*
* DIY-Thermocam Firmware
*
* GNU General Public License v3.0
*
* Copyright by Max Ritter
*
* http://www.diy-thermocam.net
* https://github.com/maxritter/diy-thermocam
*
*/
#ifndef GLOBALVARIABLES_H
#define GLOBALVARIABLES_H
/*################################# INCLUDES ##################################*/
#include <Metro.h>
#include <Bounce.h>
#include <SdFat.h>
#include <ADC.h>
/*################# PUBLIC CONSTANTS, VARIABLES & DATA TYPES ##################*/
extern char versionString[];
extern uint16_t fwVersion;
extern unsigned short* bigBuffer;
extern unsigned short* smallBuffer;
extern Metro screenOff;
extern boolean screenPressed;
extern byte screenOffTime;
extern Bounce buttonDebouncer;
extern Bounce touchDebouncer;
extern SdFat32 sd;
extern File32 sdFile;
extern String sdInfo;
extern File32 dir;
extern char saveFilename[20];
extern ADC *batMeasure;
extern int8_t batPercentage;
extern long batTimer;
extern int8_t batComp;
extern bool convertEnabled;
extern bool autoMode;
extern bool limitsLocked;
extern bool rotationVert;
extern bool rotationHorizont;
extern bool batteryEnabled;
extern bool timeEnabled;
extern bool dateEnabled;
extern bool spotEnabled;
extern bool colorbarEnabled;
extern bool storageEnabled;
extern byte filterType;
extern byte minMaxPoints;
extern bool tempFormat;
extern byte textColor;
extern bool leptonGainMode;
extern byte leptonVersion;
extern byte diagnostic;
extern byte colorScheme;
extern const byte *colorMap;
extern int16_t colorElements;
extern uint16_t maxValue;
extern uint16_t minValue;
extern float spotTemp;
extern float ambTemp;
extern uint16_t minTempPos;
extern uint16_t minTempVal;
extern uint16_t maxTempPos;
extern uint16_t maxTempVal;
extern byte hotColdMode;
extern int16_t hotColdLevel;
extern byte hotColdColor;
extern uint16_t tempPoints[96][2];
extern bool usbConnected;
extern float leptonCalSlope;
extern volatile byte imgSave;
extern volatile byte videoSave;
extern volatile byte showMenu;
extern volatile bool longTouch;
extern volatile bool serialMode;
extern volatile byte loadTouch;
extern volatile bool leptonBufferValid;
extern volatile bool disableSPIIRQ;
#endif /* GLOBALVARIABLES_H */
================================================
FILE: firmware/3.0/include/gui.h
================================================
/*
*
* GUI - Main Methods to lcd the Graphical-User-Interface
*
* DIY-Thermocam Firmware
*
* GNU General Public License v3.0
*
* Copyright by Max Ritter
*
* http://www.diy-thermocam.net
* https://github.com/maxritter/diy-thermocam
*
*/
#ifndef GUI_H
#define GUI_H
/*########################## PUBLIC PROCEDURES ################################*/
void bootScreen();
void changeTextColor();
void drawCenterElement(int element);
void drawMainMenuBorder();
void drawTitle(char* name, bool firstStart = false);
void floatToChar(char* buffer, float val);
void showDiagnostic();
void showFullMessage(char* message, bool small = false);
void showTransMessage(char* msg);
#endif /* GUI_H */
================================================
FILE: firmware/3.0/include/hardware.h
================================================
/*
*
* HARDWARE - Main hardware functions
*
* DIY-Thermocam Firmware
*
* GNU General Public License v3.0
*
* Copyright by Max Ritter
*
* http://www.diy-thermocam.net
* https://github.com/maxritter/diy-thermocam
*
*/
#ifndef HARDWARE_H
#define HARDWARE_H
/*########################## PUBLIC PROCEDURES ################################*/
void t4_direct_write_low(volatile uint32_t *base, uint32_t mask);
void t4_direct_write_high(volatile uint32_t *base, uint32_t mask);
bool isUSBConnected();
float bytesToFloat(uint8_t* farray);
void checkHardware();
bool checkDiagnostic(byte device);
void checkFWUpgrade();
bool checkScreenLight();
void clearEEPROM();
void disableScreenLight();
void displayBuffer();
void enableScreenLight();
boolean extButtonPressed();
void floatToBytes(uint8_t* farray, float val);
void getSpotTemp();
time_t getTeensy3Time();
void initADC();
void initBuffer();
void initGPIO();
void initHardware();
void initI2C();
void initRTC();
void initScreenOffTimer();
void initSPI();
void readEEPROM();
void readTempLimits();
bool screenOffCheck();
void setDiagnostic(byte device);
void setDisplayRotation();
void toggleDisplay();
boolean touchScreenPressed();
#endif /* HARDWARE_H */
================================================
FILE: firmware/3.0/include/lepton.h
================================================
/*
*
* LEPTON - Access the FLIR Lepton LWIR module
*
* DIY-Thermocam Firmware
*
* GNU General Public License v3.0
*
* Copyright by Max Ritter
*
* http://www.diy-thermocam.net
* https://github.com/maxritter/diy-thermocam
*
*/
#ifndef LEPTON_H
#define LEPTON_H
/*########################## PUBLIC PROCEDURES ################################*/
void lepton_begin();
void lepton_end();
bool lepton_ffc(bool message = false, bool switch_gain = false);
void lepton_ffcMode(bool automatic);
bool lepton_getPacketAsync(uint8_t *line, uint8_t *seg);
void lepton_getFrame();
void lepton_getFrameAsync();
void lepton_init();
int lepton_readReg(byte reg);
void lepton_setReg(byte reg);
float lepton_spotTemp();
bool lepton_version();
void lepton_savePacket(uint8_t line, uint8_t segment = 0);
void lepton_setGpioMode(bool vsync_enabled);
void lepton_setSysGainHigh();
void lepton_setSysGainLow();
void lepton_setSysGainAuto();
int lepton_getSysGainMode();
float lepton_getResolution();
void lepton_setLowGain();
void lepton_setHighGain();
void lepton_startFrame();
void lepton_endFrame();
#endif /* LEPTON_H */
================================================
FILE: firmware/3.0/include/livemode.h
================================================
/*
*
* LIVE MODE - GUI functions used in the live mode
*
* DIY-Thermocam Firmware
*
* GNU General Public License v3.0
*
* Copyright by Max Ritter
*
* http://www.diy-thermocam.net
* https://github.com/maxritter/diy-thermocam
*
*/
#ifndef LIVEMODE_H
#define LIVEMODE_H
/*########################## PUBLIC PROCEDURES ################################*/
void displayBatteryStatus();
void displayDate();
void displayFreeSpace();
void displayInfos();
void displayMinMaxPoint(bool min);
void displayTempMode();
void displayTime();
void showSpot();
#endif /* LIVEMODE_H */
================================================
FILE: firmware/3.0/include/load.h
================================================
/*
*
* LOAD - Load images and videos from the internal storage
*
* DIY-Thermocam Firmware
*
* GNU General Public License v3.0
*
* Copyright by Max Ritter
*
* http://www.diy-thermocam.net
* https://github.com/maxritter/diy-thermocam
*
*/
#ifndef LOAD_H
#define LOAD_H
/*########################## PUBLIC PROCEDURES ################################*/
void checkFileEnding(bool* check, char* filename);
void checkFileStructure(bool* check);
bool checkFileValidity();
void chooseFile(char* filename);
void clearData();
void copyIntoBuffers(char* filename);
bool dayChoose(bool* days, char* filename);
void displayRawData();
bool findFile(char* filename, bool next, bool restart, int* position = 0, char* compare = NULL);
bool hourChoose(bool* hours, char* filename);
bool isImage(char* filename);
void loadAlloc();
void loadBMPImage(char* filename);
void loadDeAlloc();
bool loadDelete(char* filename, int* pos);
void loadFiles();
void loadFind(char* filename, int* pos);
void loadRawData(char* filename);
void loadSettings();
void loadTouchIRQ();
bool minuteChoose(bool* minutes, char* filename);
bool monthChoose(bool* months, char* filename);
void readTempPoints();
void searchFiles();
bool secondChoose(bool* seconds, char* filename);
bool yearChoose(char* filename);
#endif /* LOAD_H */
================================================
FILE: firmware/3.0/include/loadmenu.h
================================================
/*
*
* LOAD MENU - Display the menu to load images and videos
*
* DIY-Thermocam Firmware
*
* GNU General Public License v3.0
*
* Copyright by Max Ritter
*
* http://www.diy-thermocam.net
* https://github.com/maxritter/diy-thermocam
*
*/
#ifndef LOADMENU_H
#define LOADMENU_H
/*########################## PUBLIC PROCEDURES ################################*/
void convertImage(char* filename);
bool convertPrompt();
void convertVideo(char* dirname);
void deleteImage(char* filename);
void deleteVideo(char* dirname);
void displayGUI(uint32_t imgCount, char* infoText);
void displayVideoFrame(uint32_t imgCount);
uint32_t getVideoFrameNumber();
int loadMenu(char* title, int* array, int length);
void openImage(char* filename, uint32_t imgCount);
void playVideo(char* dirname, uint32_t imgCount);
#endif /* LOADMENU_H */
================================================
FILE: firmware/3.0/include/mainmenu.h
================================================
/*
*
* MAIN MENU - Display the main menu with icons
*
* DIY-Thermocam Firmware
*
* GNU General Public License v3.0
*
* Copyright by Max Ritter
*
* http://www.diy-thermocam.net
* https://github.com/maxritter/diy-thermocam
*
*/
#ifndef MAINMENU_H
#define MAINMENU_H
/*########################## PUBLIC PROCEDURES ################################*/
bool calibrationRepeat();
void calibrationScreen(bool firstStart = false);
bool colorMenu();
void colorMenuString(int pos);
void drawMainMenu(byte pos);
void drawSelectionMenu();
void hotColdChooserHandler();
void hotColdChooser();
bool hotColdColorMenu();
void hotColdColorMenuString(int pos);
bool hotColdMenu();
bool liveDispMenu();
void liveDispMenuString(int pos);
void mainMenuBackground();
void mainMenuHandler(byte* pos);
bool mainMenuSelect(byte pos, byte page);
void mainMenuSelection(char* selection);
void mainMenuTitle(char* title);
void mainMenu();
bool massStoragePrompt();
bool tempLimits();
bool tempLimitsManualHandler();
void tempLimitsManual();
bool tempLimitsPresetSaveMenu();
void tempLimitsPresetSaveString(int pos);
bool tempLimitsPresets();
void tempLimitsPresetsString(int pos);
bool tempPointsMenu();
#endif /* MAINMENU_H */
================================================
FILE: firmware/3.0/include/massstorage.h
================================================
/*
*
* MASS STORAGE - Mass storage mode to connect the internal storage to the PC
*
* DIY-Thermocam Firmware
*
* GNU General Public License v3.0
*
* Copyright by Max Ritter
*
* http://www.diy-thermocam.net
* https://github.com/maxritter/diy-thermocam
*
*/
#ifndef MASSSTORAGE_H
#define MASSSTORAGE_H
#include <Arduino.h>
/*########################## PUBLIC PROCEDURES ################################*/
void enterMassStorage();
void setMassStorage();
void checkMassStorage();
#endif /* MASSSTORAGE_H */
================================================
FILE: firmware/3.0/include/save.h
================================================
/*
*
* SAVE - Save images and videos to the internal storage
*
* DIY-Thermocam Firmware
*
* GNU General Public License v3.0
*
* Copyright by Max Ritter
*
* http://www.diy-thermocam.net
* https://github.com/maxritter/diy-thermocam
*
*/
#ifndef SAVE_H
#define SAVE_H
/*########################## PUBLIC PROCEDURES ################################*/
void createSDName(char* filename, boolean folder = false);
void frameFilename(char* filename, uint32_t count);
void imgSaveEnd();
void imgSaveStart();
void processVideoFrames(uint32_t framesCaptured, char* dirname);
void saveBuffer(char* filename);
void saveRawData(bool isImage, char* name, uint32_t framesCaptured = 0);
void saveVideoFrame(char* filename);
#endif /* SAVE_H */
================================================
FILE: firmware/3.0/include/sdcard.h
================================================
/*
*
* SD Card - Methods to access the internal SD storage
*
* DIY-Thermocam Firmware
*
* GNU General Public License v3.0
*
* Copyright by Max Ritter
*
* http://www.diy-thermocam.net
* https://github.com/maxritter/diy-thermocam
*
*/
#ifndef SD_H
#define SD_H
/*########################## PUBLIC PROCEDURES ################################*/
bool beginSD();
void clearCache(uint8_t addSig);
void clearFatDir(uint32_t bgn, uint32_t count);
void dateTime(uint16_t* date, uint16_t* time);
bool formatCard();
void formatFAT16();
void formatFAT32();
uint32_t getCardSize();
uint32_t getSDSpace();
void initSD();
uint16_t lbnToCylinder(uint32_t lbn);
uint8_t lbnToHead(uint32_t lbn);
uint8_t lbnToSector(uint32_t lbn);
void refreshFreeSpace();
uint32_t volSerialNumber();
uint8_t writeCache(uint32_t lbn);
void writeMbr();
#endif /* SD_H */
================================================
FILE: firmware/3.0/include/settingsmenu.h
================================================
/*
*
* SETTINGS MENU - Adjust different on-device settings
*
* DIY-Thermocam Firmware
*
* GNU General Public License v3.0
*
* Copyright by Max Ritter
*
* http://www.diy-thermocam.net
* https://github.com/maxritter/diy-thermocam
*
*/
#ifndef SETTINGSMENU_H
#define SETTINGSMENU_H
/*########################## PUBLIC PROCEDURES ################################*/
void batteryGauge();
void convertImageMenu(bool firstStart = false);
void dateMenuHandler(bool firstStart = false);
void dateMenu(bool firstStart = false);
void dayMenu(bool firstStart);
void displayMenuHandler();
void displayMenu();
void formatStorage();
void hourMenu(bool firstStart);
void minuteMenu(bool firstStart);
void monthMenu(bool firstStart);
void generalMenuHandler();
void generalMenu();
void rotateDisplayMenu(bool firstStart = false);
void screenTimeoutMenu();
void secondMenu(bool firstStart);
void settingsMenuHandler();
void settingsMenu();
void hardwareMenuHandler();
void hardwareMenu();
void tempFormatMenu(bool firstStart = false);
void timeMenuHandler(bool firstStart = false);
void timeMenu(bool firstStart = false);
void yearMenu(bool firstStart);
#endif /* SETTINGSMENU_H */
================================================
FILE: firmware/3.0/include/temperature.h
================================================
/*
*
* TEMPERATURE - Functions to convert Lepton raw values to absolute temperatures and back
*
* DIY-Thermocam Firmware
*
* GNU General Public License v3.0
*
* Copyright by Max Ritter
*
* http://www.diy-thermocam.net
* https://github.com/maxritter/diy-thermocam
*
*/
#ifndef CALIBRATION_H
#define CALIBRATION_H
#include <Arduino.h>
/*########################## PUBLIC PROCEDURES ################################*/
uint16_t calcAverage();
float rawToTemp(uint16_t rawValue);
float celciusToFahrenheit(float Tc);
float fahrenheitToCelcius(float Tf);
uint16_t tempToRaw(float temp);
#endif /* CALIBRATION_H */
================================================
FILE: firmware/3.0/include/thermal.h
================================================
/*
*
* THERMAL - Main functions in the live mode
*
* DIY-Thermocam Firmware
*
* GNU General Public License v3.0
*
* Copyright by Max Ritter
*
* http://www.diy-thermocam.net
* https://github.com/maxritter/diy-thermocam
*
*/
#ifndef THERMAL_H
#define THERMAL_H
/*########################## PUBLIC PROCEDURES ################################*/
void buttonIRQ();
void changeColorScheme(byte* pos);
void changeDisplayOptions(byte* pos);
void liveModeInit();
void liveMode();
void longTouchHandler();
void selectColorScheme();
void showColorBar();
void showImage();
void touchIRQ();
#endif /* THERMAL_H */
================================================
FILE: firmware/3.0/include/touchscreen.h
================================================
/*
*
* Touchscreen - FT6206 or XPT2046 controller
*
* DIY-Thermocam Firmware
*
* GNU General Public License v3.0
*
* Copyright by Max Ritter
*
* http://www.diy-thermocam.net
* https://github.com/maxritter/diy-thermocam
*
*/
#ifndef TOUCHSCREEN_H
#define TOUCHSCREEN_H
/*################# PUBLIC CONSTANTS, VARIABLES & DATA TYPES ##################*/
class TS_Point {
public:
TS_Point(void) : x(0), y(0), z(0) {}
TS_Point(int16_t x, int16_t y, int16_t z) : x(x), y(y), z(z) {}
bool operator==(TS_Point p) { return ((p.x == x) && (p.y == y) && (p.z == z)); }
bool operator!=(TS_Point p) { return ((p.x != x) || (p.y != y) || (p.z != z)); }
int16_t x, y, z;
};
extern volatile bool touch_capacitive;
/*########################## PUBLIC PROCEDURES ################################*/
TS_Point touch_getPoint();
void touch_init();
void touch_setRotation(bool rotated);
volatile bool touch_touched();
#endif /* TOUCHSCREEN_H */
================================================
FILE: firmware/3.0/include/videomenu.h
================================================
/*
*
* VIDEO MENU - Record single frames or time interval videos
*
* DIY-Thermocam Firmware
*
* GNU General Public License v3.0
*
* Copyright by Max Ritter
*
* http://www.diy-thermocam.net
* https://github.com/maxritter/diy-thermocam
*
*/
#ifndef VIDEOMENU_H
#define VIDEOMENU_H
/*########################## PUBLIC PROCEDURES ################################*/
void videoCaptureInterval(int16_t* remainingTime, uint32_t* framesCaptured, uint16_t* folderFrames, char* buffer, char* dirName);
void videoCaptureNormal(uint32_t* framesCaptured, uint16_t* folderFrames, char* buffer, char* dirName);
void videoCapture();
bool videoIntervalChooser();
bool videoIntervalHandler(byte* pos);
void videoIntervalString(int pos);
void videoMode();
#endif /* VIDEOMENU_H */
================================================
FILE: firmware/3.0/include/xpt2046_touchscreen.h
================================================
/*
*
* FT6206 Touch controller
*
* DIY-Thermocam Firmware
*
* GNU General Public License v3.0
*
* Copyright by Max Ritter
*
* http://www.diy-thermocam.net
* https://github.com/maxritter/diy-thermocam
*
*/
#ifndef XPT2046_TOUCHSCREEN_H
#define XPT2046_TOUCHSCREEN_H
/*########################## PUBLIC PROCEDURES ################################*/
class XPT2046_Touchscreen {
public:
XPT2046_Touchscreen();
bool begin();
TS_Point getPoint();
bool touched();
void readData(uint16_t *x, uint16_t *y, uint8_t *z);
bool bufferEmpty();
uint8_t bufferSize() { return 1; }
bool isrWake;
bool rotated = false;
private:
void update();
uint8_t csPin, tirqPin;
int16_t xraw, yraw, zraw;
uint32_t msraw;
};
#endif /* XPT2046_TOUCHSCREEN_H */
================================================
FILE: firmware/3.0/lib/ADC/ADC.cpp
================================================
/* Teensy 4.x, 3.x, LC ADC library
* https://github.com/pedvide/ADC
* Copyright (c) 2020 Pedro Villanueva
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/* ADC.cpp: Implements the control of one or more ADC modules of Teensy 3.x, LC
*
*/
#include "ADC.h"
// translate pin number to SC1A nomenclature and viceversa
// we need to create this static const arrays so that we can assign the "normal arrays" to the correct one
// depending on which ADC module we will be.
/* channel2sc1aADCx converts a pin number to their value for the SC1A register, for the ADC0 and ADC1
* numbers with +ADC_SC1A_PIN_MUX (128) means those pins use mux a, the rest use mux b.
* numbers with +ADC_SC1A_PIN_DIFF (64) means it's also a differential pin (treated also in the channel2sc1a_diff_ADCx)
* For diff_table_ADCx, +ADC_SC1A_PIN_PGA means the pin can use PGA on that ADC
*/
///////// ADC0
#if defined(ADC_TEENSY_3_0)
const uint8_t ADC::channel2sc1aADC0[] = {
// new version, gives directly the sc1a number. 0x1F=31 deactivates the ADC.
5, 14, 8, 9, 13, 12, 6, 7, 15, 4, 0, 19, 3, 21, // 0-13, we treat them as A0-A13
5, 14, 8, 9, 13, 12, 6, 7, 15, 4, // 14-23 (A0-A9)
31, 31, 31, 31, 31, 31, 31, 31, 31, 31, // 24-33
0 + ADC_SC1A_PIN_DIFF, 19 + ADC_SC1A_PIN_DIFF, 3 + ADC_SC1A_PIN_DIFF, 21 + ADC_SC1A_PIN_DIFF, // 34-37 (A10-A13)
26, 22, 23, 27, 29, 30 // 38-43: temp. sensor, VREF_OUT, A14, bandgap, VREFH, VREFL. A14 isn't connected to anything in Teensy 3.0.
};
#elif defined(ADC_TEENSY_3_1) // the only difference with 3.0 is that A13 is not connected to ADC0 and that T3.1 has PGA.
const uint8_t ADC::channel2sc1aADC0[] = {
// new version, gives directly the sc1a number. 0x1F=31 deactivates the ADC.
5, 14, 8, 9, 13, 12, 6, 7, 15, 4, 0, 19, 3, 31, // 0-13, we treat them as A0-A13
5, 14, 8, 9, 13, 12, 6, 7, 15, 4, // 14-23 (A0-A9)
31, 31, 31, 31, 31, 31, 31, 31, 31, 31, // 24-33
0 + ADC_SC1A_PIN_DIFF, 19 + ADC_SC1A_PIN_DIFF, 3 + ADC_SC1A_PIN_DIFF, 31 + ADC_SC1A_PIN_DIFF, // 34-37 (A10-A13)
26, 22, 23, 27, 29, 30 // 38-43: temp. sensor, VREF_OUT, A14, bandgap, VREFH, VREFL. A14 isn't connected to anything in Teensy 3.0.
};
#elif defined(ADC_TEENSY_LC)
// Teensy LC
const uint8_t ADC::channel2sc1aADC0[] = {
// new version, gives directly the sc1a number. 0x1F=31 deactivates the ADC.
5, 14, 8, 9, 13, 12, 6, 7, 15, 11, 0, 4 + ADC_SC1A_PIN_MUX, 23, 31, // 0-13, we treat them as A0-A12 + A13= doesn't exist
5, 14, 8, 9, 13, 12, 6, 7, 15, 11, // 14-23 (A0-A9)
0 + ADC_SC1A_PIN_DIFF, 4 + ADC_SC1A_PIN_MUX + ADC_SC1A_PIN_DIFF, 23, 31, 31, 31, 31, 31, 31, 31, // 24-33 ((A10-A12) + nothing), A11 uses mux a
31, 31, 31, 31, // 34-37 nothing
26, 27, 31, 27, 29, 30 // 38-43: temp. sensor, , , bandgap, VREFH, VREFL.
};
#elif defined(ADC_TEENSY_3_5)
const uint8_t ADC::channel2sc1aADC0[] = {
// new version, gives directly the sc1a number. 0x1F=31 deactivates the ADC.
5, 14, 8, 9, 13, 12, 6, 7, 15, 4, 3, 31, 31, 31, // 0-13, we treat them as A0-A13
5, 14, 8, 9, 13, 12, 6, 7, 15, 4, // 14-23 (A0-A9)
26, 27, 29, 30, 31, 31, 31, // 24-30: Temp_Sensor, bandgap, VREFH, VREFL.
31, 31, 17, 18, // 31-34 A12(ADC1), A13(ADC1), A14, A15
31, 31, 31, 31, 31, 31, 31, 31, 31, // 35-43
31, 31, 31, 31, 31, 31, 31, 31, 31, // 44-52
31, 31, 31, 31, 31, 31, 31, 31, 31, // 53-61
31, 31, 3 + ADC_SC1A_PIN_DIFF, 31 + ADC_SC1A_PIN_DIFF, 23, 31, 1, 31 // 62-69 64: A10, 65: A11 (NOT CONNECTED), 66: A21, 68: A25 (no diff)
};
#elif defined(ADC_TEENSY_3_6)
const uint8_t ADC::channel2sc1aADC0[] = {
// new version, gives directly the sc1a number. 0x1F=31 deactivates the ADC.
5, 14, 8, 9, 13, 12, 6, 7, 15, 4, 3, 31, 31, 31, // 0-13, we treat them as A0-A13
5, 14, 8, 9, 13, 12, 6, 7, 15, 4, // 14-23 (A0-A9)
26, 27, 29, 30, 31, 31, 31, // 24-30: Temp_Sensor, bandgap, VREFH, VREFL.
31, 31, 17, 18, // 31-34 A12(ADC1), A13(ADC1), A14, A15
31, 31, 31, 31, 31, 31, 31, 31, 31, // 35-43
31, 31, 31, 31, 31, 31, 31, 31, 31, // 44-52
31, 31, 31, 31, 31, 31, 31, 31, 31, // 53-61
31, 31, 3 + ADC_SC1A_PIN_DIFF, 31 + ADC_SC1A_PIN_DIFF, 23, 31 // 62-67 64: A10, 65: A11 (NOT CONNECTED), 66: A21, 67: A22(ADC1)
};
#elif defined(ADC_TEENSY_4_0)
const uint8_t ADC::channel2sc1aADC0[] = {
// new version, gives directly the sc1a number. 0x1F=31 deactivates the ADC.
7, 8, 12, 11, 6, 5, 15, 0, 13, 14, 1, 2, 31, 31, // 0-13, we treat them as A0-A13
7, 8, 12, 11, 6, 5, 15, 0, 13, 14, // 14-23 (A0-A9)
1, 2, 31, 31 // A10, A11, A12, A13
};
#elif defined(ADC_TEENSY_4_1)
const uint8_t ADC::channel2sc1aADC0[] = {
// new version, gives directly the sc1a number. 0x1F=31 deactivates the ADC.
7, 8, 12, 11, 6, 5, 15, 0, 13, 14, 1, 2, 31, 31, // 0-13, we treat them as A0-A13
7, 8, 12, 11, 6, 5, 15, 0, 13, 14, // 14-23 (A0-A9)
1, 2, 31, 31, // A10, A11, A12, A13
31, 31, 31, 31, 31, 31, 31, 31, 31, 31, //
31, 31, 9, 10 // A14, A15, A16, A17
};
#endif // defined
///////// ADC1
#if defined(ADC_TEENSY_3_1)
const uint8_t ADC::channel2sc1aADC1[] = {
// new version, gives directly the sc1a number. 0x1F=31 deactivates the ADC.
31, 31, 8, 9, 31, 31, 31, 31, 31, 31, 3, 31, 0, 19, // 0-13, we treat them as A0-A13
31, 31, 8, 9, 31, 31, 31, 31, 31, 31, // 14-23 (A0-A9)
31, 31, // 24,25 are digital only pins
5 + ADC_SC1A_PIN_MUX, 5, 4, 6, 7, 4 + ADC_SC1A_PIN_MUX, 31, 31, // 26-33 26=5a, 27=5b, 28=4b, 29=6b, 30=7b, 31=4a, 32,33 are digital only
3 + ADC_SC1A_PIN_DIFF, 31 + ADC_SC1A_PIN_DIFF, 0 + ADC_SC1A_PIN_DIFF, 19 + ADC_SC1A_PIN_DIFF, // 34-37 (A10-A13) A11 isn't connected.
26, 18, 31, 27, 29, 30 // 38-43: temp. sensor, VREF_OUT, A14 (not connected), bandgap, VREFH, VREFL.
};
#elif defined(ADC_TEENSY_3_5)
const uint8_t ADC::channel2sc1aADC1[] = {
// new version, gives directly the sc1a number. 0x1F=31 deactivates the ADC.
31, 31, 8, 9, 31, 31, 31, 31, 31, 31, 31, 19, 14, 15, // 0-13, we treat them as A0-A13
31, 31, 8, 9, 31, 31, 31, 31, 31, 31, // 14-23 (A0-A9)
26, 27, 29, 30, 18, 31, 31, // 24-30: Temp_Sensor, bandgap, VREFH, VREFL, VREF_OUT
14, 15, 31, 31, 4, 5, 6, 7, 17, // 31-39 A12-A20
31, 31, 31, 31, // 40-43
31, 31, 31, 31, 31, 10, 11, 31, 31, // 44-52, 49: A23, 50: A24
31, 31, 31, 31, 31, 31, 31, 31, 31, // 53-61
31, 31, 0 + ADC_SC1A_PIN_DIFF, 19 + ADC_SC1A_PIN_DIFF, 31, 23, 31, 1 // 62-69 64: A10, 65: A11, 67: A22, 69: A26 (not diff)
};
#elif defined(ADC_TEENSY_3_6)
const uint8_t ADC::channel2sc1aADC1[] = {
// new version, gives directly the sc1a number. 0x1F=31 deactivates the ADC.
31, 31, 8, 9, 31, 31, 31, 31, 31, 31, 31, 19, 14, 15, // 0-13, we treat them as A0-A13
31, 31, 8, 9, 31, 31, 31, 31, 31, 31, // 14-23 (A0-A9)
26, 27, 29, 30, 18, 31, 31, // 24-30: Temp_Sensor, bandgap, VREFH, VREFL, VREF_OUT
14, 15, 31, 31, 4, 5, 6, 7, 17, // 31-39 A12-A20
31, 31, 31, 23, // 40-43: A10(ADC0), A11(ADC0), A21, A22
31, 31, 31, 31, 31, 10, 11, 31, 31, // 44-52, 49: A23, 50: A24
31, 31, 31, 31, 31, 31, 31, 31, 31, // 53-61
31, 31, 0 + ADC_SC1A_PIN_DIFF, 19 + ADC_SC1A_PIN_DIFF, 31, 23 // 61-67 64: A10, 65: A11, 66: A21(ADC0), 67: A22
};
#elif defined(ADC_TEENSY_4_0)
const uint8_t ADC::channel2sc1aADC1[] = {
// new version, gives directly the sc1a number. 0x1F=31 deactivates the ADC.
7, 8, 12, 11, 6, 5, 15, 0, 13, 14, 31, 31, 3, 4, // 0-13, we treat them as A0-A13
7, 8, 12, 11, 6, 5, 15, 0, 13, 14, // 14-23 (A0-A9)
31, 31, 3, 4 // A10, A11, A12, A13
};
#elif defined(ADC_TEENSY_4_1)
const uint8_t ADC::channel2sc1aADC1[] = {
// new version, gives directly the sc1a number. 0x1F=31 deactivates the ADC.
7, 8, 12, 11, 6, 5, 15, 0, 13, 14, 31, 31, 3, 4, // 0-13, we treat them as A0-A13
7, 8, 12, 11, 6, 5, 15, 0, 13, 14, // 14-23 (A0-A9)
31, 31, 3, 4, // A10, A11, A12, A13
31, 31, 31, 31, 31, 31, 31, 31, 31, 31, //
1, 2, 9, 10 // A14, A15, A16, A17
};
#endif
#if defined(ADC_TEENSY_3_1) // Teensy 3.1
const ADC_Module::ADC_NLIST ADC::diff_table_ADC0[] = {
{A10, 0 + ADC_SC1A_PIN_PGA}, {A12, 3}};
const ADC_Module::ADC_NLIST ADC::diff_table_ADC1[] = {
{A10, 3}, {A12, 0 + ADC_SC1A_PIN_PGA}};
#elif defined(ADC_TEENSY_3_0) // Teensy 3.0
const ADC_Module::ADC_NLIST ADC::diff_table_ADC0[] = {
{A10, 0}, {A12, 3}};
#elif defined(ADC_TEENSY_LC) // Teensy LC
const ADC_Module::ADC_NLIST ADC::diff_table_ADC0[] = {
{A10, 0}};
#elif defined(ADC_TEENSY_3_5) || defined(ADC_TEENSY_3_6) // Teensy 3.6// Teensy 3.5
const ADC_Module::ADC_NLIST ADC::diff_table_ADC0[] = {
{A10, 3}};
const ADC_Module::ADC_NLIST ADC::diff_table_ADC1[] = {
{A10, 0}};
#elif defined(ADC_TEENSY_4)
#endif
// translate SC1A to pin number
///////// ADC0
#if defined(ADC_TEENSY_3_0) || defined(ADC_TEENSY_3_1)
const uint8_t ADC::sc1a2channelADC0[] = {
// new version, gives directly the pin number
34, 0, 0, 36, 23, 14, 20, 21, 16, 17, 0, 0, 19, 18, // 0-13
15, 22, 23, 0, 0, 35, 0, 37, // 14-21
39, 40, 0, 0, 38, 41, 42, 43, // VREF_OUT, A14, temp. sensor, bandgap, VREFH, VREFL.
0 // 31 means disabled, but just in case
};
#elif defined(ADC_TEENSY_LC)
// Teensy LC
const uint8_t ADC::sc1a2channelADC0[] = {
// new version, gives directly the pin number
24, 0, 0, 0, 25, 14, 20, 21, 16, 17, 0, 23, 19, 18, // 0-13
15, 22, 23, 0, 0, 0, 0, 0, // 14-21
26, 0, 0, 0, 38, 41, 0, 42, 43, // A12, temp. sensor, bandgap, VREFH, VREFL.
0 // 31 means disabled, but just in case
};
#elif defined(ADC_TEENSY_3_5) || defined(ADC_TEENSY_3_6)
const uint8_t ADC::sc1a2channelADC0[] = {
// new version, gives directly the pin number
0, 68, 0, 64, 23, 14, 20, 21, 16, 17, 0, 0, 19, 18, // 0-13
15, 22, 0, 33, 34, 0, 0, 0, // 14-21
0, 66, 0, 0, 70, 0, 0, 0, // 22-29
0 // 31 means disabled, but just in case
};
#elif defined(ADC_TEENSY_4_0)
const uint8_t ADC::sc1a2channelADC0[] = {
// new version, gives directly the pin number
21, 24, 25, 0, 0, 19, 18, 14, 15, 0, 0, 17, 16, 22,
23, 20, 0, 0, 0, 0, 0, 0, //14-21
0, 0, 0, 0, 0, 0 //22-27
};
#elif defined(ADC_TEENSY_4_1)
const uint8_t ADC::sc1a2channelADC0[] = {
// new version, gives directly the pin number
21, 24, 25, 0, 0, 19, 18, 14, 15, 0, 0, 17, 16, 22,
23, 20, 0, 0, 0, 0, 0, 0, //14-21
0, 0, 0, 0, 0, 0 //22-27
};
#endif // defined
///////// ADC1
#if defined(ADC_TEENSY_3_1)
const uint8_t ADC::sc1a2channelADC1[] = { // new version, gives directly the pin number
36, 0, 0, 34, 28, 26, 29, 30, 16, 17, 0, 0, 0, 0, // 0-13. 5a=26, 5b=27, 4b=28, 4a=31
0, 0, 0, 0, 39, 37, 0, 0, // 14-21
0, 0, 0, 0, 38, 41, 0, 42, // 22-29. VREF_OUT, A14, temp. sensor, bandgap, VREFH, VREFL.
43};
#elif defined(ADC_TEENSY_3_5) || defined(ADC_TEENSY_3_6)
const uint8_t ADC::sc1a2channelADC1[] = { // new version, gives directly the pin number
0, 69, 0, 0, 35, 36, 37, 38, 0, 0, 49, 50, 0, 0, // 0-13.
31, 32, 0, 39, 71, 65, 0, 0, // 14-21
0, 67, 0, 0, 0, 0, 0, 0, // 22-29.
0};
#elif defined(ADC_TEENSY_4_0)
const uint8_t ADC::sc1a2channelADC1[] = {
// new version, gives directly the pin number
21, 0, 0, 26, 27, 19, 18, 14, 15, 0, 0, 17, 16, 22, // 0-13
23, 20, 0, 0, 0, 0, 0, 0, //14-21
0, 0, 0, 0, 0, 0 //22-27
};
#elif defined(ADC_TEENSY_4_1)
const uint8_t ADC::sc1a2channelADC1[] = {
// new version, gives directly the pin number
21, 0, 0, 26, 27, 19, 18, 14, 15, 0, 0, 17, 16, 22, // 0-13
23, 20, 0, 0, 0, 0, 0, 0, //14-21
0, 0, 0, 0, 0, 0 //22-27
};
#endif
// Constructor
ADC::ADC() : // awkward initialization so there are no -Wreorder warnings
#if ADC_DIFF_PAIRS > 0
adc0_obj(0, channel2sc1aADC0, diff_table_ADC0, ADC0_START)
#ifdef ADC_DUAL_ADCS
,
adc1_obj(1, channel2sc1aADC1, diff_table_ADC1, ADC1_START)
#endif
#else
adc0_obj(0, channel2sc1aADC0, ADC0_START)
#ifdef ADC_DUAL_ADCS
,
adc1_obj(1, channel2sc1aADC1, ADC1_START)
#endif
#endif
{
//ctor
//digitalWriteFast(LED_BUILTIN, HIGH);
}
/* Returns the analog value of the pin.
* It waits until the value is read and then returns the result.
* If a comparison has been set up and fails, it will return ADC_ERROR_VALUE.
* This function is interrupt safe, so it will restore the adc to the state it was before being called
* If more than one ADC exists, it will select the module with less workload, you can force a selection using
* adc_num. If you select ADC1 in Teensy 3.0 it will return ADC_ERROR_VALUE.
*/
int ADC::analogRead(uint8_t pin, int8_t adc_num)
{
#ifdef ADC_SINGLE_ADC
return adc0->analogRead(pin); // use ADC0
#else
/* Teensy 3.1
*/
if (adc_num == -1)
{ // use no ADC in particular
// check which ADC can read the pin
bool adc0Pin = adc0->checkPin(pin);
bool adc1Pin = adc1->checkPin(pin);
if (adc0Pin && adc1Pin)
{ // Both ADCs
if ((adc0->num_measurements) > (adc1->num_measurements))
{ // use the ADC with less workload
return adc1->analogRead(pin);
}
else
{
return adc0->analogRead(pin);
}
}
else if (adc0Pin)
{ // ADC0
return adc0->analogRead(pin);
}
else if (adc1Pin)
{ // ADC1
return adc1->analogRead(pin);
}
else
{ // pin not valid in any ADC
adc0->fail_flag |= ADC_ERROR::WRONG_PIN;
adc1->fail_flag |= ADC_ERROR::WRONG_PIN;
return ADC_ERROR_VALUE; // all others are invalid
}
}
else if (adc_num == 0)
{ // user wants ADC0
return adc0->analogRead(pin);
}
else if (adc_num == 1)
{ // user wants ADC 1
return adc1->analogRead(pin);
}
adc0->fail_flag |= ADC_ERROR::OTHER;
return ADC_ERROR_VALUE;
#endif
}
#if ADC_DIFF_PAIRS > 0
/* Reads the differential analog value of two pins (pinP - pinN).
* It waits until the value is read and then returns the result.
* If a comparison has been set up and fails, it will return ADC_ERROR_VALUE.
* \param pinP must be A10 or A12.
* \param pinN must be A11 (if pinP=A10) or A13 (if pinP=A12).
* Other pins will return ADC_ERROR_VALUE.
* This function is interrupt safe, so it will restore the adc to the state it was before being called
* If more than one ADC exists, it will select the module with less workload, you can force a selection using
* adc_num. If you select ADC1 in Teensy 3.0 it will return ADC_ERROR_VALUE.
*/
int ADC::analogReadDifferential(uint8_t pinP, uint8_t pinN, int8_t adc_num)
{
#ifdef ADC_SINGLE_ADC
return adc0->analogReadDifferential(pinP, pinN); // use ADC0
#else
/* Teensy 3.1
*/
if (adc_num == -1)
{ // use no ADC in particular
// check which ADC can read the pin
bool adc0Pin = adc0->checkDifferentialPins(pinP, pinN);
bool adc1Pin = adc1->checkDifferentialPins(pinP, pinN);
if (adc0Pin && adc1Pin)
{ // Both ADCs
if ((adc0->num_measurements) > (adc1->num_measurements))
{ // use the ADC with less workload
return adc1->analogReadDifferential(pinP, pinN);
}
else
{
return adc0->analogReadDifferential(pinP, pinN);
}
}
else if (adc0Pin)
{ // ADC0
return adc0->analogReadDifferential(pinP, pinN);
}
else if (adc1Pin)
{ // ADC1
return adc1->analogReadDifferential(pinP, pinN);
}
else
{ // pins not valid in any ADC
adc0->fail_flag |= ADC_ERROR::WRONG_PIN;
adc1->fail_flag |= ADC_ERROR::WRONG_PIN;
return ADC_ERROR_VALUE; // all others are invalid
}
}
else if (adc_num == 0)
{ // user wants ADC0
return adc0->analogReadDifferential(pinP, pinN);
}
else if (adc_num == 1)
{ // user wants ADC 1
return adc1->analogReadDifferential(pinP, pinN);
}
adc0->fail_flag |= ADC_ERROR::OTHER;
return ADC_ERROR_VALUE;
#endif
}
#endif
// Starts an analog measurement on the pin and enables interrupts.
/* It returns immediately, get value with readSingle().
* If the pin is incorrect it returns ADC_ERROR_VALUE
* This function is interrupt safe. The ADC interrupt will restore the adc to its previous settings and
* restart the adc if it stopped a measurement. If you modify the adc_isr then this won't happen.
*/
bool ADC::startSingleRead(uint8_t pin, int8_t adc_num)
{
#ifdef ADC_SINGLE_ADC
return adc0->startSingleRead(pin); // use ADC0
#else
/* Teensy 3.1
*/
if (adc_num == -1)
{ // use no ADC in particular
// check which ADC can read the pin
bool adc0Pin = adc0->checkPin(pin);
bool adc1Pin = adc1->checkPin(pin);
if (adc0Pin && adc1Pin)
{ // Both ADCs
if ((adc0->num_measurements) > (adc1->num_measurements))
{ // use the ADC with less workload
return adc1->startSingleRead(pin);
}
else
{
return adc0->startSingleRead(pin);
}
}
else if (adc0Pin)
{ // ADC0
return adc0->startSingleRead(pin);
}
else if (adc1Pin)
{ // ADC1
return adc1->startSingleRead(pin);
}
else
{ // pin not valid in any ADC
adc0->fail_flag |= ADC_ERROR::WRONG_PIN;
adc1->fail_flag |= ADC_ERROR::WRONG_PIN;
return false; // all others are invalid
}
}
else if (adc_num == 0)
{ // user wants ADC0
return adc0->startSingleRead(pin);
}
else if (adc_num == 1)
{ // user wants ADC 1
return adc1->startSingleRead(pin);
}
adc0->fail_flag |= ADC_ERROR::OTHER;
return false;
#endif
}
#if ADC_DIFF_PAIRS > 0
// Start a differential conversion between two pins (pinP - pinN) and enables interrupts.
/* It returns inmediately, get value with readSingle().
* \param pinP must be A10 or A12.
* \param pinN must be A11 (if pinP=A10) or A13 (if pinP=A12).
* Other pins will return ADC_ERROR_DIFF_VALUE.
* This function is interrupt safe. The ADC interrupt will restore the adc to its previous settings and
* restart the adc if it stopped a measurement. If you modify the adc_isr then this won't happen.
*/
bool ADC::startSingleDifferential(uint8_t pinP, uint8_t pinN, int8_t adc_num)
{
#ifdef ADC_SINGLE_ADC
return adc0->startSingleDifferential(pinP, pinN); // use ADC0
#else
/* Teensy 3.1
*/
if (adc_num == -1)
{ // use no ADC in particular
// check which ADC can read the pin
bool adc0Pin = adc0->checkDifferentialPins(pinP, pinN);
bool adc1Pin = adc1->checkDifferentialPins(pinP, pinN);
if (adc0Pin && adc1Pin)
{ // Both ADCs
if ((adc0->num_measurements) > (adc1->num_measurements))
{ // use the ADC with less workload
return adc1->startSingleDifferential(pinP, pinN);
}
else
{
return adc0->startSingleDifferential(pinP, pinN);
}
}
else if (adc0Pin)
{ // ADC0
return adc0->startSingleDifferential(pinP, pinN);
}
else if (adc1Pin)
{ // ADC1
return adc1->startSingleDifferential(pinP, pinN);
}
else
{ // pins not valid in any ADC
adc0->fail_flag |= ADC_ERROR::WRONG_PIN;
adc1->fail_flag |= ADC_ERROR::WRONG_PIN;
return false; // all others are invalid
}
}
else if (adc_num == 0)
{ // user wants ADC0
return adc0->startSingleDifferential(pinP, pinN);
}
else if (adc_num == 1)
{ // user wants ADC 1
return adc1->startSingleDifferential(pinP, pinN);
}
adc0->fail_flag |= ADC_ERROR::OTHER;
return false;
#endif
}
#endif
// Reads the analog value of a single conversion.
/* Set the conversion with with startSingleRead(pin) or startSingleDifferential(pinP, pinN).
* \return the converted value.
*/
int ADC::readSingle(int8_t adc_num)
{
#ifdef ADC_SINGLE_ADC
return adc0->readSingle();
#else
if (adc_num == 1)
{ // user wants ADC 1, do nothing if it's a Teensy 3.0
return adc1->readSingle();
}
return adc0->readSingle();
#endif
}
// Starts continuous conversion on the pin.
/* It returns as soon as the ADC is set, use analogReadContinuous() to read the value.
*/
bool ADC::startContinuous(uint8_t pin, int8_t adc_num)
{
#ifdef ADC_SINGLE_ADC
return adc0->startContinuous(pin); // use ADC0
#else
/* Teensy 3.1
*/
if (adc_num == -1)
{ // use no ADC in particular
// check which ADC can read the pin
bool adc0Pin = adc0->checkPin(pin);
bool adc1Pin = adc1->checkPin(pin);
if (adc0Pin && adc1Pin)
{ // Both ADCs
if ((adc0->num_measurements) > (adc1->num_measurements))
{ // use the ADC with less workload
return adc1->startContinuous(pin);
}
else
{
return adc0->startContinuous(pin);
}
}
else if (adc0Pin)
{ // ADC0
return adc0->startContinuous(pin);
}
else if (adc1Pin)
{ // ADC1
return adc1->startContinuous(pin);
}
else
{ // pin not valid in any ADC
adc0->fail_flag |= ADC_ERROR::WRONG_PIN;
adc1->fail_flag |= ADC_ERROR::WRONG_PIN;
return false; // all others are invalid
}
}
else if (adc_num == 0)
{ // user wants ADC0
return adc0->startContinuous(pin);
}
else if (adc_num == 1)
{ // user wants ADC 1
return adc1->startContinuous(pin);
}
adc0->fail_flag |= ADC_ERROR::OTHER;
return false;
#endif
}
#if ADC_DIFF_PAIRS > 0
// Starts continuous conversion between the pins (pinP-pinN).
/* It returns as soon as the ADC is set, use analogReadContinuous() to read the value.
* \param pinP must be A10 or A12.
* \param pinN must be A11 (if pinP=A10) or A13 (if pinP=A12).
* Other pins will return ADC_ERROR_DIFF_VALUE.
*/
bool ADC::startContinuousDifferential(uint8_t pinP, uint8_t pinN, int8_t adc_num)
{
#ifdef ADC_SINGLE_ADC
return adc0->startContinuousDifferential(pinP, pinN); // use ADC0
#else
/* Teensy 3.1
*/
if (adc_num == -1)
{ // use no ADC in particular
// check which ADC can read the pin
bool adc0Pin = adc0->checkDifferentialPins(pinP, pinN);
bool adc1Pin = adc1->checkDifferentialPins(pinP, pinN);
if (adc0Pin && adc1Pin)
{ // Both ADCs
if ((adc0->num_measurements) > (adc1->num_measurements))
{ // use the ADC with less workload
return adc1->startContinuousDifferential(pinP, pinN);
}
else
{
return adc0->startContinuousDifferential(pinP, pinN);
}
}
else if (adc0Pin)
{ // ADC0
return adc0->startContinuousDifferential(pinP, pinN);
}
else if (adc1Pin)
{ // ADC1
return adc1->startContinuousDifferential(pinP, pinN);
}
else
{ // pins not valid in any ADC
adc0->fail_flag |= ADC_ERROR::WRONG_PIN;
adc1->fail_flag |= ADC_ERROR::WRONG_PIN;
return false; // all others are invalid
}
}
else if (adc_num == 0)
{ // user wants ADC0
return adc0->startContinuousDifferential(pinP, pinN);
}
else if (adc_num == 1)
{ // user wants ADC 1
return adc1->startContinuousDifferential(pinP, pinN);
}
adc0->fail_flag |= ADC_ERROR::OTHER;
return false;
#endif
}
#endif
//! Reads the analog value of a continuous conversion.
/** Set the continuous conversion with with analogStartContinuous(pin) or startContinuousDifferential(pinP, pinN).
* \return the last converted value.
* If single-ended and 16 bits it's necessary to typecast it to an unsigned type (like uint16_t),
* otherwise values larger than 3.3/2 V are interpreted as negative!
*/
int ADC::analogReadContinuous(int8_t adc_num)
{
#ifdef ADC_SINGLE_ADC
return adc0->analogReadContinuous();
#else
if (adc_num == 1)
{ // user wants ADC 1, do nothing if it's a Teensy 3.0
return adc1->analogReadContinuous();
}
return adc0->analogReadContinuous();
#endif
}
//! Stops continuous conversion
void ADC::stopContinuous(int8_t adc_num)
{
#ifdef ADC_SINGLE_ADC
adc0->stopContinuous();
#else
if (adc_num == 1)
{ // user wants ADC 1, do nothing if it's a Teensy 3.0
adc1->stopContinuous();
return;
}
adc0->stopContinuous();
return;
#endif
}
//////////////// SYNCHRONIZED BLOCKING METHODS //////////////////
///// ONLY FOR BOARDS WITH MORE THAN ONE ADC /////
/////////////////////////////////////////////////////////////////
#ifdef ADC_DUAL_ADCS
/*Returns the analog values of both pins, measured at the same time by the two ADC modules.
* It waits until the value is read and then returns the result as a struct Sync_result,
* use Sync_result.result_adc0 and Sync_result.result_adc1.
* If a comparison has been set up and fails, it will return ADC_ERROR_VALUE in both fields of the struct.
*/
ADC::Sync_result ADC::analogSynchronizedRead(uint8_t pin0, uint8_t pin1)
{
Sync_result res = {ADC_ERROR_VALUE, ADC_ERROR_VALUE};
// check pins
if (!adc0->checkPin(pin0))
{
adc0->fail_flag |= ADC_ERROR::WRONG_PIN;
return res;
}
if (!adc1->checkPin(pin1))
{
adc1->fail_flag |= ADC_ERROR::WRONG_PIN;
return res;
}
// check if we are interrupting a measurement, store setting if so.
// vars to save the current state of the ADC in case it's in use
ADC_Module::ADC_Config old_adc0_config = {};
uint8_t wasADC0InUse = adc0->isConverting(); // is the ADC running now?
if (wasADC0InUse)
{ // this means we're interrupting a conversion
// save the current conversion config, the adc isr will restore the adc
__disable_irq();
//digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) );
adc0->saveConfig(&old_adc0_config);
__enable_irq();
}
ADC_Module::ADC_Config old_adc1_config = {};
uint8_t wasADC1InUse = adc1->isConverting(); // is the ADC running now?
if (wasADC1InUse)
{ // this means we're interrupting a conversion
// save the current conversion config, the adc isr will restore the adc
__disable_irq();
//digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) );
adc1->saveConfig(&old_adc1_config);
__enable_irq();
}
// no continuous mode
adc0->singleMode();
adc1->singleMode();
// start both measurements
adc0->startReadFast(pin0);
adc1->startReadFast(pin1);
// wait for both ADCs to finish
while ((adc0->isConverting()) || (adc1->isConverting()))
{ // wait for both to finish
yield();
//digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) );
}
__disable_irq(); // make sure nothing interrupts this part
if (adc0->isComplete())
{ // conversion succeded
res.result_adc0 = adc0->readSingle();
}
else
{ // comparison was false
adc0->fail_flag |= ADC_ERROR::COMPARISON;
}
if (adc1->isComplete())
{ // conversion succeded
res.result_adc1 = adc1->readSingle();
}
else
{ // comparison was false
adc1->fail_flag |= ADC_ERROR::COMPARISON;
}
__enable_irq();
// if we interrupted a conversion, set it again
if (wasADC0InUse)
{
//digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) );
adc0->loadConfig(&old_adc0_config);
}
if (wasADC1InUse)
{
//digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) );
adc1->loadConfig(&old_adc1_config);
}
//digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) );
return res;
}
#if ADC_DIFF_PAIRS > 0
/*Returns the diff analog values of both sets of pins, measured at the same time by the two ADC modules.
* It waits until the value is read and then returns the result as a struct Sync_result,
* use Sync_result.result_adc0 and Sync_result.result_adc1.
* If a comparison has been set up and fails, it will return ADC_ERROR_VALUE in both fields of the struct.
*/
ADC::Sync_result ADC::analogSynchronizedReadDifferential(uint8_t pin0P, uint8_t pin0N, uint8_t pin1P, uint8_t pin1N)
{
Sync_result res = {ADC_ERROR_VALUE, ADC_ERROR_VALUE};
;
// check pins
if (!adc0->checkDifferentialPins(pin0P, pin0N))
{
adc0->fail_flag |= ADC_ERROR::WRONG_PIN;
return res; // all others are invalid
}
if (!adc1->checkDifferentialPins(pin1P, pin1N))
{
adc1->fail_flag |= ADC_ERROR::WRONG_PIN;
return res; // all others are invalid
}
uint8_t resolution0 = adc0->getResolution();
uint8_t resolution1 = adc1->getResolution();
// check if we are interrupting a measurement, store setting if so.
// vars to save the current state of the ADC in case it's in use
ADC_Module::ADC_Config old_adc0_config = {};
uint8_t wasADC0InUse = adc0->isConverting(); // is the ADC running now?
if (wasADC0InUse)
{ // this means we're interrupting a conversion
// save the current conversion config, the adc isr will restore the adc
__disable_irq();
//digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) );
adc0->saveConfig(&old_adc0_config);
__enable_irq();
}
ADC_Module::ADC_Config old_adc1_config = {};
uint8_t wasADC1InUse = adc1->isConverting(); // is the ADC running now?
if (wasADC1InUse)
{ // this means we're interrupting a conversion
// save the current conversion config, the adc isr will restore the adc
__disable_irq();
//digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) );
adc1->saveConfig(&old_adc1_config);
__enable_irq();
}
// no continuous mode
adc0->singleMode();
adc1->singleMode();
// start both measurements
adc0->startDifferentialFast(pin0P, pin0N);
adc1->startDifferentialFast(pin1P, pin1N);
// wait for both ADCs to finish
while ((adc0->isConverting()) || (adc1->isConverting()))
{
yield();
//digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) );
}
__disable_irq(); // make sure nothing interrupts this part
if (adc0->isComplete())
{ // conversion succeded
res.result_adc0 = adc0->readSingle();
if (resolution0 == 16)
{ // 16 bit differential is actually 15 bit + 1 bit sign
res.result_adc0 *= 2; // multiply by 2 as if it were really 16 bits, so that getMaxValue gives a correct value.
}
}
else
{ // comparison was false
adc0->fail_flag |= ADC_ERROR::COMPARISON;
}
if (adc1->isComplete())
{ // conversion succeded
res.result_adc1 = adc1->readSingle();
if (resolution1 == 16)
{ // 16 bit differential is actually 15 bit + 1 bit sign
res.result_adc1 *= 2; // multiply by 2 as if it were really 16 bits, so that getMaxValue gives a correct value.
}
}
else
{ // comparison was false
adc1->fail_flag |= ADC_ERROR::COMPARISON;
}
__enable_irq();
// if we interrupted a conversion, set it again
if (wasADC0InUse)
{
//digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) );
adc0->loadConfig(&old_adc0_config);
}
if (wasADC1InUse)
{
//digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) );
adc1->loadConfig(&old_adc1_config);
}
//digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) );
return res;
}
#endif
/////////////// SYNCHRONIZED NON-BLOCKING METHODS //////////////
// Starts an analog measurement at the same time on the two ADC modules
/* It returns inmediately, get value with readSynchronizedSingle().
* If the pin is incorrect it returns false
* If this function interrupts a measurement, it stores the settings in adc_config
*/
bool ADC::startSynchronizedSingleRead(uint8_t pin0, uint8_t pin1)
{
// check pins
if (!adc0->checkPin(pin0))
{
adc0->fail_flag |= ADC_ERROR::WRONG_PIN;
return false;
}
if (!adc1->checkPin(pin1))
{
adc1->fail_flag |= ADC_ERROR::WRONG_PIN;
return false;
}
// check if we are interrupting a measurement, store setting if so.
adc0->adcWasInUse = adc0->isConverting(); // is the ADC running now?
if (adc0->adcWasInUse)
{ // this means we're interrupting a conversion
// save the current conversion config, the adc isr will restore the adc
__disable_irq();
//digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) );
adc0->saveConfig(&adc0->adc_config);
__enable_irq();
}
adc1->adcWasInUse = adc1->isConverting(); // is the ADC running now?
if (adc1->adcWasInUse)
{ // this means we're interrupting a conversion
// save the current conversion config, the adc isr will restore the adc
__disable_irq();
//digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) );
adc1->saveConfig(&adc1->adc_config);
__enable_irq();
}
// no continuous mode
adc0->singleMode();
adc1->singleMode();
// start both measurements
adc0->startReadFast(pin0);
adc1->startReadFast(pin1);
//digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) );
return true;
}
#if ADC_DIFF_PAIRS > 0
// Start a differential conversion between two pins (pin0P - pin0N) and (pin1P - pin1N)
/* It returns inmediately, get value with readSynchronizedSingle().
* \param pinP must be A10 or A12.
* \param pinN must be A11 (if pinP=A10) or A13 (if pinP=A12).
* Other pins will return false.
* If this function interrupts a measurement, it stores the settings in adc_config
*/
bool ADC::startSynchronizedSingleDifferential(uint8_t pin0P, uint8_t pin0N, uint8_t pin1P, uint8_t pin1N)
{
// check pins
if (!adc0->checkDifferentialPins(pin0P, pin0N))
{
adc0->fail_flag |= ADC_ERROR::WRONG_PIN;
return false; // all others are invalid
}
if (!adc1->checkDifferentialPins(pin1P, pin1N))
{
adc1->fail_flag |= ADC_ERROR::WRONG_PIN;
return false; // all others are invalid
}
// check if we are interrupting a measurement, store setting if so.
adc0->adcWasInUse = adc0->isConverting(); // is the ADC running now?
if (adc0->adcWasInUse)
{ // this means we're interrupting a conversion
// save the current conversion config, the adc isr will restore the adc
__disable_irq();
//digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) );
adc0->saveConfig(&adc0->adc_config);
__enable_irq();
}
adc1->adcWasInUse = adc1->isConverting(); // is the ADC running now?
if (adc1->adcWasInUse)
{ // this means we're interrupting a conversion
// save the current conversion config, the adc isr will restore the adc
__disable_irq();
//digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) );
adc1->saveConfig(&adc1->adc_config);
__enable_irq();
}
// no continuous mode
adc0->singleMode();
adc1->singleMode();
// start both measurements
adc0->startDifferentialFast(pin0P, pin0N);
adc1->startDifferentialFast(pin1P, pin1N);
//digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) );
return true;
}
#endif
// Reads the analog value of a single conversion.
/*
* \return the converted value.
*/
ADC::Sync_result ADC::readSynchronizedSingle()
{
ADC::Sync_result res;
res.result_adc0 = adc0->readSingle();
res.result_adc1 = adc1->readSingle();
return res;
}
///////////// SYNCHRONIZED CONTINUOUS CONVERSION METHODS ////////////
//! Starts a continuous conversion in both ADCs simultaneously
/** Use readSynchronizedContinuous to get the values
*
*/
bool ADC::startSynchronizedContinuous(uint8_t pin0, uint8_t pin1)
{
// check pins
if (!adc0->checkPin(pin0))
{
adc0->fail_flag |= ADC_ERROR::WRONG_PIN;
return false;
}
if (!adc1->checkPin(pin1))
{
adc1->fail_flag |= ADC_ERROR::WRONG_PIN;
return false;
}
adc0->continuousMode();
adc1->continuousMode();
__disable_irq(); // both measurements should have a maximum delay of an instruction time
adc0->startReadFast(pin0);
adc1->startReadFast(pin1);
__enable_irq();
return true;
}
#if ADC_DIFF_PAIRS > 0
//! Starts a continuous differential conversion in both ADCs simultaneously
/** Use readSynchronizedContinuous to get the values
*
*/
bool ADC::startSynchronizedContinuousDifferential(uint8_t pin0P, uint8_t pin0N, uint8_t pin1P, uint8_t pin1N)
{
// check pins
if (!adc0->checkDifferentialPins(pin0P, pin0N))
{
adc0->fail_flag |= ADC_ERROR::WRONG_PIN;
return false; // all others are invalid
}
if (!adc1->checkDifferentialPins(pin1P, pin1N))
{
adc1->fail_flag |= ADC_ERROR::WRONG_PIN;
return false; // all others are invalid
}
adc0->continuousMode();
adc1->continuousMode();
__disable_irq();
adc0->startDifferentialFast(pin0P, pin0N);
adc1->startDifferentialFast(pin1P, pin1N);
__enable_irq();
return true;
}
#endif
//! Returns the values of both ADCs.
ADC::Sync_result ADC::readSynchronizedContinuous()
{
ADC::Sync_result res;
res.result_adc0 = adc0->analogReadContinuous();
res.result_adc1 = adc1->analogReadContinuous();
return res;
}
//! Stops synchronous continuous conversion
void ADC::stopSynchronizedContinuous()
{
adc0->stopContinuous();
adc1->stopContinuous();
}
#endif
================================================
FILE: firmware/3.0/lib/ADC/ADC.h
================================================
/* Teensy 4.x, 3.x, LC ADC library
* https://github.com/pedvide/ADC
* Copyright (c) 2020 Pedro Villanueva
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/* TODO
* - Function to measure more that 1 pin consecutively (stream?)
*
* bugs:
* - comparison values in 16 bit differential mode are twice what they should be
*/
/*! \mainpage ADC
Teensy 4.x, 3.x, LC ADC library
This manual is divided in the following sections:
- \subpage adc_doc "ADC"
- \subpage adc_module "ADC Module"
- \subpage settings "Board settings"
- \subpage error "ADC error codes"
- \subpage util "ADC util"
*/
/*! \page adc_doc ADC
Make Analog to Digital conversions using the ADC interface.
See the ADC class for all methods.
*/
#ifndef ADC_H
#define ADC_H
#define ADC_0 0
#define ADC_1 1
//enum class ADC_NUM {ADC_0, ADC_1}; // too verbose, but it'd avoid some mistakes
// include ADC module class
#include "ADC_Module.h"
#ifdef __cplusplus
extern "C"
{
#endif
/** Class ADC: Controls the Teensy 3.x, 4 ADC
*
*/
class ADC
{
protected:
private:
// ADCs objects
ADC_Module adc0_obj;
#ifdef ADC_DUAL_ADCS
ADC_Module adc1_obj;
#endif
//! Number of ADC objects
const uint8_t num_ADCs = ADC_NUM_ADCS;
public:
/** Default constructor */
ADC();
// create both adc objects
//! Object to control the ADC0
ADC_Module *const adc0 = &adc0_obj; // adc object pointer
#ifdef ADC_DUAL_ADCS
//! Object to control the ADC1
ADC_Module *const adc1 = &adc1_obj; // adc object pointer
#endif
#ifdef ADC_SINGLE_ADC
//! Array with the ADC Modules
ADC_Module *const adc[ADC_NUM_ADCS] = {adc0};
#else
//! Array with the ADC Modules
ADC_Module *const adc[ADC_NUM_ADCS] = {adc0, adc1};
#endif
/////////////// METHODS TO SET/GET SETTINGS OF THE ADC ////////////////////
//! Set the voltage reference you prefer, default is vcc
/*! It recalibrates at the end.
* \param type can be ADC_REFERENCE::REF_3V3, ADC_REFERENCE::REF_1V2 (not for Teensy LC) or ADC_REFERENCE::REF_EXT
* \param adc_num ADC number to change.
*/
__attribute__((error("Use adc->adcX->setReference instead"))) void setReference(ADC_REFERENCE type, int8_t adc_num = -1);
//! Change the resolution of the measurement.
/*!
* \param bits is the number of bits of resolution.
* For single-ended measurements: 8, 10, 12 or 16 bits.
* For differential measurements: 9, 11, 13 or 16 bits.
* If you want something in between (11 bits single-ended for example) select the immediate higher
* and shift the result one to the right.
* Whenever you change the resolution, change also the comparison values (if you use them).
* \param adc_num ADC number to change.
*/
__attribute__((error("Use adc->adcX->setResolution instead"))) void setResolution(uint8_t bits, int8_t adc_num = -1);
//! Returns the resolution of the ADC_Module.
/**
* \param adc_num ADC number to query.
* \return the resolution of adc_num ADC.
*/
__attribute__((error("Use adc->adcX->getResolution instead")))
uint8_t
getResolution(int8_t adc_num = -1);
//! Returns the maximum value for a measurement: 2^res-1.
/**
* \param adc_num ADC number to query.
* \return the maximum value of adc_num ADC.
*/
__attribute__((error("Use adc->adcX->getMaxValue instead")))
uint32_t
getMaxValue(int8_t adc_num = -1);
//! Sets the conversion speed (changes the ADC clock, ADCK)
/**
* \param speed can be any from the ADC_CONVERSION_SPEED enum: VERY_LOW_SPEED, LOW_SPEED, MED_SPEED, HIGH_SPEED_16BITS, HIGH_SPEED, VERY_HIGH_SPEED,
* ADACK_2_4, ADACK_4_0, ADACK_5_2 or ADACK_6_2.
*
* VERY_LOW_SPEED is guaranteed to be the lowest possible speed within specs for resolutions less than 16 bits (higher than 1 MHz),
* it's different from LOW_SPEED only for 24, 4 or 2 MHz bus frequency.
* LOW_SPEED is guaranteed to be the lowest possible speed within specs for all resolutions (higher than 2 MHz).
* MED_SPEED is always >= LOW_SPEED and <= HIGH_SPEED.
* HIGH_SPEED_16BITS is guaranteed to be the highest possible speed within specs for all resolutions (lower or eq than 12 MHz).
* HIGH_SPEED is guaranteed to be the highest possible speed within specs for resolutions less than 16 bits (lower or eq than 18 MHz).
* VERY_HIGH_SPEED may be out of specs, it's different from HIGH_SPEED only for 48, 40 or 24 MHz bus frequency.
*
* Additionally the conversion speed can also be ADACK_2_4, ADACK_4_0, ADACK_5_2 and ADACK_6_2,
* where the numbers are the frequency of the ADC clock (ADCK) in MHz and are independent on the bus speed.
* This is useful if you are using the Teensy at a very low clock frequency but want faster conversions,
* but if F_BUS<F_ADCK, you can't use VERY_HIGH_SPEED for sampling speed.
* \param adc_num ADC number to change.
*/
__attribute__((error("Use adc->adcX->setConversionSpeed instead"))) void setConversionSpeed(ADC_CONVERSION_SPEED speed, int8_t adc_num = -1);
//! Sets the sampling speed
/** Increase the sampling speed for low impedance sources, decrease it for higher impedance ones.
* \param speed can be any of the ADC_SAMPLING_SPEED enum: VERY_LOW_SPEED, LOW_SPEED, MED_SPEED, HIGH_SPEED or VERY_HIGH_SPEED.
*
* VERY_LOW_SPEED is the lowest possible sampling speed (+24 ADCK).
* LOW_SPEED adds +16 ADCK.
* MED_SPEED adds +10 ADCK.
* HIGH_SPEED adds +6 ADCK.
* VERY_HIGH_SPEED is the highest possible sampling speed (0 ADCK added).
* \param adc_num ADC number to change.
*/
__attribute__((error("Use adc->adcX->setSamplingSpeed instead"))) void setSamplingSpeed(ADC_SAMPLING_SPEED speed, int8_t adc_num = -1);
//! Set the number of averages
/*!
* \param num can be 0, 4, 8, 16 or 32.
* \param adc_num ADC number to change.
*/
__attribute__((error("Use adc->adcX->setAveraging instead"))) void setAveraging(uint8_t num, int8_t adc_num = -1);
//! Enable interrupts
/** An IRQ_ADCx Interrupt will be raised when the conversion is completed
* (including hardware averages and if the comparison (if any) is true).
* \param adc_num ADC number to change.
* \param isr function (returns void and accepts no arguments) that will be executed after an interrupt.
* \param priority Interrupt priority, highest is 0, lowest is 255.
*/
__attribute__((error("Use adc->adcX->enableInterrupts instead"))) void enableInterrupts(void (*isr)(void), uint8_t priority = 255, int8_t adc_num = -1);
//! Disable interrupts
/**
* \param adc_num ADC number to change.
*/
__attribute__((error("Use adc->adcX->disableInterrupts instead"))) void disableInterrupts(int8_t adc_num = -1);
#ifdef ADC_USE_DMA
//! Enable DMA request
/** An ADC DMA request will be raised when the conversion is completed
* (including hardware averages and if the comparison (if any) is true).
* \param adc_num ADC number to change.
*/
__attribute__((error("Use adc->adcX->enableDMA instead"))) void enableDMA(int8_t adc_num = -1);
//! Disable ADC DMA request
/**
* \param adc_num ADC number to change.
*/
__attribute__((error("Use adc->adcX->disableDMA instead"))) void disableDMA(int8_t adc_num = -1);
#endif
//! Enable the compare function to a single value
/** A conversion will be completed only when the ADC value
* is >= compValue (greaterThan=1) or < compValue (greaterThan=0)
* Call it after changing the resolution
* Use with interrupts or poll conversion completion with isComplete()
* \param compValue value to compare
* \param greaterThan true or false
* \param adc_num ADC number to change.
*/
__attribute__((error("Use adc->adcX->enableCompare instead"))) void enableCompare(int16_t compValue, bool greaterThan, int8_t adc_num = -1);
//! Enable the compare function to a range
/** A conversion will be completed only when the ADC value is inside (insideRange=1) or outside (=0)
* the range given by (lowerLimit, upperLimit),including (inclusive=1) the limits or not (inclusive=0).
* See Table 31-78, p. 617 of the freescale manual.
* Call it after changing the resolution
* Use with interrupts or poll conversion completion with isComplete()
* \param lowerLimit lower value to compare
* \param upperLimit upper value to compare
* \param insideRange true or false
* \param inclusive true or false
* \param adc_num ADC number to change.
*/
__attribute__((error("Use adc->adcX->enableCompareRange instead"))) void enableCompareRange(int16_t lowerLimit, int16_t upperLimit, bool insideRange, bool inclusive, int8_t adc_num = -1);
//! Disable the compare function
/**
* \param adc_num ADC number to change.
*/
__attribute__((error("Use adc->adcX->disableCompare instead"))) void disableCompare(int8_t adc_num = -1);
#ifdef ADC_USE_PGA
//! Enable and set PGA
/** Enables the PGA and sets the gain
* Use only for signals lower than 1.2 V and only in differential mode
* \param gain can be 1, 2, 4, 8, 16, 32 or 64
* \param adc_num ADC number to change.
*/
__attribute__((error("Use adc->adcX->enablePGA instead"))) void enablePGA(uint8_t gain, int8_t adc_num = -1);
//! Returns the PGA level
/** PGA level = from 1 to 64
* \param adc_num ADC number to query.
* \return PGA level = from 1 to 64
*/
__attribute__((error("Use adc->adcX->getPGA instead")))
uint8_t
getPGA(int8_t adc_num = -1);
//! Disable PGA
/**
* \param adc_num ADC number to query
*/
__attribute__((error("Use adc->adcX->disablePGA instead"))) void disablePGA(int8_t adc_num = -1);
#endif
////////////// INFORMATION ABOUT THE STATE OF THE ADC /////////////////
//! Is the ADC converting at the moment?
/**
* \param adc_num ADC number to query
* \return true if yes, false if not.
*/
__attribute__((error("Use adc->adcX->isConverting instead"))) bool isConverting(int8_t adc_num = -1);
//! Is an ADC conversion ready?
/** When a value is read this function returns 0 until a new value exists
* So it only makes sense to call it with continuous or non-blocking methods
* \param adc_num ADC number to query
* \return true if yes, false if not.
*/
__attribute__((error("Use adc->adcX->isComplete instead"))) bool isComplete(int8_t adc_num = -1);
#if ADC_DIFF_PAIRS > 0
//! Is the ADC in differential mode?
/**
* \param adc_num ADC number to query
* \return true or false
*/
__attribute__((error("Use adc->adcX->isDifferential instead"))) bool isDifferential(int8_t adc_num = -1);
#endif
//! Is the ADC in continuous mode?
/**
* \param adc_num ADC number to query
* \return true or false
*/
__attribute__((error("Use adc->adcX->isContinuous instead"))) bool isContinuous(int8_t adc_num = -1);
//////////////// BLOCKING CONVERSION METHODS //////////////////
//! Returns the analog value of the pin.
/** It waits until the value is read and then returns the result.
* If a comparison has been set up and fails, it will return ADC_ERROR_VALUE.
* This function is interrupt safe, so it will restore the adc to the state it was before being called
* If more than one ADC exists, it will select the module with less workload, you can force a selection using
* adc_num. If you select ADC1 in Teensy 3.0 it will return ADC_ERROR_VALUE.
* \param pin can be any of the analog pins
* \param adc_num ADC_X ADC module
* \return the value of the pin.
*/
int analogRead(uint8_t pin, int8_t adc_num = -1);
//! Returns the analog value of the special internal source, such as the temperature sensor.
/** It calls analogRead(uint8_t pin) internally, with the correct value for the pin for all boards.
* Possible values:
* TEMP_SENSOR, Temperature sensor.
* VREF_OUT, 1.2 V reference (switch on first using VREF.h).
* BANDGAP, BANDGAP (switch on first using VREF.h).
* VREFH, High VREF.
* VREFL, Low VREF.
* \param pin ADC_INTERNAL_SOURCE to read.
* \param adc_num ADC_X ADC module
* \return the value of the pin.
*/
int analogRead(ADC_INTERNAL_SOURCE pin, int8_t adc_num = -1) __attribute__((always_inline))
{
return analogRead(static_cast<uint8_t>(pin), adc_num);
}
#if ADC_DIFF_PAIRS > 0
//! Reads the differential analog value of two pins (pinP - pinN).
/** It waits until the value is read and then returns the result.
* This function is interrupt safe, so it will restore the adc to the state it was before being called
* If more than one ADC exists, it will select the module with less workload, you can force a selection using
* adc_num
* \param pinP must be A10 or A12.
* \param pinN must be A11 (if pinP=A10) or A13 (if pinP=A12).
* \param adc_num ADC_X ADC module
* \return the differential value of the pins, invalid pins return ADC_ERROR_VALUE.
* If a comparison has been set up and fails, it will return ADC_ERROR_VALUE.
*/
int analogReadDifferential(uint8_t pinP, uint8_t pinN, int8_t adc_num = -1);
#endif
/////////////// NON-BLOCKING CONVERSION METHODS //////////////
//! Starts an analog measurement on the pin and enables interrupts.
/** It returns immediately, get value with readSingle().
* If this function interrupts a measurement, it stores the settings in adc_config
* \param pin can be any of the analog pins
* \param adc_num ADC_X ADC module
* \return true if the pin is valid, false otherwise.
*/
bool startSingleRead(uint8_t pin, int8_t adc_num = -1);
#if ADC_DIFF_PAIRS > 0
//! Start a differential conversion between two pins (pinP - pinN) and enables interrupts.
/** It returns immediately, get value with readSingle().
* If this function interrupts a measurement, it stores the settings in adc_config
* \param pinP must be A10 or A12.
* \param pinN must be A11 (if pinP=A10) or A13 (if pinP=A12).
* \param adc_num ADC_X ADC module
* \return true if the pins are valid, false otherwise.
*/
bool startSingleDifferential(uint8_t pinP, uint8_t pinN, int8_t adc_num = -1);
#endif
//! Reads the analog value of a single conversion.
/** Set the conversion with with startSingleRead(pin) or startSingleDifferential(pinP, pinN).
* \param adc_num ADC_X ADC module
* \return the converted value.
*/
int readSingle(int8_t adc_num = -1);
///////////// CONTINUOUS CONVERSION METHODS ////////////
//! Starts continuous conversion on the pin.
/** It returns as soon as the ADC is set, use analogReadContinuous() to read the value.
* \param pin can be any of the analog pins
* \param adc_num ADC_X ADC module
* \return true if the pin is valid, false otherwise.
*/
bool startContinuous(uint8_t pin, int8_t adc_num = -1);
#if ADC_DIFF_PAIRS > 0
//! Starts continuous conversion between the pins (pinP-pinN).
/** It returns as soon as the ADC is set, use analogReadContinuous() to read the value.
* \param pinP must be A10 or A12.
* \param pinN must be A11 (if pinP=A10) or A13 (if pinP=A12).
* \param adc_num ADC_X ADC module
* \return true if the pins are valid, false otherwise.
*/
bool startContinuousDifferential(uint8_t pinP, uint8_t pinN, int8_t adc_num = -1);
#endif
//! Reads the analog value of a continuous conversion.
/** Set the continuous conversion with with analogStartContinuous(pin) or startContinuousDifferential(pinP, pinN).
* If single-ended and 16 bits it's necessary to typecast it to an unsigned type (like uint16_t),
* otherwise values larger than 3.3/2 V are interpreted as negative!
* \param adc_num ADC_X ADC module
* \return the last converted value.
*/
int analogReadContinuous(int8_t adc_num = -1);
//! Stops continuous conversion
/**
* \param adc_num ADC_X ADC module
*/
void stopContinuous(int8_t adc_num = -1);
/////////// SYNCHRONIZED METHODS ///////////////
///// ONLY FOR BOARDS WITH MORE THAN ONE ADC /////
#ifdef ADC_DUAL_ADCS
//! Struct for synchronous measurements
/** result_adc0 has the result from ADC0 and result_adc1 from ADC1.
*/
struct Sync_result
{
int32_t result_adc0, result_adc1;
};
//////////////// SYNCHRONIZED BLOCKING METHODS //////////////////
//! Returns the analog values of both pins, measured at the same time by the two ADC modules.
/** It waits until the values are read and then returns the result as a struct Sync_result,
* use Sync_result.result_adc0 and Sync_result.result_adc1.
* If a comparison has been set up and fails, it will return ADC_ERROR_VALUE in both fields of the struct.
* This function is interrupt safe, so it will restore the adc to the state it was before being called
* \param pin0 pin in ADC0
* \param pin1 pin in ADC1
* \return a Sync_result struct with the result of each ADC value.
*/
Sync_result analogSynchronizedRead(uint8_t pin0, uint8_t pin1);
//! Same as analogSynchronizedRead
/**
* \param pin0 pin in ADC0
* \param pin1 pin in ADC1
* \return a Sync_result struct with the result of each ADC value.
*/
Sync_result analogSyncRead(uint8_t pin0, uint8_t pin1) __attribute__((always_inline)) { return analogSynchronizedRead(pin0, pin1); }
#if ADC_DIFF_PAIRS > 0
//! Returns the differential analog values of both sets of pins, measured at the same time by the two ADC modules.
/** It waits until the values are read and then returns the result as a struct Sync_result,
* use Sync_result.result_adc0 and Sync_result.result_adc1.
* If a comparison has been set up and fails, it will return ADC_ERROR_VALUE in both fields of the struct.
* This function is interrupt safe, so it will restore the adc to the state it was before being called
* \param pin0P positive pin in ADC0
* \param pin0N negative pin in ADC0
* \param pin1P positive pin in ADC1
* \param pin1N negative pin in ADC1
* \return a Sync_result struct with the result of each differential ADC value.
*/
Sync_result analogSynchronizedReadDifferential(uint8_t pin0P, uint8_t pin0N, uint8_t pin1P, uint8_t pin1N);
//! Same as analogSynchronizedReadDifferential
/**
* \param pin0P positive pin in ADC0
* \param pin0N negative pin in ADC0
* \param pin1P positive pin in ADC1
* \param pin1N negative pin in ADC1
* \return a Sync_result struct with the result of each differential ADC value.
*/
Sync_result analogSyncReadDifferential(uint8_t pin0P, uint8_t pin0N, uint8_t pin1P, uint8_t pin1N) __attribute__((always_inline))
{
return analogSynchronizedReadDifferential(pin0P, pin0N, pin1P, pin1N);
}
#endif
/////////////// SYNCHRONIZED NON-BLOCKING METHODS //////////////
//! Starts an analog measurement at the same time on the two ADC modules
/** It returns immediately, get value with readSynchronizedSingle().
* If this function interrupts a measurement, it stores the settings in adc_config
* \param pin0 pin in ADC0
* \param pin1 pin in ADC1
* \return true if the pins are valid, false otherwise.
*/
bool startSynchronizedSingleRead(uint8_t pin0, uint8_t pin1);
#if ADC_DIFF_PAIRS > 0
//! Start a differential conversion between two pins (pin0P - pin0N) and (pin1P - pin1N)
/** It returns immediately, get value with readSynchronizedSingle().
* If this function interrupts a measurement, it stores the settings in adc_config
* \param pin0P positive pin in ADC0
* \param pin0N negative pin in ADC0
* \param pin1P positive pin in ADC1
* \param pin1N negative pin in ADC1
* \return true if the pins are valid, false otherwise.
*/
bool startSynchronizedSingleDifferential(uint8_t pin0P, uint8_t pin0N, uint8_t pin1P, uint8_t pin1N);
#endif
//! Reads the analog value of a single conversion.
/**
* \return the converted value.
*/
Sync_result readSynchronizedSingle();
///////////// SYNCHRONIZED CONTINUOUS CONVERSION METHODS ////////////
//! Starts a continuous conversion in both ADCs simultaneously
/** Use readSynchronizedContinuous to get the values
* \param pin0 pin in ADC0
* \param pin1 pin in ADC1
* \return true if the pins are valid, false otherwise.
*/
bool startSynchronizedContinuous(uint8_t pin0, uint8_t pin1);
#if ADC_DIFF_PAIRS > 0
//! Starts a continuous differential conversion in both ADCs simultaneously
/** Use readSynchronizedContinuous to get the values
* \param pin0P positive pin in ADC0
* \param pin0N negative pin in ADC0
* \param pin1P positive pin in ADC1
* \param pin1N negative pin in ADC1
* \return true if the pins are valid, false otherwise.
*/
bool startSynchronizedContinuousDifferential(uint8_t pin0P, uint8_t pin0N, uint8_t pin1P, uint8_t pin1N);
#endif
//! Returns the values of both ADCs.
/**
* \return the converted value.
*/
Sync_result readSynchronizedContinuous();
//! Stops synchronous continuous conversion
void stopSynchronizedContinuous();
#endif
//////////// ERRORS /////
//! Resets all errors from all ADCs, if any.
void resetError()
{
for (int i = 0; i < ADC_NUM_ADCS; i++)
{
adc[i]->resetError();
}
}
//! Translate pin number to SC1A nomenclature
// should this be a constexpr?
static const uint8_t channel2sc1aADC0[ADC_MAX_PIN + 1];
#ifdef ADC_DUAL_ADCS
//! Translate pin number to SC1A nomenclature
static const uint8_t channel2sc1aADC1[ADC_MAX_PIN + 1];
#endif
//! Translate pin number to SC1A nomenclature for differential pins
static const uint8_t sc1a2channelADC0[ADC_MAX_PIN + 1];
#ifdef ADC_DUAL_ADCS
//! Translate pin number to SC1A nomenclature for differential pins
static const uint8_t sc1a2channelADC1[ADC_MAX_PIN + 1];
#endif
#if ADC_DIFF_PAIRS > 0
//! Translate differential pin number to SC1A nomenclature
static const ADC_Module::ADC_NLIST diff_table_ADC0[ADC_DIFF_PAIRS];
#ifdef ADC_DUAL_ADCS
//! Translate differential pin number to SC1A nomenclature
static const ADC_Module::ADC_NLIST diff_table_ADC1[ADC_DIFF_PAIRS];
#endif
#endif
};
#ifdef __cplusplus
}
#endif
#endif // ADC_H
================================================
FILE: firmware/3.0/lib/ADC/ADC_Module.cpp
================================================
/* Teensy 4.x, 3.x, LC ADC library
* https://github.com/pedvide/ADC
* Copyright (c) 2020 Pedro Villanueva
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/* ADC_Module.cpp: Implements the fuctions of a Teensy 3.x, LC ADC module
*
*/
#include "ADC_Module.h"
// include the internal reference
#ifdef ADC_USE_INTERNAL_VREF
#include <VREF.h>
#endif
/* Constructor
* Point the registers to the correct ADC module
* Copy the correct channel2sc1a
* Call init
*/
ADC_Module::ADC_Module(uint8_t ADC_number,
const uint8_t *const a_channel2sc1a,
#if ADC_DIFF_PAIRS > 0
const ADC_NLIST *const a_diff_table,
#endif
ADC_REGS_t &a_adc_regs) : ADC_num(ADC_number), channel2sc1a(a_channel2sc1a)
#if ADC_DIFF_PAIRS > 0
,
diff_table(a_diff_table)
#endif
,
adc_regs(a_adc_regs)
#ifdef ADC_USE_PDB
,
PDB0_CHnC1(ADC_num ? PDB0_CH1C1 : PDB0_CH0C1)
#endif
#if defined(ADC_TEENSY_4)
,
XBAR_IN(ADC_num ? XBARA1_IN_QTIMER4_TIMER3 : XBARA1_IN_QTIMER4_TIMER0), XBAR_OUT(ADC_num ? XBARA1_OUT_ADC_ETC_TRIG10 : XBARA1_OUT_ADC_ETC_TRIG00), QTIMER4_INDEX(ADC_num ? 3 : 0), ADC_ETC_TRIGGER_INDEX(ADC_num ? 4 : 0), IRQ_ADC(ADC_num ? IRQ_NUMBER_t::IRQ_ADC2 : IRQ_NUMBER_t::IRQ_ADC1)
#elif defined(ADC_DUAL_ADCS)
// IRQ_ADC0 and IRQ_ADC1 aren't consecutive in Teensy 3.6
// fix by SB, https://github.com/pedvide/ADC/issues/19
,
IRQ_ADC(ADC_num ? IRQ_NUMBER_t::IRQ_ADC1 : IRQ_NUMBER_t::IRQ_ADC0)
#else
,
IRQ_ADC(IRQ_NUMBER_t::IRQ_ADC0)
#endif
{
// call our init
analog_init();
}
/* Initialize stuff:
* - Switch on clock
* - Clear all fail flags
* - Internal reference (default: external vcc)
* - Mux between a and b channels (b channels)
* - Calibrate with 32 averages and low speed
* - When first calibration is done it sets:
* - Resolution (default: 10 bits)
* - Conversion speed and sampling time (both set to medium speed)
* - Averaging (set to 4)
*/
void ADC_Module::analog_init()
{
startClock();
// default settings:
/*
- 10 bits resolution
- 4 averages
- vcc reference
- no interrupts
- pga gain=1
- conversion speed = medium
- sampling speed = medium
initiate to 0 (or 1) so the corresponding functions change it to the correct value
*/
analog_res_bits = 0;
analog_max_val = 0;
analog_num_average = 0;
analog_reference_internal = ADC_REF_SOURCE::REF_NONE;
#ifdef ADC_USE_PGA
pga_value = 1;
#endif
interrupts_enabled = false;
#ifdef ADC_TEENSY_4
// overwrite old values if a new conversion ends
atomic::setBitFlag(adc_regs.CFG, ADC_CFG_OVWREN);
// this is the only option for Teensy 3.x and LC
#endif
conversion_speed = ADC_CONVERSION_SPEED::HIGH_SPEED; // set to something different from line 139 so it gets changed there
sampling_speed = ADC_SAMPLING_SPEED::VERY_HIGH_SPEED;
calibrating = 0;
fail_flag = ADC_ERROR::CLEAR; // clear all errors
num_measurements = 0;
// select b channels
#ifdef ADC_TEENSY_4
// T4 has no a or b channels
#else
// ADC_CFG2_muxsel = 1;
atomic::setBitFlag(adc_regs.CFG2, ADC_CFG2_MUXSEL);
#endif
// set reference to vcc
setReference(ADC_REFERENCE::REF_3V3);
// set resolution to 10
setResolution(10);
// the first calibration will use 32 averages and lowest speed,
// when this calibration is over the averages and speed will be set to default by wait_for_cal and init_calib will be cleared.
init_calib = 1;
setAveraging(32);
setConversionSpeed(ADC_CONVERSION_SPEED::LOW_SPEED);
setSamplingSpeed(ADC_SAMPLING_SPEED::LOW_SPEED);
// begin init calibration
calibrate();
}
// starts calibration
void ADC_Module::calibrate()
{
__disable_irq();
calibrating = 1;
#ifdef ADC_TEENSY_4
atomic::clearBitFlag(adc_regs.GC, ADC_GC_CAL);
atomic::setBitFlag(adc_regs.GS, ADC_GS_CALF);
atomic::setBitFlag(adc_regs.GC, ADC_GC_CAL);
#else
// ADC_SC3_cal = 0; // stop possible previous calibration
atomic::clearBitFlag(adc_regs.SC3, ADC_SC3_CAL);
// ADC_SC3_calf = 1; // clear possible previous error
atomic::setBitFlag(adc_regs.SC3, ADC_SC3_CALF);
// ADC_SC3_cal = 1; // start calibration
atomic::setBitFlag(adc_regs.SC3, ADC_SC3_CAL);
#endif
__enable_irq();
}
/* Waits until calibration is finished and writes the corresponding registers
*
*/
void ADC_Module::wait_for_cal(void)
{
// wait for calibration to finish
#ifdef ADC_TEENSY_4
while (atomic::getBitFlag(adc_regs.GC, ADC_GC_CAL))
{ // Bit ADC_GC_CAL in register GC cleared when calib. finishes.
yield();
}
if (atomic::getBitFlag(adc_regs.GS, ADC_GS_CALF))
{ // calibration failed
fail_flag |= ADC_ERROR::CALIB; // the user should know and recalibrate manually
}
#else
while (atomic::getBitFlag(adc_regs.SC3, ADC_SC3_CAL))
{ // Bit ADC_SC3_CAL in register ADC0_SC3 cleared when calib. finishes.
yield();
}
if (atomic::getBitFlag(adc_regs.SC3, ADC_SC3_CALF))
{ // calibration failed
fail_flag |= ADC_ERROR::CALIB; // the user should know and recalibrate manually
}
#endif
// set calibrated values to registers
#ifdef ADC_TEENSY_4
// T4 does not require anything else for calibration
#else
__disable_irq();
uint16_t sum;
if (calibrating)
{
sum = adc_regs.CLPS + adc_regs.CLP4 + adc_regs.CLP3 + adc_regs.CLP2 + adc_regs.CLP1 + adc_regs.CLP0;
sum = (sum / 2) | 0x8000;
adc_regs.PG = sum;
sum = adc_regs.CLMS + adc_regs.CLM4 + adc_regs.CLM3 + adc_regs.CLM2 + adc_regs.CLM1 + adc_regs.CLM0;
sum = (sum / 2) | 0x8000;
adc_regs.MG = sum;
}
__enable_irq();
#endif
calibrating = 0;
// the first calibration uses 32 averages and lowest speed,
// when this calibration is over, set the averages and speed to default.
if (init_calib)
{
// set conversion speed to medium
setConversionSpeed(ADC_CONVERSION_SPEED::MED_SPEED);
// set sampling speed to medium
setSamplingSpeed(ADC_SAMPLING_SPEED::MED_SPEED);
// number of averages to 4
setAveraging(4);
init_calib = 0; // clear
}
}
//! Starts the calibration sequence, waits until it's done and writes the results
/** Usually it's not necessary to call this function directly, but do it if the "environment" changed
* significantly since the program was started.
*/
void ADC_Module::recalibrate()
{
calibrate();
wait_for_cal();
}
/////////////// METHODS TO SET/GET SETTINGS OF THE ADC ////////////////////
/* Set the voltage reference you prefer, default is 3.3V
* It needs to recalibrate
* Use ADC_REF_3V3, ADC_REF_1V2 (not for Teensy LC) or ADC_REF_EXT
*/
void ADC_Module::setReference(ADC_REFERENCE type)
{
ADC_REF_SOURCE ref_type = static_cast<ADC_REF_SOURCE>(type); // cast to source type, that is, either internal or default
if (analog_reference_internal == ref_type)
{ // don't need to change anything
return;
}
if (ref_type == ADC_REF_SOURCE::REF_ALT)
{ // 1.2V ref for Teensy 3.x, 3.3 VDD for Teensy LC
// internal reference requested
#ifdef ADC_USE_INTERNAL_VREF
VREF::start(); // enable VREF if Teensy 3.x
#endif
analog_reference_internal = ADC_REF_SOURCE::REF_ALT;
#ifdef ADC_TEENSY_4
// No REF_ALT for T4
#else
// *ADC_SC2_ref = 1; // uses bitband: atomic
atomic::setBitFlag(adc_regs.SC2, ADC_SC2_REFSEL(1));
#endif
}
else if (ref_type == ADC_REF_SOURCE::REF_DEFAULT)
{ // ext ref for all Teensys, vcc also for Teensy 3.x
// vcc or external reference requested
#ifdef ADC_USE_INTERNAL_VREF
VREF::stop(); // disable 1.2V reference source when using the external ref (p. 102, 3.7.1.7)
#endif
analog_reference_internal = ADC_REF_SOURCE::REF_DEFAULT;
#ifdef ADC_TEENSY_4
atomic::clearBitFlag(adc_regs.CFG, ADC_CFG_REFSEL(3));
#else
// *ADC_SC2_ref = 0; // uses bitband: atomic
atomic::clearBitFlag(adc_regs.SC2, ADC_SC2_REFSEL(1));
#endif
}
calibrate();
}
/* Change the resolution of the measurement
* For single-ended measurements: 8, 10, 12 or 16 bits.
* For differential measurements: 9, 11, 13 or 16 bits.
* If you want something in between (11 bits single-ended for example) select the inmediate higher
* and shift the result one to the right.
*
* It doesn't recalibrate
*/
void ADC_Module::setResolution(uint8_t bits)
{
if (analog_res_bits == bits)
{
return;
}
uint8_t config;
if (calibrating)
wait_for_cal();
if (bits <= 9)
{
config = 8;
}
else if (bits <= 11)
{
config = 10;
#ifdef ADC_TEENSY_4
}
else if (bits > 11)
{
config = 12;
#else
}
else if (bits <= 13)
{
config = 12;
}
else if (bits > 13)
{
config = 16;
#endif
}
else
{
config = 8; // default to 8 bits
}
// conversion resolution
// single-ended 8 bits is the same as differential 9 bits, etc.
if ((config == 8) || (config == 9))
{
#ifdef ADC_TEENSY_4
atomic::clearBitFlag(adc_regs.CFG, ADC_CFG_MODE(3));
#else
// *ADC_CFG1_mode1 = 0;
// *ADC_CFG1_mode0 = 0;
atomic::clearBitFlag(adc_regs.CFG1, ADC_CFG1_MODE(3));
#endif
analog_max_val = 255; // diff mode 9 bits has 1 bit for sign, so max value is the same as single 8 bits
}
else if ((config == 10) || (config == 11))
{
#ifdef ADC_TEENSY_4
atomic::changeBitFlag(adc_regs.CFG, ADC_CFG_MODE(3), ADC_CFG_MODE(1));
#else
// *ADC_CFG1_mode1 = 1;
// *ADC_CFG1_mode0 = 0;
atomic::changeBitFlag(adc_regs.CFG1, ADC_CFG1_MODE(3), ADC_CFG1_MODE(2));
#endif
analog_max_val = 1023;
}
else if ((config == 12) || (config == 13))
{
#ifdef ADC_TEENSY_4
atomic::changeBitFlag(adc_regs.CFG, ADC_CFG_MODE(3), ADC_CFG_MODE(2));
#else
// *ADC_CFG1_mode1 = 0;
// *ADC_CFG1_mode0 = 1;
atomic::changeBitFlag(adc_regs.CFG1, ADC_CFG1_MODE(3), ADC_CFG1_MODE(1));
#endif
analog_max_val = 4095;
}
else
{
#ifdef ADC_TEENSY_4
// Impossible for T4
#else
// *ADC_CFG1_mode1 = 1;
// *ADC_CFG1_mode0 = 1;
atomic::setBitFlag(adc_regs.CFG1, ADC_CFG1_MODE(3));
#endif
analog_max_val = 65535;
}
analog_res_bits = config;
// no recalibration is needed when changing the resolution, p. 619
}
/* Returns the resolution of the ADC
*
*/
uint8_t ADC_Module::getResolution()
{
return analog_res_bits;
}
/* Returns the maximum value for a measurement, that is: 2^resolution-1
*
*/
uint32_t ADC_Module::getMaxValue()
{
return analog_max_val;
}
// Sets the conversion speed
/* Increase the sampling speed for low impedance sources, decrease it for higher impedance ones.
* \param speed can be any of the ADC_SAMPLING_SPEED enum: VERY_LOW_SPEED, LOW_SPEED, MED_SPEED, HIGH_SPEED or VERY_HIGH_SPEED.
*
* VERY_LOW_SPEED is the lowest possible sampling speed (+24 ADCK).
* LOW_SPEED adds +16 ADCK.
* MED_SPEED adds +10 ADCK.
* HIGH_SPEED adds +6 ADCK.
* VERY_HIGH_SPEED is the highest possible sampling speed (0 ADCK added).
*/
void ADC_Module::setConversionSpeed(ADC_CONVERSION_SPEED speed)
{
if (speed == conversion_speed)
{ // no change
return;
}
//if (calibrating) wait_for_cal();
bool is_adack = false;
uint32_t ADC_CFG1_speed = 0; // store the clock and divisor (set to 0 to avoid warnings)
switch (speed)
{
// normal bus clock
#ifndef ADC_TEENSY_4
case ADC_CONVERSION_SPEED::VERY_LOW_SPEED:
atomic::clearBitFlag(adc_regs.CFG2, ADC_CFG2_ADHSC);
atomic::setBitFlag(adc_regs.CFG1, ADC_CFG1_ADLPC);
// ADC_CFG1_speed = ADC_CFG1_VERY_LOW_SPEED;
ADC_CFG1_speed = get_CFG_VERY_LOW_SPEED(ADC_F_BUS);
break;
#endif
case ADC_CONVERSION_SPEED::LOW_SPEED:
#ifdef ADC_TEENSY_4
atomic::clearBitFlag(adc_regs.CFG, ADC_CFG_ADHSC);
atomic::setBitFlag(adc_regs.CFG, ADC_CFG_ADLPC);
#else
atomic::clearBitFlag(adc_regs.CFG2, ADC_CFG2_ADHSC);
atomic::setBitFlag(adc_regs.CFG1, ADC_CFG1_ADLPC);
#endif
// ADC_CFG1_speed = ADC_CFG1_LOW_SPEED;
ADC_CFG1_speed = get_CFG_LOW_SPEED(ADC_F_BUS);
break;
case ADC_CONVERSION_SPEED::MED_SPEED:
#ifdef ADC_TEENSY_4
atomic::clearBitFlag(adc_regs.CFG, ADC_CFG_ADHSC);
atomic::clearBitFlag(adc_regs.CFG, ADC_CFG_ADLPC);
#else
atomic::clearBitFlag(adc_regs.CFG2, ADC_CFG2_ADHSC);
atomic::clearBitFlag(adc_regs.CFG1, ADC_CFG1_ADLPC);
#endif
ADC_CFG1_speed = get_CFG_MEDIUM_SPEED(ADC_F_BUS);
break;
#ifndef ADC_TEENSY_4
case ADC_CONVERSION_SPEED::HIGH_SPEED_16BITS:
atomic::setBitFlag(adc_regs.CFG2, ADC_CFG2_ADHSC);
atomic::clearBitFlag(adc_regs.CFG1, ADC_CFG1_ADLPC);
// ADC_CFG1_speed = ADC_CFG1_HI_SPEED_16_BITS;
ADC_CFG1_speed = get_CFG_HI_SPEED_16_BITS(ADC_F_BUS);
break;
#endif
case ADC_CONVERSION_SPEED::HIGH_SPEED:
#ifdef ADC_TEENSY_4
atomic::setBitFlag(adc_regs.CFG, ADC_CFG_ADHSC);
atomic::clearBitFlag(adc_regs.CFG, ADC_CFG_ADLPC);
#else
atomic::setBitFlag(adc_regs.CFG2, ADC_CFG2_ADHSC);
atomic::clearBitFlag(adc_regs.CFG1, ADC_CFG1_ADLPC);
#endif
ADC_CFG1_speed = get_CFG_HIGH_SPEED(ADC_F_BUS);
break;
#ifndef ADC_TEENSY_4
case ADC_CONVERSION_SPEED::VERY_HIGH_SPEED:
atomic::setBitFlag(adc_regs.CFG2, ADC_CFG2_ADHSC);
atomic::clearBitFlag(adc_regs.CFG1, ADC_CFG1_ADLPC);
// ADC_CFG1_speed = ADC_CFG1_VERY_HIGH_SPEED;
ADC_CFG1_speed = get_CFG_VERY_HIGH_SPEED(ADC_F_BUS);
break;
#endif
// adack - async clock source, independent of the bus clock
#ifdef ADC_TEENSY_4 // fADK = 10 or 20 MHz
case ADC_CONVERSION_SPEED::ADACK_10:
atomic::clearBitFlag(adc_regs.CFG, ADC_CFG_ADHSC);
is_adack = true;
break;
case ADC_CONVERSION_SPEED::ADACK_20:
atomic::setBitFlag(adc_regs.CFG, ADC_CFG_ADHSC);
is_adack = true;
break;
#else // fADK = 2.4, 4.0, 5.2 or 6.2 MHz
case ADC_CONVERSION_SPEED::ADACK_2_4:
atomic::clearBitFlag(adc_regs.CFG2, ADC_CFG2_ADHSC);
atomic::setBitFlag(adc_regs.CFG1, ADC_CFG1_ADLPC);
is_adack = true;
break;
case ADC_CONVERSION_SPEED::ADACK_4_0:
atomic::setBitFlag(adc_regs.CFG2, ADC_CFG2_ADHSC);
atomic::setBitFlag(adc_regs.CFG1, ADC_CFG1_ADLPC);
is_adack = true;
break;
case ADC_CONVERSION_SPEED::ADACK_5_2:
atomic::clearBitFlag(adc_regs.CFG2, ADC_CFG2_ADHSC);
atomic::clearBitFlag(adc_regs.CFG1, ADC_CFG1_ADLPC);
is_adack = true;
break;
case ADC_CONVERSION_SPEED::ADACK_6_2:
atomic::setBitFlag(adc_regs.CFG2, ADC_CFG2_ADHSC);
atomic::clearBitFlag(adc_regs.CFG1, ADC_CFG1_ADLPC);
is_adack = true;
break;
#endif
default:
fail_flag |= ADC_ERROR::OTHER;
return;
}
if (is_adack)
{
// async clock source, independent of the bus clock
#ifdef ADC_TEENSY_4
atomic::setBitFlag(adc_regs.GC, ADC_GC_ADACKEN); // enable ADACK (takes max 5us to be ready)
atomic::setBitFlag(adc_regs.CFG, ADC_CFG_ADICLK(3)); // select ADACK as clock source
atomic::clearBitFlag(adc_regs.CFG, ADC_CFG_ADIV(3)); // select no dividers
#else
atomic::setBitFlag(adc_regs.CFG2, ADC_CFG2_ADACKEN);
atomic::setBitFlag(adc_regs.CFG1, ADC_CFG1_ADICLK(3));
atomic::clearBitFlag(adc_regs.CFG1, ADC_CFG1_ADIV(3));
#endif
}
else
{
// normal bus clock used - disable the internal asynchronous clock
// total speed can be: bus, bus/2, bus/4, bus/8 or bus/16.
#ifdef ADC_TEENSY_4
atomic::clearBitFlag(adc_regs.GC, ADC_GC_ADACKEN); // disable async
atomic::changeBitFlag(adc_regs.CFG, ADC_CFG_ADICLK(3), ADC_CFG1_speed & ADC_CFG_ADICLK(3)); // bus or bus/2
atomic::changeBitFlag(adc_regs.CFG, ADC_CFG_ADIV(3), ADC_CFG1_speed & ADC_CFG_ADIV(3)); // divisor for the clock source
#else
atomic::clearBitFlag(adc_regs.CFG2, ADC_CFG2_ADACKEN);
atomic::changeBitFlag(adc_regs.CFG1, ADC_CFG1_ADICLK(3), ADC_CFG1_speed & ADC_CFG1_ADICLK(3));
atomic::changeBitFlag(adc_regs.CFG1, ADC_CFG1_ADIV(3), ADC_CFG1_speed & ADC_CFG1_ADIV(3));
#endif
}
conversion_speed = speed;
calibrate();
}
// Sets the sampling speed
/* Increase the sampling speed for low impedance sources, decrease it for higher impedance ones.
* \param speed can be any of the ADC_SAMPLING_SPEED enum: VERY_LOW_SPEED, LOW_SPEED, MED_SPEED, HIGH_SPEED or VERY_HIGH_SPEED.
*
* VERY_LOW_SPEED is the lowest possible sampling speed (+24 ADCK).
* LOW_SPEED adds +16 ADCK.
* MED_SPEED adds +10 ADCK.
* HIGH_SPEED adds +6 ADCK.
* VERY_HIGH_SPEED is the highest possible sampling speed (0 ADCK added).
*/
void ADC_Module::setSamplingSpeed(ADC_SAMPLING_SPEED speed)
{
if (calibrating)
wait_for_cal();
switch (speed)
{
#ifdef ADC_TEENSY_4
case ADC_SAMPLING_SPEED::VERY_LOW_SPEED:
atomic::setBitFlag(adc_regs.CFG, ADC_CFG_ADLSMP); // long sampling time enable
atomic::changeBitFlag(adc_regs.CFG, ADC_CFG_ADSTS(3), ADC_CFG_ADSTS(3));
break;
case ADC_SAMPLING_SPEED::LOW_SPEED:
atomic::setBitFlag(adc_regs.CFG, ADC_CFG_ADLSMP); // long sampling time enable
atomic::changeBitFlag(adc_regs.CFG, ADC_CFG_ADSTS(3), ADC_CFG_ADSTS(2));
break;
case ADC_SAMPLING_SPEED::LOW_MED_SPEED:
atomic::setBitFlag(adc_regs.CFG, ADC_CFG_ADLSMP); // long sampling time enable
atomic::changeBitFlag(adc_regs.CFG, ADC_CFG_ADSTS(3), ADC_CFG_ADSTS(1));
break;
case ADC_SAMPLING_SPEED::MED_SPEED:
atomic::setBitFlag(adc_regs.CFG, ADC_CFG_ADLSMP); // long sampling time enable
atomic::changeBitFlag(adc_regs.CFG, ADC_CFG_ADSTS(3), ADC_CFG_ADSTS(0));
break;
case ADC_SAMPLING_SPEED::MED_HIGH_SPEED:
atomic::clearBitFlag(adc_regs.CFG, ADC_CFG_ADLSMP); // long sampling time disabled
atomic::changeBitFlag(adc_regs.CFG, ADC_CFG_ADSTS(3), ADC_CFG_ADSTS(3));
break;
case ADC_SAMPLING_SPEED::HIGH_SPEED:
atomic::clearBitFlag(adc_regs.CFG, ADC_CFG_ADLSMP); // long sampling time disabled
atomic::changeBitFlag(adc_regs.CFG, ADC_CFG_ADSTS(3), ADC_CFG_ADSTS(2));
break;
case ADC_SAMPLING_SPEED::HIGH_VERY_HIGH_SPEED:
atomic::clearBitFlag(adc_regs.CFG, ADC_CFG_ADLSMP); // long sampling time disabled
atomic::changeBitFlag(adc_regs.CFG, ADC_CFG_ADSTS(3), ADC_CFG_ADSTS(1));
break;
case ADC_SAMPLING_SPEED::VERY_HIGH_SPEED:
atomic::clearBitFlag(adc_regs.CFG, ADC_CFG_ADLSMP); // long sampling time disabled
atomic::changeBitFlag(adc_regs.CFG, ADC_CFG_ADSTS(3), ADC_CFG_ADSTS(0));
break;
#else
case ADC_SAMPLING_SPEED::VERY_LOW_SPEED:
atomic::setBitFlag(adc_regs.CFG1, ADC_CFG1_ADLSMP); // long sampling time enable
atomic::clearBitFlag(adc_regs.CFG2, ADC_CFG2_ADLSTS(3)); // maximum sampling time (+24 ADCK)
break;
case ADC_SAMPLING_SPEED::LOW_SPEED:
atomic::setBitFlag(adc_regs.CFG1, ADC_CFG1_ADLSMP); // long sampling time enable
atomic::changeBitFlag(adc_regs.CFG2, ADC_CFG2_ADLSTS(3), ADC_CFG2_ADLSTS(1)); // high sampling time (+16 ADCK)
break;
case ADC_SAMPLING_SPEED::MED_SPEED:
atomic::setBitFlag(adc_regs.CFG1, ADC_CFG1_ADLSMP); // long sampling time enable
atomic::changeBitFlag(adc_regs.CFG2, ADC_CFG2_ADLSTS(3), ADC_CFG2_ADLSTS(2)); // medium sampling time (+10 ADCK)
break;
case ADC_SAMPLING_SPEED::HIGH_SPEED:
atomic::setBitFlag(adc_regs.CFG1, ADC_CFG1_ADLSMP); // long sampling time enable
atomic::setBitFlag(adc_regs.CFG2, ADC_CFG2_ADLSTS(3)); // low sampling time (+6 ADCK)
break;
case ADC_SAMPLING_SPEED::VERY_HIGH_SPEED:
atomic::clearBitFlag(adc_regs.CFG1, ADC_CFG1_ADLSMP); // shortest sampling time
break;
#endif
}
sampling_speed = speed;
}
/* Set the number of averages: 0, 4, 8, 16 or 32.
*
*/
void ADC_Module::setAveraging(uint8_t num)
{
if (calibrating)
wait_for_cal();
if (num <= 1)
{
num = 0;
// ADC_SC3_avge = 0;
#ifdef ADC_TEENSY_4
atomic::clearBitFlag(adc_regs.GC, ADC_GC_AVGE);
#else
atomic::clearBitFlag(adc_regs.SC3, ADC_SC3_AVGE);
#endif
}
else
{
// ADC_SC3_avge = 1;
#ifdef ADC_TEENSY_4
atomic::setBitFlag(adc_regs.GC, ADC_GC_AVGE);
#else
atomic::setBitFlag(adc_regs.SC3, ADC_SC3_AVGE);
#endif
if (num <= 4)
{
num = 4;
// ADC_SC3_avgs0 = 0;
// ADC_SC3_avgs1 = 0;
#ifdef ADC_TEENSY_4
atomic::clearBitFlag(adc_regs.CFG, ADC_CFG_AVGS(3));
#else
atomic::clearBitFlag(adc_regs.SC3, ADC_SC3_AVGS(3));
#endif
}
else if (num <= 8)
{
num = 8;
// ADC_SC3_avgs0 = 1;
// ADC_SC3_avgs1 = 0;
#ifdef ADC_TEENSY_4
atomic::changeBitFlag(adc_regs.CFG, ADC_CFG_AVGS(3), ADC_CFG_AVGS(1));
#else
atomic::changeBitFlag(adc_regs.SC3, ADC_SC3_AVGS(3), ADC_SC3_AVGS(1));
#endif
}
else if (num <= 16)
{
num = 16;
// ADC_SC3_avgs0 = 0;
// ADC_SC3_avgs1 = 1;
#ifdef ADC_TEENSY_4
atomic::changeBitFlag(adc_regs.CFG, ADC_CFG_AVGS(3), ADC_CFG_AVGS(2));
#else
atomic::changeBitFlag(adc_regs.SC3, ADC_SC3_AVGS(3), ADC_SC3_AVGS(2));
#endif
}
else
{
num = 32;
// ADC_SC3_avgs0 = 1;
// ADC_SC3_avgs1 = 1;
#ifdef ADC_TEENSY_4
atomic::setBitFlag(adc_regs.CFG, ADC_CFG_AVGS(3));
#else
atomic::setBitFlag(adc_regs.SC3, ADC_SC3_AVGS(3));
#endif
}
}
analog_num_average = num;
}
/* Enable interrupts: An ADC Interrupt will be raised when the conversion is completed
* (including hardware averages and if the comparison (if any) is true).
*/
void ADC_Module::enableInterrupts(void (*isr)(void), uint8_t priority)
{
if (calibrating)
wait_for_cal();
// ADC_SC1A_aien = 1;
#ifdef ADC_TEENSY_4
atomic::setBitFlag(adc_regs.HC0, ADC_HC_AIEN);
interrupts_enabled = true;
#else
atomic::setBitFlag(adc_regs.SC1A, ADC_SC1_AIEN);
#endif
attachInterruptVector(IRQ_ADC, isr);
NVIC_SET_PRIORITY(IRQ_ADC, priority);
NVIC_ENABLE_IRQ(IRQ_ADC);
}
/* Disable interrupts
*
*/
void ADC_Module::disableInterrupts()
{
// ADC_SC1A_aien = 0;
#ifdef ADC_TEENSY_4
atomic::clearBitFlag(adc_regs.HC0, ADC_HC_AIEN);
interrupts_enabled = false;
#else
atomic::clearBitFlag(adc_regs.SC1A, ADC_SC1_AIEN);
#endif
NVIC_DISABLE_IRQ(IRQ_ADC);
}
#ifdef ADC_USE_DMA
/* Enable DMA request: An ADC DMA request will be raised when the conversion is completed
* (including hardware averages and if the comparison (if any) is true).
*/
void ADC_Module::enableDMA()
{
if (calibrating)
wait_for_cal();
// ADC_SC2_dma = 1;
#ifdef ADC_TEENSY_4
atomic::setBitFlag(adc_regs.GC, ADC_GC_DMAEN);
#else
atomic::setBitFlag(adc_regs.SC2, ADC_SC2_DMAEN);
#endif
}
/* Disable ADC DMA request
*
*/
void ADC_Module::disableDMA()
{
// ADC_SC2_dma = 0;
#ifdef ADC_TEENSY_4
atomic::clearBitFlag(adc_regs.GC, ADC_GC_DMAEN);
#else
atomic::clearBitFlag(adc_regs.SC2, ADC_SC2_DMAEN);
#endif
}
#endif
/* Enable the compare function: A conversion will be completed only when the ADC value
* is >= compValue (greaterThan=1) or < compValue (greaterThan=0)
* Call it after changing the resolution
* Use with interrupts or poll conversion completion with isADC_Complete()
*/
void ADC_Module::enableCompare(int16_t compValue, bool greaterThan)
{
if (calibrating)
wait_for_cal(); // if we modify the adc's registers when calibrating, it will fail
// ADC_SC2_cfe = 1; // enable compare
// ADC_SC2_cfgt = (int32_t)greaterThan; // greater or less than?
#ifdef ADC_TEENSY_4
atomic::setBitFlag(adc_regs.GC, ADC_GC_ACFE);
atomic::changeBitFlag(adc_regs.GC, ADC_GC_ACFGT, ADC_GC_ACFGT * greaterThan);
adc_regs.CV = ADC_CV_CV1(compValue);
#else
atomic::setBitFlag(adc_regs.SC2, ADC_SC2_ACFE);
atomic::changeBitFlag(adc_regs.SC2, ADC_SC2_ACFGT, ADC_SC2_ACFGT * greaterThan);
adc_regs.CV1 = (int16_t)compValue; // comp value
#endif
}
/* Enable the compare function: A conversion will be completed only when the ADC value
* is inside (insideRange=1) or outside (=0) the range given by (lowerLimit, upperLimit),
* including (inclusive=1) the limits or not (inclusive=0).
* See Table 31-78, p. 617 of the freescale manual.
* Call it after changing the resolution
*/
void ADC_Module::enableCompareRange(int16_t lowerLimit, int16_t upperLimit, bool insideRange, bool inclusive)
{
if (calibrating)
wait_for_cal(); // if we modify the adc's registers when calibrating, it will fail
// ADC_SC2_cfe = 1; // enable compare
// ADC_SC2_cren = 1; // enable compare range
#ifdef ADC_TEENSY_4
atomic::setBitFlag(adc_regs.GC, ADC_GC_ACFE);
atomic::setBitFlag(adc_regs.GC, ADC_GC_ACREN);
#else
atomic::setBitFlag(adc_regs.SC2, ADC_SC2_ACFE);
atomic::setBitFlag(adc_regs.SC2, ADC_SC2_ACREN);
#endif
if (insideRange && inclusive)
{ // True if value is inside the range, including the limits. CV1 <= CV2 and ACFGT=1
// ADC_SC2_cfgt = 1;
#ifdef ADC_TEENSY_4
atomic::setBitFlag(adc_regs.GC, ADC_GC_ACFGT);
adc_regs.CV = ADC_CV_CV1(lowerLimit) | ADC_CV_CV2(upperLimit);
#else
atomic::setBitFlag(adc_regs.SC2, ADC_SC2_ACFGT);
adc_regs.CV1 = (int16_t)lowerLimit;
adc_regs.CV2 = (int16_t)upperLimit;
#endif
}
else if (insideRange && !inclusive)
{ // True if value is inside the range, excluding the limits. CV1 > CV2 and ACFGT=0
// ADC_SC2_cfgt = 0;
#ifdef ADC_TEENSY_4
atomic::clearBitFlag(adc_regs.GC, ADC_GC_ACFGT);
adc_regs.CV = ADC_CV_CV2(lowerLimit) | ADC_CV_CV1(upperLimit);
#else
atomic::clearBitFlag(adc_regs.SC2, ADC_SC2_ACFGT);
adc_regs.CV2 = (int16_t)lowerLimit;
adc_regs.CV1 = (int16_t)upperLimit;
#endif
}
else if (!insideRange && inclusive)
{ // True if value is outside of range or is equal to either limit. CV1 > CV2 and ACFGT=1
// ADC_SC2_cfgt = 1;
#ifdef ADC_TEENSY_4
atomic::setBitFlag(adc_regs.GC, ADC_GC_ACFGT);
adc_regs.CV = ADC_CV_CV2(lowerLimit) | ADC_CV_CV1(upperLimit);
#else
atomic::setBitFlag(adc_regs.SC2, ADC_SC2_ACFGT);
adc_regs.CV2 = (int16_t)lowerLimit;
adc_regs.CV1 = (int16_t)upperLimit;
#endif
}
else if (!insideRange && !inclusive)
{ // True if value is outside of range and not equal to either limit. CV1 > CV2 and ACFGT=0
// ADC_SC2_cfgt = 0;
#ifdef ADC_TEENSY_4
atomic::clearBitFlag(adc_regs.GC, ADC_GC_ACFGT);
adc_regs.CV = ADC_CV_CV1(lowerLimit) | ADC_CV_CV2(upperLimit);
#else
atomic::clearBitFlag(adc_regs.SC2, ADC_SC2_ACFGT);
adc_regs.CV1 = (int16_t)lowerLimit;
adc_regs.CV2 = (int16_t)upperLimit;
#endif
}
}
/* Disable the compare function
*
*/
void ADC_Module::disableCompare()
{
// ADC_SC2_cfe = 0;
#ifdef ADC_TEENSY_4
atomic::clearBitFlag(adc_regs.GC, ADC_GC_ACFE);
#else
atomic::clearBitFlag(adc_regs.SC2, ADC_SC2_ACFE);
#endif
}
#ifdef ADC_USE_PGA
/* Enables the PGA and sets the gain
* Use only for signals lower than 1.2 V
* \param gain can be 1, 2, 4, 8, 16 32 or 64
*
*/
void ADC_Module::enablePGA(uint8_t gain)
{
if (calibrating)
wait_for_cal();
uint8_t setting;
if (gain <= 1)
{
setting = 0;
}
else if (gain <= 2)
{
setting = 1;
}
else if (gain <= 4)
{
setting = 2;
}
else if (gain <= 8)
{
setting = 3;
}
else if (gain <= 16)
{
setting = 4;
}
else if (gain <= 32)
{
setting = 5;
}
else
{ // 64
setting = 6;
}
adc_regs.PGA = ADC_PGA_PGAEN | ADC_PGA_PGAG(setting);
pga_value = 1 << setting;
}
/* Returns the PGA level
* PGA level = from 0 to 64
*/
uint8_t ADC_Module::getPGA()
{
return pga_value;
}
//! Disable PGA
void ADC_Module::disablePGA()
{
// ADC_PGA_pgaen = 0;
atomic::clearBitFlag(adc_regs.PGA, ADC_PGA_PGAEN);
pga_value = 1;
}
#endif
//////////////// INFORMATION ABOUT VALID PINS //////////////////
// check whether the pin is a valid analog pin
bool ADC_Module::checkPin(uint8_t pin)
{
if (pin > ADC_MAX_PIN)
{
return false; // all others are invalid
}
// translate pin number to SC1A number, that also contains MUX a or b info.
const uint8_t sc1a_pin = channel2sc1a[pin];
// check for valid pin
if ((sc1a_pin & ADC_SC1A_CHANNELS) == ADC_SC1A_PIN_INVALID)
{
return false; // all others are invalid
}
return true;
}
#if ADC_DIFF_PAIRS > 0
// check whether the pins are a valid analog differential pins (including PGA if enabled)
bool ADC_Module::checkDifferentialPins(uint8_t pinP, uint8_t pinN)
{
if (pinP > ADC_MAX_PIN)
{
return false; // all others are invalid
}
// translate pinP number to SC1A number, to make sure it's differential
uint8_t sc1a_pin = channel2sc1a[pinP];
if (!(sc1a_pin & ADC_SC1A_PIN_DIFF))
{
return false; // all others are invalid
}
// get SC1A number, also whether it can do PGA
sc1a_pin = getDifferentialPair(pinP);
// the pair can't be measured with this ADC
if ((sc1a_pin & ADC_SC1A_CHANNELS) == ADC_SC1A_PIN_INVALID)
{
return false; // all others are invalid
}
#ifdef ADC_USE_PGA
// check if PGA is enabled, and whether the pin has access to it in this ADC module
if (isPGAEnabled() && !(sc1a_pin & ADC_SC1A_PIN_PGA))
{
return false;
}
#endif // ADC_USE_PGA
return true;
}
#endif
//////////////// HELPER METHODS FOR CONVERSION /////////////////
// Starts a single-ended conversion on the pin (sets the mux correctly)
// Doesn't do any of the checks on the pin
// It doesn't change the continuous conversion bit
void ADC_Module::startReadFast(uint8_t pin)
{
// translate pin number to SC1A number, that also contains MUX a or b info.
const uint8_t sc1a_pin = channel2sc1a[pin];
#ifdef ADC_TEENSY_4
// Teensy 4 has no a or b channels
#else
if (sc1a_pin & ADC_SC1A_PIN_MUX)
{ // mux a
atomic::clearBitFlag(adc_regs.CFG2, ADC_CFG2_MUXSEL);
}
else
{ // mux b
atomic::setBitFlag(adc_regs.CFG2, ADC_CFG2_MUXSEL);
}
#endif
// select pin for single-ended mode and start conversion, enable interrupts if requested
__disable_irq();
#ifdef ADC_TEENSY_4
adc_regs.HC0 = (sc1a_pin & ADC_SC1A_CHANNELS) + interrupts_enabled * ADC_HC_AIEN;
#else
adc_regs.SC1A = (sc1a_pin & ADC_SC1A_CHANNELS) + atomic::getBitFlag(adc_regs.SC1A, ADC_SC1_AIEN) * ADC_SC1_AIEN;
#endif
__enable_irq();
}
#if ADC_DIFF_PAIRS > 0
// Starts a differential conversion on the pair of pins
// Doesn't do any of the checks on the pins
// It doesn't change the continuous conversion bit
void ADC_Module::startDifferentialFast(uint8_t pinP, uint8_t pinN)
{
// get SC1A number
uint8_t sc1a_pin = getDifferentialPair(pinP);
#ifdef ADC_USE_PGA
// check if PGA is enabled
if (isPGAEnabled())
{
sc1a_pin = 0x2; // PGA always uses DAD2
}
#endif // ADC_USE_PGA
__disable_irq();
adc_regs.SC1A = ADC_SC1_DIFF + (sc1a_pin & ADC_SC1A_CHANNELS) + atomic::getBitFlag(adc_regs.SC1A, ADC_SC1_AIEN) * ADC_SC1_AIEN;
__enable_irq();
}
#endif
//////////////// BLOCKING CONVERSION METHODS //////////////////
/*
This methods are implemented like this:
1. Check that the pin is correct
2. if calibrating, wait for it to finish before modifiying any ADC register
3. Check if we're interrupting a measurement, if so store the settings.
4. Disable continuous conversion mode and start the current measurement
5. Wait until it's done, and check whether the comparison (if any) was succesful.
6. Get the result.
7. If step 3. is true, restore the previous ADC settings
*/
/* Reads the analog value of the pin.
* It waits until the value is read and then returns the result.
* If a comparison has been set up and fails, it will return ADC_ERROR_VALUE.
* Set the resolution, number of averages and voltage reference using the appropriate functions.
*/
int ADC_Module::analogRead(uint8_t pin)
{
//digitalWriteFast(LED_BUILTIN, HIGH);
// check whether the pin is correct
if (!checkPin(pin))
{
fail_flag |= ADC_ERROR::WRONG_PIN;
return ADC_ERROR_VALUE;
}
// increase the counter of measurements
num_measurements++;
//digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN));
if (calibrating)
wait_for_cal();
//digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN));
// check if we are interrupting a measurement, store setting if so.
// vars to save the current state of the ADC in case it's in use
ADC_Config old_config = {};
const uint8_t wasADCInUse = isConverting(); // is the ADC running now?
if (wasADCInUse)
{ // this means we're interrupting a conversion
// save the current conversion config, we don't want any other interrupts messing up the configs
__disable_irq();
//digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) );
saveConfig(&old_config);
__enable_irq();
}
// no continuous mode
singleMode();
startReadFast(pin); // start single read
// wait for the ADC to finish
while (isConverting())
{
yield();
}
// it's done, check if the comparison (if any) was true
int32_t result;
__disable_irq(); // make sure nothing interrupts this part
if (isComplete())
{ // conversion succeded
result = (uint16_t)readSingle();
}
else
{ // comparison was false
fail_flag |= ADC_ERROR::COMPARISON;
result = ADC_ERROR_VALUE;
}
__enable_irq();
// if we interrupted a conversion, set it again
if (wasADCInUse)
{
//digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) );
__disable_irq();
loadConfig(&old_config);
__enable_irq();
}
num_measurements--;
return result;
} // analogRead
#if ADC_DIFF_PAIRS > 0
/* Reads the differential analog value of two pins (pinP - pinN)
* It waits until the value is read and then returns the result
* If a comparison has been set up and fails, it will return ADC_ERROR_DIFF_VALUE
* Set the resolution, number of averages and voltage reference using the appropriate functions
*/
int ADC_Module::analogReadDifferential(uint8_t pinP, uint8_t pinN)
{
if (!checkDifferentialPins(pinP, pinN))
{
fail_flag |= ADC_ERROR::WRONG_PIN;
return ADC_ERROR_VALUE; // all others are invalid
}
// increase the counter of measurements
num_measurements++;
// check for calibration before setting channels,
// because conversion will start as soon as we write to adc_regs.SC1A
if (calibrating)
wait_for_cal();
uint8_t res = getResolution();
// vars to saved the current state of the ADC in case it's in use
ADC_Config old_config = {};
uint8_t wasADCInUse = isConverting(); // is the ADC running now?
if (wasADCInUse)
{ // this means we're interrupting a conversion
// save the current conversion config, we don't want any other interrupts messing up the configs
__disable_irq();
saveConfig(&old_config);
__enable_irq();
}
// no continuous mode
singleMode();
startDifferentialFast(pinP, pinN); // start conversion
// wait for the ADC to finish
while (isConverting())
{
yield();
//digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) );
}
// it's done, check if the comparison (if any) was true
int32_t result;
__disable_irq(); // make sure nothing interrupts this part
if (isComplete())
{ // conversion succeded
result = (int16_t)(int32_t)readSingle(); // cast to 32 bits
if (res == 16)
{ // 16 bit differential is actually 15 bit + 1 bit sign
result *= 2; // multiply by 2 as if it were really 16 bits, so that getMaxValue gives a correct value.
}
}
else
{ // comparison was false
result = ADC_ERROR_VALUE;
fail_flag |= ADC_ERROR::COMPARISON;
}
__enable_irq();
// if we interrupted a conversion, set it again
if (wasADCInUse)
{
__disable_irq();
loadConfig(&old_config);
__enable_irq();
}
num_measurements--;
return result;
} // analogReadDifferential
#endif
/////////////// NON-BLOCKING CONVERSION METHODS //////////////
/*
This methods are implemented like this:
1. Check that the pin is correct
2. if calibrating, wait for it to finish before modifiying any ADC register
3. Check if we're interrupting a measurement, if so store the settings (in a member of the class, so it can be accessed).
4. Disable continuous conversion mode and start the current measurement
The fast methods only do step 4.
*/
/* Starts an analog measurement on the pin.
* It returns inmediately, read value with readSingle().
* If the pin is incorrect it returns false.
*/
bool ADC_Module::startSingleRead(uint8_t pin)
{
// check whether the pin is correct
if (!checkPin(pin))
{
fail_flag |= ADC_ERROR::WRONG_PIN;
return false;
}
if (calibrating)
wait_for_cal();
// save the current state of the ADC in case it's in use
adcWasInUse = isConverting(); // is the ADC running now?
if (adcWasInUse)
{ // this means we're interrupting a conversion
// save the current conversion config, the adc isr will restore the adc
__disable_irq();
saveConfig(&adc_config);
__enable_irq();
}
// no continuous mode
singleMode();
// start measurement
startReadFast(pin);
return true;
}
#if ADC_DIFF_PAIRS > 0
/* Start a differential conversion between two pins (pinP - pinN).
* It returns inmediately, get value with readSingle().
* Incorrect pins will return false.
* Set the resolution, number of averages and voltage reference using the appropriate functions
*/
bool ADC_Module::startSingleDifferential(uint8_t pinP, uint8_t pinN)
{
if (!checkDifferentialPins(pinP, pinN))
{
fail_flag |= ADC_ERROR::WRONG_PIN;
return false; // all others are invalid
}
// check for calibration before setting channels,
// because conversion will start as soon as we write to adc_regs.SC1A
if (calibrating)
wait_for_cal();
// vars to saved the current state of the ADC in case it's in use
adcWasInUse = isConverting(); // is the ADC running now?
if (adcWasInUse)
{ // this means we're interrupting a conversion
// save the current conversion config, we don't want any other interrupts messing up the configs
__disable_irq();
saveConfig(&adc_config);
__enable_irq();
}
// no continuous mode
singleMode();
// start the conversion
startDifferentialFast(pinP, pinN);
return true;
}
#endif
///////////// CONTINUOUS CONVERSION METHODS ////////////
/*
This methods are implemented like this:
1. Check that the pin is correct
2. If calibrating, wait for it to finish before modifiying any ADC register
4. Enable continuous conversion mode and start the current measurement
*/
/* Starts continuous conversion on the pin
* It returns as soon as the ADC is set, use analogReadContinuous() to read the values
* Set the resolution, number of averages and voltage reference using the appropriate functions BEFORE calling this function
*/
bool ADC_Module::startContinuous(uint8_t pin)
{
// check whether the pin is correct
if (!checkPin(pin))
{
fail_flag |= ADC_ERROR::WRONG_PIN;
return false;
}
// check for calibration before setting channels,
if (calibrating)
wait_for_cal();
// increase the counter of measurements
num_measurements++;
// set continuous conversion flag
continuousMode();
startReadFast(pin);
return true;
}
#if ADC_DIFF_PAIRS > 0
/* Starts continuous and differential conversion between the pins (pinP-pinN)
* It returns as soon as the ADC is set, use analogReadContinuous() to read the value
* Set the resolution, number of averages and voltage reference using the appropriate functions BEFORE calling this function
*/
bool ADC_Module::startContinuousDifferential(uint8_t pinP, uint8_t pinN)
{
if (!checkDifferentialPins(pinP, pinN))
{
fail_flag |= ADC_ERROR::WRONG_PIN;
return false; // all others are invalid
}
// increase the counter of measurements
num_measurements++;
// check for calibration before setting channels,
// because conversion will start as soon as we write to adc_regs.SC1A
if (calibrating)
wait_for_cal();
// save the current state of the ADC in case it's in use
uint8_t wasADCInUse = isConverting(); // is the ADC running now?
if (wasADCInUse)
{ // this means we're interrupting a conversion
// save the current conversion config, we don't want any other interrupts messing up the configs
__disable_irq();
saveConfig(&adc_config);
__enable_irq();
}
// set continuous mode
continuousMode();
// start conversions
startDifferentialFast(pinP, pinN);
return true;
}
#endif
/* Stops continuous conversion
*/
void ADC_Module::stopContinuous()
{
// set channel select to all 1's (31) to stop it.
#ifdef ADC_TEENSY_4
adc_regs.HC0 = ADC_SC1A_PIN_INVALID + interrupts_enabled * ADC_HC_AIEN;
#else
adc_regs.SC1A = ADC_SC1A_PIN_INVALID + atomic::getBitFlag(adc_regs.SC1A, ADC_SC1_AIEN) * ADC_SC1_AIEN;
#endif
// decrease the counter of measurements (unless it's 0)
if (num_measurements > 0)
{
num_measurements--;
}
return;
}
//////////// FREQUENCY METHODS ////////
//////////// PDB ////////////////
#ifdef ADC_USE_PDB
// frequency in Hz
void ADC_Module::startPDB(uint32_t freq)
{
if (!(SIM_SCGC6 & SIM_SCGC6_PDB))
{ // setup PDB
SIM_SCGC6 |= SIM_SCGC6_PDB; // enable pdb clock
}
if (freq > ADC_F_BUS)
return; // too high
if (freq < 1)
return; // too low
// mod will have to be a 16 bit value
// we detect if it's higher than 0xFFFF and scale it back accordingly.
uint32_t mod = (ADC_F_BUS / freq);
uint8_t prescaler = 0; // from 0 to 7: factor of 1, 2, 4, 8, 16, 32, 64 or 128
uint8_t mult = 0; // from 0 to 3, factor of 1, 10, 20 or 40
// if mod is too high we need to use prescaler and mult to bring it down to a 16 bit number
const uint32_t min_level = 0xFFFF;
if (mod > min_level)
{
if (mod < 2 * min_level)
{
prescaler = 1;
}
else if (mod < 4 * min_level)
{
prescaler = 2;
}
else if (mod < 8 * min_level)
{
prescaler = 3;
}
else if (mod < 10 * min_level)
{
mult = 1;
}
else if (mod < 16 * min_level)
{
prescaler = 4;
}
else if (mod < 20 * min_level)
{
mult = 2;
}
else if (mod < 32 * min_level)
{
prescaler = 5;
}
else if (mod < 40 * min_level)
{
mult = 3;
}
else if (mod < 64 * min_level)
{
prescaler = 6;
}
else if (mod < 128 * min_level)
{
prescaler = 7;
}
else if (mod < 160 * min_level)
{ // 16*10
prescaler = 4;
mult = 1;
}
else if (mod < 320 * min_level)
{ // 16*20
prescaler = 4;
mult = 2;
}
else if (mod < 640 * min_level)
{ // 16*40
prescaler = 4;
mult = 3;
}
else if (mod < 1280 * min_level)
{ // 32*40
prescaler = 5;
mult = 3;
}
else if (mod < 2560 * min_level)
{ // 64*40
prescaler = 6;
mult = 3;
}
else if (mod < 5120 * min_level)
{ // 128*40
prescaler = 7;
mult = 3;
}
else
{ // frequency too low
return;
}
mod >>= prescaler;
if (mult > 0)
{
mod /= 10;
mod >>= (mult - 1);
}
}
setHardwareTrigger(); // trigger ADC with hardware
// software trigger enable PDB PDB interrupt continuous mode load immediately
constexpr uint32_t ADC_PDB_CONFIG = PDB_SC_TRGSEL(15) | PDB_SC_PDBEN | PDB_SC_PDBIE | PDB_SC_CONT | PDB_SC_LDMOD(0);
constexpr uint32_t PDB_CHnC1_TOS_1 = 0x0100;
constexpr uint32_t PDB_CHnC1_EN_1 = 0x01;
PDB0_IDLY = 1; // the pdb interrupt happens when IDLY is equal to CNT+1
PDB0_MOD = (uint16_t)(mod - 1);
PDB0_SC = ADC_PDB_CONFIG | PDB_SC_PRESCALER(prescaler) | PDB_SC_MULT(mult) | PDB_SC_LDOK; // load all new values
PDB0_SC = ADC_PDB_CONFIG | PDB_SC_PRESCALER(prescaler) | PDB_SC_MULT(mult) | PDB_SC_SWTRIG; // start the counter!
PDB0_CHnC1 = PDB_CHnC1_TOS_1 | PDB_CHnC1_EN_1; // enable pretrigger 0 (SC1A)
//NVIC_ENABLE_IRQ(IRQ_PDB);
}
void ADC_Module::stopPDB()
{
if (!(SIM_SCGC6 & SIM_SCGC6_PDB))
{ // if PDB clock wasn't on, return
setSoftwareTrigger();
return;
}
PDB0_SC = 0;
setSoftwareTrigger();
//NVIC_DISABLE_IRQ(IRQ_PDB);
}
//! Return the PDB's frequency
uint32_t ADC_Module::getPDBFrequency()
{
const uint32_t mod = (uint32_t)PDB0_MOD;
const uint8_t prescaler = (PDB0_SC & 0x7000) >> 12;
const uint8_t mult = (PDB0_SC & 0xC) >> 2;
const uint32_t freq = uint32_t((mod + 1) << (prescaler)) * uint32_t((mult == 0) ? 1 : 10 << (mult - 1));
return ADC_F_BUS / freq;
}
#endif
#ifdef ADC_USE_QUAD_TIMER
// TODO: Add support for Teensy 3.x Quad timer
#if defined(ADC_TEENSY_4) // only supported by Teensy 4...
// try to use some teensy core functions...
// mainly out of pwm.c
extern "C"
{
extern void xbar_connect(unsigned int input, unsigned int output);
extern void quadtimer_init(IMXRT_TMR_t *p);
extern void quadtimerWrite(IMXRT_TMR_t *p, unsigned int submodule, uint16_t val);
extern void quadtimerFrequency(IMXRT_TMR_t *p, unsigned int submodule, float frequency);
}
void ADC_Module::startQuadTimer(uint32_t freq)
{
// First lets setup the XBAR
CCM_CCGR2 |= CCM_CCGR2_XBAR1(CCM_CCGR_ON); //turn clock on for xbara1
xbar_connect(XBAR_IN, XBAR_OUT);
// Update the ADC
uint8_t adc_pin_channel = adc_regs.HC0 & 0x1f; // remember the trigger that was set
setHardwareTrigger(); // set the hardware trigger
adc_regs.HC0 = (adc_regs.HC0 & ~0x1f) | 16; // ADC_ETC channel remember other states...
singleMode(); // make sure continuous is turned off as you want the trigger to di it.
// setup adc_etc - BUGBUG have not used the preset values yet.
if (IMXRT_ADC_ETC.CTRL & ADC_ETC_CTRL_SOFTRST)
{ // SOFTRST
// Soft reset
atomic::clearBitFlag(IMXRT_ADC_ETC.CTRL, ADC_ETC_CTRL_SOFTRST);
delay(5); // give some time to be sure it is init
}
if (ADC_num == 0)
{ // BUGBUG - in real code, should probably know we init ADC or not..
IMXRT_ADC_ETC.CTRL |=
(ADC_ETC_CTRL_TSC_BYPASS | ADC_ETC_CTRL_DMA_MODE_SEL | ADC_ETC_CTRL_TRIG_ENABLE(1 << ADC_ETC_TRIGGER_INDEX)); // 0x40000001; // start with trigger 0
IMXRT_ADC_ETC.TRIG[ADC_ETC_TRIGGER_INDEX].CTRL = ADC_ETC_TRIG_CTRL_TRIG_CHAIN(0); // chainlength -1 only us
IMXRT_ADC_ETC.TRIG[ADC_ETC_TRIGGER_INDEX].CHAIN_1_0 =
ADC_ETC_TRIG_CHAIN_IE0(1) /*| ADC_ETC_TRIG_CHAIN_B2B0 */
| ADC_ETC_TRIG_CHAIN_HWTS0(1) | ADC_ETC_TRIG_CHAIN_CSEL0(adc_pin_channel);
if (interrupts_enabled)
{
// Not sure yet?
}
if (adc_regs.GC & ADC_GC_DMAEN)
{
IMXRT_ADC_ETC.DMA_CTRL |= ADC_ETC_DMA_CTRL_TRIQ_ENABLE(ADC_ETC_TRIGGER_INDEX);
}
}
else
{
// This is our second one... Try second trigger?
// Remove the BYPASS?
IMXRT_ADC_ETC.CTRL &= ~(ADC_ETC_CTRL_TSC_BYPASS); // 0x40000001; // start with trigger 0
IMXRT_ADC_ETC.CTRL |= ADC_ETC_CTRL_DMA_MODE_SEL | ADC_ETC_CTRL_TRIG_ENABLE(1 << ADC_ETC_TRIGGER_INDEX); // Add trigger
IMXRT_ADC_ETC.TRIG[ADC_ETC_TRIGGER_INDEX].CTRL = ADC_ETC_TRIG_CTRL_TRIG_CHAIN(0); // chainlength -1 only us
IMXRT_ADC_ETC.TRIG[ADC_ETC_TRIGGER_INDEX].CHAIN_1_0 =
ADC_ETC_TRIG_CHAIN_IE0(1) /*| ADC_ETC_TRIG_CHAIN_B2B0 */
| ADC_ETC_TRIG_CHAIN_HWTS0(1) | ADC_ETC_TRIG_CHAIN_CSEL0(adc_pin_channel);
if (adc_regs.GC & ADC_GC_DMAEN)
{
IMXRT_ADC_ETC.DMA_CTRL |= ADC_ETC_DMA_CTRL_TRIQ_ENABLE(ADC_ETC_TRIGGER_INDEX);
}
}
// Now init the QTimer.
// Extracted from quadtimer_init in pwm.c but only the one channel...
// Maybe see if we have to do this every time we call this. But how often is that?
IMXRT_TMR4.CH[QTIMER4_INDEX].CTRL = 0; // stop timer
IMXRT_TMR4.CH[QTIMER4_INDEX].CNTR = 0;
IMXRT_TMR4.CH[QTIMER4_INDEX].SCTRL = TMR_SCTRL_OEN | TMR_SCTRL_OPS | TMR_SCTRL_VAL | TMR_SCTRL_FORCE;
IMXRT_TMR4.CH[QTIMER4_INDEX].CSCTRL = TMR_CSCTRL_CL1(1) | TMR_CSCTRL_ALT_LOAD;
// COMP must be less than LOAD - otherwise output is always low
IMXRT_TMR4.CH[QTIMER4_INDEX].LOAD = 24000; // low time (65537 - x) -
IMXRT_TMR4.CH[QTIMER4_INDEX].COMP1 = 0; // high time (0 = always low, max = LOAD-1)
IMXRT_TMR4.CH[QTIMER4_INDEX].CMPLD1 = 0;
IMXRT_TMR4.CH[QTIMER4_INDEX].CTRL = TMR_CTRL_CM(1) | TMR_CTRL_PCS(8) |
TMR_CTRL_LENGTH | TMR_CTRL_OUTMODE(6);
quadtimerFrequency(&IMXRT_TMR4, QTIMER4_INDEX, freq);
quadtimerWrite(&IMXRT_TMR4, QTIMER4_INDEX, 5);
}
//! Stop the PDB
void ADC_Module::stopQuadTimer()
{
quadtimerWrite(&IMXRT_TMR4, QTIMER4_INDEX, 0);
setSoftwareTrigger();
}
//! Return the PDB's frequency
uint32_t ADC_Module::getQuadTimerFrequency()
{
// Can I reverse the calculations of quad timer set frequency?
uint32_t high = IMXRT_TMR4.CH[QTIMER4_INDEX].CMPLD1;
uint32_t low = 65537 - IMXRT_TMR4.CH[QTIMER4_INDEX].LOAD;
uint32_t highPlusLow = high + low; //
if (highPlusLow == 0)
return 0; //
uint8_t pcs = (IMXRT_TMR4.CH[QTIMER4_INDEX].CTRL >> 9) & 0x7;
uint32_t freq = (F_BUS_ACTUAL >> pcs) / highPlusLow;
//Serial.printf("ADC_Module::getTimerFrequency H:%u L:%u H+L=%u pcs:%u freq:%u\n", high, low, highPlusLow, pcs, freq);
return freq;
}
#endif // Teensy 4
#endif // ADC_USE_QUAD_TIMER
================================================
FILE: firmware/3.0/lib/ADC/ADC_Module.h
================================================
/* Teensy 4.x, 3.x, LC ADC library
* https://github.com/pedvide/ADC
* Copyright (c) 2020 Pedro Villanueva
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/* ADC_Module.h: Declarations of the fuctions of a Teensy 3.x, LC ADC module
*
*/
/*! \
gitextract_mg_ibzep/
├── .github/
│ └── FUNDING.yml
├── .gitignore
├── LICENSE
├── README.MD
├── enclosure/
│ ├── 3.0/
│ │ ├── enclosure.skb
│ │ └── enclosure.skp
│ └── README.MD
├── firmware/
│ ├── 3.0/
│ │ ├── .gitignore
│ │ ├── include/
│ │ │ ├── battery.h
│ │ │ ├── bitmaps.h
│ │ │ ├── buttons.h
│ │ │ ├── colorschemes.h
│ │ │ ├── connection.h
│ │ │ ├── create.h
│ │ │ ├── display.h
│ │ │ ├── firststart.h
│ │ │ ├── fonts.h
│ │ │ ├── ft6206_touchscreen.h
│ │ │ ├── globaldefines.h
│ │ │ ├── globalvariables.h
│ │ │ ├── gui.h
│ │ │ ├── hardware.h
│ │ │ ├── lepton.h
│ │ │ ├── livemode.h
│ │ │ ├── load.h
│ │ │ ├── loadmenu.h
│ │ │ ├── mainmenu.h
│ │ │ ├── massstorage.h
│ │ │ ├── save.h
│ │ │ ├── sdcard.h
│ │ │ ├── settingsmenu.h
│ │ │ ├── temperature.h
│ │ │ ├── thermal.h
│ │ │ ├── touchscreen.h
│ │ │ ├── videomenu.h
│ │ │ └── xpt2046_touchscreen.h
│ │ ├── lib/
│ │ │ ├── ADC/
│ │ │ │ ├── ADC.cpp
│ │ │ │ ├── ADC.h
│ │ │ │ ├── ADC_Module.cpp
│ │ │ │ ├── ADC_Module.h
│ │ │ │ ├── ADC_util.h
│ │ │ │ ├── AnalogBufferDMA.cpp
│ │ │ │ ├── AnalogBufferDMA.h
│ │ │ │ ├── VREF.h
│ │ │ │ ├── atomic.h
│ │ │ │ └── settings_defines.h
│ │ │ ├── Bounce/
│ │ │ │ ├── Bounce.cpp
│ │ │ │ └── Bounce.h
│ │ │ ├── EEPROM/
│ │ │ │ ├── EEPROM.cpp
│ │ │ │ └── EEPROM.h
│ │ │ ├── LittleFS/
│ │ │ │ ├── LittleFS.cpp
│ │ │ │ ├── LittleFS.h
│ │ │ │ ├── LittleFS_NAND.cpp
│ │ │ │ └── littlefs/
│ │ │ │ ├── DESIGN.md
│ │ │ │ ├── LICENSE.md
│ │ │ │ ├── README.md
│ │ │ │ ├── SPEC.md
│ │ │ │ ├── lfs.c
│ │ │ │ ├── lfs.h
│ │ │ │ ├── lfs_util.c
│ │ │ │ └── lfs_util.h
│ │ │ ├── MTP/
│ │ │ │ ├── MTP.cpp
│ │ │ │ ├── MTP.h
│ │ │ │ ├── Storage.cpp
│ │ │ │ └── Storage.h
│ │ │ ├── Metro/
│ │ │ │ ├── Metro.cpp
│ │ │ │ └── Metro.h
│ │ │ ├── SD/
│ │ │ │ ├── library.properties
│ │ │ │ └── src/
│ │ │ │ ├── SD.cpp
│ │ │ │ └── SD.h
│ │ │ ├── SPI/
│ │ │ │ ├── SPI.cpp
│ │ │ │ └── SPI.h
│ │ │ ├── SdFat/
│ │ │ │ └── src/
│ │ │ │ ├── BufferedPrint.h
│ │ │ │ ├── DigitalIO/
│ │ │ │ │ ├── DigitalPin.h
│ │ │ │ │ ├── SoftSPI.h
│ │ │ │ │ ├── boards/
│ │ │ │ │ │ ├── AvrDevelopersGpioPinMap.h
│ │ │ │ │ │ ├── BobuinoGpioPinMap.h
│ │ │ │ │ │ ├── GpioPinMap.h
│ │ │ │ │ │ ├── LeonardoGpioPinMap.h
│ │ │ │ │ │ ├── MegaGpioPinMap.h
│ │ │ │ │ │ ├── SleepingBeautyGpioPinMap.h
│ │ │ │ │ │ ├── Standard1284GpioPinMap.h
│ │ │ │ │ │ ├── Teensy2GpioPinMap.h
│ │ │ │ │ │ ├── Teensy2ppGpioPinMap.h
│ │ │ │ │ │ └── UnoGpioPinMap.h
│ │ │ │ │ └── readme.txt
│ │ │ │ ├── ExFatLib/
│ │ │ │ │ ├── ExFatConfig.h
│ │ │ │ │ ├── ExFatDbg.cpp
│ │ │ │ │ ├── ExFatFile.cpp
│ │ │ │ │ ├── ExFatFile.h
│ │ │ │ │ ├── ExFatFilePrint.cpp
│ │ │ │ │ ├── ExFatFileWrite.cpp
│ │ │ │ │ ├── ExFatFormatter.cpp
│ │ │ │ │ ├── ExFatFormatter.h
│ │ │ │ │ ├── ExFatLib.h
│ │ │ │ │ ├── ExFatName.cpp
│ │ │ │ │ ├── ExFatPartition.cpp
│ │ │ │ │ ├── ExFatPartition.h
│ │ │ │ │ ├── ExFatVolume.cpp
│ │ │ │ │ ├── ExFatVolume.h
│ │ │ │ │ └── upcase.cpp
│ │ │ │ ├── FatLib/
│ │ │ │ │ ├── FatDbg.cpp
│ │ │ │ │ ├── FatFile.cpp
│ │ │ │ │ ├── FatFile.h
│ │ │ │ │ ├── FatFileLFN.cpp
│ │ │ │ │ ├── FatFilePrint.cpp
│ │ │ │ │ ├── FatFileSFN.cpp
│ │ │ │ │ ├── FatFormatter.cpp
│ │ │ │ │ ├── FatFormatter.h
│ │ │ │ │ ├── FatLib.h
│ │ │ │ │ ├── FatName.cpp
│ │ │ │ │ ├── FatPartition.cpp
│ │ │ │ │ ├── FatPartition.h
│ │ │ │ │ ├── FatVolume.cpp
│ │ │ │ │ └── FatVolume.h
│ │ │ │ ├── FreeStack.cpp
│ │ │ │ ├── FreeStack.h
│ │ │ │ ├── FsLib/
│ │ │ │ │ ├── FsFile.cpp
│ │ │ │ │ ├── FsFile.h
│ │ │ │ │ ├── FsFormatter.h
│ │ │ │ │ ├── FsLib.h
│ │ │ │ │ ├── FsNew.cpp
│ │ │ │ │ ├── FsNew.h
│ │ │ │ │ ├── FsVolume.cpp
│ │ │ │ │ └── FsVolume.h
│ │ │ │ ├── MinimumSerial.cpp
│ │ │ │ ├── MinimumSerial.h
│ │ │ │ ├── RingBuf.h
│ │ │ │ ├── SdCard/
│ │ │ │ │ ├── CPPLINT.cfg
│ │ │ │ │ ├── SdCard.h
│ │ │ │ │ ├── SdCardInfo.cpp
│ │ │ │ │ ├── SdCardInfo.h
│ │ │ │ │ ├── SdCardInterface.h
│ │ │ │ │ ├── SdSpiCard.cpp
│ │ │ │ │ ├── SdSpiCard.h
│ │ │ │ │ ├── SdioCard.h
│ │ │ │ │ ├── SdioTeensy.cpp
│ │ │ │ │ └── SdioTeensy.h
│ │ │ │ ├── SdFat.h
│ │ │ │ ├── SdFatConfig.h
│ │ │ │ ├── SpiDriver/
│ │ │ │ │ ├── SdSpiArduinoDriver.h
│ │ │ │ │ ├── SdSpiArtemis.cpp
│ │ │ │ │ ├── SdSpiAvr.h
│ │ │ │ │ ├── SdSpiBareUnoDriver.h
│ │ │ │ │ ├── SdSpiBaseClass.h
│ │ │ │ │ ├── SdSpiChipSelect.cpp
│ │ │ │ │ ├── SdSpiDriver.h
│ │ │ │ │ ├── SdSpiDue.cpp
│ │ │ │ │ ├── SdSpiESP.cpp
│ │ │ │ │ ├── SdSpiLibDriver.h
│ │ │ │ │ ├── SdSpiParticle.cpp
│ │ │ │ │ ├── SdSpiSTM32.cpp
│ │ │ │ │ ├── SdSpiSTM32Core.cpp
│ │ │ │ │ ├── SdSpiSoftDriver.h
│ │ │ │ │ └── SdSpiTeensy3.cpp
│ │ │ │ ├── common/
│ │ │ │ │ ├── ArduinoFiles.h
│ │ │ │ │ ├── CPPLINT.cfg
│ │ │ │ │ ├── CompileDateTime.h
│ │ │ │ │ ├── DebugMacros.h
│ │ │ │ │ ├── FmtNumber.cpp
│ │ │ │ │ ├── FmtNumber.h
│ │ │ │ │ ├── FsApiConstants.h
│ │ │ │ │ ├── FsBlockDevice.h
│ │ │ │ │ ├── FsBlockDeviceInterface.h
│ │ │ │ │ ├── FsCache.cpp
│ │ │ │ │ ├── FsCache.h
│ │ │ │ │ ├── FsDateTime.cpp
│ │ │ │ │ ├── FsDateTime.h
│ │ │ │ │ ├── FsName.cpp
│ │ │ │ │ ├── FsName.h
│ │ │ │ │ ├── FsStructs.cpp
│ │ │ │ │ ├── FsStructs.h
│ │ │ │ │ ├── FsUtf.cpp
│ │ │ │ │ ├── FsUtf.h
│ │ │ │ │ ├── PrintBasic.cpp
│ │ │ │ │ ├── PrintBasic.h
│ │ │ │ │ ├── SysCall.h
│ │ │ │ │ ├── upcase.cpp
│ │ │ │ │ └── upcase.h
│ │ │ │ ├── iostream/
│ │ │ │ │ ├── ArduinoStream.h
│ │ │ │ │ ├── StdioStream.cpp
│ │ │ │ │ ├── StdioStream.h
│ │ │ │ │ ├── StreamBaseClass.cpp
│ │ │ │ │ ├── bufstream.h
│ │ │ │ │ ├── fstream.h
│ │ │ │ │ ├── ios.h
│ │ │ │ │ ├── iostream.h
│ │ │ │ │ ├── istream.cpp
│ │ │ │ │ ├── istream.h
│ │ │ │ │ ├── ostream.cpp
│ │ │ │ │ └── ostream.h
│ │ │ │ └── sdios.h
│ │ │ ├── Time/
│ │ │ │ ├── DateStrings.cpp
│ │ │ │ ├── Time.cpp
│ │ │ │ ├── Time.h
│ │ │ │ ├── TimeLib.h
│ │ │ │ └── library.properties
│ │ │ └── Wire/
│ │ │ ├── Wire.cpp
│ │ │ ├── Wire.h
│ │ │ ├── WireIMXRT.cpp
│ │ │ ├── WireIMXRT.h
│ │ │ ├── WireKinetis.cpp
│ │ │ ├── WireKinetis.h
│ │ │ └── utility/
│ │ │ ├── twi.c
│ │ │ └── twi.h
│ │ ├── platformio.ini
│ │ └── src/
│ │ ├── general/
│ │ │ ├── colorschemes.cpp
│ │ │ └── globalvariables.cpp
│ │ ├── gui/
│ │ │ ├── bitmaps.cpp
│ │ │ ├── buttons.cpp
│ │ │ ├── firststart.cpp
│ │ │ ├── gui.cpp
│ │ │ ├── livemode.cpp
│ │ │ ├── loadmenu.cpp
│ │ │ ├── mainmenu.cpp
│ │ │ ├── settingsmenu.cpp
│ │ │ └── videomenu.cpp
│ │ ├── hardware/
│ │ │ ├── battery.cpp
│ │ │ ├── connection.cpp
│ │ │ ├── display/
│ │ │ │ ├── display.cpp
│ │ │ │ └── fonts.cpp
│ │ │ ├── hardware.cpp
│ │ │ ├── lepton.cpp
│ │ │ ├── massstorage.cpp
│ │ │ ├── sdcard.cpp
│ │ │ └── touchscreen/
│ │ │ ├── ft6206_touchscreen.cpp
│ │ │ ├── touchscreen.cpp
│ │ │ └── xpt2046_touchscreen.cpp
│ │ ├── main.cpp
│ │ └── thermal/
│ │ ├── create.cpp
│ │ ├── load.cpp
│ │ ├── save.cpp
│ │ ├── temperature.cpp
│ │ └── thermal.cpp
│ └── README.MD
├── pcb/
│ ├── 3.0/
│ │ ├── pcb.brd
│ │ └── pcb.sch
│ └── README.MD
└── software/
├── README.MD
├── thermal_analysis_software/
│ └── README.MD
├── thermal_data_viewer/
│ └── README.MD
├── thermal_live_viewer/
│ ├── 3.0/
│ │ ├── .gitignore
│ │ ├── main.py
│ │ ├── requirements.txt
│ │ ├── setup.py
│ │ └── src/
│ │ ├── __init__.py
│ │ ├── colorschemes.py
│ │ └── liveviewer.py
│ └── README.MD
└── video_converter/
└── README.MD
SYMBOL INDEX (1490 symbols across 142 files)
FILE: firmware/3.0/include/display.h
type propFont (line 46) | struct propFont
FILE: firmware/3.0/include/ft6206_touchscreen.h
function class (line 41) | class FT6206_Touchscreen {
FILE: firmware/3.0/include/touchscreen.h
function class (line 21) | class TS_Point {
function operator (line 26) | bool operator!=(TS_Point p) { return ((p.x != x) || (p.y != y) || (p.z !...
FILE: firmware/3.0/include/xpt2046_touchscreen.h
function class (line 21) | class XPT2046_Touchscreen {
FILE: firmware/3.0/lib/ADC/ADC.h
function class (line 69) | class ADC
FILE: firmware/3.0/lib/ADC/ADC_Module.h
function class (line 51) | class ADC_Module
FILE: firmware/3.0/lib/ADC/ADC_util.h
function namespace (line 45) | namespace ADC_util
FILE: firmware/3.0/lib/ADC/AnalogBufferDMA.cpp
function dumpDMA_TCD (line 56) | static void dumpDMA_TCD(DMABaseClass *dmabc)
FILE: firmware/3.0/lib/ADC/AnalogBufferDMA.h
function class (line 36) | class AnalogBufferDMA
FILE: firmware/3.0/lib/ADC/VREF.h
function namespace (line 37) | namespace VREF
function trim (line 69) | inline void trim(uint8_t trim)
function stop (line 78) | __attribute__((always_inline)) inline void stop()
function isStable (line 94) | __attribute__((always_inline)) inline volatile bool isStable()
function isOn (line 103) | __attribute__((always_inline)) inline volatile bool isOn()
function waitUntilStable (line 113) | inline void waitUntilStable()
FILE: firmware/3.0/lib/ADC/atomic.h
function namespace (line 46) | namespace atomic
FILE: firmware/3.0/lib/ADC/settings_defines.h
type class (line 156) | enum class
type class (line 168) | enum class
type class (line 179) | enum class
type class (line 188) | enum class
type class (line 233) | enum class
type class (line 245) | enum class
function ADC_INTERNAL_SOURCE (line 258) | enum class ADC_INTERNAL_SOURCE : uint8_t
FILE: firmware/3.0/lib/Bounce/Bounce.h
function class (line 33) | class Bounce
FILE: firmware/3.0/lib/EEPROM/EEPROM.h
type EERef (line 43) | struct EERef{
type EEPtr (line 94) | struct EEPtr{
function EERef (line 104) | EERef operator*() { return index; }
function EEPtr (line 109) | EEPtr operator++ (int) { return index++; }
function EEPtr (line 110) | EEPtr operator-- (int) { return index--; }
FILE: firmware/3.0/lib/LittleFS/LittleFS.cpp
function PROGMEM (line 30) | PROGMEM static const struct chipinfo {
type chipinfo (line 69) | struct chipinfo
type chipinfo (line 71) | struct chipinfo
function FLASHMEM (line 94) | FLASHMEM
function FLASHMEM (line 160) | FLASHMEM
function FLASHMEM (line 175) | FLASHMEM
function FLASHMEM (line 251) | FLASHMEM
function FLASHMEM (line 277) | FLASHMEM
type lfs_config (line 304) | struct lfs_config
function blockIsBlank (line 305) | static bool blockIsBlank(struct lfs_config *config, lfs_block_t block, v...
function cb_usedBlocks (line 321) | static int cb_usedBlocks( void *inData, lfs_block_t block )
function FLASHMEM (line 342) | FLASHMEM
function FLASHMEM (line 385) | FLASHMEM
function make_command_and_address (line 406) | static void make_command_and_address(uint8_t *buf, uint8_t cmd, uint32_t...
function printtbuf (line 421) | static void printtbuf(const void *buf, unsigned int len)
function flexspi2_ip_command (line 629) | static void flexspi2_ip_command(uint32_t index, uint32_t addr)
function flexspi2_ip_read (line 643) | static void flexspi2_ip_read(uint32_t index, uint32_t addr, void *data, ...
function flexspi2_ip_write (line 709) | static void flexspi2_ip_write(uint32_t index, uint32_t addr, const void ...
function FLASHMEM (line 743) | FLASHMEM
function FLASHMEM (line 905) | FLASHMEM
function FLASHMEM (line 941) | FLASHMEM
type lfs_config (line 995) | struct lfs_config
type lfs_config (line 1015) | struct lfs_config
type lfs_config (line 1024) | struct lfs_config
FILE: firmware/3.0/lib/LittleFS/LittleFS.h
function class (line 30) | class LittleFSFile : public FileImpl
function virtual (line 71) | virtual bool setCreateTime(const DateTimeFields &tm) {
function virtual (line 80) | virtual bool setModifyTime(const DateTimeFields &tm) {
function virtual (line 89) | virtual size_t write(const void *buf, size_t size) {
function virtual (line 95) | virtual int peek() {
function virtual (line 98) | virtual int available() {
function virtual (line 106) | virtual void flush() {
function virtual (line 109) | virtual size_t read(void *buf, size_t nbyte) {
function virtual (line 122) | virtual bool seek(uint64_t pos, int mode = SeekSet) {
function virtual (line 132) | virtual uint64_t position() {
function virtual (line 138) | virtual uint64_t size() {
function virtual (line 144) | virtual void close() {
function virtual (line 159) | virtual bool isOpen() {
function virtual (line 162) | virtual const char * name() {
function virtual (line 167) | virtual boolean isDirectory(void) {
type lfs_info (line 172) | struct lfs_info
function virtual (line 205) | virtual void rewindDirectory(void) {
function getCreationTime (line 216) | uint32_t getCreationTime() {
function getModifiedTime (line 223) | uint32_t getModifiedTime() {
function class (line 236) | class LittleFS : public FS
function virtual (line 250) | virtual const char * getMediaName() {return (const char*)F("");}
function File (line 255) | File open(const char *filepath, uint8_t mode = FILE_READ) {
function exists (line 302) | bool exists(const char *filepath) {
function mkdir (line 308) | bool mkdir(const char *filepath) {
function rename (line 321) | bool rename(const char *oldfilepath, const char *newfilepath) {
function remove (line 330) | bool remove(const char *filepath) {
function rmdir (line 335) | bool rmdir(const char *filepath) {
function usedSize (line 338) | uint64_t usedSize() {
function totalSize (line 344) | uint64_t totalSize() {
function class (line 362) | class LittleFS_RAM : public LittleFS
function class (line 448) | class LittleFS_SPIFlash : public LittleFS
function class (line 488) | class LittleFS_SPIFram : public LittleFS
function class (line 530) | class LittleFS_QSPIFlash : public LittleFS
function class (line 563) | class LittleFS_QSPIFlash : public LittleFS
function class (line 574) | class LittleFS_Program : public LittleFS
function class (line 591) | class LittleFS_Program : public LittleFS
function class (line 600) | class LittleFS_SPINAND : public LittleFS
function class (line 664) | class LittleFS_QPINAND : public LittleFS
function class (line 729) | class FS_NONE : public FS {
function class (line 740) | class LittleFS_SPI : public FS {
function class (line 776) | class LittleFS_QSPI : public FS {
FILE: firmware/3.0/lib/LittleFS/LittleFS_NAND.cpp
function PROGMEM (line 68) | PROGMEM static const struct chipinfo {
type chipinfo (line 93) | struct chipinfo
type chipinfo (line 95) | struct chipinfo
function FLASHMEM (line 106) | FLASHMEM
function printtbuf (line 202) | static void printtbuf(const void *buf, unsigned int len)
type lfs_config (line 210) | struct lfs_config
function blockIsBlank (line 211) | static bool blockIsBlank(struct lfs_config *config, lfs_block_t block, v...
type chipinfo (line 789) | struct chipinfo
function flexspi2_ip_command (line 812) | static void flexspi2_ip_command(uint32_t index, uint32_t addr)
function flexspi2_ip_read (line 826) | static void flexspi2_ip_read(uint32_t index, uint32_t addr, void *data, ...
function flexspi2_ip_write (line 892) | static void flexspi2_ip_write(uint32_t index, uint32_t addr, const void ...
type chipinfo (line 952) | struct chipinfo
type chipinfo (line 1521) | struct chipinfo
FILE: firmware/3.0/lib/LittleFS/littlefs/lfs.c
function lfs_cache_drop (line 14) | static inline void lfs_cache_drop(lfs_t *lfs, lfs_cache_t *rcache) {
function lfs_cache_zero (line 21) | static inline void lfs_cache_zero(lfs_t *lfs, lfs_cache_t *pcache) {
function lfs_bd_read (line 27) | static int lfs_bd_read(lfs_t *lfs,
function lfs_bd_cmp (line 116) | static int lfs_bd_cmp(lfs_t *lfs,
function lfs_bd_flush (line 144) | static int lfs_bd_flush(lfs_t *lfs,
function lfs_bd_sync (line 179) | static int lfs_bd_sync(lfs_t *lfs,
function lfs_bd_prog (line 195) | static int lfs_bd_prog(lfs_t *lfs,
function lfs_bd_erase (line 243) | static int lfs_bd_erase(lfs_t *lfs, lfs_block_t block) {
function lfs_pair_swap (line 254) | static inline void lfs_pair_swap(lfs_block_t pair[2]) {
function lfs_pair_isnull (line 260) | static inline bool lfs_pair_isnull(const lfs_block_t pair[2]) {
function lfs_pair_cmp (line 264) | static inline int lfs_pair_cmp(
function lfs_pair_sync (line 271) | static inline bool lfs_pair_sync(
function lfs_pair_fromle32 (line 278) | static inline void lfs_pair_fromle32(lfs_block_t pair[2]) {
function lfs_pair_tole32 (line 283) | static inline void lfs_pair_tole32(lfs_block_t pair[2]) {
type lfs_tag_t (line 289) | typedef uint32_t lfs_tag_t;
type lfs_stag_t (line 290) | typedef int32_t lfs_stag_t;
function lfs_tag_isvalid (line 301) | static inline bool lfs_tag_isvalid(lfs_tag_t tag) {
function lfs_tag_isdelete (line 305) | static inline bool lfs_tag_isdelete(lfs_tag_t tag) {
function lfs_tag_type1 (line 309) | static inline uint16_t lfs_tag_type1(lfs_tag_t tag) {
function lfs_tag_type3 (line 313) | static inline uint16_t lfs_tag_type3(lfs_tag_t tag) {
function lfs_tag_chunk (line 317) | static inline uint8_t lfs_tag_chunk(lfs_tag_t tag) {
function lfs_tag_splice (line 321) | static inline int8_t lfs_tag_splice(lfs_tag_t tag) {
function lfs_tag_id (line 325) | static inline uint16_t lfs_tag_id(lfs_tag_t tag) {
function lfs_size_t (line 329) | static inline lfs_size_t lfs_tag_size(lfs_tag_t tag) {
function lfs_size_t (line 333) | static inline lfs_size_t lfs_tag_dsize(lfs_tag_t tag) {
type lfs_mattr (line 338) | struct lfs_mattr {
type lfs_diskoff (line 343) | struct lfs_diskoff {
function lfs_gstate_xor (line 353) | static inline void lfs_gstate_xor(lfs_gstate_t *a, const lfs_gstate_t *b) {
function lfs_gstate_iszero (line 359) | static inline bool lfs_gstate_iszero(const lfs_gstate_t *a) {
function lfs_gstate_hasorphans (line 368) | static inline bool lfs_gstate_hasorphans(const lfs_gstate_t *a) {
function lfs_gstate_getorphans (line 372) | static inline uint8_t lfs_gstate_getorphans(const lfs_gstate_t *a) {
function lfs_gstate_hasmove (line 376) | static inline bool lfs_gstate_hasmove(const lfs_gstate_t *a) {
function lfs_gstate_hasmovehere (line 380) | static inline bool lfs_gstate_hasmovehere(const lfs_gstate_t *a,
function lfs_gstate_fromle32 (line 385) | static inline void lfs_gstate_fromle32(lfs_gstate_t *a) {
function lfs_gstate_tole32 (line 391) | static inline void lfs_gstate_tole32(lfs_gstate_t *a) {
function lfs_ctz_fromle32 (line 398) | static void lfs_ctz_fromle32(struct lfs_ctz *ctz) {
function lfs_ctz_tole32 (line 404) | static void lfs_ctz_tole32(struct lfs_ctz *ctz) {
function lfs_superblock_fromle32 (line 410) | static inline void lfs_superblock_fromle32(lfs_superblock_t *superblock) {
function lfs_superblock_tole32 (line 419) | static inline void lfs_superblock_tole32(lfs_superblock_t *superblock) {
function lfs_mlist_isopen (line 429) | static bool lfs_mlist_isopen(struct lfs_mlist *head,
function lfs_mlist_remove (line 441) | static void lfs_mlist_remove(lfs_t *lfs, struct lfs_mlist *mlist) {
function lfs_mlist_append (line 450) | static void lfs_mlist_append(lfs_t *lfs, struct lfs_mlist *mlist) {
type lfs_mattr (line 459) | struct lfs_mattr
type lfs_mattr (line 461) | struct lfs_mattr
function lfs_alloc_lookahead (line 505) | static int lfs_alloc_lookahead(void *p, lfs_block_t block) {
function lfs_alloc_ack (line 521) | static void lfs_alloc_ack(lfs_t *lfs) {
function lfs_alloc_drop (line 527) | static void lfs_alloc_drop(lfs_t *lfs) {
function lfs_alloc (line 534) | static int lfs_alloc(lfs_t *lfs, lfs_block_t *block) {
function lfs_stag_t (line 582) | static lfs_stag_t lfs_dir_getslice(lfs_t *lfs, const lfs_mdir_t *dir,
function lfs_stag_t (line 644) | static lfs_stag_t lfs_dir_get(lfs_t *lfs, const lfs_mdir_t *dir,
function lfs_dir_getread (line 651) | static int lfs_dir_getread(lfs_t *lfs, const lfs_mdir_t *dir,
function lfs_dir_traverse_filter (line 713) | static int lfs_dir_traverse_filter(void *p,
function lfs_dir_traverse (line 743) | static int lfs_dir_traverse(lfs_t *lfs,
function lfs_stag_t (line 838) | static lfs_stag_t lfs_dir_fetchmatch(lfs_t *lfs,
function lfs_dir_fetch (line 1075) | static int lfs_dir_fetch(lfs_t *lfs,
function lfs_dir_getgstate (line 1083) | static int lfs_dir_getgstate(lfs_t *lfs, const lfs_mdir_t *dir,
function lfs_dir_getinfo (line 1101) | static int lfs_dir_getinfo(lfs_t *lfs, lfs_mdir_t *dir,
type lfs_dir_find_match (line 1135) | struct lfs_dir_find_match {
function lfs_dir_find_match (line 1141) | static int lfs_dir_find_match(void *data,
function lfs_stag_t (line 1165) | static lfs_stag_t lfs_dir_find(lfs_t *lfs, lfs_mdir_t *dir,
type lfs_commit (line 1266) | struct lfs_commit {
function lfs_dir_commitprog (line 1277) | static int lfs_dir_commitprog(lfs_t *lfs, struct lfs_commit *commit,
function lfs_dir_commitattr (line 1294) | static int lfs_dir_commitattr(lfs_t *lfs, struct lfs_commit *commit,
function lfs_dir_commitcrc (line 1341) | static int lfs_dir_commitcrc(lfs_t *lfs, struct lfs_commit *commit) {
function lfs_dir_alloc (line 1443) | static int lfs_dir_alloc(lfs_t *lfs, lfs_mdir_t *dir) {
function lfs_dir_drop (line 1487) | static int lfs_dir_drop(lfs_t *lfs, lfs_mdir_t *dir, lfs_mdir_t *tail) {
function lfs_dir_split (line 1508) | static int lfs_dir_split(lfs_t *lfs,
function lfs_dir_commit_size (line 1543) | static int lfs_dir_commit_size(void *p, lfs_tag_t tag, const void *buffe...
type lfs_dir_commit_commit (line 1553) | struct lfs_dir_commit_commit {
function lfs_dir_commit_commit (line 1560) | static int lfs_dir_commit_commit(void *p, lfs_tag_t tag, const void *buf...
function lfs_dir_compact (line 1567) | static int lfs_dir_compact(lfs_t *lfs,
function lfs_dir_commit (line 1826) | static int lfs_dir_commit(lfs_t *lfs, lfs_mdir_t *dir,
function lfs_rawmkdir (line 2019) | static int lfs_rawmkdir(lfs_t *lfs, const char *path) {
function lfs_dir_rawopen (line 2115) | static int lfs_dir_rawopen(lfs_t *lfs, lfs_dir_t *dir, const char *path) {
function lfs_dir_rawclose (line 2159) | static int lfs_dir_rawclose(lfs_t *lfs, lfs_dir_t *dir) {
function lfs_dir_rawread (line 2166) | static int lfs_dir_rawread(lfs_t *lfs, lfs_dir_t *dir, struct lfs_info *...
function lfs_dir_rawseek (line 2211) | static int lfs_dir_rawseek(lfs_t *lfs, lfs_dir_t *dir, lfs_off_t off) {
function lfs_soff_t (line 2248) | static lfs_soff_t lfs_dir_rawtell(lfs_t *lfs, lfs_dir_t *dir) {
function lfs_dir_rawrewind (line 2253) | static int lfs_dir_rawrewind(lfs_t *lfs, lfs_dir_t *dir) {
function lfs_ctz_index (line 2267) | static int lfs_ctz_index(lfs_t *lfs, lfs_off_t *off) {
function lfs_ctz_find (line 2280) | static int lfs_ctz_find(lfs_t *lfs,
function lfs_ctz_extend (line 2315) | static int lfs_ctz_extend(lfs_t *lfs,
function lfs_ctz_traverse (line 2414) | static int lfs_ctz_traverse(lfs_t *lfs,
type lfs_file_config (line 2461) | struct lfs_file_config
type lfs_mlist (line 2491) | struct lfs_mlist
function lfs_file_rawopen (line 2622) | static int lfs_file_rawopen(lfs_t *lfs, lfs_file_t *file,
function lfs_file_rawclose (line 2629) | static int lfs_file_rawclose(lfs_t *lfs, lfs_file_t *file) {
function lfs_file_relocate (line 2649) | static int lfs_file_relocate(lfs_t *lfs, lfs_file_t *file) {
function lfs_file_outline (line 2720) | static int lfs_file_outline(lfs_t *lfs, lfs_file_t *file) {
function lfs_file_flush (line 2734) | static int lfs_file_flush(lfs_t *lfs, lfs_file_t *file) {
function lfs_file_rawsync (line 2814) | static int lfs_file_rawsync(lfs_t *lfs, lfs_file_t *file) {
function lfs_ssize_t (line 2866) | static lfs_ssize_t lfs_file_rawread(lfs_t *lfs, lfs_file_t *file,
function lfs_ssize_t (line 2940) | static lfs_ssize_t lfs_file_rawwrite(lfs_t *lfs, lfs_file_t *file,
function lfs_soff_t (line 3062) | static lfs_soff_t lfs_file_rawseek(lfs_t *lfs, lfs_file_t *file,
function lfs_file_rawtruncate (line 3098) | static int lfs_file_rawtruncate(lfs_t *lfs, lfs_file_t *file, lfs_off_t ...
function lfs_soff_t (line 3154) | static lfs_soff_t lfs_file_rawtell(lfs_t *lfs, lfs_file_t *file) {
function lfs_file_rawrewind (line 3159) | static int lfs_file_rawrewind(lfs_t *lfs, lfs_file_t *file) {
function lfs_soff_t (line 3168) | static lfs_soff_t lfs_file_rawsize(lfs_t *lfs, lfs_file_t *file) {
function lfs_rawstat (line 3182) | static int lfs_rawstat(lfs_t *lfs, const char *path, struct lfs_info *in...
function lfs_rawremove (line 3193) | static int lfs_rawremove(lfs_t *lfs, const char *path) {
function lfs_rawrename (line 3272) | static int lfs_rawrename(lfs_t *lfs, const char *oldpath, const char *ne...
function lfs_ssize_t (line 3406) | static lfs_ssize_t lfs_rawgetattr(lfs_t *lfs, const char *path,
function lfs_commitattr (line 3440) | static int lfs_commitattr(lfs_t *lfs, const char *path,
function lfs_rawsetattr (line 3464) | static int lfs_rawsetattr(lfs_t *lfs, const char *path,
function lfs_rawremoveattr (line 3475) | static int lfs_rawremoveattr(lfs_t *lfs, const char *path, uint8_t type) {
function lfs_init (line 3482) | static int lfs_init(lfs_t *lfs, const struct lfs_config *cfg) {
function lfs_deinit (line 3591) | static int lfs_deinit(lfs_t *lfs) {
function lfs_rawformat (line 3609) | static int lfs_rawformat(lfs_t *lfs, const struct lfs_config *cfg) {
function lfs_rawmount (line 3674) | static int lfs_rawmount(lfs_t *lfs, const struct lfs_config *cfg) {
function lfs_rawunmount (line 3801) | static int lfs_rawunmount(lfs_t *lfs) {
function lfs_fs_rawtraverse (line 3807) | int lfs_fs_rawtraverse(lfs_t *lfs,
function lfs_fs_pred (line 3906) | static int lfs_fs_pred(lfs_t *lfs,
type lfs_fs_parent_match (line 3934) | struct lfs_fs_parent_match {
function lfs_fs_parent_match (line 3941) | static int lfs_fs_parent_match(void *data,
function lfs_stag_t (line 3962) | static lfs_stag_t lfs_fs_parent(lfs_t *lfs, const lfs_block_t pair[2],
function lfs_fs_relocate (line 3991) | static int lfs_fs_relocate(lfs_t *lfs,
function lfs_fs_preporphans (line 4094) | static int lfs_fs_preporphans(lfs_t *lfs, int8_t orphans) {
function lfs_fs_prepmove (line 4105) | static void lfs_fs_prepmove(lfs_t *lfs,
function lfs_fs_demove (line 4115) | static int lfs_fs_demove(lfs_t *lfs) {
function lfs_fs_deorphan (line 4147) | static int lfs_fs_deorphan(lfs_t *lfs) {
function lfs_fs_forceconsistency (line 4222) | static int lfs_fs_forceconsistency(lfs_t *lfs) {
function lfs_fs_size_count (line 4237) | static int lfs_fs_size_count(void *p, lfs_block_t block) {
function lfs_ssize_t (line 4244) | static lfs_ssize_t lfs_fs_rawsize(lfs_t *lfs) {
type lfs1_type (line 4277) | enum lfs1_type {
type lfs1_t (line 4283) | typedef struct lfs1 {
type lfs1_entry_t (line 4287) | typedef struct lfs1_entry {
type lfs1_dir_t (line 4305) | typedef struct lfs1_dir {
type lfs1_superblock_t (line 4320) | typedef struct lfs1_superblock {
function lfs1_crc (line 4338) | static void lfs1_crc(uint32_t *crc, const void *buffer, size_t size) {
function lfs1_bd_read (line 4342) | static int lfs1_bd_read(lfs_t *lfs, lfs_block_t block,
function lfs1_bd_crc (line 4350) | static int lfs1_bd_crc(lfs_t *lfs, lfs_block_t block,
function lfs1_dir_fromle32 (line 4367) | static void lfs1_dir_fromle32(struct lfs1_disk_dir *d) {
function lfs1_dir_tole32 (line 4374) | static void lfs1_dir_tole32(struct lfs1_disk_dir *d) {
function lfs1_entry_fromle32 (line 4381) | static void lfs1_entry_fromle32(struct lfs1_disk_entry *d) {
function lfs1_entry_tole32 (line 4386) | static void lfs1_entry_tole32(struct lfs1_disk_entry *d) {
function lfs1_superblock_fromle32 (line 4391) | static void lfs1_superblock_fromle32(struct lfs1_disk_superblock *d) {
function lfs_size_t (line 4401) | static inline lfs_size_t lfs1_entry_size(const lfs1_entry_t *entry) {
function lfs1_dir_fetch (line 4405) | static int lfs1_dir_fetch(lfs_t *lfs,
function lfs1_dir_next (line 4467) | static int lfs1_dir_next(lfs_t *lfs, lfs1_dir_t *dir, lfs1_entry_t *entr...
function lfs1_traverse (line 4497) | int lfs1_traverse(lfs_t *lfs, int (*cb)(void*, lfs_block_t), void *data) {
function lfs1_moved (line 4566) | static int lfs1_moved(lfs_t *lfs, const void *e) {
function lfs1_mount (line 4607) | static int lfs1_mount(lfs_t *lfs, struct lfs1 *lfs1,
function lfs1_unmount (line 4670) | static int lfs1_unmount(lfs_t *lfs) {
function lfs_rawmigrate (line 4675) | static int lfs_rawmigrate(lfs_t *lfs, const struct lfs_config *cfg) {
function lfs_format (line 4916) | int lfs_format(lfs_t *lfs, const struct lfs_config *cfg) {
function lfs_mount (line 4946) | int lfs_mount(lfs_t *lfs, const struct lfs_config *cfg) {
function lfs_unmount (line 4975) | int lfs_unmount(lfs_t *lfs) {
function lfs_remove (line 4990) | int lfs_remove(lfs_t *lfs, const char *path) {
function lfs_rename (line 5006) | int lfs_rename(lfs_t *lfs, const char *oldpath, const char *newpath) {
function lfs_stat (line 5021) | int lfs_stat(lfs_t *lfs, const char *path, struct lfs_info *info) {
function lfs_ssize_t (line 5035) | lfs_ssize_t lfs_getattr(lfs_t *lfs, const char *path,
function lfs_setattr (line 5052) | int lfs_setattr(lfs_t *lfs, const char *path,
function lfs_removeattr (line 5070) | int lfs_removeattr(lfs_t *lfs, const char *path, uint8_t type) {
function lfs_file_open (line 5085) | int lfs_file_open(lfs_t *lfs, lfs_file_t *file, const char *path, int fl...
function lfs_file_opencfg (line 5101) | int lfs_file_opencfg(lfs_t *lfs, lfs_file_t *file,
function lfs_file_close (line 5121) | int lfs_file_close(lfs_t *lfs, lfs_file_t *file) {
function lfs_file_sync (line 5137) | int lfs_file_sync(lfs_t *lfs, lfs_file_t *file) {
function lfs_ssize_t (line 5153) | lfs_ssize_t lfs_file_read(lfs_t *lfs, lfs_file_t *file,
function lfs_ssize_t (line 5171) | lfs_ssize_t lfs_file_write(lfs_t *lfs, lfs_file_t *file,
function lfs_soff_t (line 5189) | lfs_soff_t lfs_file_seek(lfs_t *lfs, lfs_file_t *file,
function lfs_file_truncate (line 5207) | int lfs_file_truncate(lfs_t *lfs, lfs_file_t *file, lfs_off_t size) {
function lfs_soff_t (line 5224) | lfs_soff_t lfs_file_tell(lfs_t *lfs, lfs_file_t *file) {
function lfs_file_rewind (line 5239) | int lfs_file_rewind(lfs_t *lfs, lfs_file_t *file) {
function lfs_soff_t (line 5253) | lfs_soff_t lfs_file_size(lfs_t *lfs, lfs_file_t *file) {
function lfs_mkdir (line 5269) | int lfs_mkdir(lfs_t *lfs, const char *path) {
function lfs_dir_open (line 5284) | int lfs_dir_open(lfs_t *lfs, lfs_dir_t *dir, const char *path) {
function lfs_dir_close (line 5299) | int lfs_dir_close(lfs_t *lfs, lfs_dir_t *dir) {
function lfs_dir_read (line 5313) | int lfs_dir_read(lfs_t *lfs, lfs_dir_t *dir, struct lfs_info *info) {
function lfs_dir_seek (line 5328) | int lfs_dir_seek(lfs_t *lfs, lfs_dir_t *dir, lfs_off_t off) {
function lfs_soff_t (line 5343) | lfs_soff_t lfs_dir_tell(lfs_t *lfs, lfs_dir_t *dir) {
function lfs_dir_rewind (line 5357) | int lfs_dir_rewind(lfs_t *lfs, lfs_dir_t *dir) {
function lfs_ssize_t (line 5371) | lfs_ssize_t lfs_fs_size(lfs_t *lfs) {
function lfs_fs_traverse (line 5385) | int lfs_fs_traverse(lfs_t *lfs, int (*cb)(void *, lfs_block_t), void *da...
function lfs_migrate (line 5401) | int lfs_migrate(lfs_t *lfs, const struct lfs_config *cfg) {
FILE: firmware/3.0/lib/LittleFS/littlefs/lfs.h
type lfs_size_t (line 40) | typedef uint32_t lfs_size_t;
type lfs_off_t (line 41) | typedef uint32_t lfs_off_t;
type lfs_ssize_t (line 43) | typedef int32_t lfs_ssize_t;
type lfs_soff_t (line 44) | typedef int32_t lfs_soff_t;
type lfs_block_t (line 46) | typedef uint32_t lfs_block_t;
type lfs_error (line 73) | enum lfs_error {
type lfs_type (line 92) | enum lfs_type {
type lfs_open_flags (line 125) | enum lfs_open_flags {
type lfs_whence_flags (line 150) | enum lfs_whence_flags {
type lfs_config (line 158) | struct lfs_config {
type lfs_info (line 269) | struct lfs_info {
type lfs_attr (line 285) | struct lfs_attr {
type lfs_file_config (line 298) | struct lfs_file_config {
type lfs_cache_t (line 322) | typedef struct lfs_cache {
type lfs_mdir_t (line 329) | typedef struct lfs_mdir {
type lfs_dir_t (line 341) | typedef struct lfs_dir {
type lfs_file_t (line 352) | typedef struct lfs_file {
type lfs_superblock_t (line 372) | typedef struct lfs_superblock {
type lfs_gstate_t (line 381) | typedef struct lfs_gstate {
type lfs_t (line 387) | typedef struct lfs {
type lfs_config (line 433) | struct lfs_config
type lfs_config (line 444) | struct lfs_config
type lfs_info (line 476) | struct lfs_info
type lfs_file_config (line 538) | struct lfs_file_config
type lfs_info (line 631) | struct lfs_info
type lfs_config (line 687) | struct lfs_config
FILE: firmware/3.0/lib/LittleFS/littlefs/lfs_util.c
function lfs_crc (line 14) | uint32_t lfs_crc(uint32_t crc, const void *buffer, size_t size) {
FILE: firmware/3.0/lib/LittleFS/littlefs/lfs_util.h
function lfs_max (line 115) | static inline uint32_t lfs_max(uint32_t a, uint32_t b) {
function lfs_min (line 119) | static inline uint32_t lfs_min(uint32_t a, uint32_t b) {
function lfs_aligndown (line 124) | static inline uint32_t lfs_aligndown(uint32_t a, uint32_t alignment) {
function lfs_alignup (line 128) | static inline uint32_t lfs_alignup(uint32_t a, uint32_t alignment) {
function lfs_npw2 (line 133) | static inline uint32_t lfs_npw2(uint32_t a) {
function lfs_ctz (line 150) | static inline uint32_t lfs_ctz(uint32_t a) {
function lfs_popc (line 159) | static inline uint32_t lfs_popc(uint32_t a) {
function lfs_scmp (line 171) | static inline int lfs_scmp(uint32_t a, uint32_t b) {
function lfs_fromle32 (line 176) | static inline uint32_t lfs_fromle32(uint32_t a) {
function lfs_tole32 (line 195) | static inline uint32_t lfs_tole32(uint32_t a) {
function lfs_frombe32 (line 200) | static inline uint32_t lfs_frombe32(uint32_t a) {
function lfs_tobe32 (line 219) | static inline uint32_t lfs_tobe32(uint32_t a) {
function lfs_free (line 238) | static inline void lfs_free(void *p) {
FILE: firmware/3.0/lib/MTP/MTP.cpp
type usb_string_descriptor_struct (line 43) | struct usb_string_descriptor_struct
function usb_init_events (line 1395) | int usb_init_events(void)
function usb_mtp_sendEvent (line 1402) | int usb_mtp_sendEvent(const void *buffer, uint32_t len, uint32_t timeout)
function get_mtp_txEventcount (line 1427) | uint32_t get_mtp_txEventcount() {return mtp_txEventcount; }
function get_mtp_rxEventcount (line 1428) | uint32_t get_mtp_rxEventcount() {return mtp_rxEventcount; }
function txEvent_event (line 1430) | static void txEvent_event(transfer_t *t) { mtp_txEventcount++;}
function rxEvent_event (line 1431) | static void rxEvent_event(transfer_t *t) { mtp_rxEventcount++;}
function usb_init_events (line 1433) | int usb_init_events(void)
function usb_mtp_wait (line 1443) | static int usb_mtp_wait(transfer_t *xfer, uint32_t timeout)
function usb_mtp_recvEvent (line 1456) | int usb_mtp_recvEvent(void *buffer, uint32_t len, uint32_t timeout)
function usb_mtp_sendEvent (line 1470) | int usb_mtp_sendEvent(const void *buffer, uint32_t len, uint32_t timeout)
FILE: firmware/3.0/lib/MTP/MTP.h
function class (line 48) | class MTPD {
FILE: firmware/3.0/lib/MTP/Storage.cpp
function dbgPrint (line 44) | static void dbgPrint(uint16_t line) {
function mtp_yield (line 73) | void mtp_yield() {}
function mtp_lock_storage (line 74) | void mtp_lock_storage(bool lock) {}
function Record (line 123) | Record MTPStorage_SD::ReadIndexRecord(uint32_t i)
FILE: firmware/3.0/lib/MTP/Storage.h
function class (line 44) | class mSD_Base
function class (line 87) | class MTPStorageInterface {
type Record (line 123) | struct Record
function getStoreID (line 142) | uint32_t getStoreID(const char *name) {return sd_getStoreID(name);}
function get_FSCount (line 183) | uint32_t get_FSCount(void) {return sd_getFSCount();}
FILE: firmware/3.0/lib/Metro/Metro.h
function class (line 8) | class Metro
FILE: firmware/3.0/lib/SD/src/SD.h
function class (line 56) | class SDFile : public FileImpl
function virtual (line 70) | virtual size_t write(const void *buf, size_t size) {
function virtual (line 73) | virtual int peek() {
function virtual (line 76) | virtual int available() {
function virtual (line 79) | virtual void flush() {
function virtual (line 82) | virtual size_t read(void *buf, size_t nbyte) {
function virtual (line 88) | virtual bool seek(uint64_t pos, int mode = SeekSet) {
function virtual (line 94) | virtual uint64_t position() {
function virtual (line 97) | virtual uint64_t size() {
function virtual (line 100) | virtual void close() {
function virtual (line 109) | virtual bool isOpen() {
function virtual (line 112) | virtual const char * name() {
function virtual (line 124) | virtual boolean isDirectory(void) {
function virtual (line 132) | virtual void rewindDirectory(void) {
function virtual (line 159) | virtual bool setCreateTime(const DateTimeFields &tm) {
function virtual (line 164) | virtual bool setModifyTime(const DateTimeFields &tm) {
function class (line 176) | class SDClass : public FS
function class (line 244) | class Sd2Card
function fatType (line 260) | uint8_t fatType() {
function blocksPerCluster (line 263) | uint32_t blocksPerCluster() {
function clusterCount (line 266) | uint32_t clusterCount() {
function operator (line 270) | operator FsVolume * () __attribute__ ((deprecated("Use SD.begin() to acc...
FILE: firmware/3.0/lib/SPI/SPI.cpp
function DMAChanneltransferCount (line 175) | inline void DMAChanneltransferCount(DMAChannel * dmac, unsigned int len) {
function DMAChanneltransferCount (line 186) | inline void DMAChanneltransferCount(DMAChannel * dmac, unsigned int len) {
function _spi_dma_rxISR0 (line 195) | void _spi_dma_rxISR0(void) {SPI.dma_rxisr();}
function _spi_dma_rxISR0 (line 197) | void _spi_dma_rxISR0(void) {;}
function _spi_dma_rxISR0 (line 218) | void _spi_dma_rxISR0(void) {SPI.dma_rxisr();}
function _spi_dma_rxISR1 (line 219) | void _spi_dma_rxISR1(void) {SPI1.dma_rxisr();}
function _spi_dma_rxISR2 (line 220) | void _spi_dma_rxISR2(void) {SPI2.dma_rxisr();}
function _spi_dma_rxISR0 (line 222) | void _spi_dma_rxISR0(void) {;}
function _spi_dma_rxISR1 (line 223) | void _spi_dma_rxISR1(void) {;}
function _spi_dma_rxISR2 (line 224) | void _spi_dma_rxISR2(void) {;}
function _spi_dma_rxISR0 (line 910) | void _spi_dma_rxISR0(void) {SPI.dma_isr();}
function _spi_dma_rxISR1 (line 911) | void _spi_dma_rxISR1(void) {SPI1.dma_isr();}
function _spi_dma_rxISR0 (line 913) | void _spi_dma_rxISR0(void) {;}
function _spi_dma_rxISR1 (line 914) | void _spi_dma_rxISR1(void) {;}
function _spi_dma_rxISR0 (line 1500) | void _spi_dma_rxISR0(void) {SPI.dma_rxisr();}
function _spi_dma_rxISR1 (line 1554) | void _spi_dma_rxISR1(void) {SPI1.dma_rxisr();}
function _spi_dma_rxISR2 (line 1603) | void _spi_dma_rxISR2(void) {SPI2.dma_rxisr();}
function DMAChanneltransferCount (line 1868) | inline void DMAChanneltransferCount(DMAChannel * dmac, unsigned int len) {
function DMAChanneltransferCount (line 1879) | inline void DMAChanneltransferCount(DMAChannel * dmac, unsigned int len) {
function dumpDMA_TCD (line 1884) | void dumpDMA_TCD(DMABaseClass *dmabc)
FILE: firmware/3.0/lib/SPI/SPI.h
function class (line 84) | class SPISettings {
function init_AlwaysInline (line 100) | void init_AlwaysInline(uint32_t clock, uint8_t bitOrder, uint8_t dataMode)
function class (line 169) | class SPIClass { // AVR
function class (line 326) | class SPISettings {
function init_AlwaysInline (line 342) | void init_AlwaysInline(uint32_t clock, uint8_t bitOrder, uint8_t dataMode)
function class (line 420) | class SPIClass { // Teensy 3.x
function class (line 686) | class SPISettings {
function init_AlwaysInline (line 702) | void init_AlwaysInline(uint32_t clock, uint8_t bitOrder, uint8_t dataMode)
function class (line 795) | class SPIClass { // Teensy-LC
function class (line 1037) | class SPISettings {
function clock (line 1062) | inline uint32_t clock() {return _clock;}
function class (line 1069) | class SPIClass { // Teensy 4
FILE: firmware/3.0/lib/SdFat/src/BufferedPrint.h
function explicit (line 43) | explicit BufferedPrint(WriteClass* wr) : m_wr(wr), m_in(0) {}
function begin (line 47) | void begin(WriteClass* wr) {
function flush (line 52) | void flush() {sync();}
function printField (line 58) | size_t printField(char c, char term) {
function printField (line 75) | size_t printField(const __FlashStringHelper *fsh, char term) {
function printField (line 105) | size_t printField(const char* str, char term) {
function println (line 176) | size_t println() {
function println (line 211) | size_t println(float f, uint8_t prec) {
function sync (line 234) | bool sync() {
function write (line 249) | size_t write(const void* src, size_t n) {
FILE: firmware/3.0/lib/SdFat/src/DigitalIO/DigitalPin.h
type GpioPinMap_t (line 33) | struct GpioPinMap_t {
function badPinCheck (line 53) | static inline __attribute__((always_inline))
function pinMask (line 74) | static inline __attribute__((always_inline))
function fastBitWriteSafe (line 105) | static inline __attribute__((always_inline))
function fastDigitalRead (line 126) | static inline __attribute__((always_inline))
function fastDigitalToggle (line 137) | static inline __attribute__((always_inline))
function fastDigitalWrite (line 152) | static inline __attribute__((always_inline))
function fastDdrWrite (line 161) | static inline __attribute__((always_inline))
function fastPinMode (line 173) | static inline __attribute__((always_inline))
function fastDigitalRead (line 187) | static inline __attribute__((always_inline))
function fastDigitalWrite (line 196) | static inline __attribute__((always_inline))
function fastDigitalRead (line 210) | static inline __attribute__((always_inline))
function fastDigitalWrite (line 219) | static inline __attribute__((always_inline))
function fastDigitalWrite (line 233) | static inline __attribute__((always_inline))
function fastDigitalRead (line 254) | static inline __attribute__((always_inline))
function fastDigitalWrite (line 265) | inline void fastDigitalWrite(uint8_t pin, bool value) {
function fastDigitalRead (line 269) | inline bool fastDigitalRead(uint8_t pin) {
function fastDigitalToggle (line 274) | inline void fastDigitalToggle(uint8_t pin) {
function fastPinMode (line 278) | inline void fastPinMode(uint8_t pin, uint8_t mode) {
function operator (line 317) | inline operator bool () const __attribute__((always_inline)) {
function toggle (line 366) | inline __attribute__((always_inline))
function write (line 375) | inline __attribute__((always_inline))
FILE: firmware/3.0/lib/SdFat/src/DigitalIO/SoftSPI.h
function receive (line 62) | inline __attribute__((always_inline))
function send (line 79) | inline __attribute__((always_inline))
function transfer (line 95) | inline __attribute__((always_inline))
function MODE_CPOL (line 113) | inline __attribute__((always_inline))
function receiveBit (line 115) | inline __attribute__((always_inline))
function sendBit (line 130) | inline __attribute__((always_inline))
function transferBit (line 145) | inline __attribute__((always_inline))
FILE: firmware/3.0/lib/SdFat/src/ExFatLib/ExFatDbg.cpp
function dmpDirData (line 36) | static void dmpDirData(print_t* pr, DirGeneric_t* dir) {
function exFatDirChecksum (line 46) | static uint16_t exFatDirChecksum(const void* dir, uint16_t checksum) {
function hashDir (line 56) | static uint16_t hashDir(DirName_t* dir, uint16_t hash) {
function printDateTime (line 69) | static void printDateTime(print_t* pr,
function printDirBitmap (line 75) | static void printDirBitmap(print_t* pr, DirBitmap_t* dir) {
function printDirFile (line 86) | static void printDirFile(print_t* pr, DirFile_t* dir) {
function printDirLabel (line 105) | static void printDirLabel(print_t* pr, DirLabel_t* dir) {
function printDirName (line 117) | static void printDirName(print_t* pr, DirName_t* dir) {
function printDirStream (line 135) | static void printDirStream(print_t* pr, DirStream_t* dir) {
function printDirUpcase (line 152) | static void printDirUpcase(print_t* pr, DirUpcase_t* dir) {
function printExFatBoot (line 163) | static void printExFatBoot(print_t* pr, pbs_t* pbs) {
function printHex (line 208) | static void printHex(print_t* pr, uint8_t h) {
function printHex (line 215) | static void printHex(print_t* pr, uint16_t val) {
function printHex (line 230) | static void printHex(print_t* pr, uint32_t val) {
function printHex64 (line 245) | static void printHex64(print_t* pr, uint64_t n) {
function println64 (line 257) | static void println64(print_t* pr, uint64_t n) {
function printMbr (line 269) | static void printMbr(print_t* pr, MbrSector_t* mbr) {
FILE: firmware/3.0/lib/SdFat/src/ExFatLib/ExFatFile.cpp
function lfnLegalChar (line 36) | inline bool lfnLegalChar(uint8_t c) {
FILE: firmware/3.0/lib/SdFat/src/ExFatLib/ExFatFile.h
function class (line 48) | class ExName_t : public FsName {
function class (line 60) | class ExFatFile {
function operator (line 87) | operator bool() {
function available (line 98) | int available() {
function available64 (line 105) | uint64_t available64() {
function clearError (line 109) | void clearError() {
function clearWriteError (line 113) | void clearWriteError() {
function exists (line 150) | bool exists(const char* path) {
function firstSector (line 183) | uint32_t firstSector() const;
function getName (line 225) | size_t getName(char* name, size_t size) {
function printName (line 519) | size_t printName(print_t* pr) {
function read (line 545) | int read() {
function rewind (line 603) | void rewind() {
function seekCur (line 623) | bool seekCur(int64_t offset) {
function truncate (line 701) | bool truncate(uint64_t length) {
function write (line 712) | size_t write(const char* str) {
function write (line 719) | size_t write(uint8_t b) {return write(&b, 1);}
function printName (line 754) | size_t printName() {
function ExFatVolume (line 773) | ExFatVolume* volume() const {return m_vol;}
FILE: firmware/3.0/lib/SdFat/src/ExFatLib/ExFatFileWrite.cpp
function exFatDirChecksum (line 63) | static uint16_t exFatDirChecksum(const uint8_t* data, uint16_t checksum) {
FILE: firmware/3.0/lib/SdFat/src/ExFatLib/ExFatFormatter.h
function class (line 32) | class ExFatFormatter {
FILE: firmware/3.0/lib/SdFat/src/ExFatLib/ExFatName.cpp
function toUpper (line 31) | static char toUpper(char c) {
function exFatHash (line 35) | inline uint16_t exFatHash(char c, uint16_t hash) {
function exFatHash (line 42) | inline uint16_t exFatHash(uint16_t u, uint16_t hash) {
FILE: firmware/3.0/lib/SdFat/src/ExFatLib/ExFatPartition.h
type DirPos_t (line 48) | struct DirPos_t {
function class (line 61) | class ExFatPartition {
FILE: firmware/3.0/lib/SdFat/src/ExFatLib/ExFatVolume.h
function class (line 33) | class ExFatVolume : public ExFatPartition {
function begin (line 55) | bool begin(FsBlockDevice* dev, bool setCwv, uint32_t firstSector, uint32...
function chdir (line 71) | bool chdir() {
function chvol (line 83) | void chvol() {m_cwv = this;}
function exists (line 92) | bool exists(const char* path) {
function ls (line 130) | bool ls(print_t* pr, const char* path, uint8_t flags) {
function ExFile (line 152) | ExFile open(const char* path, oflag_t oflag = O_RDONLY) {
function remove (line 163) | bool remove(const char* path) {
function rename (line 181) | bool rename(const char* oldPath, const char* newPath) {
function rmdir (line 193) | bool rmdir(const char* path) {
function truncate (line 205) | bool truncate(const char* path, uint64_t length) {
function ls (line 217) | bool ls() {
function ls (line 232) | bool ls(uint8_t flags) {
function chdir (line 259) | bool chdir(const String& path) {
function exists (line 268) | bool exists(const String &path) {
function ExFile (line 288) | ExFile open(const String &path, oflag_t oflag = O_RDONLY) {
function remove (line 297) | bool remove(const String& path) {
function rename (line 314) | bool rename(const String& oldPath, const String& newPath) {
function rmdir (line 325) | bool rmdir(const String& path) {
function truncate (line 336) | bool truncate(const String& path, uint64_t length) {
function ExFatVolume (line 343) | static ExFatVolume* cwv() {return m_cwv;}
function ExFatFile (line 344) | ExFatFile* vwd() {return &m_vwd;}
FILE: firmware/3.0/lib/SdFat/src/FatLib/FatDbg.cpp
function getLfnChar (line 28) | static uint16_t getLfnChar(DirLfn_t* ldir, uint8_t i) {
function printHex (line 39) | static void printHex(print_t* pr, uint8_t h) {
function printHex (line 46) | static void printHex(print_t* pr, uint8_t w, uint16_t h) {
function printHex (line 58) | static void printHex(print_t* pr, uint16_t val) {
function printHex (line 73) | static void printHex(print_t* pr, uint32_t val) {
function printHexLn (line 89) | static void printHexLn(print_t* pr, Uint val) {
function printFatDir (line 94) | static bool printFatDir(print_t* pr, DirFat_t* dir) {
FILE: firmware/3.0/lib/SdFat/src/FatLib/FatFile.cpp
function DirFat_t (line 91) | DirFat_t* FatFile::cacheDirEntry(uint8_t action) {
function DirFat_t (line 866) | DirFat_t* FatFile::readDirCache(bool skipReadOk) {
FILE: firmware/3.0/lib/SdFat/src/FatLib/FatFile.h
type FatPos_t (line 67) | struct FatPos_t {
function class (line 82) | class FatLfn_t : public FsName {
function class (line 97) | class FatSfn_t {
type FatLfn_t (line 107) | typedef FatLfn_t FatName_t;
type FatSfn_t (line 110) | typedef FatSfn_t FatName_t;
function class (line 132) | class FatFile {
function available (line 167) | int available() const {
function clearError (line 178) | void clearError() {
function clearWriteError (line 182) | void clearWriteError() {
function exists (line 254) | bool exists(const char* path) {
function firstSector (line 289) | uint32_t firstSector() const;
function printAccessDateTime (line 584) | size_t printAccessDateTime(print_t* pr) {
function read (line 717) | int read() {
function rewind (line 788) | void rewind() {
function seekCur (line 823) | bool seekCur(int32_t offset) {
function truncate (line 896) | bool truncate(uint32_t length) {
function write (line 904) | size_t write(const char* str) {
function write (line 911) | size_t write(uint8_t b) {
function printName (line 949) | size_t printName() {
function DirFat_t (line 988) | DirFat_t* cacheDir(uint16_t index) {
function lfnChecksum (line 995) | uint8_t lfnChecksum(uint8_t* name) {
FILE: firmware/3.0/lib/SdFat/src/FatLib/FatFileLFN.cpp
function isLower (line 32) | static bool isLower(char c) {
function isUpper (line 36) | static bool isUpper(char c) {
function toUpper (line 41) | inline char toUpper(char c) {
function putLfnChar (line 52) | static void putLfnChar(DirLfn_t* ldir, uint8_t i, uint16_t c) {
function Bernstein (line 64) | __attribute__((unused))
FILE: firmware/3.0/lib/SdFat/src/FatLib/FatFormatter.cpp
type initFatDirState (line 84) | struct initFatDirState {
type initFatDirState (line 91) | struct initFatDirState
type initFatDirState (line 91) | struct initFatDirState
type initFatDirState (line 102) | struct initFatDirState
FILE: firmware/3.0/lib/SdFat/src/FatLib/FatFormatter.h
function class (line 33) | class FatFormatter {
FILE: firmware/3.0/lib/SdFat/src/FatLib/FatPartition.cpp
type FreeClusterCountStruct (line 331) | struct FreeClusterCountStruct {
type FreeClusterCountStruct (line 338) | struct FreeClusterCountStruct
type FreeClusterCountStruct (line 338) | struct FreeClusterCountStruct
type FreeClusterCountStruct (line 351) | struct FreeClusterCountStruct
type FreeClusterCountStruct (line 351) | struct FreeClusterCountStruct
type FreeClusterCountStruct (line 386) | struct FreeClusterCountStruct
FILE: firmware/3.0/lib/SdFat/src/FatLib/FatPartition.h
function class (line 51) | class FatPartition {
FILE: firmware/3.0/lib/SdFat/src/FatLib/FatVolume.h
function class (line 37) | class FatVolume : public FatPartition {
function begin (line 58) | bool begin(FsBlockDevice* dev, bool setCwv, uint32_t firstSector, uint32...
function chvol (line 72) | void chvol() {m_cwv = this;}
function chdir (line 78) | bool chdir() {
function exists (line 96) | bool exists(const char* path) {
function ls (line 135) | bool ls(print_t* pr, const char* path, uint8_t flags) {
function File32 (line 159) | File32 open(const char *path, oflag_t oflag = O_RDONLY) {
function remove (line 171) | bool remove(const char* path) {
function rename (line 190) | bool rename(const char *oldPath, const char *newPath) {
function rmdir (line 203) | bool rmdir(const char* path) {
function truncate (line 216) | bool truncate(const char* path, uint32_t length) {
function chdir (line 261) | bool chdir(const String& path) {
function exists (line 271) | bool exists(const String& path) {
function File32 (line 291) | File32 open(const String& path, oflag_t oflag = O_RDONLY) {
function remove (line 300) | bool remove(const String& path) {
function rename (line 317) | bool rename(const String& oldPath, const String& newPath) {
function rmdir (line 328) | bool rmdir(const String& path) {
function truncate (line 339) | bool truncate(const String& path, uint32_t length) {
function FatVolume (line 346) | static FatVolume* cwv() {return m_cwv;}
function FatFile (line 347) | FatFile* vwd() {return &m_vwd;}
FILE: firmware/3.0/lib/SdFat/src/FreeStack.cpp
function FillStack (line 54) | void FillStack() {
function UnusedStack (line 63) | int UnusedStack() {
FILE: firmware/3.0/lib/SdFat/src/FreeStack.h
function FreeStack (line 43) | inline int FreeStack() {
function FreeStack (line 51) | inline int FreeStack() {
function FreeStack (line 57) | inline int FreeStack() {
function FreeStack (line 64) | inline int FreeStack() {
function FreeStack (line 72) | inline int FreeStack() {
function FillStack (line 91) | inline void FillStack() {}
function UnusedStack (line 92) | inline int UnusedStack() {return 0;}
FILE: firmware/3.0/lib/SdFat/src/FsLib/FsFile.cpp
function FsBaseFile (line 39) | FsBaseFile& FsBaseFile::operator=(const FsBaseFile& from) {
FILE: firmware/3.0/lib/SdFat/src/FsLib/FsFile.h
function class (line 38) | class FsBaseFile {
function clearWriteError (line 84) | void clearWriteError() {
function contiguousRange (line 104) | bool contiguousRange(uint32_t* bgnSector, uint32_t* endSector) {
function exists (line 129) | bool exists(const char* path) {
function fgetpos (line 136) | void fgetpos(fspos_t* pos) const {
function flush (line 175) | void flush() {sync();}
function fsetpos (line 179) | void fsetpos(const fspos_t* pos) {
function getAccessDateTime (line 190) | bool getAccessDateTime(uint16_t* pdate, uint16_t* ptime) {
function getCreateDateTime (line 201) | bool getCreateDateTime(uint16_t* pdate, uint16_t* ptime) {
function getModifyDateTime (line 217) | bool getModifyDateTime(uint16_t* pdate, uint16_t* ptime) {
function getName (line 230) | size_t getName(char* name, size_t len) {
function isBusy (line 246) | bool isBusy() {
function ls (line 311) | bool ls(uint8_t flags) {
function ls (line 315) | bool ls() {
function ls (line 325) | bool ls(print_t* pr) {
function ls (line 342) | bool ls(print_t* pr, uint8_t flags) {
function open (line 435) | bool open(const char* path, oflag_t oflag = O_RDONLY) {
function peek (line 457) | int peek() {
function preAllocate (line 472) | bool preAllocate(uint64_t length) {
function printAccessDateTime (line 482) | size_t printAccessDateTime(print_t* pr) {
function printCreateDateTime (line 492) | size_t printCreateDateTime(print_t* pr) {
function printFileSize (line 532) | size_t printFileSize(print_t* pr) {
function printModifyDateTime (line 542) | size_t printModifyDateTime(print_t* pr) {
function printName (line 552) | size_t printName(print_t* pr) {
function read (line 561) | int read() {
function read (line 578) | int read(void* buf, size_t count) {
function remove (line 607) | bool remove(const char* path) {
function rename (line 617) | bool rename(const char* newPath) {
function rename (line 628) | bool rename(FsBaseFile* dirFile, const char* newPath) {
function rewind (line 633) | void rewind() {
function rewindDirectory (line 638) | void rewindDirectory() {
function seek (line 660) | bool seek(uint64_t pos) {return seekSet(pos);}
function seekCur (line 665) | bool seekCur(int64_t offset) {
function seekSet (line 682) | bool seekSet(uint64_t pos) {
function sync (line 693) | bool sync() {
function timestamp (line 729) | bool timestamp(uint8_t flags, uint16_t year, uint8_t month, uint8_t day,
function truncate (line 741) | bool truncate() {
function truncate (line 752) | bool truncate(uint64_t length) {
function write (line 761) | size_t write(const char* str) {
function write (line 769) | size_t write(uint8_t b) {return write(&b, 1);}
function write (line 782) | size_t write(const void* buf, size_t count) {
FILE: firmware/3.0/lib/SdFat/src/FsLib/FsFormatter.h
function class (line 33) | class FsFormatter {
FILE: firmware/3.0/lib/SdFat/src/FsLib/FsNew.h
type newalign_t (line 31) | typedef uint32_t newalign_t;
FILE: firmware/3.0/lib/SdFat/src/FsLib/FsVolume.cpp
function FsFile (line 81) | FsFile FsVolume::open(const char *path, oflag_t oflag) {
function FsFile (line 88) | FsFile FsVolume::open(const String &path, oflag_t oflag) {
FILE: firmware/3.0/lib/SdFat/src/FsLib/FsVolume.h
function class (line 40) | class FsVolume {
function remove (line 206) | bool remove(const char *path) {
function rename (line 224) | bool rename(const char *oldPath, const char *newPath) {
function rmdir (line 236) | bool rmdir(const char *path) {
function ls (line 249) | bool ls() {
function ls (line 264) | bool ls(uint8_t flags) {
function chdir (line 293) | bool chdir(const String& path) {
function exists (line 302) | bool exists(const String &path) {
function remove (line 329) | bool remove(const String &path) {
function rename (line 346) | bool rename(const String& oldPath, const String& newPath) {
function rmdir (line 357) | bool rmdir(const String &path) {
function FsVolume (line 401) | static FsVolume* cwv() {return m_cwv;}
FILE: firmware/3.0/lib/SdFat/src/MinimumSerial.h
function class (line 37) | class MinimumSerial : public print_t {
FILE: firmware/3.0/lib/SdFat/src/RingBuf.h
function is_aligned (line 37) | inline bool is_aligned(const void* ptr, uintptr_t alignment) {
function memcpyBuf (line 41) | inline void memcpyBuf(void* dst, const void* src, size_t len) {
function memcpyBuf (line 55) | inline void memcpyBuf(void* dst, const void* src, size_t len) {
function begin (line 83) | void begin(F* file) {
function bytesFree (line 94) | size_t bytesFree() const {
function bytesUsed (line 110) | size_t bytesUsed() const {
function memcpyIn (line 135) | size_t memcpyIn(const void* buf, size_t count) {
function memcpyOut (line 163) | size_t memcpyOut(void* buf, size_t count) {
function readIn (line 248) | size_t readIn(size_t count) {
function sync (line 271) | bool sync() {
function write (line 287) | size_t write(const void* buf, size_t count) {
function write (line 299) | size_t write(const char* str) {
function write (line 309) | size_t write(const uint8_t* buf, size_t count) override {
function write (line 317) | size_t write(uint8_t data) override {
function writeOut (line 332) | size_t writeOut(size_t count) {
function advance (line 359) | size_t advance(size_t index, size_t n) {
function minSize (line 364) | size_t minSize(size_t a, size_t b) {return a < b ? a : b;}
FILE: firmware/3.0/lib/SdFat/src/SdCard/SdCard.h
type SdCardInterface (line 30) | typedef SdCardInterface SdCard;
type SdSpiCard (line 32) | typedef SdSpiCard SdCard;
function isSpi (line 39) | inline bool isSpi(SdSpiConfig cfg) {(void)cfg; return true;}
function isSpi (line 45) | inline bool isSpi(SdioConfig cfg) {(void)cfg; return false;}
function class (line 50) | class SdCardFactory {
FILE: firmware/3.0/lib/SdFat/src/SdCard/SdCardInfo.cpp
function printSdErrorSymbol (line 29) | void printSdErrorSymbol(print_t* pr, uint8_t code) {
function printSdErrorText (line 39) | void printSdErrorText(print_t* pr, uint8_t code) {
FILE: firmware/3.0/lib/SdFat/src/SdCard/SdCardInfo.h
type cid_t (line 259) | typedef struct CID {
type csd1_t (line 300) | typedef struct CSDV1 {
type csd2_t (line 365) | typedef struct CSDV2 {
function sdCardCapacity (line 455) | inline uint32_t sdCardCapacity(csd_t* csd) {
type SdStatus_t (line 472) | typedef struct SdStatus {
FILE: firmware/3.0/lib/SdFat/src/SdCard/SdCardInterface.h
function class (line 33) | class SdCardInterface : public FsBlockDeviceInterface {
FILE: firmware/3.0/lib/SdFat/src/SdCard/SdSpiCard.cpp
class Timeout (line 27) | class Timeout {
method Timeout (line 29) | Timeout() {}
method Timeout (line 30) | explicit Timeout(uint16_t ms) {set(ms);}
method millis16 (line 31) | uint16_t millis16() {return millis();}
method set (line 32) | void set(uint16_t ms) {
method timedOut (line 35) | bool timedOut() {
function CRC7 (line 45) | static uint8_t CRC7(const uint8_t* data, uint8_t n) {
function CRC_CCITT (line 63) | static uint16_t CRC_CCITT(const uint8_t* data, size_t n) {
function CRC_CCITT (line 116) | static uint16_t CRC_CCITT(const uint8_t* data, size_t n) {
FILE: firmware/3.0/lib/SdFat/src/SdCard/SdSpiCard.h
function class (line 46) | class SharedSpiCard {
function class (line 377) | class DedicatedSpiCard : public SharedSpiCard {
type DedicatedSpiCard (line 460) | typedef DedicatedSpiCard SdSpiCard;
type SharedSpiCard (line 463) | typedef SharedSpiCard SdSpiCard;
FILE: firmware/3.0/lib/SdFat/src/SdCard/SdioCard.h
function class (line 36) | class SdioConfig {
function class (line 56) | class SdioCard : public SdCardInterface {
FILE: firmware/3.0/lib/SdFat/src/SdCard/SdioTeensy.cpp
function printRegs (line 217) | static void printRegs(uint32_t line) {
function setSdErrorCode (line 272) | inline bool setSdErrorCode(uint8_t code, uint32_t line) {
function sdIrs (line 282) | static void sdIrs() {
function enableGPIO (line 295) | static void enableGPIO(bool enable) {
function initClock (line 308) | static void initClock() {
function baseClock (line 316) | static uint32_t baseClock() { return F_CPU;}
function gpioMux (line 320) | static void gpioMux(uint8_t mode) {
function enableGPIO (line 330) | static void enableGPIO(bool enable) {
function initClock (line 354) | static void initClock() {
function baseClock (line 369) | static uint32_t baseClock() {
function cardAcmd (line 376) | static bool cardAcmd(uint32_t rca, uint32_t xfertyp, uint32_t arg) {
function cardCommand (line 380) | static bool cardCommand(uint32_t xfertyp, uint32_t arg) {
function cardCMD6 (line 405) | static bool cardCMD6(uint32_t arg, uint8_t* status) {
function enableDmaIrs (line 423) | static void enableDmaIrs() {
function initSDHC (line 428) | static void initSDHC() {
function statusCMD13 (line 462) | static uint32_t statusCMD13() {
function isBusyCMD13 (line 466) | static bool isBusyCMD13() {
function isBusyCommandComplete (line 470) | static bool isBusyCommandComplete() {
function isBusyCommandInhibit (line 474) | static bool isBusyCommandInhibit() {
function isBusyDat (line 478) | static bool isBusyDat() {
function isBusyDMA (line 482) | static bool isBusyDMA() {
function isBusyFifoRead (line 486) | static bool isBusyFifoRead() {
function isBusyFifoWrite (line 490) | static bool isBusyFifoWrite() {
function isBusyTransferComplete (line 494) | static bool isBusyTransferComplete() {
function rdWrSectors (line 498) | static bool rdWrSectors(uint32_t xfertyp,
function readReg16 (line 517) | static bool readReg16(uint32_t xfertyp, void* data) {
function setSdclk (line 530) | static void setSdclk(uint32_t kHzMax) {
function transferStop (line 569) | static bool transferStop() {
function yieldTimeout (line 593) | static bool yieldTimeout(bool (*fcn)()) {
function waitDmaStatus (line 607) | static bool waitDmaStatus() {
function waitTimeout (line 615) | static bool waitTimeout(bool (*fcn)()) {
function waitTransferComplete (line 625) | static bool waitTransferComplete() {
FILE: firmware/3.0/lib/SdFat/src/SdFat.h
function begin (line 75) | bool begin(SdCsPin_t csPin, uint32_t maxSck) {
function begin (line 84) | bool begin(SdSpiConfig spiConfig) {
function begin (line 97) | bool begin(SdioConfig sdioConfig) {
function restart (line 104) | bool restart() {
function SdCard (line 115) | SdCard* card() {return m_card;}
function cardBegin (line 122) | bool cardBegin(SdSpiConfig spiConfig) {
function cardBegin (line 132) | bool cardBegin(SdioConfig sdioConfig) {
function end (line 138) | void end() {
function errorHalt (line 149) | void errorHalt(print_t* pr) {
function errorHalt (line 166) | void errorHalt(print_t* pr, const char* msg) {
function errorHalt (line 177) | void errorHalt(print_t* pr, const __FlashStringHelper* msg) {
function freeClusterCount (line 206) | uint32_t freeClusterCount() {
function hasDedicatedSpi (line 219) | bool hasDedicatedSpi() {return m_card ? m_card->hasDedicatedSpi() : false;}
function initErrorHalt (line 225) | void initErrorHalt(print_t* pr) {
function initErrorHalt (line 235) | void initErrorHalt(print_t* pr, const char* msg) {
function initErrorHalt (line 245) | void initErrorHalt(print_t* pr, const __FlashStringHelper* msg) {
function initErrorPrint (line 254) | void initErrorPrint(print_t* pr) {
function isDedicatedSpi (line 266) | bool isDedicatedSpi() {return m_card ? m_card->isDedicatedSpi() : false;}
function printFatType (line 272) | void printFatType(print_t* pr) {
function errorPrint (line 285) | void errorPrint(print_t* pr) {
function errorPrint (line 301) | void errorPrint(print_t* pr, char const* msg) {
function errorPrint (line 312) | void errorPrint(print_t* pr, const __FlashStringHelper* msg) {
function printSdError (line 322) | void printSdError(print_t* pr) {
function sdErrorCode (line 339) | uint8_t sdErrorCode() {
function sdErrorData (line 347) | uint8_t sdErrorData() {return m_card ? m_card->errorData() : 0;}
function setDedicatedSpi (line 353) | bool setDedicatedSpi(bool value) {
function Vol (line 361) | Vol* vol() {return reinterpret_cast<Vol*>(this);}
function volumeBegin (line 367) | bool volumeBegin() {
function initErrorPrint (line 372) | void initErrorPrint() {
function errorHalt (line 380) | void errorHalt(const __FlashStringHelper* msg) {
function errorHalt (line 385) | void errorHalt() {errorHalt(&Serial);}
function errorHalt (line 391) | void errorHalt(const char* msg) {errorHalt(&Serial, msg);}
function initErrorHalt (line 394) | void initErrorHalt() {initErrorHalt(&Serial);}
function errorPrint (line 400) | void errorPrint(const char* msg) {errorPrint(&Serial, msg);}
function errorPrint (line 405) | void errorPrint(const __FlashStringHelper* msg) {errorPrint(&Serial, msg);}
function initErrorHalt (line 411) | void initErrorHalt(const char* msg) {initErrorHalt(&Serial, msg);}
function initErrorHalt (line 417) | void initErrorHalt(const __FlashStringHelper* msg) {
type SdFat32 (line 458) | typedef SdFat32 SdFat;
type FatFile (line 460) | typedef FatFile SdBaseFile;
type SdExFat (line 462) | typedef SdExFat SdFat;
type ExFatFile (line 463) | typedef ExFatFile SdBaseFile;
type SdFs (line 465) | typedef SdFs SdFat;
type FsBaseFile (line 466) | typedef FsBaseFile SdBaseFile;
type File32 (line 484) | typedef File32 File;
type ExFile (line 486) | typedef ExFile File;
type FsFile (line 488) | typedef FsFile File;
function class (line 495) | class SdFile : public PrintFile<SdBaseFile> {
function dateTimeCallback (line 531) | static void dateTimeCallback(
function dateTimeCallbackCancel (line 536) | static void dateTimeCallbackCancel() {
FILE: firmware/3.0/lib/SdFat/src/SdFatConfig.h
type SdCsPin_t (line 184) | typedef uint8_t SdCsPin_t;
FILE: firmware/3.0/lib/SdFat/src/SpiDriver/SdSpiArduinoDriver.h
function class (line 39) | class SdSpiArduinoDriver {
type SdSpiArduinoDriver (line 89) | typedef SdSpiArduinoDriver SdSpiDriver;
FILE: firmware/3.0/lib/SdFat/src/SpiDriver/SdSpiAvr.h
function activate (line 30) | inline void SdSpiArduinoDriver::activate() {
function begin (line 34) | inline void SdSpiArduinoDriver::begin(SdSpiConfig spiConfig) {
function deactivate (line 39) | inline void SdSpiArduinoDriver::deactivate() {
function end (line 43) | inline void SdSpiArduinoDriver::end() {
function receive (line 47) | inline uint8_t SdSpiArduinoDriver::receive() {
function receive (line 51) | inline uint8_t SdSpiArduinoDriver::receive(uint8_t* buf, size_t count) {
function send (line 89) | inline void SdSpiArduinoDriver::send(uint8_t data) {
function send (line 93) | inline void SdSpiArduinoDriver::send(const uint8_t* buf , size_t count) {
FILE: firmware/3.0/lib/SdFat/src/SpiDriver/SdSpiBareUnoDriver.h
function unoBit (line 48) | inline uint8_t unoBit(uint8_t pin) {
function unoDigitalRead (line 51) | inline uint8_t unoDigitalRead(uint8_t pin) {
function unoDigitalWrite (line 55) | inline void unoDigitalWrite(uint8_t pin, uint8_t value) {
function unoPinMode (line 67) | inline void unoPinMode(uint8_t pin, uint8_t mode) {
function class (line 91) | class SdSpiDriverBareUno {
FILE: firmware/3.0/lib/SdFat/src/SpiDriver/SdSpiBaseClass.h
function class (line 35) | class SdSpiBaseClass {
FILE: firmware/3.0/lib/SdFat/src/SpiDriver/SdSpiChipSelect.cpp
function sdCsInit (line 29) | void sdCsInit(SdCsPin_t pin) {
function sdCsWrite (line 33) | void sdCsWrite(SdCsPin_t pin, bool level) {
function sdCsInit (line 38) | __attribute__((weak))
function sdCsWrite (line 43) | __attribute__((weak))
FILE: firmware/3.0/lib/SdFat/src/SpiDriver/SdSpiDriver.h
function spiOptionDedicated (line 55) | inline bool spiOptionDedicated(uint8_t opt) {return opt & DEDICATED_SPI;}
function spiOptionDedicated (line 61) | inline bool spiOptionDedicated(uint8_t opt) {(void)opt; return false;}
type SPIClass (line 87) | typedef SPIClass SpiPort_t;
type SdSpiSoftDriver (line 91) | typedef SdSpiSoftDriver SpiPort_t;
type SdSpiBaseClass (line 95) | typedef SdSpiBaseClass SpiPort_t;
function class (line 104) | class SdSpiConfig {
type SdSpiBaseClass (line 151) | typedef SdSpiBaseClass SdSpiDriver;
FILE: firmware/3.0/lib/SdFat/src/SpiDriver/SdSpiDue.cpp
function dmac_disable (line 45) | static void dmac_disable() {
function dmac_enable (line 49) | static void dmac_enable() {
function dmac_channel_disable (line 53) | static void dmac_channel_disable(uint32_t ul_num) {
function dmac_channel_enable (line 57) | static void dmac_channel_enable(uint32_t ul_num) {
function dmac_channel_transfer_done (line 61) | static bool dmac_channel_transfer_done(uint32_t ul_num) {
function spiDmaRX (line 66) | static void spiDmaRX(uint8_t* dst, uint16_t count) {
function spiDmaTX (line 82) | static void spiDmaTX(const uint8_t* src, uint16_t count) {
function spiTransfer (line 152) | static inline uint8_t spiTransfer(uint8_t b) {
FILE: firmware/3.0/lib/SdFat/src/SpiDriver/SdSpiLibDriver.h
function activate (line 32) | inline void SdSpiArduinoDriver::activate() {
function begin (line 36) | inline void SdSpiArduinoDriver::begin(SdSpiConfig spiConfig) {
function end (line 49) | inline void SdSpiArduinoDriver::end() {
function deactivate (line 53) | inline void SdSpiArduinoDriver::deactivate() {
function receive (line 57) | inline uint8_t SdSpiArduinoDriver::receive() {
function receive (line 61) | inline uint8_t SdSpiArduinoDriver::receive(uint8_t* buf, size_t count) {
function send (line 73) | inline void SdSpiArduinoDriver::send(uint8_t data) {
function send (line 77) | inline void SdSpiArduinoDriver::send(const uint8_t* buf, size_t count) {
FILE: firmware/3.0/lib/SdFat/src/SpiDriver/SdSpiParticle.cpp
function SD_SPI_DMA_TransferComplete_Callback (line 29) | static void SD_SPI_DMA_TransferComplete_Callback() {
FILE: firmware/3.0/lib/SdFat/src/SpiDriver/SdSpiSoftDriver.h
function class (line 36) | class SdSpiSoftDriver {
function receive (line 109) | uint8_t receive() {return m_spi.receive();}
function send (line 114) | void send(uint8_t data) {m_spi.send(data);}
type SdSpiSoftDriver (line 120) | typedef SdSpiSoftDriver SdSpiDriver;
FILE: firmware/3.0/lib/SdFat/src/common/ArduinoFiles.h
function write (line 53) | size_t write(uint8_t b) {
function available (line 75) | int available() {
function flush (line 79) | void flush() {
function isDirectory (line 85) | bool isDirectory() {
function peek (line 100) | int peek() {
function PosType (line 104) | PosType position() {
function read (line 112) | int read() {
function rewindDirectory (line 116) | void rewindDirectory() {
function seek (line 128) | bool seek(PosType pos) {
function PosType (line 132) | PosType size() {
function write (line 140) | size_t write(uint8_t b) {
function write (line 155) | size_t write(const uint8_t* buffer, size_t size) {
FILE: firmware/3.0/lib/SdFat/src/common/CompileDateTime.h
function compileYear (line 31) | constexpr uint16_t compileYear() {
function compileMonthIs (line 38) | constexpr bool compileMonthIs(const char* str) {
function compileMonth (line 44) | constexpr uint8_t compileMonth() {
function compileDay (line 59) | constexpr uint8_t compileDay() {
function compileHour (line 63) | constexpr uint8_t compileHour() {
function compileMinute (line 67) | constexpr uint8_t compileMinute() {
function compileSecond (line 71) | constexpr uint8_t compileSecond() {
FILE: firmware/3.0/lib/SdFat/src/common/DebugMacros.h
function dbgFail (line 38) | __attribute__((unused)) static void dbgFail(uint16_t line) {
function dbgHalt (line 44) | __attribute__((unused)) static void dbgHalt(uint16_t line) {
function dbgWarn (line 62) | __attribute__((unused)) static void dbgWarn(uint16_t line) {
FILE: firmware/3.0/lib/SdFat/src/common/FmtNumber.cpp
function scale10 (line 413) | float scale10(float v, int8_t n) {
function scanFloat (line 436) | float scanFloat(const char* str, const char** ptr) {
FILE: firmware/3.0/lib/SdFat/src/common/FmtNumber.h
function isDigit (line 30) | inline bool isDigit(char c) {
function isSpace (line 33) | inline bool isSpace(char c) {
FILE: firmware/3.0/lib/SdFat/src/common/FsApiConstants.h
type oflag_t (line 44) | typedef int oflag_t;
type oflag_t (line 57) | typedef uint8_t oflag_t;
function isWriteMode (line 63) | inline bool isWriteMode(oflag_t oflag) {
FILE: firmware/3.0/lib/SdFat/src/common/FsBlockDevice.h
type FsBlockDeviceInterface (line 29) | typedef FsBlockDeviceInterface FsBlockDevice;
type SdCard (line 31) | typedef SdCard FsBlockDevice;
FILE: firmware/3.0/lib/SdFat/src/common/FsBlockDeviceInterface.h
function class (line 37) | class FsBlockDeviceInterface {
FILE: firmware/3.0/lib/SdFat/src/common/FsCache.h
function class (line 37) | class FsCache {
FILE: firmware/3.0/lib/SdFat/src/common/FsDateTime.cpp
function dateTimeMs10 (line 29) | static void dateTimeMs10(uint16_t* date, uint16_t* time, uint8_t* ms10) {
type FsDateTime (line 35) | namespace FsDateTime {
function clearCallback (line 38) | void clearCallback() {
function setCallback (line 41) | void setCallback(void (*dateTime)(uint16_t* date, uint16_t* time)) {
function setCallback (line 45) | void setCallback(
function fsPrintDate (line 104) | size_t fsPrintDate(print_t* pr, uint16_t date) {
function fsPrintDateTime (line 118) | size_t fsPrintDateTime(print_t* pr, uint16_t date, uint16_t time) {
function fsPrintDateTime (line 134) | size_t fsPrintDateTime(print_t* pr, uint32_t dateTime) {
function fsPrintDateTime (line 138) | size_t fsPrintDateTime(print_t* pr,
function fsPrintTime (line 153) | size_t fsPrintTime(print_t* pr, uint16_t time) {
function fsPrintTime (line 161) | size_t fsPrintTime(print_t* pr, uint16_t time, uint8_t sec100) {
function fsPrintTimeZone (line 169) | size_t fsPrintTimeZone(print_t* pr, int8_t tz) {
FILE: firmware/3.0/lib/SdFat/src/common/FsDateTime.h
function namespace (line 38) | namespace FsDateTime {
function FS_DATE (line 116) | static inline uint16_t FS_DATE(uint16_t year, uint8_t month, uint8_t day) {
function FS_YEAR (line 126) | static inline uint16_t FS_YEAR(uint16_t fatDate) {
function FS_MONTH (line 134) | static inline uint8_t FS_MONTH(uint16_t fatDate) {
function FS_DAY (line 142) | static inline uint8_t FS_DAY(uint16_t fatDate) {
function FS_TIME (line 152) | static inline uint16_t FS_TIME(uint8_t hour, uint8_t minute, uint8_t sec...
function FS_HOUR (line 161) | static inline uint8_t FS_HOUR(uint16_t fatTime) {
function FS_MINUTE (line 169) | static inline uint8_t FS_MINUTE(uint16_t fatTime) {
function FS_SECOND (line 179) | static inline uint8_t FS_SECOND(uint16_t fatTime) {
FILE: firmware/3.0/lib/SdFat/src/common/FsName.h
function class (line 37) | class FsName {
FILE: firmware/3.0/lib/SdFat/src/common/FsStructs.cpp
function lbaToMbrChs (line 28) | void lbaToMbrChs(uint8_t* chs, uint32_t capacityMB, uint32_t lba) {
FILE: firmware/3.0/lib/SdFat/src/common/FsStructs.h
function getLe16 (line 35) | inline uint16_t getLe16(const uint8_t* src) {
function getLe32 (line 38) | inline uint32_t getLe32(const uint8_t* src) {
function getLe64 (line 41) | inline uint64_t getLe64(const uint8_t* src) {
function setLe16 (line 44) | inline void setLe16(uint8_t* dst, uint16_t src) {
function setLe32 (line 47) | inline void setLe32(uint8_t* dst, uint32_t src) {
function setLe64 (line 50) | inline void setLe64(uint8_t* dst, uint64_t src) {
function getLe16 (line 54) | inline uint16_t getLe16(const uint8_t* src) {
function getLe32 (line 58) | inline uint32_t getLe32(const uint8_t* src) {
function getLe64 (line 64) | inline uint64_t getLe64(const uint8_t* src) {
function setLe16 (line 74) | inline void setLe16(uint8_t* dst, uint16_t src) {
function setLe32 (line 78) | inline void setLe32(uint8_t* dst, uint32_t src) {
function setLe64 (line 84) | inline void setLe64(uint8_t* dst, uint64_t src) {
function lfnReservedChar (line 100) | inline bool lfnReservedChar(uint8_t c) {
function sfnReservedChar (line 106) | inline bool sfnReservedChar(uint8_t c) {
type MbrPart_t (line 121) | typedef struct mbrPartition {
type MbrSector_t (line 130) | typedef struct masterBootRecordSector {
type pbs_t (line 136) | typedef struct partitionBootSector {
type DirGeneric_t (line 144) | typedef struct {
type fspos_t (line 149) | typedef struct {
type BpbFat16_t (line 155) | typedef struct biosParameterBlockFat16 {
type BpbFat32_t (line 177) | typedef struct biosParameterBlockFat32 {
type PbsFat_t (line 207) | typedef struct partitionBootSectorFat {
type FsInfo_t (line 222) | typedef struct FsInfoSector {
type DirFat_t (line 248) | typedef struct {
function isFileDir (line 263) | static inline bool isFileDir(const DirFat_t* dir) {
function isFileOrSubdir (line 266) | static inline bool isFileOrSubdir(const DirFat_t* dir) {
function isLongName (line 269) | static inline uint8_t isLongName(const DirFat_t* dir) {
function isSubdir (line 272) | static inline bool isSubdir(const DirFat_t* dir) {
type DirLfn_t (line 286) | typedef struct {
function exFatChecksum (line 297) | inline uint32_t exFatChecksum(uint32_t sum, uint8_t data) {
type BpbExFat_t (line 301) | typedef struct biosParameterBlockExFat {
type ExFatPbs_t (line 321) | typedef struct ExFatBootSector {
type DirBitmap_t (line 332) | typedef struct {
type DirUpcase_t (line 341) | typedef struct {
type DirLabel_t (line 351) | typedef struct {
type DirFile_t (line 366) | typedef struct {
type DirStream_t (line 389) | typedef struct {
type DirName_t (line 404) | typedef struct {
type Guid_t (line 412) | typedef struct {
type GPTPartitionHeader_t (line 416) | typedef struct {
type GPTPartitionEntryItem_t (line 434) | typedef struct {
type GPTPartitionEntrySector_t (line 443) | typedef struct {
FILE: firmware/3.0/lib/SdFat/src/common/FsUtf.cpp
type FsUtf (line 26) | namespace FsUtf {
FILE: firmware/3.0/lib/SdFat/src/common/FsUtf.h
function namespace (line 33) | namespace FsUtf {
FILE: firmware/3.0/lib/SdFat/src/common/PrintBasic.h
function class (line 54) | class PrintBasic {
function println (line 106) | size_t println() {
function println (line 109) | size_t println(char c) {
function println (line 112) | size_t println(const char* str) {
function write (line 136) | size_t write(const char *str) {
function virtual (line 141) | virtual size_t write(const uint8_t* buffer, size_t size) {
function write (line 148) | size_t write(const char *buffer, size_t size) {
function class (line 163) | class StreamBasic : public PrintBasic {
FILE: firmware/3.0/lib/SdFat/src/common/SysCall.h
type Print (line 43) | typedef Print print_t;
type Stream (line 45) | typedef Stream stream_t;
type PrintBasic (line 58) | typedef PrintBasic print_t;
type PrintBasic (line 60) | typedef PrintBasic stream_t;
FILE: firmware/3.0/lib/SdFat/src/common/upcase.cpp
type map16 (line 38) | struct map16 {
type map16 (line 43) | struct map16
type pair16 (line 45) | struct pair16 {
type pair16 (line 49) | struct pair16
function searchPair16 (line 187) | static size_t searchPair16(const pair16_t* table, size_t size, uint16_t ...
function toUpcase (line 202) | uint16_t toUpcase(uint16_t chr) {
function upcaseChecksum (line 224) | uint32_t upcaseChecksum(uint16_t uc, uint32_t sum) {
FILE: firmware/3.0/lib/SdFat/src/iostream/ArduinoStream.h
function class (line 37) | class ArduinoInStream : public ibufstream {
function class (line 107) | class ArduinoOutStream : public ostream {
FILE: firmware/3.0/lib/SdFat/src/iostream/StdioStream.h
function class (line 112) | class StdioStream : private StreamBaseFile {
function println (line 459) | size_t println() {
function printDec (line 504) | int printDec(char n) {
function printDec (line 522) | int printDec(unsigned char n) {
function printDec (line 555) | int printDec(double value, uint8_t prec) {
function printHexln (line 610) | int printHexln(uint32_t n) {
FILE: firmware/3.0/lib/SdFat/src/iostream/bufstream.h
function class (line 38) | class ibufstream : public istream {
function class (line 101) | class obufstream : public ostream {
FILE: firmware/3.0/lib/SdFat/src/iostream/fstream.h
function getWriteError (line 46) | bool getWriteError() {
function seekpos (line 62) | bool seekpos(pos_type pos) {
function setmode (line 68) | void setmode(ios::openmode mode) {
function clear (line 99) | void clear(iostate state = goodbit) {
function close (line 106) | void close() {
function is_open (line 135) | bool is_open() {
function getpos (line 150) | void getpos(pos_t* pos) {
function putch (line 156) | void putch(char c) {
function putstr (line 162) | void putstr(const char *str) {
function seekoff (line 168) | bool seekoff(off_type off, seekdir way) {
function seekpos (line 171) | bool seekpos(pos_type pos) {
function setpos (line 174) | void setpos(pos_t* pos) {
function sync (line 177) | bool sync() {
function pos_type (line 180) | pos_type tellpos() {
function explicit (line 198) | explicit ifstream(const char* path, openmode mode = in) {
function close (line 207) | void close() {
function is_open (line 211) | bool is_open() {
function open (line 220) | void open(const char* path, openmode mode = in) {
function getpos (line 235) | void getpos(pos_t* pos) {
function seekoff (line 241) | bool seekoff(off_type off, seekdir way) {
function seekpos (line 244) | bool seekpos(pos_type pos) {
function setpos (line 247) | void setpos(pos_t* pos) {
function pos_type (line 250) | pos_type tellpos() {
function explicit (line 267) | explicit ofstream(const char* path, openmode mode = out) {
function clear (line 276) | void clear(iostate state = goodbit) {
function close (line 283) | void close() {
function open (line 292) | void open(const char* path, openmode mode = out) {
function is_open (line 296) | bool is_open() {
function putstr (line 309) | void putstr(const char* str) {
function seekoff (line 312) | bool seekoff(off_type off, seekdir way) {
function seekpos (line 315) | bool seekpos(pos_type pos) {
function sync (line 322) | bool sync() {
function pos_type (line 325) | pos_type tellpos() {
FILE: firmware/3.0/lib/SdFat/src/iostream/ios.h
type fspos_t (line 34) | typedef fspos_t pos_t;
type FatFile (line 38) | typedef FatFile StreamBaseFile;
type ExFatFile (line 40) | typedef ExFatFile StreamBaseFile;
type FsBaseFile (line 42) | typedef FsBaseFile StreamBaseFile;
function class (line 50) | class ios_base {
function class (line 389) | class ios : public ios_base {
FILE: firmware/3.0/lib/SdFat/src/iostream/iostream.h
type setfill (line 64) | struct setfill {
type setprecision (line 95) | struct setprecision {
type setw (line 125) | struct setw {
FILE: firmware/3.0/lib/SdFat/src/iostream/istream.cpp
function istream (line 41) | istream& istream::get(char& c) {
function istream (line 49) | istream& istream::get(char *str, streamsize n, char delim) {
function istream (line 227) | istream& istream::getline(char *str, streamsize n, char delim) {
function istream (line 347) | istream& istream::ignore(streamsize n, int delim) {
FILE: firmware/3.0/lib/SdFat/src/iostream/istream.h
function class (line 37) | class istream : public virtual ios {
function pos_type (line 293) | pos_type tellg() {
function getch (line 335) | int16_t getch(pos_t* pos) {
FILE: firmware/3.0/lib/SdFat/src/iostream/ostream.h
function class (line 37) | class ostream : public virtual ios {
function pos_type (line 246) | pos_type tellp() {
function putNum (line 295) | void putNum(uint32_t n) {putNum(n, false);}
function putNum (line 296) | void putNum(uint64_t n) {putNum(n, false);}
FILE: firmware/3.0/lib/Time/Time.cpp
function refreshCache (line 42) | void refreshCache(time_t t) {
function hour (line 49) | int hour() { // the hour now
function hour (line 53) | int hour(time_t t) { // the hour for the given time
function hourFormat12 (line 58) | int hourFormat12() { // the hour now in 12 hour format
function hourFormat12 (line 62) | int hourFormat12(time_t t) { // the hour for the given time in 12 hour f...
function isAM (line 72) | uint8_t isAM() { // returns true if time now is AM
function isAM (line 76) | uint8_t isAM(time_t t) { // returns true if given time is AM
function isPM (line 80) | uint8_t isPM() { // returns true if PM
function isPM (line 84) | uint8_t isPM(time_t t) { // returns true if PM
function minute (line 88) | int minute() {
function minute (line 92) | int minute(time_t t) { // the minute for the given time
function second (line 97) | int second() {
function second (line 101) | int second(time_t t) { // the second for the given time
function day (line 106) | int day(){
function day (line 110) | int day(time_t t) { // the day for the given time (0-6)
function weekday (line 115) | int weekday() { // Sunday is day 1
function weekday (line 119) | int weekday(time_t t) {
function month (line 124) | int month(){
function month (line 128) | int month(time_t t) { // the month for the given time
function year (line 133) | int year() { // as in Processing, the full four digit year: (2009, 2010...
function year (line 137) | int year(time_t t) { // the year for the given time
function breakTime (line 151) | void breakTime(time_t timeInput, tmElements_t &tm){
function time_t (line 204) | time_t makeTime(const tmElements_t &tm){
function time_t (line 250) | time_t now() {
function setTime (line 274) | void setTime(time_t t) {
function setTime (line 286) | void setTime(int hr,int min,int sec,int dy, int mnth, int yr){
function adjustTime (line 302) | void adjustTime(long adjustment) {
function timeStatus_t (line 307) | timeStatus_t timeStatus() {
function setSyncProvider (line 312) | void setSyncProvider( getExternalTime getTimeFunction){
function setSyncInterval (line 318) | void setSyncInterval(time_t interval){ // set the number of seconds betw...
FILE: firmware/3.0/lib/Time/TimeLib.h
type time_t (line 21) | typedef unsigned long time_t;
type timeStatus_t (line 34) | typedef enum {timeNotSet, timeNeedsSync, timeSet
type timeDayOfWeek_t (line 37) | typedef enum {
type tmByteFields (line 41) | typedef enum {
type tmElements_t (line 45) | typedef struct {
type time_t (line 61) | typedef time_t(*getExternalTime)();
FILE: firmware/3.0/lib/Wire/Wire.h
function class (line 39) | class TwoWire : public Stream
FILE: firmware/3.0/lib/Wire/WireIMXRT.cpp
function FLASHMEM (line 16) | FLASHMEM void TwoWire::begin(void)
function FLASHMEM (line 341) | FLASHMEM void TwoWire::setSDA(uint8_t pin) {
function FLASHMEM (line 359) | FLASHMEM void TwoWire::configSDApin(uint8_t i)
function FLASHMEM (line 368) | FLASHMEM void TwoWire::setSCL(uint8_t pin) {
function FLASHMEM (line 386) | FLASHMEM void TwoWire::configSCLpin(uint8_t i)
function lpi2c1_isr (line 398) | void lpi2c1_isr(void) { Wire.isr(); }
function lpi2c3_isr (line 399) | void lpi2c3_isr(void) { Wire2.isr(); }
function lpi2c4_isr (line 400) | void lpi2c4_isr(void) { Wire1.isr(); }
function lpi2c2_isr (line 401) | void lpi2c2_isr(void) { Wire3.isr(); }
function lpi2c1_isr (line 403) | void lpi2c1_isr(void) { Wire.isr(); }
function lpi2c3_isr (line 404) | void lpi2c3_isr(void) { Wire1.isr(); }
function lpi2c4_isr (line 405) | void lpi2c4_isr(void) { Wire2.isr(); }
FILE: firmware/3.0/lib/Wire/WireIMXRT.h
function class (line 41) | class TwoWire : public Stream
function class (line 201) | class TWBRemulation
FILE: firmware/3.0/lib/Wire/WireKinetis.cpp
function sda_rising_isr0 (line 444) | void sda_rising_isr0(void)
function sda_rising_isr1 (line 450) | void sda_rising_isr1(void)
function twi_writeTo (line 830) | uint8_t twi_writeTo(uint8_t address, uint8_t* data, uint8_t length, uint...
function i2c0_isr (line 914) | void i2c0_isr(void) { Wire.isr(); }
function i2c1_isr (line 919) | void i2c1_isr(void) { Wire1.isr(); }
function i2c2_isr (line 924) | void i2c2_isr(void) { Wire2.isr(); }
function i2c3_isr (line 929) | void i2c3_isr(void) { Wire3.isr(); }
FILE: firmware/3.0/lib/Wire/WireKinetis.h
function class (line 83) | class TwoWire : public Stream
function class (line 240) | class TWBRemulation
FILE: firmware/3.0/lib/Wire/utility/twi.c
function twi_init (line 70) | void twi_init(void)
function twi_setAddress (line 101) | void twi_setAddress(uint8_t address)
function twi_readFrom (line 117) | uint8_t twi_readFrom(uint8_t address, uint8_t* data, uint8_t length, uin...
function twi_writeTo (line 194) | uint8_t twi_writeTo(uint8_t address, uint8_t* data, uint8_t length, uint...
function twi_transmit (line 268) | uint8_t twi_transmit(const uint8_t* data, uint8_t length)
function twi_attachSlaveRxEvent (line 297) | void twi_attachSlaveRxEvent( void (*function)(uint8_t*, int) )
function twi_attachSlaveTxEvent (line 308) | void twi_attachSlaveTxEvent( void (*function)(void) )
function twi_reply (line 319) | void twi_reply(uint8_t ack)
function twi_stop (line 335) | void twi_stop(void)
function twi_releaseBus (line 356) | void twi_releaseBus(void)
function SIGNAL (line 365) | SIGNAL(TWI_vect)
FILE: firmware/3.0/src/gui/buttons.cpp
function buttons_addButton (line 60) | int buttons_addButton(uint16_t x, uint16_t y, uint16_t width, uint16_t h...
function buttons_addButton (line 85) | int buttons_addButton(uint16_t x, uint16_t y, uint16_t width, uint16_t h...
function buttons_drawButton (line 109) | void buttons_drawButton(int buttonID) {
function buttons_drawButtons (line 180) | void buttons_drawButtons() {
function buttons_enableButton (line 188) | void buttons_enableButton(int buttonID, boolean redraw) {
function buttons_disableButton (line 197) | void buttons_disableButton(int buttonID, boolean redraw) {
function buttons_relabelButton (line 206) | void buttons_relabelButton(int buttonID, char *label, boolean redraw) {
function boolean (line 215) | boolean buttons_buttonEnabled(int buttonID) {
function buttons_deleteButton (line 220) | void buttons_deleteButton(int buttonID) {
function buttons_deleteAllButtons (line 226) | void buttons_deleteAllButtons() {
function buttons_checkButtons (line 238) | int buttons_checkButtons(boolean timeout, boolean fast) {
function buttons_setActive (line 325) | void buttons_setActive(int buttonID) {
function buttons_setInactive (line 343) | void buttons_setInactive(int buttonID) {
function buttons_setTextFont (line 361) | void buttons_setTextFont(const uint8_t* font) {
function buttons_setSymbolFont (line 366) | void buttons_setSymbolFont(const uint8_t* font) {
function buttons_setButtonColors (line 371) | void buttons_setButtonColors(word atxt, word iatxt, word brd, word brdhi,
function buttons_init (line 381) | void buttons_init() {
FILE: firmware/3.0/src/gui/firststart.cpp
function boolean (line 37) | boolean checkFirstStart()
function welcomeScreen (line 43) | void welcomeScreen()
function infoScreen (line 70) | void infoScreen(String *text, bool cont)
function timeDateScreen (line 108) | void timeDateScreen()
function tempFormatScreen (line 134) | void tempFormatScreen()
function convertImageScreen (line 152) | void convertImageScreen()
function firstFormat (line 170) | void firstFormat()
function firstStartComplete (line 182) | void firstStartComplete()
function boolean (line 201) | boolean checkLiveModeHelper()
function liveModeHelper (line 207) | void liveModeHelper()
function stdEEPROMSet (line 238) | void stdEEPROMSet()
function firstStart (line 281) | void firstStart()
FILE: firmware/3.0/src/gui/gui.cpp
function floatToChar (line 32) | void floatToChar(char *buffer, float val)
function changeTextColor (line 41) | void changeTextColor()
function showFullMessage (line 61) | void showFullMessage(char *message, bool small)
function showTransMessage (line 82) | void showTransMessage(char *msg)
function drawCenterElement (line 102) | void drawCenterElement(int element)
function drawMainMenuBorder (line 112) | void drawMainMenuBorder()
function drawTitle (line 120) | void drawTitle(char *name, bool firstStart)
function showDiagnostic (line 137) | void showDiagnostic()
function bootScreen (line 196) | void bootScreen()
FILE: firmware/3.0/src/gui/livemode.cpp
function displayBatteryStatus (line 36) | void displayBatteryStatus()
function displayTime (line 76) | void displayTime()
function displayDate (line 86) | void displayDate()
function displayTempMode (line 96) | void displayTempMode()
function displayMinMaxPoint (line 129) | void displayMinMaxPoint(bool min)
function displayFreeSpace (line 162) | void displayFreeSpace()
function showSpot (line 168) | void showSpot()
function displayInfos (line 189) | void displayInfos()
FILE: firmware/3.0/src/gui/loadmenu.cpp
function displayGUI (line 34) | void displayGUI(uint32_t imgCount, char* infoText) {
function deleteVideo (line 59) | void deleteVideo(char* dirname) {
function deleteImage (line 140) | void deleteImage(char* filename) {
function convertPrompt (line 187) | bool convertPrompt() {
function convertImage (line 223) | void convertImage(char* filename) {
function convertVideo (line 263) | void convertVideo(char* dirname) {
function openImage (line 301) | void openImage(char* filename, uint32_t imgCount) {
function getVideoFrameNumber (line 355) | uint32_t getVideoFrameNumber() {
function displayVideoFrame (line 378) | void displayVideoFrame(uint32_t imgCount)
function playVideo (line 393) | void playVideo(char* dirname, uint32_t imgCount) {
function loadMenu (line 480) | int loadMenu(char* title, int* array, int length) {
FILE: firmware/3.0/src/gui/mainmenu.cpp
function mainMenuBackground (line 41) | void mainMenuBackground()
function drawSelectionMenu (line 53) | void drawSelectionMenu()
function mainMenuTitle (line 69) | void mainMenuTitle(char *title)
function mainMenuSelection (line 78) | void mainMenuSelection(char *selection)
function massStoragePrompt (line 90) | bool massStoragePrompt()
function calibrationRepeat (line 133) | bool calibrationRepeat()
function calibrationScreen (line 174) | void calibrationScreen(bool firstStart)
function tempPointsMenu (line 206) | bool tempPointsMenu()
function hotColdColorMenuString (line 256) | void hotColdColorMenuString(int pos)
function hotColdColorMenu (line 286) | bool hotColdColorMenu()
function hotColdChooserHandler (line 346) | void hotColdChooserHandler()
function hotColdChooser (line 427) | void hotColdChooser()
function hotColdMenu (line 475) | bool hotColdMenu()
function tempLimitsPresetSaveString (line 572) | void tempLimitsPresetSaveString(int pos)
function tempLimitsPresetSaveMenu (line 594) | bool tempLimitsPresetSaveMenu()
function tempLimitsManualHandler (line 696) | bool tempLimitsManualHandler()
function tempLimitsManual (line 844) | void tempLimitsManual()
function tempLimitsPresetsString (line 878) | void tempLimitsPresetsString(int pos)
function tempLimitsPresets (line 900) | bool tempLimitsPresets()
function tempLimits (line 992) | bool tempLimits()
function liveDispMenuString (line 1052) | void liveDispMenuString(int pos)
function liveDispMenu (line 1137) | bool liveDispMenu()
function colorMenuString (line 1190) | void colorMenuString(int pos)
function colorMenu (line 1257) | bool colorMenu()
function drawMainMenu (line 1307) | void drawMainMenu(byte pos)
function mainMenuSelect (line 1357) | bool mainMenuSelect(byte pos, byte page)
function mainMenuHandler (line 1424) | void mainMenuHandler(byte *pos)
function mainMenu (line 1491) | void mainMenu()
FILE: firmware/3.0/src/gui/settingsmenu.cpp
function secondMenu (line 39) | void secondMenu(bool firstStart)
function minuteMenu (line 93) | void minuteMenu(bool firstStart)
function hourMenu (line 147) | void hourMenu(bool firstStart)
function dayMenu (line 201) | void dayMenu(bool firstStart)
function monthMenu (line 256) | void monthMenu(bool firstStart)
function yearMenu (line 310) | void yearMenu(bool firstStart)
function batteryGauge (line 358) | void batteryGauge()
function dateMenu (line 407) | void dateMenu(bool firstStart)
function dateMenuHandler (line 422) | void dateMenuHandler(bool firstStart)
function timeMenu (line 457) | void timeMenu(bool firstStart)
function timeMenuHandler (line 472) | void timeMenuHandler(bool firstStart)
function generalMenu (line 507) | void generalMenu()
function generalMenuHandler (line 519) | void generalMenuHandler()
function convertImageMenu (line 558) | void convertImageMenu(bool firstStart)
function formatStorage (line 620) | void formatStorage()
function changeLeptonGain (line 670) | void changeLeptonGain()
function hardwareMenuHandler (line 738) | void hardwareMenuHandler()
function hardwareMenu (line 771) | void hardwareMenu()
function tempFormatMenu (line 783) | void tempFormatMenu(bool firstStart)
function rotateDisplayMenu (line 845) | void rotateDisplayMenu(bool firstStart)
function screenTimeoutMenu (line 921) | void screenTimeoutMenu()
function displayMenuHandler (line 962) | void displayMenuHandler()
function displayMenu (line 996) | void displayMenu()
function settingsMenuHandler (line 1008) | void settingsMenuHandler()
function settingsMenu (line 1043) | void settingsMenu()
FILE: firmware/3.0/src/gui/videomenu.cpp
function videoIntervalString (line 44) | void videoIntervalString(int pos) {
function videoIntervalHandler (line 85) | bool videoIntervalHandler(byte* pos) {
function videoIntervalChooser (line 154) | bool videoIntervalChooser() {
function videoCaptureInterval (line 176) | void videoCaptureInterval(int16_t* remainingTime, uint32_t* framesCaptur...
function videoCaptureNormal (line 232) | void videoCaptureNormal(uint32_t* framesCaptured, uint16_t* folderFrames...
function videoCreateFolder (line 263) | void videoCreateFolder(char *dirName) {
function videoCapture (line 280) | void videoCapture() {
function videoMode (line 353) | void videoMode() {
FILE: firmware/3.0/src/hardware/battery.cpp
function getLipoPerc (line 30) | int getLipoPerc(float vol) {
function checkBattery (line 57) | void checkBattery(bool start, bool calibrate) {
FILE: firmware/3.0/src/hardware/connection.cpp
function getInt (line 44) | int getInt(String text)
function checkNoDisplay (line 53) | bool checkNoDisplay()
function sendRawLimits (line 63) | void sendRawLimits()
function sendRawData (line 74) | void sendRawData(bool color)
function sendFramebuffer (line 101) | void sendFramebuffer()
function sendConfigData (line 111) | void sendConfigData()
function sendCalibrationData (line 137) | void sendCalibrationData()
function sendSpotTemp (line 153) | void sendSpotTemp()
function sendTempPoints (line 167) | void sendTempPoints()
function sendBatteryStatus (line 181) | void sendBatteryStatus()
function sendFWVersion (line 187) | void sendFWVersion()
function setLimits (line 194) | void setLimits()
function setTextColor (line 234) | void setTextColor()
function setColorScheme (line 268) | void setColorScheme()
function setTempFormat (line 302) | void setTempFormat()
function setShowSpot (line 334) | void setShowSpot()
function setShowColorbar (line 366) | void setShowColorbar()
function setMinMax (line 398) | void setMinMax()
function setShutterMode (line 430) | void setShutterMode()
function setFilterType (line 458) | void setFilterType()
function setRotation (line 490) | void setRotation()
function sendHardwareVersion (line 524) | void sendHardwareVersion()
function sendDiagnostic (line 531) | void sendDiagnostic()
function setTempPoints (line 538) | void setTempPoints()
function sendFrame (line 566) | void sendFrame(bool color)
function saveFrame (line 604) | void saveFrame()
function sendDisplayFrame (line 640) | void sendDisplayFrame()
function serialHandler (line 680) | bool serialHandler()
function buttonHandler (line 811) | void buttonHandler()
function touchHandler (line 839) | bool touchHandler()
function checkSerial (line 862) | void checkSerial()
function serialOutput (line 879) | void serialOutput()
function serialInit (line 919) | void serialInit()
function serialConnect (line 936) | void serialConnect()
FILE: firmware/3.0/src/hardware/display/display.cpp
type current_font (line 102) | struct current_font
function display_begin_spi_transaction (line 158) | void display_begin_spi_transaction()
function display_end_spi_transaction (line 173) | void display_end_spi_transaction()
function display_waitFifoNotFull (line 180) | void display_waitFifoNotFull()
function display_waitTransmitComplete (line 194) | void display_waitTransmitComplete()
function display_maybeUpdateTCR (line 209) | void display_maybeUpdateTCR(uint32_t requested_tcr_state)
function display_writecommand_cont (line 234) | void display_writecommand_cont(uint8_t c)
function display_writedata8_cont (line 241) | void display_writedata8_cont(uint8_t c)
function display_writedata16_cont (line 249) | void display_writedata16_cont(uint16_t d)
function display_writecommand_last (line 257) | void display_writecommand_last(uint8_t c)
function display_writedata8_last (line 265) | void display_writedata8_last(uint8_t c)
function display_writedata16_last (line 273) | void display_writedata16_last(uint16_t d)
function display_setAddr (line 281) | void display_setAddr(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1)
function display_readcommand8 (line 292) | uint8_t display_readcommand8(uint8_t c, uint8_t index)
function display_setRotation (line 335) | void display_setRotation(uint8_t m)
function byte (line 363) | byte display_InitLCD()
function display_init (line 422) | void display_init()
function display_setXY (line 448) | void display_setXY(word x1, word y1, word x2, word y2)
function display_clrXY (line 476) | void display_clrXY()
function display_clrScr (line 485) | void display_clrScr()
function display_drawPixel (line 491) | void display_drawPixel(int x, int y)
function display_drawHLine (line 505) | void display_drawHLine(int x, int y, int l)
function display_drawVLine (line 526) | void display_drawVLine(int x, int y, int l)
function display_setPixel (line 547) | void display_setPixel(word color)
function display_LCD_Write_DATA (line 568) | void display_LCD_Write_DATA(char VH, char VL)
function display_drawLine (line 574) | void display_drawLine(int x1, int y1, int x2, int y2)
function display_fillScr (line 631) | void display_fillScr(word color)
function display_fillScr (line 650) | void display_fillScr(byte r, byte g, byte b)
function display_drawRect (line 657) | void display_drawRect(int x1, int y1, int x2, int y2)
function display_fillRect (line 675) | void display_fillRect(int x1, int y1, int x2, int y2)
function display_drawRoundRect (line 714) | void display_drawRoundRect(int x1, int y1, int x2, int y2)
function display_fillRoundRect (line 738) | void display_fillRoundRect(int x1, int y1, int x2, int y2)
function display_drawCircle (line 772) | void display_drawCircle(int x, int y, int radius)
function display_fillCircle (line 821) | void display_fillCircle(int x, int y, int radius)
function display_setColor (line 838) | void display_setColor(byte r, byte g, byte b)
function display_setColor (line 845) | void display_setColor(word color)
function word (line 852) | word display_getColor()
function display_setBackColor (line 858) | void display_setBackColor(byte r, byte g, byte b)
function display_setBackColor (line 866) | void display_setBackColor(uint32_t color)
function word (line 879) | word display_getBackColor()
function display_printChar (line 885) | void display_printChar(byte c, int x, int y)
function display_getFontHeight (line 973) | int display_getFontHeight()
function boolean (line 979) | boolean display_getCharPtr(byte c, propFont &fontChar)
function display_printProportionalChar (line 1008) | int display_printProportionalChar(byte c, int x, int y)
function display_rotatePropChar (line 1059) | int display_rotatePropChar(byte c, int x, int y, int offset, int deg)
function display_rotateChar (line 1115) | void display_rotateChar(byte c, int x, int y, int pos, int deg)
function display_print (line 1153) | void display_print(char *st, int x, int y, int deg)
function display_print (line 1197) | void display_print(String st, int x, int y, int deg)
function display_printC (line 1205) | void display_printC(String st, int x, int y, uint32_t color)
function display_printNumI (line 1214) | void display_printNumI(long num, int x, int y, int length, char filler)
function display_convertFloat (line 1277) | void display_convertFloat(char *buf, double num, int width, byte prec)
function display_printNumF (line 1283) | void display_printNumF(double num, byte dec, int x, int y, char divider,...
function display_setFont (line 1324) | void display_setFont(const uint8_t *font)
function display_getFontXsize (line 1340) | uint8_t display_getFontXsize()
function display_getFontYsize (line 1346) | uint8_t display_getFontYsize()
function display_drawBitmap (line 1352) | void display_drawBitmap(int x, int y, int w, int h, unsigned short *data)
function display_writeRect2BPP (line 1371) | void display_writeRect2BPP(int16_t x, int16_t y, int16_t w, int16_t h, c...
function display_writeRect4BPP (line 1394) | void display_writeRect4BPP(int16_t x, int16_t y, int16_t w, int16_t h, c...
function display_getStringWidth (line 1413) | int display_getStringWidth(char *str)
function display_enterSleepMode (line 1440) | void display_enterSleepMode()
function display_exitSleepMode (line 1448) | void display_exitSleepMode()
function display_writeScreen (line 1456) | void display_writeScreen(unsigned short *pcolors)
FILE: firmware/3.0/src/hardware/hardware.cpp
function t4_direct_write_low (line 39) | void t4_direct_write_low(volatile uint32_t *base, uint32_t mask)
function t4_direct_write_high (line 44) | void t4_direct_write_high(volatile uint32_t *base, uint32_t mask)
function isUSBConnected (line 49) | bool isUSBConnected()
function floatToBytes (line 55) | void floatToBytes(uint8_t *farray, float val)
function bytesToFloat (line 70) | float bytesToFloat(uint8_t *farray)
function clearEEPROM (line 82) | void clearEEPROM()
function checkFWUpgrade (line 89) | void checkFWUpgrade()
function readEEPROM (line 112) | void readEEPROM()
function checkDiagnostic (line 237) | bool checkDiagnostic(byte device)
function setDiagnostic (line 244) | void setDiagnostic(byte device)
function checkHardware (line 250) | void checkHardware()
function boolean (line 258) | boolean touchScreenPressed()
function boolean (line 266) | boolean extButtonPressed()
function initGPIO (line 274) | void initGPIO()
function initSPI (line 283) | void initSPI()
function initI2C (line 309) | void initI2C()
function initADC (line 315) | void initADC()
function initBuffer (line 332) | void initBuffer()
function displayBuffer (line 342) | void displayBuffer()
function setDisplayRotation (line 348) | void setDisplayRotation()
function readTempLimits (line 363) | void readTempLimits()
function initScreenOffTimer (line 422) | void initScreenOffTimer()
function time_t (line 443) | time_t getTeensy3Time()
function initRTC (line 449) | void initRTC()
function disableScreenLight (line 465) | void disableScreenLight()
function enableScreenLight (line 471) | void enableScreenLight()
function checkScreenLight (line 477) | bool checkScreenLight()
function getSpotTemp (line 483) | void getSpotTemp()
function toggleDisplay (line 495) | void toggleDisplay()
function screenOffCheck (line 511) | bool screenOffCheck()
function initHardware (line 532) | void initHardware()
FILE: firmware/3.0/src/hardware/lepton.cpp
function AbsDiff32u (line 40) | uint32_t AbsDiff32u(uint32_t n1, uint32_t n2)
function lepton_startFrame (line 52) | void lepton_startFrame()
function lepton_endFrame (line 62) | void lepton_endFrame()
function lepton_begin (line 72) | void lepton_begin()
function lepton_reset (line 79) | void lepton_reset()
function lepton_end (line 87) | void lepton_end()
function lepton_savePacket (line 94) | void lepton_savePacket(uint8_t line, uint8_t segment)
function lepton_getFrame (line 196) | void lepton_getFrame()
function lepton_getPacketAsync (line 212) | bool lepton_getPacketAsync(uint8_t *line, uint8_t *seg)
function lepton_getFrameAsync (line 244) | void lepton_getFrameAsync()
function lepton_setReg (line 350) | void lepton_setReg(byte reg)
function lepton_readReg (line 359) | int lepton_readReg(byte reg)
function lepton_i2cReadDataRegister (line 377) | int lepton_i2cReadDataRegister(byte *data, int data_length_request)
function byte (line 404) | byte lepton_i2cWriteDataRegister(byte *data, int length)
function byte (line 434) | byte lepton_i2c_execute_command(byte cmdbyte0, byte cmdbyte1)
function lepton_ffc (line 452) | bool lepton_ffc(bool message, bool switch_gain)
function lepton_spotTemp (line 492) | float lepton_spotTemp()
function lepton_ffcMode (line 533) | void lepton_ffcMode(bool automatic)
function lepton_setGpioMode (line 559) | void lepton_setGpioMode(bool vsync_enabled)
function lepton_version (line 576) | bool lepton_version()
function lepton_setSysGainMode (line 623) | void lepton_setSysGainMode(byte mode)
function lepton_setSysGainHigh (line 643) | void lepton_setSysGainHigh()
function lepton_setSysGainLow (line 651) | void lepton_setSysGainLow()
function lepton_setSysGainAuto (line 659) | void lepton_setSysGainAuto()
function lepton_getSysGainMode (line 675) | int lepton_getSysGainMode()
function byte (line 694) | byte lepton_getRadTlinearResolution()
function lepton_getResolution (line 712) | float lepton_getResolution()
function lepton_setRadTlinearResolution (line 735) | void lepton_setRadTlinearResolution(byte resolution)
function lepton_setRadTlinear10 (line 755) | void lepton_setRadTlinear10()
function lepton_setRadTlinear100 (line 763) | void lepton_setRadTlinear100()
function lepton_setLowGain (line 769) | void lepton_setLowGain()
function lepton_setHighGain (line 778) | void lepton_setHighGain()
function lepton_spiCheck (line 787) | bool lepton_spiCheck()
function lepton_init (line 808) | void lepton_init()
FILE: firmware/3.0/src/hardware/massstorage.cpp
function dateTime (line 51) | void dateTime(uint16_t *date, uint16_t *time, uint8_t *ms10)
function storage_configure (line 58) | void storage_configure()
function enterMassStorage (line 72) | void enterMassStorage()
function setMassStorage (line 99) | void setMassStorage()
function checkMassStorage (line 108) | void checkMassStorage()
FILE: firmware/3.0/src/hardware/sdcard.cpp
function getSDSpace (line 37) | uint32_t getSDSpace()
function getCardSize (line 43) | uint32_t getCardSize()
function refreshFreeSpace (line 49) | void refreshFreeSpace()
function dateTime (line 57) | void dateTime(uint16_t *date, uint16_t *time)
function beginSD (line 66) | bool beginSD()
function initSD (line 72) | void initSD()
function eraseCard (line 86) | bool eraseCard()
function formatCard (line 118) | bool formatCard()
FILE: firmware/3.0/src/hardware/touchscreen/ft6206_touchscreen.cpp
function boolean (line 25) | boolean FT6206_Touchscreen::begin(uint8_t threshhold) {
function boolean (line 31) | boolean FT6206_Touchscreen::touched(void) {
function TS_Point (line 70) | TS_Point FT6206_Touchscreen::getPoint(void) {
FILE: firmware/3.0/src/hardware/touchscreen/touchscreen.cpp
function TS_Point (line 45) | TS_Point touch_getPoint() {
function touch_init (line 54) | void touch_init() {
function touch_touched (line 104) | volatile bool touch_touched() {
function touch_setRotation (line 118) | void touch_setRotation(bool rotated) {
FILE: firmware/3.0/src/hardware/touchscreen/xpt2046_touchscreen.cpp
function isrPin (line 55) | void isrPin(void)
function TS_Point (line 61) | TS_Point XPT2046_Touchscreen::getPoint()
function besttwoavg (line 92) | static int16_t besttwoavg(int16_t x, int16_t y, int16_t z) {
FILE: firmware/3.0/src/main.cpp
function setup (line 27) | void setup()
function loop (line 58) | void loop()
FILE: firmware/3.0/src/thermal/create.cpp
function gaussianFilter (line 34) | void gaussianFilter()
function boxFilter (line 60) | void boxFilter()
function resizePixels (line 86) | void resizePixels(unsigned short *pixels, int w1, int h1, int w2, int h2)
function smallToBigBuffer (line 119) | void smallToBigBuffer()
function clearTempPoints (line 156) | void clearTempPoints()
function showTemperatures (line 169) | void showTemperatures()
function getTouchPos (line 210) | void getTouchPos(uint16_t *x, uint16_t *y)
function tempPointFunction (line 235) | void tempPointFunction(bool remove)
function limitValues (line 373) | void limitValues()
function getHotColdColors (line 392) | void getHotColdColors(byte *red, byte *green, byte *blue)
function convertColors (line 430) | void convertColors(bool small)
function refreshMinMax (line 492) | void refreshMinMax()
function refreshTempPoints (line 519) | void refreshTempPoints()
function calculatePointPos (line 544) | void calculatePointPos(int16_t *xpos, int16_t *ypos, uint16_t pixelIndex)
function createThermalImg (line 558) | void createThermalImg(bool small)
FILE: firmware/3.0/src/thermal/load.cpp
function clearData (line 81) | void clearData()
function displayRawData (line 109) | void displayRawData()
function loadBMPImage (line 138) | void loadBMPImage(char *filename)
function isImage (line 167) | bool isImage(char *filename)
function readTempPoints (line 192) | void readTempPoints()
function loadRawData (line 265) | void loadRawData(char *filename)
function yearChoose (line 370) | bool yearChoose(char *filename)
function monthChoose (line 443) | bool monthChoose(bool *months, char *filename)
function dayChoose (line 495) | bool dayChoose(bool *days, char *filename)
function hourChoose (line 543) | bool hourChoose(bool *hours, char *filename)
function minuteChoose (line 591) | bool minuteChoose(bool *minutes, char *filename)
function secondChoose (line 640) | bool secondChoose(bool *seconds, char *filename)
function copyIntoBuffers (line 689) | void copyIntoBuffers(char *filename)
function checkFileValidity (line 703) | bool checkFileValidity()
function checkFileStructure (line 717) | void checkFileStructure(bool *check)
function checkFileEnding (line 742) | void checkFileEnding(bool *check, char *filename)
function findFile (line 773) | bool findFile(char *filename, bool next, bool restart, int *position, ch...
function searchFiles (line 838) | void searchFiles()
function chooseFile (line 899) | void chooseFile(char *filename)
function loadDelete (line 1032) | bool loadDelete(char *filename, int *pos)
function loadFind (line 1063) | void loadFind(char *filename, int *pos)
function loadAlloc (line 1091) | void loadAlloc()
function loadSettings (line 1102) | void loadSettings()
function loadDeAlloc (line 1114) | void loadDeAlloc()
function loadTouchIRQ (line 1125) | void loadTouchIRQ()
function loadFiles (line 1162) | void loadFiles()
FILE: firmware/3.0/src/thermal/save.cpp
function createSDName (line 56) | void createSDName(char *filename, boolean folder)
function imgSaveStart (line 126) | void imgSaveStart()
function frameFilename (line 160) | void frameFilename(char *filename, uint32_t count)
function saveVideoFrame (line 171) | void saveVideoFrame(char *filename)
function processVideoFrames (line 199) | void processVideoFrames(uint32_t framesCaptured, char *dirname)
function saveRawData (line 277) | void saveRawData(bool isImage, char *name, uint32_t framesCaptured)
function imgSaveEnd (line 387) | void imgSaveEnd()
function saveBuffer (line 401) | void saveBuffer(char *filename)
FILE: firmware/3.0/src/thermal/temperature.cpp
function celciusToFahrenheit (line 25) | float celciusToFahrenheit(float Tc) {
function fahrenheitToCelcius (line 31) | float fahrenheitToCelcius(float Tf) {
function rawToTemp (line 37) | float rawToTemp(uint16_t rawValue) {
function tempToRaw (line 49) | uint16_t tempToRaw(float temp) {
function calcAverage (line 60) | uint16_t calcAverage() {
FILE: firmware/3.0/src/thermal/thermal.cpp
function touchIRQ (line 41) | void touchIRQ()
function buttonIRQ (line 78) | void buttonIRQ()
function longTouchHandler (line 120) | void longTouchHandler()
function showColorBar (line 237) | void showColorBar()
function changeDisplayOptions (line 313) | void changeDisplayOptions(byte *pos)
function selectColorScheme (line 395) | void selectColorScheme()
function changeColorScheme (line 517) | void changeColorScheme(byte *pos)
function showImage (line 528) | void showImage()
function liveModeInit (line 540) | void liveModeInit()
function liveMode (line 557) | void liveMode()
FILE: software/thermal_live_viewer/3.0/main.py
function create_port_menu (line 7) | def create_port_menu() -> Optional[str]:
FILE: software/thermal_live_viewer/3.0/src/colorschemes.py
class ColorSchemes (line 1) | class ColorSchemes:
method __init__ (line 2) | def __init__(self):
FILE: software/thermal_live_viewer/3.0/src/liveviewer.py
class LiveViewer (line 18) | class LiveViewer:
method __init__ (line 19) | def __init__(self, serial_port):
method resource_path (line 139) | def resource_path(self, relative_path):
method setColorScheme (line 145) | def setColorScheme(self, updateValue):
method setSpot (line 278) | def setSpot(self, updateValue):
method setBar (line 316) | def setBar(self, updateValue):
method setMinMax (line 354) | def setMinMax(self, updateValue):
method setTextColor (line 399) | def setTextColor(self, updateValue):
method setFilterType (line 446) | def setFilterType(self, updateValue):
method setLimits (line 489) | def setLimits(self, updateValue):
method setFormat (line 527) | def setFormat(self, updateValue):
method setRotation (line 565) | def setRotation(self, updateValue):
method runShutter (line 596) | def runShutter(self):
method runCalibration (line 627) | def runCalibration(self):
method drawButtons (line 716) | def drawButtons(self):
method applyFilter (line 763) | def applyFilter(self):
method convertColors (line 786) | def convertColors(self):
method convertLeptonData (line 807) | def convertLeptonData(self):
method displayText (line 821) | def displayText(self, msg, wait):
method SaveVideoFile (line 842) | def SaveVideoFile(self,image_folder,output_video):
method videoRecord (line 872) | def videoRecord(self):
method saveThermal (line 936) | def saveThermal(self):
method saveVisual (line 955) | def saveVisual(self):
method endConnection (line 1029) | def endConnection(self):
method checkExit (line 1049) | def checkExit(self):
method checkWarmup (line 1056) | def checkWarmup(self):
method tempFunc (line 1070) | def tempFunc(self, mousePos, add):
method calFunction (line 1157) | def calFunction(self, rawValue):
method getTextColor (line 1169) | def getTextColor(self):
method showSpot (line 1184) | def showSpot(self):
method drawTemperature (line 1210) | def drawTemperature(self, xpos, ypos, rawValue, minMax):
method showMinMax (line 1262) | def showMinMax(self):
method showWarmupTime (line 1313) | def showWarmupTime(self):
method showColorbar (line 1335) | def showColorbar(self):
method showTemperatures (line 1383) | def showTemperatures(self):
method displayThermalImage (line 1418) | def displayThermalImage(self):
method createThermalImage (line 1453) | def createThermalImage(self):
method extractRGB (line 1472) | def extractRGB(self, buff):
method getStream (line 1484) | def getStream(self):
method getFrameData (line 1526) | def getFrameData(self):
method getConfigData (line 1604) | def getConfigData(self):
method serialHandler (line 1674) | def serialHandler(self):
method getTempPoints (line 1742) | def getTempPoints(self):
method setRenderMode (line 1779) | def setRenderMode(self):
method getDiagnostic (line 1791) | def getDiagnostic(self):
method sendStart (line 1832) | def sendStart(self):
method connect (line 1860) | def connect(self):
method eventHandler (line 1918) | def eventHandler(self):
method setup (line 1998) | def setup(self):
method loop (line 2023) | def loop(self):
method run (line 2043) | def run(self):
Condensed preview — 250 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3,232K chars).
[
{
"path": ".github/FUNDING.yml",
"chars": 65,
"preview": "# These are supported funding model platforms\n\ngithub: maxritter\n"
},
{
"path": ".gitignore",
"chars": 60,
"preview": ".DS_Store\n__pycache__/\n*.pyc\n*.pyo\n*.pyd\n*.pyw\n*.pyz\n*.pywz\n"
},
{
"path": "LICENSE",
"chars": 35141,
"preview": " GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
},
{
"path": "README.MD",
"chars": 908,
"preview": "# DIY-Thermocam\r\n\r\n<img src=\"https://www.diy-thermocam.net/images/website/logo_text.png\" width=\"500\">\r\n\r\nThe DIY-Thermoc"
},
{
"path": "enclosure/README.MD",
"chars": 178,
"preview": "# DIY-Thermocam - Enclosure\n\nThe enclosure has been designed with Google Sketchup in 3D and converted to 2D files to las"
},
{
"path": "firmware/3.0/.gitignore",
"chars": 13,
"preview": ".pio\n.vscode\n"
},
{
"path": "firmware/3.0/include/battery.h",
"chars": 462,
"preview": "/*\n*\n* BATTERY - Measure the lithium battery status\n*\n* DIY-Thermocam Firmware\n*\n* GNU General Public License v3.0\n*\n* C"
},
{
"path": "firmware/3.0/include/bitmaps.h",
"chars": 1481,
"preview": "/*\n*\n* BITMAPS - Icons and graphics shown inside the GUI\n*\n* DIY-Thermocam Firmware\n*\n* GNU General Public License v3.0\n"
},
{
"path": "firmware/3.0/include/buttons.h",
"chars": 1375,
"preview": "/*\n*\n* Buttons - Touch buttons for the GUI\n*\n* DIY-Thermocam Firmware\n*\n* GNU General Public License v3.0\n*\n* Copyright "
},
{
"path": "firmware/3.0/include/colorschemes.h",
"chars": 1149,
"preview": "/*\n*\n* COLOR SCHEMES - Contains 19 different color schemes to display the thermal image\n*\n* DIY-Thermocam Firmware\n*\n* G"
},
{
"path": "firmware/3.0/include/connection.h",
"chars": 2539,
"preview": "/*\n*\n* CONNECTION - Communication protocol for the USB serial data transmission\n*\n* DIY-Thermocam Firmware\n*\n* GNU Gener"
},
{
"path": "firmware/3.0/include/create.h",
"chars": 952,
"preview": "/*\n*\n* CREATE - Functions to create and display the thermal frameBuffer\n*\n* DIY-Thermocam Firmware\n*\n* GNU General Publi"
},
{
"path": "firmware/3.0/include/display.h",
"chars": 4173,
"preview": "/*\n*\n* Display - ILI9341 SPI Display Module\n*\n* DIY-Thermocam Firmware\n*\n* GNU General Public License v3.0\n*\n* Copyright"
},
{
"path": "firmware/3.0/include/firststart.h",
"chars": 712,
"preview": "/*\n*\n* FIRST START - Menu that is displayed on the first device start\n*\n* DIY-Thermocam Firmware\n*\n* GNU General Public "
},
{
"path": "firmware/3.0/include/fonts.h",
"chars": 392,
"preview": "/*\n*\n* Fonts\n*\n* DIY-Thermocam Firmware\n*\n* GNU General Public License v3.0\n*\n* Copyright by Max Ritter\n*\n* http://www.d"
},
{
"path": "firmware/3.0/include/ft6206_touchscreen.h",
"chars": 1366,
"preview": "/*\n *\n * FT6206 Touch controller\n *\n * DIY-Thermocam Firmware\n *\n * GNU General Public License v3.0\n *\n * Copyright by M"
},
{
"path": "firmware/3.0/include/globaldefines.h",
"chars": 5809,
"preview": "/*\n*\n* GLOBAL DEFINES - Global defines, that are used firmware-wide\n*\n* DIY-Thermocam Firmware\n*\n* GNU General Public Li"
},
{
"path": "firmware/3.0/include/globalvariables.h",
"chars": 2261,
"preview": "/*\n*\n* GLOBAL VARIABLES - Global variable declarations, that are used firmware-wide\n*\n* DIY-Thermocam Firmware\n*\n* GNU G"
},
{
"path": "firmware/3.0/include/gui.h",
"chars": 686,
"preview": "/*\n*\n* GUI - Main Methods to lcd the Graphical-User-Interface\n*\n* DIY-Thermocam Firmware\n*\n* GNU General Public License "
},
{
"path": "firmware/3.0/include/hardware.h",
"chars": 1202,
"preview": "/*\n*\n* HARDWARE - Main hardware functions\n*\n* DIY-Thermocam Firmware\n*\n* GNU General Public License v3.0\n*\n* Copyright b"
},
{
"path": "firmware/3.0/include/lepton.h",
"chars": 1102,
"preview": "/*\n*\n* LEPTON - Access the FLIR Lepton LWIR module\n*\n* DIY-Thermocam Firmware\n*\n* GNU General Public License v3.0\n*\n* Co"
},
{
"path": "firmware/3.0/include/livemode.h",
"chars": 568,
"preview": "/*\n*\n* LIVE MODE - GUI functions used in the live mode\n*\n* DIY-Thermocam Firmware\n*\n* GNU General Public License v3.0\n*\n"
},
{
"path": "firmware/3.0/include/load.h",
"chars": 1292,
"preview": "/*\n*\n* LOAD - Load images and videos from the internal storage\n*\n* DIY-Thermocam Firmware\n*\n* GNU General Public License"
},
{
"path": "firmware/3.0/include/loadmenu.h",
"chars": 821,
"preview": "/*\n*\n* LOAD MENU - Display the menu to load images and videos\n*\n* DIY-Thermocam Firmware\n*\n* GNU General Public License "
},
{
"path": "firmware/3.0/include/mainmenu.h",
"chars": 1203,
"preview": "/*\n*\n* MAIN MENU - Display the main menu with icons\n*\n* DIY-Thermocam Firmware\n*\n* GNU General Public License v3.0\n*\n* C"
},
{
"path": "firmware/3.0/include/massstorage.h",
"chars": 509,
"preview": "/*\n*\n* MASS STORAGE - Mass storage mode to connect the internal storage to the PC\n*\n* DIY-Thermocam Firmware\n*\n* GNU Ge"
},
{
"path": "firmware/3.0/include/save.h",
"chars": 730,
"preview": "/*\n*\n* SAVE - Save images and videos to the internal storage\n*\n* DIY-Thermocam Firmware\n*\n* GNU General Public License v"
},
{
"path": "firmware/3.0/include/sdcard.h",
"chars": 838,
"preview": "/*\n*\n* SD Card - Methods to access the internal SD storage\n*\n* DIY-Thermocam Firmware\n*\n* GNU General Public License v3."
},
{
"path": "firmware/3.0/include/settingsmenu.h",
"chars": 1167,
"preview": "/*\n*\n* SETTINGS MENU - Adjust different on-device settings\n*\n* DIY-Thermocam Firmware\n*\n* GNU General Public License v3."
},
{
"path": "firmware/3.0/include/temperature.h",
"chars": 613,
"preview": "/*\n*\n* TEMPERATURE - Functions to convert Lepton raw values to absolute temperatures and back\n*\n* DIY-Thermocam Firmware"
},
{
"path": "firmware/3.0/include/thermal.h",
"chars": 604,
"preview": "/*\n*\n* THERMAL - Main functions in the live mode\n*\n* DIY-Thermocam Firmware\n*\n* GNU General Public License v3.0\n*\n* Copy"
},
{
"path": "firmware/3.0/include/touchscreen.h",
"chars": 934,
"preview": "/*\n*\n* Touchscreen - FT6206 or XPT2046 controller\n*\n* DIY-Thermocam Firmware\n*\n* GNU General Public License v3.0\n*\n* Cop"
},
{
"path": "firmware/3.0/include/videomenu.h",
"chars": 765,
"preview": "/*\n*\n* VIDEO MENU - Record single frames or time interval videos\n*\n* DIY-Thermocam Firmware\n*\n* GNU General Public Licen"
},
{
"path": "firmware/3.0/include/xpt2046_touchscreen.h",
"chars": 759,
"preview": "/*\n *\n * FT6206 Touch controller\n *\n * DIY-Thermocam Firmware\n *\n * GNU General Public License v3.0\n *\n * Copyright by M"
},
{
"path": "firmware/3.0/lib/ADC/ADC.cpp",
"chars": 42003,
"preview": "/* Teensy 4.x, 3.x, LC ADC library\n * https://github.com/pedvide/ADC\n * Copyright (c) 2020 Pedro Villanueva\n *\n * Permis"
},
{
"path": "firmware/3.0/lib/ADC/ADC.h",
"chars": 25409,
"preview": "/* Teensy 4.x, 3.x, LC ADC library\n * https://github.com/pedvide/ADC\n * Copyright (c) 2020 Pedro Villanueva\n *\n * Permis"
},
{
"path": "firmware/3.0/lib/ADC/ADC_Module.cpp",
"chars": 53306,
"preview": "/* Teensy 4.x, 3.x, LC ADC library\n * https://github.com/pedvide/ADC\n * Copyright (c) 2020 Pedro Villanueva\n *\n * Permis"
},
{
"path": "firmware/3.0/lib/ADC/ADC_Module.h",
"chars": 26724,
"preview": "/* Teensy 4.x, 3.x, LC ADC library\n * https://github.com/pedvide/ADC\n * Copyright (c) 2020 Pedro Villanueva\n *\n * Permis"
},
{
"path": "firmware/3.0/lib/ADC/ADC_util.h",
"chars": 7467,
"preview": "/* Teensy 4.x, 3.x, LC ADC library\n * https://github.com/pedvide/ADC\n * Copyright (c) 2020 Pedro Villanueva\n *\n * Permis"
},
{
"path": "firmware/3.0/lib/ADC/AnalogBufferDMA.cpp",
"chars": 10703,
"preview": "/* Teensy 3.x, LC, 4.0 ADC library\n https://github.com/pedvide/ADC\n Copyright (c) 2020 Pedro Villanueva\n\n Permissi"
},
{
"path": "firmware/3.0/lib/ADC/AnalogBufferDMA.h",
"chars": 3221,
"preview": "/* Teensy 3.x, LC, 4.0 ADC library\n * https://github.com/pedvide/ADC\n * Copyright (c) 2020 Pedro Villanueva\n *\n * Permis"
},
{
"path": "firmware/3.0/lib/ADC/VREF.h",
"chars": 5026,
"preview": "/* Teensy 4.x, 3.x, LC ADC library\n * https://github.com/pedvide/ADC\n * Copyright (c) 2020 Pedro Villanueva\n *\n * Permis"
},
{
"path": "firmware/3.0/lib/ADC/atomic.h",
"chars": 9284,
"preview": "/* Teensy 4.x, 3.x, LC ADC library\n * https://github.com/pedvide/ADC\n * Copyright (c) 2020 Pedro Villanueva\n *\n * Permis"
},
{
"path": "firmware/3.0/lib/ADC/settings_defines.h",
"chars": 26719,
"preview": "/* Teensy 4.x, 3.x, LC ADC library\n * https://github.com/pedvide/ADC\n * Copyright (c) 2020 Pedro Villanueva\n *\n * Permis"
},
{
"path": "firmware/3.0/lib/Bounce/Bounce.cpp",
"chars": 1786,
"preview": "\r\n// Please read Bounce.h for information about the liscence and authors\r\n\r\n#include <Arduino.h>\r\n#include \"Bounce.h\"\r\n\r"
},
{
"path": "firmware/3.0/lib/Bounce/Bounce.h",
"chars": 2324,
"preview": "\n/*\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU G"
},
{
"path": "firmware/3.0/lib/EEPROM/EEPROM.cpp",
"chars": 28,
"preview": "// this file no longer used\n"
},
{
"path": "firmware/3.0/lib/EEPROM/EEPROM.h",
"chars": 7502,
"preview": "/*\n EEPROM.h - EEPROM library\n Original Copyright (c) 2006 David A. Mellis. All right reserved.\n New version by Chri"
},
{
"path": "firmware/3.0/lib/LittleFS/LittleFS.cpp",
"chars": 34640,
"preview": "/* LittleFS for Teensy\n * Copyright (c) 2020, Paul Stoffregen, paul@pjrc.com\n *\n * Permission is hereby granted, free of"
},
{
"path": "firmware/3.0/lib/LittleFS/LittleFS.h",
"chars": 27102,
"preview": "/* LittleFS for Teensy\n * Copyright (c) 2020, Paul Stoffregen, paul@pjrc.com\n *\n * Permission is hereby granted, free of"
},
{
"path": "firmware/3.0/lib/LittleFS/LittleFS_NAND.cpp",
"chars": 43914,
"preview": "/* LittleFS for Teensy\n * Copyright (c) 2020, Paul Stoffregen, paul@pjrc.com\n *\n * Permission is hereby granted, free of"
},
{
"path": "firmware/3.0/lib/LittleFS/littlefs/DESIGN.md",
"chars": 96231,
"preview": "## The design of littlefs\n\nA little fail-safe filesystem designed for microcontrollers.\n\n```\n | | | .---._____\n ."
},
{
"path": "firmware/3.0/lib/LittleFS/littlefs/LICENSE.md",
"chars": 1479,
"preview": "Copyright (c) 2017, Arm Limited. All rights reserved.\n\nRedistribution and use in source and binary forms, with or withou"
},
{
"path": "firmware/3.0/lib/LittleFS/littlefs/README.md",
"chars": 10265,
"preview": "## littlefs\n\nA little fail-safe filesystem designed for microcontrollers.\n\n```\n | | | .---._____\n .-----. | "
},
{
"path": "firmware/3.0/lib/LittleFS/littlefs/SPEC.md",
"chars": 30716,
"preview": "## littlefs technical specification\n\nThis is the technical specification of the little filesystem. This document\ncovers "
},
{
"path": "firmware/3.0/lib/LittleFS/littlefs/lfs.c",
"chars": 160700,
"preview": "/*\n * The little filesystem\n *\n * Copyright (c) 2017, Arm Limited. All rights reserved.\n * SPDX-License-Identifier: BSD-"
},
{
"path": "firmware/3.0/lib/LittleFS/littlefs/lfs.h",
"chars": 23122,
"preview": "/*\n * The little filesystem\n *\n * Copyright (c) 2017, Arm Limited. All rights reserved.\n * SPDX-License-Identifier: BSD-"
},
{
"path": "firmware/3.0/lib/LittleFS/littlefs/lfs_util.c",
"chars": 862,
"preview": "/*\n * lfs util functions\n *\n * Copyright (c) 2017, Arm Limited. All rights reserved.\n * SPDX-License-Identifier: BSD-3-C"
},
{
"path": "firmware/3.0/lib/LittleFS/littlefs/lfs_util.h",
"chars": 7370,
"preview": "/*\n * lfs utility functions\n *\n * Copyright (c) 2017, Arm Limited. All rights reserved.\n * SPDX-License-Identifier: BSD-"
},
{
"path": "firmware/3.0/lib/MTP/MTP.cpp",
"chars": 52264,
"preview": "// MTP.cpp - Teensy MTP Responder library\n// Copyright (C) 2017 Fredrik Hubinette <hubbe@hubbe.net>\n//\n// With updates f"
},
{
"path": "firmware/3.0/lib/MTP/MTP.h",
"chars": 5167,
"preview": "// MTP.h - Teensy MTP Responder library\n// Copyright (C) 2017 Fredrik Hubinette <hubbe@hubbe.net>\n//\n// With updates fro"
},
{
"path": "firmware/3.0/lib/MTP/Storage.cpp",
"chars": 20283,
"preview": "// Storage.cpp - Teensy MTP Responder library\n// Copyright (C) 2017 Fredrik Hubinette <hubbe@hubbe.net>\n//\n// With updat"
},
{
"path": "firmware/3.0/lib/MTP/Storage.h",
"chars": 7469,
"preview": "// Storage.h - Teensy MTP Responder library\n// Copyright (C) 2017 Fredrik Hubinette <hubbe@hubbe.net>\n//\n// With updates"
},
{
"path": "firmware/3.0/lib/Metro/Metro.cpp",
"chars": 1659,
"preview": "\n#if defined(ARDUINO) && ARDUINO >= 100\n#include \"Arduino.h\"\n#else\n#include \"WProgram.h\"\n#endif\n#include \"Metro.h\"\n\n\nvoi"
},
{
"path": "firmware/3.0/lib/Metro/Metro.h",
"chars": 367,
"preview": "\n\n#ifndef Metro_h\n#define Metro_h\n\n#include <inttypes.h>\n\nclass Metro\n{\n\npublic:\n void begin(unsigned long interval_mil"
},
{
"path": "firmware/3.0/lib/SD/library.properties",
"chars": 468,
"preview": "name=SD\nversion=2.0.0\nauthor=Paul Stoffregen\nmaintainer=Paul Stoffregen\nsentence=Arduino SD compatibility layer for SdFa"
},
{
"path": "firmware/3.0/lib/SD/src/SD.cpp",
"chars": 5758,
"preview": "/* SD library compatibility wrapper for use of SdFat on Teensy\n * Copyright (c) 2020, Paul Stoffregen, paul@pjrc.com\n *\n"
},
{
"path": "firmware/3.0/lib/SD/src/SD.h",
"chars": 8497,
"preview": "/* SD library compatibility wrapper for use of SdFat on Teensy\n * Copyright (c) 2020, Paul Stoffregen, paul@pjrc.com\n *\n"
},
{
"path": "firmware/3.0/lib/SPI/SPI.cpp",
"chars": 60472,
"preview": "/*\n * Copyright (c) 2010 by Cristian Maglie <c.maglie@bug.st>\n * SPI Master library for arduino.\n *\n * This file is free"
},
{
"path": "firmware/3.0/lib/SPI/SPI.h",
"chars": 49024,
"preview": "/*\n * Copyright (c) 2010 by Cristian Maglie <c.maglie@bug.st>\n * Copyright (c) 2014 by Paul Stoffregen <paul@pjrc.com> ("
},
{
"path": "firmware/3.0/lib/SdFat/src/BufferedPrint.h",
"chars": 8321,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/DigitalIO/DigitalPin.h",
"chars": 12569,
"preview": "/* Arduino DigitalIO Library\n * Copyright (C) 2013 by William Greiman\n *\n * This file is part of the Arduino DigitalIO L"
},
{
"path": "firmware/3.0/lib/SdFat/src/DigitalIO/SoftSPI.h",
"chars": 5339,
"preview": "/* Arduino DigitalIO Library\n * Copyright (C) 2013 by William Greiman\n *\n * This file is part of the Arduino DigitalIO L"
},
{
"path": "firmware/3.0/lib/SdFat/src/DigitalIO/boards/AvrDevelopersGpioPinMap.h",
"chars": 972,
"preview": "#ifndef AvrDevelopersGpioPinMap_h\n#define AvrDevelopersGpioPinMap_h\nstatic const GpioPinMap_t GpioPinMap[] = {\n GPIO_PI"
},
{
"path": "firmware/3.0/lib/SdFat/src/DigitalIO/boards/BobuinoGpioPinMap.h",
"chars": 954,
"preview": "#ifndef BobuinoGpioPinMap_h\n#define BobuinoGpioPinMap_h\nstatic const GpioPinMap_t GpioPinMap[] = {\n GPIO_PIN(B, 0), //"
},
{
"path": "firmware/3.0/lib/SdFat/src/DigitalIO/boards/GpioPinMap.h",
"chars": 2164,
"preview": "/* Arduino DigitalIO Library\n * Copyright (C) 2013 by William Greiman\n *\n * This file is part of the Arduino DigitalIO L"
},
{
"path": "firmware/3.0/lib/SdFat/src/DigitalIO/boards/LeonardoGpioPinMap.h",
"chars": 906,
"preview": "#ifndef LeonardoGpioPinMap_h\n#define LeonardoGpioPinMap_h\nstatic const GpioPinMap_t GpioPinMap[] = {\n GPIO_PIN(D, 2), "
},
{
"path": "firmware/3.0/lib/SdFat/src/DigitalIO/boards/MegaGpioPinMap.h",
"chars": 1934,
"preview": "#ifndef MegaGpioPinMap_h\n#define MegaGpioPinMap_h\nstatic const GpioPinMap_t GpioPinMap[] = {\n GPIO_PIN(E, 0), // D0\n "
},
{
"path": "firmware/3.0/lib/SdFat/src/DigitalIO/boards/SleepingBeautyGpioPinMap.h",
"chars": 975,
"preview": "#ifndef SleepingBeautyGpioPinMap_h\n#define SleepingBeautyGpioPinMap_h\nstatic const GpioPinMap_t GpioPinMap[] = {\n GPIO_"
},
{
"path": "firmware/3.0/lib/SdFat/src/DigitalIO/boards/Standard1284GpioPinMap.h",
"chars": 969,
"preview": "#ifndef Standard1284GpioPinMap_h\n#define Standard1284GpioPinMap_h\nstatic const GpioPinMap_t GpioPinMap[] = {\n GPIO_PIN("
},
{
"path": "firmware/3.0/lib/SdFat/src/DigitalIO/boards/Teensy2GpioPinMap.h",
"chars": 773,
"preview": "#ifndef Teensy2GpioPinMap_h\n#define Teensy2GpioPinMap_h\nstatic const GpioPinMap_t GpioPinMap[] = {\n GPIO_PIN(B, 0), //"
},
{
"path": "firmware/3.0/lib/SdFat/src/DigitalIO/boards/Teensy2ppGpioPinMap.h",
"chars": 1325,
"preview": "#ifndef Teensypp2GpioPinMap_h\n#define Teensypp2GpioPinMap_h\nstatic const GpioPinMap_t GpioPinMap[] = {\n GPIO_PIN(D, 0),"
},
{
"path": "firmware/3.0/lib/SdFat/src/DigitalIO/boards/UnoGpioPinMap.h",
"chars": 630,
"preview": "#ifndef UnoGpioPinMap_h\n#define UnoGpioPinMap_h\nstatic const GpioPinMap_t GpioPinMap[] = {\n GPIO_PIN(D, 0), // D0\n GP"
},
{
"path": "firmware/3.0/lib/SdFat/src/DigitalIO/readme.txt",
"chars": 80,
"preview": "Selected files from the DigitalIO library.\n\nhttps://github.com/greiman/DigitalIO"
},
{
"path": "firmware/3.0/lib/SdFat/src/ExFatLib/ExFatConfig.h",
"chars": 1377,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/ExFatLib/ExFatDbg.cpp",
"chars": 19828,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/ExFatLib/ExFatFile.cpp",
"chars": 19423,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/ExFatLib/ExFatFile.h",
"chars": 28492,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/ExFatLib/ExFatFilePrint.cpp",
"chars": 5986,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/ExFatLib/ExFatFileWrite.cpp",
"chars": 19576,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/ExFatLib/ExFatFormatter.cpp",
"chars": 11487,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/ExFatLib/ExFatFormatter.h",
"chars": 2024,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/ExFatLib/ExFatLib.h",
"chars": 1317,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/ExFatLib/ExFatName.cpp",
"chars": 5585,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/ExFatLib/ExFatPartition.cpp",
"chars": 11104,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/ExFatLib/ExFatPartition.h",
"chars": 9182,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/ExFatLib/ExFatVolume.cpp",
"chars": 1678,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/ExFatLib/ExFatVolume.h",
"chars": 10599,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/ExFatLib/upcase.cpp",
"chars": 28,
"preview": "// this file no longer used\n"
},
{
"path": "firmware/3.0/lib/SdFat/src/FatLib/FatDbg.cpp",
"chars": 7943,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/FatLib/FatFile.cpp",
"chars": 38385,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/FatLib/FatFile.h",
"chars": 36824,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/FatLib/FatFileLFN.cpp",
"chars": 15843,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/FatLib/FatFilePrint.cpp",
"chars": 3339,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/FatLib/FatFileSFN.cpp",
"chars": 8511,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/FatLib/FatFormatter.cpp",
"chars": 10618,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/FatLib/FatFormatter.h",
"chars": 2243,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/FatLib/FatLib.h",
"chars": 1307,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/FatLib/FatName.cpp",
"chars": 8643,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/FatLib/FatPartition.cpp",
"chars": 17660,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/FatLib/FatPartition.h",
"chars": 11146,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/FatLib/FatVolume.cpp",
"chars": 1667,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/FatLib/FatVolume.h",
"chars": 11105,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/FreeStack.cpp",
"chars": 2754,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/FreeStack.h",
"chars": 3145,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/FsLib/FsFile.cpp",
"chars": 6090,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/FsLib/FsFile.h",
"chars": 28369,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/FsLib/FsFormatter.h",
"chars": 2046,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/FsLib/FsLib.h",
"chars": 1369,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/FsLib/FsNew.cpp",
"chars": 1304,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/FsLib/FsNew.h",
"chars": 1838,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/FsLib/FsVolume.cpp",
"chars": 11641,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/FsLib/FsVolume.h",
"chars": 13011,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/MinimumSerial.cpp",
"chars": 2945,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/MinimumSerial.h",
"chars": 2235,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/RingBuf.h",
"chars": 10813,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/SdCard/CPPLINT.cfg",
"chars": 26,
"preview": "exclude_files=SdioTeensy.h"
},
{
"path": "firmware/3.0/lib/SdFat/src/SdCard/SdCard.h",
"chars": 2547,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/SdCard/SdCardInfo.cpp",
"chars": 1901,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/SdCard/SdCardInfo.h",
"chars": 17905,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/SdCard/SdCardInterface.h",
"chars": 4051,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/SdCard/SdSpiCard.cpp",
"chars": 22548,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/SdCard/SdSpiCard.h",
"chars": 15564,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/SdCard/SdioCard.h",
"chars": 8661,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/SdCard/SdioTeensy.cpp",
"chars": 38064,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/SdCard/SdioTeensy.h",
"chars": 22447,
"preview": "#ifndef SdioTeensy_h\n#define SdioTeensy_h\n\n// From Paul's SD.h driver.\n\n#if defined(__IMXRT1062__)\n#define MAKE_REG_MASK"
},
{
"path": "firmware/3.0/lib/SdFat/src/SdFat.h",
"chars": 17932,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/SdFatConfig.h",
"chars": 15698,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/SpiDriver/SdSpiArduinoDriver.h",
"chars": 3182,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/SpiDriver/SdSpiArtemis.cpp",
"chars": 3278,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/SpiDriver/SdSpiAvr.h",
"chars": 4046,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/SpiDriver/SdSpiBareUnoDriver.h",
"chars": 5160,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/SpiDriver/SdSpiBaseClass.h",
"chars": 2582,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/SpiDriver/SdSpiChipSelect.cpp",
"chars": 2018,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/SpiDriver/SdSpiDriver.h",
"chars": 5280,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/SpiDriver/SdSpiDue.cpp",
"chars": 8068,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/SpiDriver/SdSpiESP.cpp",
"chars": 3713,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/SpiDriver/SdSpiLibDriver.h",
"chars": 3450,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/SpiDriver/SdSpiParticle.cpp",
"chars": 3249,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/SpiDriver/SdSpiSTM32.cpp",
"chars": 3268,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/SpiDriver/SdSpiSTM32Core.cpp",
"chars": 3144,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/SpiDriver/SdSpiSoftDriver.h",
"chars": 3510,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/SpiDriver/SdSpiTeensy3.cpp",
"chars": 3551,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/common/ArduinoFiles.h",
"chars": 5107,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/common/CPPLINT.cfg",
"chars": 86,
"preview": "exclude_files=PrintBasic.cpp\nexclude_files=PrintBasic.h\nexclude_files=PrintTemplates.h"
},
{
"path": "firmware/3.0/lib/SdFat/src/common/CompileDateTime.h",
"chars": 2960,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/common/DebugMacros.h",
"chars": 2482,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/common/FmtNumber.cpp",
"chars": 13826,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/common/FmtNumber.h",
"chars": 1867,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/common/FsApiConstants.h",
"chars": 3034,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/common/FsBlockDevice.h",
"chars": 1444,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/common/FsBlockDeviceInterface.h",
"chars": 4667,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/common/FsCache.cpp",
"chars": 2426,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/common/FsCache.h",
"chars": 6153,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/common/FsDateTime.cpp",
"chars": 6189,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/common/FsDateTime.h",
"chars": 6784,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/common/FsName.cpp",
"chars": 1734,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/common/FsName.h",
"chars": 2154,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/common/FsStructs.cpp",
"chars": 2207,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/common/FsStructs.h",
"chars": 14239,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/common/FsUtf.cpp",
"chars": 3757,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/common/FsUtf.h",
"chars": 4143,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/common/PrintBasic.cpp",
"chars": 2626,
"preview": "/**\n * Copyright (c) 2011-2020 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/common/PrintBasic.h",
"chars": 4792,
"preview": "/**\n * Copyright (c) 2011-2020 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/common/SysCall.h",
"chars": 2267,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/common/upcase.cpp",
"chars": 6159,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/common/upcase.h",
"chars": 1373,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/iostream/ArduinoStream.h",
"chars": 3673,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/iostream/StdioStream.cpp",
"chars": 10923,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/iostream/StdioStream.h",
"chars": 23823,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/iostream/StreamBaseClass.cpp",
"chars": 4117,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/iostream/bufstream.h",
"chars": 4181,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/iostream/fstream.h",
"chars": 8635,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/iostream/ios.h",
"chars": 12712,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/iostream/iostream.h",
"chars": 4159,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/iostream/istream.cpp",
"chars": 8976,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/iostream/istream.h",
"chars": 11084,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/iostream/ostream.cpp",
"chars": 4466,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/iostream/ostream.h",
"chars": 8987,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/SdFat/src/sdios.h",
"chars": 1407,
"preview": "/**\n * Copyright (c) 2011-2021 Bill Greiman\n * This file is part of the SdFat library for SD memory cards.\n *\n * MIT Lic"
},
{
"path": "firmware/3.0/lib/Time/DateStrings.cpp",
"chars": 3168,
"preview": "/* DateStrings.cpp\n * Definitions for date strings for use with the Time library\n *\n * Updated for Arduino 1.5.7 18 July"
},
{
"path": "firmware/3.0/lib/Time/Time.cpp",
"chars": 8790,
"preview": "/*\n time.c - low level time and date functions\n Copyright (c) Michael Margolis 2009-2014\n\n This library is free softw"
},
{
"path": "firmware/3.0/lib/Time/Time.h",
"chars": 21,
"preview": "#include \"TimeLib.h\"\n"
},
{
"path": "firmware/3.0/lib/Time/TimeLib.h",
"chars": 6598,
"preview": "/*\n time.h - low level time and date functions\n*/\n\n/*\n July 3 2011 - fixed elapsedSecsThisWeek macro (thanks Vincent V"
},
{
"path": "firmware/3.0/lib/Time/library.properties",
"chars": 406,
"preview": "name=Time\nversion=1.6.1\nauthor=Michael Margolis\nmaintainer=Paul Stoffregen\nsentence=Timekeeping functionality for Arduin"
},
{
"path": "firmware/3.0/lib/Wire/Wire.cpp",
"chars": 7516,
"preview": "/*\n TwoWire.cpp - TWI/I2C library for Wiring & Arduino\n Copyright (c) 2006 Nicholas Zambetti. All right reserved.\n\n "
},
{
"path": "firmware/3.0/lib/Wire/Wire.h",
"chars": 4076,
"preview": "/*\n TwoWire.h - TWI/I2C library for Arduino & Wiring\n Copyright (c) 2006 Nicholas Zambetti. All right reserved.\n\n Th"
},
{
"path": "firmware/3.0/lib/Wire/WireIMXRT.cpp",
"chars": 15160,
"preview": "\n#include \"Wire.h\"\n\n\n#if defined(__IMXRT1062__)\n\n//#include \"debug/printf.h\"\n\n#define PINCONFIG (IOMUXC_PAD_ODE | IOMUXC"
},
{
"path": "firmware/3.0/lib/Wire/WireIMXRT.h",
"chars": 10398,
"preview": "/* Wire Library for Teensy LC & 3.X\n * Copyright (c) 2014-2017, Paul Stoffregen, paul@pjrc.com\n *\n * Development of this"
},
{
"path": "firmware/3.0/lib/Wire/WireKinetis.cpp",
"chars": 25965,
"preview": "/* Wire Library for Teensy LC & 3.X\n * Copyright (c) 2014-2017, Paul Stoffregen, paul@pjrc.com\n *\n * Development of this"
}
]
// ... and 50 more files (download for full content)
About this extraction
This page contains the full source code of the maxritter/diy-thermocam GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 250 files (2.9 MB), approximately 772.3k tokens, and a symbol index with 1490 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.