diff --git a/.gitattributes b/.gitattributes index dfe07704..0ffeae3f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,2 @@ # Auto detect text files and perform LF normalization -* text=auto +* text=auto eol=lf \ No newline at end of file diff --git a/.github/BOM_TEMPLATES/bom_template_purchase.csv b/.github/BOM_TEMPLATES/bom_template_purchase.csv deleted file mode 100644 index 5d2344cc..00000000 --- a/.github/BOM_TEMPLATES/bom_template_purchase.csv +++ /dev/null @@ -1,2 +0,0 @@ -Part,Description,Quantity,Supplier,Supplier Part Number,Unit Cost (CAD),Reference -E.g. Foam Board,"2"" Polypropylene",6,Home Depot,142-978D,12.64,www.homedepot.ca/foam-board \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..f1306b15 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "software/microcontroller/lib/I2CIP"] + path = software/microcontroller/lib/I2CIP + url = https://github.com/PeaPodTechnologies/I2CIP diff --git a/builds/README.md b/builds/README.md new file mode 100644 index 00000000..0e93be5f --- /dev/null +++ b/builds/README.md @@ -0,0 +1,11 @@ +# PeaPod Builds + +All builds, each representing an implementation-specific formulation of the PeaPod framework, per-unit. + +## Folder Structure + +All builds will follow the same folder structure: + +- `assets/` - various graphical/etc. assets (diagrams, etc. excluding pictures of schematics/PCB layouts) +- `docs/` - build-specific documentation (user manuals, build guides, quick-start, product briefs, etc.) +- `hardware/` - compiled BoMs, including fabrication (3D printing, PCB w/ gerber, etc.) and purchase (DigiKey, McMaster-Carr, etc.) diff --git a/builds/microgreens/README.md b/builds/microgreens/README.md new file mode 100644 index 00000000..359523cf --- /dev/null +++ b/builds/microgreens/README.md @@ -0,0 +1,37 @@ +# PeaPod for Microgreens + +PeaPod for Microgreens is an implementation-specific formulation of the PeaPod framework, designed to repeatably grow high-quality microgreens at minimal operating cost. This repository contains all the necessary information to build and operate the PeaPod for Microgreens. + +# Cost Breakdown + +> Production & Revenue Estimate (Per Unit, 3 Trays, 1 Week Cycle): 2 lbs. (>$40) + +## Materials + +> Aeroponic Supply System can provide water for up to 4 trays + + - Microgreen Tray: $400 ea. + - Aeroponic Supply System: $400 + - Lighting System: $100 ea. + - Power & Control: $100 + - Housing: $200 + +Total: $1200 + +Break-Even: 30 Weeks + +## Labor + + - Design & Fabrication Fees + - Manufacturing Labor + - Assembly Labor + - Delivery & Installation Labor + - Setup & Training Fees + +## Operating Costs + + - Electricity + - Water + - Fertilizer (optional) + - Seeds + - Operating Labor \ No newline at end of file diff --git a/builds/microgreens/docs/.gitignore b/builds/microgreens/docs/.gitignore new file mode 100644 index 00000000..d2972f0e --- /dev/null +++ b/builds/microgreens/docs/.gitignore @@ -0,0 +1,284 @@ +## Core latex/pdflatex auxiliary files: +*.aux +*.lof +*.log +*.lot +*.fls +*.out +*.toc +*.fmt +*.fot +*.cb +*.cb2 +.*.lb + +## Intermediate documents: +*.dvi +*.xdv +*-converted-to.* +# these rules might exclude image files for figures etc. +# *.ps +# *.eps +# *.pdf + +## Generated if empty string is given at "Please type another file name for output:" +.pdf + +## Bibliography auxiliary files (bibtex/biblatex/biber): +*.bbl +*.bcf +*.blg +*-blx.aux +*-blx.bib +*.run.xml + +## Build tool auxiliary files: +*.fdb_latexmk +*.synctex +*.synctex(busy) +*.synctex.gz +*.synctex.gz(busy) +*.pdfsync + +## Build tool directories for auxiliary files +# latexrun +latex.out/ + +## Auxiliary and intermediate files from other packages: +# algorithms +*.alg +*.loa + +# achemso +acs-*.bib + +# amsthm +*.thm + +# beamer +*.nav +*.pre +*.snm +*.vrb + +# changes +*.soc + +# comment +*.cut + +# cprotect +*.cpt + +# elsarticle (documentclass of Elsevier journals) +*.spl + +# endnotes +*.ent + +# fixme +*.lox + +# feynmf/feynmp +*.mf +*.mp +*.t[1-9] +*.t[1-9][0-9] +*.tfm + +#(r)(e)ledmac/(r)(e)ledpar +*.end +*.?end +*.[1-9] +*.[1-9][0-9] +*.[1-9][0-9][0-9] +*.[1-9]R +*.[1-9][0-9]R +*.[1-9][0-9][0-9]R +*.eledsec[1-9] +*.eledsec[1-9]R +*.eledsec[1-9][0-9] +*.eledsec[1-9][0-9]R +*.eledsec[1-9][0-9][0-9] +*.eledsec[1-9][0-9][0-9]R + +# glossaries +*.acn +*.acr +*.glg +*.glo +*.gls +*.glsdefs +*.lzo +*.lzs + +# uncomment this for glossaries-extra (will ignore makeindex's style files!) +# *.ist + +# gnuplottex +*-gnuplottex-* + +# gregoriotex +*.gaux +*.gtex + +# htlatex +*.4ct +*.4tc +*.idv +*.lg +*.trc +*.xref + +# hyperref +*.brf + +# knitr +*-concordance.tex +# TODO Uncomment the next line if you use knitr and want to ignore its generated tikz files +# *.tikz +*-tikzDictionary + +# listings +*.lol + +# luatexja-ruby +*.ltjruby + +# makeidx +*.idx +*.ilg +*.ind + +# minitoc +*.maf +*.mlf +*.mlt +*.mtc[0-9]* +*.slf[0-9]* +*.slt[0-9]* +*.stc[0-9]* + +# minted +_minted* +*.pyg + +# morewrites +*.mw + +# nomencl +*.nlg +*.nlo +*.nls + +# pax +*.pax + +# pdfpcnotes +*.pdfpc + +# sagetex +*.sagetex.sage +*.sagetex.py +*.sagetex.scmd + +# scrwfile +*.wrt + +# sympy +*.sout +*.sympy +sympy-plots-for-*.tex/ + +# pdfcomment +*.upa +*.upb + +# pythontex +*.pytxcode +pythontex-files-*/ + +# tcolorbox +*.listing + +# thmtools +*.loe + +# TikZ & PGF +*.dpth +*.md5 +*.auxlock + +# todonotes +*.tdo + +# vhistory +*.hst +*.ver + +# easy-todo +*.lod + +# xcolor +*.xcp + +# xmpincl +*.xmpi + +# xindy +*.xdy + +# xypic precompiled matrices and outlines +*.xyc +*.xyd + +# endfloat +*.ttt +*.fff + +# Latexian +TSWLatexianTemp* + +## Editors: +# WinEdt +*.bak +*.sav + +# Texpad +.texpadtmp + +# LyX +*.lyx~ + +# Kile +*.backup + +# gummi +.*.swp + +# KBibTeX +*~[0-9]* + +# TeXnicCenter +*.tps + +# auto folder when using emacs and auctex +./auto/* +*.el + +# expex forward references with \gathertags +*-tags.tex + +# standalone packages +*.sta + +# Makeindex log files +*.lpz + +# xwatermark package +*.xwm + +# REVTeX puts footnotes in the bibliography by default, unless the nofootinbib +# option is specified. Footnotes are the stored in a file with suffix Notes.bib. +# Uncomment the next line to have this generated file ignored. +#*Notes.bib \ No newline at end of file diff --git a/builds/microgreens/docs/productsheet/ProductSheet.tex b/builds/microgreens/docs/productsheet/ProductSheet.tex new file mode 100644 index 00000000..35aec316 --- /dev/null +++ b/builds/microgreens/docs/productsheet/ProductSheet.tex @@ -0,0 +1,62 @@ +\documentclass{../../../docs/tex/report} +\usepackage{setspace} % Setting line spacing +\usepackage{ulem} % Underline +\usepackage{caption} % Captioning figures +\usepackage{subcaption} % Subfigures +\usepackage{geometry} % Page layout +\usepackage{multicol} % Columned pages +\usepackage{array,etoolbox} +\usepackage{fancyhdr} +\usepackage{enumitem} +\usepackage[toc,page]{appendix} +\setlist{noitemsep} + +% Page layout (margins, size, line spacing) +\geometry{letterpaper, left=1in, right=1in, bottom=1in, top=1in} +\setstretch{1} + +% Headers +\pagestyle{fancy} +\lhead{PeaPod for Microgreens} +\rhead{PeaPod Technologies Inc.} + +\begin{document} + +\begin{titlepage} + \begin{center} + \vspace*{1.2cm} + + \textbf{\large{PeaPod for Microgreens - Product Sheet}} + + \vspace{0.5cm} + + Low-Cost Modular High-Quality Microgreens Production System + + \vfill + \input{../../../docs/tex/documentation/Namecard.tex} + \vspace{1.25cm} + + Revision 0.1\\ + PeaPod Technologies Inc.\\ + March 31st, 2024 + + \end{center} +\end{titlepage} + +\thispagestyle{plain} + +\tableofcontents +\clearpage + +\section{Product Overview} + +\subsection{Introduction} + +PeaPod for Microgreens is a custom aeroponic plant growth unit optimized for growing high-quality microgreens at minimal operating cost. The system is designed to be turn-key and easy to use, from germination to harvest. Full-stack automation and control systems ensure repeatability and reliability, enabling business owners to make surefire return on investment, making this product ideal for in-house restaurant production and small-scale commercial growing. + +\clearpage + +% References +\bibliographystyle{IEEEtran} +\bibliography{references} +\end{document} \ No newline at end of file diff --git a/builds/microgreens/docs/requirements/Requirements.pdf b/builds/microgreens/docs/requirements/Requirements.pdf new file mode 100644 index 00000000..81ad9f7c Binary files /dev/null and b/builds/microgreens/docs/requirements/Requirements.pdf differ diff --git a/builds/microgreens/docs/requirements/Requirements.tex b/builds/microgreens/docs/requirements/Requirements.tex new file mode 100644 index 00000000..8bd92c37 --- /dev/null +++ b/builds/microgreens/docs/requirements/Requirements.tex @@ -0,0 +1,210 @@ +\documentclass{../../../../docs/tex/report} +\usepackage{setspace} % Setting line spacing +\usepackage{ulem} % Underline +\usepackage{caption} % Captioning figures +\usepackage{subcaption} % Subfigures +\usepackage{geometry} % Page layout +\usepackage{multicol} % Columned pages +\usepackage{array,etoolbox} +\usepackage{fancyhdr} +\usepackage{enumitem} +\usepackage[toc,page]{appendix} + +% Page layout (margins, size, line spacing) +\geometry{letterpaper, left=1in, right=1in, bottom=1in, top=1in} +\setstretch{1.5} + +% Headers +\pagestyle{fancy} +\lhead{PeaPod for Microgreens - Requirements} +\rhead{PeaPod Technologies Inc.} + +% Metric counter, referencing commands +\newcounter{metricnumber} +\setcounter{metricnumber}{1} +\newcommand{\metricrow}{M\arabic{metricnumber}} +\newcommand{\mlabel}[1]{\addtocounter{metricnumber}{-1}\refstepcounter{metricnumber}\label{#1}\addtocounter{metricnumber}{1}} +\newcommand{\mref}[1]{\hyperref[#1]{M\ref{#1}}} + +\begin{document} + +\begin{titlepage} + \begin{center} + \vspace*{1.2cm} + + \textbf{\large{PeaPod for Microgreens - Requirements}} + + \vspace{0.5cm} + + Outlining the Implementation-Specific Requirements for a PeaPod Microgreens Production Unit\\ + + \textit{Extends: \textbf{PeaPod - Requirements}} + + \vfill + \input{../../../../docs/tex/documentation/Namecard.tex} + \vspace{1.25cm} + + Revision 0.1\\ + PeaPod Technologies Inc.\\ + March 31st, 2024 + + \end{center} +\end{titlepage} + +\thispagestyle{plain} + +\tableofcontents +\newpage + +\section{Introduction} +\label{sec:intro} + +\subsection{Purpose} +\label{sec:purpose} + +The purpose of this document is to outline both the category requirements (Section \ref{sec:requirements}) for an implementation of the PeaPod framework (See \textit{PeaPod - Requirements}) that produces microgreens and the scoped requirements (Section \ref{sec:scope}) for this design as proposed by PeaPod Technologies Inc.: \textbf{PeaPod for Microgreens}. + +\subsection{Design Paradigm} +\label{sec:structure} + +\input{../../../../docs/tex/documentation/DesignParadigm.tex} + +\clearpage + + +\subsection{Scope and Justification} +\label{sec:scope} + +\begin{enumerate}[label=SC\arabic*., ref=SC\arabic*] + \item \label{sc:1} Lorem ipsum dolor sit amet, consectetur adipiscing elit: + \begin{enumerate}[label=SC3\alph*., ref=SC3\alph*] + \item \label{sc:1a} Sed auctor, nunc nec ultricies ultricies, nunc nunc ultricies nunc, nec ultricies nunc nunc nec. + \end{enumerate} +\end{enumerate} + +\subsection{Definitions} +\label{sec:definitions} + +A number of useful definitions have emerged from the above scoping: +\begin{enumerate} + \item \textbf{ABC} - Lorem ipsum dolor sit amet, consectetur adipiscing elit. +\end{enumerate} + +\clearpage + + +\section{Framing} +\label{sec:framing} + +\subsection{Problem Statement} +\label{sec:opportunity} + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed auctor, nunc nec ultricies ultricies, nunc nunc ultricies nunc, nec ultricies nunc nunc nec. + +\subsection{Solution Requirements} +\label{sec:requirements} + +The following are the overall challenge requirements compiled from A, B, and an excerpt from C: +\begin{enumerate}[label=R\arabic*., ref=R\arabic*] + \item \label{r:1} \textbf{Must} lorem ipsum dolor sit amet, consectetur adipiscing elit: + \begin{enumerate}[ref=R1\alph*] + \item \label{r:1a} \textbf{Should} lorem ipsum dolor sit amet, consectetur adipiscing elit; + \end{enumerate} +\end{enumerate} + +% Change line spacing for the more list-heavy sections +\setstretch{1} +\subsection{Stakeholders and Values} +\label{sec:stakeholders} + +\begin{enumerate}[label=S\arabic*., ref=S\arabic*] + \item \label{s:1} A - Values, etc. + \item \label{s:2} B - DfX, etc. +\end{enumerate} + +\clearpage + + +\subsection{Problem-Solving Goals} +\label{sec:goals} + +% High-Level +\begin{multicols}{2}[] + \begin{enumerate}[label=HL\arabic*., ref=HL\arabic*] + \item \label{hl:output} Goal ABC \hfill (\ref{s:1}, \ref{r:1}, \ref{r:1a}) + \end{enumerate} +\end{multicols} + +\subsection{Solution Objectives} +\label{sec:objectives} + +% Low-Level +\begin{multicols}{2}[] + \begin{enumerate}[label=LL\arabic*., ref=LL\arabic*] + \item \label{ll:output_variety} Objective ABC \hfill (\ref{hl:output}) + \end{enumerate} +\end{multicols} + +\clearpage + + +\subsection{Metrics} +\label{sec:metrics} + +\begin{tabular}{| @{\makebox[2.4em][c]{\metricrow}} | p{8.7cm} | p{5.9cm} |} + \hline + \multicolumn{1}{| @{\makebox[2.4em][c]{\textbf{\#}}} | l |}{\textbf{Metric}} & \textbf{Units}\\ + \hline + Metric ABC \mlabel{m:constraint} \hfill (\ref{ll:output_variety}) & Yes/No \\ + Metric XYZ \mlabel{m:criteria} \hfill (\ref{ll:output_variety}) & 0 - 100\% \\ + \hline +\end{tabular} + +\clearpage + + +\subsection{Constraints} +\label{sec:constraints} + +\begin{tabular}{|l|p{14.35cm}|} + \hline + \textbf{Metric} & \textbf{Constraint \hfill Justification} \\ + \hline + \mref{m:constraint} & Yes \hfill (\ref{s:1})\\ + \hline +\end{tabular} + +\subsection{Criteria} +\label{sec:criteria} + +\begin{tabular}{|l|p{14.35cm}|} + \hline + \textbf{Metric} & \textbf{Criteria \hfill Justification} \\ + \hline + \mref{m:criteria} & Should Maximize \hfill (\ref{r:1a}) \\ + \hline +\end{tabular} + +% Refer to Appendix \ref{sec:assessment} for prototype verification Assessment Criteria (categories, weights, etc.). + +\newpage + +\section{Reference Designs} + +% -------- TEMPLATE -------- +% Introduction - Project goal, scope, differences from this project +% Graphics - Design drawings/photos, etc. +% Analysis - Rank the design across each of our metrics + % TODO: Metrics might be too much, maybe just qualitative analysis based on LLOs? + +\subsection{Reference Design XYZ} + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed auctor, nunc nec ultricies ultricies, nunc nunc ultricies nunc, nec ultricies nunc nunc nec. + +% \newpage + +% % References +% \bibliographystyle{IEEEtran} +% \bibliography{references} + +\end{document} \ No newline at end of file diff --git a/builds/microgreens/hardware/README.md b/builds/microgreens/hardware/README.md new file mode 100644 index 00000000..290f3edd --- /dev/null +++ b/builds/microgreens/hardware/README.md @@ -0,0 +1,56 @@ +# PeaPod for Microgreens - Hardware + +## Scope and Use-Case + +- Follows PeaPod framework "housing unit" system +- Indoor microgreens cultivation (i.e. no temperature/humidity control required) +- Minimal scale (min. 2 trays, "desktop" size) +- 1020 tray system +- ZERO consumables (no soil/media, optional fertilizers) +- FULL right-to-repair (open-source, no proprietary parts, orderable subassemblies, ease of assembly/disassembly) + +## Specifications + +> Entries marked with a (*) are manufactured in-house from raw materials +> +> Entries marked with a (**) are fabricated in-house using 3D printing + +### Trays + +> Industry-Standard 1020 Tray Size on Drawer-Slide Tray Frames (Note: Dimensions do not include tray framing, drawers, mounting hardware, etc.) + +Tray System Dimensions: 20" wide x 30" deep (3x1020 per tray) + +- Tray Frame (T-Slot, Gusset Brackets**, Fasteners, Handle**) +- Drawer System (Slides, Mounts**, Fasteners) +- Mesh Trays* (Mesh, Velcro, Staples) +- Root-Zone Container* (Waterproof Composite, Adhesive, Drawstring w/ Locking Wheel) + +### Watering + +> Aeroponic Watering System + +- Reservoir (Bucket w/ Lid, Heater w/ Thermostat, Water Supply Line w/ Valve) +- Supply System w/ CAM Lock Fittings (Diaphragm Pump [12V 10A] w/ Pressure Switch, Bladder Accumulator, Solenoid Valve [12V 1A]) +- Watering System (Manifold, Loc-Line Modular Adjustable Tubing, Spray Nozzles) +- Root-Zone Drainage System (Auto Sump Pump [12V 1A]) +- Supply & Drainage Harness (Tubing, Push-to-Connect Harness Fittings, Quick-Disconnect Tray Fittings) + +### Lighting + +> LED Grow Light System + +- Adjustable Light Fixture (DIN Rail, Mounting Plate, Drawstring) +- LED Strips* (LEDs w/ Onboard Ballast, PCB, Wiring Harness) + +### Power & Control + +- Power Supplies (AC/DC Adapters at 5V, 12V, 24V) +- Relay Board w/ Transistor Control +- Microcontroller (Arduino Nano) + +### Housing + +> T-Slot Frame System + +Outer Dimensions (Per Unit): 24" wide x 34" deep x 36" tall \ No newline at end of file diff --git a/builds/microgreens/hardware/boms/microgreens_bom_components.csv b/builds/microgreens/hardware/boms/microgreens_bom_components.csv new file mode 100644 index 00000000..c4fe1162 --- /dev/null +++ b/builds/microgreens/hardware/boms/microgreens_bom_components.csv @@ -0,0 +1,12 @@ +Index ,Manufacturer Part Number ,Manufacturer Name ,Description ,Quantity ,Digi-Key Part Number ,Unit Price ,Extended Price ,Datasheet ,Reference Designator + 1 ,A000005 ,Arduino ,ARDUINO NANO ATMEGA328 EVAL BRD , 1 ,1050-1001-ND , 28.63000 ,$28.63 ,https://media.digikey.com/pdf/Data%20Sheets/Arduino%20PDFs/A000005.pdf ,U2 + 2 ,S404GSEJ6-U3000-3 ,"Delkin Devices, Inc." ,4GB MLC MICROSD CARD (-25C - +85 , 1 ,3247-S404GSEJ6-U3000-3-ND , 19.33000 ,$19.33 ,https://www.delkin.com/wp-content/uploads/2021/01/microSD-Industrial-Spec-Sheet-Jan-2021.pdf , + 3 ,61304021121 ,Würth Elektronik ,CONN HEADER VERT 40POS 2.54MM , 1 ,732-5310-ND , 2.70000 ,$2.70 ,https://www.we-online.com/katalog/datasheet/6130xx21121.pdf ,"U1, U2" + 4 ,SC0510 ,Raspberry Pi ,ZERO 2 W , 1 , , , ,https://datasheets.raspberrypi.com/rpizero2/raspberry-pi-zero-2-w-product-brief.pdf ,U1 + 5 ,DMN2005K-7 ,Diodes Incorporated ,MOSFET N-CH 20V 300MA SOT23-3 , 2 ,DMN2005K-7DICT-ND , 0.58000 ,$1.16 ,https://www.diodes.com/assets/Datasheets/ds30734.pdf ,"Q1, Q2" + 6 ,RC0603FR-0710KL ,YAGEO ,RES 10K OHM 1% 1/10W 0603 , 5 ,311-10.0KHRCT-ND , 0.15000 ,$0.75 ,https://www.yageo.com/upload/media/product/productsearch/datasheet/rchip/PYu-RC_Group_51_RoHS_L_11.pdf ,R1-5 + 7 ,4484 ,Adafruit Industries LLC ,MINI PITFT 1.3 FOR RASPBERRY PI , 1 ,1528-4484-ND , 22.02000 ,$22.02 ,https://media.digikey.com/pdf/Data%20Sheets/Adafruit%20PDFs/4484_Web.pdf , + 8 ,5055670271 ,Molex ,CONN HEADER SMD R/A 2POS 1.25MM , 2 ,WM17038CT-ND , 1.19000 ,$2.38 ,https://www.molex.com/pdm_docs/ps/5055650000-000.pdf ,"J3, J8" + 9 ,5055670471 ,Molex ,CONN HEADER SMD R/A 4POS 1.25MM , 5 ,WM17040CT-ND , 1.30000 ,$6.50 ,http://www.literature.molex.com/SQLImages/kelmscott/Molex/PDF_Images/987651-4888.pdf ,"J1, J2, J6, J9, J10" + 10 ,5055670871 ,Molex ,CONN HEADER SMD R/A 8POS 1.25MM , 3 ,WM17115CT-ND , 1.77000 ,$5.31 ,https://www.molex.com/pdm_docs/pk/5055679200-200.pdf ,"J4, J5, J7" + 11 ,5055670681 ,Molex ,CONN HEADER SMD R/A 6POS 1.25MM , 3 ,WM22471CT-ND , 1.42000 ,$4.26 ,https://www.molex.com/pdm_docs/ps/5055650002-000.pdf ,J11-13 \ No newline at end of file diff --git a/builds/microgreens/hardware/boms/microgreens_bom_purchase.csv b/builds/microgreens/hardware/boms/microgreens_bom_purchase.csv new file mode 100644 index 00000000..512556ac --- /dev/null +++ b/builds/microgreens/hardware/boms/microgreens_bom_purchase.csv @@ -0,0 +1,12 @@ +Part ,Description ,Quantity ,Supplier ,Supplier Part Number ,Unit Cost (CAD) ,Reference +Tray Frame X +Tray Frame Y +Tray Frame Z +Tray Drawer Slide ,24in.; Pair , 1 ,McMaster-Carr ,11435A28 , 42.92 ,. +Tray Mesh Medium ,2ft. Wide , 1 ,McMaster-Carr ,9218T13 , 119.04 ,. +Tray Mesh Velcro ,1n. Wide; 30ft. Roll , 1 ,McMaster-Carr ,95005K817 , 55.27 ,. +Root-Zone Container Composite ,1.43oz Dyneema; 0.5yd sections; Cut & Folded , 2 ,Ripstop by the Roll , , 34.09 ,. +Root-Zone Container Adhesive ,Pressure-Sensitive Adhesive Tape for Dyneema; 1/2in. Wide; 5yd. Roll , 3 ,Ripstop by the Roll , , 6.41 ,https://ripstopbytheroll.com/products/dyneema-composite-fabric-double-sided-adhesive-tape +Root-Zone Container Drawstring ,Nylon Cord; 5/32in. dia.; 50ft. Length , 1 ,McMaster-Carr ,3696T38 , 2.82 ,https://www.mcmaster.com/3696T38/ +Root-Zone Container Lock ,Slide-to-Release Wheel; Pack of 25 , 1 ,McMaster-Carr ,3734T4 , 29.23 ,https://www.mcmaster.com/3734T4 +Aeroponic Misting Nozzle ,80deg Full-Cone; Brass; 5gal. per hr. @100PSI; 1/8 MPT , 4 ,McMaster-Carr ,3178K75 , 22.66 ,https://www.mcmaster.com/3178K75/ diff --git a/builds/template/README.md b/builds/template/README.md new file mode 100644 index 00000000..97253281 --- /dev/null +++ b/builds/template/README.md @@ -0,0 +1,3 @@ +# PeaPod for XYZ + +PeaPod for XYZ is an implementation-specific formulation of the PeaPod framework, designed to lorem ipsum dolor sit amet, consectetur adipiscing elit. This repository contains all the necessary information to build and operate the PeaPod for XYZ. \ No newline at end of file diff --git a/builds/template/docs/.gitignore b/builds/template/docs/.gitignore new file mode 100644 index 00000000..d2972f0e --- /dev/null +++ b/builds/template/docs/.gitignore @@ -0,0 +1,284 @@ +## Core latex/pdflatex auxiliary files: +*.aux +*.lof +*.log +*.lot +*.fls +*.out +*.toc +*.fmt +*.fot +*.cb +*.cb2 +.*.lb + +## Intermediate documents: +*.dvi +*.xdv +*-converted-to.* +# these rules might exclude image files for figures etc. +# *.ps +# *.eps +# *.pdf + +## Generated if empty string is given at "Please type another file name for output:" +.pdf + +## Bibliography auxiliary files (bibtex/biblatex/biber): +*.bbl +*.bcf +*.blg +*-blx.aux +*-blx.bib +*.run.xml + +## Build tool auxiliary files: +*.fdb_latexmk +*.synctex +*.synctex(busy) +*.synctex.gz +*.synctex.gz(busy) +*.pdfsync + +## Build tool directories for auxiliary files +# latexrun +latex.out/ + +## Auxiliary and intermediate files from other packages: +# algorithms +*.alg +*.loa + +# achemso +acs-*.bib + +# amsthm +*.thm + +# beamer +*.nav +*.pre +*.snm +*.vrb + +# changes +*.soc + +# comment +*.cut + +# cprotect +*.cpt + +# elsarticle (documentclass of Elsevier journals) +*.spl + +# endnotes +*.ent + +# fixme +*.lox + +# feynmf/feynmp +*.mf +*.mp +*.t[1-9] +*.t[1-9][0-9] +*.tfm + +#(r)(e)ledmac/(r)(e)ledpar +*.end +*.?end +*.[1-9] +*.[1-9][0-9] +*.[1-9][0-9][0-9] +*.[1-9]R +*.[1-9][0-9]R +*.[1-9][0-9][0-9]R +*.eledsec[1-9] +*.eledsec[1-9]R +*.eledsec[1-9][0-9] +*.eledsec[1-9][0-9]R +*.eledsec[1-9][0-9][0-9] +*.eledsec[1-9][0-9][0-9]R + +# glossaries +*.acn +*.acr +*.glg +*.glo +*.gls +*.glsdefs +*.lzo +*.lzs + +# uncomment this for glossaries-extra (will ignore makeindex's style files!) +# *.ist + +# gnuplottex +*-gnuplottex-* + +# gregoriotex +*.gaux +*.gtex + +# htlatex +*.4ct +*.4tc +*.idv +*.lg +*.trc +*.xref + +# hyperref +*.brf + +# knitr +*-concordance.tex +# TODO Uncomment the next line if you use knitr and want to ignore its generated tikz files +# *.tikz +*-tikzDictionary + +# listings +*.lol + +# luatexja-ruby +*.ltjruby + +# makeidx +*.idx +*.ilg +*.ind + +# minitoc +*.maf +*.mlf +*.mlt +*.mtc[0-9]* +*.slf[0-9]* +*.slt[0-9]* +*.stc[0-9]* + +# minted +_minted* +*.pyg + +# morewrites +*.mw + +# nomencl +*.nlg +*.nlo +*.nls + +# pax +*.pax + +# pdfpcnotes +*.pdfpc + +# sagetex +*.sagetex.sage +*.sagetex.py +*.sagetex.scmd + +# scrwfile +*.wrt + +# sympy +*.sout +*.sympy +sympy-plots-for-*.tex/ + +# pdfcomment +*.upa +*.upb + +# pythontex +*.pytxcode +pythontex-files-*/ + +# tcolorbox +*.listing + +# thmtools +*.loe + +# TikZ & PGF +*.dpth +*.md5 +*.auxlock + +# todonotes +*.tdo + +# vhistory +*.hst +*.ver + +# easy-todo +*.lod + +# xcolor +*.xcp + +# xmpincl +*.xmpi + +# xindy +*.xdy + +# xypic precompiled matrices and outlines +*.xyc +*.xyd + +# endfloat +*.ttt +*.fff + +# Latexian +TSWLatexianTemp* + +## Editors: +# WinEdt +*.bak +*.sav + +# Texpad +.texpadtmp + +# LyX +*.lyx~ + +# Kile +*.backup + +# gummi +.*.swp + +# KBibTeX +*~[0-9]* + +# TeXnicCenter +*.tps + +# auto folder when using emacs and auctex +./auto/* +*.el + +# expex forward references with \gathertags +*-tags.tex + +# standalone packages +*.sta + +# Makeindex log files +*.lpz + +# xwatermark package +*.xwm + +# REVTeX puts footnotes in the bibliography by default, unless the nofootinbib +# option is specified. Footnotes are the stored in a file with suffix Notes.bib. +# Uncomment the next line to have this generated file ignored. +#*Notes.bib \ No newline at end of file diff --git a/builds/template/docs/productsheet/ProductSheet.tex b/builds/template/docs/productsheet/ProductSheet.tex new file mode 100644 index 00000000..9bbab28d --- /dev/null +++ b/builds/template/docs/productsheet/ProductSheet.tex @@ -0,0 +1,62 @@ +\documentclass{../../../../docs/tex/report} +\usepackage{setspace} % Setting line spacing +\usepackage{ulem} % Underline +\usepackage{caption} % Captioning figures +\usepackage{subcaption} % Subfigures +\usepackage{geometry} % Page layout +\usepackage{multicol} % Columned pages +\usepackage{array,etoolbox} +\usepackage{fancyhdr} +\usepackage{enumitem} +\usepackage[toc,page]{appendix} +\setlist{noitemsep} + +% Page layout (margins, size, line spacing) +\geometry{letterpaper, left=1in, right=1in, bottom=1in, top=1in} +\setstretch{1} + +% Headers +\pagestyle{fancy} +\lhead{PeaPod XYZ} +\rhead{PeaPod Technologies Inc.} + +\begin{document} + +\begin{titlepage} + \begin{center} + \vspace*{1.2cm} + + \textbf{\large{PeaPod XYZ - Product Sheet}} + + \vspace{0.5cm} + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + + \vfill + \input{../../../docs/tex/documentation/Namecard.tex} + \vspace{1.25cm} + + Revision 0.1\\ + PeaPod Technologies Inc.\\ + Month XX, 2024 + + \end{center} +\end{titlepage} + +\thispagestyle{plain} + +\tableofcontents +\clearpage + +\section{Product Overview} + +\subsection{Introduction} + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed auctor, nunc nec ultricies ultricies, nunc nunc ultricies nunc, nec ultricies nunc nunc nec. Sed auctor, nunc nec ultricies ultricies, nunc nunc ultricies nunc, nec ultricies nunc nunc nec. Sed auctor, nunc nec ultricies ultricies, nunc nunc ultricies nunc, nec ultricies nunc nunc nec. Sed auctor, nunc nec ultricies ultricies, nunc nunc ultricies nunc, nec ultricies nunc nunc nec. + +\clearpage + +% References +\bibliographystyle{IEEEtran} +\bibliography{references} +\end{document} \ No newline at end of file diff --git a/builds/template/docs/requirements/Requirements.pdf b/builds/template/docs/requirements/Requirements.pdf new file mode 100644 index 00000000..e47ac10a Binary files /dev/null and b/builds/template/docs/requirements/Requirements.pdf differ diff --git a/builds/template/docs/requirements/Requirements.tex b/builds/template/docs/requirements/Requirements.tex new file mode 100644 index 00000000..54bec7a0 --- /dev/null +++ b/builds/template/docs/requirements/Requirements.tex @@ -0,0 +1,210 @@ +\documentclass{../../../../docs/tex/report} +\usepackage{setspace} % Setting line spacing +\usepackage{ulem} % Underline +\usepackage{caption} % Captioning figures +\usepackage{subcaption} % Subfigures +\usepackage{geometry} % Page layout +\usepackage{multicol} % Columned pages +\usepackage{array,etoolbox} +\usepackage{fancyhdr} +\usepackage{enumitem} +\usepackage[toc,page]{appendix} + +% Page layout (margins, size, line spacing) +\geometry{letterpaper, left=1in, right=1in, bottom=1in, top=1in} +\setstretch{1.5} + +% Headers +\pagestyle{fancy} +\lhead{PeaPod for XYZ - Requirements} +\rhead{PeaPod Technologies Inc.} + +% Metric counter, referencing commands +\newcounter{metricnumber} +\setcounter{metricnumber}{1} +\newcommand{\metricrow}{M\arabic{metricnumber}} +\newcommand{\mlabel}[1]{\addtocounter{metricnumber}{-1}\refstepcounter{metricnumber}\label{#1}\addtocounter{metricnumber}{1}} +\newcommand{\mref}[1]{\hyperref[#1]{M\ref{#1}}} + +\begin{document} + +\begin{titlepage} + \begin{center} + \vspace*{1.2cm} + + \textbf{\large{PeaPod for XYZ - Requirements}} + + \vspace{0.5cm} + + Outlining the Implementation-Specific Requirements for a PeaPod XYZ\\ + + \textit{Extends: \textbf{PeaPod - Requirements}} + + \vfill + \input{../../../../docs/tex/documentation/Namecard.tex} + \vspace{1.25cm} + + Revision 0.1\\ + PeaPod Technologies Inc.\\ + March 31st, 2024 + + \end{center} +\end{titlepage} + +\thispagestyle{plain} + +\tableofcontents +\newpage + +\section{Introduction} +\label{sec:intro} + +\subsection{Purpose} +\label{sec:purpose} + +The purpose of this document is to outline both the category requirements (Section \ref{sec:requirements}) for an implementation of the PeaPod framework (See \textit{PeaPod - Requirements}) that XYZ and the scoped requirements (Section \ref{sec:scope}) for the design being proposed by PeaPod Technologies Inc.: \textbf{PeaPod for XYZ}. + +\subsection{Design Paradigm} +\label{sec:structure} + +\input{../../../../docs/tex/documentation/DesignParadigm.tex} + +\clearpage + + +\subsection{Scope and Justification} +\label{sec:scope} + +\begin{enumerate}[label=SC\arabic*., ref=SC\arabic*] + \item \label{sc:1} Lorem ipsum dolor sit amet, consectetur adipiscing elit: + \begin{enumerate}[label=SC3\alph*., ref=SC3\alph*] + \item \label{sc:1a} Sed auctor, nunc nec ultricies ultricies, nunc nunc ultricies nunc, nec ultricies nunc nunc nec. + \end{enumerate} +\end{enumerate} + +\subsection{Definitions} +\label{sec:definitions} + +A number of useful definitions have emerged from the above scoping: +\begin{enumerate} + \item \textbf{ABC} - Lorem ipsum dolor sit amet, consectetur adipiscing elit. +\end{enumerate} + +\clearpage + + +\section{Framing} +\label{sec:framing} + +\subsection{Problem Statement} +\label{sec:opportunity} + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed auctor, nunc nec ultricies ultricies, nunc nunc ultricies nunc, nec ultricies nunc nunc nec. + +\subsection{Solution Requirements} +\label{sec:requirements} + +The following are the overall challenge requirements compiled from A, B, and an excerpt from C: +\begin{enumerate}[label=R\arabic*., ref=R\arabic*] + \item \label{r:1} \textbf{Must} lorem ipsum dolor sit amet, consectetur adipiscing elit: + \begin{enumerate}[ref=R1\alph*] + \item \label{r:1a} \textbf{Should} lorem ipsum dolor sit amet, consectetur adipiscing elit; + \end{enumerate} +\end{enumerate} + +% Change line spacing for the more list-heavy sections +\setstretch{1} +\subsection{Stakeholders and Values} +\label{sec:stakeholders} + +\begin{enumerate}[label=S\arabic*., ref=S\arabic*] + \item \label{s:1} A - Values, etc. + \item \label{s:2} B - DfX, etc. +\end{enumerate} + +\clearpage + + +\subsection{Problem-Solving Goals} +\label{sec:goals} + +% High-Level +\begin{multicols}{2}[] + \begin{enumerate}[label=HL\arabic*., ref=HL\arabic*] + \item \label{hl:output} Goal ABC \hfill (\ref{s:1}, \ref{r:1}, \ref{r:1a}) + \end{enumerate} +\end{multicols} + +\subsection{Solution Objectives} +\label{sec:objectives} + +% Low-Level +\begin{multicols}{2}[] + \begin{enumerate}[label=LL\arabic*., ref=LL\arabic*] + \item \label{ll:output_variety} Objective ABC \hfill (\ref{hl:output}) + \end{enumerate} +\end{multicols} + +\clearpage + + +\subsection{Metrics} +\label{sec:metrics} + +\begin{tabular}{| @{\makebox[2.4em][c]{\metricrow}} | p{8.7cm} | p{5.9cm} |} + \hline + \multicolumn{1}{| @{\makebox[2.4em][c]{\textbf{\#}}} | l |}{\textbf{Metric}} & \textbf{Units}\\ + \hline + Metric ABC \mlabel{m:constraint} \hfill (\ref{ll:output_variety}) & Yes/No \\ + Metric XYZ \mlabel{m:criteria} \hfill (\ref{ll:output_variety}) & 0 - 100\% \\ + \hline +\end{tabular} + +\clearpage + + +\subsection{Constraints} +\label{sec:constraints} + +\begin{tabular}{|l|p{14.35cm}|} + \hline + \textbf{Metric} & \textbf{Constraint \hfill Justification} \\ + \hline + \mref{m:constraint} & Yes \hfill (\ref{s:1})\\ + \hline +\end{tabular} + +\subsection{Criteria} +\label{sec:criteria} + +\begin{tabular}{|l|p{14.35cm}|} + \hline + \textbf{Metric} & \textbf{Criteria \hfill Justification} \\ + \hline + \mref{m:criteria} & Should Maximize \hfill (\ref{r:1a}) \\ + \hline +\end{tabular} + +% Refer to Appendix \ref{sec:assessment} for prototype verification Assessment Criteria (categories, weights, etc.). + +\newpage + +\section{Reference Designs} + +% -------- TEMPLATE -------- +% Introduction - Project goal, scope, differences from this project +% Graphics - Design drawings/photos, etc. +% Analysis - Rank the design across each of our metrics + % TODO: Metrics might be too much, maybe just qualitative analysis based on LLOs? + +\subsection{Reference Design XYZ} + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed auctor, nunc nec ultricies ultricies, nunc nunc ultricies nunc, nec ultricies nunc nunc nec. + +% \newpage + +% % References +% \bibliographystyle{IEEEtran} +% \bibliography{references} + +\end{document} \ No newline at end of file diff --git a/builds/template/hardware/README.md b/builds/template/hardware/README.md new file mode 100644 index 00000000..ca86875e --- /dev/null +++ b/builds/template/hardware/README.md @@ -0,0 +1,47 @@ +# PeaPod for Microgreens - Hardware + +## Scope and Use-Case + +- Follows PeaPod framework "housing unit" system +- Indoor microgreens cultivation (i.e. no temperature/humidity control required) +- Minimal scale (i.e. 1-2 trays, "desktop" size) +- 1020 tray system +- ZERO consumables (no soil/media, optional fertilizers, ) + +## Specifications + +### Trays + +> Industry-Standard 1020 Tray Size on Drawer-Slide Tray Frames (Note: Dimensions do not include tray framing) + +Tray System Dimensions: 20" wide x 30" deep (3 trays per unit) + +### Lighting + +### Watering + +### Housing + +Outer Dimensions (Per Unit): 24" wide x 34" deep x 36" tall + +# Cost Breakdown + +> Production & Revenue Estimate (Per Unit, 3 Trays, 1 Week Cycle): X lbs. (Y$) + +## Materials + +## Labor + + - Design & Fabrication Fees + - Manufacturing Labor + - Assembly Labor + - Delivery & Installation Labor + - Setup & Training Fees + +## Operating Costs + + - Electricity + - Water + - Fertilizer (optional) + - Seeds + - Operating Labor \ No newline at end of file diff --git a/builds/template/hardware/boms/template_bom_components.csv b/builds/template/hardware/boms/template_bom_components.csv new file mode 100644 index 00000000..4432b6c4 --- /dev/null +++ b/builds/template/hardware/boms/template_bom_components.csv @@ -0,0 +1,2 @@ +Index ,Manufacturer Part Number ,Manufacturer Name ,Description ,Quantity ,Digi-Key Part Number ,Unit Price ,Extended Price ,Datasheet ,Reference Designator + 1 ,A000005 ,Arduino ,ARDUINO NANO ATMEGA328 EVAL BRD , 1 ,1050-1001-ND , 28.63000 ,$28.63 ,https://media.digikey.com/pdf/Data%20Sheets/Arduino%20PDFs/A000005.pdf ,U2 \ No newline at end of file diff --git a/builds/template/hardware/boms/template_bom_purchase.csv b/builds/template/hardware/boms/template_bom_purchase.csv new file mode 100644 index 00000000..1c22ff1e --- /dev/null +++ b/builds/template/hardware/boms/template_bom_purchase.csv @@ -0,0 +1,2 @@ +Part ,Description ,Quantity ,Supplier ,Supplier Part Number ,Unit Cost (CAD) ,Reference +Automation Motherboard PCB ,"2 Layers, 1 oz. Copper, 1.6mm Thickness, Suggested: HASL Finish, White PCB, Black Silkscreen" ,1 (MOQ 5) ,JLCPCB ,N/A , 0.51 ,../gerber/ \ No newline at end of file diff --git a/docs/progressreport/ProgressReport.pdf b/docs/progressreport/ProgressReport.pdf index d21d7d53..1e1db05f 100644 Binary files a/docs/progressreport/ProgressReport.pdf and b/docs/progressreport/ProgressReport.pdf differ diff --git a/docs/progressreport/ProgressReport.tex b/docs/progressreport/ProgressReport.tex index 571049d9..760b4e69 100644 --- a/docs/progressreport/ProgressReport.tex +++ b/docs/progressreport/ProgressReport.tex @@ -17,7 +17,7 @@ % Headers \pagestyle{fancy} -\lhead{PeaPod - Progress Report} +\lhead{PeaPod - Solution Overview \& Progress Report} \rhead{PeaPod Technologies Inc.} \begin{document} @@ -26,7 +26,7 @@ \begin{center} \vspace*{1.2cm} - \textbf{\large{PeaPod - Progress Report}} + \textbf{\large{PeaPod - Solution Overview \& Progress Report}} \vspace{0.5cm} @@ -36,9 +36,9 @@ \input{../tex/Namecard.tex} \vspace{.75cm} - Revision 1.0\\ + Revision 1.1\\ PeaPod Technologies Inc.\\ - May 31st, 2022 + August 16th, 2022 \end{center} \end{titlepage} diff --git a/microcontroller.code-workspace b/microcontroller.code-workspace new file mode 100644 index 00000000..cc3f943e --- /dev/null +++ b/microcontroller.code-workspace @@ -0,0 +1,9 @@ +{ + "folders": [ + { + "name": "PeaPod Microcontroller Firmware", + "path": "software/microcontroller" + } + ], + "settings": {} +} \ No newline at end of file diff --git a/software.code-workspace b/software.code-workspace new file mode 100644 index 00000000..66312daa --- /dev/null +++ b/software.code-workspace @@ -0,0 +1,9 @@ +{ + "folders": [ + { + "name": "Peapod Software", + "path": "software/" + } + ], + "settings": {} +} \ No newline at end of file diff --git a/software/.dockerignore b/software/.dockerignore new file mode 100644 index 00000000..d14ae482 --- /dev/null +++ b/software/.dockerignore @@ -0,0 +1,26 @@ +# Dependency directories (prevent host modules from entering build context) +node_modules +**/node_modules + +# macOS metadata files +.DS_Store +._* +.AppleDouble + +# VCS and editor metadata +.git +.gitmodules +.vscode + +# Local build/test artifacts +out +out.tar.gz +.next +coverage +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +.env +.env.* diff --git a/software/.env.template b/software/.env.template new file mode 100644 index 00000000..8bf6d0b1 --- /dev/null +++ b/software/.env.template @@ -0,0 +1,17 @@ +FIREBASE_APIKEY="" +FIREBASE_AUTHDOMAIN="" +FIREBASE_PROJECTID="" +FIREBASE_STORAGEBUCKET="" +FIREBASE_MESSAGINGSENDERID="" +FIREBASE_APPID="" +FIREBASE_MEASUREMENTID="" +GOOGLE_SCOPES="email profile" +GOOGLE_CLIENTID="" +GOOGLE_CLIENTSECRET="" +GITHUB_SCOPES="read:user user:email" +GITHUB_CLIENTID="" +GITHUB_CLIENTSECRET="" +SERIALPORT="/dev/ttyS0" +# NEXT_HOST="localhost" +# NODE_ENV="production" +NEXT_PORT=3000 \ No newline at end of file diff --git a/software/.firebaserc b/software/.firebaserc new file mode 100644 index 00000000..309c557d --- /dev/null +++ b/software/.firebaserc @@ -0,0 +1,5 @@ +{ + "projects": { + "default": "cloudponics-bc383" + } +} diff --git a/software/.gitignore b/software/.gitignore index 7f9eeed5..9da96e74 100644 --- a/software/.gitignore +++ b/software/.gitignore @@ -2,5 +2,73 @@ node_modules/ *.js *.d.ts +!jest.config.js + +# Runtime files deviceInfo.json -projects/ \ No newline at end of file +projects/ + +# Logs +logs/** + +# Arduino Binaries +*.elf +*.hex +*.eep +*.bin + +*.log + +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/versions + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# env files (can opt-in for committing if needed) +.env* +!.env.template + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts + +api/*.mjs +api/*.js + +logs/*.txt + +server.mjs + +sample.jpg + +out.tar.gz \ No newline at end of file diff --git a/software/.npmignore b/software/.npmignore index a4925d7f..880c2871 100644 --- a/software/.npmignore +++ b/software/.npmignore @@ -1,16 +1,42 @@ -node_modules/ -tsconfig.json - +# TypeScript files (keep type files) *.ts !*.d.ts +tsconfig.json +# Aux files .git/ -.gitignore +**/.gitignore .gitattributes .npmignore package-lock.json +# Unpublishables .env +.env.template *.pem deviceInfo.json -projects/ \ No newline at end of file +projects/ + +# Test Scripts +tests/ +*.test.js +*.test.js.map +*.test.d.ts +*.test.ts +jest.config.js + +# Arduino Binaries +*.elf +*.hex +*.eep +*.bin +*.oo +**/.vscode/ +**/.pio/ + +# Docker +Dockerfile +Dockerfile.* +.dockerignore +docker-compose.yml +docker-compose.*.yml \ No newline at end of file diff --git a/software/.prettierrc b/software/.prettierrc new file mode 100644 index 00000000..d34c24c4 --- /dev/null +++ b/software/.prettierrc @@ -0,0 +1,11 @@ +{ + "semi": true, + "singleQuote": true, + "useTabs": false, + "tabWidth": 2, + "printWidth": 80, + "trailingComma": "es5", + "bracketSpacing": true, + "arrowParens": "always", + "endOfLine": "lf" +} diff --git a/software/Dockerfile b/software/Dockerfile new file mode 100644 index 00000000..6be315aa --- /dev/null +++ b/software/Dockerfile @@ -0,0 +1,43 @@ +# ---- deps (Yarn) ---- +FROM --platform=$BUILDPLATFORM node:20-bookworm-slim AS peapodos +WORKDIR /app + +# Tools needed for node-gyp native addons (like epoll) +RUN apt-get update && apt-get install -y --no-install-recommends \ + ca-certificates curl python3 python3-venv make g++ \ + && rm -rf /var/lib/apt/lists/* + +RUN curl -fsSL -o get-platformio.py https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py && python3 get-platformio.py + +RUN corepack enable + +COPY package*.json ./ +COPY yarn.lock ./ +RUN yarn install --frozen-lockfile --non-interactive --network-timeout 100000 + +COPY . . + +RUN yarn buildapi +RUN npx next build + +RUN rm -f /app/.next/standalone/server.js +RUN rm -rf /app/.next/standalone/node_modules +RUN rm -f /app/.next/standalone/package.json + +RUN mkdir -p /tmp/export/.next/static /tmp/export/api /tmp/export/microcontroller \ + && cp -a /app/.next/standalone/. /tmp/export/ \ + && cp -a /app/.next/static/. /tmp/export/.next/static/ \ + && cp -a /app/public /tmp/export/public \ + && cp -a /app/api/*.mjs /tmp/export/api/ \ + && cp -a /app/server.mjs /tmp/export/ \ + && cp -a /app/microcontroller /tmp/export/microcontroller \ + && cp -a /app/.env /tmp/export/.env \ + && cp -a /app/node_modules /tmp/export/node_modules \ + && cp -a /app/package.json /tmp/export/package.json \ + && cp -a /app/yarn.lock /tmp/export/yarn.lock + +RUN tar -czf /app/out.tar.gz -C /tmp/export . + +FROM scratch AS export + +COPY --from=peapodos /app/out.tar.gz /out.tar.gz \ No newline at end of file diff --git a/software/Dockerfile.local b/software/Dockerfile.local new file mode 100644 index 00000000..ec5a44cb --- /dev/null +++ b/software/Dockerfile.local @@ -0,0 +1,20 @@ +# Use an official Node runtime as a parent image +FROM node:20 AS peapodos-local + +# Set the working directory in the container +WORKDIR /usr/src/app + +# Install apt dependencies +RUN apt-get update && apt-get install -y udev + +# Copy package.json and package-lock.json +COPY package*.json ./ + +# Install dependencies +RUN yarn install --frozen-lockfile --non-interactive --network-timeout 100000 + +# Copy the rest of your app's source code +COPY . . + +# Your app binds to port 3000 so you'll use the EXPOSE instruction to have it mapped by the docker daemon +EXPOSE 3000 \ No newline at end of file diff --git a/software/PeaPodOS-Arduino/PeaPodOS-Arduino.ino b/software/PeaPodOS-Arduino/PeaPodOS-Arduino.ino deleted file mode 100644 index c983f94f..00000000 --- a/software/PeaPodOS-Arduino/PeaPodOS-Arduino.ino +++ /dev/null @@ -1,211 +0,0 @@ -#include "./src/Sensor.h" -#include "./src/SHT31.h" - -#include "./src/Actuator.h" -#include "./src/LED.h" -// #include "Wire.h" -// #include "K30.h" -// #include "FloatSensor.h" -// #include "Scale.h" - -//MACRO DEFINITIONS -#define NUM_SENSORS 2 -#define NUM_ACTUATORS 1 -// #define FLOATSENSOR_PIN 5 -#define REVISION 0 - -// Sensors -SHT31 sht31; -SHT31_temp temp = SHT31_temp(&sht31); -SHT31_hum hum = SHT31_hum(&sht31); -// K30 k30; -// Scale scale; -// FloatSensor fs = FloatSensor(FLOATSENSOR_PIN); - -Sensor* sensors [NUM_SENSORS] = { - &temp, - &hum, - // &k30, - // &fs, - // &scale -}; - -//Actuators -LED led_blue(3); -LED led_cool(5); -LED led_warm(6); -LED led_red(9); -LED led_far(10); - -Actuator* actuators [NUM_ACTUATORS] = { - &led_blue, - &led_cool, - &led_warm, - &led_red, - &led_far, -} - - -void setup() -{ - digitalWrite(13, LOW); - if(!post()){ - // Failed POST - while(true){ - delay(250); - digitalWrite(13, HIGH); - delay(250); - digitalWrite(13, LOW); - } - } - - // Tell computer 'ready', wait to receive valid program. - Serial.print("{\"type\":\"revision\",\"data\":"); - Serial.print(REVISION); - Serial.print("}\n"); - - String ins; - do{ - while(!Serial.available()); - ins = Serial.readString(); - ins.trim(); - }while(!handleInstructions(ins)); - digitalWrite(13, HIGH); -} - -void loop() -{ - if(Serial.available()){ - String in = Serial.readString(); - in.trim(); //Whitespace or newlines - handleInstructions(in); - } - - for(int i = 0; i < NUM_SENSORS; i++){ - float read = sensors[i]->getRead(); - if(!isnan(read)){ - Serial.print("{\"type\":\"data\",\"data\":{\"label\":\""); - Serial.print(sensors[i]->evname); - Serial.print("\",\"value\":"); - Serial.print(read); - Serial.print("}}\n"); - } - } - delay(10); -} - -/** - * Handles incoming instruction "var":value string. - * @param s - Instruction string - * @return was the instruction handled in a valid way? - **/ -bool handleInstruction(String in){ - uint8_t split = in.indexOf(":"); - if(split!=-1 && in.charAt(0) == '"' && in.charAt(split-1) == '"'){ - String var = in.substring(1, split-1); //Assumes surrounding "" - float value = in.substring(split+1).toFloat(); - - //INSTRUCTION HANDLING IF BLOCKS - EACH RETURNS TRUE - if(var.equals("led_blue")){ - led_blue.target = value; - return true; - } - if(var.equals("led_cool")){ - led_cool.target = value; - return true; - } - if(var.equals("led_warm")){ - led_warm.target = value; - return true; - } - if(var.equals("led_red")){ - led_red.target = value; - return true; - } - if(var.equals("led_far")){ - led_far.target = value; - return true; - } - Serial.print("{\"type\":\"error\",\"data\":\"Unknown instruction target '"); - Serial.print(var); - Serial.print("'\"}\n"); - return false; - } - Serial.print("{\"type\":\"error\",\"data\":\"Failed to handle instruction '"); - in.replace("\"", "\\\""); - Serial.print(in); - Serial.print("'\"}\n"); - return false; -} - -/** - * Handles incoming instruction dictionary {"var":val,...} - * Continues regardless of failure of a single instruction, alerts only - * @param s - Instructions dictionary string - * @return were all instructions handled in a valid way? - * */ -bool handleInstructions(String ins){ - if(ins.equals("{}")){ - return true; //Empty dictionary, by default handled - } - if(ins.charAt(0) != '{' || ins.charAt(ins.length()-1) != '}'){ - Serial.print("{\"type\":\"error\",\"data\":\"Invalid instructions dictionary '"); - Serial.print(ins); - Serial.print("'\"}\n"); - return false; - } - ins = ins.substring(1, ins.length()-1); //Strips surrounding {} - - //Handles each individual instruction - - bool result = true; - //While there are multiple instructions - while(ins.indexOf(',') != -1){ - //Did the leftmost one succeed? - result &= handleInstruction(ins.substring(0, ins.indexOf(','))); - //Truncate leftmost instruction - ins = ins.substring(ins.indexOf(',')+1); - } - //Handle last/only instruction (there are no commas left) - result &= handleInstruction(ins); - return result; -} - -bool post(){ - Serial.begin(115200); - while(!Serial); //Waits until serial opens - - // Test sensor protocols - per-sensor tests - bool success = true; - for(int i = 0; i < NUM_SENSORS; i++){ - bool latest = sensors[i]->begin(); - success &= latest; - if(!latest){ - Serial.print("{\"type\":\"error\",\"data\":\"Failed to initialize sensor '"); - Serial.print(sensors[i]->name); - Serial.print("'. Check wiring.\"}\n"); - } else { - Serial.print("{\"type\":\"debug\",\"data\":\"Sensor '"); - Serial.print(sensors[i]->name); - Serial.print("' initialized successfully.\"}\n"); - - // {type: debug, data: "Sensor 'Temperature Sensor' initialized successfully."} - } - } - - // Test actuator protocols - per-actuator tests - for(int i = 0; i < NUM_ACTUATORS; i++){ - bool latest = actuators[i]->begin(); - success &= latest; - if(!latest){ - Serial.print("{\"type\":\"error\",\"data\":\"Failed to initialize actuator '"); - Serial.print(actuators[i]->name); - Serial.print("'. Check wiring.\"}\n"); - } else { - Serial.print("{\"type\":\"debug\",\"data\":\"Actuator '"); - Serial.print(actuators[i]->name); - Serial.print("' initialized successfully.\"}\n"); - } - } - return success; -} diff --git a/software/PeaPodOS-Arduino/README.md b/software/PeaPodOS-Arduino/README.md deleted file mode 100644 index b0af71b2..00000000 --- a/software/PeaPodOS-Arduino/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# PeaPodOS Arduino - -Includes all libraries and code for PeaPod's Arduino Micro. - -## References - -Todo. - -# Development - -## Requirements - -- Arduino IDE - -## Uploading - -Open the [main sketch](./PeaPod-Arduino.ino) in the Arduino IDE. Connect the PeaPod Arduino Micro to your computer. Select Arduino Micro as the board. Select the appropriate serial port. - -Verify, then upload the sketch. - -## Interfacing - -Open the Arduino IDE Serial Monitor (Tools > Serial Monitor). To start the PeaPod's data gathering, send it a valid "Instruction Set" JSON-formatted string where each key-value pair is an Instruction. - -The currently supported Instructions are: -- None. GTFO. \ No newline at end of file diff --git a/software/PeaPodOS-Arduino/src/Actuator.cpp b/software/PeaPodOS-Arduino/src/Actuator.cpp deleted file mode 100644 index b2859768..00000000 --- a/software/PeaPodOS-Arduino/src/Actuator.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include "Arduino.h" -#include "Actuator.h" - -/** - * Constructor. - * @param name - Meaningful, readable name of the sensor. - * @param id - Identifying name of the associated hardware. - * @param evname - Name of the environment variable the sensor records. - **/ -Actuator::Actuator(String name, String id, String evname){ - this->id = id; - this->name = name; - this->evname = evname; - //just in case - this->evname.toLowerCase(); - this->evname.replace(' ','-'); -} - -void Actuator::updateActuator(){ - if(this->ready){ - this->update(); - } -} - -bool Actuator::begin(){ - this->ready = init(); - return ready; -} \ No newline at end of file diff --git a/software/PeaPodOS-Arduino/src/Actuator.h b/software/PeaPodOS-Arduino/src/Actuator.h deleted file mode 100644 index 8ba0aab1..00000000 --- a/software/PeaPodOS-Arduino/src/Actuator.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef Actuator_H -#define Actuator_H - -#include "Arduino.h" - -class Actuator{ - protected: - // Wrapper functions - virtual void update() = 0; - virtual bool init() = 0; - //Has begin() been performed by THIS object? - bool ready = false; - public: - /** - * Hardware ID. - */ - String id; - /** - * Meaningful, readable name of the actuator. - */ - String name; - /** - * Preformatted (lowercase and underscored) name of the environment variable the actuator controls. - */ - String evname; - float target; - Actuator(String name, String id, String evname); - void updateActuator(); - bool begin(); -}; - -#endif \ No newline at end of file diff --git a/software/PeaPodOS-Arduino/src/FloatSensor.cpp b/software/PeaPodOS-Arduino/src/FloatSensor.cpp deleted file mode 100644 index d553b9cb..00000000 --- a/software/PeaPodOS-Arduino/src/FloatSensor.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "FloatSensor.h" - -FloatSensor::FloatSensor(uint8_t pin) : Sensor("Float Sensor", "Float Switch", "Reservoir Level", 500){ - this->pin = pin; -} - -bool FloatSensor::init(){ - pinMode(pin, INPUT); - return true; -} - -float FloatSensor::read(){ - return digitalRead(pin); -} \ No newline at end of file diff --git a/software/PeaPodOS-Arduino/src/FloatSensor.h b/software/PeaPodOS-Arduino/src/FloatSensor.h deleted file mode 100644 index e2d4f0b7..00000000 --- a/software/PeaPodOS-Arduino/src/FloatSensor.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef FloatSensor_H -#define FloatSensor_H - -#include "Arduino.h" -#include "Sensor.h" - -class FloatSensor : public Sensor { - public: - FloatSensor(uint8_t pin); - private: - float read() override; - bool init() override; - /** - * Digital input pin. - * */ - uint8_t pin; -}; - - -#endif \ No newline at end of file diff --git a/software/PeaPodOS-Arduino/src/K30.cpp b/software/PeaPodOS-Arduino/src/K30.cpp deleted file mode 100644 index 9afa81eb..00000000 --- a/software/PeaPodOS-Arduino/src/K30.cpp +++ /dev/null @@ -1,46 +0,0 @@ -#include "Arduino.h" -#include "K30.h" -#include "Wire.h" - - -K30::K30(TwoWire *wire, uint16_t i2c_address) : Sensor("CO2 Sensor", "K30", "ppm CO2", 2000) { - this->wire = wire; - _i2c_address = i2c_address; -} - -bool K30::init(){ - wire->begin(); - return true; -} - -float K30::read() -{ - byte recValue[4] = {0,0,0,0}; - - // Instruct to take a reading - wire->beginTransmission(_i2c_address); - wire->write(0x22); - wire->write(0x00); - wire->write(0x08); - wire->write(0x2A); - wire->endTransmission(); - delay(30); - - // Request reading - wire->requestFrom(_i2c_address,4); - delay(20); - - byte i=0; - while(wire->available()) - { - recValue[i] = wire->read(); - i++; - } - - byte checkSum = recValue[0] + recValue[1] + recValue[2]; - - if (checkSum == recValue[3]){ - return (recValue[1] << 8) + recValue[2]; - } - return NAN; -} diff --git a/software/PeaPodOS-Arduino/src/K30.h b/software/PeaPodOS-Arduino/src/K30.h deleted file mode 100644 index 67ff96d7..00000000 --- a/software/PeaPodOS-Arduino/src/K30.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef K30_h -#define K30_h - -#include "Arduino.h" -#include "Wire.h" -#include "Sensor.h" - -#define K30_DEFAULT_ADDR 0x68 - -extern TwoWire Wire; - -class K30 : public Sensor -{ - public: - K30(TwoWire *wire = &Wire, uint16_t i2c_address = K30_DEFAULT_ADDR); - private: - float read() override; - bool init() override; - int _i2c_address; - TwoWire *wire; -}; -#endif diff --git a/software/PeaPodOS-Arduino/src/LED.cpp b/software/PeaPodOS-Arduino/src/LED.cpp deleted file mode 100644 index 04e5bbb1..00000000 --- a/software/PeaPodOS-Arduino/src/LED.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "LED.h" - -LED::LED(uint8_t pin) : Actuator("LED", "led0", "led"){ - this->pin = pin; -} - -bool LED::init(){ - this->target = 0; - pinMode(this->pin, OUTPUT); - return true; -} - -void LED::update(){ - // Clamp to 0target = min(max(target, 0), 1); - Serial.println(this->target*255); - analogWrite(this->pin, this->target*255); -} \ No newline at end of file diff --git a/software/PeaPodOS-Arduino/src/LED.h b/software/PeaPodOS-Arduino/src/LED.h deleted file mode 100644 index 528fc407..00000000 --- a/software/PeaPodOS-Arduino/src/LED.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef LED_H -#define LED_H - -#include "Actuator.h" - -class LED : public Actuator { - public: - LED(uint8_t pin); - private: - void update() override; - bool init() override; - /** - * PWM output pin. - * */ - uint8_t pin; -}; - -#endif \ No newline at end of file diff --git a/software/PeaPodOS-Arduino/src/NAU7802.cpp b/software/PeaPodOS-Arduino/src/NAU7802.cpp deleted file mode 100644 index 39209885..00000000 --- a/software/PeaPodOS-Arduino/src/NAU7802.cpp +++ /dev/null @@ -1,435 +0,0 @@ -/* - This is an Arduino library written for the NAU7802 24-bit wheatstone - bridge and load cell amplifier. - By Nathan Seidle @ SparkFun Electronics, March 3nd, 2019 - - The NAU7802 is an I2C device that converts analog signals to a 24-bit - digital signal. This makes it possible to create your own digital scale - either by hacking an off-the-shelf bathroom scale or by creating your - own scale using a load cell. - - The NAU7802 is a better version of the popular HX711 load cell amplifier. - It uses a true I2C interface so that it can share the bus with other - I2C devices while still taking very accurate 24-bit load cell measurements - up to 320Hz. - - https://github.com/sparkfun/SparkFun_Qwiic_Scale_NAU7802_Arduino_Library - - SparkFun labored with love to create this code. Feel like supporting open - source? Buy a board from SparkFun! - https://www.sparkfun.com/products/15242 -*/ - -#include "NAU7802.h" - -//Constructor -NAU7802::NAU7802(TwoWire *wire) -{ - _i2cPort = wire; -} - -//Sets up the NAU7802 for basic function -//If initialize is true (or not specified), default init and calibration is performed -//If initialize is false, then it's up to the caller to initalize and calibrate -//Returns true upon completion -bool NAU7802::begin(uint8_t addr, bool initialize) -{ - _deviceAddress = addr; - - // Serial.print("Connection attempt 1... "); - if(!isConnected()){ - // Serial.print("Failed.\nConnection attempt 2... "); - if(!isConnected()){ - // Serial.print("Failed. Check wiring."); - return false; - } - } - // Serial.println("Success."); - - bool result = true; //Accumulate a result as we do the setup - - if (initialize) - { - - // Serial.print("Resetting... "); - result &= reset(); //Reset all registers - // if(!result){Serial.println("Failed.");}else{Serial.print("\n");} - - // Serial.print("Powering up... "); - result &= powerUp(); //Power on analog and digital sections of the scale - // if(!result){Serial.println("Failed.");}else{Serial.print("\n");} - - // Serial.print("Setting LDO... "); - result &= setLDO(NAU7802_LDO_3V3); //Set LDO to 3.3V - // if(!result){Serial.println("Failed.");}else{Serial.print("\n");} - - // Serial.print("Setting gain (x4)... "); - result &= setGain(NAU7802_GAIN_4); //Set gain to 4 - // if(!result){Serial.println("Failed.");}else{Serial.print("\n");} - - // Serial.print("Setting sample rate (20Hz)... "); - result &= setSampleRate(NAU7802_SPS_20); //Set samples per second to 20 - // if(!result){Serial.println("Failed.");}else{Serial.print("\n");} - - // Serial.print("Turning off CLK_CHP... "); - result &= setRegister(NAU7802_ADC, 0x30); //Turn off CLK_CHP. From 9.1 power on sequencing. - // if(!result){Serial.println("Failed.");}else{Serial.print("\n");} - - // Serial.print("Enabling channel 2 decoupling cap... "); - result &= setBit(NAU7802_PGA_PWR_PGA_CAP_EN, NAU7802_PGA_PWR); //Enable 330pF decoupling cap on chan 2. From 9.14 application circuit note. - // if(!result){Serial.println("Failed.");}else{Serial.print("\n");} - - // Serial.print("Recalibrating... "); - result &= calibrateAFE(); //Re-cal analog front end when we change gain, sample rate, or channel - // if(!result){Serial.println("Failed.");}else{Serial.print("\n");} - } - - return (result); -} - -//Returns true if device is present -//Tests for device ack to I2C address -bool NAU7802::isConnected() -{ - _i2cPort->beginTransmission(_deviceAddress); - if (_i2cPort->endTransmission() != 0) - return (false); //Sensor did not ACK - return (true); //All good -} - -//Returns true if Cycle Ready bit is set (conversion is complete) -bool NAU7802::available() -{ - return (getBit(NAU7802_PU_CTRL_CR, NAU7802_PU_CTRL)); -} - -//Calibrate analog front end of system. Returns true if CAL_ERR bit is 0 (no error) -//Takes approximately 344ms to calibrate; wait up to 1000ms. -//It is recommended that the AFE be re-calibrated any time the gain, SPS, or channel number is changed. -bool NAU7802::calibrateAFE() -{ - beginCalibrateAFE(); - return waitForCalibrateAFE(1000); -} - -//Begin asynchronous calibration of the analog front end. -// Poll for completion with calAFEStatus() or wait with waitForCalibrateAFE() -void NAU7802::beginCalibrateAFE() -{ - setBit(NAU7802_CTRL2_CALS, NAU7802_CTRL2); -} - -//Check calibration status. -NAU7802_Cal_Status NAU7802::calAFEStatus() -{ - if (getBit(NAU7802_CTRL2_CALS, NAU7802_CTRL2)) - { - return NAU7802_CAL_IN_PROGRESS; - } - - if (getBit(NAU7802_CTRL2_CAL_ERROR, NAU7802_CTRL2)) - { - return NAU7802_CAL_FAILURE; - } - - // Calibration passed - return NAU7802_CAL_SUCCESS; -} - -//Wait for asynchronous AFE calibration to complete with optional timeout. -//If timeout is not specified (or set to 0), then wait indefinitely. -//Returns true if calibration completes succsfully, otherwise returns false. -bool NAU7802::waitForCalibrateAFE(uint32_t timeout_ms) -{ - uint32_t begin = millis(); - NAU7802_Cal_Status cal_ready; - - while ((cal_ready = calAFEStatus()) == NAU7802_CAL_IN_PROGRESS) - { - if ((timeout_ms > 0) && ((millis() - begin) > timeout_ms)) - { - break; - } - delay(1); - } - - if (cal_ready == NAU7802_CAL_SUCCESS) - { - return (true); - } - return (false); -} - -//Set the readings per second -//10, 20, 40, 80, and 320 samples per second is available -bool NAU7802::setSampleRate(uint8_t rate) -{ - if (rate > 0b111) - rate = 0b111; //Error check - - uint8_t value = getRegister(NAU7802_CTRL2); - value &= 0b10001111; //Clear CRS bits - value |= rate << 4; //Mask in new CRS bits - - return (setRegister(NAU7802_CTRL2, value)); -} - -//Select between 1 and 2 -bool NAU7802::setChannel(uint8_t channelNumber) -{ - if (channelNumber == NAU7802_CHANNEL_1) - return (clearBit(NAU7802_CTRL2_CHS, NAU7802_CTRL2)); //Channel 1 (default) - else - return (setBit(NAU7802_CTRL2_CHS, NAU7802_CTRL2)); //Channel 2 -} - -//Power up digital and analog sections of scale -bool NAU7802::powerUp() -{ - setBit(NAU7802_PU_CTRL_PUD, NAU7802_PU_CTRL); - setBit(NAU7802_PU_CTRL_PUA, NAU7802_PU_CTRL); - - //Wait for Power Up bit to be set - takes approximately 200us - uint8_t counter = 0; - while (1) - { - if (getBit(NAU7802_PU_CTRL_PUR, NAU7802_PU_CTRL) == true) - break; //Good to go - delay(1); - if (counter++ > 100) - return (false); //Error - } - return (true); -} - -//Puts scale into low-power mode -bool NAU7802::powerDown() -{ - clearBit(NAU7802_PU_CTRL_PUD, NAU7802_PU_CTRL); - return (clearBit(NAU7802_PU_CTRL_PUA, NAU7802_PU_CTRL)); -} - -//Resets all registers to Power Of Defaults -bool NAU7802::reset() -{ - setBit(NAU7802_PU_CTRL_RR, NAU7802_PU_CTRL); //Set RR - delay(1); - return (clearBit(NAU7802_PU_CTRL_RR, NAU7802_PU_CTRL)); //Clear RR to leave reset state -} - -//Set the onboard Low-Drop-Out voltage regulator to a given value -//2.4, 2.7, 3.0, 3.3, 3.6, 3.9, 4.2, 4.5V are available -bool NAU7802::setLDO(uint8_t ldoValue) -{ - if (ldoValue > 0b111) - ldoValue = 0b111; //Error check - - //Set the value of the LDO - uint8_t value = getRegister(NAU7802_CTRL1); - value &= 0b11000111; //Clear LDO bits - value |= ldoValue << 3; //Mask in new LDO bits - setRegister(NAU7802_CTRL1, value); - - return (setBit(NAU7802_PU_CTRL_AVDDS, NAU7802_PU_CTRL)); //Enable the internal LDO -} - -//Set the gain -//x1, 2, 4, 8, 16, 32, 64, 128 are avaialable -bool NAU7802::setGain(uint8_t gainValue) -{ - if (gainValue > 0b111) - gainValue = 0b111; //Error check - - uint8_t value = getRegister(NAU7802_CTRL1); - value &= 0b11111000; //Clear gain bits - value |= gainValue; //Mask in new bits - - return (setRegister(NAU7802_CTRL1, value)); -} - -//Get the revision code of this IC -uint8_t NAU7802::getRevisionCode() -{ - uint8_t revisionCode = getRegister(NAU7802_DEVICE_REV); - return (revisionCode & 0x0F); -} - -//Returns 24-bit reading -//Assumes CR Cycle Ready bit (ADC conversion complete) has been checked to be 1 -int32_t NAU7802::getReading() -{ - _i2cPort->beginTransmission(_deviceAddress); - _i2cPort->write(NAU7802_ADCO_B2); - if (_i2cPort->endTransmission() != 0) - return (false); //Sensor did not ACK - - _i2cPort->requestFrom((uint8_t)_deviceAddress, (uint8_t)3); - - if (_i2cPort->available()) - { - uint32_t valueRaw = (uint32_t)_i2cPort->read() << 16; //MSB - valueRaw |= (uint32_t)_i2cPort->read() << 8; //MidSB - valueRaw |= (uint32_t)_i2cPort->read(); //LSB - - // the raw value coming from the ADC is a 24-bit number, so the sign bit now - // resides on bit 23 (0 is LSB) of the uint32_t container. By shifting the - // value to the left, I move the sign bit to the MSB of the uint32_t container. - // By casting to a signed int32_t container I now have properly recovered - // the sign of the original value - int32_t valueShifted = (int32_t)(valueRaw << 8); - - // shift the number back right to recover its intended magnitude - int32_t value = (valueShifted >> 8); - - return (value); - } - - return (0); //Error -} - -//Return the average of a given number of readings -int32_t NAU7802::getAverage(uint16_t averageAmount) -{ - long total = 0; - uint16_t samplesAquired = 0; - - unsigned long startTime = millis(); - while (1) - { - if (available() == true) - { - total += getReading(); - if (++samplesAquired == averageAmount) - break; //All done - } - delay(1); - } - total /= averageAmount; - - return (total); -} - -//Call when scale is setup, level, at running temperature, with nothing on it -void NAU7802::calculateZeroOffset(uint16_t averageAmount) -{ - setZeroOffset(getAverage(averageAmount)); -} - -//Sets the internal variable. Useful for users who are loading values from NVM. -void NAU7802::setZeroOffset(int32_t newZeroOffset) -{ - _zeroOffset = newZeroOffset; - Serial.print("{\"type\":\"debug\",\"msg\":\"New zero: "); - Serial.print(String(_zeroOffset)); - Serial.println("\"}"); -} - -int32_t NAU7802::getZeroOffset() -{ - return (_zeroOffset); -} - -//Call after zeroing. Provide the float weight sitting on scale. Units do not matter. -void NAU7802::calculateCalibrationFactor(float weightOnScale, uint16_t averageAmount) -{ - int32_t onScale = getAverage(averageAmount); - float newCalFactor = (onScale - _zeroOffset) / (float)weightOnScale; - setCalibrationFactor(newCalFactor); -} - -//Pass a known calibration factor into library. Helpful if users is loading settings from NVM. -//If you don't know your cal factor, call setZeroOffset(), then calculateCalibrationFactor() with a known weight -void NAU7802::setCalibrationFactor(float newCalFactor) -{ - Serial.print("{\"type\":\"debug\",\"msg\":\"New calibration factor: "); - Serial.print(String(newCalFactor)); - Serial.println("\"}"); - _calibrationFactor = newCalFactor; -} - -float NAU7802::getCalibrationFactor() -{ - return (_calibrationFactor); -} - -//Returns the y of y = mx + b using the current weight on scale, the cal factor, and the offset. -float NAU7802::getWeight(bool allowNegativeWeights, uint16_t samplesToTake) -{ - int32_t onScale = getAverage(samplesToTake); - - //Prevent the current reading from being less than zero offset - //This happens when the scale is zero'd, unloaded, and the load cell reports a value slightly less than zero value - //causing the weight to be negative or jump to millions of pounds - if (allowNegativeWeights == false) - { - if (onScale < _zeroOffset) - onScale = _zeroOffset; //Force reading to zero - } - - float weight = (onScale - _zeroOffset) / _calibrationFactor; - return (weight); -} - -//Set Int pin to be high when data is ready (default) -bool NAU7802::setIntPolarityHigh() -{ - return (clearBit(NAU7802_CTRL1_CRP, NAU7802_CTRL1)); //0 = CRDY pin is high active (ready when 1) -} - -//Set Int pin to be low when data is ready -bool NAU7802::setIntPolarityLow() -{ - return (setBit(NAU7802_CTRL1_CRP, NAU7802_CTRL1)); //1 = CRDY pin is low active (ready when 0) -} - -//Mask & set a given bit within a register -bool NAU7802::setBit(uint8_t bitNumber, uint8_t registerAddress) -{ - uint8_t value = getRegister(registerAddress); - value |= (1 << bitNumber); //Set this bit - return (setRegister(registerAddress, value)); -} - -//Mask & clear a given bit within a register -bool NAU7802::clearBit(uint8_t bitNumber, uint8_t registerAddress) -{ - uint8_t value = getRegister(registerAddress); - value &= ~(1 << bitNumber); //Set this bit - return (setRegister(registerAddress, value)); -} - -//Return a given bit within a register -bool NAU7802::getBit(uint8_t bitNumber, uint8_t registerAddress) -{ - uint8_t value = getRegister(registerAddress); - value &= (1 << bitNumber); //Clear all but this bit - return (value); -} - -//Get contents of a register -uint8_t NAU7802::getRegister(uint8_t registerAddress) -{ - _i2cPort->beginTransmission(_deviceAddress); - _i2cPort->write(registerAddress); - if (_i2cPort->endTransmission() != 0) - return (-1); //Sensor did not ACK - - _i2cPort->requestFrom((uint8_t)_deviceAddress, (uint8_t)1); - - if (_i2cPort->available()) - return (_i2cPort->read()); - - return (-1); //Error -} - -//Send a given value to be written to given address -//Return true if successful -bool NAU7802::setRegister(uint8_t registerAddress, uint8_t value) -{ - _i2cPort->beginTransmission(_deviceAddress); - _i2cPort->write(registerAddress); - _i2cPort->write(value); - if (_i2cPort->endTransmission() != 0) - return (false); //Sensor did not ACK - return (true); -} diff --git a/software/PeaPodOS-Arduino/src/NAU7802.h b/software/PeaPodOS-Arduino/src/NAU7802.h deleted file mode 100644 index a4399f0e..00000000 --- a/software/PeaPodOS-Arduino/src/NAU7802.h +++ /dev/null @@ -1,224 +0,0 @@ -/* - This is an Arduino library written for the NAU7802 24-bit wheatstone - bridge and load cell amplifier. - By Nathan Seidle @ SparkFun Electronics, March 3nd, 2019 - - The NAU7802 is an I2C device that converts analog signals to a 24-bit - digital signal. This makes it possible to create your own digital scale - either by hacking an off-the-shelf bathroom scale or by creating your - own scale using a load cell. - - The NAU7802 is a better version of the popular HX711 load cell amplifier. - It uses a true I2C interface so that it can share the bus with other - I2C devices while still taking very accurate 24-bit load cell measurements - up to 320Hz. - - https://github.com/sparkfun/SparkFun_NAU7802_Scale_Arduino_Library - - SparkFun labored with love to create this code. Feel like supporting open - source? Buy a board from SparkFun! - https://www.sparkfun.com/products/15242 -*/ - -#ifndef NAU7802_h -#define NAU7802_h - -#include "Arduino.h" -#include "Wire.h" - -#define ACK_TRIES 2 - -//Register Map -typedef enum -{ - NAU7802_PU_CTRL = 0x00, - NAU7802_CTRL1, - NAU7802_CTRL2, - NAU7802_OCAL1_B2, - NAU7802_OCAL1_B1, - NAU7802_OCAL1_B0, - NAU7802_GCAL1_B3, - NAU7802_GCAL1_B2, - NAU7802_GCAL1_B1, - NAU7802_GCAL1_B0, - NAU7802_OCAL2_B2, - NAU7802_OCAL2_B1, - NAU7802_OCAL2_B0, - NAU7802_GCAL2_B3, - NAU7802_GCAL2_B2, - NAU7802_GCAL2_B1, - NAU7802_GCAL2_B0, - NAU7802_I2C_CONTROL, - NAU7802_ADCO_B2, - NAU7802_ADCO_B1, - NAU7802_ADCO_B0, - NAU7802_ADC = 0x15, //Shared ADC and OTP 32:24 - NAU7802_OTP_B1, //OTP 23:16 or 7:0? - NAU7802_OTP_B0, //OTP 15:8 - NAU7802_PGA = 0x1B, - NAU7802_PGA_PWR = 0x1C, - NAU7802_DEVICE_REV = 0x1F, -} Scale_Registers; - -//Bits within the PU_CTRL register -typedef enum -{ - NAU7802_PU_CTRL_RR = 0, - NAU7802_PU_CTRL_PUD, - NAU7802_PU_CTRL_PUA, - NAU7802_PU_CTRL_PUR, - NAU7802_PU_CTRL_CS, - NAU7802_PU_CTRL_CR, - NAU7802_PU_CTRL_OSCS, - NAU7802_PU_CTRL_AVDDS, -} PU_CTRL_Bits; - -//Bits within the CTRL1 register -typedef enum -{ - NAU7802_CTRL1_GAIN = 2, - NAU7802_CTRL1_VLDO = 5, - NAU7802_CTRL1_DRDY_SEL = 6, - NAU7802_CTRL1_CRP = 7, -} CTRL1_Bits; - -//Bits within the CTRL2 register -typedef enum -{ - NAU7802_CTRL2_CALMOD = 0, - NAU7802_CTRL2_CALS = 2, - NAU7802_CTRL2_CAL_ERROR = 3, - NAU7802_CTRL2_CRS = 4, - NAU7802_CTRL2_CHS = 7, -} CTRL2_Bits; - -//Bits within the PGA register -typedef enum -{ - NAU7802_PGA_CHP_DIS = 0, - NAU7802_PGA_INV = 3, - NAU7802_PGA_BYPASS_EN, - NAU7802_PGA_OUT_EN, - NAU7802_PGA_LDOMODE, - NAU7802_PGA_RD_OTP_SEL, -} PGA_Bits; - -//Bits within the PGA PWR register -typedef enum -{ - NAU7802_PGA_PWR_PGA_CURR = 0, - NAU7802_PGA_PWR_ADC_CURR = 2, - NAU7802_PGA_PWR_MSTR_BIAS_CURR = 4, - NAU7802_PGA_PWR_PGA_CAP_EN = 7, -} PGA_PWR_Bits; - -//Allowed Low drop out regulator voltages -typedef enum -{ - NAU7802_LDO_2V4 = 0b111, - NAU7802_LDO_2V7 = 0b110, - NAU7802_LDO_3V0 = 0b101, - NAU7802_LDO_3V3 = 0b100, - NAU7802_LDO_3V6 = 0b011, - NAU7802_LDO_3V9 = 0b010, - NAU7802_LDO_4V2 = 0b001, - NAU7802_LDO_4V5 = 0b000, -} NAU7802_LDO_Values; - -//Allowed gains -typedef enum -{ - NAU7802_GAIN_128 = 0b111, - NAU7802_GAIN_64 = 0b110, - NAU7802_GAIN_32 = 0b101, - NAU7802_GAIN_16 = 0b100, - NAU7802_GAIN_8 = 0b011, - NAU7802_GAIN_4 = 0b010, - NAU7802_GAIN_2 = 0b001, - NAU7802_GAIN_1 = 0b000, -} NAU7802_Gain_Values; - -//Allowed samples per second -typedef enum -{ - NAU7802_SPS_320 = 0b111, - NAU7802_SPS_80 = 0b011, - NAU7802_SPS_40 = 0b010, - NAU7802_SPS_20 = 0b001, - NAU7802_SPS_10 = 0b000, -} NAU7802_SPS_Values; - -//Select between channel values -typedef enum -{ - NAU7802_CHANNEL_1 = 0, - NAU7802_CHANNEL_2 = 1, -} NAU7802_Channels; - -//Calibration state -typedef enum -{ - NAU7802_CAL_SUCCESS = 0, - NAU7802_CAL_IN_PROGRESS = 1, - NAU7802_CAL_FAILURE = 2, -} NAU7802_Cal_Status; - -extern TwoWire Wire; - -class NAU7802 -{ -public: - NAU7802(TwoWire *wire = &Wire); //Default constructor - bool begin(uint8_t addr = 0x2A, bool initialize = true); //Check communication and initialize sensor - bool isConnected(); //Returns true if device acks at the I2C address - - bool available(); //Returns true if Cycle Ready bit is set (conversion is complete) - int32_t getReading(); //Returns 24-bit reading. Assumes CR Cycle Ready bit (ADC conversion complete) has been checked by .available() - int32_t getAverage(uint16_t samplesToTake); //Return the average of a given number of readings - - void calculateZeroOffset(uint16_t averageAmount = 8); //Also called taring. Call this with nothing on the scale - void setZeroOffset(int32_t newZeroOffset); //Sets the internal variable. Useful for users who are loading values from NVM. - int32_t getZeroOffset(); //Ask library for this value. Useful for storing value into NVM. - - void calculateCalibrationFactor(float weightOnScale, uint16_t averageAmount = 8); //Call this with the value of the thing on the scale. Sets the calibration factor based on the weight on scale and zero offset. - void setCalibrationFactor(float calFactor); //Pass a known calibration factor into library. Helpful if users is loading settings from NVM. - float getCalibrationFactor(); //Ask library for this value. Useful for storing value into NVM. - - float getWeight(bool allowNegativeWeights = false, uint16_t samplesToTake = 8); //Once you've set zero offset and cal factor, you can ask the library to do the calculations for you. - - bool setGain(uint8_t gainValue); //Set the gain. x1, 2, 4, 8, 16, 32, 64, 128 are available - bool setLDO(uint8_t ldoValue); //Set the onboard Low-Drop-Out voltage regulator to a given value. 2.4, 2.7, 3.0, 3.3, 3.6, 3.9, 4.2, 4.5V are avaialable - bool setSampleRate(uint8_t rate); //Set the readings per second. 10, 20, 40, 80, and 320 samples per second is available - bool setChannel(uint8_t channelNumber); //Select between 1 and 2 - - bool calibrateAFE(); //Synchronous calibration of the analog front end of the NAU7802. Returns true if CAL_ERR bit is 0 (no error) - void beginCalibrateAFE(); //Begin asynchronous calibration of the analog front end of the NAU7802. Poll for completion with calAFEStatus() or wait with waitForCalibrateAFE(). - bool waitForCalibrateAFE(uint32_t timeout_ms = 0); //Wait for asynchronous AFE calibration to complete with optional timeout. - NAU7802_Cal_Status calAFEStatus(); //Check calibration status. - - bool reset(); //Resets all registers to Power Of Defaults - - bool powerUp(); //Power up digital and analog sections of scale, ~2mA - bool powerDown(); //Puts scale into low-power 200nA mode - - bool setIntPolarityHigh(); //Set Int pin to be high when data is ready (default) - bool setIntPolarityLow(); //Set Int pin to be low when data is ready - - uint8_t getRevisionCode(); //Get the revision code of this IC. Always 0x0F. - - bool setBit(uint8_t bitNumber, uint8_t registerAddress); //Mask & set a given bit within a register - bool clearBit(uint8_t bitNumber, uint8_t registerAddress); //Mask & clear a given bit within a register - bool getBit(uint8_t bitNumber, uint8_t registerAddress); //Return a given bit within a register - - uint8_t getRegister(uint8_t registerAddress); //Get contents of a register - bool setRegister(uint8_t registerAddress, uint8_t value); //Send a given value to be written to given address. Return true if successful - -private: - TwoWire *_i2cPort; //This stores the user's requested i2c port - uint8_t _deviceAddress; //Default unshifted 7-bit address of the NAU7802 - - //y = mx+b, default to NO CHANGE - int32_t _zeroOffset = 0; //This is b - float _calibrationFactor = 1.0; //This is m. User provides this number so that we can output y when requested -}; -#endif diff --git a/software/PeaPodOS-Arduino/src/SHT31.cpp b/software/PeaPodOS-Arduino/src/SHT31.cpp deleted file mode 100644 index 88e97348..00000000 --- a/software/PeaPodOS-Arduino/src/SHT31.cpp +++ /dev/null @@ -1,167 +0,0 @@ -#include "SHT31.h" - -/** - * One constructor, begin, and error checks all in one! solid. - * Assumes serial is ready. - * */ -SHT31::SHT31(TwoWire *wire){ - _wire = wire; - humidity = NAN; - temp = NAN; -} - -bool SHT31::begin(uint8_t i2caddr){ - _wire->begin(); - _i2caddr = i2caddr; - reset(); - begun = (readStatus() != 0xFFFF); - return begun; -} - -uint16_t SHT31::readStatus(void) { - writeCommand(SHT31_READSTATUS); - _wire->requestFrom(_i2caddr, (uint8_t)3); - uint16_t stat = _wire->read(); - stat <<= 8; - stat |= _wire->read(); - // Serial.println(stat, HEX); - return stat; -} - -void SHT31::reset(void) { - writeCommand(SHT31_SOFTRESET); - delay(10); -} - -void SHT31::heater(bool h) { - if (h) - writeCommand(SHT31_HEATEREN); - else - writeCommand(SHT31_HEATERDIS); - delay(1); -} - -/*! - * @brief Return sensor heater state - * @return heater state (TRUE = enabled, FALSE = disabled) - */ -bool SHT31::isHeaterEnabled() { - uint16_t regValue = readStatus(); - return (bool)bitRead(regValue, SHT31_REG_HEATER_BIT); -} - -float SHT31::readTemperature(void) { - if (!readTempHum()){ - return NAN; - } - return temp; -} - -float SHT31::readHumidity(void) { - if (!readTempHum()){ - return NAN; - } - return humidity; -} - -/** - * Performs a CRC8 calculation on the supplied values. - * - * @param data Pointer to the data to use when calculating the CRC8. - * @param len The number of bytes in 'data'. - * - * @return The computed CRC8 value. - */ -static uint8_t crc8(const uint8_t *data, int len) { - /* - * - * CRC-8 formula from page 14 of SHT spec pdf - * - * Test data 0xBE, 0xEF should yield 0x92 - * - * Initialization data 0xFF - * Polynomial 0x31 (x8 + x5 +x4 +1) - * Final XOR 0x00 - */ - - const uint8_t POLYNOMIAL(0x31); - uint8_t crc(0xFF); - - for (int j = len; j; --j) { - crc ^= *data++; - - for (int i = 8; i; --i) { - crc = (crc & 0x80) ? (crc << 1) ^ POLYNOMIAL : (crc << 1); - } - } - return crc; -} - -bool SHT31::readTempHum(void) { - uint8_t readbuffer[6]; - - writeCommand(SHT31_MEAS_HIGHREP); - - delay(20); - _wire->requestFrom(_i2caddr, sizeof(readbuffer)); - if (_wire->available() != sizeof(readbuffer)) - return false; - for (size_t i = 0; i < sizeof(readbuffer); i++) { - readbuffer[i] = _wire->read(); - } - - if (readbuffer[2] != crc8(readbuffer, 2) || - readbuffer[5] != crc8(readbuffer + 3, 2)) - return false; - - int32_t stemp = (int32_t)(((uint32_t)readbuffer[0] << 8) | readbuffer[1]); - // simplified (65536 instead of 65535) integer version of: - // temp = (stemp * 175.0f) / 65535.0f - 45.0f; - stemp = ((4375 * stemp) >> 14) - 4500; - temp = (float)stemp / 100.0f; - - uint32_t shum = ((uint32_t)readbuffer[3] << 8) | readbuffer[4]; - // simplified (65536 instead of 65535) integer version of: - // humidity = (shum * 100.0f) / 65535.0f; - shum = (625 * shum) >> 12; - humidity = (float)shum / 100.0f; - - return true; -} - -void SHT31::writeCommand(uint16_t cmd) { - _wire->beginTransmission(_i2caddr); - _wire->write(cmd >> 8); - _wire->write(cmd & 0xFF); - _wire->endTransmission(); -} - -bool SHT31::hasBegun(){ - return begun; -} - -//Yatta yatta - -SHT31_temp::SHT31_temp(SHT31 *sensor) : Sensor("Temperature Sensor", "SHT31", "Air Temperature", 1000){ - this->sensor = sensor; -} - -float SHT31_temp::read(){ - return sensor->readTemperature(); -} - -bool SHT31_temp::init(){ - return sensor->hasBegun() || sensor->begin(); -} - -SHT31_hum::SHT31_hum(SHT31 *sensor) : Sensor("Humidity Sensor", "SHT31", "Air Humidity", 1000){ - this->sensor = sensor; -} - -float SHT31_hum::read(){ - return sensor->readHumidity(); -} - -bool SHT31_hum::init(){ - return sensor->hasBegun() || sensor->begin(); -} \ No newline at end of file diff --git a/software/PeaPodOS-Arduino/src/SHT31.h b/software/PeaPodOS-Arduino/src/SHT31.h deleted file mode 100644 index e25b138a..00000000 --- a/software/PeaPodOS-Arduino/src/SHT31.h +++ /dev/null @@ -1,147 +0,0 @@ -#ifndef SHT31_H -#define SHT31_H - -#include "Arduino.h" -#include "Sensor.h" -#include "Wire.h" - -#define SHT31_DEFAULT_ADDR 0x44 /**< SHT31 Default Address */ -#define SHT31_MEAS_HIGHREP_STRETCH \ - 0x2C06 /**< Measurement High Repeatability with Clock Stretch Enabled */ -#define SHT31_MEAS_MEDREP_STRETCH \ - 0x2C0D /**< Measurement Medium Repeatability with Clock Stretch Enabled */ -#define SHT31_MEAS_LOWREP_STRETCH \ - 0x2C10 /**< Measurement Low Repeatability with Clock Stretch Enabled*/ -#define SHT31_MEAS_HIGHREP \ - 0x2400 /**< Measurement High Repeatability with Clock Stretch Disabled */ -#define SHT31_MEAS_MEDREP \ - 0x240B /**< Measurement Medium Repeatability with Clock Stretch Disabled */ -#define SHT31_MEAS_LOWREP \ - 0x2416 /**< Measurement Low Repeatability with Clock Stretch Disabled */ -#define SHT31_READSTATUS 0xF32D /**< Read Out of Status Register */ -#define SHT31_CLEARSTATUS 0x3041 /**< Clear Status */ -#define SHT31_SOFTRESET 0x30A2 /**< Soft Reset */ -#define SHT31_HEATEREN 0x306D /**< Heater Enable */ -#define SHT31_HEATERDIS 0x3066 /**< Heater Disable */ -#define SHT31_REG_HEATER_BIT 0x0d /**< Status Register Heater Bit */ - -extern TwoWire Wire; /**< Forward declarations of Wire for board/variant - combinations that don't have a default 'Wire' */ - -/** - * Driver for the Adafruit SHT31-D Temperature and Humidity breakout board. - */ -class SHT31 { -public: - /** - * Constructor. - */ - SHT31(TwoWire *theWire = &Wire); - - bool begin(uint8_t i2caddr = SHT31_DEFAULT_ADDR); - - /** - * Gets a single temperature reading from the sensor. - * - * @return A float value indicating the temperature. - */ - float readTemperature(void); - - /** - * Gets a single relative humidity reading from the sensor. - * - * @return A float value representing relative humidity. - */ - float readHumidity(void); - - /** - * Gets the current status register contents. - * - * @return The 16-bit status register. - */ - uint16_t readStatus(void); - - /** - * Performs a reset of the sensor to put it into a known state. - */ - void reset(void); - - /** - * Enables or disabled the heating element. - * - * @param h True to enable the heater, False to disable it. - */ - void heater(bool h); - - /** - * Gets the current status register heater bit. - * - * @return Boolean value, True = enabled, False = disabled. - */ - bool isHeaterEnabled(); - - TwoWire *_wire; /**< Wire object */ - - bool hasBegun(); - -protected: - bool begun = false; -private: - /** - * Placeholder to track humidity internally. - */ - float humidity; - - /** - * Placeholder to track temperature internally. - */ - float temp; - - /** - * Placeholder to track the I2C address. - */ - uint8_t _i2caddr; - - /** - * Internal function to perform a temp + humidity read. - * - * @return True if successful, otherwise false. - */ - bool readTempHum(void); - - /** - * Internal function to perform and I2C write. - * - * @param cmd The 16-bit command ID to send. - */ - void writeCommand(uint16_t cmd); - - /** - * Internal function to read data over the I2C bus. - * - * @return True if successful, otherwise False. - */ - bool readData(void); -}; - -//WRAPPER CLASSES - Sensor derivatives do define "_read()" using ONE SHT31 object. - -class SHT31_temp : public Sensor{ - private: - SHT31 *sensor; - float read() override; - bool init() override; - public: - SHT31_temp(SHT31 *sensor); -}; - -class SHT31_hum : public Sensor{ - private: - SHT31 *sensor; - float read() override; - bool init() override; - public: - SHT31_hum(SHT31 *sensor); -}; - -#endif diff --git a/software/PeaPodOS-Arduino/src/Scale.cpp b/software/PeaPodOS-Arduino/src/Scale.cpp deleted file mode 100644 index 3ee49da6..00000000 --- a/software/PeaPodOS-Arduino/src/Scale.cpp +++ /dev/null @@ -1,47 +0,0 @@ -#include "Scale.h" -#include "NAU7802.h" - -Scale::Scale() : Sensor("Scale", "NAU7802", "mass", 3){ - //Look up the calibration factor in EEPROM? -} - -bool Scale::init(){ - return (nau7802.begin()); -} - -//if readings < avg readings: total += reading (checks available), readings++, return NAN -//else calculate average reading, reset readings and total, return avg converted to weight - -float Scale::read(){ - - if(!nau7802.available()){ - return NAN; - // Serial.println("NAU7802 not available!"); - } - - //Non-intrusive average - if(i < AVG_READINGS){ - total += nau7802.getReading(); - i++; - return NAN; - } - - double result = (total/AVG_READINGS-nau7802.getZeroOffset())/(nau7802.getCalibrationFactor()); - restart(); - - return (float)result; -} - -void Scale::calibrate(float grams){ - if(grams == 0.0){ - nau7802.calculateZeroOffset(CALIBRATION_READINGS); - } else { - nau7802.calculateCalibrationFactor(grams, CALIBRATION_READINGS); - } - restart(); -} - -void Scale::restart(){ - i = 0; - total = 0; -} \ No newline at end of file diff --git a/software/PeaPodOS-Arduino/src/Scale.h b/software/PeaPodOS-Arduino/src/Scale.h deleted file mode 100644 index cffbf7be..00000000 --- a/software/PeaPodOS-Arduino/src/Scale.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef Scale_H -#define Scale_H - -#include "Arduino.h" -#include "NAU7802.h" -#include "Sensor.h" - -#define AVG_READINGS 320 -#define CALIBRATION_READINGS 80 - -class Scale : public Sensor { - public: - Scale(); - void calibrate(float grams); //Calibrates the scale using a known load (or 0 to tare) - void restart(); - private: - bool init() override; - float read() override; - NAU7802 nau7802 = NAU7802(); //Default constructed NAU7802 object - uint16_t i = 0; - int32_t total = 0; - // float readings[AVG_READINGS]; -}; - -#endif \ No newline at end of file diff --git a/software/PeaPodOS-Arduino/src/Sensor.cpp b/software/PeaPodOS-Arduino/src/Sensor.cpp deleted file mode 100644 index e6559504..00000000 --- a/software/PeaPodOS-Arduino/src/Sensor.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include "Arduino.h" -#include "Sensor.h" - -/** - * Constructor. - * @param _name - Meaningful, readable name of the sensor. - * @param _id - Identifying name of the associated hardware. - * @param _evname - Name of the environment variable the sensor records. - * @param _delta - The minimum time (in ms) between sensor reads. - * @param __read - Pointer to the hardware-level read function. - * @param _args - Pointer to static arguments to pass to hardware-level read function. - **/ -Sensor::Sensor(String name, String id, String evname, uint16_t delta){ - this->id = id; - this->name = name; - this->evname = evname; - //"Air Temperature" -> "air-temperature" - this->evname.toLowerCase(); - this->evname.replace(' ','-'); - this->delta = delta; - //Buffer - Resets the last read time to the current time - lastread = millis(); -} - -/** - * Wrapper for hardware-level read function. Checks that enough time has passed between reads, and checks for `ready` flag and types. - * @return Sensor read, or nan. Usually nan. Like 99% of the time nan. - **/ -float Sensor::getRead(){ - float result = NAN; - //Has enough time passed between reads? - if(ready && millis()-lastread > delta){ - result = read(); - //Reset the last read time to now - //BUFFER - Happens post-read - lastread = millis(); - cachedread = result; - } - return result; -} - -bool Sensor::begin(){ - ready = init(); - return ready; -} - -// Class = Type -// Object = Variable -// Constructor: function on class that creates the object (same name as class) -// `this` keyword - diff --git a/software/PeaPodOS-Arduino/src/Sensor.h b/software/PeaPodOS-Arduino/src/Sensor.h deleted file mode 100644 index 5f5c0ed7..00000000 --- a/software/PeaPodOS-Arduino/src/Sensor.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef Sensor_H -#define Sensor_H - -#include "Arduino.h" - -class Sensor{ - private: - //The minimum time (in ms) between sensor reads. - uint16_t delta; - //The last time the sensor was read, ms since program start. - unsigned long lastread; - protected: - virtual float read() = 0; - virtual bool init() = 0; - //Has begin() been performed by THIS object? - bool ready = false; - float cachedread; - public: - /** - * Hardware ID. - */ - String id; - /** - * Meaningful, readable name of the sensor. - */ - String name; - /** - * Preformatted (lowercase and underscored) name of the environment variable the sensor records. - */ - String evname; - Sensor(String name, String id, String evname, uint16_t delta); - //Calls read() and manages delta - float getRead(); - //Sets ready in accordance with init() - bool begin(); -}; - -#endif \ No newline at end of file diff --git a/software/README.md b/software/README.md index edef1ebf..ca3f8618 100644 --- a/software/README.md +++ b/software/README.md @@ -1,9 +1,11 @@ -# PeaPodOS +# PeaPod OS [![issuesopen](https://img.shields.io/github/issues/PeaPodTechnologies/peapod)](https://github.com/PeaPodTech/PeaPod/issues) [![issuesclosed](https://img.shields.io/github/issues-closed/PeaPodTechnologies/peapod)](https://github.com/PeaPodTech/PeaPod/issues?q=is%3Aissue+is%3Aclosed) [![opensource](https://img.shields.io/badge/open-source-red)](https://github.com/PeaPodTechnologies/PeaPod/issues?q=is%3Aopen+is%3Aissue+label%3A%22Status%3A+Open%22) ![coffee](https://img.shields.io/badge/powered%20by-coffee-brown) [![24/7](https://img.shields.io/badge/Eat,%20Sleep,-PeaPod-darkgreen)](https://www.youtube.com/watch?v=2zWv9JC5G3w) [![FLDSMDFR](https://img.shields.io/badge/The-FLDSMDFR-orange)](https://www.youtube.com/watch?v=k8xFbWLUDoQ) +Main software for PeaPod. + A cloud-connected isolated and automated plant growth environment, able to generate any environment from a combination of independent environment parameters. Designed as both a hassle-free food production system and a research tool for precise and distributed mapping of the plant-environment relationship. @@ -11,56 +13,176 @@ Designed as both a hassle-free food production system and a research tool for pr *** ### Table of Contents - [Background](#background) -- [Development](#development) - [Production](#production) - [Setting Up Raspberry Pi](#setting-up-raspberry-pi) +- [Development](#development) + - [Arduino Test Suite](#arduino-test-suite) + - [Build from Source](#build-from-source) *** # Background - + *** -# Development - - - # Production ### Setting Up Raspberry Pi The following are performed on a computer: -1. Format a microSD card (>=4GB) with a single FAT partition. +1. Format a microSD card (>=32GB) with a single FAT partition. 2. Download the Raspberry Pi Imager [(Download)](https://www.raspberrypi.com/software/). -3. Flash the SD card with a *Raspberry Pi OS Lite* image. +3. Flash the SD card with a *Raspberry Pi OS Lite (64-bit)* image. -> Note: In Future, a custom PeaPod image will be released with steps 4-6 already complete. +> Note: In Future, a custom PeaPod Raspberry Pi OS Lite image will be released with steps 5, 6, and 12 already complete. 4. Plug in a keyboard and display, insert the microSD card, and power the Raspberry Pi device. -The following are performed on the Raspberry Pi: +The following are performed on the Raspberry Pi, with a keyboard and monitor: -5. Login with the default username (`pi`) and password (`raspberry`). +5. Login. 6. Execute `sudo raspi-config` and perform these steps to setup the Pi: - 1. *System Options > Wireless Lan* - Setup WiFi - 2. *System Options > Hostname* - Set a unique host name (`e.g. john-peapod`) - 3. *System Options > Boot/Auto Login* - Select `Console Autologin` - 4. Disable UART console - 5. *Interface Options > Camera* - Enable Camera - -7. Set up localization: - 1. Locale - 2. Timezone - 3. Keyboard - -> Note: In Future, step 8 will be automated at startup. -8. Update Packages: - 1. `sudo apt-get update` - 2. `sudo apt-get install nodejs npm` - 3. `sudo npm i -g @peapodtech/peapodos --save` - -9. Import `.env` file with Firebase and auth keys (TBA), as well as the field `SERIALPORT="/dev/ttyS0"`. This is the GPIO mini-UART on the Raspberry Pi Zero 2 W. - -11. Run the program by executing `peapodos`. \ No newline at end of file + 1. *System Options > Wireless Lan* - Setup WiFi and connect to the Internet (if not set from within imager) + 2. *System Options > Hostname* - Set a unique hostname, e.g. `peapod` (if not set from within imager) + 3. *System Options > Boot/Auto Login* - Select `Console Autologin` (B2) + 4. *Interface Options > SSH* - `Enable` SSH Server (if not set from within imager) + 5. *Interface Options > Serial Port* - `Disable` serial login shell, but `Enable` the serial port hardware + 6. *Performance Options > GPU Memory* - 256 MB (to support the camera module, if used) + 7. *Localisation Options > Locale* (i.e. `en_US.UTF-8`) + 8. *Localisation Options > Timezone* (i.e. `US` > `Eastern`) + 9. *Localisation Options > Keyboard* (i.e. `Generic 105-key` > `English (US)` > `Default` > `No compose key`) + 10. Optional: *Advanced Options > Expand Filesystem* + 11. Reboot to save: `sudo reboot` + +> You can now SSH into the Raspberry Pi to perform the rest of the setup (`ssh pi@{hostname}.local` with your chosen hostname, or with VS Code) + +> Note: In Future, steps 7-11 will be performed at runtime. +7. Update Packages: + 1. Update package listings, upgrade existing packages: `sudo apt update && sudo apt full-upgrade -y` + 2. Install Node.JS, the Node package manager, and *avrdude*: `sudo apt install -y nodejs npm avrdude python3-venv python3-dev` (could take a while) + 3. Install main software package: `sudo npm i -g @peapodtech/peapodos --save` + 4. If using a Raspberry Pi Camera, install the camera package: `sudo apt install -y libcamera-apps` + +8. Install [PlatformIO Core](https://docs.platformio.org/en/latest/core/installation/methods/installer-script.html#super-quick-macos-linux) + +9. Create a custom configuration file for the AVR flash utility *avrdude* to be able to program the Arduino Nano via ICSP over the Raspberry Pi's GPIO pins: + 1. Create a local copy of the *avrdude* configuration file with `cp /etc/avrdude.conf ~/avrdude_gpio.conf`, then modify your copy with `nano ~/avrdude_gpio.conf`. Copy the following to the end of the file: + + ``` + # Raspberry Pi GPIO configuration for avrdude. + programmer + id = "peapod"; + desc = "Use the Linux sysfs interface to bitbang GPIO lines"; + type = "linuxgpio"; + reset = 5; + sck = 6; + mosi = 12; + miso = 13; + ; + ``` + (*Ctrl-O* to save, *Ctrl-X* to exit) + 2. Verify the configuration and connection to the Arduino with `sudo avrdude -p m328p -C/avrdude_gpio.conf -c peapod -v`. A successful output should look something like: + ``` + avrdude: Version 6.3-20171130 + Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ + Copyright (c) 2007-2014 Joerg Wunsch + + System wide configuration file is "/home/pi/avrdude_gpio.conf" + User configuration file is "/root/.avrduderc" + User configuration file does not exist or is not a regular file, skipping + + Using Port : unknown + Using Programmer : peapod + AVR Part : ATmega328P + Chip Erase delay : 9000 us + PAGEL : PD7 + BS2 : PC2 + RESET disposition : dedicated + RETRY pulse : SCK + serial program mode : yes + parallel program mode : yes + Timeout : 200 + StabDelay : 100 + CmdexeDelay : 25 + SyncLoops : 32 + ByteDelay : 0 + PollIndex : 3 + PollValue : 0x53 + Memory Detail : + + Block Poll Page Polled + Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack + ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- + eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff + flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff + lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 + hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 + efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 + lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 + calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00 + signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00 + + Programmer Type : linuxgpio + Description : Use the Linux sysfs interface to bitbang GPIO lines + Pin assignment : /sys/class/gpio/gpio{n} + RESET = 8 + SCK = 11 + MOSI = 10 + MISO = 9 + + avrdude: AVR device initialized and ready to accept instructions + + Reading | ################################################## | 100% 0.00s + + avrdude: Device signature = 0x1e950f (probably m328p) + avrdude: safemode: lfuse reads as FF + avrdude: safemode: hfuse reads as DA + avrdude: safemode: efuse reads as FD + + avrdude: safemode: lfuse reads as FF + avrdude: safemode: hfuse reads as DA + avrdude: safemode: efuse reads as FD + avrdude: safemode: Fuses OK (E:FD, H:DA, L:FF) + + avrdude done. Thank you. + ``` + +10. Perform first-time flashing with `~/.platformio/penv/bin/platformio run -e peapod -d ~/microcontroller/ --target upload` + +11. Edit the `sudoers` file to allow `avrdude` to be executed using `sudo` *without a password*: + 1. Open the `sudoers` file: `sudo visudo` + 2. Add the following line to the end (assuming your username is `pi`, the hostname is `peapod`, and the `avrdude` binary is located at `/usr/bin/avrdude`): + + `pi peapod = (root) NOPASSWD: /usr/bin/avrdude` + + (*Ctrl-O* to save, *Ctrl-X* to exit; *avrdude* can be located with `whereis avrdude`) + + + +13. Populate a `.env` file with Firebase and Google and/or GitHub auth keys (a template is provided as `.env.template`), as well as the field `SERIALPORT="/dev/ttyS0"` (Raspberry Pi Zero 2 W GPIO mini-UART). + +14. Run the main program by executing `peapodos`. + + +# Development + +### Arduino Test Suite + +To run the PlatformIO test suite: `~/.platformio/penv/bin/platformio test -e peapod -d ~/microcontroller/` + +### Build from Source + +1. Install TypeScript language support and compiler, as well as a Node build tool: `sudo npm install -g typescript` +2. Clone this source, copy contents of `software/` (only the essentials: `index.ts`, `package.json`, `tsconfig.json`, `src/`, and `microcontroller/`)to home folder `~/` +3. Build the `serialport` package from source: `sudo npm install serialport --unsafe-perm --build-from-source` +4. Install all other Node dependencies: `npm i` +5. Compile: `tsc` +6. Populate the `.env` file (see `.env.template`) +7. Compile and upload microcontroller software: `~/.platformio/penv/bin/platformio run -e peapod -d ~/microcontroller/ --target upload` +8. Execute: `node .` \ No newline at end of file diff --git a/software/api.esbuild.mjs b/software/api.esbuild.mjs new file mode 100644 index 00000000..e8613d00 --- /dev/null +++ b/software/api.esbuild.mjs @@ -0,0 +1,47 @@ +import esbuild from 'esbuild'; +import { + esbuildPluginFilePathExtensions +} from 'esbuild-plugin-file-path-extensions'; + +console.log('Building API...'); + +const esbuildConfig = { + format: 'esm', + platform: 'node', + target: 'esnext', + packages: 'external', + bundle: true, + allowOverwrite: true, + keepNames: true, + outExtension: { '.js': '.mjs' }, + tsconfig: './api.tsconfig.json', + external: ['debug', 'ora', 'chalk', 'socket.io', 'blessed'], + plugins: [esbuildPluginFilePathExtensions({ + esm: true, + esmExtension: 'mjs', + filter: /^\..*\.(js|ts)$/ // '.*.js' or '.*.ts' + })] +}; + +// Build API +const build_api = esbuild.build({ + ...esbuildConfig, + entryPoints: ['./api/*.ts'], + outdir: './api/' +}); + +// Build server +const build_server = esbuild.build({ + ...esbuildConfig, + entryPoints: ['./server.ts'], + outdir: './' +}); + +// Build serial test +const build_serialtest = esbuild.build({ + ...esbuildConfig, + entryPoints: ['./serialtest.ts'], + outdir: './' +}); + +await Promise.all([build_api, build_server, build_serialtest]).catch((err) => { console.error(err); process.exit(1); } ); \ No newline at end of file diff --git a/software/api.tsconfig.json b/software/api.tsconfig.json new file mode 100644 index 00000000..410a342c --- /dev/null +++ b/software/api.tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "target": "esnext", + "lib": ["esnext"], + "strict": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "node", + "skipLibCheck": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "removeComments": true, + "baseUrl": "./", + "paths": { + "serialport": ["./lib/serialport/packages/serialport/lib/index"], + "@serialport/*": ["./lib/serialport/packages/*/lib/index"], + "serialport/*": ["./lib/serialport/packages/serialport/lib/*"] + } + }, + "include": ["./api/**/*.ts"], + "exclude": ["./node_modules/**", "./src/**", "./lib/**"] +} diff --git a/software/api/README.md b/software/api/README.md new file mode 100644 index 00000000..8628d4bf --- /dev/null +++ b/software/api/README.md @@ -0,0 +1,5 @@ +# API + +- Node.JS Console i.e. limited-input devices +- WebSockets, SQL, File Logging, Firebase, etc. +- diff --git a/software/api/controller.ts b/software/api/controller.ts new file mode 100644 index 00000000..a174cc11 --- /dev/null +++ b/software/api/controller.ts @@ -0,0 +1,424 @@ +import chalk from 'chalk'; +import { SerialPort, ReadlineParser } from 'serialport'; +import { ControllerTXError, DebugJsonSerialportError } from './errors'; +import { DebugJsonConsole as ui } from './ui'; +import { DebugJsonMessage, DebugJsonMessageTypes } from './types'; +import { updateMicrocontroller } from './utils'; +import { config } from 'process'; + +// import { Gpio } from 'onoff'; + +// CONSTANTS + +/** + * Baud rate for serial communication. Must match that found in microcontroller code. + */ +const BAUDRATE = 115200; + +/** + * Microcontroller software revision matching this software. + */ +export const CONTROLLER_REVISION = 0; // Just zero for now + +/** + * Seconds to wait between messages before timing out. + */ +const SERIAL_TIMEOUT_SECONDS = 5; + +const RESET_INTERVAL = 60000; +const BATCH_INTERVAL = 100; + +/** + * GPIO pin attached to the reset grounding circuit + */ +// const RESET_PIN = 26; + +export function findSerialPort(path?: string, matchExact: boolean = false): Promise { + return SerialPort.list().then(ports => { + let exact = false; + return ports.reduce((acc, port) => { + // console.log(JSON.stringify(port, null, 2)); + if(port && port['path']) { + if(!path) { + acc.push(port.path as string); + return acc; + } + if(matchExact && (port['path'] as string).toLowerCase() === path.toLowerCase()) { + exact = true; + acc = [port.path as string]; + } else if(!exact && (port['path'] as string).toLowerCase().includes(path.toLowerCase())) { + acc.push(port.path as string); + } + } + return acc; + }, [] as string[]); + }); +} + +export function getSerialPorts(): Promise { + return SerialPort.list().then(ports => { + return ports.map(port => port.path as string); + }); +} + +// TYPES + +/** + * Base type for any controller. + */ +export type Controller = { + /** + * Establish communications with the Controller. + * @param onMessage Pipe all received messages. + * @throws If received message is invalid (JSON parsing fails). + */ + // start(onMessage: (msg: ControllerMessage) => void): Promise; + start(onMessages: (messages: DebugJsonMessage[]) => void): Promise; + + /** + * Write instructions to the Controller. + * @param instructions Instruction set. + */ + // write(instructions: ControllerInstructions): void; + write(instructions: DebugJsonMessage): void; + + /** + * Halt communications with the Controller. + */ + stop(): Promise; +}; + +/** + * Messages FROM the controller + */ +// export type ControllerMessage = +// | { +// type: 'info' | 'debug' | 'error'; +// data: string; +// } +// | { +// type: 'data'; +// data: { +// label: string; +// value: number; +// }; +// } +// | { +// type: 'revision'; +// data: number; +// }; + +/** + * Messages TO the controller + */ +// export type ControllerInstructions = { +// [key: string]: number; +// }; + +/** + * Simulated controller parameters + */ +export type SimulatorConfig = { + [key: string]: { + min: number; + max: number; + interval: number; + }; +}; + +// CLASSES + +/** + * Interface between this computer and the microcontroller. + */ +export class MicroController implements Controller { + serial: SerialPort; + parser: ReadlineParser; + #timedout: boolean = false; + #count: number = 0; + #started: boolean = false; + #batch: DebugJsonMessage[] = []; + private timeout?: NodeJS.Timeout; + private resetInterval?: NodeJS.Timeout; + #lastBatch = Date.now(); + // private resetpin: Gpio; + + constructor(readonly serialport: string, readonly passRevision: boolean = true) { + // Reset pin GPIO interface + // this.resetpin = new Gpio(RESET_PIN, 'out'); + + // Create the serial port interface + this.serial = new SerialPort({ + path: serialport, + baudRate: BAUDRATE, + autoOpen: false, + }); + + this.serial.on('error', async (err) => { + // ui.fail(`CONTROLLER SERIAL: ${err}`); + throw new DebugJsonSerialportError(`${err.name} - ${err.message}`); + }); + + // Create the newline parser + this.parser = this.serial.pipe( + new ReadlineParser({ + delimiter: '\n', + includeDelimiter: false, + }) + ); + } + + // Starts serial (newline parser) and resolves when RX revision is correct + async start(onMessage: (messages: DebugJsonMessage[]) => void): Promise { + this.pauseTimeout(true); // Don't want it interrupting the start sequence + // Reset listeners + this.parser.removeAllListeners('data'); + + // resolve only on valid comms AND revision check + + // Reset the microcontroller (opens the serial port) + await this.reset(); + + // Reset the serial timeout interval + this.resetTimeout(); + + // Set up the reset interval + this.resetInterval = setInterval(() => { + ui.info('CONTROLLER RESET INTERVAL'); + this.reset(); + }, RESET_INTERVAL); + + this.parser.on('error', async (_err) => { + await this.reset().catch(() => {throw new DebugJsonSerialportError(`${_err.name} - ${_err.message}`)}); + }); + + // Set up the data listener + ui.start('CONTROLLER REVISION...'); + await new Promise((resolve) => { + this.parser.on('data', async (msgtxt) => { + this.resetTimeout(); + this.#count++; + + // Attempt to parse the raw text as a valid JSON object + const msg: DebugJsonMessage = JSON.parse(msgtxt); + + // Microcontroller-specific pre-handling + switch (msg.type) { + case 'revision': + // Software update + if (msg.data && Object.keys(msg.data).includes('revision') && msg.data['revision'] === CONTROLLER_REVISION) { + if(ui.spinning()) { + ui.succeed( + `CONTROLLER REVISION PASS! ${msg.data['revision']} === ${CONTROLLER_REVISION}` + ); + this.#started = true; + resolve(); + } + if(this.passRevision) { + onMessage([msg]); + } + return; + } else { + ui.fail( + `CONTROLLER REVISION FAIL: ${msg.data['revision'] ?? 'NULL'} !== ${CONTROLLER_REVISION}` + ); + // Attempt to update the microcontroller, and then restart + await this.stop(); + // ui.start('CONTROLLER FLASH...'); + // await updateMicrocontroller(); + // ui.succeed('CONTROLLER FLASH PASS!'); + } + break; + default: + if(this.#started) { + this.#batch.push(msg); + if(Date.now() - this.#lastBatch >= BATCH_INTERVAL) { + onMessage(this.#batch); + this.#batch = []; + this.#lastBatch = Date.now(); + } + } + break; + } + }); + }); + } + + /** + * Clear the serial timeout. + */ + private pauseTimeout(force: boolean = false): void { + if (this.timeout && (this.#timedout || force)) {clearTimeout(this.timeout);} + } + + /** + * Refresh (or start) the serial timeout. + */ + private resetTimeout(timeoutSeconds: number = SERIAL_TIMEOUT_SECONDS): void { + this.pauseTimeout(true); + this.timeout = setTimeout(() => { + ui.fail( + `CONTROLLER TIMEOUT: ${timeoutSeconds}s` + ); + this.#timedout = true; + // this.reset().catch((err) => {if(cb) {cb(err);}}); + this.reset(); + }, timeoutSeconds * 1000); + } + + write(msg: DebugJsonMessage): void { + ui.info(`[${chalk.yellow('WRITE')}] - ${JSON.stringify(msg)}`); + this.serial.write(JSON.stringify(msg) + '\n', undefined, (err) => { + if (err) throw new ControllerTXError(JSON.stringify(msg)); + }); + } + + stop(): Promise { + this.pauseTimeout(true); + if (!this.serial.isOpen) return Promise.resolve(); + return new Promise((resolve, reject) => { + this.serial.close((err) => { + if (err) { + reject(new DebugJsonSerialportError(`${err.name} - ${err.message}`)); + } else { + resolve(); + } + }); + }); + // Stop listening for data + // this.parser.removeAllListeners('data'); + } + + /** + * Resets the microcontroller by closing and re-opening serial. + */ + private reset(): Promise { + // Stop and reset + return this.stop().then(() => { + // this.resetpin.writeSync(1); + + this.#count = 0; + + // this.#started = false; + + // Wait, then stop resetting + // await new Promise((r) => setTimeout(r, 1000)); + // this.resetpin.writeSync(0); + + // (Re-)open serial + return new Promise((resolve, reject) => { + ui.start('CONTROLLER RESET...'); + this.serial.open((err) => { + if (err) { + ui.fail('CONTROLLER RESET FAIL!'); + reject(new DebugJsonSerialportError(`${err.name} - ${err.message}`)); + } else { + ui.succeed('CONTROLLER RESET PASS!'); + this.resetTimeout(); + resolve(); + } + }); + }); + }); + } +} + +/** + * A simulated controller for generating random data. + */ +export class SimulatedController implements Controller { + private intervals: NodeJS.Timeout[] = []; + private readonly startDate: number = Date.now(); + private output?: (msg: DebugJsonMessage[]) => void; + + constructor(readonly parameters: SimulatorConfig) {} + + async start(onMessage: (msg: DebugJsonMessage[]) => void): Promise { + this.output = onMessage; + for (const label of Object.keys(this.parameters)) { + this.intervals.push( + setInterval(() => { + onMessage( + [this.generateData( + label, + this.parameters[label].min, + this.parameters[label].max + )] + ); + }, this.parameters[label].interval) + ); + } + } + write(instructions: DebugJsonMessage): void { + switch(instructions.type) { + case 'command': + if(instructions.data && Object.keys(instructions.data).includes('rebuild')) { + ui.info('SIMULATED CONTROLLER REBUILD TREE'); + if(this.output) { + this.output([ + this.generateTree() + ]); + } + break; + } + case 'config': + if(instructions.data && Object.keys(instructions.data).includes('list')) { + ui.info('SIMULATED CONTROLLER LIST STATES'); + if(this.output) { + this.output([ + this.parameters ? { + type: 'config' as DebugJsonMessageTypes, + timestamp: Date.now() - this.startDate, + data: {'onoff': true, ...Object.keys(this.parameters).reduce<{[key: string]: number | boolean}>((acc, key) => { + const max = this.parameters[key].max; + const min = this.parameters[key].min; + acc[key] = Math.random() * (max - min) + min; + return acc; + }, {})}, + } : { + type: 'config' as DebugJsonMessageTypes, + timestamp: Date.now() - this.startDate, + data: {}, + } + ]); + } + break; + } + default: + ui.info(`SIMULATED CONTROLLER WRITE: ${JSON.stringify(instructions)}`); + break; + } + } + stop(): Promise { + for (const interval of this.intervals) { + clearInterval(interval); + } + return Promise.resolve(); + } + + /** + * Generate a single data point + * @param label Dataset label + * @param min Minimum value + * @param max Maximum value + */ + private generateData( + label: string, + min: number, + max: number + ): DebugJsonMessage { + const d = (Math.random() * (max - min) + min); + return { + type: 'event', + timestamp: Date.now() - this.startDate, + data: { + [label]: d, + }, + }; + } + + private generateTree() { + // modules: {devices: {id: string, fqa: number}[]}[] + return {type: 'tree' as DebugJsonMessageTypes, timestamp: Date.now() - this.startDate, data: Object.keys(this.parameters).reduce<{[key: string]: number[]}[]>((acc, label, idx) => { acc[0][label] = [idx]; return acc; }, [{}])}; + } +} diff --git a/software/api/env.ts b/software/api/env.ts new file mode 100644 index 00000000..bb979612 --- /dev/null +++ b/software/api/env.ts @@ -0,0 +1,150 @@ +import dotenv from 'dotenv'; +import { existsSync } from 'fs'; +import { FirebaseOptions } from 'firebase/app'; +import { EnvFieldError } from './errors'; +import { DeviceFlowUIOptions } from '@peapodtech/firebasedeviceflow'; + +/** + * Env fields required for ALL modes. + */ +const ENV_FIELDS_PEAPOD = ['SERIALPORT']; + +/** + * Env fields required for Firebase functionality. + */ +const ENV_FIELDS_FIREBASE = [ + 'FIREBASE_APIKEY', + 'FIREBASE_AUTHDOMAIN', + 'FIREBASE_PROJECTID', + 'FIREBASE_STORAGEBUCKET', + 'FIREBASE_MESSAGINGSENDERID', + 'FIREBASE_APPID', + 'FIREBASE_MEASUREMENTID' +]; + +/** + * Env fields required for GCP IoT Core functionality. + */ +const ENV_FIELDS_IOT = [ + 'IOT_CLOUDREGION', + 'FIREBASE_PROJECTID', + 'IOT_REGISTRY', + 'IOT_JWT_EXPIRYMINS' +]; + +/** + * Env fields required for FirebaseDeviceFlow Auth functionality. + */ +const ENV_FIELDS_AUTH = [ + 'GOOGLE_SCOPES', + 'GOOGLE_CLIENTID', + 'GOOGLE_CLIENTSECRET', + 'GITHUB_SCOPES', + 'GITHUB_CLIENTID', + 'GITHUB_CLIENTSECRET' +]; + +export type PeaPodEnv = { + serialport: string; +}; + +/** + * Load a `.env`-style file to `process.env`. + * + * Throws an error if the file does not exist. + */ +export default function loadDotEnv(path: string = '.env'): void { + // Check for file + if (existsSync(path)) { + const config = dotenv.config({ path }); + if (config.error) { + throw config.error; + } + } else { + throw new Error('Environment variable file not found.'); + } +} + +/** + * Check which of the given fields are missing (undefined) in `process.env` + * @param fields List of fields to check + * @returns List of missing fields + */ +function getMissingEnvFields(fields: string[]): string[] { + return fields.filter(field => !Object.keys(process.env).includes(field)); +} + +/** + * Load config for the Firebase app and check for all fields. + * @returns Firebase app config object + */ +export function loadFirebaseEnv(): FirebaseOptions { + const missingFields = getMissingEnvFields(ENV_FIELDS_FIREBASE); + if (missingFields.length) { + throw new EnvFieldError('Firebase', missingFields); + } else { + return { + apiKey: process.env.FIREBASE_APIKEY, + authDomain: process.env.FIREBASE_AUTHDOMAIN, + databaseURL: process.env.FIREBASE_DATABASEURL, + projectId: process.env.FIREBASE_PROJECTID, + storageBucket: process.env.FIREBASE_STORAGEBUCKET, + messagingSenderId: process.env.FIREBASE_MESSAGINGSENDERID, + appId: process.env.FIREBASE_APPID, + measurementId: process.env.FIREBASE_MEASUREMENTID + }; + } +} + +/** + * Load config for GCP IoT Core and check for all fields. + * @returns GCP IoT Core config object + */ +export function loadIoTEnv(): IoTConfig { + const missingFields = getMissingEnvFields(ENV_FIELDS_IOT); + if (missingFields.length) { + throw new EnvFieldError('GCP IoT Core', missingFields); + } else { + return { + cloudregion: process.env.IOT_CLOUDREGION!, + projectid: process.env.FIREBASE_PROJECTID!, + registryid: process.env.IOT_REGISTRY!, + jwtexpiryminutes: Number(process.env.IOT_JWT_EXPIRYMINS ?? '1440') + }; + } +} + +/** + * Load config for the Firebase app and check for all fields. + * @returns Firebase app config object + */ +export function loadAuthEnv(): DeviceFlowUIOptions { + const missingFields = getMissingEnvFields(ENV_FIELDS_AUTH); + if (missingFields.length) { + throw new EnvFieldError('Firebase Device Flow Auth', missingFields); + } else { + return { + Google: { + scopes: process.env.GOOGLE_SCOPES?.split(' '), + clientid: process.env.GOOGLE_CLIENTID, + clientsecret: process.env.GOOGLE_CLIENTSECRET + }, + GitHub: { + scopes: process.env.GITHUB_SCOPES?.split(' '), + clientid: process.env.GITHUB_CLIENTID, + clientsecret: process.env.GITHUB_CLIENTSECRET + } + }; + } +} + +export function loadPeaPodEnv(): PeaPodEnv { + const missingFields = getMissingEnvFields(ENV_FIELDS_PEAPOD); + if (missingFields.length) { + throw new EnvFieldError('PeaPod', missingFields); + } else { + return { + serialport: process.env.SERIALPORT! + }; + } +} \ No newline at end of file diff --git a/software/api/errors.ts b/software/api/errors.ts new file mode 100644 index 00000000..d8cfcb22 --- /dev/null +++ b/software/api/errors.ts @@ -0,0 +1,40 @@ +export class ControllerTXError extends Error { + constructor(msg: any) { + super("DEBUGJSON RX FAIL: '" + JSON.stringify(msg) + "'"); + } +} + +export class ControllerRXError extends Error { + constructor(msg: any) { + super("DEBUGJSON TX FAIL: '" + JSON.stringify(msg) + "'"); + } +} + +// UNUSED +// export class SerialTimeoutError extends Error { +// constructor(timeoutSeconds?: number) { +// super(`Arduino serial communication timed out${ timeoutSeconds === undefined ? '' : ` after ${ timeoutSeconds } seconds` }.`); +// } +// }; + +export class EnvFieldError extends Error { + constructor(mode: string, missingFields: string[]) { + super( + `.env file is missing the following fields necessary for ${mode} functionality: ${missingFields.join( + ', ' + )}` + ); + } +} + +export class DebugJsonSerialportError extends Error { + constructor(err: string) { + super(`SerialPort - ${err}`); + } +} + +export class FirebaseError extends Error { + constructor(err: FirebaseError | string | undefined = undefined) { + super(`Firebase - ${err ?? 'Unknown error'}`); + } +} \ No newline at end of file diff --git a/software/api/firebase.ts b/software/api/firebase.ts new file mode 100644 index 00000000..79f9d3dd --- /dev/null +++ b/software/api/firebase.ts @@ -0,0 +1,50 @@ +// Imports: Firebase +import { + getDatabase, + ref, + push, + // set +} from 'firebase/database'; +import { + getStorage, + ref as storageRef, + uploadBytes, +} from 'firebase/storage'; +import { DebugJsonMessage } from './types'; +import { getAuth } from 'firebase/auth'; +import { FirebaseError } from './errors'; +import { readFileSync } from 'fs'; + +export const pushDebugMessage = (message: DebugJsonMessage, t?: string) => { + const _r = ref(database, `messages/${t ?? 'default'}`); + const r = push(_r, message); + // set(r, message); +}; + +export const pushDebugMessages = (messages: DebugJsonMessage[], t?: string) => { + if(messages.length === 0) return; + const d = messages.reduce((l, msg) => { + const label = msg.t ?? (t ?? 'default'); + if(!l[label]) l[label] = []; + l[label].push(msg); + return l; + }, {}); + Object.keys(d).forEach(k => { + const _r = ref(getDatabase(), `messageBatches/${k}`); + const r = push(_r, d[k]); + // set(r, d[k]); + }); +}; + +export type FileUploadTypes = 'application/pdf' | 'image/jpeg' | 'image/png'; + +export const uploadFile = (buf: ArrayBuffer | Uint8Array, name: string) => { + const storage = getStorage(); + const auth = getAuth(); + + if(!auth.currentUser) throw new FirebaseError('User not authenticated'); + + const r = storageRef(storage, 'users/' + auth.currentUser.uid + '/' + (name ?? `upload-${Date.now()}`)); + + return uploadBytes(r, buf); +}; \ No newline at end of file diff --git a/software/api/types.ts b/software/api/types.ts new file mode 100644 index 00000000..cdab6131 --- /dev/null +++ b/software/api/types.ts @@ -0,0 +1,90 @@ +export type DebugJsonMessageTypes = + | 'debug' + | 'info' + | 'warn' + | 'error' + | 'event' + | 'command' + | 'config' + | 'revision' + | 'tree'; + +export type DebugJsonMessage = { + type: DebugJsonMessageTypes; // * Required; Usually first in a stream + t?: string; // Additional message typing i.e. device IDs, "WARN", "BSOD", etc. + timestamp?: number; // ** Suggested; Milliseconds since t=revision sent (or program start) + msg?: string; + data?: { + [key: string]: boolean | number | number[] | string; // I.e. {"temperature": 25.0, "button0": true, "nav": "~/mydir/"} + // We'll handle floating-point precision at deserialization time, create a class DebugJsonNumber + }; + units?: { + [key: string]: string; // I.e. "temperature": "°C" + }; +}; + +export type DebugJsonInstruction = { + type: 'config' | 'command', + data: { + fqa?: number, + g?: boolean, + a?: boolean | number | string, + s?: boolean | number | string, + b?: boolean | number | string, + [key: string]: boolean | number | number[] | string | undefined } +}; + +export function parseType(type: DebugJsonMessageTypes): string { + switch (type) { + case 'event': + return 'Telemetry'; // 'event' is used bi-directionally; Controller-to-Host is telemetry (i.e. component states, program flow), Host-to-Controller is for state changes (non-component/ not command, setting component-state e.g. on/off; targeted/ not config, e.g. setting up the camera lighting component-state as part of the Controller API; instead: specific and programmatic (e.g. enabling/disabling specific component-states mid-program, tuning non-component-state control parameters) + default: + return type.toUpperCase().charAt(0) + type.slice(1); + } +} + +// JSON-friendly always +export function parseDatum(value: unknown): string { + if (typeof value === 'string') { + return value; + } else if (Array.isArray(value)) { + return '[' + value.map(parseDatum).join() + ']'; // Recurse + } else if (typeof value === 'number') { + return '' + value; // Let JS handle it + } else if (typeof value === 'boolean') { + return value === false ? 'false' : 'true'; + } else if (value === null) { + return 'null'; + } else { + return ''; + } +} + +export function parseTimestamp(ms: number): string { + // ms duration since program start + const seconds = Math.floor(ms / 1000); + const minutes = Math.floor(seconds / 60); + const hours = Math.floor(minutes / 60); + + const msString = (ms % 1000).toString().padStart(3, '0'); + const secondsString = (seconds % 60).toString().padStart(2, '0'); + const minutesString = (minutes % 60).toString().padStart(2, '0'); + const hoursString = hours.toString().padStart(2, '0'); + + return `${hoursString}:${minutesString}:${secondsString}.${msString}`; +}; + +export type SchedulerEntry = { + id: string; + date: Date; + title: string; + description?: string; + instruction: DebugJsonInstruction; +} & ( + | { entry: 'event' } + | { + entry: 'interval'; + endDate: Date; + interval: number; + } +); \ No newline at end of file diff --git a/software/api/ui.ts b/software/api/ui.ts new file mode 100644 index 00000000..86667c34 --- /dev/null +++ b/software/api/ui.ts @@ -0,0 +1,338 @@ +import { Ora, Spinner } from 'ora'; +import ora from 'ora'; +// import * as blessed from 'blessed'; + +const I2CIP_DEFAULT_SPINNER: Spinner = { + interval: 50, + frames: [ + '▁▁▁▁▁▁▁▁▁▁▁', + '█▁▁▁▁▁▁▁▁▁▁', + '██▁▁▁▁▁▁▁▁▁', + '███▁▁▁▁▁▁▁▁', + '████▁▁▁▁▁▁▁', + '█████▁▁▁▁▁▁', + '▁█████▁▁▁▁▁', + '▁▁█████▁▁▁▁', + '▁▁▁█████▁▁▁', + '▁▁▁▁█████▁▁', + '▁▁▁▁▁█████▁', + '▁▁▁▁▁▁█████', + '▁▁▁▁▁▁▁████', + '▁▁▁▁▁▁▁▁███', + '▁▁▁▁▁▁▁▁▁██', + '▁▁▁▁▁▁▁▁▁▁█', + ], +}; + +// class ConsoleStream implements NodeJS.WritableStream, NodeJS.EventEmitter { +// out: (message?: any, ...optionalParams: any[]) => void; +// constructor( +// readonly con: Console, +// readonly writable = true +// ) { +// // Capture console.log +// this.out = con.log; +// } +// // Writeable Stream +// write( +// buffer: Uint8Array | string, +// encodingOrCb?: BufferEncoding | ((err?: Error | null) => void), +// cb?: (err?: Error | null) => void +// ): boolean { +// if (typeof encodingOrCb === 'function') { +// this.out(buffer); +// encodingOrCb(); +// } else { +// if (encodingOrCb) this.out(Buffer.from(buffer as string, encodingOrCb)); +// else this.out(buffer); +// if (cb) cb(); +// } +// return true; +// } +// end( +// dataOrCb?: string | Uint8Array | (() => void), +// encodingOrCb?: BufferEncoding | (() => void), +// cb?: () => void +// ): this { +// if (typeof dataOrCb === 'function') { +// this.out('\n'); +// dataOrCb(); +// } else if (typeof encodingOrCb === 'function') { +// this.out(dataOrCb as string | Uint8Array); +// if ((dataOrCb as string | Uint8Array).toString().slice(-1) !== '\n') +// this.out('\n'); +// encodingOrCb(); +// } else { +// if (dataOrCb) this.out(dataOrCb); +// if (encodingOrCb) this.out('\n'); +// if (cb) cb(); +// } +// return this; +// } + +// // Readable (EventEmitter) - NOP FOR NOw +// on(eventName: string | symbol, listener: (...args: any[]) => void): this { +// return this; +// } +// once( +// eventName: string | symbol, +// listener: (...args: any[]) => void +// ): this { +// return this; +// } +// off(eventName: string | symbol, listener: (...args: any[]) => void): this { +// return this; +// } +// emit(eventName: string | symbol, ...args: any[]): boolean { +// return true; +// } +// // addListener, removeListener, removeAllListeners, setMaxListeners +// // listeners, rawListeners, eventNames +// addListener( +// eventName: string | symbol, +// listener: (...args: any[]) => void +// ): this { +// return this; +// } +// removeListener( +// eventName: string | symbol, +// listener: (...args: any[]) => void +// ): this { +// return this; +// } +// removeAllListeners(eventName?: string | symbol): this { +// return this; +// } +// setMaxListeners(n: number): this { +// return this; +// } +// getMaxListeners(): number { +// return 0; +// } +// listeners(eventName: string | symbol): Function[] { +// return []; +// } +// rawListeners(eventName: string | symbol): Function[] { +// return []; +// } +// eventNames(): (string | symbol)[] { +// return []; +// } +// listenerCount( +// eventName: string | symbol, +// listener?: Function | undefined +// ): number { +// return 0; +// } +// prependListener( +// eventName: string | symbol, +// listener: (...args: any[]) => void +// ): this { +// return this; +// } +// prependOnceListener( +// eventName: string | symbol, +// listener: (...args: any[]) => void +// ): this { +// return this; +// } +// } + +// class DebugJsonUI extends ConsoleStream { +class DebugJsonUI { + spinner: Ora = this.reset(); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + private _log: (...args: any[]) => void; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + private _err: (...args: any[]) => void; + constructor(con: Console = console) { + // super(con); + // Create and start the spinner + // this.spinner.start('Loading...'); + this._log = con.log; + this._err = con.error; + } + + reset(): Ora { + if(this.spinning()) { + this.spinner.stop(); + } else { + this.spinner = ora({ + // stream: this, + spinner: I2CIP_DEFAULT_SPINNER + }); + } + return this.spinner; + } + + spinning(): boolean { + return this.spinner?.isSpinning; + } + + /** + * Start the loading spinner. + * @param text Text to display. + * @param spinner Spinner to use. Defaults to the default spinner. + */ + start(text: string = '') { + // If it's already spinning, just change the text + if (this.spinning()) { + this.spinner.text = text; + } else { + // Otherwise, start a new one + this.reset(); + this.spinner.start(text); + } + } + + /** + * Fail the loading spinner. + * @param text Text to display. + */ + fail(text: string = '') { + // If it's spinning, change the text and fail + if (!this.spinning()) { + this.reset(); + } + this.spinner.fail(text); + } + + /** + * Succeed the loading spinner. + * @param text Text to display. + */ + succeed(text: string = '') { + // If it's spinning, change the text and succeed + if (!this.spinning()) { + this.reset(); + } + this.spinner.succeed(text); + } + + /** + * Complete the loading spinner with info (blue `i`) + * @param text Text to display. + */ + info(text: string = '') { + if (!this.spinning()) { + this.reset(); + } + this.spinner.info(text); + } + + /** + * If spinning: stop and clear the current spinner, log some text, then restart the spinner + * Else: Just log + * + * @param text Text to log + */ + log(...args: unknown[]) { + if (this.spinning()) { + const oldtext = this.spinner.text; + this.spinner.stop(); // stop spinner + this._log(...args); // log text + this.spinner.start(oldtext); // restart spinner + } else { + this._log(...args); // log text + } + } + + /** + * If spinning: stop and clear the current spinner, log some text, then restart the spinner + * Else: Just log + * + * @param text Text to log + */ + err(...args: unknown[]) { + if (this.spinning()) { + const oldtext = this.spinner.text; + this.spinner.stop(); // stop spinner + this._err(...args); // log text + this.spinner.start(oldtext); // restart spinner + } else { + this._err(...args); // log text + } + } +} + +export const DebugJsonConsole = new DebugJsonUI(); +export default DebugJsonConsole; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export function _logRedirect(...message: any[]): void { + DebugJsonConsole.log(...message); +} + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export function _errRedirect(...message: any[]): void { + DebugJsonConsole.err(...message); +} + +// // Use yargs to get a flag "--spawn" +// const _IS_SPAWN = yargs(process.argv.slice(2)).boolean('spawn').argv; + +// // If spawn, spawn a new process +// if (_IS_SPAWN) { +// // Import the child_process module +// import { spawn } from 'child_process'; +// // Spawn a new process, with that console used as a stream for the UI +// const n = spawn('node', [], {}); +// // Make writablestream from n.stdout + +// } else { + +// } + +// If not spawn, this is the spawned process. Run the UI + +// Create a screen object. +// let screen = blessed.screen({ +// smartCSR: true +// }); + +// let box = blessed.box({ +// top: 'top', +// left: 'left', +// width: '50%', +// height: '50%', +// border: { +// type: 'line' +// }, +// style: { +// fg: 'white', +// bg: 'black', +// border: { +// fg: '#ffffff' +// } +// }, +// align: 'left' +// }); + +// screen.append(box); + +// export namespace Screen { +// export function render(): void { +// box.focus(); +// screen.render(); +// } +// export function hide(): void { +// box.hide(); +// } +// export function setData(data: DebugJsonMessage): void { +// let s = '[' + (data.t ?? parseType(data.type)) + ']'; +// if (data.timestamp) s += '@' + data.timestamp + 'ms'; +// if (data.data) { +// s += Object.entries(data.data).map(datum => { +// return ( +// datum[0] // label +// .split('-') // multiword delimiter; replace with space +// .map(word => word.slice(0, 1).toUpperCase() + word.slice(1).toLowerCase()) +// .join(' ') + +// ': ' + +// parseDatum(datum[1]) // value, to string +// ); +// }).join(', ') + ' }'; +// } +// box.setContent(s); +// } +// } diff --git a/software/api/utils.ts b/software/api/utils.ts new file mode 100644 index 00000000..18d16ec6 --- /dev/null +++ b/software/api/utils.ts @@ -0,0 +1,111 @@ +import { spawn } from 'child_process'; +import { existsSync, mkdirSync, writeFileSync } from 'fs'; +import { hostname } from 'os'; +import { lookup } from 'dns'; + +const PATHSTEM_MICROCONTROLLER = './microcontroller/'; + +/** + * Compiles the microcontroller software, and flashes the binary to the chip. + */ +export function updateMicrocontroller(): Promise { + return new Promise((res, rej) => { + // Create log folder + if (!existsSync('logs/')) { + mkdirSync('logs/', { recursive: true }); + } + execute( + `${process.env.HOME}/.platformio/penv/bin/platformio run -d ${PATHSTEM_MICROCONTROLLER} -t upload`, + [1] + ) + .catch(err => { + writeFileSync('logs/updateMicrocontroller.log', err); + rej( + new Error( + 'Failed to update the microcontroller software. See logs/updateMicrocontroller.log' + ) + ); + }) + .then(log1 => { + if (log1) writeFileSync('logs/updateMicrocontroller.log', log1); + res(); + }); + }); +} + +/** + * General purpose command execution and logging. No `sudo` support. + */ +export function execute(command: string, failureCodes: number[] = []): Promise { + return new Promise((res, rej) => { + const args = command.split(' '); + const eprocess = spawn(args[0], args.slice(1)); + let log = '> ' + command + '\n'; + eprocess.stdout?.on('data', out => { + log += out; + }); + eprocess.stderr?.on('data', out => { + log += out; + }); + eprocess.on('error', error => { + log += error.message; + rej(log); + eprocess.kill(); + }); + eprocess.on('close', code => { + if (code) { + log += '> Process exited with code ' + code; + if (failureCodes.includes(code)) { + rej(log); + } + return; + } + // If no options, no codes, OR non-failure: + res(log); + }); + }); +} + +const dateFormat = (d: Date) => (`${d.getFullYear()}-${d.getMonth()+1}-${d.getDate()}_${d.getHours()}-${d.getMinutes()}-${d.getSeconds()}`); + +type CameraCaptureOptions = { + width?: number; + height?: number; + // TODO: Add more options +}; + +const PATHSTEM_IMAGES = 'capture'; +const CAMERATIMEOUT = 3000; + +// Returns a path to the JPEG image. +export function cameraCapture(options?: CameraCaptureOptions): Promise { + return new Promise((res, rej) => { + const datestring = dateFormat(new Date()); + const p = `./images/${PATHSTEM_IMAGES}-${datestring}`; + if (!existsSync('./images/')) { + mkdirSync('./images/', { recursive: true }); + } + execute(`rpicam-still -o ${p}.jpg -n --timeout ${CAMERATIMEOUT}`) + .catch(err => { + if (!existsSync('./logs/')) { + mkdirSync('./logs/', { recursive: true }); + } + writeFileSync(`logs/cameraCapture_${datestring}.log`, err); + rej(new Error(err)); + }) + .then(() => { + res(`${p}.jpg`); + }); + }); +} + +// Helper: IPv4 Address Lookup (Fallback to 'localhost') +export const ipv4Lookup = async (): Promise => { + const h = hostname(); + if(!h) return 'localhost'; + return await new Promise((res) => { + lookup(h, { family: 4, all: true }, (err, addrs) => { + res((err || !addrs || !(addrs.length)) ? 'localhost' : addrs.find((a) => (a.address !== '127.0.0.1')).address); + }); + }); +}; \ No newline at end of file diff --git a/software/archive/index.ts b/software/archive/index.ts new file mode 100644 index 00000000..8f61c8de --- /dev/null +++ b/software/archive/index.ts @@ -0,0 +1,55 @@ +#!/usr/bin/env node +import chalk from 'chalk'; +import * as inquirer from 'inquirer'; + +import { checkInternet, sleep } from '../src/utils'; +import { Spinner } from '../src/ui'; +import { PublishingMode } from '../src/publisher'; +import PeaPod from '../src/peapod'; + +// MAIN + +async function main(): Promise { + Spinner.start(`Checking for ${chalk.blue('Internet')} connection...'`); + // const internet = await checkInternet(); + // const internet = false; + // if (internet) { + // Spinner.succeed(`Connected to the ${chalk.blue('Internet')}!`); + // } else { + // Spinner.fail(`Failed to connect to the ${chalk.blue('Internet')}.`); + // } + + // Get desired publishing mode + // let publishingmode = ( + // await inquirer.prompt<{ pm: PublishingMode }>([ + // { + // type: 'list', + // name: 'pm', + // message: 'Select publishing mode:', + // choices: Object.entries(PublishingMode).map(pm => { + // return { + // // Object.entries casts `PublishingMode` values to `string`. This recasts them to PublishingMode enum values (TypeScript magic) + // value: PublishingMode[pm[0] as keyof typeof PublishingMode], + // name: pm[1] + // }; + // }) + // } + // ]) + // ).pm; + + let peapod: PeaPod = new PeaPod(PublishingMode.OFFLINE); + + let idleInterval = await peapod.idle(); + + // Temporary; replace with main menu + await sleep(10000); + + clearInterval(idleInterval); + peapod.start(); +} + +main().catch(err => { + // Last resort catch + Spinner.fail(JSON.stringify(err)); + process.exit(1); +}); diff --git a/software/archive/microcontroller/ControlSystemsOS.cc b/software/archive/microcontroller/ControlSystemsOS.cc new file mode 100644 index 00000000..7ed9e23e --- /dev/null +++ b/software/archive/microcontroller/ControlSystemsOS.cc @@ -0,0 +1,754 @@ + +#include + +#include + +#include +#include +#include + +// #define DEBUG 1 + +#include +#include +#include + +// GROUP BY MODULE + +ControlSystemsOS::CSOSModule* ControlSystemsOS::csos_modules[I2CIP_NUM_WIRES][I2CIP_MUX_COUNT] = { { nullptr } }; + +// GLOBAL CONSTANT MAPS + +// Internal Use +char ControlSystemsOS::device_id_map[MAP_INDEX_COUNT][I2CIP_ID_SIZE] = { + {'\0'}, + {'\0'} +}; + +bool ControlSystemsOS::device_id_loaded[MAP_INDEX_COUNT] = { + false, + false +}; + +int ControlSystemsOS::getMapIndex(const i2cip_id_t& id) { + for(unsigned char i = 0; i < MAP_INDEX_COUNT; i++) { + // Compare strings ignoring case + if(strcasecmp_P(id, ControlSystemsOS::device_id_progmem[i]) == 0){ + #ifdef CSOS_DEBUG_SERIAL + const char* s = getDeviceID(i); + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> Map Lookup ")); + CSOS_DEBUG_SERIAL.print(i); + CSOS_DEBUG_SERIAL.print(_F(" [ID '")); + CSOS_DEBUG_SERIAL.print(s); + CSOS_DEBUG_SERIAL.print(_F("' @0x")); + CSOS_DEBUG_SERIAL.print((uint16_t)s, HEX); + CSOS_DEBUG_SERIAL.print(_F(" | Factory @0x")); + CSOS_DEBUG_SERIAL.print((uint16_t)device_factory[i], HEX); + CSOS_DEBUG_SERIAL.print("]\n"); + DEBUG_DELAY(); + #endif + return i; + } + } + return -1; +} + +const char* ControlSystemsOS::getDeviceID(uint8_t index) { + // #ifdef CSOS_DEBUG_SERIAL + // DEBUG_DELAY(); + // CSOS_DEBUG_SERIAL.print(_F("-> Map ID ")); + // CSOS_DEBUG_SERIAL.print(index); + // CSOS_DEBUG_SERIAL.print(_F(": ")); + // #endif + if(index >= MAP_INDEX_COUNT) { + // #ifdef CSOS_DEBUG_SERIAL + // CSOS_DEBUG_SERIAL.print(_F("Out of Range!")); + // DEBUG_DELAY(); + // #endif + return nullptr; + } + if(!device_id_loaded[index]) { + // #ifdef CSOS_DEBUG_SERIAL + // CSOS_DEBUG_SERIAL.print(_F("(Loading... ")); + // #endif + if(index == MAP_INDEX_EEPROM) { + return EEPROM::getStaticIDBuffer(); + } else { + // char* s1 = (char*)malloc(I2CIP_ID_SIZE * sizeof(char)); + // char* s1 = new char[I2CIP_ID_SIZE]; + // if(s1 == nullptr) return nullptr; + strcpy_P(device_id_map[index], ControlSystemsOS::device_id_progmem[index]); + // device_id_map[index] = s2; + device_id_loaded[index] = true; + } + // device_id_loaded[index] = (device_id_map[index] != nullptr); + // #ifdef CSOS_DEBUG_SERIAL + // CSOS_DEBUG_SERIAL.print(device_id_loaded[index] ? _F("Success) ") : _F("Fail!)\n")); + // #endif + } + // #ifdef CSOS_DEBUG_SERIAL + // if(device_id_map != nullptr) { + // CSOS_DEBUG_SERIAL.print(_F("ID '")); + // CSOS_DEBUG_SERIAL.print(device_id_map[index]); + // CSOS_DEBUG_SERIAL.print(_F("' @0x")); + // CSOS_DEBUG_SERIAL.print((uint16_t)device_id_map[index], HEX); + // CSOS_DEBUG_SERIAL.print("]\n"); + // } + // DEBUG_DELAY(); + // #endif + return &(device_id_map[index][0]); +} + +using namespace ControlSystemsOS; +using namespace I2CIP; + +CSOSModule::CSOSModule(const uint8_t& wire, const uint8_t& module) : Module(wire, module) { + // Build Maps + +} + +DeviceGroup* CSOSModule::deviceGroupFactory(i2cip_id_t lookup) { + if(lookup == nullptr) { Serial.print("wtf?"); return nullptr; } + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> DeviceGroup Factory (ID '")); + CSOS_DEBUG_SERIAL.print(lookup); + CSOS_DEBUG_SERIAL.print(_F("')\n")); + DEBUG_DELAY(); + #endif + int index = ControlSystemsOS::getMapIndex(lookup); + if(index < 0) { + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> Map Index '")); + CSOS_DEBUG_SERIAL.print(lookup); + CSOS_DEBUG_SERIAL.print(_F("' DNE! Check Libraries.\n")); + DEBUG_DELAY(); + #endif + return nullptr; + } + + const char* id = getDeviceID(index); + + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> Creating DeviceGroup '")); + CSOS_DEBUG_SERIAL.print(id); + CSOS_DEBUG_SERIAL.print(_F("' (Map Index ")); + CSOS_DEBUG_SERIAL.print(index); + CSOS_DEBUG_SERIAL.print(_F(", Factory @0x")); + CSOS_DEBUG_SERIAL.print((uint16_t)device_factory[index], HEX); + CSOS_DEBUG_SERIAL.print("): "); + DEBUG_DELAY(); + #endif + + // Serial.print(_F("-> Creating DeviceGroup '")); + // Serial.print(id); + // Serial.print(_F("' (Map Index ")); + // Serial.print(index); + // Serial.print(_F(", Factory @0x")); + // Serial.print((uint16_t)device_factory[index], HEX); + // Serial.print("): "); + + DeviceGroup* dg = new DeviceGroup(id, device_factory[index]); + + // if(dg == nullptr) { + // Serial.print(_F("Fail!\n")); + // } else { + // Serial.print(_F("Success!\n")); + // } + + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + if(dg == nullptr) { + CSOS_DEBUG_SERIAL.print(_F("Fail!\n")); + } else { + CSOS_DEBUG_SERIAL.print(_F("Success!\n")); + } + DEBUG_DELAY(); + #endif + + return dg; +} + +bool CSOSModule::parseEEPROMContents(const char* buffer) { + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> Deserializing Module EEPROM to JSON: ")); + DEBUG_DELAY(); + #endif + + // 0. Buffer size + size_t buflen = strlen(buffer); + + // 1. EEPROM -> JSON Deserialization + // TODO: Buflen + 1 ? + DeserializationError jsonerr = deserializeJson(this->eeprom_json, buffer, buflen); + + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print("Code 0x"); + CSOS_DEBUG_SERIAL.print(jsonerr.code(), 16); + CSOS_DEBUG_SERIAL.print("\n"); + DEBUG_DELAY(); + #endif + + if(jsonerr.code() != DeserializationError::Code::Ok) return false; + + // 2. Schema Validation and Loading + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> Verifying JSON:\n")); + #endif + + // 2a. Base Array of Busses + if(!this->eeprom_json.is() || !this->eeprom_json[0].is()) { + #ifdef CSOS_DEBUG_SERIAL + CSOS_DEBUG_SERIAL.print(_F("Bad JSON: Invalid Structure!\n")); + DEBUG_DELAY(); + #endif + } + + JsonArray busses = this->eeprom_json.as(); + + int busnum = -1; + for (JsonVariant bus : busses) { + busnum++; + + #ifdef CSOS_DEBUG_SERIAL + CSOS_DEBUG_SERIAL.print("[BUS "); + CSOS_DEBUG_SERIAL.print(busnum+1, HEX); + CSOS_DEBUG_SERIAL.print("]\n"); + #endif + + // 2b. Bus Root Object + if(!bus.is()) { + #ifdef CSOS_DEBUG_SERIAL + CSOS_DEBUG_SERIAL.print(_F("Bad JSON: Invalid Bus Structure!\n")); + DEBUG_DELAY(); + #endif + continue; + } + JsonObject root = bus.as(); + + for (JsonPair kv : root) { + // 2c. Array of I2C Addresses + if(!kv.value().is() || kv.value().isNull()) { + #ifdef CSOS_DEBUG_SERIAL + CSOS_DEBUG_SERIAL.print(_F("Bad JSON: Invalid Entry Value!\n")); + DEBUG_DELAY(); + #endif + continue; + } + + const char* key = kv.key().c_str(); + + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print("[ ID '"); + CSOS_DEBUG_SERIAL.print(key); + CSOS_DEBUG_SERIAL.print("']\n"); + #endif + + // Get DeviceGroup + DeviceGroup* dg = this->operator[](key); + if(dg == nullptr) { + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> Group DNE! Check Libraries.\n")); + DEBUG_DELAY(); + #endif + break; + } + + uint8_t numfqas = kv.value().size(); + if(numfqas == 0) { + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> Empty! (Skipping)\n")); + DEBUG_DELAY(); + #endif + continue; + } + i2cip_fqa_t fqas[numfqas]; + + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print("-> ["); + DEBUG_DELAY(); + #endif + + uint8_t i = 0; + for (JsonVariant addr : kv.value().as()) { + if(!addr.is()) { continue; } + uint8_t address = addr.as(); + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(" 0x"); + CSOS_DEBUG_SERIAL.print(address, HEX); + DEBUG_DELAY(); + #endif + fqas[i] = createFQA(this->getWireNum(), this->getModuleNum(), (uint8_t)busnum, address); + } + + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(" ]\n"); + DEBUG_DELAY(); + #endif + + for (i = 0; i < numfqas; i++) { + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> Adding Device ")); + CSOS_DEBUG_SERIAL.print(i+1); + CSOS_DEBUG_SERIAL.print(" / "); + CSOS_DEBUG_SERIAL.print(numfqas); + CSOS_DEBUG_SERIAL.print(_F(" (Factory @0x")); + CSOS_DEBUG_SERIAL.print((uint16_t)dg->factory, HEX); + CSOS_DEBUG_SERIAL.print(")\n"); + DEBUG_DELAY(); + #endif + + // Invoke DeviceGroup Call Operator - Returns Matching, or Calls Factory and Adds + i2cip_fqa_t fqa = fqas[i]; + Device* d = (*dg)(fqa); + if(d == nullptr) { + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> Factory Failed! (Skipping)\n")); + DEBUG_DELAY(); + #endif + continue; + } else { + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> Factory Success! (Adding)\n")); + DEBUG_DELAY(); + #endif + Device* dd = this->add(*d); + if(dd == nullptr) { + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> Couldn't Add Device!\n")); + DEBUG_DELAY(); + #endif + return false; + } + } + } + + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> Group Complete!\n")); + DEBUG_DELAY(); + #endif + } + } + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> EEPROM Parsed Successfully!\n")); + DEBUG_DELAY(); + #endif + return true; +} + +// Subnetwork state change update + rebuild from discovery +i2cip_errorlevel_t ControlSystemsOS::update(const uint8_t& wire, const uint8_t& mod, bool build) { + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("= [ NETWORK UPDATE: MODULE ")); + CSOS_DEBUG_SERIAL.print(mod, HEX); + CSOS_DEBUG_SERIAL.print(" ] =\n"); + DEBUG_DELAY(); + #endif + + i2cip_errorlevel_t errlev = I2CIP_ERR_NONE; + CSOSModule* m = csos_modules[wire][mod]; + + if(m == nullptr) { + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> Module DNE; Pinging.\n")); + DEBUG_DELAY(); + #endif + + bool b = MUX::pingMUX(wire, mod); + + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + if(b) { CSOS_DEBUG_SERIAL.print(_F("-> Module Found! Creating.\n")); } + else { CSOS_DEBUG_SERIAL.print(_F("-> Module Not Found.\n")); } + DEBUG_DELAY(); + #endif + + if(b) { + // New module found! + m = new CSOSModule(wire, mod); + if(m == nullptr) { + Serial.println("CSOSModule ENOMEM"); + return I2CIP_ERR_SOFT; + } + csos_modules[wire][mod] = m; + + if (build) { + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> Discovering\n")); + DEBUG_DELAY(); + #endif + + bool r = m->discover(); + + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> Discovery")); + CSOS_DEBUG_SERIAL.print(r ? _F(" Success!\n") : _F(" Failure, Deleting Module.\n")); + DEBUG_DELAY(); + #endif + + if (!r) { + delete m; + csos_modules[wire][mod] = nullptr; + return I2CIP_ERR_SOFT; + } + } + } else { + // No net change + return I2CIP_ERR_NONE; + } + } else { + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> Updating Module.\n")); + DEBUG_DELAY(); + #endif + } + + // csos_modules_lastChecked[wire][module] = millis(); + + errlev = m->operator()(); + + if(errlev > I2CIP_ERR_NONE) { + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> Fail. Deleting Module.\n")); + DEBUG_DELAY(); + #endif + delete m; + csos_modules[wire][mod] = nullptr; + return errlev; + } + #ifdef CSOS_DEBUG_SERIAL + else { + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> Pass! Updating Devices.\n")); + DEBUG_DELAY(); + } + #endif + + for(uint8_t i = 0; i < MAP_INDEX_COUNT; i++) { + const char* id = getDeviceID(i); + if(id == nullptr || id[0] == '\0') continue; + DeviceGroup* dg = (*m)[id]; + if(dg == nullptr) continue; + + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> [ DEVICE GROUP ")); + CSOS_DEBUG_SERIAL.print(i+1, HEX); + CSOS_DEBUG_SERIAL.print(" / "); + CSOS_DEBUG_SERIAL.print(MAP_INDEX_COUNT, HEX); + CSOS_DEBUG_SERIAL.print(" ]\n"); + DEBUG_DELAY(); + #endif + + for(uint8_t j = 0; j < dg->numdevices; j++) { + Device* device = dg->devices[j]; + if(device == nullptr) continue; + + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("[ DEVICE ")); + CSOS_DEBUG_SERIAL.print(j+1, HEX); + CSOS_DEBUG_SERIAL.print(" / "); + CSOS_DEBUG_SERIAL.print(dg->numdevices, HEX); + CSOS_DEBUG_SERIAL.print(_F(" ]\n-> FQA: ")); + CSOS_DEBUG_SERIAL.print(I2CIP_FQA_SEG_I2CBUS(device->getFQA()), HEX); + CSOS_DEBUG_SERIAL.print(":"); + CSOS_DEBUG_SERIAL.print(I2CIP_FQA_SEG_MODULE(device->getFQA()), HEX); + CSOS_DEBUG_SERIAL.print(":"); + CSOS_DEBUG_SERIAL.print(I2CIP_FQA_SEG_MUXBUS(device->getFQA()), HEX); + CSOS_DEBUG_SERIAL.print(":"); + CSOS_DEBUG_SERIAL.print(I2CIP_FQA_SEG_DEVADR(device->getFQA()), HEX); + CSOS_DEBUG_SERIAL.print("\n"); + DEBUG_DELAY(); + #endif + + errlev = (*m)(*device, false); + + #ifdef CSOS_DEBUG_SERIAL + switch(errlev) { + case I2CIP_ERR_NONE: + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> 0x0 Pass!\n")); + DEBUG_DELAY(); + break; + case I2CIP_ERR_SOFT: + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> 0x1 Communication Error!\n")); + DEBUG_DELAY(); + break; + case I2CIP_ERR_HARD: + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> 0x2 Hardware Lost, ABORT!\n")); + DEBUG_DELAY(); + break; + } + #endif + + if(errlev == I2CIP_ERR_HARD) return errlev; + } + } + + return errlev; +} + +// Whole-network state change update +i2cip_errorlevel_t ControlSystemsOS::update(bool build) { + i2cip_errorlevel_t errlev = I2CIP_ERR_NONE; + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("=== [ NETWORK UPDATE ] ===\n")); + DEBUG_DELAY(); + #endif + // 1. Scan for Modules + for(uint8_t wirenum = 0; wirenum < I2CIP_NUM_WIRES; wirenum++) { + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("== [ WIRE ")); + CSOS_DEBUG_SERIAL.print(wirenum+1, HEX); + CSOS_DEBUG_SERIAL.print(" / "); + CSOS_DEBUG_SERIAL.print(I2CIP_NUM_WIRES, HEX); + CSOS_DEBUG_SERIAL.print(_F("] ==\n")); + DEBUG_DELAY(); + #endif + + for(uint8_t modnum = 0; modnum < I2CIP_MUX_COUNT; modnum++) { + errlev = update(wirenum, modnum, build || csos_modules[wirenum][modnum] == nullptr); + I2CIP_ERR_BREAK(errlev); + } + } + + return errlev; +} + +// Control systems update +i2cip_errorlevel_t ControlSystemsOS::fixedUpdate(unsigned long timestamp, CSOSModule& m) { + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("= [ CONTROLSYSTEMS UPDATE: MODULE ")); + CSOS_DEBUG_SERIAL.print(m.getModuleNum(), HEX); + CSOS_DEBUG_SERIAL.print(_F(" ] =\n")); + #endif + + i2cip_errorlevel_t errlev = I2CIP_ERR_NONE; + + // 1. FSM Timer Functionality + Chronos.set(timestamp); + + // 2. Control Systems Fixed Update per-ID + for(uint8_t i = 0; i < MAP_INDEX_COUNT; i++) { + const char* id = getDeviceID(i); + + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> DeviceGroup '")); + CSOS_DEBUG_SERIAL.print(id); + CSOS_DEBUG_SERIAL.print(_F("'\n")); + DEBUG_DELAY(); + #endif + + DeviceGroup* dg = m[id]; + if(dg == nullptr) { + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> Group '")); + CSOS_DEBUG_SERIAL.print(id); + CSOS_DEBUG_SERIAL.print(_F("' DNE! Check Libraries.\n")); + DEBUG_DELAY(); + #endif + continue; + } + + for(uint8_t j = 0; j < dg->numdevices; j++) { + Device* device = dg->devices[j]; + if(device == nullptr) break; + + if(device->getFQA() == ((const EEPROM&)m).getFQA()) { + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> SPRT EEPROM! Skipping...\n")); + DEBUG_DELAY(); + #endif + continue; + } + + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> Updating Device ")); + CSOS_DEBUG_SERIAL.print(j+1); + CSOS_DEBUG_SERIAL.print(" / "); + CSOS_DEBUG_SERIAL.print(dg->numdevices); + CSOS_DEBUG_SERIAL.print("\n"); + DEBUG_DELAY(); + #endif + + if(m[*device] == nullptr) { + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> Device Not In BST! Deleting...\n")); + DEBUG_DELAY(); + #endif + m.remove(device); + continue; + } + + errlev = m(*device, true); + + #ifdef CSOS_DEBUG_SERIAL + switch(errlev) { + case I2CIP_ERR_NONE: + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> 0x0 Pass!\n")); + DEBUG_DELAY(); + break; + case I2CIP_ERR_SOFT: + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> 0x1 Communication Error!\n")); + DEBUG_DELAY(); + break; + case I2CIP_ERR_HARD: + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> 0x2 Hardware Lost, ABORT!\n")); + DEBUG_DELAY(); + break; + } + #endif + + if(errlev == I2CIP_ERR_HARD) return errlev; + + // Sensor JSON Output + if(device->getInput() != nullptr && device->getInput()->getSensor() != nullptr) { + StaticJsonDocument<100> data; + data["id"] = device->getID(); + data["timestamp"] = timestamp; + data.createNestedObject("data"); + + Datum* datum = device->getInput()->getSensor()->datumFactory(); + do { + if(datum == nullptr) break; + + JsonObject d = data["data"].as(); + + datum->addToJSON(d); + + if(datum->next != nullptr) { + Serial.print(','); + } + datum = datum->next; + } while(datum != nullptr); + size_t l = serializeJson(data, Serial); + Serial.print(l); + Serial.println(F(" Bytes")); + // data.remove("id"); + // data.remove("timestamp"); + // data.remove("data"); + data.garbageCollect(); + delay(10); + } + #ifdef CSOS_DEBUG_SERIAL + else { + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("-> No Sensor, Skipping!\n")); + DEBUG_DELAY(); + } + #endif + } + } + + return errlev; + + // RPi: "air-temperature" -> Variable-Sensor(s) Linker -> Sensors (i.e. SHT31_Temperature) + // uC: "sht31" -> ID-Interface Linker -> FQA[], SHT31 -> SHT31_Temperature::read(SHT31(fqa), nullptr, dest); +} + +i2cip_errorlevel_t ControlSystemsOS::fixedUpdate(unsigned long timestamp) { + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("=== [ CONTROLSYSTEMS UPDATE T + ")); + // Chronograph::debugTimestamp(timestamp); + CSOS_DEBUG_SERIAL.print(_F(" ] ===\n")); + DEBUG_DELAY(); + #endif + + i2cip_errorlevel_t errlev = I2CIP_ERR_NONE; + + // 1. Scan for Modules + for(uint8_t wirenum = 0; wirenum < I2CIP_NUM_WIRES; wirenum++) { + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(_F("== [ WIRE ")); + CSOS_DEBUG_SERIAL.print(wirenum+1, HEX); + CSOS_DEBUG_SERIAL.print(" / "); + CSOS_DEBUG_SERIAL.print(I2CIP_NUM_WIRES, HEX); + CSOS_DEBUG_SERIAL.print(_F("] ==\n")); + DEBUG_DELAY(); + #endif + + for(uint8_t modnum = 0; modnum < I2CIP_MUX_COUNT; modnum++) { + CSOSModule* m = csos_modules[wirenum][modnum]; + if(m == nullptr) continue; + errlev = fixedUpdate(timestamp, *m); + + if(errlev == I2CIP_ERR_HARD) return errlev; + } + } + + return errlev; + +} + +// void ControlSystemsOS::deleteDevice(Device* device) { +// if(device == nullptr) return; + +// // Pick module from FQA +// uint8_t wirenum = I2CIP_FQA_SEG_I2CBUS(device->getFQA()); +// uint8_t modnum = I2CIP_FQA_SEG_MODULE(device->getFQA()); +// CSOSModule* m = csos_modules[wirenum][modnum]; +// if(m == nullptr) return; + +// m->remove(device); +// } + +// template i2cip_errorlevel_t ControlSystemsOS::handleInputDevice(Device* device, const A& args) { +// InputGetter* input = device->getInput(); +// if(input == nullptr) return I2CIP_ERR_SOFT; + +// InputInterface* interface = (InputInterface*) input; +// G value = interface->getCache(); +// i2cip_errorlevel_t errlev = interface->get(value, args); +// Serial.print("Value: "); +// Serial.print(value); +// return errlev; +// } + +// template i2cip_errorlevel_t ControlSystemsOS::handleOutputDevice(Device* device, const S& value, const B& args) { +// OutputSetter* output = device->getOutput(); +// if(output == nullptr) return I2CIP_ERR_SOFT; + +// OutputInterface* interface = (OutputInterface*) output; +// i2cip_errorlevel_t errlev = interface->set(value, args); +// return errlev; +// } \ No newline at end of file diff --git a/software/archive/microcontroller/ControlSystemsOS.h b/software/archive/microcontroller/ControlSystemsOS.h new file mode 100644 index 00000000..729a04b7 --- /dev/null +++ b/software/archive/microcontroller/ControlSystemsOS.h @@ -0,0 +1,91 @@ +#ifndef CSOS_CSOS_H_ +#define CSOS_CSOS_H_ + +#include +#include +#include + +#include + +#include + +#ifndef MAP_INDEX_COUNT +#define MAP_INDEX_COUNT 1 +#endif + +#include +// #include + +#define CSOS_MODULE_JSON_DOCSIZE (size_t)(I2CIP_EEPROM_SIZE * 3 / 2) + +using namespace I2CIP; + +typedef i2cip_errorlevel_t (* interfaceHandler_t)(Device*); + +namespace ControlSystemsOS { + + // MODULE DEFINITION + + class CSOSModule : public Module { + private: + StaticJsonDocument eeprom_json; + + protected: + DeviceGroup* deviceGroupFactory(i2cip_id_t id) override; + + bool parseEEPROMContents(const char* eeprom_contents) override; + + public: + CSOSModule(const uint8_t& wire, const uint8_t& module); + + ~CSOSModule() { } + }; + + + i2cip_errorlevel_t update(bool build = false); + i2cip_errorlevel_t update(const uint8_t& wire, const uint8_t& mod, bool build = true); + i2cip_errorlevel_t fixedUpdate(unsigned long timestamp); + i2cip_errorlevel_t fixedUpdate(unsigned long timestamp, CSOSModule& m); + + extern CSOSModule* csos_modules[I2CIP_NUM_WIRES][I2CIP_MUX_COUNT]; + extern char device_id_map[MAP_INDEX_COUNT][I2CIP_ID_SIZE]; + extern bool device_id_loaded[MAP_INDEX_COUNT]; + + // static Linker linker; + + // extern fsm_timestamp_t csos_modules_lastChecked[I2CIP_NUM_WIRES][I2CIP_MUX_COUNT]; + + // extern const csos_types_t csos_map_interface_state[]; + // extern const csos_types_t csos_map_interface_args[]; + + // extern bool stateChange; + + // new SHT31(fqa) + + // void initialize(void); + + + // i2cip_errorlevel_t handleDevice(Device* device); + // template i2cip_errorlevel_t handleInputDevice(Device* device, const A& args); + // template i2cip_errorlevel_t handleOutputDevice(Device* device, const S& value, const B& args); + + /** + * Find a device group by ID. + * @param id + * @returns Pointer to the device group (`nullptr` if none) + */ + // DeviceGroup* operator[](const char* id); + + /** + * Find a device ID by FQA. + * @param fqa + * @returns Pointer to the device ID (`nullptr` if none) + */ + // const char* operator[](const i2cip_fqa_t& fqa); + + // const i2cip_devicetree_t& getDevices(void); + + // const i2cip_devicetable_t& getDeviceGroups(void); +}; + +#endif \ No newline at end of file diff --git a/software/archive/microcontroller/actuators/actuator.cc b/software/archive/microcontroller/actuators/actuator.cc new file mode 100644 index 00000000..74d36381 --- /dev/null +++ b/software/archive/microcontroller/actuators/actuator.cc @@ -0,0 +1,84 @@ +// HEADERS + +#include + +#include + +#include + +// CONSTRUCTOR + +Actuator::Actuator(const char* const* id, float failtarget) : _id(id), failtarget(failtarget) { + state.error = ERR_NONE; + state.debug = DS_DISABLED; + + // Default start target + target = failtarget; +} + +// PUBLIC METHODS + +ActuatorState* Actuator::begin(void) { + state.error = initialize(); + if (state.error > ERR_NONE) { + // Failed + state.debug = DS_DISABLED; + } else { + // Success + state.debug = DS_INITIALIZED; + // Perform first update + update(); + } + return &state; +} + +ActuatorState* Actuator::update(void) { + // Check state preconditions, and do not attempt set if the target hasn't changed + if (state.error < ERR_FATAL && state.debug >= DS_INITIALIZED) { + if (target != state.lasttarget) { + // Attempt to set actuator state from target + state.error = set(target); + + switch (state.error) { + case ERR_NONE: + // Success! + state.debug = DS_SUCCESS; + state.lasttarget = target; + break; + + case ERR_WARNING: + // Set didn't go as planned, non-fatal + // DO NOT UPDATE STATE VALUES + break; + + case ERR_FATAL: + // Set failed catastrophically + state.debug = DS_DISABLED; + + // Failsafe + set(failtarget); + break; + } + } else { + // No `target` updates since last `update()` call + state.debug = DS_WAITING; + } + } + return &state; +} + +ActuatorState* Actuator::getState(void) { + return &state; +} + +void Actuator::setTarget(float target) { + this->target = target; +} + +String Actuator::toString(void) { + return String((const char*)_id); +} + +String Actuator::getID(void) { + return String((const char*)_id); +} \ No newline at end of file diff --git a/software/archive/microcontroller/actuators/actuator.h b/software/archive/microcontroller/actuators/actuator.h new file mode 100644 index 00000000..e6678f01 --- /dev/null +++ b/software/archive/microcontroller/actuators/actuator.h @@ -0,0 +1,84 @@ +#ifndef PEAPOD_ACTUATORS_ACTUATOR_H_ +#define PEAPOD_ACTUATORS_ACTUATOR_H_ + +// HEADERS + +#include + +#include + +// DECLARATIONS + +// All actuator state info +typedef struct ActuatorState { + // Error level + errorlevel_t error; + + // Other state information + debuglevel_t debug; + + // Last successfully set target - is set to the value of `target` on successful `set()` + float lasttarget; +} ActuatorState; + +// CLASS + +class Actuator { + public: + /** + * @param failtarget Target that the actuator should be set to in case of failure + */ + Actuator(const char* const* id, float failtarget); + + /** + * Wrapper function for `set()`. Checks debug state (initialized). + * @returns Pointer to actuator state + */ + ActuatorState* update(void); + + /** + * Wrapper function for `initialize()`. Sets debug state to indicate initialization success or failure, and also performs a first `update()`. + * @return Pointer to actuator state + */ + ActuatorState* begin(void); + + // @return Pointer to actuator state + ActuatorState* getState(void); + + // @param target Actuator target + void setTarget(float target); + + // @return String representation of this actuator + String toString(void); + + String getID(void); + + protected: + /** + * Initializes actuator. To be implemented by the child class. + * @return Error level for this initialization attempt + */ + virtual errorlevel_t initialize(void) = 0; + + /** + * Sets actuator state. To be implemented by the child class. + * @param target Target for this actuator + * @return Error level for this set attempt + */ + virtual errorlevel_t set(float target) = 0; + + private: + // Actuator ID + const char* const* _id; + + // Stores all the latest state data for this actuator. + ActuatorState state; + + // Failsafe target + float failtarget; + + // Target state value for this actuator + float target; +}; + +#endif diff --git a/software/archive/microcontroller/actuators/led.cc b/software/archive/microcontroller/actuators/led.cc new file mode 100644 index 00000000..d9324aa5 --- /dev/null +++ b/software/archive/microcontroller/actuators/led.cc @@ -0,0 +1,20 @@ +// HEADERS + +#include + +#include + +#include +#include +#include + +// CONSTRUCTOR + +LED::LED(const uint8_t pin, ledwavelength_t wavelength) : PWM(&id, pin), color(String(wavelength + "nm")) { } + +LED::LED(const uint8_t pin, ledtemperature_t temperature) : PWM(&id, pin), color(String(temperature + "K")) { } + +String LED::toString(void) { + return Actuator::toString() + " (" + color + ")"; +} + diff --git a/software/archive/microcontroller/actuators/led.h b/software/archive/microcontroller/actuators/led.h new file mode 100644 index 00000000..ec69dc0e --- /dev/null +++ b/software/archive/microcontroller/actuators/led.h @@ -0,0 +1,57 @@ +#ifndef PEAPOD_ACTUATORS_LED_H_ +#define PEAPOD_ACTUATORS_LED_H_ + +// HEADERS + +#include + +#include +#include +#include + +// GLOBALS +// Used when you need a pointer to static PROGMEM - these variables are ONLY INITIALIZED in the .cc SOURCE file that INCLUDES this header file +#ifndef GLOBALS // Double-declaration blocker + #define GLOBALS + // Descriptors - overallocated for suffix + static const PROGMEM char* const id = "LED"; +#endif + +// CLASS + +// Interface for PWM-dimmable LEDs. +class LED : public PWM { + public: + typedef enum ledwavelength_t { + LED_CREE_XPG3_BLUE = 448, + LED_CREE_XPG3_RED = 645, + LED_CREE_XPE2_FARRED = 730, + } ledwavelength_t; + + typedef enum ledtemperature_t { + LED_CREE_XPG3_WARMWHITE = 2700, + LED_CREE_XPG3_COOLWHITE = 5700, + } ledtemperature_t; + + /** + * Constructor. + * @param pin PWM pin for controlling this LED. + * @param wavelength Wavelength of light emitted (nm) + */ + LED(const uint8_t pin, ledwavelength_t wavelength); + + /** + * Constructor. + * @param pin PWM pin for controlling this LED. + * @param temperature Color temperature (K) + */ + LED(const uint8_t pin, ledtemperature_t temperature); + + String toString(void); + + private: + // LED color. + const String color; +}; + +#endif diff --git a/software/archive/microcontroller/actuators/onoff.cc b/software/archive/microcontroller/actuators/onoff.cc new file mode 100644 index 00000000..9bc52b81 --- /dev/null +++ b/software/archive/microcontroller/actuators/onoff.cc @@ -0,0 +1,25 @@ +// HEADERS + +#include + +#include + +#include +#include + +// CONSTRUCTOR + +OnOff::OnOff(const char* const* id, const uint8_t pin) : Actuator(id, 0), pin(pin) { } + +// PUBLIC METHODS + +errorlevel_t OnOff::initialize(void) { + pinMode(pin, OUTPUT); + return ERR_NONE; +} + +errorlevel_t OnOff::set(float target) { + // Round to 0 or 1 + digitalWrite(pin, target >= 0.5 ? 1 : 0); + return ERR_NONE; +} \ No newline at end of file diff --git a/software/archive/microcontroller/actuators/onoff.h b/software/archive/microcontroller/actuators/onoff.h new file mode 100644 index 00000000..fdc6a33e --- /dev/null +++ b/software/archive/microcontroller/actuators/onoff.h @@ -0,0 +1,26 @@ +#ifndef PEAPOD_ACTUATORS_ONOFF_H_ +#define PEAPOD_ACTUATORS_ONOFF_H_ + +#include + +#include +#include + +class OnOff : public Actuator { + public: + + /** + * Constructor. + * @param id Actuator ID + * @param pin Digital output pin for controlling this on/off actuator. + */ + OnOff(const char* const* id, const uint8_t pin); + private: + errorlevel_t initialize(void) override; + errorlevel_t set(float target) override; + + // Digital output pin. + const uint8_t pin; +}; + +#endif diff --git a/software/archive/microcontroller/actuators/pwm.cc b/software/archive/microcontroller/actuators/pwm.cc new file mode 100644 index 00000000..38751a03 --- /dev/null +++ b/software/archive/microcontroller/actuators/pwm.cc @@ -0,0 +1,26 @@ +// HEADERS + +#include + +#include + +#include +#include + +// CONSTRUCTOR + +PWM::PWM(const char* const* id, const uint8_t pin) : Actuator(id, 0), pin(pin) { } + +// PUBLIC METHODS + +errorlevel_t PWM::initialize(void) { + pinMode(pin, OUTPUT); + return ERR_NONE; +} + +errorlevel_t PWM::set(float target) { + // Clamp to 0 < x < 1 + target = min(max(target, 0), 1); + analogWrite(pin, target * 255); + return ERR_NONE; +} \ No newline at end of file diff --git a/software/archive/microcontroller/actuators/pwm.h b/software/archive/microcontroller/actuators/pwm.h new file mode 100644 index 00000000..5a5a2fa4 --- /dev/null +++ b/software/archive/microcontroller/actuators/pwm.h @@ -0,0 +1,31 @@ +#ifndef PEAPOD_ACTUATORS_PWM_H_ +#define PEAPOD_ACTUATORS_PWM_H_ + +// HEADERS + +#include + +#include +#include + +// CLASS + +// Abstract interface for any PWM-controllable actuator +class PWM : public Actuator { + public: + + /** + * Constructor. + * @param id ID of this actuator + * @param pin Digital output PWM pin for controlling this PWM-capable actuator. + */ + PWM(const char* const* id, const uint8_t pin); + private: + errorlevel_t initialize(void) override; + errorlevel_t set(float target) override; + + // PWM output pin. + const uint8_t pin; +}; + +#endif diff --git a/software/archive/microcontroller/actuators/solenoid.cc b/software/archive/microcontroller/actuators/solenoid.cc new file mode 100644 index 00000000..927403b1 --- /dev/null +++ b/software/archive/microcontroller/actuators/solenoid.cc @@ -0,0 +1,13 @@ +// HEADERS + +#include + +#include + +#include +#include +#include + +// CONSTRUCTOR + +Solenoid::Solenoid(const uint8_t pin) : OnOff(&id, pin) { } \ No newline at end of file diff --git a/software/archive/microcontroller/actuators/solenoid.h b/software/archive/microcontroller/actuators/solenoid.h new file mode 100644 index 00000000..aba0990b --- /dev/null +++ b/software/archive/microcontroller/actuators/solenoid.h @@ -0,0 +1,32 @@ +#ifndef PEAPOD_ACTUATORS_SOLENOID_H_ +#define PEAPOD_ACTUATORS_SOLENOID_H_ + +// HEADERS + +#include + +#include +#include +#include + +// GLOBALS +// Used when you need a pointer to static PROGMEM - these variables are ONLY INITIALIZED in the .cc SOURCE file that INCLUDES this header file +#ifndef GLOBALS // Double-declaration blocker + #define GLOBALS + // Descriptors + static const PROGMEM char* const id = "Solenoid"; +#endif + +// CLASS + +// Interface for relay-controlled solenoids +class Solenoid : public OnOff { + public: + /** + * Constructor. + * @param pin PWM pin for controlling this LED. + */ + Solenoid(const uint8_t pin); +}; + +#endif diff --git a/software/archive/microcontroller/actuators/supply.cc b/software/archive/microcontroller/actuators/supply.cc new file mode 100644 index 00000000..c41dd8fb --- /dev/null +++ b/software/archive/microcontroller/actuators/supply.cc @@ -0,0 +1,13 @@ +// HEADERS + +#include + +#include + +#include +#include +#include + +// CONSTRUCTOR + +SupplyPump::SupplyPump(const uint8_t pin) : OnOff(&id, pin) { } \ No newline at end of file diff --git a/software/archive/microcontroller/actuators/supply.h b/software/archive/microcontroller/actuators/supply.h new file mode 100644 index 00000000..de8da177 --- /dev/null +++ b/software/archive/microcontroller/actuators/supply.h @@ -0,0 +1,32 @@ +#ifndef PEAPOD_ACTUATORS_SUPPLY_H_ +#define PEAPOD_ACTUATORS_SUPPLY_H_ + +// HEADERS + +#include + +#include +#include +#include + +// GLOBALS +// Used when you need a pointer to static PROGMEM - these variables are ONLY INITIALIZED in the .cc SOURCE file that INCLUDES this header file +#ifndef GLOBALS // Double-declaration blocker + #define GLOBALS + // Descriptors + static const PROGMEM char* const id = "Supply Pump"; +#endif + +// CLASS + +// Interface for the supply pump. +class SupplyPump : public OnOff { + public: + /** + * Constructor. + * @param pin PWM pin for controlling this LED. + */ + SupplyPump(const uint8_t pin); +}; + +#endif diff --git a/software/archive/microcontroller/actuators/tec.cc b/software/archive/microcontroller/actuators/tec.cc new file mode 100644 index 00000000..930434e6 --- /dev/null +++ b/software/archive/microcontroller/actuators/tec.cc @@ -0,0 +1,30 @@ +// HEADERS + +#include + +#include + +#include +#include + +// CONSTRUCTOR + +TEC::TEC(uint8_t powerpin, uint8_t relayApin, uint8_t relayBpin) : Actuator(&id, 0), power(powerpin), relayA(relayApin), relayB(relayBpin) { } + +// PUBLIC METHODS + +errorlevel_t TEC::initialize(void) { + pinMode(power, OUTPUT); + pinMode(relayA, OUTPUT); + pinMode(relayB, OUTPUT); + return ERR_NONE; +} + +errorlevel_t TEC::set(float target) { + // Clamp to -1 < x < 1 + target = min(max(target, -1), 1); + analogWrite(power, abs(target) * 255); + analogWrite(relayA, 255 * (target >= TEC_DEADZONE ? 1 : 0)); + analogWrite(relayB, 255 * (target <= -TEC_DEADZONE ? 1 : 0)); + return ERR_NONE; +} \ No newline at end of file diff --git a/software/archive/microcontroller/actuators/tec.h b/software/archive/microcontroller/actuators/tec.h new file mode 100644 index 00000000..8d8a975c --- /dev/null +++ b/software/archive/microcontroller/actuators/tec.h @@ -0,0 +1,48 @@ +#ifndef PEAPOD_ACTUATORS_TEC_H_ +#define PEAPOD_ACTUATORS_TEC_H_ + +// HEADERS + +#include + +#include +#include + +// MACROS + +// Settings +#define TEC_DEADZONE 0.01 + +// GLOBALS +// Used when you need a pointer to static PROGMEM - these variables are ONLY INITIALIZED in the .cc SOURCE file that INCLUDES this header file +#ifndef GLOBALS // Double-declaration blocker + #define GLOBALS + // Descriptors + static const PROGMEM char* const id = "Thermoelectric Controller"; +#endif + +// CLASS + +// Interface for Thermoelectric Controllers. +class TEC : public Actuator { + public: + + /** + * Constructor. + * @param powerpin Digital PWM output pin for controlling heat pump magnitude + * @param relayApin Digital output pin for controlling heat pump direction relay A + * @param relayBpin Digital output pin for controlling heat pump direction relay B + */ + TEC(uint8_t powerpin, uint8_t relayApin, uint8_t relayBpin); + private: + errorlevel_t initialize(void) override; + errorlevel_t set(float target) override; + + // "Magnitude" PWM output pin. + const uint8_t power; + + // "Direction"/relay control digital output pins. + const uint8_t relayA, relayB; +}; + +#endif diff --git a/software/archive/microcontroller/debug.h b/software/archive/microcontroller/debug.h new file mode 100644 index 00000000..74df0c70 --- /dev/null +++ b/software/archive/microcontroller/debug.h @@ -0,0 +1,38 @@ +#ifndef CSOS_DEBUG_SERIAL + +#include + +// #define DEBUG 1 // Uncomment to enable debug + +// BASIC DEBUG MACRO +#ifdef DEBUG +#if DEBUG == 1 +#ifndef DEBUG_SERIAL +#define DEBUG_SERIAL Serial +#endif +#endif +#endif + +// CROSS-LIBRARY DEBUG COMPATIBILITY +#ifdef DEBUG_SERIAL +#define CSOS_DEBUG_SERIAL DEBUG_SERIAL +#endif + +// DEBUG DELAY MACRO FOR SERIAL OUTPUT STABILITY (OPTIONAL) +#ifdef CSOS_DEBUG_SERIAL +#ifndef DEBUG_DELAY +#define DEBUG_DELAY() {delay(10);} +#endif +#endif + +// #define DEBUG_DISABLE_FSTRINGS 1 +#ifdef DEBUG_DISABLE_FSTRINGS +#define _F(x) x +#else +#define _F(x) F(x) +#endif + +#endif + +// #include <../I2CIP/debug.h> +// #include <../FiniteStateMachine/debug.h> \ No newline at end of file diff --git a/software/archive/microcontroller/interfaces/adc.cc b/software/archive/microcontroller/interfaces/adc.cc new file mode 100644 index 00000000..0ca6840c --- /dev/null +++ b/software/archive/microcontroller/interfaces/adc.cc @@ -0,0 +1,107 @@ +#include + +#include +#include + +using namespace ControlSystemsOS; + +ControlSystemsOS::ADC::ADC(const i2cip_fqa_t& fqa, const i2cip_id_t& id) : Device(fqa, id), InputInterface((Device*)this) { } + +i2cip_errorlevel_t ControlSystemsOS::ADC::get(float& dest, const args_adc_t& args) { + // Set config register values + uint16_t config = + ADC_REG_CONFIG_CQUE_1CONV | // Set CQUE to any value other than none so we can use it in RDY mode + ADC_REG_CONFIG_CLAT_NONLAT | // Non-latching (default val) + ADC_REG_CONFIG_CPOL_ACTVLOW | // Alert/Rdy active low (default val) + ADC_REG_CONFIG_CMODE_TRAD | // Traditional comparator (default val) + ADC_REG_CONFIG_MODE_SINGLE | // Single-ended discrete reading + ADC_GAIN | // Gain setting + ADC_SPS | // Sampling rate setting + ADC_CHANNEL_TO_MUX(args) | // Set MUX from channel # + ADC_REG_CONFIG_OS_SINGLE; // Set 'start single-conversion' bit + + // Overwrite config register + i2cip_errorlevel_t errlev = this->writeRegister(ADC_REG_POINTER_CONFIG, config); + I2CIP_ERR_BREAK(errlev); + + // Write threshold registers + uint16_t instr = 0x8000; + errlev = this->writeRegister(ADC_REG_POINTER_HITHRESH, instr); + I2CIP_ERR_BREAK(errlev); + + instr = 0x0; + errlev = this->writeRegister(ADC_REG_POINTER_LOWTHRESH, instr); + I2CIP_ERR_BREAK(errlev); + + // Wait for the conversion to complete + uint8_t timeout = 0; + uint16_t ready = 0; + do { + if(timeout == ADC_TIMEOUT) { + errlev = I2CIP_ERR_SOFT; + break; + } + errlev = this->readRegisterWord(ADC_REG_POINTER_CONFIG, ready); + timeout++; + } while(((ready & 0x8000) == 0) && (errlev == I2CIP_ERR_NONE)); + I2CIP_ERR_BREAK(errlev); + + // Read the conversion results + uint16_t result; + errlev = this->readRegisterWord(ADC_REG_POINTER_CONVERT, result); + I2CIP_ERR_BREAK(errlev); + uint8_t buf [2] = { 0 }; + size_t readlen = 2; + result &= this->read(buf, readlen); + + // Shift 12-bit results right 4 bits for the ADS1015, making sure we keep the sign bit intact + uint16_t res = (((uint16_t)buf[0] << 8) | buf[1]) >> ADC_SHIFT; + if (res > 0x07FF) { + // negative number - extend the sign to 16th bit + res |= 0xF000; + } + dest = ControlSystemsOS::ADC::computeVolts((int16_t)res); + return errlev; +} + +const args_adc_t& ControlSystemsOS::ADC::getDefaultA(void) const { + return ControlSystemsOS::ADC::default_a; +} + +void ControlSystemsOS::ADC::clearCache(void) { + this->setCache(ControlSystemsOS::ADC::default_cache); + + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(F("ADC Cache Cleared\n")); + DEBUG_DELAY(); + #endif +} + +float ControlSystemsOS::ADC::computeVolts(int16_t counts) { + // see data sheet Table 3 + float fsRange; + switch (ADC_GAIN) { + case GAIN_TWOTHIRDS: + fsRange = 6.144f; + break; + case GAIN_ONE: + fsRange = 4.096f; + break; + case GAIN_TWO: + fsRange = 2.048f; + break; + case GAIN_FOUR: + fsRange = 1.024f; + break; + case GAIN_EIGHT: + fsRange = 0.512f; + break; + case GAIN_SIXTEEN: + fsRange = 0.256f; + break; + default: + fsRange = 0.0f; + } + return counts * (fsRange / (32768 >> ADC_SHIFT)); +} \ No newline at end of file diff --git a/software/archive/microcontroller/interfaces/adc.h b/software/archive/microcontroller/interfaces/adc.h new file mode 100644 index 00000000..0a3a4bb1 --- /dev/null +++ b/software/archive/microcontroller/interfaces/adc.h @@ -0,0 +1,142 @@ +#ifndef CSOS_INTERFACES_ADC_H_ +#define CSOS_INTERFACES_ADC_H_ + +#include +#include + +// Not sure if this will break something. Let's try it and find out +#ifdef ADC +#undef ADC +#endif + +// REGISTERS + +// Pointer register +#define ADC_REG_POINTER_MASK (uint8_t)0x03 // Point mask +#define ADC_REG_POINTER_CONVERT (uint8_t)0x00 // Conversion +#define ADC_REG_POINTER_CONFIG (uint8_t)0x01 // Configuration +#define ADC_REG_POINTER_LOWTHRESH (uint8_t)0x02 // Low threshold +#define ADC_REG_POINTER_HITHRESH (uint8_t)0x03 // High threshold + +// Config register: OS bit +#define ADC_REG_CONFIG_OS_MASK (uint16_t)0x8000 // OS Mask +#define ADC_REG_CONFIG_OS_SINGLE (uint16_t)0x8000 // Write: Set to start a single-conversion +#define ADC_REG_CONFIG_OS_BUSY (uint16_t)0x0000 // Read: Bit = 0 when conversion is in progress +#define ADC_REG_CONFIG_OS_NOTBUSY (uint16_t)0x8000 // Read: Bit = 1 when device is not performing a conversion + +// Config register: MUX bits +#define ADC_REG_CONFIG_MUX_MASK (uint16_t)0x7000 // Mux Mask +#define ADC_REG_CONFIG_MUX_DIFF_0_1 (uint16_t)0x0000 // Differential P = AIN0, N = AIN1 (default) +#define ADC_REG_CONFIG_MUX_DIFF_0_3 (uint16_t)0x1000 // Differential P = AIN0, N = AIN3 +#define ADC_REG_CONFIG_MUX_DIFF_1_3 (uint16_t)0x2000 // Differential P = AIN1, N = AIN3 +#define ADC_REG_CONFIG_MUX_DIFF_2_3 (uint16_t)0x3000 // Differential P = AIN2, N = AIN3 +#define ADC_REG_CONFIG_MUX_SINGLE_0 (uint16_t)0x4000 // Single-ended AIN0 +#define ADC_REG_CONFIG_MUX_SINGLE_1 (uint16_t)0x5000 // Single-ended AIN1 +#define ADC_REG_CONFIG_MUX_SINGLE_2 (uint16_t)0x6000 // Single-ended AIN2 +#define ADC_REG_CONFIG_MUX_SINGLE_3 (uint16_t)0x7000 // Single-ended AIN3 + +// Config register: Gain bits +#define ADC_REG_CONFIG_PGA_MASK (uint16_t)0x0E00 // PGA Mask +#define ADC_REG_CONFIG_PGA_6_144V (uint16_t)0x0000 // +/-6.144V range = Gain 2/3 +#define ADC_REG_CONFIG_PGA_4_096V (uint16_t)0x0200 // +/-4.096V range = Gain 1 +#define ADC_REG_CONFIG_PGA_2_048V (uint16_t)0x0400 // +/-2.048V range = Gain 2 (default) +#define ADC_REG_CONFIG_PGA_1_024V (uint16_t)0x0600 // +/-1.024V range = Gain 4 +#define ADC_REG_CONFIG_PGA_0_512V (uint16_t)0x0800 // +/-0.512V range = Gain 8 +#define ADC_REG_CONFIG_PGA_0_256V (uint16_t)0x0A00 // +/-0.256V range = Gain 16 + +// Config register: ADC mode bit +#define ADC_REG_CONFIG_MODE_MASK (uint16_t)0x0100 // Mode Mask +#define ADC_REG_CONFIG_MODE_CONTIN (uint16_t)0x0000 // Continuous conversion mode +#define ADC_REG_CONFIG_MODE_SINGLE (uint16_t)0x0100 // Power-down single-shot mode (default) + +// Config register: sample rate bits +#define ADC_REG_CONFIG_RATE_MASK (uint16_t)0x00E0 // Data Rate Mask +#define ADC_RATE_128SPS (uint16_t)0x0000 // 128 samples per second +#define ADC_RATE_250SPS (uint16_t)0x0020 // 250 samples per second +#define ADC_RATE_490SPS (uint16_t)0x0040 // 490 samples per second +#define ADC_RATE_920SPS (uint16_t)0x0060 // 920 samples per second +#define ADC_RATE_1600SPS (uint16_t)0x0080 // 1600 samples per second (default) +#define ADC_RATE_2400SPS (uint16_t)0x00A0 // 2400 samples per second +#define ADC_RATE_3300SPS (uint16_t)0x00C0 // 3300 samples per second + +// Config register: Comparator mode bit +#define ADC_REG_CONFIG_CMODE_MASK (uint16_t)0x0010 // CMode Mask +#define ADC_REG_CONFIG_CMODE_TRAD (uint16_t)0x0000 // Traditional comparator with hysteresis (default) +#define ADC_REG_CONFIG_CMODE_WINDOW (uint16_t)0x0010 // Window comparator + +// Config register: Comparator polarity bit +#define ADC_REG_CONFIG_CPOL_MASK (uint16_t)0x0008 // CPol Mask +#define ADC_REG_CONFIG_CPOL_ACTVLOW (uint16_t)0x0000 // ALERT/RDY pin is low when active (default) +#define ADC_REG_CONFIG_CPOL_ACTVHI (uint16_t)0x0008 // ALERT/RDY pin is high when active + +// Config register: Comparator latching bit +#define ADC_REG_CONFIG_CLAT_MASK (uint16_t)0x0004 // Determines if ALERT/RDY pin latches once asserted +#define ADC_REG_CONFIG_CLAT_NONLAT (uint16_t)0x0000 // Non-latching comparator (default) +#define ADC_REG_CONFIG_CLAT_LATCH (uint16_t)0x0004 // Latching comparator + +// Config register: Comparator queue bits +#define ADC_REG_CONFIG_CQUE_MASK (uint16_t)0x0003 // CQue Mask +#define ADC_REG_CONFIG_CQUE_1CONV (uint16_t)0x0000 // Assert ALERT/RDY after one conversions +#define ADC_REG_CONFIG_CQUE_2CONV (uint16_t)0x0001 // Assert ALERT/RDY after two conversions +#define ADC_REG_CONFIG_CQUE_4CONV (uint16_t)0x0002 // Assert ALERT/RDY after four conversions +#define ADC_REG_CONFIG_CQUE_NONE (uint16_t)0x0003 // Disable the comparator and put ALERT/RDY in high state (default) + +// HELPERS +#define ADC_CHANNEL_TO_MUX(channel) (0x4000 + (channel) * 0x1000) + +// SETTINGS +#define ADC_ADDR 0x48 +#define ADC_SHIFT 4 +#define ADC_GAIN ADC::GAIN_TWOTHIRDS // +/-6.144V for 0-5V single-ended analogRead +#define ADC_SPS ADC_RATE_1600SPS +#define ADC_TIMEOUT 100 + +using namespace I2CIP; + +typedef enum { + ADC_CHANNEL_NULL = 0xFF, + ADC_CHANNEL_0 = 0x0, + ADC_CHANNEL_1, + ADC_CHANNEL_2, + ADC_CHANNEL_3 +} args_adc_t; + +namespace ControlSystemsOS { + + // Interface class for the ADS1015 12-bit ADC IC. Reads analog voltage (range: +/-6.144V) + class ADC : public Device, public InputInterface { + friend Device* ControlSystemsOS::adcFactory(const i2cip_fqa_t& fqa); + + private: + const float default_cache = 0.0f; + const args_adc_t default_a = ADC_CHANNEL_NULL; + + // Gain settings + typedef enum { + GAIN_TWOTHIRDS = ADC_REG_CONFIG_PGA_6_144V, + GAIN_ONE = ADC_REG_CONFIG_PGA_4_096V, + GAIN_TWO = ADC_REG_CONFIG_PGA_2_048V, + GAIN_FOUR = ADC_REG_CONFIG_PGA_1_024V, + GAIN_EIGHT = ADC_REG_CONFIG_PGA_0_512V, + GAIN_SIXTEEN = ADC_REG_CONFIG_PGA_0_256V + } adc_gain_t; + + static float computeVolts(int16_t counts); + + ADC(const i2cip_fqa_t& fqa, const i2cip_id_t& id); + + public: + /** + * Read an ADC channel. + * @param fqa + * @param dest Pin state + * @param args Pin number + **/ + i2cip_errorlevel_t get(float& dest, const args_adc_t& args) override; + + const args_adc_t& getDefaultA(void) const override; + void clearCache(void) override; + }; +}; + +#endif \ No newline at end of file diff --git a/software/archive/microcontroller/interfaces/eeprom.cc b/software/archive/microcontroller/interfaces/eeprom.cc new file mode 100644 index 00000000..fd1107cf --- /dev/null +++ b/software/archive/microcontroller/interfaces/eeprom.cc @@ -0,0 +1,46 @@ +#include + +#include + +#include +#include +#include + +EEPROM::EEPROM(MUX* mux, uint8_t addr, uint8_t bus) : Interface(addr, mux, bus), size(EEPROM_SIZE) { } + +EEPROM::EEPROM(MUX* mux, size_t size, uint8_t addr, uint8_t bus) : Interface(addr, mux, bus), size(size) { } + +/** + * Reads until the first null ('/-') character, or the end of the EEPROM, whichever comes first. + * @param buff Pointer to the buffer to copy the contents into. + * @param len Pointer to the size_t into which to copy the number of bytes read. + * @return Error Level + */ +errorlevel_t EEPROM::read(char* buff, size_t* len) { + // Multiple operations being performed, reset the MUX manually + mux. + + // Byte currently being read + uint16_t bytenum = 0; + for (uint16_t x = 0; x < size; x++) { + // Request data from the EEPROM chip at byte `bytenum` + errorlevel_t result = thisinterface.write(bytenum); + // Store the requested data (copy as a byte pointer) + result &= thisinterface.read((uint8_t*)buff, 1, false); + if (result != ERR_NONE) { + // Failed, stop + buff[x] = '\0'; + *len = x+1; + return ERR_SOFT; + } + if (buff[0] == '\0') { + // END + *len = x+1; + break; + } + buff[x] = buff[0]; + + bytenum++; + } + return ERR_NONE; +} \ No newline at end of file diff --git a/software/archive/microcontroller/interfaces/eeprom.h b/software/archive/microcontroller/interfaces/eeprom.h new file mode 100644 index 00000000..cede5342 --- /dev/null +++ b/software/archive/microcontroller/interfaces/eeprom.h @@ -0,0 +1,29 @@ +#ifndef CSOS_INTERFACES_EEPROM_H_ +#define CSOS_INTERFACES_EEPROM_H_ + +#define EEPROM_ADDR 0x50 // Default device address +#define EEPROM_SIZE 200 // Bytes + +#include + +#include +#include +#include + +// Interface class for EEPROM +class EEPROM : public Interface { + private: + const size_t size; + public: + EEPROM(MUX* mux, uint8_t addr = EEPROM_ADDR, uint8_t bus = MUX_BUS_DEFAULT); + EEPROM(MUX* mux, size_t size, uint8_t addr = EEPROM_ADDR, uint8_t bus = MUX_BUS_DEFAULT); + + /** + * Read from the EEPROM into a buffer, until '\0' + * @param buffer The buffer to read into + * @param len Pointer to a variable for how many bytes were read + */ + errorlevel_t read(char* buffer, size_t* len); +}; + +#endif \ No newline at end of file diff --git a/software/archive/microcontroller/interfaces/gpio.cc b/software/archive/microcontroller/interfaces/gpio.cc new file mode 100644 index 00000000..8583e4b8 --- /dev/null +++ b/software/archive/microcontroller/interfaces/gpio.cc @@ -0,0 +1,69 @@ +#include + +#include +#include + +using namespace ControlSystemsOS; + +GPIO::GPIO(const i2cip_fqa_t& fqa, const i2cip_id_t& id) : Device(fqa, id), IOInterface((Device*)this) { } + +i2cip_errorlevel_t GPIO::get(state_gpio_t& dest, const args_gpio_t& args) { + // Set pin mode + i2cip_errorlevel_t errlev = this->pinMode(args, GPIO_PINMODE_INPUT); + I2CIP_ERR_BREAK(errlev); + + // Read in register + uint8_t value; + errlev = this->readRegisterByte(GPIO_PIN_REG(GPIO_GPIO, args), value); + dest = (errlev > I2CIP_ERR_NONE ? GPIO_PIN_UNDEF : (state_gpio_t)READ_BITS(value, GPIO_PIN_SHIFT(args), 1)); + return errlev; +} + +i2cip_errorlevel_t GPIO::set(const state_gpio_t& value, const args_gpio_t& args) { + if(value == GPIO_PIN_UNDEF) { + return I2CIP_ERR_SOFT; + } + + // Set pin mode + i2cip_errorlevel_t errlev = this->pinMode(args, GPIO_PINMODE_OUTPUT); + I2CIP_ERR_BREAK(errlev); + + // Read register + uint8_t existing; + errlev = this->readRegisterByte(GPIO_PIN_REG(GPIO_GPIO, args), existing); + I2CIP_ERR_BREAK(errlev); + + // Write register + return this->writeRegister(GPIO_PIN_REG(GPIO_GPIO, args), OVERWRITE_BITS(existing, value, (args % 8), 1)); +} + +i2cip_errorlevel_t GPIO::pinMode(const args_gpio_t& pin, const gpio_pinmode_t& mode) { + // Read in register + uint8_t existing; + i2cip_errorlevel_t errlev = this->readRegisterByte(GPIO_PIN_REG(GPIO_IODIR, pin), existing); + I2CIP_ERR_BREAK(errlev); + + // Write to register + return this->writeRegister(GPIO_PIN_REG(GPIO_IODIR, pin), OVERWRITE_BITS(existing, mode, (pin % 8), 1)); +} + +// args_gpio_t getDefaultA(void) const override; +// state_gpio_t getDefaultCache(void) const override; +// args_gpio_t getDefaultB(void) const override; +// state_gpio_t getFailsafe(void) const override; + +const args_gpio_t& GPIO::getDefaultA(void) const { + return default_a; +} + +void GPIO::clearCache(void) { + this->setCache(default_cache); +} + +const args_gpio_t& GPIO::getDefaultB(void) const { + return default_b; +} + +void GPIO::resetFailsafe(void) { + this->setValue(default_failsafe); +} \ No newline at end of file diff --git a/software/archive/microcontroller/interfaces/gpio.h b/software/archive/microcontroller/interfaces/gpio.h new file mode 100644 index 00000000..9b03eac5 --- /dev/null +++ b/software/archive/microcontroller/interfaces/gpio.h @@ -0,0 +1,110 @@ +#ifndef CSOS_INTERFACES_GPIO_H_ +#define CSOS_INTERFACES_GPIO_H_ + +#include +#include + +// MACROS +// Registers +#define GPIO_IODIR 0x00 // I/O direction register +#define GPIO_IPOL 0x02 // Input polarity register +#define GPIO_GPINTEN 0x04 // Interrupt-on-change control register +#define GPIO_DEFVAL 0x06 // Default compare register for interrupt-on-change +#define GPIO_INTCON 0x08 // Interrupt control register +#define GPIO_IOCON 0x0A // Configuration register +#define GPIO_GPPU 0x0C // Pull-up resistor configuration register +#define GPIO_INTF 0x0E // Interrupt flag register +#define GPIO_INTCAP 0x10 // Interrupt capture register +#define GPIO_GPIO 0x12 // Port register +#define GPIO_OLAT 0x14 // Output latch register + +// Constants +#define GPIO_NUMPINS 16 + +// Settings +#define GPIO_ADDR 0x20 // Default address + +/** + * Determine shifted register address from pin number. + **/ +#define GPIO_PIN_REG(reg, pin) (uint8_t)((pin < 8) ? reg : reg+1) + +#define GPIO_PIN_SHIFT(pin) (pin % 8) + +typedef enum { + GPIO_PIN_NULL = 0xFF, + GPIO_PIN_A0 = 0, + GPIO_PIN_A1, + GPIO_PIN_A2, + GPIO_PIN_A3, + GPIO_PIN_A4, + GPIO_PIN_A5, + GPIO_PIN_A6, + GPIO_PIN_A7, + GPIO_PIN_B0, + GPIO_PIN_B1, + GPIO_PIN_B2, + GPIO_PIN_B3, + GPIO_PIN_B4, + GPIO_PIN_B5, + GPIO_PIN_B6, + GPIO_PIN_B7, +} args_gpio_t; + +typedef enum { + GPIO_PIN_UNDEF = 0xFF, + GPIO_PIN_LOW = LOW, + GPIO_PIN_HIGH = HIGH +} state_gpio_t; + +typedef enum { + // GPIO_PINMODE_UNDEF = 0xFF, + GPIO_PINMODE_OUTPUT = 0, + GPIO_PINMODE_INPUT = 1 +} gpio_pinmode_t; + +using namespace I2CIP; + +namespace ControlSystemsOS { + + // Interface class for the MCP23017 16-pin GPIO IC + class GPIO : public Device, public IOInterface { + friend Device* gpioFactory(const i2cip_fqa_t& fqa); + + private: + const state_gpio_t default_cache = GPIO_PIN_UNDEF; + const args_gpio_t default_a = GPIO_PIN_NULL; + const state_gpio_t default_failsafe = GPIO_PIN_LOW; + const args_gpio_t default_b = GPIO_PIN_NULL; + /** + * @param fqa + * @param pin Pin number + * @param mode Pin mode + **/ + i2cip_errorlevel_t pinMode(const args_gpio_t& pin, const gpio_pinmode_t& mode); + + GPIO(const i2cip_fqa_t& fqa, const i2cip_id_t& id); + + public: + /** + * Read a GPIO pin. + * @param dest Pin state + * @param args Pin number + **/ + i2cip_errorlevel_t get(state_gpio_t& dest, const args_gpio_t& args) override; + + /** + * Write to a GPIO pin. + * @param dest Pin state + * @param args Pin number + **/ + i2cip_errorlevel_t set(const state_gpio_t& value, const args_gpio_t& args) override; + + const args_gpio_t& getDefaultA(void) const override; + void clearCache(void) override; + const args_gpio_t& getDefaultB(void) const override; + void resetFailsafe(void) override; + }; +}; + +#endif \ No newline at end of file diff --git a/software/archive/microcontroller/interfaces/interface.cc b/software/archive/microcontroller/interfaces/interface.cc new file mode 100644 index 00000000..9ec27af7 --- /dev/null +++ b/software/archive/microcontroller/interfaces/interface.cc @@ -0,0 +1,109 @@ +#include + +#include +#include +#include +#include + +#include +#include +#include + +Interface::Interface(uint8_t addr, MUX* mux, uint8_t bus, TwoWire& wire = Wire) : Adafruit_I2CDevice(addr, &wire), mux(mux), bus(bus) { } + +Interface::Interface(uint8_t addr, TwoWire& wire = Wire) : Adafruit_I2CDevice(addr, &wire), mux(nullptr), bus(0x0) {} + +errorlevel_t Interface::begin(void) { + return ping() ? ERR_NONE : ERR_HARD; +} + +bool Interface::ping(void) { + // `ping()` just looks better okayyy + return thisdevice.begin(); +} + +errorlevel_t Interface::write(const uint8_t* buffer, size_t len, bool reset) { + errorlevel_t status = ERR_NONE; + + // If this interface is on a module, switch the MUX to the correct bus + if (mux != nullptr) { + status &= mux->setBus(bus); + } + + // Device alive? + if(!ping()){ + // Device lost! + return ERR_HARD; + } + + if(!thisdevice.write(buffer, len)) { + status = ERR_SOFT; + } + + // If this interface is on a module, switch the module's MUX to the "inactive" bus (to avoid unintentional messaging) + if (mux != nullptr) { + status &= mux->resetBus(); + } + + return status; +} + +errorlevel_t Interface::write(const uint8_t b, bool reset) { + return write(&b, 1, reset); +} + +errorlevel_t Interface::write(const uint16_t b, bool reset) { + return writeRegister((uint8_t)(b >> 8), (uint8_t)(b & 0xFF)); +} + +errorlevel_t Interface::writeRegister(uint8_t reg, uint8_t value) { + uint8_t buf[2] = { reg, value }; + return write(buf, 2); +} + +errorlevel_t Interface::writeRegister(uint8_t reg, uint16_t value) { + uint8_t buf[3] = { reg, value >> 8, value & 0xFF }; + return write(buf, 3); +} + +errorlevel_t Interface::read(uint8_t* buffer, size_t len, bool reset) { + errorlevel_t status = ERR_NONE; + + // If this interface is on a module, switch the MUX to the correct bus + if (mux != nullptr) { + status &= mux->setBus(bus); + } + + // Device alive? + if(!ping()){ + // Device lost! + return ERR_HARD; + } + + // Attempt to read from the device + if(!thisdevice.read(buffer, len)) { + status &= ERR_SOFT; + } + + // If this interface is on a module, switch the module's MUX to the "inactive" bus (to avoid unintentional messaging) + if (mux != nullptr) { + mux->resetBus(); + } + + return status; +} + +template static S* I2CSensorFactory(Interface* i, JsonObject* args) { + // I2C device; `i` is ignored + // Check for all keys + if(args->containsKey("addr") && args->containsKey("bus") && args->containsKey("moduleaddr")) { + // Parse + uint8_t addr = args->getMember("addr").as(); + uint8_t bus = args->getMember("bus").as(); + uint8_t moduleaddr = args->getMember("moduleaddr").as(); + // Construct + return new S(addr, bus, moduleaddr); + } else { + return nullptr; + } +} \ No newline at end of file diff --git a/software/archive/microcontroller/interfaces/interface.h b/software/archive/microcontroller/interfaces/interface.h new file mode 100644 index 00000000..a3294244 --- /dev/null +++ b/software/archive/microcontroller/interfaces/interface.h @@ -0,0 +1,112 @@ +#ifndef CSOS_INTERFACES_INTERFACE_H_ +#define CSOS_INTERFACES_INTERFACE_H_ + +// Forward declaration to fix circular dependancy +class Interface; + +// HEADERS + +#include +#include +#include + +#include +#include + +extern TwoWire Wire; + +// CLASS +// An Interface is a single I2C peripheeral +// It is used as a generic I2C communications base class for all device classes +class Interface { + protected: + // Kept protected in case inherited classes need direct MUX access. + MUX* mux; + uint8_t bus; + // Reusable reference reference to this object as an Adafruit_I2CDevice. All methods/fields inaccessible. + Adafruit_I2CDevice& thisdevice = (Adafruit_I2CDevice&)(*this); + + // Reusable reference reference to this object as an Adafruit_I2CDevice. All methods/fields inaccessible. + Interface& thisinterface = (*this); + public: + /** + * Constructor. + * @param addr Device address + * @param bus Module MUX's bus that this device is on + * @param mux Module's MUX + * @param wire I2C bus + */ + Interface(uint8_t addr, MUX* mux, uint8_t bus, TwoWire& wire = Wire); + + /** + * Constructor. Used when the device is not on a module/behind a MUX. + * @param addr Device address + * @param wire I2C bus + */ + Interface(uint8_t addr, TwoWire& wire = Wire); + + /** + * Attempt to communicate with the device. + */ + errorlevel_t begin(void); + + /** + * Attempt to communicate with the device. Effectively the same as begin, just looks better sometimes :) + */ + bool ping(void); + + /** + * Write data to the device. + * @param buffer Bytes to send + * @param len Number of bytes + * @param reset Should the MUX be reset? (Default: `true`) + * @return ERR_FAIL: Device lost. ERR_WARN: Detected, failed to write. + */ + errorlevel_t write(const uint8_t* buffer, size_t len, bool reset = true); + + /** + * Write one byte of data to the device. + * @param b Byte to send + * @param reset Should the MUX be reset? (Default: `true`) + * @return ERR_FAIL: Device lost. ERR_WARN: Detected, failed to write. + */ + errorlevel_t write(const uint8_t b, bool reset = true); + + /** + * Write two bytes of data to the device. + * Effectively equivalent to write({b >> 8, b && 0xFF}, 2), but makes sensor interfacing a little easier :) + * @param b 2 bytes to send + * @param reset Should the MUX be reset? (Default: `true`) + * @return ERR_FAIL: Device lost. ERR_WARN: Detected, failed to write. + */ + errorlevel_t write(const uint16_t b, bool reset = true); + + + /** + * Write one byte of data to a specific register. + * Effectively equivalent to write({reg, value}, 2), but makes sensor interfacing a little easier :) + * @param reg Register to write to + * @param value Byte to write + */ + errorlevel_t writeRegister(uint8_t reg, uint8_t value); + + /** + * Write two bytes of data to a specific register. + * Effectively equivalent to write({reg, value >> 8, value & 0xFF }, 3), but makes sensor interfacing a little easier :) + * @param reg Register to write to + * @param value Two bytes to write + */ + errorlevel_t writeRegister(uint8_t reg, uint16_t value); + + /** + * Read data from the device. + * @param buffer Bytes to read to + * @param len Number of bytes to read (Default: `1`) + * @param reset Should the MUX be reset? (Default: `true`) + */ + errorlevel_t read(uint8_t* buffer, size_t len = 1, bool reset = true); +}; + +template static S* I2CSensorFactory(Interface* i, JsonObject* args); + +#endif \ No newline at end of file diff --git a/software/archive/microcontroller/interfaces/linker.cc b/software/archive/microcontroller/interfaces/linker.cc new file mode 100644 index 00000000..7b15639d --- /dev/null +++ b/software/archive/microcontroller/interfaces/linker.cc @@ -0,0 +1,35 @@ +#include + +// 0. EEPROM +#include "../I2CIP/eeprom.h" +I2CIP::Device* ControlSystemsOS::eepromFactory(const i2cip_fqa_t& fqa) { + if(getDeviceID(MAP_INDEX_EEPROM) == nullptr) { + // First time + return I2CIP::EEPROM::eepromFactory(fqa); + } + return I2CIP::EEPROM::eepromFactory(fqa, getDeviceID(MAP_INDEX_EEPROM)); +} + +// 1. ADC +// #include +// I2CIP::Device* ControlSystemsOS::adcFactory(const i2cip_fqa_t& fqa) { +// return new ControlSystemsOS::ADC(fqa, getDeviceID(MAP_INDEX_ADC)); +// } + +// 2. GPIO +// #include +// I2CIP::Device* ControlSystemsOS::gpioFactory(const i2cip_fqa_t& fqa) { +// return new ControlSystemsOS::GPIO(fqa, getDeviceID(MAP_INDEX_GPIO)); +// } + +// 3. PWM +// #include +// I2CIP::Device* ControlSystemsOS::pwmFactory(const i2cip_fqa_t& fqa) { +// return new ControlSystemsOS::PWM(fqa, getDeviceID(MAP_INDEX_PWM)); +// } + +// 4. SHT31 +#include +I2CIP::Device* ControlSystemsOS::sht31Factory(const i2cip_fqa_t& fqa) { + return new ControlSystemsOS::SHT31(fqa, getDeviceID(MAP_INDEX_SHT31)); +} diff --git a/software/archive/microcontroller/interfaces/linker.h b/software/archive/microcontroller/interfaces/linker.h new file mode 100644 index 00000000..c64d0ead --- /dev/null +++ b/software/archive/microcontroller/interfaces/linker.h @@ -0,0 +1,61 @@ +#ifndef CSOS_INTERFACES_H_ +#define CSOS_INTERFACES_H_ + +#include + +#include +#include + +// #include +// #include +// #include +#include + +// MAPPING +#define MAP_INDEX_COUNT 2 +#define MAP_INDEX_EEPROM 0 +// #define MAP_INDEX_ADC 1 +// #define MAP_INDEX_GPIO 2 +// #define MAP_INDEX_PWM 3 +#define MAP_INDEX_SHT31 1 + +namespace ControlSystemsOS { + + // MAP LINKING + + I2CIP::Device* eepromFactory(const i2cip_fqa_t& fqa); + // I2CIP::Device* adcFactory(const i2cip_fqa_t& fqa); + // I2CIP::Device* gpioFactory(const i2cip_fqa_t& fqa); + // I2CIP::Device* pwmFactory(const i2cip_fqa_t& fqa); + I2CIP::Device* sht31Factory(const i2cip_fqa_t& fqa); + + // const char* const adc_id_progmem PROGMEM = {"ADS1015"}; + // const char* const gpio_id_progmem PROGMEM = {"MCP23017"}; + // const char* const pwm_id_progmem PROGMEM = {"PCA9685"}; + + const char PROGMEM device_id_progmem[MAP_INDEX_COUNT][I2CIP_ID_SIZE] = { + {I2CIP_EEPROM_ID}, + // {"ADS1015\0"}, + // {"MCP23017\0"}, + // {"PCA9685\0"}, + {"SHT31"}, + }; + + const I2CIP::factory_device_t device_factory[MAP_INDEX_COUNT] = { + ControlSystemsOS::eepromFactory, + // ControlSystemsOS::adcFactory, + // ControlSystemsOS::gpioFactory, + // ControlSystemsOS::pwmFactory, + ControlSystemsOS::sht31Factory, + }; + + int getMapIndex(const i2cip_id_t& id); + + const char* getDeviceID(uint8_t index); + + // STATE LINKING + + +}; + +#endif \ No newline at end of file diff --git a/software/archive/microcontroller/interfaces/mcp23017.cc b/software/archive/microcontroller/interfaces/mcp23017.cc new file mode 100644 index 00000000..227463a8 --- /dev/null +++ b/software/archive/microcontroller/interfaces/mcp23017.cc @@ -0,0 +1,2 @@ +#include + diff --git a/software/archive/microcontroller/interfaces/mcp23017.h b/software/archive/microcontroller/interfaces/mcp23017.h new file mode 100644 index 00000000..b7ecdcd1 --- /dev/null +++ b/software/archive/microcontroller/interfaces/mcp23017.h @@ -0,0 +1,46 @@ +#ifndef PEAPOD_MODULES_MCP23017_H_ +#define PEAPOD_MODULES_MCP23017_H_ + +// HEADERS + +#include + +#include +#include + +// MACROS + +// Registers +#define MCP23XXX_IODIR 0x00 //!< I/O direction register +#define MCP23XXX_IPOL 0x01 //!< Input polarity register +#define MCP23XXX_GPINTEN 0x02 //!< Interrupt-on-change control register +#define MCP23XXX_DEFVAL \ + 0x03 //!< Default compare register for interrupt-on-change +#define MCP23XXX_INTCON 0x04 //!< Interrupt control register +#define MCP23XXX_IOCON 0x05 //!< Configuration register +#define MCP23XXX_GPPU 0x06 //!< Pull-up resistor configuration register +#define MCP23XXX_INTF 0x07 //!< Interrupt flag register +#define MCP23XXX_INTCAP 0x08 //!< Interrupt capture register +#define MCP23XXX_GPIO 0x09 //!< Port register +#define MCP23XXX_OLAT 0x0A //!< Output latch register + +// Constants +#define MCP23XXX_ADDR 0x20 //!< Default I2C Address + +#define MCP_PORT(pin) ((pin < 8) ? 0 : 1) //!< Determine port from pin number + +class MCP23017 { + private: + int x; + +}; + +uint8_t _width; +uint8_t _addrwidth; +uint16_t _address; +uint8_t _byteorder; +uint8_t *_buffer; + + + +#endif \ No newline at end of file diff --git a/software/archive/microcontroller/interfaces/mux.cc b/software/archive/microcontroller/interfaces/mux.cc new file mode 100644 index 00000000..0d047597 --- /dev/null +++ b/software/archive/microcontroller/interfaces/mux.cc @@ -0,0 +1,16 @@ +#include + +#include + +MUX::MUX(uint8_t addr, TwoWire& wire) : Interface(addr, wire) {} + +errorlevel_t MUX::setBus(uint8_t bus) { + if(bus > 0x07) { + return ERR_SOFT; + } + return write((uint8_t)(0x1 << bus)); +} + +errorlevel_t MUX::resetBus(void) { + return setBus(MUX_BUS_INACTIVE); +} \ No newline at end of file diff --git a/software/archive/microcontroller/interfaces/mux.h b/software/archive/microcontroller/interfaces/mux.h new file mode 100644 index 00000000..54afb836 --- /dev/null +++ b/software/archive/microcontroller/interfaces/mux.h @@ -0,0 +1,45 @@ +#ifndef CSOS_INTERFACES_MUX_H_ +#define CSOS_INTERFACES_MUX_H_ + +#include +#include + +#include +#include + +#define MUX_ADDR_MIN 0x70 // The lowest device address +#define MUX_ADDR_MAX 0x77 // The highest device address +#define MUX_BUS_MIN 0x00 // The lowest bus +#define MUX_BUS_MAX 0x07 // The highest bus +#define MUX_BUS_DEFAULT 0x00 // The default bus for "base" interfaces. +#define MUX_BUS_INACTIVE 0x07 // Bus to switch to when "inactive". This bus should be left vacant. + +extern TwoWire Wire; + +// Interface class for the TCA9548A I2C multiplexer IC +class MUX : private Interface { + private: + const uint8_t addr; + public: + /** + * Constructor + * @param addr MUX device address + * @param wire I2C bus + */ + MUX(uint8_t addr, TwoWire& wire = Wire); + + /** + * Set the MUX bus + * @param bus 0-7 + * @return Success? + */ + errorlevel_t setBus(uint8_t bus); + + /** + * Reset the MUX bus to inactive + * @return Success? + */ + errorlevel_t resetBus(void); +}; + +#endif \ No newline at end of file diff --git a/software/archive/microcontroller/interfaces/pwm.cc b/software/archive/microcontroller/interfaces/pwm.cc new file mode 100644 index 00000000..ce2e9ff1 --- /dev/null +++ b/software/archive/microcontroller/interfaces/pwm.cc @@ -0,0 +1,40 @@ +#include + +#include + +using namespace ControlSystemsOS; + +PWM::PWM(const i2cip_fqa_t& fqa, const i2cip_id_t& id) : Device(fqa, id), OutputInterface((Device*)this) { } + +i2cip_errorlevel_t PWM::set(const uint16_t& value, const args_pwm_t& args) { + // Encode LED on/off values + uint16_t on = 0, off = 0; + if (value == 0x0000) { + // OFF + off = 0x1000; + } else if (value > 0xFFF) { + // ON + on = 0x1000; + } else { + // Truncate + off = value & 0xFFF; + } + + // Write registers + i2cip_errorlevel_t errlev = this->writeRegister(PWM_CHANNEL_TO_LEDREG(args), (uint8_t)(on & 0xFF)); + I2CIP_ERR_BREAK(errlev); + errlev = this->writeRegister((uint8_t)(PWM_CHANNEL_TO_LEDREG(args) + 0x1), (uint8_t)(on >> 8)); + I2CIP_ERR_BREAK(errlev); + errlev = this->writeRegister((uint8_t)(PWM_CHANNEL_TO_LEDREG(args) + 0x2), (uint8_t)(off & 0xFF)); + I2CIP_ERR_BREAK(errlev); + errlev = this->writeRegister((uint8_t)(PWM_CHANNEL_TO_LEDREG(args) + 0x3), (uint8_t)(off >> 8)); + return errlev; +} + +const args_pwm_t& PWM::getDefaultB(void) const { + return default_b; +} + +void PWM::resetFailsafe(void) { + this->setValue(default_failsafe); +} \ No newline at end of file diff --git a/software/archive/microcontroller/interfaces/pwm.h b/software/archive/microcontroller/interfaces/pwm.h new file mode 100644 index 00000000..b0fdb684 --- /dev/null +++ b/software/archive/microcontroller/interfaces/pwm.h @@ -0,0 +1,84 @@ +#ifndef CSOS_INTERFACES_PWM_H_ +#define CSOS_INTERFACES_PWM_H_ + +#include +#include + +// MACROS +// Registers +#define PCA9685_MODE1 0x00 // Mode Register 1 +#define PCA9685_MODE2 0x01 // Mode Register 2 +#define PCA9685_SUBADR1 0x02 // I2C-bus subaddress 1 +#define PCA9685_SUBADR2 0x03 // I2C-bus subaddress 2 +#define PCA9685_SUBADR3 0x04 // I2C-bus subaddress 3 +#define PCA9685_ALLCALLADR 0x05 // LED All Call I2C-bus address +#define PCA9685_PRESCALE 0xFE // Prescaler for PWM output frequency +#define PCA9685_TESTMODE 0xFF // defines the test mode to be entered + +// Bits - Mode 1 Register +#define MODE1_ALLCAL 0x01 // respond to LED All Call I2C-bus address +#define MODE1_SUB3 0x02 // respond to I2C-bus subaddress 3 +#define MODE1_SUB2 0x04 // respond to I2C-bus subaddress 2 +#define MODE1_SUB1 0x08 // respond to I2C-bus subaddress 1 +#define MODE1_SLEEP 0x10 // Low power mode. Oscillator off +#define MODE1_AI 0x20 // Auto-Increment enabled +#define MODE1_EXTCLK 0x40 // Use EXTCLK pin clock +#define MODE1_RESTART 0x80 // Restart enabled + +// Bits - Mode 2 Register +#define MODE2_OUTNE_0 0x01 // Active LOW output enable input +#define MODE2_OUTNE_1 0x02 // Active LOW output enable input - high impedence +#define MODE2_OUTDRV 0x04 // totem pole structure vs open-drain +#define MODE2_OCH 0x08 // Outputs change on ACK vs STOP +#define MODE2_INVRT 0x10 // Output logic state inverted + +// Settings +#define PWM_ADDR 0x40 +#define PWM_FREQ 490 + +#define PWM_CHANNEL_TO_LEDREG(channel) (uint8_t)(0x06 + (4 * channel)) + +using namespace I2CIP; + +typedef enum { + PWM_CHANNEL_NULL = 0xFF, + PWM_CHANNEL_0 = 0x00, + PWM_CHANNEL_1, + PWM_CHANNEL_2, + PWM_CHANNEL_3, + PWM_CHANNEL_4, + PWM_CHANNEL_5, + PWM_CHANNEL_6, + PWM_CHANNEL_7, + PWM_CHANNEL_8, + PWM_CHANNEL_9, + PWM_CHANNEL_10, + PWM_CHANNEL_11, + PWM_CHANNEL_12, + PWM_CHANNEL_13, + PWM_CHANNEL_14, + PWM_CHANNEL_15, +} args_pwm_t; + +namespace ControlSystemsOS { + + // Interface class for the PCA9685 16-channel 12-bit PWM IC + class PWM : public Device, public OutputInterface { + friend Device* pwmFactory(const i2cip_fqa_t& fqa); + + // Note: unsigned 16-bit args are TRUNCATED to 12-bit PWM control + private: + const uint16_t default_failsafe = 0x0000; + const args_pwm_t default_b = PWM_CHANNEL_NULL; + + PWM(const i2cip_fqa_t& fqa, const i2cip_id_t& id); + + public: + i2cip_errorlevel_t set(const uint16_t& value, const args_pwm_t& args) override; + + const args_pwm_t& getDefaultB(void) const override; + void resetFailsafe(void) override; + }; +}; + +#endif \ No newline at end of file diff --git a/software/archive/microcontroller/main.cc b/software/archive/microcontroller/main.cc new file mode 100644 index 00000000..db7ee670 --- /dev/null +++ b/software/archive/microcontroller/main.cc @@ -0,0 +1,199 @@ +#ifndef UNIT_TEST +#ifndef MAIN +#define MAIN true + +#include + +#include + +#include +#include + +#include + +#define TIMESTAMP_LOG_DELTA_MS 5000 // Default + +#define FIXED_UPDATE_DELTA 1000 + +#include "simple.h" + +fsm_timestamp_t start = 0; +fsm_timestamp_t ms_last = 0; + +bool rebuild = false; + +void setup(void) { + // Serial + Serial.begin(115200); + while(!Serial); + + // Pin Modes + pinMode(PIN_LIGHTING_LO, OUTPUT); + pinMode(PIN_LIGHTING_HI, OUTPUT); + pinMode(PIN_WATERING, OUTPUT); + pinMode(PIN_DISCO_BUTTON, INPUT); + + lighting.addLoggerCallback(&logLights); + watering.addLoggerCallback(&logWatering); + + lighting.addLatchingConditional(true, false, &controlLights); + watering.addLatchingConditional(true, false, &controlWatering); + disco.addLatchingConditional(true, false, &controlDisco); + + // Timestamp output + Chronos.addInterval(TIMESTAMP_LOG_DELTA_MS, &logTimestamp); + + // Timer Flag Event - Lighting ON (No-Invert) + Chronos.addEventFlag(DELAY_START, &lighting); + + // Timer Flag Event - Lighting OFF (Inverted) + Chronos.addEventFlag(DELAY_START + DURATION_LIGHTING, &lighting, true); + + // Timer Flag Interval - Watering ON (No-Invert) + Chronos.addIntervalFlag(PERIOD_WATERING, &watering); + + // Timer Flag Interval - Watering OFF (Invert) + Chronos.addIntervalFlag(PERIOD_WATERING, DURATION_WATERING, &watering, true); + + // Disco Scroller Callback - passes interval timestamp + // discoScroller = + Chronos.addInterval(DELTA_DISCO, &scrollDisco); + + // Disco Controller - Dis-/En-ables Disco Scroller Callback + + start = millis(); + + // Serial.println(F("==== [ CYCLE -1 (SIZEOF) ] ====")); + // Serial.print(F("Module: ")); + // Serial.print(sizeof(ControlSystemsOS::CSOSModule)); + // Serial.print(F("\nHashTable: ")); + // Serial.print(sizeof(HashTable)); + // Serial.print(F("\nHashTableEntry: ")); + // Serial.print(sizeof(HashTableEntry)); + // Serial.print(F("\nBST: ")); + // Serial.print(sizeof(BST)); + // Serial.print(F("\nBSTNode: ")); + // Serial.print(sizeof(BSTNode)); + // Serial.print(F("\nDeviceGroup: ")); + // Serial.print(sizeof(DeviceGroup)); + // Serial.print(F("\nEEPROM: ")); + // Serial.print(sizeof(EEPROM)); + // Serial.println(); + Serial.println(F("==== [ CYCLE 0 (BUILD) ] ====")); + + delay(1000); + + i2cip_errorlevel_t errlev = ControlSystemsOS::update(true); + if(errlev > I2CIP_ERR_NONE) { + Serial.println(F("==== [ BUILD FAILED, FREEZING ] ====")); + while(true) { // Blink + digitalWrite(LED_BUILTIN, HIGH); + delay(100); + digitalWrite(LED_BUILTIN, LOW); + delay(100); + } + } + + #ifdef _AVR_WDT_H_ + wdt_enable(WDTO_4S); + #endif +} + +unsigned long cycle = 0; + +void loop(void) { + #ifdef _AVR_WDT_H_ + wdt_reset(); + #endif + + cycle++; + Serial.print(F("\n\n==== [ CYCLE ")); + Serial.print(cycle); + Serial.println(F(" ] ====")); + + fsm_timestamp_t ms_start = millis(); + // Watchdog Timer 24Hr Kickout + if(ms_start > TWENTYFOURHRS_MILLIS) { while(true) { delay(1); } } + + // 0. Module State-Change Forward-Propagation + // TODO: Move to `Module`? + + // 0a. Delete Devices Associated with Lost Modules + // if(ControlSystemsOS::stateChange) { + + // for(uint8_t i = 0; i < I2CIP_NUM_WIRES; i++) { + // for(uint8_t x = 0; x < I2CIP_MUX_COUNT; x++) { + + // // Check if module exists + // Module* m = ControlSystemsOS::csos_modules[i][x]; + // if(m == nullptr) { + // for(uint8_t j = 0; j < NUM_DEVICE_TYPES; j++) { + // const char* key = ControlSystemsOS::csos_map_device_id[j]; + // I2CIP::DeviceGroup * group = (*m)[key]; + // if(group == nullptr) continue; + + // for(uint8_t k = 0; k < group->numdevices; k++) { + // Device* device = group->devices[k]; + // if(device != nullptr) { + // // Delete Device + // m->remove(device); + // } + // } + // } + // } + + + // } + // } + + // ControlSystemsOS::stateChange = false; + // } + + // 1. Refresh Update - Network Status Handling & Rebuild + + // 1a. Module "Roll-Call" Check + i2cip_errorlevel_t errlev = ControlSystemsOS::update(rebuild); + // If we lose hardware, return and do FixedUpdate ASAP + rebuild = (errlev == I2CIP_ERR_HARD); + if(errlev > I2CIP_ERR_NONE) return; + + // 1b. Device Checking Per-Group + fsm_timestamp_t ms_now = millis(); + if((ms_now - ms_last) > FIXED_UPDATE_DELTA) { + errlev = ControlSystemsOS::fixedUpdate(ms_now); + ms_last = millis(); + } + + // 2. Fixed Update - Instruction and Control Handling + + Chronos.set(ms_start); + + // Other Stuff + + int discoPin = digitalRead(PIN_DISCO_BUTTON); + disco.set(discoPin == HIGH ? true : false); + + delay(100); + +} + +// Overview: +// +// 1. Module State-Change Forward-Propagation +// 2. Refresh Update - Network Status Handling & Rebuild +// 3. Fixed Update - Instruction and Control Handling +// +// 1. Module State-Change Forward-Propagation +// +// 1a. Delete Devices Associated with Lost Modules +// 1b. Delete Modules +// +// 2. Refresh Update - Network Status Handling & Rebuild +// +// 2a. Module "Roll-Call" Check +// 2b. Device Checking Per-Group +// +// 3. Fixed Update - Instruction and Control Handling + +#endif +#endif \ No newline at end of file diff --git a/software/archive/microcontroller/main.h b/software/archive/microcontroller/main.h new file mode 100644 index 00000000..f40441be --- /dev/null +++ b/software/archive/microcontroller/main.h @@ -0,0 +1,77 @@ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Settings +#define ENABLE_WATCHDOG false + +// Constants +#define NUM_SENSORS 4 +#define NUM_ACTUATORS 7 +#define REVISION 0 +#define BAUDRATE 115200 +#if ENABLE_WATCHDOG + #include + #define WDTO WDTO_1S +#endif + +// Pins +#define PIN_STATUS 13 +#define PIN_LEDBLUE 3 +#define PIN_LEDCOOL 5 +#define PIN_LEDWARM 6 +#define PIN_LEDRED 9 +#define PIN_LEDFAR 10 +#define PIN_SUPPLY 8 +#define PIN_SOLENOID 7 +#define PIN_YF_B1 2 +#define PIN_SEN0257 A0 + +// Sensors +SHT31 sht31 = SHT31(); +K30 k30 = K30(); +YF_B1 yf_b1 = YF_B1(PIN_YF_B1); +SEN0257 sen0257 = SEN0257(PIN_SEN0257); + +Sensor* sensors[NUM_SENSORS] = { + &sht31, + &k30, + &yf_b1, + &sen0257, +}; + +// Actuators +LED led_blue = LED(PIN_LEDBLUE, LED::LED_CREE_XPG3_BLUE); +LED led_cool = LED(PIN_LEDCOOL, LED::LED_CREE_XPG3_COOLWHITE); +LED led_warm = LED(PIN_LEDWARM, LED::LED_CREE_XPG3_WARMWHITE); +LED led_red = LED(PIN_LEDRED, LED::LED_CREE_XPG3_RED); +LED led_far = LED(PIN_LEDFAR, LED::LED_CREE_XPE2_FARRED); +SupplyPump supply = SupplyPump(PIN_SUPPLY); +Solenoid solenoid = Solenoid(PIN_SOLENOID); + +Actuator* actuators [NUM_ACTUATORS] = { + &led_blue, + &led_cool, + &led_warm, + &led_red, + &led_far, + &supply, + &solenoid, +}; + +const char* instr [NUM_ACTUATORS] = { "led_blue", "led_cool", "led_warm", "led_red", "led_far", "supply", "solenoid" }; + +static const InstructionActuatorMatrix matrix = { + NUM_ACTUATORS, + actuators, + instr +}; \ No newline at end of file diff --git a/software/archive/microcontroller/modules/module.cc b/software/archive/microcontroller/modules/module.cc new file mode 100644 index 00000000..01306258 --- /dev/null +++ b/software/archive/microcontroller/modules/module.cc @@ -0,0 +1,43 @@ +// HEADERS + +#include + +#include + +#include +#include +#include + +// CONSTRUCTOR + +Module::Module(const char* const* id, uint8_t numsensors, Sensor* sensors, uint8_t numactuators, Actuator* actuators) : _id(id) { + state.numsensors = numsensors; + state.sensors = sensors; + state.numactuators = numactuators; + state.actuators = actuators; +} + +ModuleState* Module::getState(void) { + return &state; +} + +String Module::toString(void) { + String s = String((const char*)(_id)) + " ("; + for (int i = 0; i < state.numsensors; i++) { + s += state.sensors[i].getID(); + if (i < state.numsensors - 1 || state.numactuators > 0) { + s += ", "; + } + } + for (int i = 0; i < state.numactuators; i++) { + s += state.actuators[i].getID(); + if (i < state.numactuators - 1) { + s += ", "; + } + } + return s + ")"; +} + +String Module::getID(void) { + return String((const char*)_id); +} \ No newline at end of file diff --git a/software/archive/microcontroller/modules/module.h b/software/archive/microcontroller/modules/module.h new file mode 100644 index 00000000..ea5ee206 --- /dev/null +++ b/software/archive/microcontroller/modules/module.h @@ -0,0 +1,48 @@ +#ifndef PEAPOD_MODULES_MODULE_H_ +#define PEAPOD_MODULES_MODULE_H_ + +// HEADERS + +#include + +#include +#include +#include + +// DECLARATIONS + +// All module state info +typedef struct ModuleState { + // Error level + errorlevel_t error; + + // Other state information + debuglevel_t debug; + + uint8_t numsensors; + Sensor* sensors; + + uint8_t numactuators; + Actuator* actuators; +} ModuleState; + +// CLASS +// A "Module" is a single control system group, a collection of sensors and actuators +class Module { + public: + Module(const char* const* id, uint8_t numsensors, Sensor* sensors, uint8_t numactuators, Actuator* actuators); + + // @return Pointer to sensor state + ModuleState* getState(void); + + // @return String representation + String toString(void); + + String getID(void); + private: + ModuleState state; + const char* const* _id; +}; + + +#endif \ No newline at end of file diff --git a/software/archive/microcontroller/peapod.cc b/software/archive/microcontroller/peapod.cc new file mode 100644 index 00000000..2ec5abaa --- /dev/null +++ b/software/archive/microcontroller/peapod.cc @@ -0,0 +1,166 @@ +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +PeaPod::PeaPod(TwoWire* wire) : wire(wire) { + +} + +void PeaPod::scan(void) { + // Module Ping + uint8_t nmodules = 0; + bool moduleFound [MODULE_COUNT] = { false }; + for (uint8_t i = 0; i < MODULE_COUNT; i++) { + if (modules[i] != nullptr) { + moduleFound[i] = true; + } + + // Acknowledge? + uint8_t addr = MODULE_ADDR_MIN + i; + Wire.beginTransmission(addr); + uint8_t error = Wire.endTransmission(); + if (error == 0) { + // Module found! Mark 'true' + // sendMessage(MESSAGE_DEBUG, "Module found at 0x" + String(addr < 16 ? "0" : "") + String(addr, HEX)); + moduleFound[i] = true; + nmodules++; + } else if (error == 4) { + // Wierd error; retry + // sendMessage(MESSAGE_ERROR, "Error at 0x" + String(addr < 16 ? "0" : "") + String(addr, HEX)); + i--; + continue; + } else if (moduleFound[i] == true) { + // Module not found; previously found module has been lost; deallocate + delete(modules[i]); + modules[i] = nullptr; + } + } + + // Read moduleinfo EEPROM + StaticJsonDocument json; + for (uint8_t i = 0; i < MODULE_COUNT; i++) { + if (!moduleFound[i]) break; + uint8_t modaddr = MODULE_ADDR_MIN + i; + + // PING EEPROM + EEPROM eeprom(modaddr); + // Attempt; uncache if failed + if (eeprom.begin() != ERR_NONE) { + // sendMessage(MESSAGE_ERROR, "Error pinging EEPROM at Module 0x" + String(modaddr < 16 ? "0" : "") + String(modaddr, HEX)); + moduleFound[i] = false; + nmodules--; + continue; + } + + // READ EEPROM + char buffer[EEPROM_SIZE] = { '\0' }; + size_t len = 0; + eeprom.read(buffer, &len); + + // SWITCH MUX TO INACTIVE BUS + Wire.beginTransmission(modaddr); + Wire.write(1 << MODULE_BUS_INACTIVE); + Wire.endTransmission(); + + // EEPROM dump + // sendMessage(MESSAGE_DEBUG, "Read from EEPROM: " + String(buffer)); + + // Attempt to parse JSON + DeserializationError error = deserializeJson(json, buffer); + if (error) { + // sendMessage(MESSAGE_ERROR, "Error parsing EEPROM to JSON at Module 0x" + String(modaddr < 16 ? "0" : "") + String(modaddr, HEX)); + moduleFound[i] = false; + nmodules--; + continue; + } + + // Initialize Module + modules[i] = new Module(json["id"], json["numsensors"], json["numactuators"]); + + // Set up interfaces + // GPIO, ADC, etc. + + // ALLOCATE SENSORS, ACTUATORS TO HEAP + for (uint8_t i = 0; i < MODULE_COUNT; i++) { + ModuleState* state = modules[i]->getState(); + uint8_t j = 0; + for (JsonPair sensor : json["sensors"].as()) { + + // Check interface hashtable + Factory* sf = sensorFactories[(const char*)(sensor.key().c_str())]; + + if (sf == nullptr) { + // ERROR: Unrecognized sensor. Flash module EEPROM. + break; + } + + Sensor* s = sf->operator()(&(sensor.value().to())); + + if (s == nullptr) { + // ERROR: constructor arguments invalid + break; + } + + state->sensors[j] = s; + j++; + } + state->numsensors = j; + j = 0; + for (JsonPair actuator : json["actuators"].as()) { + // Check interface hashtable + Factory* af = actuatorFactories[(const char*)(actuator.key().c_str())]; + + if (af == nullptr) { + // ERROR: Unrecognized sensor. Flash module EEPROM. + break; + } + + Actuator* a = af->operator()(&(actuator.value().to())); + + if (a == nullptr) { + // ERROR: constructor arguments invalid + break; + } + + state->actuators[j] = a; + j++; + } + state->numactuators = j; + } + } +} + +errorlevel_t PeaPod::post(void) { + errorlevel_t success = ERR_NONE; + for (int i = 0; i < NUM_SENSORS; ++i) { + SensorState* state = sensors[i]->begin(); + errorlevel_t latest = (state->error == ERR_HARD ? ERR_HARD : (state->debug == ISTATE_OFF || state->error == ERR_SOFT ? ERR_SOFT : ERR_NONE)); + if (latest) { + // sendMessage(MESSAGE_DEBUG, String("Sensor " + sensors[i]->toString() + " initialized successfully.")); + } else { + // sendMessage(MESSAGE_ERROR, String("Failed to initialize sensor " + sensors[i]->toString() + ". Check wiring.")); + } + success &= latest; + } + for (int i = 0; i < NUM_ACTUATORS; ++i) { + ActuatorState* state = actuators[i]->begin(); + errorlevel_t latest = (state->debug >= ISTATE_ON && state->error == ERR_NONE); + if (latest) { + // sendMessage(MESSAGE_DEBUG, String("Actuator " + actuators[i]->toString() + " initialized successfully.")); + } else { + // sendMessage(MESSAGE_DEBUG, String("Failed to initialize actuator " + actuators[i]->toString() + ". Check wiring.")); + } + success &= latest; + } + return success; +} \ No newline at end of file diff --git a/software/archive/microcontroller/peapod.h b/software/archive/microcontroller/peapod.h new file mode 100644 index 00000000..afefe816 --- /dev/null +++ b/software/archive/microcontroller/peapod.h @@ -0,0 +1,37 @@ +#ifndef CSOS_CSOS_H_ +#define CSOS_CSOS_H_ + +// HEADERS + +#include +#include + +#include +#include +#include +#include + +#include + +extern TwoWire wire; + +// CLASS +// An Interface is a single I2C device, wrapping an Adafruit_I2CDevice. +class PeaPod { + private: + const TwoWire* wire; + + HashTable interfaces = HashTable(100); + + Module* modules[MODULE_COUNT] = { nullptr }; + public: + /** + * Constructor. + */ + PeaPod(TwoWire* wire = &Wire); + + errorlevel_t post(void); + void scan(void); +}; + +#endif \ No newline at end of file diff --git a/software/archive/microcontroller/sensors/ge_2158.cc b/software/archive/microcontroller/sensors/ge_2158.cc new file mode 100644 index 00000000..2b660b4c --- /dev/null +++ b/software/archive/microcontroller/sensors/ge_2158.cc @@ -0,0 +1,35 @@ +// HEADERS + +#include + +#include + +#include + +#include +#include + +// CONSTRUCTOR + +GE_2158::GE_2158(const uint8_t pin) : Sensor(&id, &datasetup, GE_2158_DELTA), pin(pin) { } + +// PUBLIC METHODS + +errorlevel_t GE_2158::initialize(void) { + pinMode(pin, INPUT); + return ERR_NONE; +} + +errorlevel_t GE_2158::read(float* data, uint8_t numdata) { + uint16_t read = analogRead(pin); + float v = read * GE_2158_V / 1023; + float temp = (log((v * GE_2158_R) / (GE_2158_V - v) - GE_2158_C) - GE_2158_B) / GE_2158_A; + + if (temp < 0 || temp > 100) { + return ERR_WARNING; + } + + data[0] = temp; + + return ERR_NONE; +} diff --git a/software/archive/microcontroller/sensors/ge_2158.h b/software/archive/microcontroller/sensors/ge_2158.h new file mode 100644 index 00000000..0d32f2bd --- /dev/null +++ b/software/archive/microcontroller/sensors/ge_2158.h @@ -0,0 +1,58 @@ +#ifndef PEAPOD_SENSORS_GE_2158_H_ +#define PEAPOD_SENSORS_GE_2158_H_ + +// HEADERS + +#include + +#include +#include + +// MACROS + +// Settings +#define GE_2158_DELTA 100 +#define GE_2158_V 5.0 // Feed voltage +#define GE_2158_R 3000 // Series resistor + +// Equation: T(v) = (ln((v * GE_2158_R) / (GE_2158_V - v) - GE_2158_C) - GE_2158_B) / GE_2158_A +// Fit to data tables found in manufacturer datasheet +#define GE_2158_A -0.055481 // A parameter +#define GE_2158_B 9.30108 // B parameter +#define GE_2158_C 122.933 // C parameter + +// GLOBALS +// Used when you need a pointer to static PROGMEM - these variables are ONLY INITIALIZED in the .cc SOURCE file that INCLUDES this header file +#ifndef GLOBALS // Double-declaration blocker + #define GLOBALS + // Descriptors + static const PROGMEM char* const id = "GE-2158"; + + // Data setup + static const PROGMEM char* const labels[1] = { "water_temperature" }; + static const PROGMEM SensorDataSetup datasetup = { + .numdata = 1, + .labels = labels + }; +#endif + +// CLASS + +// Interface for the Amphenol GE-2158 water temperature sensor. +class GE_2158 : public Sensor { + public: + /** + * Constructor. + * @param pin Analog input pin. + */ + GE_2158(const uint8_t pin); + private: + errorlevel_t initialize(void) override; + + errorlevel_t read(float* data, uint8_t numdata) override; + + // Analog input pin. + const uint8_t pin; +}; + +#endif diff --git a/software/archive/microcontroller/sensors/k30.cc b/software/archive/microcontroller/sensors/k30.cc new file mode 100644 index 00000000..8e15c2cc --- /dev/null +++ b/software/archive/microcontroller/sensors/k30.cc @@ -0,0 +1,53 @@ +// HEADERS + +#include + +#include +#include + +#include +#include + +// CONSTRUCTOR + +K30::K30(TwoWire* wire, uint8_t address) : Sensor(&id, &datasetup, K30_DELTA), address(address), wire(wire) { } + +// PUBLIC METHODS + +errorlevel_t K30::initialize(void) { + wire->begin(); + return ERR_NONE; +} + +errorlevel_t K30::read(float* data, uint8_t numdata) { + byte recValue[4] = {0,0,0,0}; + + // Instruct to take a reading + wire->beginTransmission(address); + wire->write(0x22); + wire->write(0x00); + wire->write(0x08); + wire->write(0x2A); + wire->endTransmission(); + delay(30); + + // Request reading + wire->requestFrom(address, (uint8_t)4); + delay(20); + + // Store reading + for(int i = 0; wire->available() && i < 4; ++i) { + recValue[i] = wire->read(); + } + + // Checksum and return + byte checkSum = recValue[0] + recValue[1] + recValue[2]; + + if (checkSum != recValue[3]) { + return ERR_WARNING; + } + + data[0] = (float)((recValue[1] << 8) + recValue[2]); + + return ERR_NONE; +} diff --git a/software/archive/microcontroller/sensors/k30.h b/software/archive/microcontroller/sensors/k30.h new file mode 100644 index 00000000..d11512be --- /dev/null +++ b/software/archive/microcontroller/sensors/k30.h @@ -0,0 +1,59 @@ +#ifndef PEAPOD_SENSORS_K30_H_ +#define PEAPOD_SENSORS_K30_H_ + +// HEADERS + +#include +#include + +#include +#include + +// MACROS + +// Settings +#define K30_DEFAULT_ADDR 0x68 +#define K30_DELTA 2000 + +// GLOBALS +// Used when you need a pointer to static PROGMEM - these variables are ONLY INITIALIZED in the .cc SOURCE file that INCLUDES this header file +#ifndef GLOBALS // Double-declaration blocker + #define GLOBALS + // Descriptors + static const PROGMEM char* const id = "K30"; + + // Data setup + static const PROGMEM char* const labels[1] = { "co2_ppm" }; + static const PROGMEM SensorDataSetup datasetup = { + .numdata = 1, + .labels = labels + }; +#endif + +// Import the default I2C interface provided by Arduino. +extern TwoWire Wire; + +// CLASS + +// Interface for the SenseAir K30 Extended Range CO2 sensor. +class K30 : public Sensor { + public: + /** + * Constructor. + * @param wire I2C interface. Defaults to the provided `Wire` interface (by reference). + * @param address Address of the K30 on the I2C bus. Defaults to 0x68 (hardware default). + */ + K30(TwoWire* wire = &Wire, const uint8_t address = K30_DEFAULT_ADDR); + private: + errorlevel_t initialize(void) override; + + errorlevel_t read(float* data, uint8_t numdata) override; + + // Address of the K30 on the I2C bus. + const uint8_t address; + + // I2C interface. + TwoWire* wire; +}; + +#endif diff --git a/software/archive/microcontroller/sensors/sen0257.cc b/software/archive/microcontroller/sensors/sen0257.cc new file mode 100644 index 00000000..fb9a5f21 --- /dev/null +++ b/software/archive/microcontroller/sensors/sen0257.cc @@ -0,0 +1,34 @@ +// HEADERS + +#include + +#include + +#include +#include + +// CONSTRUCTOR + +SEN0257::SEN0257(const uint8_t pin) : Sensor(&id, &datasetup, SEN0257_DELTA), pin(pin) { } + +// PUBLIC METHODS + +errorlevel_t SEN0257::initialize(void) { + pinMode(pin, INPUT); + return ERR_NONE; +} + +errorlevel_t SEN0257::read(float* data, uint8_t numdata) { + uint16_t read = analogRead(pin); + float v = read * 5.0 / 1023; + + float pres = (float)((v - SEN0257_VMIN) * (SEN0257_PMAX - SEN0257_PMIN) / (SEN0257_VMAX - SEN0257_VMIN) + SEN0257_PMIN); + + if (pres < SEN0257_PMIN || pres > SEN0257_PMAX) { + return ERR_WARNING; + } + + data[0] = pres; + + return ERR_NONE; +} diff --git a/software/archive/microcontroller/sensors/sen0257.h b/software/archive/microcontroller/sensors/sen0257.h new file mode 100644 index 00000000..c8162f9a --- /dev/null +++ b/software/archive/microcontroller/sensors/sen0257.h @@ -0,0 +1,54 @@ +#ifndef PEAPOD_SENSORS_SEN0257_H_ +#define PEAPOD_SENSORS_SEN0257_H_ + +// HEADERS + +#include + +#include +#include + +// MACROS + +// Settings +#define SEN0257_DELTA 100 +#define SEN0257_VMIN 0.5 // Min output voltage +#define SEN0257_VMAX 4.5 // Max output voltage +#define SEN0257_PMIN 0.0 // Min output pressure (PSI) +#define SEN0257_PMAX 261.1 // Max output pressure (PSI) + +// GLOBALS +// Used when you need a pointer to static PROGMEM - these variables are ONLY INITIALIZED in the .cc SOURCE file that INCLUDES this header file +#ifndef GLOBALS // Double-declaration blocker + #define GLOBALS + // Descriptors + static const PROGMEM char* const id = "SEN0257"; + + // Data setup + static const PROGMEM char* const labels[1] = { "water_pressure" }; + static const PROGMEM SensorDataSetup datasetup = { + .numdata = 1, + .labels = labels + }; +#endif + +// CLASS + +// Interface for the DFRobot SEN0257 water pressure sensor. +class SEN0257 : public Sensor { + public: + /** + * Constructor. + * @param pin Analog input pin. + */ + SEN0257(const uint8_t pin); + private: + errorlevel_t initialize(void) override; + + errorlevel_t read(float* data, uint8_t numdata) override; + + // Analog input pin. + const uint8_t pin; +}; + +#endif diff --git a/software/archive/microcontroller/sensors/sensor.cc b/software/archive/microcontroller/sensors/sensor.cc new file mode 100644 index 00000000..ec5ee40e --- /dev/null +++ b/software/archive/microcontroller/sensors/sensor.cc @@ -0,0 +1,205 @@ +#include +#include + +// CSOS_BOOL: bool, Number != 0 +template <> bool ControlSystemsOS::Datum::applyState(State* state) { + if(state == nullptr) return false; + + double d = 0.0; + switch(this->type) { + case CSOS_BOOL: + state->set(this->value.b); + return true; + case CSOS_UINT8: + d = (double)(this->value.u8); + break; + case CSOS_INT8: + d = (double)(this->value.i8); + break; + case CSOS_UINT16: + d = (double)(this->value.u16); + break; + case CSOS_INT16: + d = (double)(this->value.i16); + break; + case CSOS_UINT32: + d = (double)(this->value.u32); + break; + case CSOS_INT32: + d = (double)(this->value.i32); + break; + case CSOS_FLOAT: + d = (double)(this->value.f); + break; + case CSOS_DOUBLE: + d = this->value.d; + break; + default: + return false; + } + + state->set(d > -NUMBER_FLOP_EPSILON && d < NUMBER_FLOP_EPSILON); + + return true; +} + +// CSOS_(U)INT8 through 32, FLOAT, DOUBLE +template <> bool ControlSystemsOS::Datum::applyState(State* state) { + if(state == nullptr) return false; + + double d = NAN; + switch(this->type) { + case CSOS_BOOL: + d = this->value.b ? 1.0f : 0.0f; + break; + case CSOS_UINT8: + d = (double)(this->value.u8); + break; + case CSOS_INT8: + d = (double)(this->value.i8); + break; + case CSOS_UINT16: + d = (double)(this->value.u16); + break; + case CSOS_INT16: + d = (double)(this->value.i16); + break; + case CSOS_UINT32: + d = (double)(this->value.u32); + break; + case CSOS_INT32: + d = (double)(this->value.i32); + break; + case CSOS_FLOAT: + d = (double)(this->value.f); + break; + case CSOS_DOUBLE: + d = this->value.d; + break; + default: + return false; + } + + state->set(d); + + return true; +} + +char* ControlSystemsOS::Datum::toString() { + char* buffer = (char*)malloc(8 * sizeof(char)); + if(buffer == nullptr) return buffer; + for(uint8_t i = 0; i < 8; i++) buffer[i] = '\0'; + + switch(this->type) { + case CSOS_BOOL: + snprintf(buffer, 8, "%s", (this->value.b) ? "true" : "false"); + break; + case CSOS_UINT8: + snprintf(buffer, 8, "%u", this->value.u8); + break; + case CSOS_INT8: + snprintf(buffer, 8, "%d", this->value.i8); + break; + case CSOS_UINT16: + snprintf(buffer, 8, "%u", this->value.u16); + break; + case CSOS_INT16: + snprintf(buffer, 8, "%d", this->value.i16); + break; + case CSOS_UINT32: + snprintf(buffer, 8, "%lu", this->value.u32); + break; + case CSOS_INT32: + snprintf(buffer, 8, "%ld", this->value.i32); + break; + case CSOS_FLOAT: + snprintf(buffer, 8, "%.2f", (double)this->value.f); + break; + case CSOS_DOUBLE: + snprintf(buffer, 8, "%f", this->value.d); + break; + case CSOS_SCHAR: + snprintf(buffer, 8, "%c", this->value.c); + break; + default: + snprintf(buffer, 8, "null"); + break; + } + return buffer; +} + +void ControlSystemsOS::Datum::addToJSON(JsonObject& json) { + switch(this->type) { + case CSOS_BOOL: + json[this->label] = this->value.b; + break; + case CSOS_UINT8: + json[this->label] = this->value.u8; + break; + case CSOS_INT8: + json[this->label] = this->value.i8; + break; + case CSOS_UINT16: + json[this->label] = this->value.u16; + break; + case CSOS_INT16: + json[this->label] = this->value.i16; + break; + case CSOS_UINT32: + json[this->label] = this->value.u32; + break; + case CSOS_INT32: + json[this->label] = this->value.i32; + break; + case CSOS_FLOAT: + json[this->label] = this->value.f; + break; + case CSOS_DOUBLE: + json[this->label] = this->value.d; + break; + // case CSOS_SCHAR: + // json[this->label] = this->value.c; + // break; + default: + json[this->label] = nullptr; + break; + } +} + +void ControlSystemsOS::Datum::print(Print& p) { + switch(this->type) { + case CSOS_BOOL: + p.print((this->value.b) ? "true" : "false"); + break; + case CSOS_UINT8: + p.print(this->value.u8); + break; + case CSOS_INT8: + p.print(this->value.i8); + break; + case CSOS_UINT16: + p.print(this->value.u16); + break; + case CSOS_INT16: + p.print(this->value.i16); + break; + case CSOS_UINT32: + p.print(this->value.u32); + break; + case CSOS_INT32: + p.print(this->value.i32); + break; + case CSOS_FLOAT: + p.print(this->value.f); + break; + case CSOS_DOUBLE: + p.print(this->value.d); + break; + case CSOS_SCHAR: + p.print(this->value.c); + break; + default: + p.print("null"); + break; + } +} \ No newline at end of file diff --git a/software/archive/microcontroller/sensors/sensor.h b/software/archive/microcontroller/sensors/sensor.h new file mode 100644 index 00000000..98890da0 --- /dev/null +++ b/software/archive/microcontroller/sensors/sensor.h @@ -0,0 +1,83 @@ +#ifndef CSOS_SENSORS_SENSOR_H_ +#define CSOS_SENSORS_SENSOR_H_ + +#include +#include + +#include + +#include +#include + +namespace ControlSystemsOS { + class Datum { + private: + const char* label; + csos_data_t value; + csos_pdata_t ptr; + csos_types_t type; + + public: + ~Datum() { delete next; } + // Datum(const csos_types_t& type, const csos_pdata_t& value) : type(type), next(nullptr) { + // switch(type) { + // case CSOS_BOOL: + // this->value.b = *value.b; + // break; + // case CSOS_UINT8: + // this->value.u8 = *value.u8; + // break; + // case CSOS_INT8: + // this->value.i8 = *value.i8; + // break; + // case CSOS_UINT16: + // this->value.u16 = *value.u16; + // break; + // case CSOS_INT16: + // this->value.i16 = *value.i16; + // break; + // case CSOS_UINT32: + // this->value.u32 = *value.u32; + // break; + // case CSOS_INT32: + // this->value.i32 = *value.i32; + // break; + // case CSOS_FLOAT: + // this->value.f = *value.f; + // break; + // case CSOS_DOUBLE: + // this->value.d = *value.d; + // break; + // case CSOS_SCHAR: + // this->value.c = *value.c; + // break; + // default: + // this->value.null = nullptr; + // break; + // } + // } + + Datum* const next; + + Datum(const csos_types_t& type, csos_data_t value, const char* label, Datum* next = nullptr) : type(type), value(value), label(label), next(next) {} + + template bool applyState(State* state); + + const char* getLabel(void) { return this->label; } + + char* toString(void); + + void addToJSON(JsonObject& json); + + void print(Print& p); + }; + + class Sensor { + public: + Sensor(InputGetter* getter) { getter->setSensor(this); } + virtual Datum* datumFactory(void) = 0; + }; + +}; + +#endif \ No newline at end of file diff --git a/software/archive/microcontroller/sensors/sht31.cc b/software/archive/microcontroller/sensors/sht31.cc new file mode 100644 index 00000000..7b69c269 --- /dev/null +++ b/software/archive/microcontroller/sensors/sht31.cc @@ -0,0 +1,94 @@ +#include + +static uint8_t crc8(const uint8_t *data, int len) { + /* + * + * CRC-8 formula from page 14 of SHT spec pdf + * + * Test data 0xBE, 0xEF should yield 0x92 + * + * Initialization data 0xFF + * Polynomial 0x31 (x8 + x5 +x4 +1) + * Final XOR 0x00 + */ + + const uint8_t POLYNOMIAL(0x31); + uint8_t crc(0xFF); + + for (int j = len; j; --j) { + crc ^= *data++; + + for (int i = 8; i; --i) { + crc = (crc & 0x80) ? (crc << 1) ^ POLYNOMIAL : (crc << 1); + } + } + return crc; +} + +using namespace ControlSystemsOS; + +SHT31::SHT31(const i2cip_fqa_t& fqa, const i2cip_id_t& id) : Device(fqa, id), InputInterface((Device*)this), Sensor((InputGetter*)this) { } + +i2cip_errorlevel_t SHT31::get(state_sht31_t& value, const args_sht31_t& args) { + size_t buflen = 6; + uint8_t buffer[buflen]; + + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(F("!!! SHT31 GET !!!")); + DEBUG_DELAY(); + #endif + + // Read registers + i2cip_errorlevel_t errlev = this->readRegister(SHT31_MEAS_HIGHREP_STRETCH, buffer, buflen, false); + I2CIP_ERR_BREAK(errlev); + + if (buflen != sizeof(buffer)) { + return I2CIP_ERR_SOFT; + } + + // Checksum + if (buffer[2] != crc8(buffer, 2) || buffer[5] != crc8(buffer + 3, 2)) { + return I2CIP_ERR_SOFT; + } + + // Temperature conversion + int32_t stemp = (int32_t)(((uint32_t)buffer[0] << 8) | buffer[1]); + stemp = ((4375 * stemp) >> 14) - 4500; + value.temperature = (float)stemp / 100.0f; + + // Humidity conversion + uint32_t shum = ((uint32_t)buffer[3] << 8) | buffer[4]; + shum = (625 * shum) >> 12; + value.humidity = (float)shum / 100.0f; + + #ifdef CSOS_DEBUG_SERIAL + DEBUG_DELAY(); + CSOS_DEBUG_SERIAL.print(F("!!! ")); + CSOS_DEBUG_SERIAL.print(value.temperature); + CSOS_DEBUG_SERIAL.print(F("C, ")); + CSOS_DEBUG_SERIAL.print(value.humidity); + CSOS_DEBUG_SERIAL.print(F("% !!!")); + DEBUG_DELAY(); + #endif + + return I2CIP_ERR_NONE; +} + +const args_sht31_t& SHT31::getDefaultA(void) const { + return this->default_a; +} + +void SHT31::clearCache(void) { + this->setCache(this->default_cache); +} + +Datum* SHT31::datumFactory(void) { + csos_data_t hum = {.f = this->getCache().humidity}; + Datum* humidity = new Datum(CSOS_FLOAT, hum, "air_humidity"); + + csos_data_t temp = {.f = this->getCache().temperature}; + Datum* temperature = new Datum(CSOS_FLOAT, temp, "air_temperature", humidity); + + return temperature; +} \ No newline at end of file diff --git a/software/archive/microcontroller/sensors/sht31.h b/software/archive/microcontroller/sensors/sht31.h new file mode 100644 index 00000000..50079cea --- /dev/null +++ b/software/archive/microcontroller/sensors/sht31.h @@ -0,0 +1,63 @@ +#ifndef CSOS_INTERFACES_SHT31_H_ +#define CSOS_INTERFACES_SHT31_H_ + +#include +#include + +#include + +// MACROS + +// Registers +#define SHT31_MEAS_HIGHREP_STRETCH (uint16_t)0x2C06 // Measurement High Repeatability with Clock Stretch Enabled +#define SHT31_MEAS_MEDREP_STRETCH (uint16_t)0x2C0D // Measurement Medium Repeatability with Clock Stretch Enabled +#define SHT31_MEAS_LOWREP_STRETCH (uint16_t)0x2C10 // Measurement Low Repeatability with Clock Stretch Enabled +#define SHT31_MEAS_HIGHREP (uint16_t)0x2400 // Measurement High Repeatability with Clock Stretch Disabled +#define SHT31_MEAS_MEDREP (uint16_t)0x240B // Measurement Medium Repeatability with Clock Stretch Disabled +#define SHT31_MEAS_LOWREP (uint16_t)0x2416 // Measurement Low Repeatability with Clock Stretch Disabled +#define SHT31_READSTATUS (uint16_t)0xF32D // Read Out of Status Register +#define SHT31_CLEARSTATUS (uint16_t)0x3041 // Clear Status +#define SHT31_SOFTRESET (uint16_t)0x30A2 // Soft Reset +#define SHT31_HEATEREN (uint16_t)0x306D // Heater Enable +#define SHT31_HEATERDIS (uint16_t)0x3066 // Heater Disable +#define SHT31_REG_HEATER_BIT (uint16_t)0x000d // Status Register Heater Bit + +// Settings +#define SHT31_ADDR 0x44 // SHT31 Default Address + +using namespace I2CIP; + +typedef enum { + SHT31_HEATER_DISABLE = 0x00, + SHT31_HEATER_ENABLE = 0x01, +} args_sht31_t; + +typedef struct { + float temperature; + float humidity; +} state_sht31_t; + +namespace ControlSystemsOS { + + // Interface class for the SHT31 air temperature and humidity sensor + class SHT31 : public Device, public InputInterface, public Sensor { + friend Device* ControlSystemsOS::sht31Factory(const i2cip_fqa_t& fqa); + + // Note: unsigned 16-bit args are TRUNCATED to 12-bit PWM control + private: + const state_sht31_t default_cache = { NAN, NAN }; + const args_sht31_t default_a = SHT31_HEATER_DISABLE; + + SHT31(const i2cip_fqa_t& fqa, const i2cip_id_t& id); + + public: + i2cip_errorlevel_t get(state_sht31_t& value, const args_sht31_t& args) override; + + const args_sht31_t& getDefaultA(void) const override; + void clearCache(void) override; + + Datum* datumFactory(void) override; + }; +}; + +#endif \ No newline at end of file diff --git a/software/archive/microcontroller/sensors/yf_b1.cc b/software/archive/microcontroller/sensors/yf_b1.cc new file mode 100644 index 00000000..b2c44010 --- /dev/null +++ b/software/archive/microcontroller/sensors/yf_b1.cc @@ -0,0 +1,38 @@ +// HEADERS + +#include + +#include + +#include +#include + +// CONSTRUCTOR + +YF_B1::YF_B1(const uint8_t pin) : Sensor(&id, &datasetup, YF_B1_DELTA), InterruptHandler(&(this->pin)), pin(pin) { } + +// PUBLIC METHODS + +errorlevel_t YF_B1::initialize(void) { + pinMode(pin, INPUT); + // Attach rising-edge interrupt to our digital pin, triggers flow() + attachInstanceInterrupt(RISING); + return ERR_NONE; +} + +errorlevel_t YF_B1::read(float* data, uint8_t numdata) { + // Get seconds between last read and now + float diff = (millis() - this->getState()->timestamp)/1000.0; + float freq = flow_count / diff; + float flow_rate = freq / YF_B1_COUNT_PER_LPM; + + data[0] = flow_rate; + + flow_count = 0; + + return ERR_NONE; +} + +void YF_B1::handleInterrupt(void) { + flow_count++; +} \ No newline at end of file diff --git a/software/archive/microcontroller/sensors/yf_b1.h b/software/archive/microcontroller/sensors/yf_b1.h new file mode 100644 index 00000000..8deef43a --- /dev/null +++ b/software/archive/microcontroller/sensors/yf_b1.h @@ -0,0 +1,61 @@ +#ifndef PEAPOD_SENSORS_YF_B1_H_ +#define PEAPOD_SENSORS_YF_B1_H_ + +// HEADERS + +#include + +#include +#include +#include + +// MACROS + +// Settings +#define YF_B1_DELTA 1000 // Calculate frequency every second +#define YF_B1_COUNT_PER_LPM 7.5 // 7.5 counts is one liter per minute + +// GLOBALS +// Used when you need a pointer to static PROGMEM - these variables are ONLY INITIALIZED in the .cc SOURCE file that INCLUDES this header file +#ifndef GLOBALS // Double-declaration blocker + #define GLOBALS + // Descriptors + static const PROGMEM char* const id = "YF-B1"; + + // Data setup + static const PROGMEM char* const labels[1] = { "water_flow_rate" }; + static const PROGMEM SensorDataSetup datasetup = { + .numdata = 1, + .labels = labels + }; +#endif + +// CLASS + +// Interface for the Seeed Studio YF-B1 flow sensor. +class YF_B1 : public Sensor, public InterruptHandler { + public: + /** + * Constructor. + * @param pin Digital input pin. MUST be capable of interrupts (pins 2 and 3 on the Arduino Nano) + */ + YF_B1(const uint8_t pin); + private: + errorlevel_t initialize(void) override; + + errorlevel_t read(float* data, uint8_t numdata) override; + + // Digital input pin. + const uint8_t pin; + + // Triggered by interrupt. Increments flow counter. + void handleInterrupt(void) override; + + // Flow interrupt counter - volatile for interrupt compatibility + volatile uint32_t flow_count; + + // Timestamp of last flowrate calculation + unsigned long last_count; +}; + +#endif diff --git a/software/archive/microcontroller/simple.cc b/software/archive/microcontroller/simple.cc new file mode 100644 index 00000000..872d5209 --- /dev/null +++ b/software/archive/microcontroller/simple.cc @@ -0,0 +1,114 @@ +#include "simple.h" + +#include +// #include "../FiniteStateMachine/debug.h" +#ifndef DEBUG_DELAY +#define DEBUG_DELAY() {delay(10);} +#endif + +Flag lighting = Flag(); +Flag watering = Flag(); +Flag disco = Flag(); + +void logTimestamp(bool _, const fsm_timestamp_t& __) { + fsm_timestamp_t timestamp = Chronos.get(); + + DEBUG_DELAY(); + Serial.print(F("==== [ Time Elapsed: ")); + unsigned long seconds = timestamp / 1000; + unsigned long minutes = seconds / 60; + unsigned long hours = minutes / 60; + + seconds -= minutes * 60; + minutes -= hours * 60; + + if(hours < 10) Serial.print("0"); + Serial.print(hours); + Serial.print("h : "); + if(minutes < 10) Serial.print("0"); + Serial.print(minutes - hours * 60); + Serial.print("m : "); + if(seconds < 10) Serial.print("0"); + Serial.print(seconds); + Serial.println(F("s ] ====")); + DEBUG_DELAY(); +} + +void logLights(bool _, const bool& on) { + DEBUG_DELAY(); + Serial.print(F("== [ Lights: ")); + Serial.print(on ? F("ON") : F("OFF")); + Serial.println(F(" ] ==")); + DEBUG_DELAY(); +} + +void logWatering(bool _, const bool& on) { + DEBUG_DELAY(); + Serial.print(F("== [ Watering: ")); + Serial.print(on ? F("ON") : F("OFF")); + Serial.println(F(" ] ==")); + DEBUG_DELAY(); +} + +void logDisco(bool _, const bool& on) { + DEBUG_DELAY(); + Serial.print(F("== [ Disco: ")); + Serial.print(on ? F("ON") : F("OFF")); + Serial.println(F(" ] ==")); + DEBUG_DELAY(); +} + +void timerControlLights(bool on, const fsm_timestamp_t& timestamp) { + if(on) { + analogWrite(PIN_LIGHTING_HI, PWM_LIGHTING_HI); + analogWrite(PIN_LIGHTING_LO, PWM_LIGHTING_LO); + } else { + analogWrite(PIN_LIGHTING_HI, LOW); + analogWrite(PIN_LIGHTING_LO, LOW); + } +} + +void controlLights(bool _, const bool& lights) { + if(lights) { + analogWrite(PIN_LIGHTING_HI, PWM_LIGHTING_HI); + analogWrite(PIN_LIGHTING_LO, PWM_LIGHTING_LO); + } else { + analogWrite(PIN_LIGHTING_HI, LOW); + analogWrite(PIN_LIGHTING_LO, LOW); + } +} + +void controlWatering(bool _, const bool& watering) { + if(watering) { + digitalWrite(PIN_WATERING, HIGH); + } else { + digitalWrite(PIN_WATERING, LOW); + } +} + +void controlDisco(bool _, const bool& disco) { + if(disco) { + // Disable - don't worry about setting, disco scroll will take it from here + lighting.disable(); + } else { + // Enable and retrigger + lighting.resume(); + } +} + +void scrollDisco(bool _, const fsm_timestamp_t& __) { + fsm_timestamp_t timestamp = Chronos.get(); + + uint8_t discoPWM = (uint8_t)((cos(((timestamp % DISCO_CYCLE_MS) / (float)DISCO_CYCLE_MS) * 6.2831853) / 2.25 + 0.5) * 255); + + if(disco.get() && lighting.isDisabled()) { + DEBUG_DELAY(); + Serial.print(F("== [ Disco: ")); + Serial.print(discoPWM); + Serial.print(F(" ] ==\n")); + DEBUG_DELAY(); + + analogWrite(PIN_LIGHTING_HI, discoPWM); + analogWrite(PIN_LIGHTING_LO, 255-discoPWM); + } +} \ No newline at end of file diff --git a/software/archive/microcontroller/simple.h b/software/archive/microcontroller/simple.h new file mode 100644 index 00000000..39f0b845 --- /dev/null +++ b/software/archive/microcontroller/simple.h @@ -0,0 +1,44 @@ +#ifndef CSOS_SIMPLE_H_ +#define CSOS_SIMPLE_H_ + +#include + +// Watering + +#define PIN_WATERING 2 +#define DURATION_WATERING 2000 // 10 seconds +#define PERIOD_WATERING 200000 // 30 minutes + +// Lighting + +#define DELAY_START 1000 + +#define PIN_LIGHTING_LO 5 +#define PIN_LIGHTING_HI 6 +// #define PIN_LIGHTING_PHOTO 5 +#define DURATION_LIGHTING (TWENTYFOURHRS_MILLIS*3/4) +#define PWM_LIGHTING_LO (unsigned char)(255*0.3) +#define PWM_LIGHTING_HI (unsigned char)(255*0.6) + +// Fun Stuff +#define PIN_DISCO_BUTTON 10 +#define DELTA_DISCO 10 +#define DISCO_CYCLE_MS 1000 + +void logTimestamp(bool _, const fsm_timestamp_t& timestamp); +void logLights(bool _, const bool& on); +void logWatering(bool _, const bool& on); +void logDisco(bool _, const bool& on); + +// void timerControlLights(bool on, const fsm_timestamp_t& timestamp); +void controlLights(bool _, const bool& lights); +void controlWatering(bool _, const bool& watering); +void controlDisco(bool _, const bool& __); + +void scrollDisco(bool _, const fsm_timestamp_t& __); + +extern Flag lighting; +extern Flag watering; +extern Flag disco; + +#endif \ No newline at end of file diff --git a/software/archive/microcontroller/types.h b/software/archive/microcontroller/types.h new file mode 100644 index 00000000..0437cb26 --- /dev/null +++ b/software/archive/microcontroller/types.h @@ -0,0 +1,66 @@ +#ifndef CSOS_TYPES_H_ +#define CSOS_TYPES_H_ + +#include + +// Cross-compatible data types +typedef enum { + CSOS_NULL = 0x0, // INVALID - failsafe args + CSOS_BOOL = 0x2, // 0 | !0 + CSOS_UINT8 = 0x4, // 0-255 + CSOS_INT8 = 0x8, // -128-127 + CSOS_UINT16 = 0x10,// etc... + CSOS_INT16 = 0x20, + CSOS_UINT32 = 0x40,// May be a timestamp in ms + CSOS_INT32 = 0x80, + CSOS_FLOAT = 0x200, // 16-bit IEEE 754 floating point + CSOS_DOUBLE = 0x400, // 32-bit IEEE 754 floating point + CSOS_SCHAR = 0x800, // A character from a null-terminated string (quit if '\0') +} csos_types_t; + +// Pointer types (treated like an array, with default a single element) +typedef enum { + CSOS_NULLP = (CSOS_NULL | 0x1), // NOP - void* nullptr, "no args" ergo LAST args used + CSOS_BOOLP = (CSOS_BOOL | 0x1), + CSOS_UINT8P = (CSOS_UINT8 | 0x1), + CSOS_INT8P = (CSOS_INT8 | 0x1), + CSOS_UINT16P = (CSOS_UINT16 | 0x1), + CSOS_INT16P = (CSOS_INT16 | 0x1), + CSOS_UINT32P = (CSOS_UINT32 | 0x1), + CSOS_INT32P = (CSOS_INT32 | 0x1), + CSOS_FLOATP = (CSOS_FLOAT | 0x1), + CSOS_DOUBLEP = (CSOS_DOUBLE | 0x1), + CSOS_STRING = (CSOS_SCHAR | 0x1), // A pointer to a character from a null-terminated string +} csos_ptypes_t; + +// Cross-compatible data union - a single 32-bit value shared between all types +typedef union { + nullptr_t null; + bool b; + uint8_t u8; + int8_t i8; + uint16_t u16; + int16_t i16; + uint32_t u32; + int32_t i32; + float f; + double d; + char c; +} csos_data_t; + +// Cross-compatible pointer union - a single 16-bit pointer shared between all types +typedef union { + void* null; + const bool* b; + const uint8_t* u8; + const int8_t* i8; + const uint16_t* u16; + const int16_t* i16; + const uint32_t* u32; + const int32_t* i32; + const float* f; + const double* d; + const char* c; +} csos_pdata_t; + +#endif \ No newline at end of file diff --git a/software/archive/microcontroller/utils/base.h b/software/archive/microcontroller/utils/base.h new file mode 100644 index 00000000..32a3d0b0 --- /dev/null +++ b/software/archive/microcontroller/utils/base.h @@ -0,0 +1,19 @@ +#ifndef PEAPOD_UTILS_BASE_H_ +#define PEAPOD_UTILS_BASE_H_ + +// Degree of error occurred +typedef enum errorlevel_t { + ERR_NONE, + ERR_WARNING, + ERR_FATAL +} errorlevel_t; + +// General state information - On error level > 0, indicates last successful state +typedef enum debuglevel_t { + DS_DISABLED, + DS_INITIALIZED, + DS_WAITING, + DS_SUCCESS +} debuglevel_t; + +#endif \ No newline at end of file diff --git a/software/archive/microcontroller/utils/instructions.cc b/software/archive/microcontroller/utils/instructions.cc new file mode 100644 index 00000000..1eb61cb3 --- /dev/null +++ b/software/archive/microcontroller/utils/instructions.cc @@ -0,0 +1,79 @@ +#include + +#include + +#include +#include +#include + +namespace InstructionHandler { + bool isValidSet(String instructionSet) { + return instructionSet.equals("{}") || (instructionSet.charAt(0) == '{' && instructionSet.charAt(instructionSet.length()-1) == '}' && instructionSet.indexOf(':') != -1); + } + + errorlevel_t handleSet(String instructionSet, const InstructionActuatorMatrix* matrix) { + // If empty, by default handled + if(instructionSet.equals("{}")){ + return ERR_NONE; + } + + // If invalid, throw error + if (!isValidSet(instructionSet)) { + JSONMessenger::sendMessage(JSONMessenger::MESSAGE_ERROR, String("Invalid instruction set '" + instructionSet + "', bad formatting.")); + return ERR_FATAL; + } + + // Valid and non-empty, strip curly braces + instructionSet = instructionSet.substring(1, instructionSet.length()-1); + + errorlevel_t result = ERR_NONE; + // While there are instructions: + while (instructionSet.indexOf(':') != -1) { + // Find end of leftmost instruction + int stop = instructionSet.indexOf(','); + if (stop == -1) { + stop = instructionSet.length(); + } + + // Handle leftmost instruction + String instruction = instructionSet.substring(0, stop); + errorlevel_t latest = handleInstruction(instruction, matrix); + + // Raise result errorlevel? + result = max(result, latest); + + // Truncate leftmost instruction + instructionSet = instructionSet.substring(stop+1); + } + return result; + } + + errorlevel_t handleInstruction(String instruction, const InstructionActuatorMatrix* matrix) { + uint8_t split = instruction.indexOf(":"); + + // Check formatting + if (split != -1 && instruction.charAt(0) == '"' && instruction.charAt(split-1) == '"') { + // Get label (remove quotations) + String label = instruction.substring(1, split-1); + + // Get value + float value = instruction.substring(split+1).toFloat(); + + if(value == 0 && !(instruction.charAt(split+1) == '0' || (instruction.charAt(split+1) == '.' && instruction.charAt(split+2) == '0'))) { + JSONMessenger::sendMessage(JSONMessenger::MESSAGE_ERROR, String("Invalid target value '" + instruction.substring(split+1) + "'.")); + return ERR_FATAL; + } + + for (int i = 0; i < matrix->numActuators; ++i) { + if (label.equals(matrix->instructions[i])) { + matrix->actuators[i]->setTarget(value); + return ERR_NONE; + } + } + JSONMessenger::sendMessage(JSONMessenger::MESSAGE_ERROR, String("Unknown instruction label '" + label + "'.")); + return ERR_WARNING; + } + JSONMessenger::sendMessage(JSONMessenger::MESSAGE_ERROR, String("Invalid instruction '" + instruction + String("', bad formatting."))); + return ERR_FATAL; + } +} \ No newline at end of file diff --git a/software/archive/microcontroller/utils/instructions.h b/software/archive/microcontroller/utils/instructions.h new file mode 100644 index 00000000..126ea54b --- /dev/null +++ b/software/archive/microcontroller/utils/instructions.h @@ -0,0 +1,46 @@ +#ifndef PEAPOD_UTILS_INSTRUCTIONS_H_ +#define PEAPOD_UTILS_INSTRUCTIONS_H_ + +#include + +#include +#include + +// Instruction label matching `instructions[i]` indicates that the target of actuator `actuators[i]` should be set to the instruction value +typedef struct InstructionActuatorMatrix { + // Number of actuators + uint8_t numActuators; + + // Array of pointers to actuators + Actuator** actuators; + + // Array of instruction label strings + const char** instructions; +} InstructionActuatorMatrix; + +namespace InstructionHandler { + /** + * Checks a non-empty instruction set for formatting validity + * @param instructionSet JSON-formatted instruction set + * @return Validity + */ + bool isValidSet(String instructionSet); + + /** + * Handles incoming instruction set according to an instruction-actuator matrix + * @param instructionSet JSON-formatted instruction set + * @param matrix Instruction-actuator matrix + * @return Error level - `ERR_FATAL`: invalid instruction set formatting; `ERR_WARNING`: one or more instruction labels were unknown + */ + errorlevel_t handleSet(String instructionSet, const InstructionActuatorMatrix* matrix); + + /** + * Handles incoming instruction label-target pair. + * @param instruction Label-target pair (i.e. `"\"actuator_label\":value_float"`) + * @param matrix Instruction-actuator matrix + * @return Error level - `ERR_FATAL`: invalid instruction formatting; `ERR_WARNING`: instruction label was unknown + */ + errorlevel_t handleInstruction(String instruction, const InstructionActuatorMatrix* matrix); +} + +#endif diff --git a/software/archive/microcontroller/utils/interrupts.cc b/software/archive/microcontroller/utils/interrupts.cc new file mode 100644 index 00000000..158dab61 --- /dev/null +++ b/software/archive/microcontroller/utils/interrupts.cc @@ -0,0 +1,23 @@ +#include + +#include + +InterruptHandler::InterruptHandler(const uint8_t* pin) { + this->pin = pin; +} + +InterruptHandler::~InterruptHandler() { + detachInterrupt(digitalPinToInterrupt(*pin)); +} + +void InterruptHandler::attachInstanceInterrupt(int mode) { + // Pointer-to-member-function &InterruptHandler::handleInterrupt points to handleInterrupt on THIS instance + // and is then converted to a normal function pointer to its place in memory + // This causes a `-Wpmf-conversions` warning, but works so long as the object instance outlives the interrupt + // This is ensured by detaching the interrupt on object destruction + attachInterrupt(digitalPinToInterrupt(*pin), (interruptHandler)(&InterruptHandler::handlerTrigger), RISING); +} + +void InterruptHandler::handlerTrigger(void) { + this->handleInterrupt(); +} \ No newline at end of file diff --git a/software/archive/microcontroller/utils/interrupts.h b/software/archive/microcontroller/utils/interrupts.h new file mode 100644 index 00000000..671dc788 --- /dev/null +++ b/software/archive/microcontroller/utils/interrupts.h @@ -0,0 +1,40 @@ +#ifndef PEAPOD_UTILS_INTERRUPTS_H_ +#define PEAPOD_UTILS_INTERRUPTS_H_ + +#include + +typedef void (*interruptHandler)(void); + +class InterruptHandler { + public: + /** + * Constructor. + * @param pin Digital pin to attach interrupt to + */ + InterruptHandler(const uint8_t* pin); + + /** + * Destructor. Used to detach the interrupt + */ + ~InterruptHandler(); + + /** + * Attaches the interrupt to trigger `handleInterrupt` on THIS instance + * @param mode Mode (i.e. RISING) + */ + void attachInstanceInterrupt(int mode); + + /** + * Triggered by interrupt. Triggers handlerTrigger + */ + void handlerTrigger(void); + + /** + * Triggered by handlerTrigger. To be implemented by the child class. + */ + virtual void handleInterrupt(void) = 0; + private: + const uint8_t* pin; +}; + +#endif \ No newline at end of file diff --git a/software/archive/microcontroller/utils/jsonmessenger.cc b/software/archive/microcontroller/utils/jsonmessenger.cc new file mode 100644 index 00000000..309b8094 --- /dev/null +++ b/software/archive/microcontroller/utils/jsonmessenger.cc @@ -0,0 +1,56 @@ +#include + +#include + +String parseMessageLevel(JSONMessenger::jsonmessagetype_t type) { + switch (type) { + case JSONMessenger::MESSAGE_DEBUG: + return String("debug"); + case JSONMessenger::MESSAGE_ERROR: + return String("error"); + } + return String("msg"); +} + +namespace JSONMessenger { + + #ifdef UNIT_TEST + + String sendMessage(jsonmessagetype_t type, String message) { + // Replace quotes with escaped quotes + message.replace("\"", "\\\""); + String out = String("{\"type\":\"" + parseMessageLevel(type) + "\",\"data\":\"" + message + "\"}\n"); + return out; + } + + String sendRevision(uint8_t revision) { + String out = String("{\"type\":\"revision\",\"data\":" + String(revision) + "}\n"); + return out; + } + + String sendData(const char* label, float value) { + String out = String("{\"type\":\"data\",\"data\":{\"label\":\"" + String(label) + "\",\"value\":" + String(value, DATADECIMALS) + "}}\n"); + return out; + } + + #else + + void sendMessage(jsonmessagetype_t type, String message) { + // Replace quotes with escaped quotes + message.replace("\"", "\\\""); + String out = String("{\"type\":\"" + parseMessageLevel(type) + "\",\"data\":\"" + message + "\"}\n"); + Serial.print(out); + } + + void sendRevision(uint8_t revision) { + String out = String("{\"type\":\"revision\",\"data\":" + String(revision) + "}\n"); + Serial.print(out); + } + + void sendData(const char* label, float value) { + String out = String("{\"type\":\"data\",\"data\":{\"label\":\"" + String(label) + "\",\"value\":" + String(value, DATADECIMALS) + "}}\n"); + Serial.print(out); + } + + #endif +} \ No newline at end of file diff --git a/software/archive/microcontroller/utils/jsonmessenger.h b/software/archive/microcontroller/utils/jsonmessenger.h new file mode 100644 index 00000000..c789a6d0 --- /dev/null +++ b/software/archive/microcontroller/utils/jsonmessenger.h @@ -0,0 +1,48 @@ +#ifndef PEAPOD_UTILS_JSONMESSENGER_H_ +#define PEAPOD_UTILS_JSONMESSENGER_H_ + +#include + +#define DATADECIMALS 2 + +;namespace JSONMessenger { + + typedef enum jsonmessagetype_t { + MESSAGE_DEBUG, + MESSAGE_ERROR, + } jsonmessagetype_t; + + #ifdef UNIT_TEST + + String sendMessage(jsonmessagetype_t type, String message); + + String sendRevision(uint8_t revision); + + String sendData(const char* label, float value); + + #else + + /** + * Send a JSON-formatted message over Serial. + * @param type Message type + * @param message Message content + */ + void sendMessage(jsonmessagetype_t type, String message); + + /** + * Send a JSON-formatted revision message over Serial. + * @param revision Software revision + */ + void sendRevision(uint8_t revision); + + /** + * Send a JSON-formatted message over Serial containing sensor data. + * @param label Environment variable label + * @param value Sensor data value + */ + void sendData(const char* label, float value); + + #endif +} + +#endif \ No newline at end of file diff --git a/software/archive/microcontroller/utils/map.h b/software/archive/microcontroller/utils/map.h new file mode 100644 index 00000000..2fdbf35b --- /dev/null +++ b/software/archive/microcontroller/utils/map.h @@ -0,0 +1,71 @@ +#ifndef PEAPOD_UTILS_MAP_H_ +#define PEAPOD_UTILS_MAP_H_ + +#include + +#include + +#include +#include + +// Returns Sensor* +typedef Sensor* (*sensorfactory_t)(void* args); + +class SensorFactoryMap { + public: + template sensorfactory_t add(const char* const id); + sensorfactory_t find(const char* id); + private: + uint8_t numsensors = 0; + sensorfactory_t sensorFactories[NUM_SENSORS]; + const char* const* ids; +}; + +template sensorfactory_t SensorFactoryMap::add(const char* const id) { + uint8_t newsensor = numsensors; + ids[newsensor] = id; + sensorFactories[newsensor] = (sensorfactory_t)([void* args]{ return new S(args); }); + numsensors++; + return sensorFactories[newsensor]; +} + +sensorfactory_t SensorFactoryMap::find(const char* id) { + for (uint8_t i = 0; i < numsensors; i++) { + if (strcmp(id, ids[i]) == 0) { + return sensorFactories[i]; + } + } + return nullptr; +} + +// Returns Actuator* +typedef Actuator* (*actuatorfactory_t)(void* args); + +class ActuatorFactoryMap { + public: + template actuatorfactory_t add(const char* const id); + actuatorfactory_t find(const char* id); + private: + uint8_t numactuators = 0; + actuatorfactory_t actuatorFactories[NUM_ACTUATORS]; + const char* const* ids; +}; + +template actuatorfactory_t ActuatorFactoryMap::add(const char* const id) { + uint8_t newactuator = numactuators; + ids[newactuator] = id; + actuatorFactories[newactuator] = (actuatorfactory_t)([void* args]{ return new A(args); }); + numactuators++; + return actuatorFactories[newactuator]; +} + +actuatorfactory_t ActuatorFactoryMap::find(const char* id) { + for (uint8_t i = 0; i < numactuators; i++) { + if (strcmp(id, ids[i]) == 0) { + return actuatorFactories[i]; + } + } + return nullptr; +} + +#endif \ No newline at end of file diff --git a/software/archive/src/controller.ts b/software/archive/src/controller.ts new file mode 100644 index 00000000..0b6a6a74 --- /dev/null +++ b/software/archive/src/controller.ts @@ -0,0 +1,280 @@ +import chalk from 'chalk'; +import { ReadlineParser, SerialPort } from 'serialport'; +import { ControllerInstructionsError } from './errors'; +import { Spinner } from './ui'; +import { sleep, updateMicrocontroller } from './utils'; +// import { Gpio } from 'onoff'; + +// CONSTANTS + +/** + * Baud rate for serial communication. Must match that found in microcontroller code. + */ +const BAUDRATE = 115200; + +/** + * Microcontroller software revision matching this software. + */ +export const CONTROLLER_REVISION = 0; + +/** + * Seconds to wait between messages before timing out. + */ +const SERIAL_TIMEOUT_SECONDS = 10; + +/** + * GPIO pin attached to the reset grounding circuit + */ +// const RESET_PIN = 26; + +// TYPES + +/** + * Base type for any controller. + */ +export type Controller = { + /** + * Establish communications with the Controller. + * @param onMessage Pipe all received messages. + * @throws If received message is invalid (JSON parsing fails). + */ + start(onMessage: (msg: ControllerMessage) => void): Promise; + + /** + * Write instructions to the Controller. + * @param instructions Instruction set. + */ + write(instructions: ControllerInstructions): void; + + /** + * Halt communications with the Controller. + */ + stop(): void; +}; + +/** + * Messages FROM the controller + */ +export type ControllerMessage = + | { + type: 'info' | 'debug' | 'error'; + data: string; + } + | { + type: 'data'; + data: { + label: string; + value: number; + }; + } + | { + type: 'revision'; + data: number; + }; + +/** + * Messages TO the controller + */ +export type ControllerInstructions = { + [key: string]: number; +}; + +/** + * Simulated controller parameters + */ +export type SimulatorConfig = { + [key: string]: { + min: number; + max: number; + interval: number; + }; +}; + +// CLASSES + +/** + * Interface between this computer and the microcontroller. + */ +export default class MicroController implements Controller { + serial: SerialPort; + parser: ReadlineParser; + private timeout?: NodeJS.Timeout; + // private resetpin: Gpio; + + constructor(readonly serialport: string) { + // Reset pin GPIO interface + // this.resetpin = new Gpio(RESET_PIN, 'out'); + + // Create the serial port interface + this.serial = new SerialPort({ + path: serialport, + baudRate: BAUDRATE, + autoOpen: false + }); + + // Create the newline parser + this.parser = this.serial.pipe( + new ReadlineParser({ + delimiter: '\n', + includeDelimiter: false + }) + ); + } + + start(onMessage: (msg: ControllerMessage) => void): Promise { + this.clearTimeout(); + // Reset listeners + this.parser.removeAllListeners('data'); + + // Explicit promise construction so we can resolve only on valid comms AND revision check + return new Promise(async (res, rej) => { + // Reset the microcontroller (opens the serial port) + await this.reset(); + + Spinner.start('Awaiting microcontroller software revision number...'); + this.resetTimeout(); + + // Set up the listener + this.parser.on('data', async msgtxt => { + // Attempt to parse the raw text as a valid JSON object + let msg: ControllerMessage; + try { + msg = JSON.parse(msgtxt); + } catch (err) { + rej(err); + return; + } + + // Microcontroller-specific pre-handling + switch (msg.type) { + case 'revision': + // Software update + if (msg.data === CONTROLLER_REVISION) { + Spinner.succeed(`Microcontroller software up to date! Got ${msg.data}`); + res(); //Successful start sequence + } else { + Spinner.fail( + `Microcontroller software out of date! Got ${msg.data}, expected ${CONTROLLER_REVISION}.` + ); + // Attempt to update the microcontroller, and then restart + this.stop(); + Spinner.start('Compiling latest microcontroller software and flashing...'); + await updateMicrocontroller(); + Spinner.succeed('Updated microcontroller software successfully!'); + } + // Do not break + default: + onMessage(msg); + break; + } + this.resetTimeout(); + }); + }); + } + + /** + * Clear the serial timeout. + */ + private clearTimeout(): void { + if (this.timeout) clearTimeout(this.timeout); + } + + /** + * Refresh (or start) the serial timeout. + */ + private resetTimeout(timeoutSeconds: number = SERIAL_TIMEOUT_SECONDS): void { + this.clearTimeout(); + this.timeout = setTimeout(() => { + Spinner.fail( + `Microcontroller serial communications timed out after ${timeoutSeconds} seconds.` + ); + this.reset(); + }, timeoutSeconds * 1000); + } + + write(msg: ControllerInstructions): void { + Spinner.info(`[${chalk.yellow('WRITE')}] - ${JSON.stringify(msg)}`); + this.serial.write(JSON.stringify(msg) + '\n', undefined, err => { + if (err) throw new ControllerInstructionsError(JSON.stringify(msg)); + }); + } + + stop(): void { + this.clearTimeout(); + if (this.serial.isOpen) this.serial.close(); + // Stop listening for data + this.parser.removeAllListeners('data'); + } + + /** + * Resets the microcontroller by closing and re-opening serial. + */ + private async reset(): Promise { + // Stop and reset + this.stop(); + // this.resetpin.writeSync(1); + + // Wait, then stop resetting + // await sleep(1000); + // this.resetpin.writeSync(0); + + // (Re-)open serial + await new Promise((reso, reje) => { + Spinner.start('Establishing serial communications with the microcontroller...'); + this.serial.open(err => { + if (err) { + reje(err); + } else { + Spinner.succeed('Microcontroller serial communications established!'); + reso(); + } + }); + }); + + // Restart timeout + this.resetTimeout(); + } +} + +/** + * A simulated controller for generating random data. + */ +export class SimulatedController implements Controller { + private intervals: NodeJS.Timeout[] = []; + + constructor(readonly parameters: SimulatorConfig) {} + + async start(onMessage: (msg: ControllerMessage) => any): Promise { + for (const label of Object.keys(this.parameters)) { + this.intervals.push( + setInterval(() => { + onMessage( + this.generateData(label, this.parameters[label].min, this.parameters[label].max) + ); + }, this.parameters[label].interval) + ); + } + } + write() {} + async stop(): Promise { + for (const interval of this.intervals) { + clearInterval(interval); + } + } + + /** + * Generate a single data point + * @param label Dataset label + * @param min Minimum value + * @param max Maximum value + */ + private generateData(label: string, min: number, max: number): ControllerMessage { + return { + type: 'data', + data: { + label, + value: Math.random() * (max - min) + min + } + }; + } +} diff --git a/software/archive/src/controlsystem.ts b/software/archive/src/controlsystem.ts new file mode 100644 index 00000000..f35d1659 --- /dev/null +++ b/software/archive/src/controlsystem.ts @@ -0,0 +1,70 @@ +export abstract class ControlSystem { + protected target?: number; + protected value?: number; + constructor(readonly actuator: string) {} + abstract refresh(): number; + setTarget(target: number) { + this.target = target; + } + setValue(value: number) { + this.value = value; + } +} + +// MAIN CLASS + +/** + * Interface for publishing data to and receiving instructions from Google Cloud/Firebase via IoT Core PubSub. + */ +export class BangBang extends ControlSystem { + constructor(readonly actuator: string, readonly deadzone: number = 0) { + super(actuator); + } + refresh(): number { + if (this.target === undefined || this.value === undefined) { + return NaN; + } + if (this.value > this.target + this.deadzone) { + return -1; + } + if (this.value < this.target - this.deadzone) { + return 1; + } + return 0; + } +} + +/** + * Interface for publishing data to and receiving instructions from Google Cloud/Firebase via IoT Core PubSub. + */ +export class PID extends ControlSystem { + private valueLastSet: number = NaN; + private lasterr: number = NaN; + private integral: number = 0; + constructor( + readonly actuator: string, + readonly Kp: number, + readonly Ki: number, + readonly Kd: number + ) { + super(actuator); + } + refresh(): number { + if (this.target === undefined || this.value === undefined) { + return NaN; + } + const err = this.target - this.value; + let derivative = 0; + if (Number.isNaN(this.valueLastSet) || Number.isNaN(this.lasterr)) { + // Trapezoidal approximation + this.integral += ((this.lasterr + err) / 2) * (Date.now() - this.valueLastSet); + derivative = (err - this.lasterr) / (Date.now() - this.valueLastSet); + } + return this.Kp * err + this.Ki * this.integral + this.Kd * derivative; + } + + override setValue(value: number): void { + this.value = value; + this.valueLastSet = Date.now(); + } +} diff --git a/software/archive/src/env.ts b/software/archive/src/env.ts new file mode 100644 index 00000000..d43c6131 --- /dev/null +++ b/software/archive/src/env.ts @@ -0,0 +1,154 @@ +import dotenv from 'dotenv'; +import { existsSync } from 'fs'; +import { FirebaseOptions } from 'firebase/app'; +import { EnvFieldError } from './errors'; +import { IoTConfig } from './publisher'; +import { DeviceFlowUIOptions } from '@peapodtech/firebasedeviceflow'; + +/** + * Env fields required for ALL modes. + */ +const ENV_FIELDS_PEAPOD = ['SERIALPORT']; + +/** + * Env fields required for Firebase functionality. + */ +const ENV_FIELDS_FIREBASE = [ + 'FIREBASE_APIKEY', + 'FIREBASE_AUTHDOMAIN', + 'FIREBASE_PROJECTID', + 'FIREBASE_STORAGEBUCKET', + 'FIREBASE_MESSAGINGSENDERID', + 'FIREBASE_APPID', + 'FIREBASE_MEASUREMENTID' +]; + +/** + * Env fields required for GCP IoT Core functionality. + */ +const ENV_FIELDS_IOT = [ + 'IOT_CLOUDREGION', + 'FIREBASE_PROJECTID', + 'IOT_REGISTRY', + 'IOT_JWT_EXPIRYMINS' +]; + +/** + * Env fields required for FirebaseDeviceFlow Auth functionality. + */ +const ENV_FIELDS_AUTH = [ + 'GOOGLE_SCOPES', + 'GOOGLE_CLIENTID', + 'GOOGLE_CLIENTSECRET', + 'GITHUB_SCOPES', + 'GITHUB_CLIENTID', + 'GITHUB_CLIENTSECRET' +]; + +export type PeaPodEnv = { + serialport: string; +}; + +/** + * Load a `.env`-style file to `process.env`. + * + * Throws an error if the file does not exist. + */ +function loadDotEnv(path: string = '.env'): void { + // Check for file + if (existsSync(path)) { + const config = dotenv.config({ path }); + if (config.error) { + throw config.error; + } + } else { + throw new Error('Environment variable file not found.'); + } +} + +/** + * Check which of the given fields are missing (undefined) in `process.env` + * @param fields List of fields to check + * @returns List of missing fields + */ +function getMissingEnvFields(fields: string[]): string[] { + return fields.filter(field => !Object.keys(process.env).includes(field)); +} + +/** + * Load config for the Firebase app and check for all fields. + * @returns Firebase app config object + */ +export function loadFirebaseEnv(): FirebaseOptions { + const missingFields = getMissingEnvFields(ENV_FIELDS_FIREBASE); + if (missingFields.length) { + throw new EnvFieldError('Firebase', missingFields); + } else { + return { + apiKey: process.env.FIREBASE_APIKEY, + authDomain: process.env.FIREBASE_AUTHDOMAIN, + databaseURL: process.env.FIREBASE_DATABASEURL, + projectId: process.env.FIREBASE_PROJECTID, + storageBucket: process.env.FIREBASE_STORAGEBUCKET, + messagingSenderId: process.env.FIREBASE_MESSAGINGSENDERID, + appId: process.env.FIREBASE_APPID, + measurementId: process.env.FIREBASE_MEASUREMENTID + }; + } +} + +/** + * Load config for GCP IoT Core and check for all fields. + * @returns GCP IoT Core config object + */ +export function loadIoTEnv(): IoTConfig { + const missingFields = getMissingEnvFields(ENV_FIELDS_IOT); + if (missingFields.length) { + throw new EnvFieldError('GCP IoT Core', missingFields); + } else { + return { + cloudregion: process.env.IOT_CLOUDREGION!, + projectid: process.env.FIREBASE_PROJECTID!, + registryid: process.env.IOT_REGISTRY!, + jwtexpiryminutes: Number(process.env.IOT_JWT_EXPIRYMINS ?? '1440') + }; + } +} + +/** + * Load config for the Firebase app and check for all fields. + * @returns Firebase app config object + */ +export function loadAuthEnv(): DeviceFlowUIOptions { + const missingFields = getMissingEnvFields(ENV_FIELDS_AUTH); + if (missingFields.length) { + throw new EnvFieldError('Firebase Device Flow Auth', missingFields); + } else { + return { + Google: { + scopes: process.env.GOOGLE_SCOPES?.split(' '), + clientid: process.env.GOOGLE_CLIENTID, + clientsecret: process.env.GOOGLE_CLIENTSECRET + }, + GitHub: { + scopes: process.env.GITHUB_SCOPES?.split(' '), + clientid: process.env.GITHUB_CLIENTID, + clientsecret: process.env.GITHUB_CLIENTSECRET + } + }; + } +} + +export function loadPeaPodEnv(): PeaPodEnv { + const missingFields = getMissingEnvFields(ENV_FIELDS_PEAPOD); + if (missingFields.length) { + throw new EnvFieldError('PeaPod', missingFields); + } else { + return { + serialport: process.env.SERIALPORT! + }; + } +} + +// MAIN +loadDotEnv(); diff --git a/software/archive/src/errors.ts b/software/archive/src/errors.ts new file mode 100644 index 00000000..74cde432 --- /dev/null +++ b/software/archive/src/errors.ts @@ -0,0 +1,22 @@ +export class ControllerInstructionsError extends Error { + constructor(instructions: any) { + super("Failed to send instructions to Arduino: '" + JSON.stringify(instructions) + "'"); + } +} + +// UNUSED +// export class SerialTimeoutError extends Error { +// constructor(timeoutSeconds?: number) { +// super(`Arduino serial communication timed out${ timeoutSeconds === undefined ? '' : ` after ${ timeoutSeconds } seconds` }.`); +// } +// }; + +export class EnvFieldError extends Error { + constructor(mode: string, missingFields: string[]) { + super( + `.env file is missing the following fields necessary for ${mode} functionality: ${missingFields.join( + ', ' + )}` + ); + } +} diff --git a/software/archive/src/peapod.ts b/software/archive/src/peapod.ts new file mode 100644 index 00000000..ef52da12 --- /dev/null +++ b/software/archive/src/peapod.ts @@ -0,0 +1,440 @@ +import { Screen, Spinner } from './ui'; +import chalk from 'chalk'; + +import { initializeApp, getApps } from 'firebase/app'; +import { getAuth } from 'firebase/auth'; + +import { loadPeaPodEnv, loadAuthEnv, loadFirebaseEnv, loadIoTEnv } from './env'; +import MicroController, { + ControllerInstructions, + Controller, + CONTROLLER_REVISION +} from './controller'; +import OnlinePublisher, { + DataBatch, + DataSet, + Publisher, + OfflinePublisher, + PublishingMode +} from './publisher'; +import { sleep } from './utils'; +import { ControlSystem } from './controlsystem'; + +// CONSTANTS + +/** + * Seconds between data publications. + */ +const BATCH_PUBLISH_INTERVAL = 5; + +/** + * Milliseconds between target refresh. + */ +const REFRESH_INTERVAL = 1000; + +/** + * Period of the idle loop. + */ +const IDLE_PERIOD = 5000; + +// DECLARATIONS + +export type EnvironmentSchedule = { + id: string; + name: string; + revision: number; + parameters: { + [key: string]: EnvironmentTargetPhase[]; + }; +}; + +type EnvironmentTargets = { + [key: string]: number; +}; + +type EnvironmentTargetPhase = + | { + type: 'piecewise'; + end: number; + values: { + value: number; + timestamp: number; + }[]; + } + | { + type: 'periodic'; + period: number; + end: number; + values: { + value: number; + duration: number; + }[]; + }; + +/** + * Main driver class. + * + * LINGO LESSON: + * > Derived from the Solution Overview/Progress Report + * + * VARIABLE = A **MEASURABLE** environment state variable, both feedback-driven and not. E.g. "air-temperature", "air-humidity", "co2-ppm", + * PARAMETER = A **CONTROLLABLE** environment state variable, both feedback-driven and not. E.g. "air-temperature", "lighting_750nm", "dosage_pump1" + * + * INSTRUCTION + * SCHEDULE = . See `../assets/schedule_schema.json` + * TARGETS = Desired state for each parameter. PeaPod scheduler state variables. Modified + * RUN + */ +export default class PeaPod { + // INTERFACES + controller: Controller; + publisher: Publisher; + + // SCHEDULER FIELDS + + /** + * Currently loaded schedule. + */ + private schedule?: EnvironmentSchedule; + + /** + * Start time of the last run. + */ + private startTime: number = 0; + + /** + * Current environment schedule targets. + */ + private targets: EnvironmentTargets = {}; + + /** + * Latest controller data for each variable + */ + private data: DataSet = {}; + + // CONTROLLER FIELDS + + // private controlSystems?: { [key: string]: ControlSystem }; + + /** + * Latest controller instruction set. + */ + private instructions: ControllerInstructions = {}; + + // PUBLISHER FIELDS + + /** + * Batch of data to be published. + */ + private batch: DataBatch = {}; + + /** + * JS interval to trigger batch publishing. + */ + private batchInterval?: NodeJS.Timer; + + constructor(pm: PublishingMode) { + const ENV_PEAPOD = loadPeaPodEnv(); + + // CREATE CONTROLLER + this.controller = new MicroController(ENV_PEAPOD.serialport); + + // CREATE PUBLISHER + Spinner.info(`Running ${chalk.green('PeaPod')} in ${pm} mode.`); + switch (pm) { + case PublishingMode.ONLINE: + initializeApp(loadFirebaseEnv()); + if (getApps().length === 0) { + throw new Error('Failed to initialize Firebase app! Check .env fields.'); + } else { + Spinner.succeed(`Initialized Firebase app!`); + } + this.publisher = new OnlinePublisher(loadIoTEnv(), loadAuthEnv()); + break; + + case PublishingMode.OFFLINE: + default: + this.publisher = new OfflinePublisher(); + break; + } + } + + async idle(): Promise { + await this.controller.start(msg => { + switch (msg.type) { + case 'data': + this.data[msg.data.label] = msg.data.value; + Screen.setData(this.data); + Screen.render(); + break; + case 'revision': + this.controller.write(this.instructions); + break; + default: + // TODO: Console box? + Spinner.log( + `[${chalk.blueBright('CONTROLLER')} | ${msg.type.toUpperCase()}] - ${JSON.stringify( + msg.data + )}` + ); + } + }); + + // Angle to "wheel" the lights + let angle = 0; + + const idleInterval = setInterval(() => { + const idleInstructions = { + led_blue: Math.sin(angle) / 2 + 0.5, + led_cool: Math.sin(angle + (2 * Math.PI) / 5) / 2 + 0.5, + led_warm: Math.sin(angle + (4 * Math.PI) / 5) / 2 + 0.5, + led_red: Math.sin(angle + (6 * Math.PI) / 5) / 2 + 0.5, + led_far: Math.sin(angle + (8 * Math.PI) / 5) / 2 + 0.5 + }; + this.controller.write(idleInstructions); + + angle += (2 * Math.PI) / (IDLE_PERIOD / REFRESH_INTERVAL); + angle -= angle > 2 * Math.PI ? 2 * Math.PI : 0; + }, REFRESH_INTERVAL); + return idleInterval; + } + + async start(): Promise { + // INITIALIZE CONTROLLER + await this.controller.start(msg => { + // Handle different message types + // TODO: Handle error, etc. types + switch (msg.type) { + case 'data': + // Initialize batch array + if (this.batch[msg.data.label] === undefined) this.batch[msg.data.label] = []; + // Accumulate data into batches + this.batch[msg.data.label].push({ + timestamp: Date.now(), + value: msg.data.value + }); + // Set actuator values + // if (!!this.controlSystems && !!(this.controlSystems[msg.data.label])) { + // this.controlSystems[msg.data.label].setValue(msg.data.value); + // } + break; + case 'revision': + this.controller.write(this.instructions); + break; + default: + Spinner.log( + `[${chalk.blueBright('CONTROLLER')}${msg.type ? ' | ' + msg.type.toUpperCase() : ''} - ${JSON.stringify( + msg.data + )}` + ); + } + }); + + // Wait for all POST messages + await sleep(1000); + + // INITIALIZE PUBLISHER + let { projectid, projectname, run } = await this.publisher.start( + config => { + Spinner.log(`[${chalk.yellow('PUBLISHER')} | SCHEDULE] - ${config}`); + switch (config.type) { + case 'schedule': + Spinner.log( + `[${chalk.yellow('PUBLISHER')} | SCHEDULE] - ${JSON.stringify(config.data.name)}` + ); + + if (config.data.revision != CONTROLLER_REVISION) { + Spinner.fail( + `Failed to load schedule '${config.data.name}' (${config.data.id}), software version mismatch (Expected ${CONTROLLER_REVISION}, got ${config.data.revision}).` + ); + break; + } + + Spinner.succeed( + `Successfully loaded schedule '${config.data.name}' (${config.data.id}).` + ); + + // Save new schedule + this.schedule = config.data; + + break; + default: + Spinner.log(`[${chalk.yellow('PUBLISHER')} | CONFIG] - ${JSON.stringify(config.data)}`); + } + }, + command => { + switch (command.type) { + case 'instructions': + Spinner.log( + `[${chalk.yellow('PUBLISHER')} | INSTRUCTIONS] - ${JSON.stringify(command.data)}` + ); + this.controller.write(command.data); + break; + default: + Spinner.log(`[${chalk.yellow('PUBLISHER')} | COMMAND] - ${JSON.stringify(command)}`); + } + } + ); + + // START + Spinner.log( + `${chalk.green('PeaPod')} start - Project ${chalk.bold( + projectname ?? projectid + )}, Run ${chalk.bold(run)}` + ); + + this.startTime = Date.now(); + + // Start schedule phase 0 + let phasePromises = []; + if(!!this.schedule) { + for (const parameter of Object.keys(this.schedule.parameters)) { + phasePromises.push(this.startPhase(this.schedule, parameter)); + } + } + + // Reset + this.batch = {}; + + this.batchInterval = setInterval(() => { + // Publish entire batch + try { + this.publisher.publish({ + type: 'data', + metadata: { + owner: getApps().length ? getAuth().currentUser?.uid ?? 'user' : 'user', + project: projectid, + run + }, + data: this.batch + }); + } catch { + Spinner.fail('Batch publish failed, will retry...'); + return; + } + + Spinner.log( + `[${chalk.magenta('PUBLISH')}] - Batch of ${Object.values(this.batch).reduce( + (sum, entry) => sum + entry.length, + 0 + )} datapoints published.` + ); + + // Reset batch to empty + this.batch = {}; + }, BATCH_PUBLISH_INTERVAL * 1000); + + // Refresh control system values and targets, update actuator instructions, send new instructions + // const refreshInterval = setInterval(() => { + // let instruction: ControllerInstructions = {}; + // for (const parameter of Object.keys(targets)) { + // const cs = this.controlSystems[parameter]; + // cs.setTarget(this.targets[parameter]); + // instruction[cs.actuator] = cs.refresh(); + // } + // this.controller.write(instruction); + // }, REFRESH_INTERVAL); + + // When all phases for all parameters are complete, clear refresh interval, send "off" instruction, resolve this promise + // return Promise.all(phasePromises).then(() => { + // clearInterval(refreshInterval); + // let off: ControllerInstructions = {}; + // if(!!this.controlSystems){ + // for (const parameter of Object.keys(this.targets)) { + // off[this.controlSystems[parameter].actuator] = 0; + // } + // } + // this.controller.write(off); + // }); + } + + /** + * Start the schedule for a single parameter. Runs recursively until all phases are executed. Sets targets. + * @param schedule Environment schedule + * @param parameter Parameter to start + * @param n Phase to start at + */ + private startPhase( + schedule: EnvironmentSchedule, + parameter: string, + n: number = 0 + ): Promise { + return new Promise(res => { + // Break once we've reached the end + if (n >= schedule.parameters[parameter].length) { + res(); + return; + } + + const phase = schedule.parameters[parameter][n]; + + let timeouts: NodeJS.Timeout[] = []; + let intervals: NodeJS.Timer[] = []; + + // Extract all targets + switch (phase.type) { + case 'piecewise': + // Trigger each piecewise expression at its timestamp + for (const value of phase.values) { + let t = setTimeout(() => { + // Assign value + this.targets[parameter] = value.value; + // Remove this timeout if/when it self-clears + timeouts.splice( + timeouts.findIndex(v => v == t), + 1 + ); + }, value.timestamp - (Date.now() - this.startTime)); + timeouts.push(t); + } + break; + case 'periodic': + // Retrigger each value at a fixed period, with duration offset + let durationSum = 0; + phase.values.forEach((value, i) => { + // Await duration offset + let t = setTimeout( + () => { + // Start the interval + intervals.push( + setInterval(() => { + // Assign value + this.targets[parameter] = value.value; + }, phase.period) + ); + // Remove this timeout if/when it self-clears + timeouts.splice( + timeouts.findIndex(v => v == t), + 1 + ); + // First expression? Trigger now. + // Else: Timeout for the sum of all previous expressions' durations, minus the elapsed time in this phase + }, + i > 0 + ? durationSum - + (Date.now() - + (n > 0 ? schedule.parameters[parameter][n - 1].end : this.startTime)) + : 0 + ); + durationSum += value.duration; + timeouts.push(t); + }); + break; + } + + // End this phase once Date.now() - startTime > end, and start the next phase, waiting for its completion + setTimeout(() => { + // Clear all outstanding timeouts and intervals + for (const interval of intervals) { + clearInterval(interval); + } + for (const timeout of timeouts) { + clearTimeout(timeout); + } + this.startPhase(schedule, parameter, n + 1).then(() => { + res(); + }); + }, phase.end - (Date.now() - this.startTime)); + }); + } +} diff --git a/software/archive/src/publisher.ts b/software/archive/src/publisher.ts new file mode 100644 index 00000000..9e1d7259 --- /dev/null +++ b/software/archive/src/publisher.ts @@ -0,0 +1,421 @@ +import * as fs from 'fs'; +import { v4 as uuid } from 'uuid'; +import * as jwt from 'jsonwebtoken'; +import * as mqtt from 'mqtt'; +import * as inquirer from 'inquirer'; +import chalk from 'chalk'; +import { existsSync, mkdirSync, writeFileSync } from 'fs'; + +import { getApp } from 'firebase/app'; +import { getFunctions, httpsCallable } from 'firebase/functions'; +import { + getFirestore, + doc, + setDoc, + collection, + getDocs, + query, + where, + DocumentReference +} from 'firebase/firestore'; +import { getAuth } from 'firebase/auth'; + +import { DeviceFlowUI, DeviceFlowUIOptions } from '@peapodtech/firebasedeviceflow'; +import { Spinner } from './ui'; +import { fetchServerCert } from './utils'; +import { ControllerInstructions } from './controller'; +import { EnvironmentSchedule } from './peapod'; + +// TYPES + +/** + * A single datapoint. + */ +type DataPoint = { + timestamp: number; + value: number; +}; + +/** + * Batch of datapoints to be published, organized by dataset label + */ +export type DataBatch = { + [key: string]: DataPoint[]; +}; + +/** + * Set of datapoints for display + */ +export type DataSet = { + [key: string]: number; +}; + +/** + * Message TO the publisher. + */ +export type PubSubMessage = + | { + type: 'info' | 'debug' | 'error'; + data: any; + } + | { + type: 'data'; + metadata: { + owner: string; + project: string; + run: string; + }; + data: DataBatch; + }; + +/** + * Message FROM the publisher (command). + */ +export type PubSubCommand = { + type: 'instructions'; + data: ControllerInstructions; +}; + +/** + * Message FROM the publisher (config). + */ +export type PubSubConfig = { + type: 'schedule'; + data: EnvironmentSchedule; +}; + +/** + * Types of publishers. + */ +export enum PublishingMode { + ONLINE = 'Online', + OFFLINE = 'Offline' +} + +/** + * Response from the device registration cloud function. + */ +type RegisterResponse = { + id: string; + name: string; + privateKey: string; +}; + +/** + * GCP IoT Core configuration parameters. + */ +export type IoTConfig = { + deviceid?: string; + projectid: string; + cloudregion: string; + registryid: string; + jwtexpiryminutes: number; +}; + +/** + * Base type for any publisher. + */ +export type Publisher = { + start( + onConfig: (message: PubSubConfig) => void, + onCommand: (message: PubSubCommand) => void + ): Promise<{ projectid: string; projectname?: string; run: string }>; + stop(): void; + publish(msg: PubSubMessage): void; +}; + +// MAIN CLASS + +/** + * Interface for publishing data to and receiving instructions from Google Cloud/Firebase via IoT Core PubSub. + */ +export default class PubSubPublisher implements Publisher { + private tokenRefreshInterval?: NodeJS.Timer; + private mqttclient?: mqtt.MqttClient; + private deviceid!: string; + + constructor(readonly iotConfig: IoTConfig, readonly authConfig: DeviceFlowUIOptions) {} + + publish(msg: PubSubMessage): void { + if (!this.mqttclient || !this.mqttclient.connected) { + throw new Error('MQTT client not connected!'); + } + + // Build topic path + const topic = + `/devices/${this.deviceid}/` + + (msg.type === 'data' ? 'events/data' : msg.type === 'info' ? 'events' : 'state'); + + // Strip type from published object + this.mqttclient.publish(topic, JSON.stringify({ ...msg, type: undefined }), { qos: 1 }); + } + + async start( + onConfig: (message: PubSubConfig) => void, + onCommand: (message: PubSubCommand) => void + ) { + // AUTHENTICATION - FIREBASE DEVICE FLOW + const auth = new DeviceFlowUI(getApp(), this.authConfig); + const user = await auth.signIn(); + if (user.displayName) { + Spinner.info(`Welcome, ${chalk.bold(user.displayName)}!`); + } else { + Spinner.info('Welcome!'); + } + + // GET DEVICE INFO OR REGISTER + const { privatekey, deviceid } = await this.getDeviceInfoOrRegister(user.uid); + this.deviceid = deviceid; + + // CHOOSE PROJECT, RUN, PROGRAM + // TODO: choose program + const [project, projectname] = await this.selectProject(); + const run = await this.createRun(project); + + // SETUP MQTT + Spinner.start('Fetching Google root CA certificates...'); + const servercert = await fetchServerCert(); + Spinner.succeed('Certificates fetched!'); + + Spinner.start('Connecting to MQTT broker...'); + await this.connect(servercert, this.refreshToken(privatekey)); + Spinner.succeed('Device connected!'); + + // Token Refresh + this.tokenRefreshInterval = setInterval(async () => { + Spinner.start('Refreshing token...'); + await this.connect(servercert, this.refreshToken(privatekey)); + Spinner.succeed('Token refreshed. Reconnected.'); + }, this.iotConfig.jwtexpiryminutes * 60 * 1000); + + // Message listeners + this.mqttclient?.subscribe(`/devices/${this.deviceid}/config`, { qos: 1 }); + this.mqttclient?.subscribe(`/devices/${this.deviceid}/commands/#`, { qos: 0 }); + + this.mqttclient?.on('error', err => { + throw err; + }); + this.mqttclient?.on('message', (topic, message) => { + if (topic === `/devices/${this.deviceid}/config`) { + try { + const config: PubSubConfig = JSON.parse(message.toString()); + onConfig(config); + } catch (e) { + if (e instanceof SyntaxError) { + // TODO: handle invalid config + } + } + } else if (topic.startsWith(`/devices/${this.deviceid}/commands`)) { + try { + const command: PubSubCommand = JSON.parse(message.toString()); + onCommand(command); + } catch (e) { + if (e instanceof SyntaxError) { + // TODO: handle invalid command + } + } + } + }); + + return { projectid: project.id, projectname, run: run.id }; + } + + /** + * Select a project owned by the current user + * @returns A tuple containing both the document reference and the project name (if any) + */ + private async selectProject(): Promise<[DocumentReference, string]> { + const myProjects = query( + collection(getFirestore(), 'projects'), + where('owners', 'array-contains', getAuth().currentUser?.uid) + ); + const projects = (await getDocs(myProjects)).docs; + if (projects.length < 1) { + throw new Error('No projects found! Create one first.'); + } + const ref = ( + await inquirer.prompt<{ ref: [DocumentReference, string] }>([ + { + type: 'list', + name: 'ref', + message: 'Select a project:', + choices: projects.map(project => ({ + name: project.get('name') + ' - ' + project.id, + value: [project.ref, project.get('name')] + })) + } + ]) + ).ref; + return ref; + } + + /** + * Publish a new project. + * @param project Document reference to the project + * @returns Documetn reference to the new run + */ + private async createRun(project: DocumentReference): Promise { + const runid = project.id + '-' + uuid(); + const rundoc = doc(getFirestore(), project.path + '/runs/' + runid); + setDoc(rundoc, { + owner: getAuth().currentUser?.uid, + deviceId: this.deviceid + }); + return rundoc; + } + + /** + * Look for the private key and device info in local files. If not found, register the device and store the new key and info. + * @param user The UID of the user to whom this device is to be registered. + * @returns The private key and device ID. + */ + private async getDeviceInfoOrRegister( + user: string + ): Promise<{ privatekey: string; deviceid: string }> { + if (fs.existsSync('./rsa_private.pem') && fs.existsSync('./deviceInfo.json')) { + Spinner.succeed('Private key and device info found!'); + const privatekey = fs.readFileSync('./rsa_private.pem').toString(); + + let deviceinfo: { id: string; owner: string } = JSON.parse( + fs.readFileSync('./deviceInfo.json').toString() + ); + + if (deviceinfo['owner'] != user) { + throw new Error('This PeaPod is not owned by this user!'); + } + return { privatekey, deviceid: deviceinfo.id }; + } else { + Spinner.info('Private key and/or device info not found!'); + + Spinner.start('Registering device...'); + const registerDevice = httpsCallable( + getFunctions(), + 'registerDevice' + ); + let result = (await registerDevice()).data; + Spinner.succeed('Device ' + result.id + ' registered!'); + + fs.writeFileSync('./rsa_private.pem', result.privateKey); + fs.writeFileSync( + './deviceInfo.json', + JSON.stringify( + { name: result.name, id: result.id, owner: getAuth().currentUser?.uid }, + null, + 2 + ) + ); + + return { privatekey: result.privateKey, deviceid: result.id }; + } + } + + /** + * Sign a new JWT. + * @returns JSON Web Token string payload. + */ + private refreshToken(privatekey: string): string { + const now = Date.now() / 1000; + const token = { + iat: now, + exp: now + this.iotConfig.jwtexpiryminutes * 60, + aud: this.iotConfig.projectid + }; + return jwt.sign(token, privatekey, { algorithm: 'RS256' }); + } + + /** + * Connect to the MQTT broker. + * @param servercert Root CA certificate. + * @param password JWT + */ + private async connect(servercert: string, password: string): Promise { + // Disconnect existing client + this.disconnect(); + + let client = mqtt.connect({ + host: 'mqtt.googleapis.com', + port: 8883, + clientId: `projects/${this.iotConfig.projectid}/locations/${this.iotConfig.cloudregion}/registries/${this.iotConfig.registryid}/devices/${this.deviceid}`, + username: 'unused', + password, + protocol: 'mqtts', + // secureProtocol: 'TLSv1_2_method', + ca: [servercert] + }); + + return new Promise(res => { + client.on('connect', packet => { + if (!packet) { + throw new Error('Could not connect to MQTT broker!'); + } + this.mqttclient = client; + res(); + }); + }); + } + + /** + * If the MQTT client is connected, disconnect it. + */ + private async disconnect(): Promise { + if (this.mqttclient && this.mqttclient.connected) { + await new Promise(res => { + this.mqttclient?.end(true, undefined, err => { + if (err) { + throw err; + } else { + res(); + } + }); + }); + } + } + + stop() { + if (this.tokenRefreshInterval) clearInterval(this.tokenRefreshInterval); + if (this.mqttclient) this.disconnect(); + } +} + +/** + * Publishes data batches to local JSON files. + */ +export class OfflinePublisher implements Publisher { + async start( + onConfig: (message: PubSubConfig) => void, + onCommand: (message: PubSubCommand) => void + ) { + let config = { projectid: 'testproject', run: 'testrun-' + uuid() }; + Spinner.info( + `Logging data to ${chalk.bold('projects/' + config.projectid + '/runs/' + config.run + '/')}` + ); + return config; + } + stop() {} + publish(msg: PubSubMessage): void { + switch (msg.type) { + case 'data': + for (const label of Object.keys(msg.data)) { + for (const datum of msg.data[label]) { + console.log( + `[${chalk.magenta(msg.type.toUpperCase())}] - [${new Date( + datum.timestamp + ).toLocaleTimeString()}] - ${label}: ${datum.value}` + ); + } + const dir = `./projects/${msg.metadata.project}/runs/${msg.metadata.run}/${label}/`; + if (!existsSync(dir)) { + mkdirSync(dir, { recursive: true }); + } + writeFileSync( + `${dir}${label + '-' + uuid() + '.json'}`, + JSON.stringify(msg.data[label], null, 2) + ); + } + break; + default: + Spinner.log(`[${chalk.yellow(msg.type.toUpperCase())}] - ${JSON.stringify(msg.data)}`); + break; + } + } +} diff --git a/software/archive/src/ui.ts b/software/archive/src/ui.ts new file mode 100644 index 00000000..5a8d3e7d --- /dev/null +++ b/software/archive/src/ui.ts @@ -0,0 +1,157 @@ +import ora from 'ora'; +import * as blessed from 'blessed'; +import { DataSet } from './publisher'; + +const DEFAULT_SPINNER: ora.Spinner = { + interval: 50, + frames: [ + '▁▁▁▁▁▁▁▁▁▁▁', + '█▁▁▁▁▁▁▁▁▁▁', + '██▁▁▁▁▁▁▁▁▁', + '███▁▁▁▁▁▁▁▁', + '████▁▁▁▁▁▁▁', + '█████▁▁▁▁▁▁', + '▁█████▁▁▁▁▁', + '▁▁█████▁▁▁▁', + '▁▁▁█████▁▁▁', + '▁▁▁▁█████▁▁', + '▁▁▁▁▁█████▁', + '▁▁▁▁▁▁█████', + '▁▁▁▁▁▁▁████', + '▁▁▁▁▁▁▁▁███', + '▁▁▁▁▁▁▁▁▁██', + '▁▁▁▁▁▁▁▁▁▁█' + ] +}; + +/** + * Global spinner object. + */ +let spinner: ora.Ora = ora(); + +export namespace Spinner { + /** + * Start the loading spinner. + * @param text Text to display. + * @param spinner Spinner to use. Defaults to the default spinner. + */ + export function start(text: string = '') { + // If it's already spinning, just change the text + if (spinner.isSpinning) { + spinner.text = text; + } else { + // Otherwise, start a new one + spinner = ora({ text, spinner: DEFAULT_SPINNER }).start(); + } + } + + /** + * Fail the loading spinner. + * @param text Text to display. + */ + export function fail(text: string = '') { + // If it's spinning, change the text and fail + if (spinner.isSpinning) { + spinner.fail(text); + } else { + // Otherwise, start a new one and fail it + spinner = ora({ text }).fail(); + } + } + + /** + * Succeed the loading spinner. + * @param text Text to display. + */ + export function succeed(text: string = '') { + // If it's spinning, change the text and succeed + if (spinner.isSpinning) { + spinner.succeed(text); + } else { + // Otherwise, start a new one and succeed it + spinner = ora({ text }).succeed(); + } + } + + /** + * Complete the loading spinner with info (blue `i`) + * @param text Text to display. + */ + export function info(text: string = '') { + if (spinner.isSpinning) { + // If it's spinning, change the text and set to info + spinner.info(text); + } else { + // Otherwise, start a new one and info it + spinner = ora({ text }).info(); + } + } + + /** + * If spinning: stop and clear the current spinner, log some text, then restart the spinner + * Else: Just log + * + * @param text Text to log + */ + export function log(text: string) { + let oldtext = spinner.text; + if (spinner.isSpinning) { + spinner.stop(); + console.log(text); + spinner.start(oldtext); + } else { + console.log(text); + } + } +} + +// Create a screen object. +let screen = blessed.screen({ + smartCSR: true +}); + +let box = blessed.box({ + top: 'top', + left: 'left', + width: '50%', + height: '50%', + border: { + type: 'line' + }, + style: { + fg: 'white', + bg: 'black', + border: { + fg: '#ffffff' + } + }, + align: 'left' +}); + +screen.append(box); + +export namespace Screen { + export function render() { + box.focus(); + screen.render(); + } + export function hide() { + box.hide(); + } + export function setData(data: DataSet) { + let s = 'PeaPod\n'; + s += Object.entries(data) + .map(datapoint => { + return ( + datapoint[0] + .split('-') + .map(word => word.slice(0, 1).toUpperCase() + word.slice(1).toLowerCase()) + .join(' ') + + ': ' + + datapoint[1].toFixed(2) + ); + }) + .join('\n'); + box.setContent(s); + } +} diff --git a/software/archive/src/utils.ts b/software/archive/src/utils.ts new file mode 100644 index 00000000..b87c08ff --- /dev/null +++ b/software/archive/src/utils.ts @@ -0,0 +1,131 @@ +import * as dns from 'dns'; +import { existsSync, mkdirSync, writeFileSync, readFileSync } from 'fs'; +import axios from 'axios'; +import { spawn } from 'child_process'; + +const PATHSTEM_IMAGES = '~/img/'; + +const dateFormat = (d: Date) => (`${d.getFullYear()}-${d.getMonth()+1}-${d.getDate()}_${d.getHours()}-${d.getMinutes()}-${d.getSeconds()}`); + +/** + * Checks the internet connectivity. + * @param timeout Timeout in milliseconds. Default: 5000 + * @param url The URL to ping. Default: 'www.google.com' + */ +export function checkInternet( + timeout: number = 5000, + url: string = 'www.google.com' +): Promise { + const resolver = new dns.Resolver({ timeout }); + return new Promise(ret => { + resolver.resolve(url, err => { + if (err) { + ret(false); + } else { + ret(true); + } + }); + }); +} + +/** + * Sleep a given number of milliseconds. + * + * Usage: `await sleep(x)` + * @param millis Number of milliseconds to sleep. + * @returns + */ +export function sleep(millis: number): Promise { + return new Promise(resolve => { + setTimeout(resolve, millis); + }); +} + +/** + * Fetch the Google Root CA certificate. + * @returns The very same certificate. + */ +export async function fetchServerCert(): Promise { + return String((await axios.get('https://pki.goog/roots.pem')).data); +} + +/** + * Compiles the microcontroller software, and flashes the binary to the chip. + */ +export function updateMicrocontroller(): Promise { + return new Promise((res, rej) => { + // Create log folder + if (!existsSync('logs/')) { + mkdirSync('logs/', { recursive: true }); + } + execute( + `${process.env.HOME}/.platformio/penv/bin/platformio run -d microcontroller/ -e peapod -t upload`, + [1] + ) + .catch(err => { + writeFileSync('logs/updateMicrocontroller.log', err); + rej( + new Error( + `Failed to update the microcontroller software. See logs/updateMicrocontroller.log` + ) + ); + }) + .then(log1 => { + if (log1) writeFileSync('logs/updateMicrocontroller.log', log1); + res(); + }); + }); +} + +/** + * General purpose command execution and logging. No `sudo` support. + */ +export function execute(command: string, failureCodes: number[] = []): Promise { + return new Promise((res, rej) => { + const args = command.split(' '); + const eprocess = spawn(args[0], args.slice(1)); + let log = '> ' + command + '\n'; + eprocess.stdout?.on('data', out => { + log += out; + }); + eprocess.stderr?.on('data', out => { + log += out; + }); + eprocess.on('error', error => { + log += error.message; + rej(log); + eprocess.kill(); + }); + eprocess.on('close', code => { + if (code) { + log += '> Process exited with code ' + code; + if (failureCodes.includes(code)) { + rej(log); + } + return; + } + // If no options, no codes, OR non-failure: + res(log); + }); + }); +} + +type CameraCaptureOptions = { + width?: number; + height?: number; + // TODO: Add more options +}; + +// Returns a path to the JPEG image. +export function cameraCapture(options?: CameraCaptureOptions): Promise { + return new Promise((res, rej) => { + const p = `${PATHSTEM_IMAGES}-${dateFormat(new Date())}`; + execute(`libcamera-jpeg -o ${p}.jpg`) + .catch(err => { + rej(err); + }) + .then(() => { + res(`${p}.jpg`); + }); + }); +} \ No newline at end of file diff --git a/software/assets/control_flow.png b/software/assets/control_flow.png index c15312e5..2592d5fb 100644 Binary files a/software/assets/control_flow.png and b/software/assets/control_flow.png differ diff --git a/software/assets/program_schema.json b/software/assets/program_schema.json deleted file mode 100644 index 34b1bb4f..00000000 --- a/software/assets/program_schema.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "id": "{projectid}-program-{uuid}", - "description": "A short description of the program, including parameter values, duration, etc.", - "revision": 0, - // Metadata - "parameters": { - "{parametername}": { - // Metadata - "values": [ - { - "timestamp": 102375613, - "value": 23.4 - }, - // More values... - ] - } - // Other parameters... - } -} \ No newline at end of file diff --git a/software/assets/schedule_schema.json b/software/assets/schedule_schema.json new file mode 100644 index 00000000..95dec732 --- /dev/null +++ b/software/assets/schedule_schema.json @@ -0,0 +1,43 @@ +// All timestamps in ms since program start +// All durations in ms +{ + "id": "{projectid}-program-{uuid}", + "name": "A short description of the program, including parameter values, duration, etc.", + "revision": 0, //Software revision + "parameters": { + "{parametername}": [ // Schedule is loaded in phase by phase + { + "type": "piecewise", // Step through values until end + "end": 10000, + "values": [ + { + "value": 23.4, + "timestamp": 0 + }, + { + "value": 24.6, + "timestamp": 123456 + }, + // More values... + ] + }, + { + "type": "periodic", // Step through values until end + "period": 10000, + "end": 1234567, + "values": [ + { + "value": 23.4, + "duration": 1000 + }, + { + "value": 24.6, + "duration": 1000 + }, + // More values... + ] + } + // More phases... + ] + } +} \ No newline at end of file diff --git a/software/docker-compose.dev.yml b/software/docker-compose.dev.yml new file mode 100644 index 00000000..39091ca9 --- /dev/null +++ b/software/docker-compose.dev.yml @@ -0,0 +1,32 @@ +services: + peapodos: + build: + context: . + dockerfile: Dockerfile.local + environment: + - NODE_ENV=development + - PORT=3000 + restart: always + networks: + - network + stdin_open: true + tty: true + privileged: true + # command: ["yarn", "dev"] + + nginx: + image: nginx:latest + ports: + - "80:80" + volumes: + - ./nginx.conf:/etc/nginx/nginx.conf:ro + - ./public:/usr/share/nginx/html + depends_on: + - peapodos + restart: always + networks: + - network + +networks: + network: + driver: bridge \ No newline at end of file diff --git a/software/docker-compose.yml b/software/docker-compose.yml new file mode 100644 index 00000000..42136c22 --- /dev/null +++ b/software/docker-compose.yml @@ -0,0 +1,32 @@ +services: + peapodos: + build: + context: . + dockerfile: Dockerfile.local + environment: + - NODE_ENV=production + - PORT=3000 + restart: always + networks: + - network + stdin_open: true + tty: true + privileged: true + # command: ["yarn", "start"] + + nginx: + image: nginx:latest + ports: + - "80:80" + volumes: + - ./nginx.conf:/etc/nginx/nginx.conf:ro + - ./public:/usr/share/nginx/html + depends_on: + - peapodos + restart: always + networks: + - network + +networks: + network: + driver: bridge \ No newline at end of file diff --git a/software/eslint.config.mjs b/software/eslint.config.mjs new file mode 100644 index 00000000..6622e8f4 --- /dev/null +++ b/software/eslint.config.mjs @@ -0,0 +1,45 @@ +import globals from 'globals'; + +import { FlatCompat } from '@eslint/eslintrc'; +import typescriptEslint from '@typescript-eslint/eslint-plugin'; + + +const compat = new FlatCompat({ + // import.meta.dirname is available after Node.js v20.11.0 + baseDirectory: import.meta.dirname, + recommendedConfig: typescriptEslint.configs['recommended'], +}); + +console.log('Using eslint.config.mjs'); + +var eslintConfig = compat.config({ + extends: ['prettier', 'next', 'next/typescript'], + plugins: ['@typescript-eslint', 'react'], +}); + +eslintConfig.push({ files: [ + './*.{js,mjs,cjs,ts,jsx,tsx}', + './api/*.{js,mjs,cjs,ts,jsx,tsx}', + './api/**/*.{js,mjs,cjs,ts,jsx,tsx}', + './src/*.{js,mjs,cjs,ts,jsx,tsx}', + './src/**/*.{js,mjs,cjs,ts,jsx,tsx}' +]}) + +eslintConfig.push({ignores: ['node_modules', '.next', 'out', 'dist', 'build', 'coverage', 'public', 'lib']}); + +eslintConfig.push({ + languageOptions: { + globals: {...globals.browser, ...globals.node } + }, + // linterOptions: { parserOptions: { projectService: true, tsconfigRootDir: import.meta.dirname}}, + rules: { + indent: ['error', 2], + 'linebreak-style': ['error', 'unix'], + quotes: ['error', 'single'], + semi: ['error', 'always'], + 'react/react-in-jsx-scope': 'off' + } +}); + +/** @type {import('eslint').Linter.Config[]} */ +export default eslintConfig; \ No newline at end of file diff --git a/software/firebase.json b/software/firebase.json new file mode 100644 index 00000000..9279f0f5 --- /dev/null +++ b/software/firebase.json @@ -0,0 +1,26 @@ +{ + "firestore": { + "database": "(default)", + "location": "nam5", + "rules": "firestore.rules", + "indexes": "firestore.indexes.json" + }, + "functions": [ + { + "source": "functions", + "codebase": "default", + "disallowLegacyRuntimeConfig": true, + "ignore": [ + "node_modules", + ".git", + "firebase-debug.log", + "firebase-debug.*.log", + "*.local" + ], + "predeploy": [ + "npm --prefix \"$RESOURCE_DIR\" run lint", + "npm --prefix \"$RESOURCE_DIR\" run build" + ] + } + ] +} diff --git a/software/firestore.indexes.json b/software/firestore.indexes.json new file mode 100644 index 00000000..2ddb5ce9 --- /dev/null +++ b/software/firestore.indexes.json @@ -0,0 +1,4 @@ +{ + "indexes": [], + "fieldOverrides": [] +} \ No newline at end of file diff --git a/software/firestore.rules b/software/firestore.rules new file mode 100644 index 00000000..6c4af405 --- /dev/null +++ b/software/firestore.rules @@ -0,0 +1,26 @@ +rules_version = '2'; +service cloud.firestore { + match /databases/{database}/documents { + match /projects/{projectId} { + allow read, write: if request.auth.uid in resource.data.owners; + } + match /projects/{projectId}/runs/{runId} { + allow read, write: if resource.data.owner == request.auth.uid; + } + match /projects/{projectId}/{subdoc=**} { + allow read, write: if request.auth.uid in get(/databases/$(database)/documents/projects/$(projectId)).data.owners; + } + match /users/{userId} { + allow read: if request.auth.uid == userId; + allow write: if false; //Cloud Functions only + } + match /users/{userId}/{subdoc=**} { + allow read: if request.auth.uid == userId; + allow write: if false; //Cloud Functions only + } + match /devices/{deviceId=**} { + allow read: if resource.data.owner == request.auth.uid; + allow write: if false; //Cloud Functions only + } + } +} \ No newline at end of file diff --git a/software/functions/.gitignore b/software/functions/.gitignore new file mode 100644 index 00000000..9be0f014 --- /dev/null +++ b/software/functions/.gitignore @@ -0,0 +1,10 @@ +# Compiled JavaScript files +lib/**/*.js +lib/**/*.js.map + +# TypeScript v1 declaration files +typings/ + +# Node.js dependency directory +node_modules/ +*.local \ No newline at end of file diff --git a/software/functions/package-lock.json b/software/functions/package-lock.json new file mode 100644 index 00000000..7f623665 --- /dev/null +++ b/software/functions/package-lock.json @@ -0,0 +1,9901 @@ +{ + "name": "functions", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "functions", + "dependencies": { + "firebase-admin": "^13.6.0", + "firebase-functions": "^7.0.0" + }, + "devDependencies": { + "@typescript-eslint/eslint-plugin": "^5.12.0", + "@typescript-eslint/parser": "^5.12.0", + "eslint": "^8.9.0", + "eslint-config-google": "^0.14.0", + "eslint-plugin-import": "^2.25.4", + "firebase-functions-test": "^3.4.1", + "typescript": "^5.7.3" + }, + "engines": { + "node": "24" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.27.1", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.28.5.tgz", + "integrity": "sha512-6uFXyCayocRbqhZOB+6XcuZbkMNimwfVGFji8CTZnCzOHVGvDqzvitu1re2AU5LROliz7eQPhB8CpAMvnx9EjA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.28.5.tgz", + "integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.28.5", + "@babel/helper-compilation-targets": "^7.27.2", + "@babel/helper-module-transforms": "^7.28.3", + "@babel/helpers": "^7.28.4", + "@babel/parser": "^7.28.5", + "@babel/template": "^7.27.2", + "@babel/traverse": "^7.28.5", + "@babel/types": "^7.28.5", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "peer": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/generator": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.28.5.tgz", + "integrity": "sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/parser": "^7.28.5", + "@babel/types": "^7.28.5", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz", + "integrity": "sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/compat-data": "^7.27.2", + "@babel/helper-validator-option": "^7.27.1", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "peer": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", + "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz", + "integrity": "sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.28.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.3.tgz", + "integrity": "sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-module-imports": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1", + "@babel/traverse": "^7.28.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.27.1.tgz", + "integrity": "sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", + "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.4.tgz", + "integrity": "sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/template": "^7.27.2", + "@babel/types": "^7.28.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.5.tgz", + "integrity": "sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/types": "^7.28.5" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", + "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-static-block": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", + "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-attributes": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.27.1.tgz", + "integrity": "sha512-oFT0FrKHgF53f4vOsZGi2Hh3I35PfSmVs4IBFLFj4dnafP+hIWDLg3VyKmUHfLoLHlyxY4C7DGtmHuJgn+IGww==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.27.1.tgz", + "integrity": "sha512-y8YTNIeKoyhGd9O0Jiyzyyqk8gdjnumGTQPsz0xOZOQ2RmkVJeZ1vmmfIvFEKqucBG6axJGBZDE/7iI5suUI/w==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", + "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.27.1.tgz", + "integrity": "sha512-xfYCBMxveHrRMnAWl1ZlPXOZjzkN82THFvLhQhFXFt81Z5HnN+EtUkZhv/zcKpmT3fzmWZB0ywiBrbC3vogbwQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/template": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz", + "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/parser": "^7.27.2", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.28.5.tgz", + "integrity": "sha512-TCCj4t55U90khlYkVV/0TfkJkAkUg3jZFA3Neb7unZT8CPok7iiRfaX0F+WnqWqt7OxhOn0uBKXCw4lbL8W0aQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.28.5", + "@babel/helper-globals": "^7.28.0", + "@babel/parser": "^7.28.5", + "@babel/template": "^7.27.2", + "@babel/types": "^7.28.5", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.5.tgz", + "integrity": "sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.28.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@emnapi/core": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.7.1.tgz", + "integrity": "sha512-o1uhUASyo921r2XtHYOHy7gdkGLge8ghBEQHMWmyJFoXlpU58kIrhhN3w26lpQb6dspetweapMn2CSNwQ8I4wg==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "@emnapi/wasi-threads": "1.1.0", + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.7.1.tgz", + "integrity": "sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/wasi-threads": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.1.0.tgz", + "integrity": "sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", + "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/js": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@fastify/busboy": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-3.2.0.tgz", + "integrity": "sha512-m9FVDXU3GT2ITSe0UaMA5rU3QkfC/UXtCU8y0gSN/GugTqtVldOBWIB5V6V3sbmenVZUIpU6f+mPEO2+m5iTaA==", + "license": "MIT" + }, + "node_modules/@firebase/app-check-interop-types": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@firebase/app-check-interop-types/-/app-check-interop-types-0.3.3.tgz", + "integrity": "sha512-gAlxfPLT2j8bTI/qfe3ahl2I2YcBQ8cFIBdhAQA4I2f3TndcO+22YizyGYuttLHPQEpWkhmpFW60VCFEPg4g5A==", + "license": "Apache-2.0" + }, + "node_modules/@firebase/app-types": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.9.3.tgz", + "integrity": "sha512-kRVpIl4vVGJ4baogMDINbyrIOtOxqhkZQg4jTq3l8Lw6WSk0xfpEYzezFu+Kl4ve4fbPl79dvwRtaFqAC/ucCw==", + "license": "Apache-2.0" + }, + "node_modules/@firebase/auth-interop-types": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/@firebase/auth-interop-types/-/auth-interop-types-0.2.4.tgz", + "integrity": "sha512-JPgcXKCuO+CWqGDnigBtvo09HeBs5u/Ktc2GaFj2m01hLarbxthLNm7Fk8iOP1aqAtXV+fnnGj7U28xmk7IwVA==", + "license": "Apache-2.0" + }, + "node_modules/@firebase/component": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@firebase/component/-/component-0.7.0.tgz", + "integrity": "sha512-wR9En2A+WESUHexjmRHkqtaVH94WLNKt6rmeqZhSLBybg4Wyf0Umk04SZsS6sBq4102ZsDBFwoqMqJYj2IoDSg==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/util": "1.13.0", + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@firebase/database": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@firebase/database/-/database-1.1.0.tgz", + "integrity": "sha512-gM6MJFae3pTyNLoc9VcJNuaUDej0ctdjn3cVtILo3D5lpp0dmUHHLFN/pUKe7ImyeB1KAvRlEYxvIHNF04Filg==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/app-check-interop-types": "0.3.3", + "@firebase/auth-interop-types": "0.2.4", + "@firebase/component": "0.7.0", + "@firebase/logger": "0.5.0", + "@firebase/util": "1.13.0", + "faye-websocket": "0.11.4", + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@firebase/database-compat": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@firebase/database-compat/-/database-compat-2.1.0.tgz", + "integrity": "sha512-8nYc43RqxScsePVd1qe1xxvWNf0OBnbwHxmXJ7MHSuuTVYFO3eLyLW3PiCKJ9fHnmIz4p4LbieXwz+qtr9PZDg==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.7.0", + "@firebase/database": "1.1.0", + "@firebase/database-types": "1.0.16", + "@firebase/logger": "0.5.0", + "@firebase/util": "1.13.0", + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@firebase/database-types": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/@firebase/database-types/-/database-types-1.0.16.tgz", + "integrity": "sha512-xkQLQfU5De7+SPhEGAXFBnDryUWhhlFXelEg2YeZOQMCdoe7dL64DDAd77SQsR+6uoXIZY5MB4y/inCs4GTfcw==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/app-types": "0.9.3", + "@firebase/util": "1.13.0" + } + }, + "node_modules/@firebase/logger": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@firebase/logger/-/logger-0.5.0.tgz", + "integrity": "sha512-cGskaAvkrnh42b3BA3doDWeBmuHFO/Mx5A83rbRDYakPjO9bJtRL3dX7javzc2Rr/JHZf4HlterTW2lUkfeN4g==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@firebase/util": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@firebase/util/-/util-1.13.0.tgz", + "integrity": "sha512-0AZUyYUfpMNcztR5l09izHwXkZpghLgCUaAGjtMwXnCg3bj4ml5VgiwqOMOxJ+Nw4qN/zJAaOQBcJ7KGkWStqQ==", + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@google-cloud/firestore": { + "version": "7.11.6", + "resolved": "https://registry.npmjs.org/@google-cloud/firestore/-/firestore-7.11.6.tgz", + "integrity": "sha512-EW/O8ktzwLfyWBOsNuhRoMi8lrC3clHM5LVFhGvO1HCsLozCOOXRAlHrYBoE6HL42Sc8yYMuCb2XqcnJ4OOEpw==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@opentelemetry/api": "^1.3.0", + "fast-deep-equal": "^3.1.1", + "functional-red-black-tree": "^1.0.1", + "google-gax": "^4.3.3", + "protobufjs": "^7.2.6" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@google-cloud/paginator": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@google-cloud/paginator/-/paginator-5.0.2.tgz", + "integrity": "sha512-DJS3s0OVH4zFDB1PzjxAsHqJT6sKVbRwwML0ZBP9PbU7Yebtu/7SWMRzvO2J3nUi9pRNITCfu4LJeooM2w4pjg==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "arrify": "^2.0.0", + "extend": "^3.0.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@google-cloud/projectify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@google-cloud/projectify/-/projectify-4.0.0.tgz", + "integrity": "sha512-MmaX6HeSvyPbWGwFq7mXdo0uQZLGBYCwziiLIGq5JVX+/bdI3SAq6bP98trV5eTWfLuvsMcIC1YJOF2vfteLFA==", + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@google-cloud/promisify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-4.0.0.tgz", + "integrity": "sha512-Orxzlfb9c67A15cq2JQEyVc7wEsmFBmHjZWZYQMUyJ1qivXyMwdyNOs9odi79hze+2zqdTtu1E19IM/FtqZ10g==", + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@google-cloud/storage": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-7.18.0.tgz", + "integrity": "sha512-r3ZwDMiz4nwW6R922Z1pwpePxyRwE5GdevYX63hRmAQUkUQJcBH/79EnQPDv5cOv1mFBgevdNWQfi3tie3dHrQ==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@google-cloud/paginator": "^5.0.0", + "@google-cloud/projectify": "^4.0.0", + "@google-cloud/promisify": "<4.1.0", + "abort-controller": "^3.0.0", + "async-retry": "^1.3.3", + "duplexify": "^4.1.3", + "fast-xml-parser": "^4.4.1", + "gaxios": "^6.0.2", + "google-auth-library": "^9.6.3", + "html-entities": "^2.5.2", + "mime": "^3.0.0", + "p-limit": "^3.0.1", + "retry-request": "^7.0.0", + "teeny-request": "^9.0.0", + "uuid": "^8.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@google-cloud/storage/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "license": "MIT", + "optional": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/@grpc/grpc-js": { + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.14.3.tgz", + "integrity": "sha512-Iq8QQQ/7X3Sac15oB6p0FmUg/klxQvXLeileoqrTRGJYLV+/9tubbr9ipz0GKHjmXVsgFPo/+W+2cA8eNcR+XA==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@grpc/proto-loader": "^0.8.0", + "@js-sdsl/ordered-map": "^4.4.2" + }, + "engines": { + "node": ">=12.10.0" + } + }, + "node_modules/@grpc/grpc-js/node_modules/@grpc/proto-loader": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.8.0.tgz", + "integrity": "sha512-rc1hOQtjIWGxcxpb9aHAfLpIctjEnsDehj0DAiVfBlmT84uvR0uUtN2hEi/ecvWVjXUGf5qPF4qEgiLOx1YIMQ==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "lodash.camelcase": "^4.3.0", + "long": "^5.0.0", + "protobufjs": "^7.5.3", + "yargs": "^17.7.2" + }, + "bin": { + "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@grpc/proto-loader": { + "version": "0.7.15", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.15.tgz", + "integrity": "sha512-tMXdRCfYVixjuFK+Hk0Q1s38gV9zDiDJfWL3h1rv4Qc39oILCu1TRTDt7+fGUI8K4G1Fj125Hx/ru3azECWTyQ==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "lodash.camelcase": "^4.3.0", + "long": "^5.0.0", + "protobufjs": "^7.2.5", + "yargs": "^17.7.2" + }, + "bin": { + "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", + "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", + "deprecated": "Use @eslint/config-array instead", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.3", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", + "deprecated": "Use @eslint/object-schema instead", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", + "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/console": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-30.2.0.tgz", + "integrity": "sha512-+O1ifRjkvYIkBqASKWgLxrpEhQAAE7hY77ALLUufSk5717KfOShg6IbqLmdsLMPdUiFvA2kTs0R7YZy+l0IzZQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/types": "30.2.0", + "@types/node": "*", + "chalk": "^4.1.2", + "jest-message-util": "30.2.0", + "jest-util": "30.2.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/core": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-30.2.0.tgz", + "integrity": "sha512-03W6IhuhjqTlpzh/ojut/pDB2LPRygyWX8ExpgHtQA8H/3K7+1vKmcINx5UzeOX1se6YEsBsOHQ1CRzf3fOwTQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/console": "30.2.0", + "@jest/pattern": "30.0.1", + "@jest/reporters": "30.2.0", + "@jest/test-result": "30.2.0", + "@jest/transform": "30.2.0", + "@jest/types": "30.2.0", + "@types/node": "*", + "ansi-escapes": "^4.3.2", + "chalk": "^4.1.2", + "ci-info": "^4.2.0", + "exit-x": "^0.2.2", + "graceful-fs": "^4.2.11", + "jest-changed-files": "30.2.0", + "jest-config": "30.2.0", + "jest-haste-map": "30.2.0", + "jest-message-util": "30.2.0", + "jest-regex-util": "30.0.1", + "jest-resolve": "30.2.0", + "jest-resolve-dependencies": "30.2.0", + "jest-runner": "30.2.0", + "jest-runtime": "30.2.0", + "jest-snapshot": "30.2.0", + "jest-util": "30.2.0", + "jest-validate": "30.2.0", + "jest-watcher": "30.2.0", + "micromatch": "^4.0.8", + "pretty-format": "30.2.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/diff-sequences": { + "version": "30.0.1", + "resolved": "https://registry.npmjs.org/@jest/diff-sequences/-/diff-sequences-30.0.1.tgz", + "integrity": "sha512-n5H8QLDJ47QqbCNn5SuFjCRDrOLEZ0h8vAHCK5RL9Ls7Xa8AQLa/YxAc9UjFqoEDM48muwtBGjtMY5cr0PLDCw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/environment": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-30.2.0.tgz", + "integrity": "sha512-/QPTL7OBJQ5ac09UDRa3EQes4gt1FTEG/8jZ/4v5IVzx+Cv7dLxlVIvfvSVRiiX2drWyXeBjkMSR8hvOWSog5g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/fake-timers": "30.2.0", + "@jest/types": "30.2.0", + "@types/node": "*", + "jest-mock": "30.2.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/expect": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-30.2.0.tgz", + "integrity": "sha512-V9yxQK5erfzx99Sf+7LbhBwNWEZ9eZay8qQ9+JSC0TrMR1pMDHLMY+BnVPacWU6Jamrh252/IKo4F1Xn/zfiqA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "expect": "30.2.0", + "jest-snapshot": "30.2.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/expect-utils": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-30.2.0.tgz", + "integrity": "sha512-1JnRfhqpD8HGpOmQp180Fo9Zt69zNtC+9lR+kT7NVL05tNXIi+QC8Csz7lfidMoVLPD3FnOtcmp0CEFnxExGEA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/get-type": "30.1.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/fake-timers": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-30.2.0.tgz", + "integrity": "sha512-HI3tRLjRxAbBy0VO8dqqm7Hb2mIa8d5bg/NJkyQcOk7V118ObQML8RC5luTF/Zsg4474a+gDvhce7eTnP4GhYw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/types": "30.2.0", + "@sinonjs/fake-timers": "^13.0.0", + "@types/node": "*", + "jest-message-util": "30.2.0", + "jest-mock": "30.2.0", + "jest-util": "30.2.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/get-type": { + "version": "30.1.0", + "resolved": "https://registry.npmjs.org/@jest/get-type/-/get-type-30.1.0.tgz", + "integrity": "sha512-eMbZE2hUnx1WV0pmURZY9XoXPkUYjpc55mb0CrhtdWLtzMQPFvu/rZkTLZFTsdaVQa+Tr4eWAteqcUzoawq/uA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/globals": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-30.2.0.tgz", + "integrity": "sha512-b63wmnKPaK+6ZZfpYhz9K61oybvbI1aMcIs80++JI1O1rR1vaxHUCNqo3ITu6NU0d4V34yZFoHMn/uoKr/Rwfw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/environment": "30.2.0", + "@jest/expect": "30.2.0", + "@jest/types": "30.2.0", + "jest-mock": "30.2.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/pattern": { + "version": "30.0.1", + "resolved": "https://registry.npmjs.org/@jest/pattern/-/pattern-30.0.1.tgz", + "integrity": "sha512-gWp7NfQW27LaBQz3TITS8L7ZCQ0TLvtmI//4OwlQRx4rnWxcPNIYjxZpDcN4+UlGxgm3jS5QPz8IPTCkb59wZA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/node": "*", + "jest-regex-util": "30.0.1" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/reporters": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-30.2.0.tgz", + "integrity": "sha512-DRyW6baWPqKMa9CzeiBjHwjd8XeAyco2Vt8XbcLFjiwCOEKOvy82GJ8QQnJE9ofsxCMPjH4MfH8fCWIHHDKpAQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "30.2.0", + "@jest/test-result": "30.2.0", + "@jest/transform": "30.2.0", + "@jest/types": "30.2.0", + "@jridgewell/trace-mapping": "^0.3.25", + "@types/node": "*", + "chalk": "^4.1.2", + "collect-v8-coverage": "^1.0.2", + "exit-x": "^0.2.2", + "glob": "^10.3.10", + "graceful-fs": "^4.2.11", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^6.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^5.0.0", + "istanbul-reports": "^3.1.3", + "jest-message-util": "30.2.0", + "jest-util": "30.2.0", + "jest-worker": "30.2.0", + "slash": "^3.0.0", + "string-length": "^4.0.2", + "v8-to-istanbul": "^9.0.1" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/schemas": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-30.0.5.tgz", + "integrity": "sha512-DmdYgtezMkh3cpU8/1uyXakv3tJRcmcXxBOcO0tbaozPwpmh4YMsnWrQm9ZmZMfa5ocbxzbFk6O4bDPEc/iAnA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@sinclair/typebox": "^0.34.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/snapshot-utils": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/@jest/snapshot-utils/-/snapshot-utils-30.2.0.tgz", + "integrity": "sha512-0aVxM3RH6DaiLcjj/b0KrIBZhSX1373Xci4l3cW5xiUWPctZ59zQ7jj4rqcJQ/Z8JuN/4wX3FpJSa3RssVvCug==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/types": "30.2.0", + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "natural-compare": "^1.4.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/source-map": { + "version": "30.0.1", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-30.0.1.tgz", + "integrity": "sha512-MIRWMUUR3sdbP36oyNyhbThLHyJ2eEDClPCiHVbrYAe5g3CHRArIVpBw7cdSB5fr+ofSfIb2Tnsw8iEHL0PYQg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.25", + "callsites": "^3.1.0", + "graceful-fs": "^4.2.11" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/test-result": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-30.2.0.tgz", + "integrity": "sha512-RF+Z+0CCHkARz5HT9mcQCBulb1wgCP3FBvl9VFokMX27acKphwyQsNuWH3c+ojd1LeWBLoTYoxF0zm6S/66mjg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/console": "30.2.0", + "@jest/types": "30.2.0", + "@types/istanbul-lib-coverage": "^2.0.6", + "collect-v8-coverage": "^1.0.2" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/test-sequencer": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-30.2.0.tgz", + "integrity": "sha512-wXKgU/lk8fKXMu/l5Hog1R61bL4q5GCdT6OJvdAFz1P+QrpoFuLU68eoKuVc4RbrTtNnTL5FByhWdLgOPSph+Q==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/test-result": "30.2.0", + "graceful-fs": "^4.2.11", + "jest-haste-map": "30.2.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/transform": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-30.2.0.tgz", + "integrity": "sha512-XsauDV82o5qXbhalKxD7p4TZYYdwcaEXC77PPD2HixEFF+6YGppjrAAQurTl2ECWcEomHBMMNS9AH3kcCFx8jA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/core": "^7.27.4", + "@jest/types": "30.2.0", + "@jridgewell/trace-mapping": "^0.3.25", + "babel-plugin-istanbul": "^7.0.1", + "chalk": "^4.1.2", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.11", + "jest-haste-map": "30.2.0", + "jest-regex-util": "30.0.1", + "jest-util": "30.2.0", + "micromatch": "^4.0.8", + "pirates": "^4.0.7", + "slash": "^3.0.0", + "write-file-atomic": "^5.0.1" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/types": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-30.2.0.tgz", + "integrity": "sha512-H9xg1/sfVvyfU7o3zMfBEjQ1gcsdeTMgqHoYdN79tuLqfTtuu7WckRA1R5whDwOzxaZAeMKTYWqP+WCAi0CHsg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/pattern": "30.0.1", + "@jest/schemas": "30.0.5", + "@types/istanbul-lib-coverage": "^2.0.6", + "@types/istanbul-reports": "^3.0.4", + "@types/node": "*", + "@types/yargs": "^17.0.33", + "chalk": "^4.1.2" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@js-sdsl/ordered-map": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz", + "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==", + "license": "MIT", + "optional": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "0.2.12", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.12.tgz", + "integrity": "sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "@emnapi/core": "^1.4.3", + "@emnapi/runtime": "^1.4.3", + "@tybys/wasm-util": "^0.10.0" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@opentelemetry/api": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", + "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==", + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@pkgr/core": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.2.9.tgz", + "integrity": "sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/pkgr" + } + }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", + "license": "BSD-3-Clause" + }, + "node_modules/@rtsao/scc": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", + "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@sinclair/typebox": { + "version": "0.34.45", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.45.tgz", + "integrity": "sha512-qJcFVfCa5jxBFSuv7S5WYbA8XdeCPmhnaVVfX/2Y6L8WYg8sk3XY2+6W0zH+3mq1Cz+YC7Ki66HfqX6IHAwnkg==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@sinonjs/commons": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-13.0.5.tgz", + "integrity": "sha512-36/hTbH2uaWuGVERyC6da9YwGWnzUZXuPro/F2LfsdOsLnCojz/iSH8MxUt/FD2S5XBSVPhmArFUXcpCQ2Hkiw==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@sinonjs/commons": "^3.0.1" + } + }, + "node_modules/@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tybys/wasm-util": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz", + "integrity": "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", + "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/types": "^7.28.2" + } + }, + "node_modules/@types/body-parser": { + "version": "1.19.6", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.6.tgz", + "integrity": "sha512-HLFeCYgz89uk22N5Qg3dvGvsv46B8GLvKKo1zKG4NybA8U2DiEO3w9lqGg29t/tfLRJpJ6iQxnVw4OnB7MoM9g==", + "license": "MIT", + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/caseless": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.5.tgz", + "integrity": "sha512-hWtVTC2q7hc7xZ/RLbxapMvDMgUnDvKvMOpKal4DrMyfGBUfB1oKaZlIRr6mJL+If3bAP6sV/QneGzF6tJjZDg==", + "license": "MIT", + "optional": true + }, + "node_modules/@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/cors": { + "version": "2.8.19", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.19.tgz", + "integrity": "sha512-mFNylyeyqN93lfe/9CSxOGREz8cpzAhH+E93xJ4xWQf62V8sQ/24reV2nyzUWM6H6Xji+GGHpkbLe7pVoUEskg==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/express": { + "version": "4.17.25", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.25.tgz", + "integrity": "sha512-dVd04UKsfpINUnK0yBoYHDF3xu7xVH4BuDotC/xGuycx4CgbP48X/KF/586bcObxT0HENHXEU8Nqtu6NR+eKhw==", + "license": "MIT", + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.33", + "@types/qs": "*", + "@types/serve-static": "^1" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "4.19.7", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.7.tgz", + "integrity": "sha512-FvPtiIf1LfhzsaIXhv/PHan/2FeQBbtBDtfX2QfvPxdUelMDEckK08SM6nqo1MIZY3RUlfA+HV8+hFUSio78qg==", + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "node_modules/@types/http-errors": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.5.tgz", + "integrity": "sha512-r8Tayk8HJnX0FztbZN7oVqGccWgw98T/0neJphO91KkmOzug1KkofZURD4UaD5uH8AqcFLfdPErnBod0u71/qg==", + "license": "MIT" + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", + "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", + "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/jsonwebtoken": { + "version": "9.0.10", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.10.tgz", + "integrity": "sha512-asx5hIG9Qmf/1oStypjanR7iKTv0gXQ1Ov/jfrX6kS/EO0OFni8orbmGCn0672NHR3kXHwpAwR+B368ZGN/2rA==", + "license": "MIT", + "dependencies": { + "@types/ms": "*", + "@types/node": "*" + } + }, + "node_modules/@types/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-FOvQ0YPD5NOfPgMzJihoT+Za5pdkDJWcbpuj1DjaKZIr/gxodQjY/uWEFlTNqW2ugXHUiL8lRQgw63dzKHZdeQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/long": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", + "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==", + "license": "MIT", + "optional": true + }, + "node_modules/@types/mime": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "license": "MIT" + }, + "node_modules/@types/ms": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", + "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "22.19.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.3.tgz", + "integrity": "sha512-1N9SBnWYOJTrNZCdh/yJE+t910Y128BoyY+zBLWhL3r0TYzlTmFdXrPwHL9DyFZmlEXNQQolTZh3KHV31QDhyA==", + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@types/qs": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-eOunJqu0K1923aExK6y8p6fsihYEn/BYuQ4g0CxAAgFc4b/ZLN4CrsRZ55srTdqoiLzU2B2evC+apEIxprEzkQ==", + "license": "MIT" + }, + "node_modules/@types/range-parser": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "license": "MIT" + }, + "node_modules/@types/request": { + "version": "2.48.13", + "resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.13.tgz", + "integrity": "sha512-FGJ6udDNUCjd19pp0Q3iTiDkwhYup7J8hpMW9c4k53NrccQFFWKRho6hvtPPEhnXWKvukfwAlB6DbDz4yhH5Gg==", + "license": "MIT", + "optional": true, + "dependencies": { + "@types/caseless": "*", + "@types/node": "*", + "@types/tough-cookie": "*", + "form-data": "^2.5.5" + } + }, + "node_modules/@types/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-FmgJfu+MOcQ370SD0ev7EI8TlCAfKYU+B4m5T3yXc1CiRN94g/SZPtsCkk506aUDtlMnFZvasDwHHUcZUEaYuA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/send": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@types/send/-/send-1.2.1.tgz", + "integrity": "sha512-arsCikDvlU99zl1g69TcAB3mzZPpxgw0UQnaHeC1Nwb015xp8bknZv5rIfri9xTOcMuaVgvabfIRA7PSZVuZIQ==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.10", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.10.tgz", + "integrity": "sha512-tRs1dB+g8Itk72rlSI2ZrW6vZg0YrLI81iQSTkMmOqnqCaNr/8Ek4VwWcN5vZgCYWbg/JJSGBlUaYGAOP73qBw==", + "license": "MIT", + "dependencies": { + "@types/http-errors": "*", + "@types/node": "*", + "@types/send": "<1" + } + }, + "node_modules/@types/serve-static/node_modules/@types/send": { + "version": "0.17.6", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.6.tgz", + "integrity": "sha512-Uqt8rPBE8SY0RK8JB1EzVOIZ32uqy8HwdxCnoCOsYrvnswqmFZ/k+9Ikidlk/ImhsdvBsloHbAlewb2IEBV/Og==", + "license": "MIT", + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "node_modules/@types/stack-utils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", + "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@types/tough-cookie": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz", + "integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==", + "license": "MIT", + "optional": true + }, + "node_modules/@types/yargs": { + "version": "17.0.35", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.35.tgz", + "integrity": "sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", + "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.4.0", + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/type-utils": "5.62.0", + "@typescript-eslint/utils": "5.62.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "natural-compare-lite": "^1.4.0", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^5.0.0", + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", + "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/typescript-estree": "5.62.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", + "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/visitor-keys": "5.62.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", + "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/typescript-estree": "5.62.0", + "@typescript-eslint/utils": "5.62.0", + "debug": "^4.3.4", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", + "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", + "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/visitor-keys": "5.62.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", + "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@types/json-schema": "^7.0.9", + "@types/semver": "^7.3.12", + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/typescript-estree": "5.62.0", + "eslint-scope": "^5.1.1", + "semver": "^7.3.7" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", + "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "5.62.0", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", + "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", + "dev": true, + "license": "ISC" + }, + "node_modules/@unrs/resolver-binding-android-arm-eabi": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm-eabi/-/resolver-binding-android-arm-eabi-1.11.1.tgz", + "integrity": "sha512-ppLRUgHVaGRWUx0R0Ut06Mjo9gBaBkg3v/8AxusGLhsIotbBLuRk51rAzqLC8gq6NyyAojEXglNjzf6R948DNw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "peer": true + }, + "node_modules/@unrs/resolver-binding-android-arm64": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm64/-/resolver-binding-android-arm64-1.11.1.tgz", + "integrity": "sha512-lCxkVtb4wp1v+EoN+HjIG9cIIzPkX5OtM03pQYkG+U5O/wL53LC4QbIeazgiKqluGeVEeBlZahHalCaBvU1a2g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "peer": true + }, + "node_modules/@unrs/resolver-binding-darwin-arm64": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-arm64/-/resolver-binding-darwin-arm64-1.11.1.tgz", + "integrity": "sha512-gPVA1UjRu1Y/IsB/dQEsp2V1pm44Of6+LWvbLc9SDk1c2KhhDRDBUkQCYVWe6f26uJb3fOK8saWMgtX8IrMk3g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "peer": true + }, + "node_modules/@unrs/resolver-binding-darwin-x64": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-x64/-/resolver-binding-darwin-x64-1.11.1.tgz", + "integrity": "sha512-cFzP7rWKd3lZaCsDze07QX1SC24lO8mPty9vdP+YVa3MGdVgPmFc59317b2ioXtgCMKGiCLxJ4HQs62oz6GfRQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "peer": true + }, + "node_modules/@unrs/resolver-binding-freebsd-x64": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-freebsd-x64/-/resolver-binding-freebsd-x64-1.11.1.tgz", + "integrity": "sha512-fqtGgak3zX4DCB6PFpsH5+Kmt/8CIi4Bry4rb1ho6Av2QHTREM+47y282Uqiu3ZRF5IQioJQ5qWRV6jduA+iGw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "peer": true + }, + "node_modules/@unrs/resolver-binding-linux-arm-gnueabihf": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-gnueabihf/-/resolver-binding-linux-arm-gnueabihf-1.11.1.tgz", + "integrity": "sha512-u92mvlcYtp9MRKmP+ZvMmtPN34+/3lMHlyMj7wXJDeXxuM0Vgzz0+PPJNsro1m3IZPYChIkn944wW8TYgGKFHw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true + }, + "node_modules/@unrs/resolver-binding-linux-arm-musleabihf": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-musleabihf/-/resolver-binding-linux-arm-musleabihf-1.11.1.tgz", + "integrity": "sha512-cINaoY2z7LVCrfHkIcmvj7osTOtm6VVT16b5oQdS4beibX2SYBwgYLmqhBjA1t51CarSaBuX5YNsWLjsqfW5Cw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true + }, + "node_modules/@unrs/resolver-binding-linux-arm64-gnu": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-gnu/-/resolver-binding-linux-arm64-gnu-1.11.1.tgz", + "integrity": "sha512-34gw7PjDGB9JgePJEmhEqBhWvCiiWCuXsL9hYphDF7crW7UgI05gyBAi6MF58uGcMOiOqSJ2ybEeCvHcq0BCmQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true + }, + "node_modules/@unrs/resolver-binding-linux-arm64-musl": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-musl/-/resolver-binding-linux-arm64-musl-1.11.1.tgz", + "integrity": "sha512-RyMIx6Uf53hhOtJDIamSbTskA99sPHS96wxVE/bJtePJJtpdKGXO1wY90oRdXuYOGOTuqjT8ACccMc4K6QmT3w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true + }, + "node_modules/@unrs/resolver-binding-linux-ppc64-gnu": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-ppc64-gnu/-/resolver-binding-linux-ppc64-gnu-1.11.1.tgz", + "integrity": "sha512-D8Vae74A4/a+mZH0FbOkFJL9DSK2R6TFPC9M+jCWYia/q2einCubX10pecpDiTmkJVUH+y8K3BZClycD8nCShA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true + }, + "node_modules/@unrs/resolver-binding-linux-riscv64-gnu": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-gnu/-/resolver-binding-linux-riscv64-gnu-1.11.1.tgz", + "integrity": "sha512-frxL4OrzOWVVsOc96+V3aqTIQl1O2TjgExV4EKgRY09AJ9leZpEg8Ak9phadbuX0BA4k8U5qtvMSQQGGmaJqcQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true + }, + "node_modules/@unrs/resolver-binding-linux-riscv64-musl": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-musl/-/resolver-binding-linux-riscv64-musl-1.11.1.tgz", + "integrity": "sha512-mJ5vuDaIZ+l/acv01sHoXfpnyrNKOk/3aDoEdLO/Xtn9HuZlDD6jKxHlkN8ZhWyLJsRBxfv9GYM2utQ1SChKew==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true + }, + "node_modules/@unrs/resolver-binding-linux-s390x-gnu": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-s390x-gnu/-/resolver-binding-linux-s390x-gnu-1.11.1.tgz", + "integrity": "sha512-kELo8ebBVtb9sA7rMe1Cph4QHreByhaZ2QEADd9NzIQsYNQpt9UkM9iqr2lhGr5afh885d/cB5QeTXSbZHTYPg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true + }, + "node_modules/@unrs/resolver-binding-linux-x64-gnu": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-gnu/-/resolver-binding-linux-x64-gnu-1.11.1.tgz", + "integrity": "sha512-C3ZAHugKgovV5YvAMsxhq0gtXuwESUKc5MhEtjBpLoHPLYM+iuwSj3lflFwK3DPm68660rZ7G8BMcwSro7hD5w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true + }, + "node_modules/@unrs/resolver-binding-linux-x64-musl": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-musl/-/resolver-binding-linux-x64-musl-1.11.1.tgz", + "integrity": "sha512-rV0YSoyhK2nZ4vEswT/QwqzqQXw5I6CjoaYMOX0TqBlWhojUf8P94mvI7nuJTeaCkkds3QE4+zS8Ko+GdXuZtA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true + }, + "node_modules/@unrs/resolver-binding-wasm32-wasi": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-wasm32-wasi/-/resolver-binding-wasm32-wasi-1.11.1.tgz", + "integrity": "sha512-5u4RkfxJm+Ng7IWgkzi3qrFOvLvQYnPBmjmZQ8+szTK/b31fQCnleNl1GgEt7nIsZRIf5PLhPwT0WM+q45x/UQ==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "@napi-rs/wasm-runtime": "^0.2.11" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@unrs/resolver-binding-win32-arm64-msvc": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-arm64-msvc/-/resolver-binding-win32-arm64-msvc-1.11.1.tgz", + "integrity": "sha512-nRcz5Il4ln0kMhfL8S3hLkxI85BXs3o8EYoattsJNdsX4YUU89iOkVn7g0VHSRxFuVMdM4Q1jEpIId1Ihim/Uw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "peer": true + }, + "node_modules/@unrs/resolver-binding-win32-ia32-msvc": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-ia32-msvc/-/resolver-binding-win32-ia32-msvc-1.11.1.tgz", + "integrity": "sha512-DCEI6t5i1NmAZp6pFonpD5m7i6aFrpofcp4LA2i8IIq60Jyo28hamKBxNrZcyOwVOZkgsRp9O2sXWBWP8MnvIQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "peer": true + }, + "node_modules/@unrs/resolver-binding-win32-x64-msvc": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-x64-msvc/-/resolver-binding-win32-x64-msvc-1.11.1.tgz", + "integrity": "sha512-lrW200hZdbfRtztbygyaq/6jP6AKE8qQN2KvPcJ+x7wiD038YtnYtZ82IMNJ69GJibV7bwL3y9FgK+5w/pYt6g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "peer": true + }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "license": "MIT", + "optional": true, + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", + "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "is-array-buffer": "^3.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "license": "MIT" + }, + "node_modules/array-includes": { + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.9.tgz", + "integrity": "sha512-FmeCCAenzH0KH381SPT5FZmiA/TmpndpcaShhfgEN9eCVjnFBqq3l1xrI42y8+PPLI6hypzou4GXw00WHmPBLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.24.0", + "es-object-atoms": "^1.1.1", + "get-intrinsic": "^1.3.0", + "is-string": "^1.1.1", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/array.prototype.findlastindex": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.6.tgz", + "integrity": "sha512-F/TKATkzseUExPlfvmwQKGITM3DGTK+vkAsCZoDc5daVygbJBnjEUCbgkAvVFsgfXfX4YIqZ/27G3k3tdXrTxQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.9", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "es-shim-unscopables": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.3.tgz", + "integrity": "sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flatmap": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.3.tgz", + "integrity": "sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", + "integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/async-function": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", + "integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/async-retry": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.3.tgz", + "integrity": "sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw==", + "license": "MIT", + "optional": true, + "dependencies": { + "retry": "0.13.1" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT", + "optional": true + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/babel-jest": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-30.2.0.tgz", + "integrity": "sha512-0YiBEOxWqKkSQWL9nNGGEgndoeL0ZpWrbLMNL5u/Kaxrli3Eaxlt3ZtIDktEvXt4L/R9r3ODr2zKwGM/2BjxVw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/transform": "30.2.0", + "@types/babel__core": "^7.20.5", + "babel-plugin-istanbul": "^7.0.1", + "babel-preset-jest": "30.2.0", + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "slash": "^3.0.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.11.0 || ^8.0.0-0" + } + }, + "node_modules/babel-plugin-istanbul": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-7.0.1.tgz", + "integrity": "sha512-D8Z6Qm8jCvVXtIRkBnqNHX0zJ37rQcFJ9u8WOS6tkYOsRdHBzypCstaxWiu5ZIlqQtviRYbgnRLSoCEvjqcqbA==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "workspaces": [ + "test/babel-8" + ], + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-instrument": "^6.0.2", + "test-exclude": "^6.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/babel-plugin-jest-hoist": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-30.2.0.tgz", + "integrity": "sha512-ftzhzSGMUnOzcCXd6WHdBGMyuwy15Wnn0iyyWGKgBDLxf9/s5ABuraCSpBX2uG0jUg4rqJnxsLc5+oYBqoxVaA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/babel__core": "^7.20.5" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/babel-preset-current-node-syntax": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.2.0.tgz", + "integrity": "sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-import-attributes": "^7.24.7", + "@babel/plugin-syntax-import-meta": "^7.10.4", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5" + }, + "peerDependencies": { + "@babel/core": "^7.0.0 || ^8.0.0-0" + } + }, + "node_modules/babel-preset-jest": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-30.2.0.tgz", + "integrity": "sha512-US4Z3NOieAQumwFnYdUWKvUKh8+YSnS/gB3t6YBiz0bskpu7Pine8pPCheNxlPEW4wnUkma2a94YuW2q3guvCQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "babel-plugin-jest-hoist": "30.2.0", + "babel-preset-current-node-syntax": "^1.2.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.11.0 || ^8.0.0-beta.1" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/baseline-browser-mapping": { + "version": "2.9.11", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.11.tgz", + "integrity": "sha512-Sg0xJUNDU1sJNGdfGWhVHX0kkZ+HWcvmVymJbj6NSgZZmW/8S9Y2HQ5euytnIgakgxN6papOAWiwDo1ctFDcoQ==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "bin": { + "baseline-browser-mapping": "dist/cli.js" + } + }, + "node_modules/bignumber.js": { + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.1.tgz", + "integrity": "sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/body-parser": { + "version": "1.20.4", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.4.tgz", + "integrity": "sha512-ZTgYYLMOXY9qKU/57FAo8F+HA2dGX7bqGc71txDRC1rS4frdFI5R7NhluHxH6M0YItAP0sHB4uqAOcYKxO6uGA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "~1.2.0", + "http-errors": "~2.0.1", + "iconv-lite": "~0.4.24", + "on-finished": "~2.4.1", + "qs": "~6.14.0", + "raw-body": "~2.5.3", + "type-is": "~1.6.18", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/body-parser/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/body-parser/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.1.tgz", + "integrity": "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "baseline-browser-mapping": "^2.9.0", + "caniuse-lite": "^1.0.30001759", + "electron-to-chromium": "^1.5.263", + "node-releases": "^2.0.27", + "update-browserslist-db": "^1.2.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "node-int64": "^0.4.0" + } + }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", + "license": "BSD-3-Clause" + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001761", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001761.tgz", + "integrity": "sha512-JF9ptu1vP2coz98+5051jZ4PwQgd2ni8A+gYSN7EA7dPKIMf0pDlSUxhdmVOaV3/fYK5uWBkgSXJaRLr4+3A6g==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0", + "peer": true + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/ci-info": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.3.1.tgz", + "integrity": "sha512-Wdy2Igu8OcBpI2pZePZ5oWjPC38tmDVx5WKUXKwlLYkA0ozo85sLsLvkBbBn/sZaSCMFOGZJ14fvW9t5/d7kdA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cjs-module-lexer": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-2.1.1.tgz", + "integrity": "sha512-+CmxIZ/L2vNcEfvNtLdU0ZQ6mbq3FZnwAP2PPTiKP+1QOoKwlKlPgb8UKV0Dds7QVaMnHm+FwSft2VB0s/SLjQ==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "devOptional": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/collect-v8-coverage": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.3.tgz", + "integrity": "sha512-1L5aqIkwPfiodaMgQunkF1zRhNqifHBmtbbbxcr6yVxxBnliw4TDOW6NxpO8DJLgJ16OT+Y4ztZqP6p/FtXnAw==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "optional": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz", + "integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==", + "license": "MIT" + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "license": "MIT", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/data-view-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", + "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", + "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/inspect-js" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", + "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/dedent": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.1.tgz", + "integrity": "sha512-9JmrhGZpOlEgOLdQgSm0zxFaYoQon408V1v49aqTWuXENVlnCuY9JBZcXZiCsZQWDjTm5Qf/nIvAy77mXDAjEg==", + "dev": true, + "license": "MIT", + "peer": true, + "peerDependencies": { + "babel-plugin-macros": "^3.1.0" + }, + "peerDependenciesMeta": { + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "license": "MIT", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/duplexify": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.3.tgz", + "integrity": "sha512-M3BmBhwJRZsSx38lZyhE53Csddgzl5R7xGJNk7CVddZD6CcmwMCH8J+7AprIrQKH7TonKxaCjcv27Qmf+sQ+oA==", + "license": "MIT", + "optional": true, + "dependencies": { + "end-of-stream": "^1.4.1", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1", + "stream-shift": "^1.0.2" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/electron-to-chromium": { + "version": "1.5.267", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.267.tgz", + "integrity": "sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw==", + "dev": true, + "license": "ISC", + "peer": true + }, + "node_modules/emittery": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", + "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sindresorhus/emittery?sponsor=1" + } + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", + "license": "MIT", + "optional": true, + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/error-ex": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.4.tgz", + "integrity": "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-abstract": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.1.tgz", + "integrity": "sha512-zHXBLhP+QehSSbsS9Pt23Gg964240DPd6QCf8WpkqEXxQ7fhdZzYsocOr5u7apWonsS5EjZDmTF+/slGMyasvw==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.2", + "arraybuffer.prototype.slice": "^1.0.4", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "data-view-buffer": "^1.0.2", + "data-view-byte-length": "^1.0.2", + "data-view-byte-offset": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "es-set-tostringtag": "^2.1.0", + "es-to-primitive": "^1.3.0", + "function.prototype.name": "^1.1.8", + "get-intrinsic": "^1.3.0", + "get-proto": "^1.0.1", + "get-symbol-description": "^1.1.0", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "internal-slot": "^1.1.0", + "is-array-buffer": "^3.0.5", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.2", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.2.1", + "is-set": "^2.0.3", + "is-shared-array-buffer": "^1.0.4", + "is-string": "^1.1.1", + "is-typed-array": "^1.1.15", + "is-weakref": "^1.1.1", + "math-intrinsics": "^1.1.0", + "object-inspect": "^1.13.4", + "object-keys": "^1.1.1", + "object.assign": "^4.1.7", + "own-keys": "^1.0.1", + "regexp.prototype.flags": "^1.5.4", + "safe-array-concat": "^1.1.3", + "safe-push-apply": "^1.0.0", + "safe-regex-test": "^1.1.0", + "set-proto": "^1.0.0", + "stop-iteration-iterator": "^1.1.0", + "string.prototype.trim": "^1.2.10", + "string.prototype.trimend": "^1.0.9", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.3", + "typed-array-byte-length": "^1.0.3", + "typed-array-byte-offset": "^1.0.4", + "typed-array-length": "^1.0.7", + "unbox-primitive": "^1.1.0", + "which-typed-array": "^1.1.19" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.1.0.tgz", + "integrity": "sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-to-primitive": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz", + "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.2.7", + "is-date-object": "^1.0.5", + "is-symbol": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", + "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", + "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.1", + "@humanwhocodes/config-array": "^0.13.0", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-config-google": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/eslint-config-google/-/eslint-config-google-0.14.0.tgz", + "integrity": "sha512-WsbX4WbjuMvTdeVL6+J3rK1RGhCTqjsFjX7UMSMgZiyxxaNLkoJENbrGExzERFeoTpGw3F3FypTiWAP9ZXzkEw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=0.10.0" + }, + "peerDependencies": { + "eslint": ">=5.16.0" + } + }, + "node_modules/eslint-import-resolver-node": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^3.2.7", + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-module-utils": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.1.tgz", + "integrity": "sha512-L8jSWTze7K2mTg0vos/RuLRS5soomksDPoJLXIslC7c8Wmut3bx7CPpJijDcBZtxQ5lrbUdM+s0OlNbz0DCDNw==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^3.2.7" + }, + "engines": { + "node": ">=4" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import": { + "version": "2.32.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.32.0.tgz", + "integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rtsao/scc": "^1.1.0", + "array-includes": "^3.1.9", + "array.prototype.findlastindex": "^1.2.6", + "array.prototype.flat": "^1.3.3", + "array.prototype.flatmap": "^1.3.3", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.12.1", + "hasown": "^2.0.2", + "is-core-module": "^2.16.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.fromentries": "^2.0.8", + "object.groupby": "^1.0.3", + "object.values": "^1.2.1", + "semver": "^6.3.1", + "string.prototype.trimend": "^1.0.9", + "tsconfig-paths": "^3.15.0" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9" + } + }, + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "license": "BSD-2-Clause", + "peer": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esquery/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/execa/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC", + "peer": true + }, + "node_modules/exit-x": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/exit-x/-/exit-x-0.2.2.tgz", + "integrity": "sha512-+I6B/IkJc1o/2tiURyz/ivu/O0nKNEArIUB5O7zBrlDVJr22SCLH3xTeEry428LvFhRzIA1g8izguxJ/gbNcVQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/expect": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-30.2.0.tgz", + "integrity": "sha512-u/feCi0GPsI+988gU2FLcsHyAHTU0MX1Wg68NhAnN7z/+C5wqG+CY8J53N9ioe8RXgaoz0nBR/TYMf3AycUuPw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/expect-utils": "30.2.0", + "@jest/get-type": "30.1.0", + "jest-matcher-utils": "30.2.0", + "jest-message-util": "30.2.0", + "jest-mock": "30.2.0", + "jest-util": "30.2.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/express": { + "version": "4.22.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.22.1.tgz", + "integrity": "sha512-F2X8g9P1X7uCPZMA3MVf9wcTqlyNp7IhH5qPCI0izhaOIYXaW9L535tGA3qmjRzpH+bZczqq7hVKxTR4NWnu+g==", + "license": "MIT", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "~1.20.3", + "content-disposition": "~0.5.4", + "content-type": "~1.0.4", + "cookie": "~0.7.1", + "cookie-signature": "~1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.3.1", + "fresh": "~0.5.2", + "http-errors": "~2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "~2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "~0.1.12", + "proxy-addr": "~2.0.7", + "qs": "~6.14.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "~0.19.0", + "serve-static": "~1.16.2", + "setprototypeof": "1.2.0", + "statuses": "~2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/express/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/express/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "license": "MIT" + }, + "node_modules/farmhash-modern": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/farmhash-modern/-/farmhash-modern-1.1.0.tgz", + "integrity": "sha512-6ypT4XfgqJk/F3Yuv4SX26I3doUjt0GTG4a+JgWxXQpxXzTBq8fPUeGHfcYMMDPHJHm3yPOSjaeBwBGAHWXCdA==", + "license": "MIT", + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" + }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-xml-parser": { + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.3.tgz", + "integrity": "sha512-RKihhV+SHsIUGXObeVy9AXiBbFwkVk7Syp8XgwN5U3JV416+Gwp/GO9i0JYKmikykgz/UHRrrV4ROuZEo/T0ig==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT", + "optional": true, + "dependencies": { + "strnum": "^1.1.1" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, + "node_modules/fastq": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.1.tgz", + "integrity": "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==", + "dev": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/faye-websocket": { + "version": "0.11.4", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz", + "integrity": "sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==", + "license": "Apache-2.0", + "dependencies": { + "websocket-driver": ">=0.5.1" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/fb-watchman": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "bser": "2.1.1" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.2.tgz", + "integrity": "sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "~2.4.1", + "parseurl": "~1.3.3", + "statuses": "~2.0.2", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/finalhandler/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/finalhandler/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/firebase-admin": { + "version": "13.6.0", + "resolved": "https://registry.npmjs.org/firebase-admin/-/firebase-admin-13.6.0.tgz", + "integrity": "sha512-GdPA/t0+Cq8p1JnjFRBmxRxAGvF/kl2yfdhALl38PrRp325YxyQ5aNaHui0XmaKcKiGRFIJ/EgBNWFoDP0onjw==", + "license": "Apache-2.0", + "dependencies": { + "@fastify/busboy": "^3.0.0", + "@firebase/database-compat": "^2.0.0", + "@firebase/database-types": "^1.0.6", + "@types/node": "^22.8.7", + "farmhash-modern": "^1.1.0", + "fast-deep-equal": "^3.1.1", + "google-auth-library": "^9.14.2", + "jsonwebtoken": "^9.0.0", + "jwks-rsa": "^3.1.0", + "node-forge": "^1.3.1", + "uuid": "^11.0.2" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@google-cloud/firestore": "^7.11.0", + "@google-cloud/storage": "^7.14.0" + } + }, + "node_modules/firebase-functions": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/firebase-functions/-/firebase-functions-7.0.2.tgz", + "integrity": "sha512-AFAZOn2iMp6X6lvCzEI92/J/JfT2ZAGSHKAfop4btWZdIqeHU40gFwVBGPl53bnqEpuv5VYKirmkxGuPu4OHpA==", + "license": "MIT", + "dependencies": { + "@types/cors": "^2.8.5", + "@types/express": "^4.17.21", + "cors": "^2.8.5", + "express": "^4.21.0", + "protobufjs": "^7.2.2" + }, + "bin": { + "firebase-functions": "lib/bin/firebase-functions.js" + }, + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "firebase-admin": "^11.10.0 || ^12.0.0 || ^13.0.0" + } + }, + "node_modules/firebase-functions-test": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/firebase-functions-test/-/firebase-functions-test-3.4.1.tgz", + "integrity": "sha512-qAq0oszrBGdf4bnCF6t4FoSgMsepeIXh0Pi/FhikSE6e+TvKKGpfrfUP/5pFjJZxFcLsweoau88KydCql4xSeg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/lodash": "^4.14.104", + "lodash": "^4.17.5", + "ts-deepmerge": "^2.0.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "firebase-admin": "^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0", + "firebase-functions": ">=4.9.0", + "jest": ">=28.0.0" + } + }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", + "dev": true, + "license": "ISC" + }, + "node_modules/for-each": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", + "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/form-data": { + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.5.tgz", + "integrity": "sha512-jqdObeR2rxZZbPSGL+3VckHMYtu+f9//KXBsVny6JSX/pa38Fy+bGjuG8eW/H6USNQWhLi8Num++cU2yOCNz4A==", + "license": "MIT", + "optional": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.35", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, + "license": "ISC" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "peer": true, + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/function.prototype.name": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz", + "integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "functions-have-names": "^1.2.3", + "hasown": "^2.0.2", + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", + "license": "MIT", + "optional": true + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gaxios": { + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-6.7.1.tgz", + "integrity": "sha512-LDODD4TMYx7XXdpwxAVRAIAuB0bzv0s+ywFonY46k126qzQHT9ygyoa9tncmOiQmmDrik65UYsEkv3lbfqQ3yQ==", + "license": "Apache-2.0", + "dependencies": { + "extend": "^3.0.2", + "https-proxy-agent": "^7.0.1", + "is-stream": "^2.0.0", + "node-fetch": "^2.6.9", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/gaxios/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/gcp-metadata": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-6.1.1.tgz", + "integrity": "sha512-a4tiq7E0/5fTjxPAaH4jpjkSv/uCaU2p5KC6HVGrvl0cDjA8iBZv4vv1gyzlmK0ZUKqwpOyQMKzZQe3lTit77A==", + "license": "Apache-2.0", + "dependencies": { + "gaxios": "^6.1.1", + "google-logging-utils": "^0.0.2", + "json-bigint": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/generator-function": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/generator-function/-/generator-function-2.0.1.tgz", + "integrity": "sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "devOptional": true, + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-symbol-description": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", + "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/google-auth-library": { + "version": "9.15.1", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-9.15.1.tgz", + "integrity": "sha512-Jb6Z0+nvECVz+2lzSMt9u98UsoakXxA2HGHMCxh+so3n90XgYWkq5dur19JAJV7ONiJY22yBTyJB1TSkvPq9Ng==", + "license": "Apache-2.0", + "dependencies": { + "base64-js": "^1.3.0", + "ecdsa-sig-formatter": "^1.0.11", + "gaxios": "^6.1.1", + "gcp-metadata": "^6.1.0", + "gtoken": "^7.0.0", + "jws": "^4.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/google-gax": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-4.6.1.tgz", + "integrity": "sha512-V6eky/xz2mcKfAd1Ioxyd6nmA61gao3n01C+YeuIwu3vzM9EDR6wcVzMSIbLMDXWeoi9SHYctXuKYC5uJUT3eQ==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@grpc/grpc-js": "^1.10.9", + "@grpc/proto-loader": "^0.7.13", + "@types/long": "^4.0.0", + "abort-controller": "^3.0.0", + "duplexify": "^4.0.0", + "google-auth-library": "^9.3.0", + "node-fetch": "^2.7.0", + "object-hash": "^3.0.0", + "proto3-json-serializer": "^2.0.2", + "protobufjs": "^7.3.2", + "retry-request": "^7.0.0", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/google-gax/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "optional": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/google-logging-utils": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/google-logging-utils/-/google-logging-utils-0.0.2.tgz", + "integrity": "sha512-NEgUnEcBiP5HrPzufUkBzJOD/Sxsco3rLNo1F1TNf7ieU8ryUzBhqba8r756CjLX7rn3fHl6iLEwPYuqpoKgQQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=14" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC", + "peer": true + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true, + "license": "MIT" + }, + "node_modules/gtoken": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-7.1.0.tgz", + "integrity": "sha512-pCcEwRi+TKpMlxAQObHDQ56KawURgyAf6jtIY046fJ5tIv3zDe/LEIubckAO8fj6JnAxLdmWkUfNyulQ2iKdEw==", + "license": "MIT", + "dependencies": { + "gaxios": "^6.0.0", + "jws": "^4.0.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/has-bigints": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", + "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz", + "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/html-entities": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.6.0.tgz", + "integrity": "sha512-kig+rMn/QOVRvr7c86gQ8lWXq+Hkv6CbAH1hLu+RG338StTpE8Z0b44SDVaqVu7HGKf27frdmUYEs9hTUX/cLQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/mdevils" + }, + { + "type": "patreon", + "url": "https://patreon.com/mdevils" + } + ], + "license": "MIT", + "optional": true + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "license": "MIT", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/http-parser-js": { + "version": "0.5.10", + "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.10.tgz", + "integrity": "sha512-Pysuw9XpUq5dVc/2SMHpuTY01RFl8fttgcyunjL7eEMhGM3cI4eOmiCycJDVCo/7O7ClfQD3SaI6ftDzqOXYMA==", + "license": "MIT" + }, + "node_modules/http-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "license": "MIT", + "optional": true, + "dependencies": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/http-proxy-agent/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-local": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", + "integrity": "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/internal-slot": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", + "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.2", + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", + "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/is-async-function": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz", + "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "async-function": "^1.0.0", + "call-bound": "^1.0.3", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bigint": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", + "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-bigints": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-boolean-object": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", + "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-view": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", + "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", + "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-finalizationregistry": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", + "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/is-generator-function": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.2.tgz", + "integrity": "sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.4", + "generator-function": "^2.0.0", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", + "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-regex": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-set": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", + "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-string": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", + "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", + "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "has-symbols": "^1.1.0", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakmap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz", + "integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakset": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", + "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.6.tgz", + "integrity": "sha512-yg2d+Em4KizZC5niWhQaIomgf5WlL4vOOjZ5xGCmF8SnPE/mDWWXgvRExdcpCgh9lLRRa1/fSYp2ymmbJ1pI+A==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.23", + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-reports": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.2.0.tgz", + "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "peer": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/jest": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-30.2.0.tgz", + "integrity": "sha512-F26gjC0yWN8uAA5m5Ss8ZQf5nDHWGlN/xWZIh8S5SRbsEKBovwZhxGd6LJlbZYxBgCYOtreSUyb8hpXyGC5O4A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/core": "30.2.0", + "@jest/types": "30.2.0", + "import-local": "^3.2.0", + "jest-cli": "30.2.0" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-changed-files": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-30.2.0.tgz", + "integrity": "sha512-L8lR1ChrRnSdfeOvTrwZMlnWV8G/LLjQ0nG9MBclwWZidA2N5FviRki0Bvh20WRMOX31/JYvzdqTJrk5oBdydQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "execa": "^5.1.1", + "jest-util": "30.2.0", + "p-limit": "^3.1.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-circus": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-30.2.0.tgz", + "integrity": "sha512-Fh0096NC3ZkFx05EP2OXCxJAREVxj1BcW/i6EWqqymcgYKWjyyDpral3fMxVcHXg6oZM7iULer9wGRFvfpl+Tg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/environment": "30.2.0", + "@jest/expect": "30.2.0", + "@jest/test-result": "30.2.0", + "@jest/types": "30.2.0", + "@types/node": "*", + "chalk": "^4.1.2", + "co": "^4.6.0", + "dedent": "^1.6.0", + "is-generator-fn": "^2.1.0", + "jest-each": "30.2.0", + "jest-matcher-utils": "30.2.0", + "jest-message-util": "30.2.0", + "jest-runtime": "30.2.0", + "jest-snapshot": "30.2.0", + "jest-util": "30.2.0", + "p-limit": "^3.1.0", + "pretty-format": "30.2.0", + "pure-rand": "^7.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.6" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-cli": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-30.2.0.tgz", + "integrity": "sha512-Os9ukIvADX/A9sLt6Zse3+nmHtHaE6hqOsjQtNiugFTbKRHYIYtZXNGNK9NChseXy7djFPjndX1tL0sCTlfpAA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/core": "30.2.0", + "@jest/test-result": "30.2.0", + "@jest/types": "30.2.0", + "chalk": "^4.1.2", + "exit-x": "^0.2.2", + "import-local": "^3.2.0", + "jest-config": "30.2.0", + "jest-util": "30.2.0", + "jest-validate": "30.2.0", + "yargs": "^17.7.2" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-config": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-30.2.0.tgz", + "integrity": "sha512-g4WkyzFQVWHtu6uqGmQR4CQxz/CH3yDSlhzXMWzNjDx843gYjReZnMRanjRCq5XZFuQrGDxgUaiYWE8BRfVckA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/core": "^7.27.4", + "@jest/get-type": "30.1.0", + "@jest/pattern": "30.0.1", + "@jest/test-sequencer": "30.2.0", + "@jest/types": "30.2.0", + "babel-jest": "30.2.0", + "chalk": "^4.1.2", + "ci-info": "^4.2.0", + "deepmerge": "^4.3.1", + "glob": "^10.3.10", + "graceful-fs": "^4.2.11", + "jest-circus": "30.2.0", + "jest-docblock": "30.2.0", + "jest-environment-node": "30.2.0", + "jest-regex-util": "30.0.1", + "jest-resolve": "30.2.0", + "jest-runner": "30.2.0", + "jest-util": "30.2.0", + "jest-validate": "30.2.0", + "micromatch": "^4.0.8", + "parse-json": "^5.2.0", + "pretty-format": "30.2.0", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "peerDependencies": { + "@types/node": "*", + "esbuild-register": ">=3.4.0", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "esbuild-register": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/jest-diff": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-30.2.0.tgz", + "integrity": "sha512-dQHFo3Pt4/NLlG5z4PxZ/3yZTZ1C7s9hveiOj+GCN+uT109NC2QgsoVZsVOAvbJ3RgKkvyLGXZV9+piDpWbm6A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/diff-sequences": "30.0.1", + "@jest/get-type": "30.1.0", + "chalk": "^4.1.2", + "pretty-format": "30.2.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-docblock": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-30.2.0.tgz", + "integrity": "sha512-tR/FFgZKS1CXluOQzZvNH3+0z9jXr3ldGSD8bhyuxvlVUwbeLOGynkunvlTMxchC5urrKndYiwCFC0DLVjpOCA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "detect-newline": "^3.1.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-each": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-30.2.0.tgz", + "integrity": "sha512-lpWlJlM7bCUf1mfmuqTA8+j2lNURW9eNafOy99knBM01i5CQeY5UH1vZjgT9071nDJac1M4XsbyI44oNOdhlDQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/get-type": "30.1.0", + "@jest/types": "30.2.0", + "chalk": "^4.1.2", + "jest-util": "30.2.0", + "pretty-format": "30.2.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-environment-node": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-30.2.0.tgz", + "integrity": "sha512-ElU8v92QJ9UrYsKrxDIKCxu6PfNj4Hdcktcn0JX12zqNdqWHB0N+hwOnnBBXvjLd2vApZtuLUGs1QSY+MsXoNA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/environment": "30.2.0", + "@jest/fake-timers": "30.2.0", + "@jest/types": "30.2.0", + "@types/node": "*", + "jest-mock": "30.2.0", + "jest-util": "30.2.0", + "jest-validate": "30.2.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-haste-map": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-30.2.0.tgz", + "integrity": "sha512-sQA/jCb9kNt+neM0anSj6eZhLZUIhQgwDt7cPGjumgLM4rXsfb9kpnlacmvZz3Q5tb80nS+oG/if+NBKrHC+Xw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/types": "30.2.0", + "@types/node": "*", + "anymatch": "^3.1.3", + "fb-watchman": "^2.0.2", + "graceful-fs": "^4.2.11", + "jest-regex-util": "30.0.1", + "jest-util": "30.2.0", + "jest-worker": "30.2.0", + "micromatch": "^4.0.8", + "walker": "^1.0.8" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.3" + } + }, + "node_modules/jest-leak-detector": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-30.2.0.tgz", + "integrity": "sha512-M6jKAjyzjHG0SrQgwhgZGy9hFazcudwCNovY/9HPIicmNSBuockPSedAP9vlPK6ONFJ1zfyH/M2/YYJxOz5cdQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/get-type": "30.1.0", + "pretty-format": "30.2.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-matcher-utils": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-30.2.0.tgz", + "integrity": "sha512-dQ94Nq4dbzmUWkQ0ANAWS9tBRfqCrn0bV9AMYdOi/MHW726xn7eQmMeRTpX2ViC00bpNaWXq+7o4lIQ3AX13Hg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/get-type": "30.1.0", + "chalk": "^4.1.2", + "jest-diff": "30.2.0", + "pretty-format": "30.2.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-message-util": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.2.0.tgz", + "integrity": "sha512-y4DKFLZ2y6DxTWD4cDe07RglV88ZiNEdlRfGtqahfbIjfsw1nMCPx49Uev4IA/hWn3sDKyAnSPwoYSsAEdcimw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@jest/types": "30.2.0", + "@types/stack-utils": "^2.0.3", + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "micromatch": "^4.0.8", + "pretty-format": "30.2.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.6" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-mock": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-30.2.0.tgz", + "integrity": "sha512-JNNNl2rj4b5ICpmAcq+WbLH83XswjPbjH4T7yvGzfAGCPh1rw+xVNbtk+FnRslvt9lkCcdn9i1oAoKUuFsOxRw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/types": "30.2.0", + "@types/node": "*", + "jest-util": "30.2.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-pnp-resolver": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "jest-resolve": "*" + }, + "peerDependenciesMeta": { + "jest-resolve": { + "optional": true + } + } + }, + "node_modules/jest-regex-util": { + "version": "30.0.1", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-30.0.1.tgz", + "integrity": "sha512-jHEQgBXAgc+Gh4g0p3bCevgRCVRkB4VB70zhoAE48gxeSr1hfUOsM/C2WoJgVL7Eyg//hudYENbm3Ne+/dRVVA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-resolve": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-30.2.0.tgz", + "integrity": "sha512-TCrHSxPlx3tBY3hWNtRQKbtgLhsXa1WmbJEqBlTBrGafd5fiQFByy2GNCEoGR+Tns8d15GaL9cxEzKOO3GEb2A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "jest-haste-map": "30.2.0", + "jest-pnp-resolver": "^1.2.3", + "jest-util": "30.2.0", + "jest-validate": "30.2.0", + "slash": "^3.0.0", + "unrs-resolver": "^1.7.11" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-resolve-dependencies": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-30.2.0.tgz", + "integrity": "sha512-xTOIGug/0RmIe3mmCqCT95yO0vj6JURrn1TKWlNbhiAefJRWINNPgwVkrVgt/YaerPzY3iItufd80v3lOrFJ2w==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "jest-regex-util": "30.0.1", + "jest-snapshot": "30.2.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-runner": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-30.2.0.tgz", + "integrity": "sha512-PqvZ2B2XEyPEbclp+gV6KO/F1FIFSbIwewRgmROCMBo/aZ6J1w8Qypoj2pEOcg3G2HzLlaP6VUtvwCI8dM3oqQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/console": "30.2.0", + "@jest/environment": "30.2.0", + "@jest/test-result": "30.2.0", + "@jest/transform": "30.2.0", + "@jest/types": "30.2.0", + "@types/node": "*", + "chalk": "^4.1.2", + "emittery": "^0.13.1", + "exit-x": "^0.2.2", + "graceful-fs": "^4.2.11", + "jest-docblock": "30.2.0", + "jest-environment-node": "30.2.0", + "jest-haste-map": "30.2.0", + "jest-leak-detector": "30.2.0", + "jest-message-util": "30.2.0", + "jest-resolve": "30.2.0", + "jest-runtime": "30.2.0", + "jest-util": "30.2.0", + "jest-watcher": "30.2.0", + "jest-worker": "30.2.0", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-runtime": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-30.2.0.tgz", + "integrity": "sha512-p1+GVX/PJqTucvsmERPMgCPvQJpFt4hFbM+VN3n8TMo47decMUcJbt+rgzwrEme0MQUA/R+1de2axftTHkKckg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/environment": "30.2.0", + "@jest/fake-timers": "30.2.0", + "@jest/globals": "30.2.0", + "@jest/source-map": "30.0.1", + "@jest/test-result": "30.2.0", + "@jest/transform": "30.2.0", + "@jest/types": "30.2.0", + "@types/node": "*", + "chalk": "^4.1.2", + "cjs-module-lexer": "^2.1.0", + "collect-v8-coverage": "^1.0.2", + "glob": "^10.3.10", + "graceful-fs": "^4.2.11", + "jest-haste-map": "30.2.0", + "jest-message-util": "30.2.0", + "jest-mock": "30.2.0", + "jest-regex-util": "30.0.1", + "jest-resolve": "30.2.0", + "jest-snapshot": "30.2.0", + "jest-util": "30.2.0", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-snapshot": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-30.2.0.tgz", + "integrity": "sha512-5WEtTy2jXPFypadKNpbNkZ72puZCa6UjSr/7djeecHWOu7iYhSXSnHScT8wBz3Rn8Ena5d5RYRcsyKIeqG1IyA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/core": "^7.27.4", + "@babel/generator": "^7.27.5", + "@babel/plugin-syntax-jsx": "^7.27.1", + "@babel/plugin-syntax-typescript": "^7.27.1", + "@babel/types": "^7.27.3", + "@jest/expect-utils": "30.2.0", + "@jest/get-type": "30.1.0", + "@jest/snapshot-utils": "30.2.0", + "@jest/transform": "30.2.0", + "@jest/types": "30.2.0", + "babel-preset-current-node-syntax": "^1.2.0", + "chalk": "^4.1.2", + "expect": "30.2.0", + "graceful-fs": "^4.2.11", + "jest-diff": "30.2.0", + "jest-matcher-utils": "30.2.0", + "jest-message-util": "30.2.0", + "jest-util": "30.2.0", + "pretty-format": "30.2.0", + "semver": "^7.7.2", + "synckit": "^0.11.8" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-util": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-30.2.0.tgz", + "integrity": "sha512-QKNsM0o3Xe6ISQU869e+DhG+4CK/48aHYdJZGlFQVTjnbvgpcKyxpzk29fGiO7i/J8VENZ+d2iGnSsvmuHywlA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/types": "30.2.0", + "@types/node": "*", + "chalk": "^4.1.2", + "ci-info": "^4.2.0", + "graceful-fs": "^4.2.11", + "picomatch": "^4.0.2" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-util/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/jest-validate": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-30.2.0.tgz", + "integrity": "sha512-FBGWi7dP2hpdi8nBoWxSsLvBFewKAg0+uSQwBaof4Y4DPgBabXgpSYC5/lR7VmnIlSpASmCi/ntRWPbv7089Pw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/get-type": "30.1.0", + "@jest/types": "30.2.0", + "camelcase": "^6.3.0", + "chalk": "^4.1.2", + "leven": "^3.1.0", + "pretty-format": "30.2.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-validate/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-watcher": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-30.2.0.tgz", + "integrity": "sha512-PYxa28dxJ9g777pGm/7PrbnMeA0Jr7osHP9bS7eJy9DuAjMgdGtxgf0uKMyoIsTWAkIbUW5hSDdJ3urmgXBqxg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/test-result": "30.2.0", + "@jest/types": "30.2.0", + "@types/node": "*", + "ansi-escapes": "^4.3.2", + "chalk": "^4.1.2", + "emittery": "^0.13.1", + "jest-util": "30.2.0", + "string-length": "^4.0.2" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-worker": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-30.2.0.tgz", + "integrity": "sha512-0Q4Uk8WF7BUwqXHuAjc23vmopWJw5WH7w2tqBoUOZpOjW/ZnR44GXXd1r82RvnmI2GZge3ivrYXk/BE2+VtW2g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/node": "*", + "@ungap/structured-clone": "^1.3.0", + "jest-util": "30.2.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.1.1" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/jose": { + "version": "4.15.9", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.9.tgz", + "integrity": "sha512-1vUQX+IdDMVPj4k8kOxgUqlcK518yluMuGZwqlr44FS1ppZB/5GWh4rZG89erpOBOJjU/OBsnCVFfapsRz6nEA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/js-yaml": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "license": "MIT", + "dependencies": { + "bignumber.js": "^9.0.0" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonwebtoken": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.3.tgz", + "integrity": "sha512-MT/xP0CrubFRNLNKvxJ2BYfy53Zkm++5bX9dtuPbqAeQpTVe0MQTFhao8+Cp//EmJp244xt6Drw/GVEGCUj40g==", + "license": "MIT", + "dependencies": { + "jws": "^4.0.1", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + } + }, + "node_modules/jwa": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.1.tgz", + "integrity": "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==", + "license": "MIT", + "dependencies": { + "buffer-equal-constant-time": "^1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jwks-rsa": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/jwks-rsa/-/jwks-rsa-3.2.0.tgz", + "integrity": "sha512-PwchfHcQK/5PSydeKCs1ylNym0w/SSv8a62DgHJ//7x2ZclCoinlsjAfDxAAbpoTPybOum/Jgy+vkvMmKz89Ww==", + "license": "MIT", + "dependencies": { + "@types/express": "^4.17.20", + "@types/jsonwebtoken": "^9.0.4", + "debug": "^4.3.4", + "jose": "^4.15.4", + "limiter": "^1.1.5", + "lru-memoizer": "^2.2.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/jws": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.1.tgz", + "integrity": "sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==", + "license": "MIT", + "dependencies": { + "jwa": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/limiter": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/limiter/-/limiter-1.1.5.tgz", + "integrity": "sha512-FWWMIEOxz3GwUI4Ts/IvgVy6LPvoMPgjMdQ185nN6psJyBJ4yOpzqm695/h5umdLJg2vW3GR5iG11MAkR2AzJA==" + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "license": "MIT", + "optional": true + }, + "node_modules/lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", + "license": "MIT" + }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==", + "license": "MIT" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==", + "license": "MIT" + }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==", + "license": "MIT" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==", + "license": "MIT" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", + "license": "MIT" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", + "license": "MIT" + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", + "license": "MIT" + }, + "node_modules/long": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", + "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", + "license": "Apache-2.0" + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/lru-memoizer": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/lru-memoizer/-/lru-memoizer-2.3.0.tgz", + "integrity": "sha512-GXn7gyHAMhO13WSKrIiNfztwxodVsP8IoZ3XfrJV4yH2x0/OeTO/FIaAHTY5YekdGgW94njfuKmyyt1E0mR6Ug==", + "license": "MIT", + "dependencies": { + "lodash.clonedeep": "^4.5.0", + "lru-cache": "6.0.0" + } + }, + "node_modules/lru-memoizer/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/lru-memoizer/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC" + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "tmpl": "1.0.5" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "license": "MIT", + "optional": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "peer": true, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/napi-postinstall": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/napi-postinstall/-/napi-postinstall-0.3.4.tgz", + "integrity": "sha512-PHI5f1O0EP5xJ9gQmFGMS6IZcrVvTjpXjz7Na41gTE7eE2hK11lg04CECCYEEjdc17EV4DO+fkGEtt7TpTaTiQ==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "napi-postinstall": "lib/cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/napi-postinstall" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/natural-compare-lite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", + "dev": true, + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-forge": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.3.tgz", + "integrity": "sha512-rLvcdSyRCyouf6jcOIPe/BgwG/d7hKjzMKOas33/pHEr6gbq18IK9zV7DiPvzsz0oBJPme6qr6H6kGZuI9/DZg==", + "license": "(BSD-3-Clause OR GPL-2.0)", + "engines": { + "node": ">= 6.13.0" + } + }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/node-releases": { + "version": "2.0.27", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz", + "integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-hash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", + "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", + "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0", + "has-symbols": "^1.1.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.fromentries": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.groupby": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", + "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.values": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.1.tgz", + "integrity": "sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "devOptional": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/own-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", + "integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.6", + "object-keys": "^1.1.1", + "safe-push-apply": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0", + "peer": true + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "peer": true, + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC", + "peer": true + }, + "node_modules/path-to-regexp": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", + "license": "MIT" + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC", + "peer": true + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pirates": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", + "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pkg-dir/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/pretty-format": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-30.2.0.tgz", + "integrity": "sha512-9uBdv/B4EefsuAL+pWqueZyZS2Ba+LxfFeQ9DN14HU4bN8bhaxKdkpjpB6fs9+pSjIBu+FXQHImEg8j/Lw0+vA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/schemas": "30.0.5", + "ansi-styles": "^5.2.0", + "react-is": "^18.3.1" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/proto3-json-serializer": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/proto3-json-serializer/-/proto3-json-serializer-2.0.2.tgz", + "integrity": "sha512-SAzp/O4Yh02jGdRc+uIrGoe87dkN/XtwxfZ4ZyafJHymd79ozp5VG5nyZ7ygqPM5+cpLDjjGnYFUkngonyDPOQ==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "protobufjs": "^7.2.5" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/protobufjs": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.4.tgz", + "integrity": "sha512-CvexbZtbov6jW2eXAvLukXjXUW1TzFaivC46BpWc/3BpcCysb5Vffu+B3XHMm8lVEuy2Mm4XGex8hBSg1yapPg==", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/pure-rand": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-7.0.1.tgz", + "integrity": "sha512-oTUZM/NAZS8p7ANR3SHh30kXB+zK2r2BPcEn/awJIbOvq82WoMN4p62AWWp3Hhw50G0xMsw1mhIBLqHw64EcNQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT", + "peer": true + }, + "node_modules/qs": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.3.tgz", + "integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.4.24", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "optional": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/reflect.getprototypeof": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", + "integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.9", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.1", + "which-builtin-type": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", + "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "set-function-name": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.11", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz", + "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.16.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-cwd/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/retry": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", + "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/retry-request": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-7.0.2.tgz", + "integrity": "sha512-dUOvLMJ0/JJYEn8NrpOaGNE7X3vpI5XlZS/u0ANjqtcZVKnIxP7IgCFwrKTxENw29emmwug53awKtaMm4i9g5w==", + "license": "MIT", + "optional": true, + "dependencies": { + "@types/request": "^2.48.8", + "extend": "^3.0.2", + "teeny-request": "^9.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-array-concat": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz", + "integrity": "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "has-symbols": "^1.1.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safe-push-apply": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", + "integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-regex-test": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.2.tgz", + "integrity": "sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "~0.5.2", + "http-errors": "~2.0.1", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "~2.4.1", + "range-parser": "~1.2.1", + "statuses": "~2.0.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/send/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/send/node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/serve-static": { + "version": "1.16.3", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.3.tgz", + "integrity": "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==", + "license": "MIT", + "dependencies": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "~0.19.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz", + "integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "peer": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/stack-utils": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", + "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "escape-string-regexp": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/stack-utils/node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/stop-iteration-iterator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", + "integrity": "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "internal-slot": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/stream-events": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/stream-events/-/stream-events-1.0.5.tgz", + "integrity": "sha512-E1GUzBSgvct8Jsb3v2X15pjzN1tYebtbLaMg+eBOUOAxgbLoSbT2NS91ckc5lJD1KfLjId+jXJRgo0qnV5Nerg==", + "license": "MIT", + "optional": true, + "dependencies": { + "stubs": "^3.0.0" + } + }, + "node_modules/stream-shift": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.3.tgz", + "integrity": "sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==", + "license": "MIT", + "optional": true + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "optional": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-length": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/string-width/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/string-width/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.10", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", + "integrity": "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-data-property": "^1.1.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-object-atoms": "^1.0.0", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz", + "integrity": "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strnum": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.1.2.tgz", + "integrity": "sha512-vrN+B7DBIoTTZjnPNewwhx6cBA/H+IS7rfW68n7XxC1y7uoiGQBxaKzqucGUgavX15dJgiGztLJ8vxuEzwqBdA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT", + "optional": true + }, + "node_modules/stubs": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/stubs/-/stubs-3.0.0.tgz", + "integrity": "sha512-PdHt7hHUJKxvTCgbKX9C1V/ftOcjJQgz8BZwNfV5c4B6dcGqlpelTbJ999jBGZ2jYiPAwcX5dP6oBwVlBlUbxw==", + "license": "MIT", + "optional": true + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/synckit": { + "version": "0.11.11", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.11.11.tgz", + "integrity": "sha512-MeQTA1r0litLUf0Rp/iisCaL8761lKAZHaimlbGK4j0HysC4PLfqygQj9srcs0m2RdtDYnF8UuYyKpbjHYp7Jw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@pkgr/core": "^0.2.9" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/synckit" + } + }, + "node_modules/teeny-request": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-9.0.0.tgz", + "integrity": "sha512-resvxdc6Mgb7YEThw6G6bExlXKkv6+YbuzGg9xuXxSgxJF7Ozs+o8Y9+2R3sArdWdW8nOokoQb1yrpFB0pQK2g==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.0", + "node-fetch": "^2.6.9", + "stream-events": "^1.0.5", + "uuid": "^9.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/teeny-request/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/teeny-request/node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "license": "MIT", + "optional": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/teeny-request/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "optional": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/test-exclude/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true, + "license": "MIT" + }, + "node_modules/tmpl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "license": "MIT" + }, + "node_modules/ts-deepmerge": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/ts-deepmerge/-/ts-deepmerge-2.0.7.tgz", + "integrity": "sha512-3phiGcxPSSR47RBubQxPoZ+pqXsEsozLo4G4AlSrsMKTFg9TA3l+3he5BqpUi9wiuDbaHWXH/amlzQ49uEdXtg==", + "dev": true, + "license": "ISC" + }, + "node_modules/tsconfig-paths": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, + "node_modules/tsconfig-paths/node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/tsconfig-paths/node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "license": "MIT", + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/tsutils/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true, + "license": "0BSD" + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "license": "MIT", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typed-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", + "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", + "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz", + "integrity": "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.15", + "reflect.getprototypeof": "^1.0.9" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz", + "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0", + "reflect.getprototypeof": "^1.0.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/unbox-primitive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", + "integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-bigints": "^1.0.2", + "has-symbols": "^1.1.0", + "which-boxed-primitive": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "license": "MIT" + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/unrs-resolver": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/unrs-resolver/-/unrs-resolver-1.11.1.tgz", + "integrity": "sha512-bSjt9pjaEBnNiGgc9rUiHGKv5l4/TGzDmYw3RhnkJGtLhbnnA/5qJj7x3dNDCRx/PJxu774LlH8lCOlB4hEfKg==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "peer": true, + "dependencies": { + "napi-postinstall": "^0.3.0" + }, + "funding": { + "url": "https://opencollective.com/unrs-resolver" + }, + "optionalDependencies": { + "@unrs/resolver-binding-android-arm-eabi": "1.11.1", + "@unrs/resolver-binding-android-arm64": "1.11.1", + "@unrs/resolver-binding-darwin-arm64": "1.11.1", + "@unrs/resolver-binding-darwin-x64": "1.11.1", + "@unrs/resolver-binding-freebsd-x64": "1.11.1", + "@unrs/resolver-binding-linux-arm-gnueabihf": "1.11.1", + "@unrs/resolver-binding-linux-arm-musleabihf": "1.11.1", + "@unrs/resolver-binding-linux-arm64-gnu": "1.11.1", + "@unrs/resolver-binding-linux-arm64-musl": "1.11.1", + "@unrs/resolver-binding-linux-ppc64-gnu": "1.11.1", + "@unrs/resolver-binding-linux-riscv64-gnu": "1.11.1", + "@unrs/resolver-binding-linux-riscv64-musl": "1.11.1", + "@unrs/resolver-binding-linux-s390x-gnu": "1.11.1", + "@unrs/resolver-binding-linux-x64-gnu": "1.11.1", + "@unrs/resolver-binding-linux-x64-musl": "1.11.1", + "@unrs/resolver-binding-wasm32-wasi": "1.11.1", + "@unrs/resolver-binding-win32-arm64-msvc": "1.11.1", + "@unrs/resolver-binding-win32-ia32-msvc": "1.11.1", + "@unrs/resolver-binding-win32-x64-msvc": "1.11.1" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", + "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT", + "optional": true + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/uuid": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz", + "integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/esm/bin/uuid" + } + }, + "node_modules/v8-to-istanbul": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", + "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/walker": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "makeerror": "1.0.12" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause" + }, + "node_modules/websocket-driver": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz", + "integrity": "sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==", + "license": "Apache-2.0", + "dependencies": { + "http-parser-js": ">=0.5.1", + "safe-buffer": ">=5.1.0", + "websocket-extensions": ">=0.1.1" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/websocket-extensions": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz", + "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", + "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-bigint": "^1.1.0", + "is-boolean-object": "^1.2.1", + "is-number-object": "^1.1.1", + "is-string": "^1.1.1", + "is-symbol": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-builtin-type": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz", + "integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "function.prototype.name": "^1.1.6", + "has-tostringtag": "^1.0.2", + "is-async-function": "^2.0.0", + "is-date-object": "^1.1.0", + "is-finalizationregistry": "^1.1.0", + "is-generator-function": "^1.0.10", + "is-regex": "^1.2.1", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.1.0", + "which-collection": "^1.0.2", + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-collection": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", + "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-map": "^2.0.3", + "is-set": "^2.0.3", + "is-weakmap": "^2.0.2", + "is-weakset": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.19", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.19.tgz", + "integrity": "sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "for-each": "^0.3.5", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "devOptional": true, + "license": "ISC" + }, + "node_modules/write-file-atomic": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.1.tgz", + "integrity": "sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "devOptional": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC", + "peer": true + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "devOptional": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/software/functions/package.json b/software/functions/package.json new file mode 100644 index 00000000..a0a54d7f --- /dev/null +++ b/software/functions/package.json @@ -0,0 +1,31 @@ +{ + "name": "functions", + "scripts": { + "lint": "eslint --ext .js,.ts .", + "build": "tsc", + "build:watch": "tsc --watch", + "serve": "npm run build && firebase emulators:start --only functions", + "shell": "npm run build && firebase functions:shell", + "start": "npm run shell", + "deploy": "firebase deploy --only functions", + "logs": "firebase functions:log" + }, + "engines": { + "node": "24" + }, + "main": "lib/index.js", + "dependencies": { + "firebase-admin": "^13.6.0", + "firebase-functions": "^7.0.0" + }, + "devDependencies": { + "@typescript-eslint/eslint-plugin": "^5.12.0", + "@typescript-eslint/parser": "^5.12.0", + "eslint": "^8.9.0", + "eslint-config-google": "^0.14.0", + "eslint-plugin-import": "^2.25.4", + "firebase-functions-test": "^3.4.1", + "typescript": "^5.7.3" + }, + "private": true +} diff --git a/software/functions/src/device/listeners/devicelist.ts b/software/functions/src/device/listeners/devicelist.ts new file mode 100644 index 00000000..dab25039 --- /dev/null +++ b/software/functions/src/device/listeners/devicelist.ts @@ -0,0 +1,30 @@ +import * as functions from 'firebase-functions'; +import {firestore} from 'firebase-admin'; + +// Minimize Firestore reads by caching device IDs and metadata. + +type DeviceData = { + owner: string, + name: string, + latest: { + project: string, + run: string, + }, +} + +export const devices: {[key: string]: DeviceData} = {}; + +// Get initial set of registered devices +firestore().collection('devices').get().then((docs)=>{ + docs.docs.forEach((doc)=>{ + devices[doc.id] = {...(doc.data() as DeviceData)}; + }); +}); + +export const deviceCreationListener = functions.firestore.document('devices/{deviceID}').onCreate((doc)=>{ + devices[doc.id] = {...(doc.data() as DeviceData)}; +}); + +export const deviceDeletionListener = functions.firestore.document('devices/{deviceID}').onDelete((doc)=>{ + delete devices[doc.id]; +}); diff --git a/software/functions/src/device/listeners/pubsub.ts b/software/functions/src/device/listeners/pubsub.ts new file mode 100644 index 00000000..a8f19bcd --- /dev/null +++ b/software/functions/src/device/listeners/pubsub.ts @@ -0,0 +1,75 @@ +import * as functions from 'firebase-functions'; +import {firestore} from 'firebase-admin'; + +import {devices} from './devicelist'; + +// Message Attributes: +// - `deviceid`: ID of device as it appears in IoT registry AND Firestore document +// - `owner`: UID of user who registered the device + +type PubSubData = { + [key: string]: { + batch: { + timestamp: number, + value: number + }[] + } +} + +export const dataPubSubListener = functions.pubsub.topic('data').onPublish(async (message)=>{ + // try { + // let temp = message.json; + // } catch (e) { + // functions.logger.error('PubSub message was not JSON', e); + // return; + // } + + // TODO: Send STOP command (or something like that) on fatal errors + + const data = message.json.data as PubSubData; + const metadata = message.json.metadata as {project: string, run: string, owner: string}; + + if (!message.json || !metadata.owner || !metadata.project || !metadata.run) { + functions.logger.error(`Device published incomplete message.`, message); + return; + } + + if (!Object.keys(devices).includes(message.attributes.deviceId)) { + functions.logger.error(`Unregistered device '${message.attributes.deviceId}' attempted to publish data.`, devices); + return; + } + + if (devices[message.attributes.deviceId].owner != metadata.owner) { + functions.logger.error(`Decvice '${message.attributes.deviceId}' and`+ + ` owner '${metadata.owner}' do not match records.`, devices); + return; + } + + + const rundoc = await firestore().doc(`projects/${metadata.project}/runs/${metadata.run}`) + .get(); + + // Create run document + if (!rundoc.exists) { + rundoc.ref.create({ + owner: metadata.owner, + device: message.attributes.deviceId, + }); + } + + // New project? + if (devices[message.attributes.deviceId].latest.project != metadata.project || + devices[message.attributes.deviceId].latest.run != metadata.run) { + await firestore().doc(`devices/${message.attributes.deviceId}`).update({ + latest: { + project: metadata.project, + run: metadata.run, + }, + }); + } + + return Object.keys(data).map((label)=> + firestore() + .collection(`projects/${metadata.project}/runs/${metadata.run}/${label}/`) + .add({...data[label], timestamp: firestore.FieldValue.serverTimestamp()})); +}); diff --git a/software/functions/src/device/routes/registerDevice.ts b/software/functions/src/device/routes/registerDevice.ts new file mode 100644 index 00000000..22c6c006 --- /dev/null +++ b/software/functions/src/device/routes/registerDevice.ts @@ -0,0 +1,109 @@ +import * as functions from 'firebase-functions'; + +import * as iot from '@google-cloud/iot'; +import {v4 as uuid} from 'uuid'; +import {pki} from 'node-forge'; +import {firestore} from 'firebase-admin'; + +// Found at https://console.cloud.google.com/iot/registries +const gcpproject = 'cloudponics-bc383'; +const cloudregion = 'us-central1'; +const registryid = 'CloudPonics'; + +// Client SDKs +const iotClient = new iot.DeviceManagerClient(); + +type DeviceRegistrationData = { + name: string +} | null; + +export const registerDevice = functions.https.onCall(async (data: DeviceRegistrationData, context) => { + if (!context.auth || !context.auth.uid) { + throw new functions.https.HttpsError('unauthenticated', 'Not authenticated.'); + } + + const userdoc = await firestore().doc(`users/${context.auth.uid}`).get(); + + if (userdoc.get('devicecount') >= userdoc.get('devicequota')) { + throw new functions.https.HttpsError('resource-exhausted', 'Device quota exceeded.'); + } + + // Generate unique device identifier + const deviceid = 'peapod-'+uuid(); + + const {privateKey, publicKey} = pki.rsa.generateKeyPair(4096); + + // Build registry path + const registryPath = iotClient.registryPath(gcpproject, cloudregion, registryid); + + // Build IoT registry device creation request object + const request : iot.protos.google.cloud.iot.v1.ICreateDeviceRequest = { + parent: registryPath, + device: { + id: deviceid, + metadata: { + owner: context.auth?.uid, + }, + credentials: [ + { + publicKey: { + format: 'RSA_PEM', + key: pki.publicKeyToPem(publicKey), + }, + }, + ], + }, + }; + + // Create device + const [response] = await iotClient.createDevice(request); + + await firestore().doc('devices/'+response.id).create({ + owner: context.auth?.uid, + name: data?.name ?? 'PeaPod', + latest: { + project: '', + run: '', + }, + }); + + await firestore().doc('users/'+context.auth.uid).update({ + devicecount: firestore.FieldValue.increment(1), + }); + + return {id: response.id, name: response.name, privateKey: pki.privateKeyToPem(privateKey)}; +}); + +type DeviceUnregistrationData = { + deviceid: string +} + + +export const unregisterDevice = functions.https.onCall(async (data: DeviceUnregistrationData, context) => { + if (!context.auth || !context.auth.uid) { + throw new functions.https.HttpsError('unauthenticated', 'Not authenticated.'); + } + + const devicedoc = await firestore().doc(`devices/${data.deviceid}`).get(); + + if (!devicedoc.exists) { + throw new functions.https.HttpsError('invalid-argument', 'Device does not exist'); + } + + if (devicedoc.get('owner') != context.auth.uid) { + throw new functions.https.HttpsError('permission-denied', 'Permission denied'); + } + + await iotClient.deleteDevice({name: iotClient.devicePath( + gcpproject, + cloudregion, + registryid, + data.deviceid + )}); + + await devicedoc.ref.delete(); + + await firestore().doc('users/'+context.auth.uid).update({ + devicecount: firestore.FieldValue.increment(-1), + }); +}); diff --git a/software/functions/src/device/routes/uploadFile.ts b/software/functions/src/device/routes/uploadFile.ts new file mode 100644 index 00000000..44c88a92 --- /dev/null +++ b/software/functions/src/device/routes/uploadFile.ts @@ -0,0 +1,22 @@ +import * as functions from 'firebase-functions'; + +import {Storage} from '@google-cloud/storage'; + +type FileUploadData = { + deviceId: string, + filename: string, + project: string, + run: string, + file: string | Buffer +} + +const storage = new Storage(); + +export const uploadFile = functions.https.onCall(async (data: FileUploadData, context) => { + if (!context.auth) { + throw new functions.https.HttpsError('unauthenticated', 'Not authenticated.'); + } + + const bucket = storage.bucket(`projects/${data.project}/runs/${data.run}`).file(data.filename); + return bucket.save(data.file); +}); diff --git a/software/functions/src/index.ts b/software/functions/src/index.ts new file mode 100644 index 00000000..db18e102 --- /dev/null +++ b/software/functions/src/index.ts @@ -0,0 +1,8 @@ +import * as admin from 'firebase-admin'; +admin.initializeApp(); + +export {deviceCreationListener, deviceDeletionListener} from './device/listeners/devicelist'; +export * from './device/listeners/pubsub'; +export * from './device/routes/registerDevice'; +export * from './webapp/listeners/auth'; +export * from './webapp/routes/routes'; diff --git a/software/functions/src/webapp/listeners/auth.ts b/software/functions/src/webapp/listeners/auth.ts new file mode 100644 index 00000000..66b6fcab --- /dev/null +++ b/software/functions/src/webapp/listeners/auth.ts @@ -0,0 +1,32 @@ +import * as functions from 'firebase-functions'; +import {firestore} from 'firebase-admin'; + +export const newUser = functions.auth.user().onCreate((user)=>{ + return firestore().doc(`users/${user.uid}`).create({ + devicequota: 1, + devicecount: 0, + }); +}); + +/** + * On user account deletion, deletes user doc and removes access from projects and runs + */ +export const deleteUser = functions.auth.user().onDelete((user)=>{ + return [ + firestore().doc(`users/${user.uid}`).delete(), + firestore().collection('projects').where('owners', 'array-contains', user.uid).get().then((docs)=>{ + docs.docs.forEach((doc)=>{ + firestore().collection(`projects/${doc.id}/runs`).where('owner', '==', user.uid).get().then((rundocs)=>{ + rundocs.docs.forEach((rundoc)=>{ + rundoc.ref.update({ + owner: undefined, + }); + }); + }); + doc.ref.update({ + owners: firestore.FieldValue.arrayRemove(user.uid), + }); + }); + }), + ]; +}); diff --git a/software/functions/src/webapp/routes/routes.ts b/software/functions/src/webapp/routes/routes.ts new file mode 100644 index 00000000..935222f7 --- /dev/null +++ b/software/functions/src/webapp/routes/routes.ts @@ -0,0 +1,21 @@ +import * as functions from 'firebase-functions'; +import {firestore} from 'firebase-admin'; + +type GetDatasetsParams = { + project: string, + run: string +} + +export const getDatasets = functions.https.onCall(async (data: GetDatasetsParams, context)=>{ + if (!context.auth || !context.auth.uid) { + throw new functions.https.HttpsError('unauthenticated', 'Not authenticated.'); + } + + const rundoc = await firestore().doc(`projects/${data.project}/runs/${data.run}`).get(); + + if (rundoc.get('owner') != context.auth.uid) { + throw new functions.https.HttpsError('permission-denied', 'Permission denied'); + } + + return (await rundoc.ref.listCollections()).map((set)=>set.id); +}); diff --git a/software/functions/tsconfig.dev.json b/software/functions/tsconfig.dev.json new file mode 100644 index 00000000..7560eed4 --- /dev/null +++ b/software/functions/tsconfig.dev.json @@ -0,0 +1,5 @@ +{ + "include": [ + ".eslintrc.js" + ] +} diff --git a/software/functions/tsconfig.json b/software/functions/tsconfig.json new file mode 100644 index 00000000..57b915f3 --- /dev/null +++ b/software/functions/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "esModuleInterop": true, + "moduleResolution": "nodenext", + "noImplicitReturns": true, + "noUnusedLocals": true, + "outDir": "lib", + "sourceMap": true, + "strict": true, + "target": "es2017" + }, + "compileOnSave": true, + "include": [ + "src" + ] +} diff --git a/software/index.ts b/software/index.ts deleted file mode 100644 index b3057b5f..00000000 --- a/software/index.ts +++ /dev/null @@ -1,205 +0,0 @@ -#!/usr/bin/env node -import chalk from 'chalk'; //Colored CLI text -import { DeviceFlowUIOptions } from '@peapodtech/firebasedeviceflow'; //Firebase Auth via OAuth2 'Device Flow' -import { initializeApp, getApps } from 'firebase/app'; -import { getAuth } from 'firebase/auth'; -import PiCamera from 'pi-camera'; - -import PeaPodArduinoInterface, { IPeaPodArduino } from './lib/PeaPodArduino'; -import PeaPodPubSub, { IoTConfig, IPeaPodPublisher, PeaPodDataBatch } from './lib/PeaPodPublisher'; -import { ArduinoSimulator, PeaPodLogger } from './lib/PeaPodSimulator'; - -import { checkInternet, sleep, loadDotenv, findSerialPath } from './lib/utils'; //Utilities -import Spinner from './lib/ui'; //UI utils -import PeaPodCamera, { IPeaPodCamera } from './lib/PeaPodCamera'; - -// Global State - -function main(): Promise { - - // SETUP - - // Load environment variables - loadDotenv(); - - // CONSTANTS - const firebaseConfig = { - apiKey: process.env.FIREBASE_APIKEY, - authDomain: process.env.FIREBASE_AUTHDOMAIN, - databaseURL: process.env.FIREBASE_DATABASEURL, - projectId: process.env.FIREBASE_PROJECTID, - storageBucket: process.env.FIREBASE_STORAGEBUCKET, - messagingSenderId: process.env.FIREBASE_MESSAGINGSENDERID, - appId: process.env.FIREBASE_APPID, - measurementId: process.env.FIREBASE_MEASUREMENTID - }; - - const iotConfig : IoTConfig = { - cloudregion: 'us-central1', - projectid: 'cloudponics-bc383', - registryid: 'CloudPonics', - jwtexpiryminutes: 1440, - }; - - const authConfig : DeviceFlowUIOptions = { - Google : { - scopes : process.env.GOOGLE_SCOPES?.split(' '), - clientid : process.env.GOOGLE_CLIENTID, - clientsecret : process.env.GOOGLE_CLIENTSECRET - }, - GitHub : { - scopes : process.env.GITHUB_SCOPES?.split(' '), - clientid : process.env.GITHUB_CLIENTID, - clientsecret : process.env.GITHUB_CLIENTSECRET - } - }; - - const RTCServers = { - iceServers: [ - { - urls: ['stun:stun1.l.google.com:19302', 'stun:stun2.l.google.com:19302'], - }, - ], - iceCandidatePoolSize: 10, - }; - - // Seconds between data batch publications - const batchPublishInterval = 5; - - // IN PRODUCTION: fetch serial port with findSerialPath - const simulated = process.argv.includes('simulate'); - const offline = process.argv.includes('offline'); - - let arduino : IPeaPodArduino, publisher : IPeaPodPublisher, camera: IPeaPodCamera | null; - - Spinner.info(`Running in ${chalk.bold(simulated ? 'Simulated' : 'Live')} mode with ${chalk.bold(offline ? 'Local Filesystem' : 'Google Cloud')} publishing.`); - - return new Promise(async (res, rej)=>{ - - if(simulated){ - arduino = new ArduinoSimulator({ - air_temperature: { - min: 10, - max: 20, - interval: 2000 - }, - water_level: { - min: 0, - max: 1, - interval: 1000 - } - }); - - camera = null; - } else { - let serialpath; - if(process.env.SERIALPORT){ - Spinner.info('Using serial port: '+process.env.SERIALPORT); - serialpath = process.env.SERIALPORT; - } else { - Spinner.start('Finding Arduino serial port...'); - serialpath = await findSerialPath(); - Spinner.succeed('Arduino serial port found: '+serialpath); - } - - arduino = new PeaPodArduinoInterface(serialpath); - camera = new PeaPodCamera; - } - if (offline) { - publisher = new PeaPodLogger(); - } else { - // Check Internet connection - Spinner.start(`Checking for ${chalk.blue('Internet')} connection...'`); - if(!(await checkInternet())){ - Spinner.fail(`Could not connect to the ${chalk.blue('Internet')}! Running in ${chalk.bold('Offline')} mode.`); - publisher = new PeaPodLogger(); - } else { - Spinner.succeed(`Connected to the ${chalk.blue('Internet')}!`); - - // Connect to Firebase - initializeApp(firebaseConfig); - - publisher = new PeaPodPubSub(iotConfig, authConfig); - } - await sleep(1500); - } - - let batch: PeaPodDataBatch = {}; - let batchInterval: NodeJS.Timer; - - // Initialize publisher (ready for Arduino), fetch initial instructions - publisher.start(config=>{ - console.log("[CONFIG] - "+config); - // TODO: Respond to config (update instructions) - }, command=>{ - console.log("[COMMAND] - "+command); - // TODO: Respond to commands (immediate actions) - if(command.type == 'livestreamoffer'){ - - // Assumes webcam hardware has been initialized - - // 1. Create answer from command data - // 2. Call cloud function with answer - // 3. Enable video feed - - // camera?.stream().pipe(); - - /** - * { - * type: 'livestreamoffer', - * data: {...} - * } - */ - - } - }).then(({projectid, projectname, run})=>{ - // Get program - - // Initialize Arduino communications interface - arduino.start((msg)=>{ - if(msg.type == 'data') { - // Initialize batch array - if(batch[msg.data.label] === undefined) batch[msg.data.label] = {batch: []}; - batch[msg.data.label].batch.push({ - timestamp: Date.now(), - value: msg.data.value - }) - - // TODO: Plan, act - } else { - Spinner.info(`[${chalk.blueBright('ARDUINO')} | ${msg.type.toUpperCase()}] - ${JSON.stringify(msg.data)}`) - } - // TODO: publish other message types - }).then(()=>{ - Spinner.info(`${chalk.green('PeaPod')} start - Project ${chalk.bold(projectname ?? projectid)}, Run ${chalk.bold(run)}`); - batchInterval = setInterval(()=>{ - // Publish entire batch - try{ - publisher.publish({ - type: 'data', - metadata: { - owner: (getAuth().currentUser?.uid ?? 'user'), - project: projectid, - run - }, - data: batch - }); - } catch { - Spinner.fail('Batch publish failed, will retry...'); - return; - } - - console.log(`[${chalk.magenta('PUBLISH')}] - Batch of ${Object.values(batch).reduce((sum, entry)=>{return sum+entry.batch.length}, 0)} datapoints published.`); - - // Reset batch to empty - batch = {}; - }, batchPublishInterval*1000); - }).catch(e=>{rej(e)}); - }).catch(e=>{rej(e)}); - }); -} - -main().catch((err: Error)=>{ - Spinner.fail(err.message); - process.exit(1); -}); \ No newline at end of file diff --git a/software/jest.config.js b/software/jest.config.js new file mode 100644 index 00000000..8cbf8940 --- /dev/null +++ b/software/jest.config.js @@ -0,0 +1,5 @@ +/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', +}; \ No newline at end of file diff --git a/software/lib/PeaPodArduino.ts b/software/lib/PeaPodArduino.ts deleted file mode 100644 index 2b7bd1e5..00000000 --- a/software/lib/PeaPodArduino.ts +++ /dev/null @@ -1,98 +0,0 @@ -import { PeaPodMessage } from './PeaPodPublisher'; -import SerialPort from 'serialport'; -import { ArduinoInstructionsError, RevisionError } from './errors'; -import Spinner from './ui'; -import chalk from 'chalk'; - -const BAUDRATE = 115200; -const ARDUINO_REVISION = "0"; - -/** -* Abstract base type for any PeaPod message source. -*/ -export type IPeaPodArduino = { - /** - * Establish communications with the Arduino. - * @param onMessage Pipe recieved messages. - */ - start(onMessage : (msg : ArduinoMessage) => void): Promise - /** - * Halt communications. - */ - stop(): void; -}; - -/** -* Expanded message type to include all types of messages from the Arduino -*/ -export type ArduinoMessage = { - type: 'revision' | 'info' | 'debug' | 'error', - data: any -} | { - type: 'data', - data: { - label: string, - value: number - } -} - -type ArduinoInstructions = { - [key: string]: number; -} - -/** -* Interface between this computer and the Arduino. -*/ -export default class PeaPodArduinoInterface implements IPeaPodArduino{ - serial : SerialPort; - parser : SerialPort.parsers.Readline; - constructor(readonly serialpath: string, private initialInstructions: ArduinoInstructions = {}){ - // Open the serial port - this.serial = new SerialPort(serialpath, { - baudRate: BAUDRATE, - autoOpen: false - }); - - // Create the newline parser - this.parser = this.serial.pipe(new SerialPort.parsers.Readline({ - delimiter: '\n', - includeDelimiter: false - })); - } - async start(onMessage : (msg : ArduinoMessage) => void): Promise { - this.serial.open(err=>{if(err){throw err};}); - - // Set up the listener - this.parser.on('data', msgtxt =>{ - try{ - // Parse the raw text as a JSON object. - const msg = JSON.parse(msgtxt) as ArduinoMessage; - // Handle all message types except: 'info', 'data', 'debug', 'error' - switch (msg.type) { - case 'revision': - onMessage(msg); - if((msg.data as typeof ARDUINO_REVISION) == ARDUINO_REVISION){ - this.write(this.initialInstructions); - } else { - // TODO: Update Arduino if revision does not match - throw new RevisionError(ARDUINO_REVISION, msg.data as string); - } - break; - default: - onMessage(msg); - break; - } - } catch (err) { - } - }); - } - write(msg : any){ - Spinner.info(`[${chalk.yellow('WRITE')}] - ${JSON.stringify(msg)}`); - if(!this.serial?.write(JSON.stringify(msg)+'\n')){ - throw new ArduinoInstructionsError(JSON.stringify(msg)); - } - } - stop() { - this.serial.close(); - } -} \ No newline at end of file diff --git a/software/lib/PeaPodCamera.ts b/software/lib/PeaPodCamera.ts deleted file mode 100644 index 18116505..00000000 --- a/software/lib/PeaPodCamera.ts +++ /dev/null @@ -1,27 +0,0 @@ -import child from 'child_process'; -import { Readable } from 'node:stream' - -export type IPeaPodCamera = { - stream(options?: PeaPodCameraOptions): Readable; -} - -export type PeaPodCameraOptions = { - height: number; - width: number; -} - -export default class PeaPodCamera { - stream(options: PeaPodCameraOptions = {height: 480, width: 852}){ - return child.spawn('raspivid', [ - '--nopreview', - '--width', - `${options.width}`, - '--height', - `${options.height}`, - '-o', - '-' - ], { - stdio: ['ignore', 'pipe', 'inherit'] - }).stdout; - } -} \ No newline at end of file diff --git a/software/lib/PeaPodPublisher.ts b/software/lib/PeaPodPublisher.ts deleted file mode 100644 index 8a41cdce..00000000 --- a/software/lib/PeaPodPublisher.ts +++ /dev/null @@ -1,272 +0,0 @@ -import * as jwt from 'jsonwebtoken'; -import * as fs from 'fs'; -import * as mqtt from 'mqtt'; -import Spinner from './ui'; //UI utils -import { getApp } from 'firebase/app'; -import { getFunctions, httpsCallable } from 'firebase/functions'; -import { getFirestore, doc, setDoc, collection, getDocs, query, where, DocumentReference } from 'firebase/firestore'; -import { getAuth } from 'firebase/auth'; -import { fetchServerCert } from './utils'; -import * as inquirer from 'inquirer'; -import {v4 as uuid} from 'uuid'; -import { DeviceFlowUI, DeviceFlowUIOptions } from '@peapodtech/firebasedeviceflow'; //Firebase Auth via OAuth2 'Device Flow' -import chalk from 'chalk'; - -export type PeaPodDataBatch = { - [key: string]: { - batch: { - timestamp: number, - value: number - }[] - } -} - -// PeaPod Message to Cloud -export type PeaPodMessage = { - type: 'info' | 'debug' | 'error', - data: any -} | { - type: 'data', - metadata: { - owner: string, - project: string, - run: string - } - data: PeaPodDataBatch -} - -export type PeaPodCommand = { - type: 'livestreamoffer', - data: any - // TODO: import types from WebRTC -} - -/** -* Abstract base class for any PeaPod message destination. -*/ -export type IPeaPodPublisher = { - start(onConfig?: (message: string)=>void, onCommand?: (message: PeaPodCommand)=>void) : Promise<{projectid: string, projectname?: string, run: string}>, - stop(): void; - publish(msg : PeaPodMessage) : void -} - -type RegisterResponse = { - id: string, - name: string, - privateKey: string -} - -export type IoTConfig = { - deviceid?: string, - projectid: string, - cloudregion: string, - registryid: string, - jwtexpiryminutes: number -} - -export default class PeaPodPubSub implements IPeaPodPublisher { - private tokenRefreshInterval?: NodeJS.Timer; - private mqttclient?: mqtt.MqttClient; - private deviceId: string = ''; - constructor(readonly iotConfig: IoTConfig, readonly authConfig: DeviceFlowUIOptions){} - publish(msg: PeaPodMessage): void { - if(!this.mqttclient || !this.mqttclient.connected){ - throw new Error('MQTT client not connected!'); - } - // Build topic path - const topic = `/devices/${this.deviceId}/` + (msg.type == 'data' ? 'events/data' : msg.type == 'info' ? 'events' : 'state'); - // Strip type from published object - this.mqttclient.publish(topic, JSON.stringify({...msg, type: undefined}), {qos: 1}); - } - async start(onConfig: (message: string)=>void, onCommand: (message: PeaPodCommand)=>void) { - let privatekey = ''; - - // Authenticate the user with Firebase - const auth = new DeviceFlowUI(getApp(), this.authConfig); - const user = await auth.signIn(); - if(user.displayName){ - Spinner.info(`Welcome, ${chalk.bold(user.displayName)}!`); - } else { - Spinner.info('Welcome!'); - } - - if(fs.existsSync('./rsa_private.pem') && fs.existsSync('./deviceInfo.json')){ - Spinner.succeed('Private key and device info found!'); - privatekey = fs.readFileSync('./rsa_private.pem').toString(); - let deviceinfo = JSON.parse(fs.readFileSync('./deviceInfo.json').toString()); - this.deviceId = deviceinfo['id']; - if(deviceinfo['owner'] != user.uid){ - throw new Error('This PeaPod is not owned by this user!'); - } - } else { - Spinner.info('Private key and/or device info not found!'); - Spinner.start('Registering device...'); - const registerDevice = httpsCallable(getFunctions(), 'registerDevice'); - let result = (await registerDevice()).data; - Spinner.succeed('Device '+(result.id) + ' registered!'); - - fs.writeFileSync('./rsa_private.pem', result.privateKey); - fs.writeFileSync('./deviceInfo.json', JSON.stringify({name: result.name, id: result.id, owner: getAuth().currentUser?.uid}, null, 2)); - privatekey = result.privateKey; - this.deviceId = result.id; - } - - Spinner.start('Fetching Google root CA certificates...'); - const servercert = await fetchServerCert(); - Spinner.succeed('Certificates fetched!'); - - const [project, projectname] = await this.selectProject(); - const run = await this.createRun(project); - - Spinner.start('Connecting to MQTT broker...'); - await this.connect(servercert, this.refreshToken(privatekey)); - Spinner.succeed('Device connected!'); - - // Token Refresh - this.tokenRefreshInterval = setInterval(async ()=>{ - Spinner.start('Refreshing token...'); - await this.connect(servercert, this.refreshToken(privatekey)); - Spinner.succeed('Token refreshed. Reconnected.'); - }, this.iotConfig.jwtexpiryminutes*60*1000); - - // Message listeners - this.mqttclient?.subscribe(`/devices/${this.deviceId}/config`, {qos: 1}); - this.mqttclient?.subscribe(`/devices/${this.deviceId}/commands/#`, {qos: 0}); - - this.mqttclient?.on('error', err => { throw err }); - this.mqttclient?.on('message', (topic, message) => { - if (topic === `/devices/${this.deviceId}/config`) { - onConfig(message.toString()); - } else if (topic.startsWith(`/devices/${this.deviceId}/commands`)) { - onCommand(JSON.parse(message.toString()) as PeaPodCommand); - } - }); - - return {projectid: project.id, projectname, run: run.id} - } - - /** - * Select a project owned by the current user - * @returns {Promise<[DocumentReference, string]>} - */ - private async selectProject(): Promise<[DocumentReference, string]> { - const myProjects = query(collection(getFirestore(), 'projects'), where('owners', 'array-contains', getAuth().currentUser?.uid)); - const projects = (await getDocs(myProjects)).docs; - if(projects.length < 1){ - throw new Error("No projects found! Create one first."); - } - const ref = (await inquirer.prompt<{ref: [DocumentReference, string]}>([ - { - type: 'list', - name: 'ref', - message: 'Select a project:', - choices: projects.map(project=>({name: project.get('name')+' - '+project.id, value: [project.ref, project.get('name')]})) - } - ])).ref; - return ref; - } - - /** - * Publish a new project. - * @returns {Promise} The project. - */ - private async createRun(project : DocumentReference) : Promise { - const runid = project.id+'-'+uuid(); - const rundoc = doc(getFirestore(), project.path+'/runs/'+runid); - setDoc(rundoc, { - owner: getAuth().currentUser?.uid, - deviceId: this.deviceId, - }); - // console.log(`New run ${runid} on project ${project.id} generated successfully.`); - return rundoc; - } - - /** - * Select a run owned by the current user under a given project. - * @returns {Promise} - */ - async selectRun(project : DocumentReference){ - const myRuns = query(collection(getFirestore(), project.path+'/runs'), where('owner', '==', getAuth().currentUser?.uid)); - const runs = ((await getDocs(myRuns)).docs.map(doc=>({id: doc.id,ref: doc.ref}))); - if(runs.length == 0){ - throw new Error("No runs found! Create one first."); - } - const ref = (await inquirer.prompt<{ref: DocumentReference}>([ - { - type: 'list', - name: 'ref', - message: 'Select a run:', - choices: runs.map(run=>({name: run.id, value: run.ref})) - } - ])).ref; - return ref; - } - - /** - * Sign a new JWT. - * @returns JSON Web Token string payload. - */ - private refreshToken(privatekey: string) : string { - const now = Date.now() / 1000; - const token = { - iat: now, - exp: now + this.iotConfig.jwtexpiryminutes * 60, - aud: this.iotConfig.projectid, - }; - return jwt.sign(token, privatekey, {algorithm: 'RS256'}); - } - - /** - * Connect to the MQTT broker. - * @param servercert Root CA certificate. - * @param deviceid ID of this device. - * @returns The MQTT client. - */ - private async connect(servercert: string, password: string): Promise { - // Disconnect existing client - this.disconnect(); - - let client = mqtt.connect({ - host: 'mqtt.googleapis.com', - port: 8883, - clientId: `projects/${this.iotConfig.projectid}/locations/${this.iotConfig.cloudregion}/registries/${this.iotConfig.registryid}/devices/${this.deviceId}`, - username: 'unused', - password: password, - protocol: 'mqtts', - secureProtocol: 'TLSv1_2_method', - ca: [servercert], - }); - - return new Promise((res)=>{ - client.on('connect', packet => { - if (!packet) { - throw new Error('Could not connect to MQTT broker!'); - } - this.mqttclient = client; - res(); - }); - }); - } - - /** - * If the MQTT client is connected, disconnect it. - */ - private async disconnect(): Promise{ - if(this.mqttclient && this.mqttclient.connected){ - await new Promise(res=>{ - this.mqttclient?.end(true, undefined, (err)=>{ - if(err) { - throw err; - } else { - res(); - } - }); - }); - } - } - - stop() { - if(this.tokenRefreshInterval) clearInterval(this.tokenRefreshInterval); - if(this.mqttclient) this.disconnect(); - } -} \ No newline at end of file diff --git a/software/lib/PeaPodSimulator.ts b/software/lib/PeaPodSimulator.ts deleted file mode 100644 index d0e4bf89..00000000 --- a/software/lib/PeaPodSimulator.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { IPeaPodArduino, ArduinoMessage } from './PeaPodArduino'; -import { IPeaPodPublisher, PeaPodMessage } from './PeaPodPublisher'; -import { stringsToTuple } from './utils'; -import chalk from 'chalk'; -import { v4 as uuid} from 'uuid'; -import { existsSync, mkdirSync, writeFileSync } from 'fs'; -import Spinner from './ui'; - -// Convert our set of strings to a union type. TypeScript nonsense. -const DataLabels = stringsToTuple('air_temperature', 'water_level'); -type TDataLabels = typeof DataLabels[number]; -type SimulatorParameters = { - [key in TDataLabels]: { - min: number, - max: number, - interval: number - } -} - -function generateData(label: TDataLabels, min : number, max : number) : ArduinoMessage { - return { - type: 'data', - data: { - label: label.replace('_','-'), - value: Math.random()*(max-min)+min - } - }; -} - -/** -* A simulated Arduino for generating random data. -*/ -export class ArduinoSimulator implements IPeaPodArduino{ - intervals : NodeJS.Timeout[] = [] - constructor(public parameters : SimulatorParameters){} - async stop(): Promise { - for(const interval of this.intervals){ - clearInterval(interval); - } - } - async start(onMessage: (msg: ArduinoMessage) => any): Promise { - for(const label in this.parameters){ - this.intervals.push(setInterval(()=>{ - onMessage(generateData(label as TDataLabels, this.parameters[label as TDataLabels].min, this.parameters[label as TDataLabels].max)); - }, this.parameters[label as TDataLabels].interval)); - } - } -} - -export class PeaPodLogger implements IPeaPodPublisher{ - async start() { - let config = {projectid: 'testproject', run: 'testrun-'+uuid()}; - Spinner.info(`Logging data to ${chalk.bold('projects/'+config.projectid+'/runs/'+config.run+'/')}`); - return config; - } - stop(){}; - publish(msg: PeaPodMessage): void { - switch(msg.type){ - case 'data': - for(const label of Object.keys(msg.data)){ - for(const datum of msg.data[label].batch){ - console.log(`[${chalk.magenta(msg.type.toUpperCase())}] - [${(new Date(datum.timestamp)).toLocaleTimeString()}] - ${label}: ${datum.value}`); - } - const dir = `./projects/${msg.metadata.project}/runs/${msg.metadata.run}/${label}/`; - if (!existsSync(dir)){ - mkdirSync(dir, { recursive: true }); - } - writeFileSync(`${dir}${label+'-'+uuid()+'.json'}`, JSON.stringify(msg.data[label].batch, null, 2)) - } - break; - default: - console.log(`[${chalk.yellow(msg.type.toUpperCase())}] - ${JSON.stringify(msg.data)}`); - break; - } - - } -} \ No newline at end of file diff --git a/software/lib/errors.ts b/software/lib/errors.ts deleted file mode 100644 index 17c49495..00000000 --- a/software/lib/errors.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** -* Error on revision check. -*/ -export class RevisionError extends Error { - constructor(expected : string, received : string){ - super(`Revision check failed! Expected ${expected}, received ${received}`); - } -} - -/** -* Error on instruction send. -*/ -export class ArduinoInstructionsError extends Error { - constructor(instructions: any){ - super("Failed to send instructions to Arduino: '"+JSON.stringify(instructions)+"'"); - } -} \ No newline at end of file diff --git a/software/lib/ui.ts b/software/lib/ui.ts deleted file mode 100644 index 4f57abe4..00000000 --- a/software/lib/ui.ts +++ /dev/null @@ -1,92 +0,0 @@ -import ora from 'ora'; - -namespace Spinner { - const defaultSpinner : ora.Spinner = { - interval: 50, - frames: [ - "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", - "█▁▁▁▁▁▁▁▁▁▁▁▁▁▁", - "██▁▁▁▁▁▁▁▁▁▁▁▁▁", - "███▁▁▁▁▁▁▁▁▁▁▁▁", - "████▁▁▁▁▁▁▁▁▁▁▁", - "█████▁▁▁▁▁▁▁▁▁▁", - "▁█████▁▁▁▁▁▁▁▁▁", - "▁▁█████▁▁▁▁▁▁▁▁", - "▁▁▁█████▁▁▁▁▁▁▁", - "▁▁▁▁█████▁▁▁▁▁▁", - "▁▁▁▁▁█████▁▁▁▁▁", - "▁▁▁▁▁▁█████▁▁▁▁", - "▁▁▁▁▁▁▁█████▁▁▁", - "▁▁▁▁▁▁▁▁█████▁▁", - "▁▁▁▁▁▁▁▁▁█████▁", - "▁▁▁▁▁▁▁▁▁▁█████", - "▁▁▁▁▁▁▁▁▁▁▁████", - "▁▁▁▁▁▁▁▁▁▁▁▁███", - "▁▁▁▁▁▁▁▁▁▁▁▁▁██", - "▁▁▁▁▁▁▁▁▁▁▁▁▁▁█", - ] - } - - // Global spinner - export var Spinner: ora.Ora = ora(); - - /** - * Start the loading spinner. - * @param text Text to display. - * @param spinner Spinner to use. Defaults to the default spinner. - */ - export const start = (text: string = "", spinner: ora.Spinner = defaultSpinner) => { - // If it's already spinning, just change the text - if(Spinner.isSpinning){ - Spinner.text = text; - Spinner.spinner = spinner; - } else { - // Otherwise, start a new one - Spinner = ora({text, spinner}).start(); - } - } - - /** - * Fail the loading spinner. - * @param text Text to display. - */ - export const fail = (text: string = "") => { - // If it's spinning, change the text and fail - if(Spinner.isSpinning){ - Spinner.fail(text); - } else { - // Otherwise, start a new one and fail it - Spinner = ora({text}).fail(); - } - } - - /** - * Succeed the loading spinner. - * @param text Text to display. - */ - export const succeed = (text: string = "") => { - // If it's spinning, change the text and succeed - if(Spinner.isSpinning){ - Spinner.succeed(text); - } else { - // Otherwise, start a new one and succeed it - Spinner = ora({text}).succeed(); - } - } - - /** - * Set the loading spinner to info (blue `i`) - * @param text Text to display. - */ - export const info = (text: string = "") => { - if(Spinner.isSpinning) { - // If it's spinning, change the text and set to info - Spinner.info(text); - } else { - // Otherwise, start a new one and info it - Spinner = ora({text}).info(); - } - } -} - -export default Spinner; \ No newline at end of file diff --git a/software/lib/utils.ts b/software/lib/utils.ts deleted file mode 100644 index 2b0a44d1..00000000 --- a/software/lib/utils.ts +++ /dev/null @@ -1,87 +0,0 @@ -import * as dns from 'dns'; -import fs from 'fs'; -import dotenv from 'dotenv'; -import SerialPort from 'serialport'; -import axios from 'axios'; - -/** -* Checks the internet connectivity. -* @param {number} timeout Timeout in milliseconds. -* @param {dns.Resolver} resolver DNS Resolver object. -*/ -export const checkInternet = (timeout : number = 5000, url: string = 'www.google.com') : Promise => { - const resolver = new dns.Resolver({timeout}); - return new Promise(ret=>{ - resolver.resolve(url, err=>{ - if (err) { - ret(false); - } else { - ret(true); - } - }); - }); -}; - -/** -* Sleep a given number of milliseconds. -* -* Usage: `await sleep(x)` or `sleep(x).then(...)` -* @param millis Number of milliseconds to sleep. -* @returns -*/ -export const sleep = (millis : number) => { - return new Promise(resolve => { - setTimeout(resolve, millis); - }); -}; - -/** -* Load a `.env`-style file to `process.env`. -* -* Throws an error if the file does not exist. -*/ -export const loadDotenv = (path: string = '.env') => { - // Check for file - if(fs.existsSync(path)){ - const config = dotenv.config({path}); - if (config.error) { - throw config.error - } - } else { - throw new Error('Environment variable file not found.'); - } -}; - -/** -* Find the path to the serial port of a given device. -* -* Returns the first port matching the given parameters. -* @param manufacturer Device manufacturer name (or a substring thereof). -* -* TODO: More search fields? -* @returns Path to port. -*/ -export const findSerialPath = async (manufacturer: string = "arduino") : Promise => { - // List all ports - let ports = await SerialPort.list(); - // Search ports and find one that matches our parameters - for(const port of ports){ - if(port.manufacturer?.toLowerCase().includes(manufacturer)){ - return port.path; - } - } - throw new Error('Arduino not found! Check wiring.'); -}; - -/** -* Converts a set of strings to a tuple. Useful TypeScript nonsense. -* @param data -* @returns -*/ -export const stringsToTuple = (...data: T): T => { - return data; -}; - -export const fetchServerCert = async (): Promise => { - return (await axios.get("https://pki.goog/roots.pem")).data as string; -} \ No newline at end of file diff --git a/software/microcontroller/.gitignore b/software/microcontroller/.gitignore new file mode 100644 index 00000000..ecb27f0a --- /dev/null +++ b/software/microcontroller/.gitignore @@ -0,0 +1,3 @@ +.pio +.vscode +test/tmp_pio_test_transport.cpp \ No newline at end of file diff --git a/software/microcontroller/README.md b/software/microcontroller/README.md new file mode 100644 index 00000000..d61af70a --- /dev/null +++ b/software/microcontroller/README.md @@ -0,0 +1,104 @@ +# PeaPod Microcontroller Firmware + +# Architecture + +## Main + +**Setup**: + +1. Initialize Serial communication (115200 baud). +2. Wait for Serial connection. +3. Instantiate PeaPod modules (Air, Watering, Lighting; See Module Callbacks). +4. Print firmware `revision` to Serial. +5. Register callbacks: + 1. Cycle Callback (triggered on `Cycle` change): + 1. Set Chronograph to current time. + 2. Calculate and set `FPS` + 3. Read Serial input (DebugJson) and route commands/config. + 2. Heartbeat Callback (Chronograph interval): + 1. Print `heartbeat` message to Serial. + 2. Print firmware `revision` to Serial. + 3. Print `FPS` to Serial. + 4. Print current `Cycle` to Serial. + 3. Module Callbacks (Chronograph interval): + 1. If MUX pings and module was not present, instantiate module. Add seven segment display where applicable. Call module-check call operator and set module error level. + 2. If MUX doesn't ping, set module error level. + 3. If error level indicates hardware has been lost, de-instantiate module. + +**Loop**: Increment `Cycle` (See Cycle Callback). + +## Modules + +### Base Module + +> An abstract base class for PeaPod modules. + +Defines one namespaced abstract Module class: `PeaPodModule`, that: +- has two private Hash Tables: one for storing registered Variables, and one for storing registered Flags, +- has a public method `registerVariable` for registering Variables to the module, +- has a public method `registerFlag` for registering Flags to the module, +- implements `deviceGroupFactory`, linking all device driver classes to the module, +- implements `handleCommand`, routing JSON `GASB` commands to devices by FQA, +- implements `handleConfig`, routing JSON key-value pairs to flags/variables by name, + +### Air Module + +> Monitors and controls air quality parameters such as temperature, humidity, and CO2 levels. + +Defines three namespaced global Variables: `air_temperature`, `air_humidity`, and `air_co2`. + +Defines three namespaced global Callbacks: `callback_temperature`, `callback_humidity`, and `callback_co2` that print the respective variable values to Serial when they are updated. + +Defines one namespaced Module class: `PeaPodModuleAir`, that extends `PeaPodModule`, that: +- has two Chronograph intervals for reading sensors SHT45 and K30, +- defines two static callback functions for processing mean sensor readings from SHT45 and K30, +- on instantiation: + - sets up the Chronograph intervals to read sensors at defined intervals and set the Variables, + - sets up the Variable Callbacks to print updated values to Serial, + - registers the Variables to the module. +- on destruction: + - removes the Chronograph intervals from the Chronograph scheduler. + +### Watering Module + +> Controls the watering system. + +Defines one namespaced global Flag: `enable_watering`. + +Defines one namespaced Module class: `PeaPodModuleWatering`, that extends `PeaPodModule`, that: +- has two Chronograph intervals for setting the `enable_watering` flag to true and false, respectively, +- on instantiation: + - sets up the Chronograph intervals to set/reset the `enable_watering` flag at defined intervals and phases, + - sets up a Flag Callback to write on/off to a MCP23017 GPIO pin when the `enable_watering` flag is updated, + - sets the `enable_watering` flag to false, setting the GPIO pin to off, and disabling the watering system, + - registers the `enable_watering` Flag to the module. +- on destruction: + - sets the `enable_watering` flag to false, setting the GPIO pin to off, and disabling the watering system, + - removes the Chronograph intervals from the Chronograph scheduler. + +### Lighting Module + +> Controls the lighting system. + +Defines three namespaced global Variables: `adc_voltage`, `pwm_lighting_red`, and `pwm_lighting_blue`. + +Defines one namespaced global Flag: `enable_lighting`. + +Defines two namespaced global Callbacks: `callback_adc_read` and `callback_adc_voltage` that read the ADC value and convert it to voltage, respectively. + +Defines one namespaced Module class: `PeaPodModuleLighting`, that extends `PeaPodModule`, that: +- has three Chronograph intervals: one for reading the ADC, and two for setting the `enable_lighting` flag to true and false, respectively, +- defines two static callback functions: one for modulating the PCA9685 output based on PWM values and `enable_lighting` flag, and one for handling the `enable_lighting` flag updates (re-calling the PWM modulation callbacks), +- on instantiation: + - sets up the Chronograph intervals to set/reset the `enable_lighting` flag at defined intervals and phases, + - sets an initial value for the PWM channels, + - sets up a Chronograph interval to read the ADC and set the `adc_voltage` variable, + - sets up the ADC Variable Callbacks to read and convert ADC values to voltage and print to Serial, + - sets up a Flag Callback to gate the PWM modulation based on the `enable_lighting` flag, + - sets up two Variable Callbacks to modulate the PCA9685 outputs based on PWM values, + - sets the `enable_lighting` flag to false, setting the PWM outputs off, and disabling the lighting system, + - registers the Variables to the module, + - registers the `enable_lighting` Flag to the module. +- on destruction: + - sets the `enable_lighting` flag to false, setting the PWM outputs off, and disabling the lighting system, + - removes the Chronograph intervals from the Chronograph scheduler. \ No newline at end of file diff --git a/software/microcontroller/avrdude_gpio.conf b/software/microcontroller/avrdude_gpio.conf new file mode 100644 index 00000000..d9475693 --- /dev/null +++ b/software/microcontroller/avrdude_gpio.conf @@ -0,0 +1,14392 @@ +# $Id: avrdude.conf.in 1236 2013-09-16 19:40:15Z joerg_wunsch $ -*- text -*- +# +# AVRDUDE Configuration File +# +# This file contains configuration data used by AVRDUDE which describes +# the programming hardware pinouts and also provides part definitions. +# AVRDUDE's "-C" command line option specifies the location of the +# configuration file. The "-c" option names the programmer configuration +# which must match one of the entry's "id" parameter. The "-p" option +# identifies which part AVRDUDE is going to be programming and must match +# one of the parts' "id" parameter. +# +# Possible entry formats are: +# +# programmer +# parent # optional parent +# id = [, [, ] ...] ; # are quoted strings +# desc = ; # quoted string +# type = ; # programmer type, quoted string +# # supported programmer types can be listed by "-c ?type" +# connection_type = parallel | serial | usb +# baudrate = ; # baudrate for avr910-programmer +# vcc = [, ... ] ; # pin number(s) +# buff = [, ... ] ; # pin number(s) +# reset = ; # pin number +# sck = ; # pin number +# mosi = ; # pin number +# miso = ; # pin number +# errled = ; # pin number +# rdyled = ; # pin number +# pgmled = ; # pin number +# vfyled = ; # pin number +# usbvid = ; # USB VID (Vendor ID) +# usbpid = ; # USB PID (Product ID) +# usbdev = ; # USB interface or other device info +# usbvendor = ; # USB Vendor Name +# usbproduct = ; # USB Product Name +# usbsn = ; # USB Serial Number +# +# To invert a bit, use = ~ , the spaces are important. +# For a pin list all pins must be inverted. +# A single pin can be specified as usual = ~ , for lists +# specify it as follows = ~ ( [, ... ] ) . +# ; +# +# part +# id = ; # quoted string +# desc = ; # quoted string +# has_jtag = ; # part has JTAG i/f +# has_debugwire = ; # part has debugWire i/f +# has_pdi = ; # part has PDI i/f +# has_tpi = ; # part has TPI i/f +# devicecode = ; # deprecated, use stk500_devcode +# stk500_devcode = ; # numeric +# avr910_devcode = ; # numeric +# signature = ; # signature bytes +# chip_erase_delay = ; # micro-seconds +# reset = dedicated | io; +# retry_pulse = reset | sck; +# pgm_enable = ; +# chip_erase = ; +# chip_erase_delay = ; # chip erase delay (us) +# # STK500 parameters (parallel programming IO lines) +# pagel = ; # pin name in hex, i.e., 0xD7 +# bs2 = ; # pin name in hex, i.e., 0xA0 +# serial = ; # can use serial downloading +# parallel = ; # can use par. programming +# # STK500v2 parameters, to be taken from Atmel's XML files +# timeout = ; +# stabdelay = ; +# cmdexedelay = ; +# synchloops = ; +# bytedelay = ; +# pollvalue = ; +# pollindex = ; +# predelay = ; +# postdelay = ; +# pollmethod = ; +# mode = ; +# delay = ; +# blocksize = ; +# readsize = ; +# hvspcmdexedelay = ; +# # STK500v2 HV programming parameters, from XML +# pp_controlstack = , , ...; # PP only +# hvsp_controlstack = , , ...; # HVSP only +# hventerstabdelay = ; +# progmodedelay = ; # PP only +# latchcycles = ; +# togglevtg = ; +# poweroffdelay = ; +# resetdelayms = ; +# resetdelayus = ; +# hvleavestabdelay = ; +# resetdelay = ; +# synchcycles = ; # HVSP only +# chiperasepulsewidth = ; # PP only +# chiperasepolltimeout = ; +# chiperasetime = ; # HVSP only +# programfusepulsewidth = ; # PP only +# programfusepolltimeout = ; +# programlockpulsewidth = ; # PP only +# programlockpolltimeout = ; +# # JTAG ICE mkII parameters, also from XML files +# allowfullpagebitstream = ; +# enablepageprogramming = ; +# idr = ; # IO addr of IDR (OCD) reg. +# rampz = ; # IO addr of RAMPZ reg. +# spmcr = ; # mem addr of SPMC[S]R reg. +# eecr = ; # mem addr of EECR reg. +# # (only when != 0x3c) +# is_at90s1200 = ; # AT90S1200 part +# is_avr32 = ; # AVR32 part +# +# memory +# paged = ; # yes / no +# size = ; # bytes +# page_size = ; # bytes +# num_pages = ; # numeric +# min_write_delay = ; # micro-seconds +# max_write_delay = ; # micro-seconds +# readback_p1 = ; # byte value +# readback_p2 = ; # byte value +# pwroff_after_write = ; # yes / no +# read = ; +# write = ; +# read_lo = ; +# read_hi = ; +# write_lo = ; +# write_hi = ; +# loadpage_lo = ; +# loadpage_hi = ; +# writepage = ; +# ; +# ; +# +# If any of the above parameters are not specified, the default value +# of 0 is used for numerics or the empty string ("") for string +# values. If a required parameter is left empty, AVRDUDE will +# complain. +# +# Parts can also inherit parameters from previously defined parts +# using the following syntax. In this case specified integer and +# string values override parameter values from the parent part. New +# memory definitions are added to the definitions inherited from the +# parent. +# +# part parent # quoted string +# id = ; # quoted string +# +# ; +# +# NOTES: +# * 'devicecode' is the device code used by the STK500 (see codes +# listed below) +# * Not all memory types will implement all instructions. +# * AVR Fuse bits and Lock bits are implemented as a type of memory. +# * Example memory types are: +# "flash", "eeprom", "fuse", "lfuse" (low fuse), "hfuse" (high +# fuse), "signature", "calibration", "lock" +# * The memory type specified on the avrdude command line must match +# one of the memory types defined for the specified chip. +# * The pwroff_after_write flag causes avrdude to attempt to +# power the device off and back on after an unsuccessful write to +# the affected memory area if VCC programmer pins are defined. If +# VCC pins are not defined for the programmer, a message +# indicating that the device needs a power-cycle is printed out. +# This flag was added to work around a problem with the +# at90s4433/2333's; see the at90s4433 errata at: +# +# http://www.atmel.com/dyn/resources/prod_documents/doc1280.pdf +# +# INSTRUCTION FORMATS +# +# Instruction formats are specified as a comma seperated list of +# string values containing information (bit specifiers) about each +# of the 32 bits of the instruction. Bit specifiers may be one of +# the following formats: +# +# '1' = the bit is always set on input as well as output +# +# '0' = the bit is always clear on input as well as output +# +# 'x' = the bit is ignored on input and output +# +# 'a' = the bit is an address bit, the bit-number matches this bit +# specifier's position within the current instruction byte +# +# 'aN' = the bit is the Nth address bit, bit-number = N, i.e., a12 +# is address bit 12 on input, a0 is address bit 0. +# +# 'i' = the bit is an input data bit +# +# 'o' = the bit is an output data bit +# +# Each instruction must be composed of 32 bit specifiers. The +# instruction specification closely follows the instruction data +# provided in Atmel's data sheets for their parts. +# +# See below for some examples. +# +# +# The following are STK500 part device codes to use for the +# "devicecode" field of the part. These came from Atmel's software +# section avr061.zip which accompanies the application note +# AVR061 available from: +# +# http://www.atmel.com/dyn/resources/prod_documents/doc2525.pdf +# + +#define ATTINY10 0x10 /* the _old_ one that never existed! */ +#define ATTINY11 0x11 +#define ATTINY12 0x12 +#define ATTINY15 0x13 +#define ATTINY13 0x14 + +#define ATTINY22 0x20 +#define ATTINY26 0x21 +#define ATTINY28 0x22 +#define ATTINY2313 0x23 + +#define AT90S1200 0x33 + +#define AT90S2313 0x40 +#define AT90S2323 0x41 +#define AT90S2333 0x42 +#define AT90S2343 0x43 + +#define AT90S4414 0x50 +#define AT90S4433 0x51 +#define AT90S4434 0x52 +#define ATMEGA48 0x59 + +#define AT90S8515 0x60 +#define AT90S8535 0x61 +#define AT90C8534 0x62 +#define ATMEGA8515 0x63 +#define ATMEGA8535 0x64 + +#define ATMEGA8 0x70 +#define ATMEGA88 0x73 +#define ATMEGA168 0x86 + +#define ATMEGA161 0x80 +#define ATMEGA163 0x81 +#define ATMEGA16 0x82 +#define ATMEGA162 0x83 +#define ATMEGA169 0x84 + +#define ATMEGA323 0x90 +#define ATMEGA32 0x91 + +#define ATMEGA64 0xA0 + +#define ATMEGA103 0xB1 +#define ATMEGA128 0xB2 +#define AT90CAN128 0xB3 +#define AT90CAN64 0xB3 +#define AT90CAN32 0xB3 + +#define AT86RF401 0xD0 + +#define AT89START 0xE0 +#define AT89S51 0xE0 +#define AT89S52 0xE1 + +# The following table lists the devices in the original AVR910 +# appnote: +# |Device |Signature | Code | +# +-------+----------+------+ +# |tiny12 | 1E 90 05 | 0x55 | +# |tiny15 | 1E 90 06 | 0x56 | +# | | | | +# | S1200 | 1E 90 01 | 0x13 | +# | | | | +# | S2313 | 1E 91 01 | 0x20 | +# | S2323 | 1E 91 02 | 0x48 | +# | S2333 | 1E 91 05 | 0x34 | +# | S2343 | 1E 91 03 | 0x4C | +# | | | | +# | S4414 | 1E 92 01 | 0x28 | +# | S4433 | 1E 92 03 | 0x30 | +# | S4434 | 1E 92 02 | 0x6C | +# | | | | +# | S8515 | 1E 93 01 | 0x38 | +# | S8535 | 1E 93 03 | 0x68 | +# | | | | +# |mega32 | 1E 95 01 | 0x72 | +# |mega83 | 1E 93 05 | 0x65 | +# |mega103| 1E 97 01 | 0x41 | +# |mega161| 1E 94 01 | 0x60 | +# |mega163| 1E 94 02 | 0x64 | + +# Appnote AVR109 also has a table of AVR910 device codes, which +# lists: +# dev avr910 signature +# ATmega8 0x77 0x1E 0x93 0x07 +# ATmega8515 0x3B 0x1E 0x93 0x06 +# ATmega8535 0x6A 0x1E 0x93 0x08 +# ATmega16 0x75 0x1E 0x94 0x03 +# ATmega162 0x63 0x1E 0x94 0x04 +# ATmega163 0x66 0x1E 0x94 0x02 +# ATmega169 0x79 0x1E 0x94 0x05 +# ATmega32 0x7F 0x1E 0x95 0x02 +# ATmega323 0x73 0x1E 0x95 0x01 +# ATmega64 0x46 0x1E 0x96 0x02 +# ATmega128 0x44 0x1E 0x97 0x02 +# +# These codes refer to "BOOT" device codes which are apparently +# different than standard device codes, for whatever reasons +# (often one above the standard code). + +# There are several extended versions of AVR910 implementations around +# in the Internet. These add the following codes (only devices that +# actually exist are listed): + +# ATmega8515 0x3A +# ATmega128 0x43 +# ATmega64 0x45 +# ATtiny26 0x5E +# ATmega8535 0x69 +# ATmega32 0x72 +# ATmega16 0x74 +# ATmega8 0x76 +# ATmega169 0x78 + +# +# Overall avrdude defaults; suitable for ~/.avrduderc +# +default_parallel = "/dev/parport0"; +default_serial = "/dev/ttyS0"; +# default_bitclock = 2.5; + +# Turn off safemode by default +#default_safemode = no; + + +# +# PROGRAMMER DEFINITIONS +# + +# http://wiring.org.co/ +# Basically STK500v2 protocol, with some glue to trigger the +# bootloader. +programmer + id = "wiring"; + desc = "Wiring"; + type = "wiring"; + connection_type = serial; +; + +programmer + id = "arduino"; + desc = "Arduino"; + type = "arduino"; + connection_type = serial; +; +# this will interface with the chips on these programmers: +# +# http://real.kiev.ua/old/avreal/en/adapters +# http://www.amontec.com/jtagkey.shtml, jtagkey-tiny.shtml +# http://www.olimex.com/dev/arm-usb-ocd.html, arm-usb-tiny.html +# http://www.ethernut.de/en/hardware/turtelizer/index.html +# http://elk.informatik.fh-augsburg.de/hhweb/doc/openocd/usbjtag/usbjtag.html +# http://dangerousprototypes.com/docs/FT2232_breakout_board +# http://www.ftdichip.com/Products/Modules/DLPModules.htm,DLP-2232*,DLP-USB1232H +# http://flashrom.org/FT2232SPI_Programmer +# +# The drivers will look for a specific device and use the first one found. +# If you have mulitple devices, then look for unique information (like SN) +# And fill that in here. +# +# Note that the pin numbers for the main ISP signals (reset, sck, +# mosi, miso) are fixed and cannot be changed, since they must match +# the way the Multi-Protocol Synchronous Serial Engine (MPSSE) of +# these FTDI ICs has been designed. + +programmer + id = "avrftdi"; + desc = "FT2232D based generic programmer"; + type = "avrftdi"; + connection_type = usb; + usbvid = 0x0403; + usbpid = 0x6010; + usbvendor = ""; + usbproduct = ""; + usbdev = "A"; + usbsn = ""; +#ISP-signals - lower ADBUS-Nibble (default) + reset = 3; + sck = 0; + mosi = 1; + miso = 2; +#LED SIGNALs - higher ADBUS-Nibble +# errled = 4; +# rdyled = 5; +# pgmled = 6; +# vfyled = 7; +#Buffer Signal - ACBUS - Nibble +# buff = 8; +; +# This is an implementation of the above with a buffer IC (74AC244) and +# 4 LEDs directly attached, all active low. +programmer + id = "2232HIO"; + desc = "FT2232H based generic programmer"; + type = "avrftdi"; + connection_type = usb; + usbvid = 0x0403; +# Note: This PID is reserved for generic H devices and +# should be programmed into the EEPROM +# usbpid = 0x8A48; + usbpid = 0x6010; + usbdev = "A"; + usbvendor = ""; + usbproduct = ""; + usbsn = ""; +#ISP-signals + reset = 3; + sck = 0; + mosi = 1; + miso = 2; + buff = ~4; +#LED SIGNALs + errled = ~ 11; + rdyled = ~ 14; + pgmled = ~ 13; + vfyled = ~ 12; +; + +#The FT4232H can be treated as FT2232H, but it has a different USB +#device ID of 0x6011. +programmer parent "avrftdi" + id = "4232h"; + desc = "FT4232H based generic programmer"; + usbpid = 0x6011; +; + +programmer + id = "jtagkey"; + desc = "Amontec JTAGKey, JTAGKey-Tiny and JTAGKey2"; + type = "avrftdi"; + connection_type = usb; + usbvid = 0x0403; +# Note: This PID is used in all JTAGKey variants + usbpid = 0xCFF8; + usbdev = "A"; + usbvendor = ""; + usbproduct = ""; + usbsn = ""; +#ISP-signals => 20 - Pin connector on JTAGKey + reset = 3; # TMS 7 violet + sck = 0; # TCK 9 white + mosi = 1; # TDI 5 green + miso = 2; # TDO 13 orange + buff = ~4; +# VTG VREF 1 brown with red tip +# GND GND 20 black +# The colors are on the 20 pin breakout cable +# from Amontec +; + +# On the adapter you can read "O-Link". On the PCB is printed "OpenJTAG v3.1" +# You can find it as "OpenJTAG ARM JTAG USB" in the internet. +# (But there are also several projects called Open JTAG, eg. +# http://www.openjtag.org, which are completely different.) +# http://www.100ask.net/shop/english.html (website seems to be outdated) +# http://item.taobao.com/item.htm?id=1559277013 +# http://www.micro4you.com/store/openjtag-arm-jtag-usb.html (schematics!) +# some other sources which call it O-Link +# http://www.andahammer.com/olink/ +# http://www.developmentboard.net/31-o-link-debugger.html +# http://armwerks.com/catalog/o-link-debugger-copy/ +# or just have a look at ebay ... +# It is basically the same entry as jtagkey with different usb ids. +programmer parent "jtagkey" + id = "o-link"; + desc = "O-Link, OpenJTAG from www.100ask.net"; + usbvid = 0x1457; + usbpid = 0x5118; + usbvendor = "www.100ask.net"; + usbproduct = "USB<=>JTAG&RS232"; +; + +# http://wiki.openmoko.org/wiki/Debug_Board_v3 +programmer + id = "openmoko"; + desc = "Openmoko debug board (v3)"; + type = "avrftdi"; + usbvid = 0x1457; + usbpid = 0x5118; + usbdev = "A"; + usbvendor = ""; + usbproduct = ""; + usbsn = ""; + reset = 3; # TMS 7 + sck = 0; # TCK 9 + mosi = 1; # TDI 5 + miso = 2; # TDO 13 +; + +# Only Rev. A boards. +# Schematic and user manual: http://www.cs.put.poznan.pl/wswitala/download/pdf/811EVBK.pdf +programmer + id = "lm3s811"; + desc = "Luminary Micro LM3S811 Eval Board (Rev. A)"; + type = "avrftdi"; + connection_type = usb; + usbvid = 0x0403; + usbpid = 0xbcd9; + usbvendor = "LMI"; + usbproduct = "LM3S811 Evaluation Board"; + usbdev = "A"; + usbsn = ""; +#ISP-signals - lower ACBUS-Nibble (default) + reset = 3; + sck = 0; + mosi = 1; + miso = 2; +# Enable correct buffers + buff = 7; +; + +programmer + id = "avrisp"; + desc = "Atmel AVR ISP"; + type = "stk500"; + connection_type = serial; +; + +programmer + id = "avrispv2"; + desc = "Atmel AVR ISP V2"; + type = "stk500v2"; + connection_type = serial; +; + +programmer + id = "avrispmkII"; + desc = "Atmel AVR ISP mkII"; + type = "stk500v2"; + connection_type = usb; +; + +programmer parent "avrispmkII" + id = "avrisp2"; +; + +programmer + id = "buspirate"; + desc = "The Bus Pirate"; + type = "buspirate"; + connection_type = serial; +; + +programmer + id = "buspirate_bb"; + desc = "The Bus Pirate (bitbang interface, supports TPI)"; + type = "buspirate_bb"; + connection_type = serial; + # pins are bits in bitbang byte (numbers are 87654321) + # 1|POWER|PULLUP|AUX|MOSI|CLK|MISO|CS + reset = 1; + sck = 3; + mosi = 4; + miso = 2; + #vcc = 7; This is internally set independent of this setting. +; + +# This is supposed to be the "default" STK500 entry. +# Attempts to select the correct firmware version +# by probing for it. Better use one of the entries +# below instead. +programmer + id = "stk500"; + desc = "Atmel STK500"; + type = "stk500generic"; + connection_type = serial; +; + +programmer + id = "stk500v1"; + desc = "Atmel STK500 Version 1.x firmware"; + type = "stk500"; + connection_type = serial; +; + +programmer + id = "mib510"; + desc = "Crossbow MIB510 programming board"; + type = "stk500"; + connection_type = serial; +; + +programmer + id = "stk500v2"; + desc = "Atmel STK500 Version 2.x firmware"; + type = "stk500v2"; + connection_type = serial; +; + +programmer + id = "stk500pp"; + desc = "Atmel STK500 V2 in parallel programming mode"; + type = "stk500pp"; + connection_type = serial; +; + +programmer + id = "stk500hvsp"; + desc = "Atmel STK500 V2 in high-voltage serial programming mode"; + type = "stk500hvsp"; + connection_type = serial; +; + +programmer + id = "stk600"; + desc = "Atmel STK600"; + type = "stk600"; + connection_type = usb; +; + +programmer + id = "stk600pp"; + desc = "Atmel STK600 in parallel programming mode"; + type = "stk600pp"; + connection_type = usb; +; + +programmer + id = "stk600hvsp"; + desc = "Atmel STK600 in high-voltage serial programming mode"; + type = "stk600hvsp"; + connection_type = usb; +; + +programmer + id = "avr910"; + desc = "Atmel Low Cost Serial Programmer"; + type = "avr910"; + connection_type = serial; +; + +programmer + id = "ft245r"; + desc = "FT245R Synchronous BitBang"; + type = "ftdi_syncbb"; + connection_type = usb; + miso = 1; # D1 + sck = 0; # D0 + mosi = 2; # D2 + reset = 4; # D4 +; + +programmer + id = "ft232r"; + desc = "FT232R Synchronous BitBang"; + type = "ftdi_syncbb"; + connection_type = usb; + miso = 1; # RxD + sck = 0; # RTS + mosi = 2; # TxD + reset = 4; # DTR +; + +# see http://www.bitwizard.nl/wiki/index.php/FTDI_ATmega +programmer + id = "bwmega"; + desc = "BitWizard ftdi_atmega builtin programmer"; + type = "ftdi_syncbb"; + connection_type = usb; + miso = 5; # DSR + sck = 6; # DCD + mosi = 3; # CTS + reset = 7; # RI +; + +# see http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html +# Note: pins are numbered from 1! +programmer + id = "arduino-ft232r"; + desc = "Arduino: FT232R connected to ISP"; + type = "ftdi_syncbb"; + connection_type = usb; + miso = 3; # CTS X3(1) + sck = 5; # DSR X3(2) + mosi = 6; # DCD X3(3) + reset = 7; # RI X3(4) +; + +# website mentioned above uses this id +programmer parent "arduino-ft232r" + id = "diecimila"; + desc = "alias for arduino-ft232r"; +; + +programmer + id = "usbasp"; + desc = "USBasp, http://www.fischl.de/usbasp/"; + type = "usbasp"; + connection_type = usb; + usbvid = 0x16C0; # VOTI + usbpid = 0x05DC; # Obdev's free shared PID + usbvendor = "www.fischl.de"; + usbproduct = "USBasp"; + + # following variants are autodetected for id "usbasp" + + # original usbasp from fischl.de + # see above "usbasp" + + # old usbasp from fischl.de + #usbvid = 0x03EB; # ATMEL + #usbpid = 0xC7B4; # (unoffical) USBasp + #usbvendor = "www.fischl.de"; + #usbproduct = "USBasp"; + + # NIBObee (only if -P nibobee is given on command line) + # see below "nibobee" +; + +programmer + id = "nibobee"; + desc = "NIBObee"; + type = "usbasp"; + connection_type = usb; + usbvid = 0x16C0; # VOTI + usbpid = 0x092F; # NIBObee PID + usbvendor = "www.nicai-systems.com"; + usbproduct = "NIBObee"; +; + +programmer + id = "usbasp-clone"; + desc = "Any usbasp clone with correct VID/PID"; + type = "usbasp"; + connection_type = usb; + usbvid = 0x16C0; # VOTI + usbpid = 0x05DC; # Obdev's free shared PID + #usbvendor = ""; + #usbproduct = ""; +; + +programmer + id = "usbtiny"; + desc = "USBtiny simple USB programmer, http://www.ladyada.net/make/usbtinyisp/"; + type = "usbtiny"; + connection_type = usb; + usbvid = 0x1781; + usbpid = 0x0c9f; +; + +programmer + id = "arduinoisp"; + desc = " "; + type = "usbtiny"; + connection_type = usb; + usbvid = 0x2341; + usbpid = 0x0049; +; + +programmer + id = "butterfly"; + desc = "Atmel Butterfly Development Board"; + type = "butterfly"; + connection_type = serial; +; + +programmer + id = "avr109"; + desc = "Atmel AppNote AVR109 Boot Loader"; + type = "butterfly"; + connection_type = serial; +; + +programmer + id = "avr911"; + desc = "Atmel AppNote AVR911 AVROSP"; + type = "butterfly"; + connection_type = serial; +; + +# suggested in http://forum.mikrokopter.de/topic-post48317.html +programmer + id = "mkbutterfly"; + desc = "Mikrokopter.de Butterfly"; + type = "butterfly_mk"; + connection_type = serial; +; + +programmer parent "mkbutterfly" + id = "butterfly_mk"; +; + +programmer + id = "jtagmkI"; + desc = "Atmel JTAG ICE (mkI)"; + baudrate = 115200; # default is 115200 + type = "jtagmki"; + connection_type = serial; +; + +# easier to type +programmer parent "jtagmkI" + id = "jtag1"; +; + +# easier to type +programmer parent "jtag1" + id = "jtag1slow"; + baudrate = 19200; +; + +# The JTAG ICE mkII has both, serial and USB connectivity. As it is +# mostly used through USB these days (AVR Studio 5 only supporting it +# that way), we make connection_type = usb the default. Users are +# still free to use a serial port with the -P option. + +programmer + id = "jtagmkII"; + desc = "Atmel JTAG ICE mkII"; + baudrate = 19200; # default is 19200 + type = "jtagmkii"; + connection_type = usb; +; + +# easier to type +programmer parent "jtagmkII" + id = "jtag2slow"; +; + +# JTAG ICE mkII @ 115200 Bd +programmer parent "jtag2slow" + id = "jtag2fast"; + baudrate = 115200; +; + +# make the fast one the default, people will love that +programmer parent "jtag2fast" + id = "jtag2"; +; + +# JTAG ICE mkII in ISP mode +programmer + id = "jtag2isp"; + desc = "Atmel JTAG ICE mkII in ISP mode"; + baudrate = 115200; + type = "jtagmkii_isp"; + connection_type = usb; +; + +# JTAG ICE mkII in debugWire mode +programmer + id = "jtag2dw"; + desc = "Atmel JTAG ICE mkII in debugWire mode"; + baudrate = 115200; + type = "jtagmkii_dw"; + connection_type = usb; +; + +# JTAG ICE mkII in AVR32 mode +programmer + id = "jtagmkII_avr32"; + desc = "Atmel JTAG ICE mkII im AVR32 mode"; + baudrate = 115200; + type = "jtagmkii_avr32"; + connection_type = usb; +; + +# JTAG ICE mkII in AVR32 mode +programmer + id = "jtag2avr32"; + desc = "Atmel JTAG ICE mkII im AVR32 mode"; + baudrate = 115200; + type = "jtagmkii_avr32"; + connection_type = usb; +; + +# JTAG ICE mkII in PDI mode +programmer + id = "jtag2pdi"; + desc = "Atmel JTAG ICE mkII PDI mode"; + baudrate = 115200; + type = "jtagmkii_pdi"; + connection_type = usb; +; + +# AVR Dragon in JTAG mode +programmer + id = "dragon_jtag"; + desc = "Atmel AVR Dragon in JTAG mode"; + baudrate = 115200; + type = "dragon_jtag"; + connection_type = usb; +; + +# AVR Dragon in ISP mode +programmer + id = "dragon_isp"; + desc = "Atmel AVR Dragon in ISP mode"; + baudrate = 115200; + type = "dragon_isp"; + connection_type = usb; +; + +# AVR Dragon in PP mode +programmer + id = "dragon_pp"; + desc = "Atmel AVR Dragon in PP mode"; + baudrate = 115200; + type = "dragon_pp"; + connection_type = usb; +; + +# AVR Dragon in HVSP mode +programmer + id = "dragon_hvsp"; + desc = "Atmel AVR Dragon in HVSP mode"; + baudrate = 115200; + type = "dragon_hvsp"; + connection_type = usb; +; + +# AVR Dragon in debugWire mode +programmer + id = "dragon_dw"; + desc = "Atmel AVR Dragon in debugWire mode"; + baudrate = 115200; + type = "dragon_dw"; + connection_type = usb; +; + +# AVR Dragon in PDI mode +programmer + id = "dragon_pdi"; + desc = "Atmel AVR Dragon in PDI mode"; + baudrate = 115200; + type = "dragon_pdi"; + connection_type = usb; +; + +programmer + id = "jtag3"; + desc = "Atmel AVR JTAGICE3 in JTAG mode"; + type = "jtagice3"; + connection_type = usb; +; + +programmer + id = "jtag3pdi"; + desc = "Atmel AVR JTAGICE3 in PDI mode"; + type = "jtagice3_pdi"; + connection_type = usb; +; + +programmer + id = "jtag3dw"; + desc = "Atmel AVR JTAGICE3 in debugWIRE mode"; + type = "jtagice3_dw"; + connection_type = usb; +; + +programmer + id = "jtag3isp"; + desc = "Atmel AVR JTAGICE3 in ISP mode"; + type = "jtagice3_isp"; + connection_type = usb; +; + + +programmer + id = "pavr"; + desc = "Jason Kyle's pAVR Serial Programmer"; + type = "avr910"; + connection_type = serial; +; + +programmer + id = "pickit2"; + desc = "MicroChip's PICkit2 Programmer"; + type = "pickit2"; + connection_type = usb; +; + +# Parallel port programmers. + +programmer + id = "bsd"; + desc = "Brian Dean's Programmer, http://www.bsdhome.com/avrdude/"; + type = "par"; + connection_type = parallel; + vcc = 2, 3, 4, 5; + reset = 7; + sck = 8; + mosi = 9; + miso = 10; +; + +programmer + id = "stk200"; + desc = "STK200"; + type = "par"; + connection_type = parallel; + buff = 4, 5; + sck = 6; + mosi = 7; + reset = 9; + miso = 10; +; + +# The programming dongle used by the popular Ponyprog +# utility. It is almost similar to the STK200 one, +# except that there is a LED indicating that the +# programming is currently in progress. + +programmer parent "stk200" + id = "pony-stk200"; + desc = "Pony Prog STK200"; + pgmled = 8; +; + +programmer + id = "dt006"; + desc = "Dontronics DT006"; + type = "par"; + connection_type = parallel; + reset = 4; + sck = 5; + mosi = 2; + miso = 11; +; + +programmer parent "dt006" + id = "bascom"; + desc = "Bascom SAMPLE programming cable"; +; + +programmer + id = "alf"; + desc = "Nightshade ALF-PgmAVR, http://nightshade.homeip.net/"; + type = "par"; + connection_type = parallel; + vcc = 2, 3, 4, 5; + buff = 6; + reset = 7; + sck = 8; + mosi = 9; + miso = 10; + errled = 1; + rdyled = 14; + pgmled = 16; + vfyled = 17; +; + +programmer + id = "sp12"; + desc = "Steve Bolt's Programmer"; + type = "par"; + connection_type = parallel; + vcc = 4,5,6,7,8; + reset = 3; + sck = 2; + mosi = 9; + miso = 11; +; + +programmer + id = "picoweb"; + desc = "Picoweb Programming Cable, http://www.picoweb.net/"; + type = "par"; + connection_type = parallel; + reset = 2; + sck = 3; + mosi = 4; + miso = 13; +; + +programmer + id = "abcmini"; + desc = "ABCmini Board, aka Dick Smith HOTCHIP"; + type = "par"; + connection_type = parallel; + reset = 4; + sck = 3; + mosi = 2; + miso = 10; +; + +programmer + id = "futurlec"; + desc = "Futurlec.com programming cable."; + type = "par"; + connection_type = parallel; + reset = 3; + sck = 2; + mosi = 1; + miso = 10; +; + + +# From the contributor of the "xil" jtag cable: +# The "vcc" definition isn't really vcc (the cable gets its power from +# the programming circuit) but is necessary to switch one of the +# buffer lines (trying to add it to the "buff" lines doesn't work in +# avrdude versions before 5.5j). +# With this, TMS connects to RESET, TDI to MOSI, TDO to MISO and TCK +# to SCK (plus vcc/gnd of course) +programmer + id = "xil"; + desc = "Xilinx JTAG cable"; + type = "par"; + connection_type = parallel; + mosi = 2; + sck = 3; + reset = 4; + buff = 5; + miso = 13; + vcc = 6; +; + + +programmer + id = "dapa"; + desc = "Direct AVR Parallel Access cable"; + type = "par"; + connection_type = parallel; + vcc = 3; + reset = 16; + sck = 1; + mosi = 2; + miso = 11; +; + +programmer + id = "atisp"; + desc = "AT-ISP V1.1 programming cable for AVR-SDK1 from micro-research.co.th"; + type = "par"; + connection_type = parallel; + reset = ~6; + sck = ~8; + mosi = ~7; + miso = ~10; +; + +programmer + id = "ere-isp-avr"; + desc = "ERE ISP-AVR "; + type = "par"; + connection_type = parallel; + reset = ~4; + sck = 3; + mosi = 2; + miso = 10; +; + +programmer + id = "blaster"; + desc = "Altera ByteBlaster"; + type = "par"; + connection_type = parallel; + sck = 2; + miso = 11; + reset = 3; + mosi = 8; + buff = 14; +; + +# It is almost same as pony-stk200, except vcc on pin 5 to auto +# disconnect port (download on http://electropol.free.fr/spip/spip.php?article27) +programmer parent "pony-stk200" + id = "frank-stk200"; + desc = "Frank STK200"; + buff = ; # delete buff pin assignment + vcc = 5; +; + +# The AT98ISP Cable is a simple parallel dongle for AT89 family. +# http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2877 +programmer + id = "89isp"; + desc = "Atmel at89isp cable"; + type = "par"; + connection_type = parallel; + reset = 17; + sck = 1; + mosi = 2; + miso = 10; +; + + +#This programmer bitbangs GPIO lines using the Linux sysfs GPIO interface +# +#To enable it set the configuration below to match the GPIO lines connected to the +#relevant ISP header pins and uncomment the entry definition. In case you don't +#have the required permissions to edit this system wide config file put the +#entry in a separate .conf file and use it with -C+.conf +#on the command line. +# +#To check if your avrdude build has support for the linuxgpio programmer compiled in, +#use -c?type on the command line and look for linuxgpio in the list. If it's not available +#you need pass the --enable-linuxgpio=yes option to configure and recompile avrdude. +# +#programmer +# id = "linuxgpio"; +# desc = "Use the Linux sysfs interface to bitbang GPIO lines"; +# type = "linuxgpio"; +# reset = ?; +# sck = ?; +# mosi = ?; +# miso = ?; +#; + +#This programmer bitbangs GPIO lines using the Linux sysfs GPIO interface and direct +#GPIO memory registers read/write. +# +#To enable it set the configuration below to match the GPIO lines connected to the +#relevant ISP header pins and uncomment the entry definition. In case you don't +#have the required permissions to edit this system wide config file put the +#entry in a separate .conf file and use it with -C+.conf +#on the command line. +# +#To check if your avrdude build has support for the arduinotre programmer compiled in, +#use -c?type on the command line and look for arduinotre in the list. If it's not available +#you need pass the --enable-arduinotre=yes option to configure and recompile avrdude. +# +#programmer +# id = "arduinotre"; +# desc = "Arduino TRE bitbanging using GPIO registers"; +# type = "arduinotre"; +# reset = ~65; +# sck = 49; +# mosi = 48; +# miso = 61; +#; + +# some ultra cheap programmers use bitbanging on the +# serialport. +# +# PC - DB9 - Pins for RS232: +# +# GND 5 -- |O +# | O| <- 9 RI +# DTR 4 <- |O | +# | O| <- 8 CTS +# TXD 3 <- |O | +# | O| -> 7 RTS +# RXD 2 -> |O | +# | O| <- 6 DSR +# DCD 1 -> |O +# +# Using RXD is currently not supported. +# Using RI is not supported under Win32 but is supported under Posix. + +# serial ponyprog design (dasa2 in uisp) +# reset=!txd sck=rts mosi=dtr miso=cts + +programmer + id = "ponyser"; + desc = "design ponyprog serial, reset=!txd sck=rts mosi=dtr miso=cts"; + type = "serbb"; + connection_type = serial; + reset = ~3; + sck = 7; + mosi = 4; + miso = 8; +; + +# Same as above, different name +# reset=!txd sck=rts mosi=dtr miso=cts + +programmer parent "ponyser" + id = "siprog"; + desc = "Lancos SI-Prog "; +; + +# unknown (dasa in uisp) +# reset=rts sck=dtr mosi=txd miso=cts + +programmer + id = "dasa"; + desc = "serial port banging, reset=rts sck=dtr mosi=txd miso=cts"; + type = "serbb"; + connection_type = serial; + reset = 7; + sck = 4; + mosi = 3; + miso = 8; +; + +# unknown (dasa3 in uisp) +# reset=!dtr sck=rts mosi=txd miso=cts + +programmer + id = "dasa3"; + desc = "serial port banging, reset=!dtr sck=rts mosi=txd miso=cts"; + type = "serbb"; + connection_type = serial; + reset = ~4; + sck = 7; + mosi = 3; + miso = 8; +; + +# C2N232i (jumper configuration "auto") +# reset=dtr sck=!rts mosi=!txd miso=!cts + +programmer + id = "c2n232i"; + desc = "serial port banging, reset=dtr sck=!rts mosi=!txd miso=!cts"; + type = "serbb"; + connection_type = serial; + reset = 4; + sck = ~7; + mosi = ~3; + miso = ~8; +; + +# +# PART DEFINITIONS +# + +#------------------------------------------------------------ +# ATtiny11 +#------------------------------------------------------------ + +# This is an HVSP-only device. + +part + id = "t11"; + desc = "ATtiny11"; + stk500_devcode = 0x11; + signature = 0x1e 0x90 0x04; + chip_erase_delay = 20000; + + timeout = 200; + hvsp_controlstack = + 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x00, + 0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78, + 0x78, 0x00, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + hvspcmdexedelay = 0; + synchcycles = 6; + latchcycles = 1; + togglevtg = 1; + poweroffdelay = 25; + resetdelayms = 0; + resetdelayus = 50; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; + chiperasetime = 0; + programfusepolltimeout = 25; + programlockpolltimeout = 25; + + memory "eeprom" + size = 64; + blocksize = 64; + readsize = 256; + delay = 5; + ; + + memory "flash" + size = 1024; + blocksize = 128; + readsize = 256; + delay = 3; + ; + + memory "signature" + size = 3; + ; + + memory "lock" + size = 1; + ; + + memory "calibration" + size = 1; + ; + + memory "fuse" + size = 1; + ; +; + +#------------------------------------------------------------ +# ATtiny12 +#------------------------------------------------------------ + +part + id = "t12"; + desc = "ATtiny12"; + stk500_devcode = 0x12; + avr910_devcode = 0x55; + signature = 0x1e 0x90 0x05; + chip_erase_delay = 20000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; + + hvsp_controlstack = + 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x00, + 0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78, + 0x78, 0x00, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; + hventerstabdelay = 100; + hvspcmdexedelay = 0; + synchcycles = 6; + latchcycles = 1; + togglevtg = 1; + poweroffdelay = 25; + resetdelayms = 0; + resetdelayus = 50; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; + chiperasetime = 0; + programfusepolltimeout = 25; + programlockpolltimeout = 25; + + memory "eeprom" + size = 64; + min_write_delay = 9000; + max_write_delay = 20000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 x x x x x x x x", + "x x a5 a4 a3 a2 a1 a0 o o o o o o o o"; + + write = "1 1 0 0 0 0 0 0 x x x x x x x x", + "x x a5 a4 a3 a2 a1 a0 i i i i i i i i"; + + mode = 0x04; + delay = 8; + blocksize = 64; + readsize = 256; + ; + + memory "flash" + size = 1024; + min_write_delay = 4500; + max_write_delay = 20000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + write_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + mode = 0x04; + delay = 5; + blocksize = 128; + readsize = 256; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 x x x x x x x x", + "x x x x x x x x x x x x x o o x"; + + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", + "x x x x x x x x x x x x x x x x"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + + memory "fuse" + size = 1; + read = "0 1 0 1 0 0 0 0 x x x x x x x x", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 x x x x x", + "x x x x x x x x i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; +; + +#------------------------------------------------------------ +# ATtiny13 +#------------------------------------------------------------ + +part + id = "t13"; + desc = "ATtiny13"; + has_debugwire = yes; + flash_instr = 0xB4, 0x0E, 0x1E; + eeprom_instr = 0xBB, 0xFE, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, + 0xBC, 0x0E, 0xB4, 0x0E, 0xBA, 0x0D, 0xBB, 0xBC, + 0x99, 0xE1, 0xBB, 0xAC; + stk500_devcode = 0x14; + signature = 0x1e 0x90 0x07; + chip_erase_delay = 4000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + hvsp_controlstack = + 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66, + 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, + 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + hvspcmdexedelay = 0; + synchcycles = 6; + latchcycles = 1; + togglevtg = 1; + poweroffdelay = 25; + resetdelayms = 0; + resetdelayus = 90; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; + chiperasetime = 0; + programfusepolltimeout = 25; + programlockpolltimeout = 25; + + ocdrev = 0; + + memory "eeprom" + size = 64; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 0 0 0 x x x x x", + "x x a5 a4 a3 a2 a1 a0 o o o o o o o o"; + + write = "1 1 0 0 0 0 0 0 0 0 0 x x x x x", + "x x a5 a4 a3 a2 a1 a0 i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x x x x", + " x x a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 5; + blocksize = 4; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 1024; + page_size = 32; + num_pages = 32; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 0 0 0 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 0 0 0 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x x x a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x x x a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 0 0 0 a8", + " a7 a6 a5 a4 x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 32; + readsize = 256; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + + memory "lock" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; + + memory "calibration" + size = 2; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 a0 o o o o o o o o"; + ; + + memory "lfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + ; + + memory "hfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + ; + +; + + +#------------------------------------------------------------ +# ATtiny15 +#------------------------------------------------------------ + +part + id = "t15"; + desc = "ATtiny15"; + stk500_devcode = 0x13; + avr910_devcode = 0x56; + signature = 0x1e 0x90 0x06; + chip_erase_delay = 8200; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; + + hvsp_controlstack = + 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x00, + 0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78, + 0x78, 0x00, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; + hventerstabdelay = 100; + hvspcmdexedelay = 5; + synchcycles = 6; + latchcycles = 16; + togglevtg = 1; + poweroffdelay = 25; + resetdelayms = 0; + resetdelayus = 50; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; + chiperasetime = 0; + programfusepolltimeout = 25; + programlockpolltimeout = 25; + + memory "eeprom" + size = 64; + min_write_delay = 8200; + max_write_delay = 8200; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 x x x x x x x x", + "x x a5 a4 a3 a2 a1 a0 o o o o o o o o"; + + write = "1 1 0 0 0 0 0 0 x x x x x x x x", + "x x a5 a4 a3 a2 a1 a0 i i i i i i i i"; + + mode = 0x04; + delay = 10; + blocksize = 64; + readsize = 256; + ; + + memory "flash" + size = 1024; + min_write_delay = 4100; + max_write_delay = 4100; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + write_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + mode = 0x04; + delay = 5; + blocksize = 128; + readsize = 256; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 x x x x x x x x", + "x x x x x x x x x x x x x o o x"; + + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", + "x x x x x x x x x x x x x x x x"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + + memory "fuse" + size = 1; + read = "0 1 0 1 0 0 0 0 x x x x x x x x", + "x x x x x x x x o o o o x x o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 x x x x x", + "x x x x x x x x i i i i 1 1 i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; +; + +#------------------------------------------------------------ +# AT90s1200 +#------------------------------------------------------------ + +part + id = "1200"; + desc = "AT90S1200"; + is_at90s1200 = yes; + stk500_devcode = 0x33; + avr910_devcode = 0x13; + signature = 0x1e 0x90 0x01; + pagel = 0xd7; + bs2 = 0xa0; + chip_erase_delay = 20000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 1; + bytedelay = 0; + pollindex = 0; + pollvalue = 0xFF; + predelay = 1; + postdelay = 1; + pollmethod = 0; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 0; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 15; + chiperasepolltimeout = 0; + programfusepulsewidth = 2; + programfusepolltimeout = 0; + programlockpulsewidth = 0; + programlockpolltimeout = 1; + + memory "eeprom" + size = 64; + min_write_delay = 4000; + max_write_delay = 9000; + readback_p1 = 0x00; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 x x x x x x x x", + "x x a5 a4 a3 a2 a1 a0 o o o o o o o o"; + + write = "1 1 0 0 0 0 0 0 x x x x x x x x", + "x x a5 a4 a3 a2 a1 a0 i i i i i i i i"; + + mode = 0x04; + delay = 20; + blocksize = 32; + readsize = 256; + ; + memory "flash" + size = 1024; + min_write_delay = 4000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + write_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + mode = 0x02; + delay = 15; + blocksize = 128; + readsize = 256; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "fuse" + size = 1; + ; + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 20000; + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", + "x x x x x x x x x x x x x x x x"; + ; + ; + +#------------------------------------------------------------ +# AT90s4414 +#------------------------------------------------------------ + +part + id = "4414"; + desc = "AT90S4414"; + stk500_devcode = 0x50; + avr910_devcode = 0x28; + signature = 0x1e 0x92 0x01; + chip_erase_delay = 20000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 0; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 15; + chiperasepolltimeout = 0; + programfusepulsewidth = 2; + programfusepolltimeout = 0; + programlockpulsewidth = 0; + programlockpolltimeout = 1; + + memory "eeprom" + size = 256; + min_write_delay = 9000; + max_write_delay = 20000; + readback_p1 = 0x80; + readback_p2 = 0x7f; + read = " 1 0 1 0 0 0 0 0 x x x x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0 x x x x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + + mode = 0x04; + delay = 12; + blocksize = 64; + readsize = 256; + ; + memory "flash" + size = 4096; + min_write_delay = 9000; + max_write_delay = 20000; + readback_p1 = 0x7f; + readback_p2 = 0x7f; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write_lo = " 0 1 0 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + write_hi = " 0 1 0 0 1 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + mode = 0x04; + delay = 12; + blocksize = 64; + readsize = 256; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "fuse" + size = 1; + ; + memory "lock" + size = 1; + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", + "x x x x x x x x x x x x x x x x"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + ; + +#------------------------------------------------------------ +# AT90s2313 +#------------------------------------------------------------ + +part + id = "2313"; + desc = "AT90S2313"; + stk500_devcode = 0x40; + avr910_devcode = 0x20; + signature = 0x1e 0x91 0x01; + chip_erase_delay = 20000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 0; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 15; + chiperasepolltimeout = 0; + programfusepulsewidth = 2; + programfusepolltimeout = 0; + programlockpulsewidth = 0; + programlockpolltimeout = 1; + + memory "eeprom" + size = 128; + min_write_delay = 4000; + max_write_delay = 9000; + readback_p1 = 0x80; + readback_p2 = 0x7f; + read = "1 0 1 0 0 0 0 0 x x x x x x x x", + "x a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + + write = "1 1 0 0 0 0 0 0 x x x x x x x x", + "x a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + + mode = 0x04; + delay = 12; + blocksize = 64; + readsize = 256; + ; + memory "flash" + size = 2048; + min_write_delay = 4000; + max_write_delay = 9000; + readback_p1 = 0x7f; + readback_p2 = 0x7f; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + write_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + mode = 0x04; + delay = 12; + blocksize = 128; + readsize = 256; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "fuse" + size = 1; + ; + memory "lock" + size = 1; + write = "1 0 1 0 1 1 0 0 1 1 1 x x i i x", + "x x x x x x x x x x x x x x x x"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + ; + +#------------------------------------------------------------ +# AT90s2333 +#------------------------------------------------------------ + +part + id = "2333"; +##### WARNING: No XML file for device 'AT90S2333'! ##### + desc = "AT90S2333"; + stk500_devcode = 0x42; + avr910_devcode = 0x34; + signature = 0x1e 0x91 0x05; + chip_erase_delay = 20000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 0; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 15; + chiperasepolltimeout = 0; + programfusepulsewidth = 2; + programfusepolltimeout = 0; + programlockpulsewidth = 0; + programlockpolltimeout = 1; + + memory "eeprom" + size = 128; + min_write_delay = 9000; + max_write_delay = 20000; + readback_p1 = 0x00; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 x x x x x x x x", + "x a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + + write = "1 1 0 0 0 0 0 0 x x x x x x x x", + "x a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + + mode = 0x04; + delay = 12; + blocksize = 128; + readsize = 256; + ; + + memory "flash" + size = 2048; + min_write_delay = 9000; + max_write_delay = 20000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + write_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + mode = 0x04; + delay = 12; + blocksize = 128; + readsize = 256; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "fuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 20000; + pwroff_after_write = yes; + read = "0 1 0 1 0 0 0 0 x x x x x x x x", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 i i i i i", + "x x x x x x x x x x x x x x x x"; + ; + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 20000; + read = "0 1 0 1 1 0 0 0 x x x x x x x x", + "x x x x x x x x x x x x x o o x"; + + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", + "x x x x x x x x x x x x x x x x"; + ; + ; + + +#------------------------------------------------------------ +# AT90s2343 (also AT90s2323 and ATtiny22) +#------------------------------------------------------------ + +part + id = "2343"; + desc = "AT90S2343"; + stk500_devcode = 0x43; + avr910_devcode = 0x4c; + signature = 0x1e 0x91 0x03; + chip_erase_delay = 18000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; + + hvsp_controlstack = + 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x00, + 0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78, + 0x78, 0x00, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; + hventerstabdelay = 100; + hvspcmdexedelay = 0; + synchcycles = 6; + latchcycles = 1; + togglevtg = 0; + poweroffdelay = 25; + resetdelayms = 0; + resetdelayus = 50; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; + chiperasetime = 0; + programfusepolltimeout = 25; + programlockpolltimeout = 25; + + memory "eeprom" + size = 128; + min_write_delay = 9000; + max_write_delay = 20000; + readback_p1 = 0x00; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0", + "x a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + + write = "1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0", + "x a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + + mode = 0x04; + delay = 12; + blocksize = 64; + readsize = 256; + ; + memory "flash" + size = 2048; + min_write_delay = 9000; + max_write_delay = 20000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + write_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + mode = 0x04; + delay = 12; + blocksize = 128; + readsize = 128; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "fuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 20000; + read = "0 1 0 1 1 0 0 0 x x x x x x x x", + "x x x x x x x x o o o x x x x o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 1 1 1 1 i", + "x x x x x x x x x x x x x x x x"; + ; + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 20000; + read = "0 1 0 1 1 0 0 0 x x x x x x x x", + "x x x x x x x x o o o x x x x o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", + "x x x x x x x x x x x x x x x x"; + ; + ; + + +#------------------------------------------------------------ +# AT90s4433 +#------------------------------------------------------------ + +part + id = "4433"; + desc = "AT90S4433"; + stk500_devcode = 0x51; + avr910_devcode = 0x30; + signature = 0x1e 0x92 0x03; + chip_erase_delay = 20000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 0; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 15; + chiperasepolltimeout = 0; + programfusepulsewidth = 2; + programfusepolltimeout = 0; + programlockpulsewidth = 0; + programlockpolltimeout = 1; + + memory "eeprom" + size = 256; + min_write_delay = 9000; + max_write_delay = 20000; + readback_p1 = 0x00; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0 x x x x x x x x", + "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0 x x x x x x x x", + "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + + mode = 0x04; + delay = 12; + blocksize = 128; + readsize = 256; + ; + memory "flash" + size = 4096; + min_write_delay = 9000; + max_write_delay = 20000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write_lo = " 0 1 0 0 0 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + write_hi = " 0 1 0 0 1 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + mode = 0x04; + delay = 12; + blocksize = 128; + readsize = 256; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "fuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 20000; + pwroff_after_write = yes; + read = "0 1 0 1 0 0 0 0 x x x x x x x x", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 i i i i i", + "x x x x x x x x x x x x x x x x"; + ; + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 20000; + read = "0 1 0 1 1 0 0 0 x x x x x x x x", + "x x x x x x x x x x x x x o o x"; + + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", + "x x x x x x x x x x x x x x x x"; + ; + ; + +#------------------------------------------------------------ +# AT90s4434 +#------------------------------------------------------------ + +part + id = "4434"; +##### WARNING: No XML file for device 'AT90S4434'! ##### + desc = "AT90S4434"; + stk500_devcode = 0x52; + avr910_devcode = 0x6c; + signature = 0x1e 0x92 0x02; + chip_erase_delay = 20000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + + memory "eeprom" + size = 256; + min_write_delay = 9000; + max_write_delay = 20000; + readback_p1 = 0x00; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0 x x x x x x x x", + "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0 x x x x x x x x", + "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + ; + memory "flash" + size = 4096; + min_write_delay = 9000; + max_write_delay = 20000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write_lo = " 0 1 0 0 0 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + write_hi = " 0 1 0 0 1 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "fuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 20000; + read = "0 1 0 1 0 0 0 0 x x x x x x x x", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 i i i i i", + "x x x x x x x x x x x x x x x x"; + ; + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 20000; + read = "0 1 0 1 1 0 0 0 x x x x x x x x", + "x x x x x x x x x x x x x o o x"; + + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", + "x x x x x x x x x x x x x x x x"; + ; + ; + +#------------------------------------------------------------ +# AT90s8515 +#------------------------------------------------------------ + +part + id = "8515"; + desc = "AT90S8515"; + stk500_devcode = 0x60; + avr910_devcode = 0x38; + signature = 0x1e 0x93 0x01; + chip_erase_delay = 20000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 0; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepulsewidth = 15; + chiperasepolltimeout = 0; + programfusepulsewidth = 2; + programfusepolltimeout = 0; + programlockpulsewidth = 0; + programlockpolltimeout = 1; + + memory "eeprom" + size = 512; + min_write_delay = 4000; + max_write_delay = 9000; + readback_p1 = 0x80; + readback_p2 = 0x7f; + read = " 1 0 1 0 0 0 0 0 x x x x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0 x x x x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + + mode = 0x04; + delay = 12; + blocksize = 128; + readsize = 256; + ; + memory "flash" + size = 8192; + min_write_delay = 4000; + max_write_delay = 9000; + readback_p1 = 0x7f; + readback_p2 = 0x7f; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write_lo = " 0 1 0 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + write_hi = " 0 1 0 0 1 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + mode = 0x04; + delay = 12; + blocksize = 128; + readsize = 256; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "fuse" + size = 1; + ; + memory "lock" + size = 1; + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", + "x x x x x x x x x x x x x x x x"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + ; + +#------------------------------------------------------------ +# AT90s8535 +#------------------------------------------------------------ + +part + id = "8535"; + desc = "AT90S8535"; + stk500_devcode = 0x61; + avr910_devcode = 0x68; + signature = 0x1e 0x93 0x03; + chip_erase_delay = 20000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 0; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 15; + chiperasepolltimeout = 0; + programfusepulsewidth = 2; + programfusepolltimeout = 0; + programlockpulsewidth = 0; + programlockpolltimeout = 1; + + memory "eeprom" + size = 512; + min_write_delay = 9000; + max_write_delay = 20000; + readback_p1 = 0x00; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0 x x x x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0 x x x x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + + mode = 0x04; + delay = 12; + blocksize = 128; + readsize = 256; + ; + memory "flash" + size = 8192; + min_write_delay = 9000; + max_write_delay = 20000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write_lo = " 0 1 0 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + write_hi = " 0 1 0 0 1 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + mode = 0x04; + delay = 12; + blocksize = 128; + readsize = 256; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "fuse" + size = 1; + read = "0 1 0 1 1 0 0 0 x x x x x x x x", + "x x x x x x x x x x x x x x x o"; + write = "1 0 1 0 1 1 0 0 1 0 1 1 1 1 1 i", + "x x x x x x x x x x x x x x x x"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 x x x x x x x x", + "x x x x x x x x o o x x x x x x"; + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", + "x x x x x x x x x x x x x x x x"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + ; + +#------------------------------------------------------------ +# ATmega103 +#------------------------------------------------------------ + +part + id = "m103"; + desc = "ATmega103"; + stk500_devcode = 0xB1; + avr910_devcode = 0x41; + signature = 0x1e 0x97 0x01; + chip_erase_delay = 112000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; + + pp_controlstack = + 0x0E, 0x1E, 0x8E, 0x9E, 0x2E, 0x3E, 0xAE, 0xBE, + 0x4E, 0x5E, 0xCE, 0xDE, 0x6E, 0x7E, 0xEE, 0xDE, + 0x66, 0x76, 0xE6, 0xF6, 0x6A, 0x7A, 0xEA, 0x7A, + 0x7F, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 0; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 15; + chiperasepolltimeout = 0; + programfusepulsewidth = 2; + programfusepolltimeout = 0; + programlockpulsewidth = 0; + programlockpolltimeout = 10; + + memory "eeprom" + size = 4096; + min_write_delay = 4000; + max_write_delay = 9000; + readback_p1 = 0x80; + readback_p2 = 0x7f; + read = " 1 0 1 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + mode = 0x04; + delay = 12; + blocksize = 64; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 131072; + page_size = 256; + num_pages = 512; + min_write_delay = 22000; + max_write_delay = 56000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; + + mode = 0x11; + delay = 70; + blocksize = 256; + readsize = 256; + ; + + memory "fuse" + size = 1; + read = "0 1 0 1 0 0 0 0 x x x x x x x x", + "x x x x x x x x x x o x o 1 o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 1 i 1 i i", + "x x x x x x x x x x x x x x x x"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 x x x x x x x x", + "x x x x x x x x x x x x x o o x"; + + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", + "x x x x x x x x x x x x x x x x"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + ; + + +#------------------------------------------------------------ +# ATmega64 +#------------------------------------------------------------ + +part + id = "m64"; + desc = "ATmega64"; + has_jtag = yes; + stk500_devcode = 0xA0; + avr910_devcode = 0x45; + signature = 0x1e 0x96 0x02; + chip_erase_delay = 9000; + pagel = 0xD7; + bs2 = 0xA0; + reset = dedicated; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 6; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + idr = 0x22; + spmcr = 0x68; + allowfullpagebitstream = yes; + + ocdrev = 2; + + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 2048; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + mode = 0x04; + delay = 20; + blocksize = 64; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 65536; + page_size = 256; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " x a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " x a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; + + mode = 0x21; + delay = 6; + blocksize = 128; + readsize = 256; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "calibration" + size = 4; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + ; + + + + +#------------------------------------------------------------ +# ATmega128 +#------------------------------------------------------------ + +part + id = "m128"; + desc = "ATmega128"; + has_jtag = yes; + stk500_devcode = 0xB2; + avr910_devcode = 0x43; + signature = 0x1e 0x97 0x02; + chip_erase_delay = 9000; + pagel = 0xD7; + bs2 = 0xA0; + reset = dedicated; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 6; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + idr = 0x22; + spmcr = 0x68; + rampz = 0x3b; + allowfullpagebitstream = yes; + + ocdrev = 1; + + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 4096; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + mode = 0x04; + delay = 12; + blocksize = 64; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 131072; + page_size = 256; + num_pages = 512; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; + + mode = 0x21; + delay = 6; + blocksize = 128; + readsize = 256; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "calibration" + size = 4; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# AT90CAN128 +#------------------------------------------------------------ + +part + id = "c128"; + desc = "AT90CAN128"; + has_jtag = yes; + stk500_devcode = 0xB3; +# avr910_devcode = 0x43; + signature = 0x1e 0x97 0x81; + chip_erase_delay = 9000; + pagel = 0xD7; + bs2 = 0xA0; + reset = dedicated; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 6; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + idr = 0x31; + spmcr = 0x57; + rampz = 0x3b; + eecr = 0x3f; + allowfullpagebitstream = no; + + ocdrev = 3; + + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 4096; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " 0 0 0 x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " 0 0 0 x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 0 0 0", + " x x x x x x x x"; + + + mode = 0x41; + delay = 20; + blocksize = 8; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 131072; + page_size = 256; + num_pages = 512; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 256; + readsize = 256; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# AT90CAN64 +#------------------------------------------------------------ + +part + id = "c64"; + desc = "AT90CAN64"; + has_jtag = yes; + stk500_devcode = 0xB3; +# avr910_devcode = 0x43; + signature = 0x1e 0x96 0x81; + chip_erase_delay = 9000; + pagel = 0xD7; + bs2 = 0xA0; + reset = dedicated; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 6; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + idr = 0x31; + spmcr = 0x57; + rampz = 0x3b; + eecr = 0x3f; + allowfullpagebitstream = no; + + ocdrev = 3; + + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 2048; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " 0 0 0 x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " 0 0 0 x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x a10 a9 a8", + " a7 a6 a5 a4 a3 0 0 0", + " x x x x x x x x"; + + + mode = 0x41; + delay = 20; + blocksize = 8; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 65536; + page_size = 256; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 256; + readsize = 256; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# AT90CAN32 +#------------------------------------------------------------ + +part + id = "c32"; + desc = "AT90CAN32"; + has_jtag = yes; + stk500_devcode = 0xB3; +# avr910_devcode = 0x43; + signature = 0x1e 0x95 0x81; + chip_erase_delay = 9000; + pagel = 0xD7; + bs2 = 0xA0; + reset = dedicated; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 6; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + idr = 0x31; + spmcr = 0x57; + rampz = 0x3b; + eecr = 0x3f; + allowfullpagebitstream = no; + + ocdrev = 3; + + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 1024; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " 0 0 0 x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " 0 0 0 x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x x a9 a8", + " a7 a6 a5 a4 a3 0 0 0", + " x x x x x x x x"; + + + mode = 0x41; + delay = 20; + blocksize = 8; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 32768; + page_size = 256; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 256; + readsize = 256; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + ; + + +#------------------------------------------------------------ +# ATmega16 +#------------------------------------------------------------ + +part + id = "m16"; + desc = "ATmega16"; + has_jtag = yes; + stk500_devcode = 0x82; + avr910_devcode = 0x74; + signature = 0x1e 0x94 0x03; + pagel = 0xd7; + bs2 = 0xa0; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 100; + latchcycles = 6; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + idr = 0x31; + spmcr = 0x57; + allowfullpagebitstream = yes; + + ocdrev = 2; + + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 4; /* for parallel programming */ + size = 512; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " 0 0 x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " 0 0 x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x04; + delay = 10; + blocksize = 128; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 16384; + page_size = 128; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 a13 a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; + + mode = 0x21; + delay = 6; + blocksize = 128; + readsize = 256; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lfuse" + size = 1; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "calibration" + size = 4; + + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; + ; + + +#------------------------------------------------------------ +# ATmega164P +#------------------------------------------------------------ + +# close to ATmega16 + +part parent "m16" + id = "m164p"; + desc = "ATmega164P"; + signature = 0x1e 0x94 0x0a; + + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + allowfullpagebitstream = no; + chip_erase_delay = 55000; + + ocdrev = 3; + ; + + +#------------------------------------------------------------ +# ATmega324P +#------------------------------------------------------------ + +# similar to ATmega164P + +part + id = "m324p"; + desc = "ATmega324P"; + has_jtag = yes; + stk500_devcode = 0x82; # no STK500v1 support, use the ATmega16 one + avr910_devcode = 0x74; + signature = 0x1e 0x95 0x08; + pagel = 0xd7; + bs2 = 0xa0; + chip_erase_delay = 55000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + idr = 0x31; + spmcr = 0x57; + allowfullpagebitstream = no; + + ocdrev = 3; + + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 4; /* for parallel programming */ + size = 1024; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " 0 0 x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " 0 0 x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 10; + blocksize = 128; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 32768; + page_size = 128; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; + + mode = 0x21; + delay = 6; + blocksize = 256; + readsize = 256; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lfuse" + size = 1; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x 1 1 1 1 1 i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + + memory "calibration" + size = 1; + + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + ; + + +#------------------------------------------------------------ +# ATmega324PA +#------------------------------------------------------------ + +# similar to ATmega324P + +part parent "m324p" + id = "m324pa"; + desc = "ATmega324PA"; + signature = 0x1e 0x95 0x11; + + ocdrev = 3; + ; + + +#------------------------------------------------------------ +# ATmega644 +#------------------------------------------------------------ + +# similar to ATmega164 + +part + id = "m644"; + desc = "ATmega644"; + has_jtag = yes; + stk500_devcode = 0x82; # no STK500v1 support, use the ATmega16 one + avr910_devcode = 0x74; + signature = 0x1e 0x96 0x09; + pagel = 0xd7; + bs2 = 0xa0; + chip_erase_delay = 55000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 6; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + idr = 0x31; + spmcr = 0x57; + allowfullpagebitstream = no; + + ocdrev = 3; + + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 2048; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " 0 0 x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " 0 0 x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 0 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 10; + blocksize = 128; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 65536; + page_size = 256; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; + + mode = 0x21; + delay = 6; + blocksize = 256; + readsize = 256; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lfuse" + size = 1; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x 1 1 1 1 1 i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + + memory "calibration" + size = 1; + + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# ATmega644P +#------------------------------------------------------------ + +# similar to ATmega164p + +part parent "m644" + id = "m644p"; + desc = "ATmega644P"; + signature = 0x1e 0x96 0x0a; + + ocdrev = 3; + ; + + + +#------------------------------------------------------------ +# ATmega1284P +#------------------------------------------------------------ + +# similar to ATmega164p + +part + id = "m1284p"; + desc = "ATmega1284P"; + has_jtag = yes; + stk500_devcode = 0x82; # no STK500v1 support, use the ATmega16 one + avr910_devcode = 0x74; + signature = 0x1e 0x97 0x05; + pagel = 0xd7; + bs2 = 0xa0; + chip_erase_delay = 55000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 6; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + idr = 0x31; + spmcr = 0x57; + allowfullpagebitstream = no; + + ocdrev = 3; + + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 4096; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " 0 0 x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " 0 0 x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 0 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 10; + blocksize = 128; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 131072; + page_size = 256; + num_pages = 512; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 10; + blocksize = 256; + readsize = 256; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lfuse" + size = 1; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x 1 1 1 1 1 i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + + memory "calibration" + size = 1; + + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + ; + + + +#------------------------------------------------------------ +# ATmega162 +#------------------------------------------------------------ + +part + id = "m162"; + desc = "ATmega162"; + has_jtag = yes; + stk500_devcode = 0x83; + avr910_devcode = 0x63; + signature = 0x1e 0x94 0x04; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xa0; + + idr = 0x04; + spmcr = 0x57; + allowfullpagebitstream = yes; + + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + ocdrev = 2; + + memory "flash" + paged = yes; + size = 16384; + page_size = 128; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 a13 a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; + mode = 0x41; + delay = 10; + blocksize = 128; + readsize = 256; + + ; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 6; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 4; /* for parallel programming */ + size = 512; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + + read = " 1 0 1 0 0 0 0 0", + " 0 0 x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " 0 0 x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 20; + blocksize = 4; + readsize = 256; + ; + + memory "lfuse" + size = 1; + min_write_delay = 16000; + max_write_delay = 16000; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; + + memory "hfuse" + size = 1; + min_write_delay = 16000; + max_write_delay = 16000; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; + + memory "efuse" + size = 1; + min_write_delay = 16000; + max_write_delay = 16000; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x 1 1 1 1 1 i i i"; + ; + + memory "lock" + size = 1; + min_write_delay = 16000; + max_write_delay = 16000; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; + + memory "signature" + size = 3; + + read = "0 0 1 1 0 0 0 0 0 0 x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + + memory "calibration" + size = 1; + + read = "0 0 1 1 1 0 0 0 0 0 x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; +; + + + +#------------------------------------------------------------ +# ATmega163 +#------------------------------------------------------------ + +part + id = "m163"; + desc = "ATmega163"; + stk500_devcode = 0x81; + avr910_devcode = 0x64; + signature = 0x1e 0x94 0x02; + chip_erase_delay = 32000; + pagel = 0xd7; + bs2 = 0xa0; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 0; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 30; + programfusepulsewidth = 0; + programfusepolltimeout = 2; + programlockpulsewidth = 0; + programlockpolltimeout = 2; + + + memory "eeprom" + size = 512; + min_write_delay = 4000; + max_write_delay = 4000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + mode = 0x41; + delay = 20; + blocksize = 4; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 16384; + page_size = 128; + num_pages = 128; + min_write_delay = 16000; + max_write_delay = 16000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " x x x a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " x x x a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; + + mode = 0x11; + delay = 20; + blocksize = 128; + readsize = 256; + ; + + memory "lfuse" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o x x o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i 1 1 i i i i"; + ; + + memory "hfuse" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x x x x x 1 o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x 1 1 1 1 1 i i i"; + ; + + memory "lock" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x 0 x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# ATmega169 +#------------------------------------------------------------ + +part + id = "m169"; + desc = "ATmega169"; + has_jtag = yes; + stk500_devcode = 0x85; + avr910_devcode = 0x78; + signature = 0x1e 0x94 0x05; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + idr = 0x31; + spmcr = 0x57; + + ocdrev = 2; + + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 4; /* for parallel programming */ + size = 512; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x x x a8", + " a7 a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 20; + blocksize = 4; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 16384; + page_size = 128; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " x x x a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " x x x a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 128; + readsize = 256; + ; + + memory "lfuse" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; + + memory "hfuse" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + ; + + memory "lock" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# ATmega329 +#------------------------------------------------------------ + +part + id = "m329"; + desc = "ATmega329"; + has_jtag = yes; +# stk500_devcode = 0x85; # no STK500 support, only STK500v2 +# avr910_devcode = 0x?; # try the ATmega169 one: + avr910_devcode = 0x75; + signature = 0x1e 0x95 0x03; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + idr = 0x31; + spmcr = 0x57; + + ocdrev = 3; + + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 4; /* for parallel programming */ + size = 1024; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 20; + blocksize = 8; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 32768; + page_size = 128; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " x a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " x x x a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 256; + readsize = 256; + ; + + memory "lfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; + + memory "hfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; + + memory "efuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x i i i"; + ; + + memory "lock" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# ATmega329P +#------------------------------------------------------------ +# Identical to ATmega329 except of the signature + +part parent "m329" + id = "m329p"; + desc = "ATmega329P"; + signature = 0x1e 0x95 0x0b; + + ocdrev = 3; + ; + +#------------------------------------------------------------ +# ATmega3290 +#------------------------------------------------------------ + +# identical to ATmega329 + +part parent "m329" + id = "m3290"; + desc = "ATmega3290"; + signature = 0x1e 0x95 0x04; + + ocdrev = 3; + ; + +#------------------------------------------------------------ +# ATmega3290P +#------------------------------------------------------------ + +# identical to ATmega3290 except of the signature + +part parent "m3290" + id = "m3290p"; + desc = "ATmega3290P"; + signature = 0x1e 0x95 0x0c; + + ocdrev = 3; + ; + +#------------------------------------------------------------ +# ATmega649 +#------------------------------------------------------------ + +part + id = "m649"; + desc = "ATmega649"; + has_jtag = yes; +# stk500_devcode = 0x85; # no STK500 support, only STK500v2 +# avr910_devcode = 0x?; # try the ATmega169 one: + avr910_devcode = 0x75; + signature = 0x1e 0x96 0x03; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + idr = 0x31; + spmcr = 0x57; + + ocdrev = 3; + + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 2048; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x a10 a9 a8", + " a7 a6 a5 a4 a3 0 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 20; + blocksize = 8; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 65536; + page_size = 256; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " x x x a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 256; + readsize = 256; + ; + + memory "lfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; + + memory "hfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; + + memory "efuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x i i i"; + ; + + memory "lock" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# ATmega6490 +#------------------------------------------------------------ + +# identical to ATmega649 + +part parent "m649" + id = "m6490"; + desc = "ATmega6490"; + signature = 0x1e 0x96 0x04; + + ocdrev = 3; + ; + +#------------------------------------------------------------ +# ATmega32 +#------------------------------------------------------------ + +part + id = "m32"; + desc = "ATmega32"; + has_jtag = yes; + stk500_devcode = 0x91; + avr910_devcode = 0x72; + signature = 0x1e 0x95 0x02; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xa0; + reset = dedicated; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 6; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + idr = 0x31; + spmcr = 0x57; + allowfullpagebitstream = yes; + + ocdrev = 2; + + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 4; /* for parallel programming */ + size = 1024; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " 0 0 x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " 0 0 x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x04; + delay = 10; + blocksize = 64; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 32768; + page_size = 128; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 a13 a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; + + mode = 0x21; + delay = 6; + blocksize = 64; + readsize = 256; + ; + + memory "lfuse" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; + + memory "hfuse" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; + + memory "lock" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + + memory "calibration" + size = 4; + read = "0 0 1 1 1 0 0 0 0 0 x x x x x x", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# ATmega161 +#------------------------------------------------------------ + +part + id = "m161"; + desc = "ATmega161"; + stk500_devcode = 0x80; + avr910_devcode = 0x60; + signature = 0x1e 0x94 0x01; + chip_erase_delay = 28000; + pagel = 0xd7; + bs2 = 0xa0; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 0; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 30; + programfusepulsewidth = 0; + programfusepolltimeout = 2; + programlockpulsewidth = 0; + programlockpolltimeout = 2; + + memory "eeprom" + size = 512; + min_write_delay = 3400; + max_write_delay = 3400; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + mode = 0x04; + delay = 5; + blocksize = 128; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 16384; + page_size = 128; + num_pages = 128; + min_write_delay = 14000; + max_write_delay = 14000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " x x x a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " x x x a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; + + mode = 0x21; + delay = 16; + blocksize = 128; + readsize = 256; + ; + + memory "fuse" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 0 0 0 0 x x x x x x x x", + "x x x x x x x x x o x o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 x x x x x", + "x x x x x x x x 1 i 1 i i i i i"; + ; + + memory "lock" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + ; + + +#------------------------------------------------------------ +# ATmega8 +#------------------------------------------------------------ + +part + id = "m8"; + desc = "ATmega8"; + stk500_devcode = 0x70; + avr910_devcode = 0x76; + signature = 0x1e 0x93 0x07; + pagel = 0xd7; + bs2 = 0xc2; + chip_erase_delay = 10000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 2; + resetdelayus = 0; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + memory "eeprom" + size = 512; + page_size = 4; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " 0 0 x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " 0 0 x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + mode = 0x04; + delay = 20; + blocksize = 128; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 0 x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 0 x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; + + mode = 0x21; + delay = 10; + blocksize = 64; + readsize = 256; + ; + + memory "lfuse" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; + + memory "hfuse" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; + + memory "lock" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; + + memory "calibration" + size = 4; + read = "0 0 1 1 1 0 0 0 0 0 x x x x x x", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + ; + + + +#------------------------------------------------------------ +# ATmega8515 +#------------------------------------------------------------ + +part + id = "m8515"; + desc = "ATmega8515"; + stk500_devcode = 0x63; + avr910_devcode = 0x3A; + signature = 0x1e 0x93 0x06; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 6; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + memory "eeprom" + size = 512; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " 0 0 x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " 0 0 x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + mode = 0x04; + delay = 20; + blocksize = 128; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 0 x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 0 x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; + + mode = 0x21; + delay = 6; + blocksize = 64; + readsize = 256; + ; + + memory "lfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; + + memory "hfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; + + memory "lock" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; + + memory "calibration" + size = 4; + read = "0 0 1 1 1 0 0 0 0 0 x x x x x x", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + ; + + + + +#------------------------------------------------------------ +# ATmega8535 +#------------------------------------------------------------ + +part + id = "m8535"; + desc = "ATmega8535"; + stk500_devcode = 0x64; + avr910_devcode = 0x69; + signature = 0x1e 0x93 0x08; + pagel = 0xd7; + bs2 = 0xa0; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 6; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + memory "eeprom" + size = 512; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " 0 0 x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " 0 0 x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + mode = 0x04; + delay = 20; + blocksize = 128; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 0 x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 0 x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; + + mode = 0x21; + delay = 6; + blocksize = 64; + readsize = 256; + ; + + memory "lfuse" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; + + memory "hfuse" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; + + memory "lock" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; + + memory "calibration" + size = 4; + read = "0 0 1 1 1 0 0 0 0 0 x x x x x x", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + ; + + +#------------------------------------------------------------ +# ATtiny26 +#------------------------------------------------------------ + +part + id = "t26"; + desc = "ATtiny26"; + stk500_devcode = 0x21; + avr910_devcode = 0x5e; + signature = 0x1e 0x91 0x09; + pagel = 0xb3; + bs2 = 0xb2; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; + + pp_controlstack = + 0xC4, 0xE4, 0xC4, 0xE4, 0xCC, 0xEC, 0xCC, 0xEC, + 0xD4, 0xF4, 0xD4, 0xF4, 0xDC, 0xFC, 0xDC, 0xFC, + 0xC8, 0xE8, 0xD8, 0xF8, 0x4C, 0x6C, 0x5C, 0x7C, + 0xEC, 0xBC, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 2; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + memory "eeprom" + size = 128; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 x x x x x x x x", + "x a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + + write = "1 1 0 0 0 0 0 0 x x x x x x x x", + "x a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + + mode = 0x04; + delay = 10; + blocksize = 64; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 2048; + page_size = 32; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x x x x a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x x x x a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 x x x x", + " x x x x x x x x"; + + mode = 0x21; + delay = 6; + blocksize = 16; + readsize = 256; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 x x x x x x x x", + "x x x x x x x x x x x x x x o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 1 i i", + "x x x x x x x x x x x x x x x x"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x x x x i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x x x x o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "calibration" + size = 4; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; + +; + + +#------------------------------------------------------------ +# ATtiny261 +#------------------------------------------------------------ +# Close to ATtiny26 + +part + id = "t261"; + desc = "ATtiny261"; + has_debugwire = yes; + flash_instr = 0xB4, 0x00, 0x10; + eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, + 0xBC, 0x00, 0xB4, 0x00, 0xBA, 0x0D, 0xBB, 0xBC, + 0x99, 0xE1, 0xBB, 0xAC; +# stk500_devcode = 0x21; +# avr910_devcode = 0x5e; + signature = 0x1e 0x91 0x0c; + pagel = 0xb3; + bs2 = 0xb2; + chip_erase_delay = 4000; + + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; + + pp_controlstack = + 0xC4, 0xE4, 0xC4, 0xE4, 0xCC, 0xEC, 0xCC, 0xEC, + 0xD4, 0xF4, 0xD4, 0xF4, 0xDC, 0xFC, 0xDC, 0xFC, + 0xC8, 0xE8, 0xD8, 0xF8, 0x4C, 0x6C, 0x5C, 0x7C, + 0xEC, 0xBC, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 2; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + ocdrev = 1; + + memory "eeprom" + paged = no; + size = 128; + page_size = 4; + num_pages = 32; + min_write_delay = 4000; + max_write_delay = 4000; + readback_p1 = 0xff; + readback_p2 = 0xff; + + read = "1 0 1 0 0 0 0 0 x x x x x x x x", + "x a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + + write = "1 1 0 0 0 0 0 0 x x x x x x x x", + "x a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x x x x", + " x a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 10; + blocksize = 4; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 2048; + page_size = 32; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x x x x a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x x x x a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 32; + readsize = 256; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 x x x x x x x x", + "x x x x x x x x x x x x x x o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 1 i i", + "x x x x x x x x x x x x x x x x"; + min_write_delay = 4500; + max_write_delay = 4500; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 4500; + max_write_delay = 4500; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 4500; + max_write_delay = 4500; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x x x x x x x x o"; + min_write_delay = 4500; + max_write_delay = 4500; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + +; + + +#------------------------------------------------------------ +# ATtiny461 +#------------------------------------------------------------ +# Close to ATtiny261 + +part + id = "t461"; + desc = "ATtiny461"; + has_debugwire = yes; + flash_instr = 0xB4, 0x00, 0x10; + eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, + 0xBC, 0x00, 0xB4, 0x00, 0xBA, 0x0D, 0xBB, 0xBC, + 0x99, 0xE1, 0xBB, 0xAC; +# stk500_devcode = 0x21; +# avr910_devcode = 0x5e; + signature = 0x1e 0x92 0x08; + pagel = 0xb3; + bs2 = 0xb2; + chip_erase_delay = 4000; + + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; + + pp_controlstack = + 0xC4, 0xE4, 0xC4, 0xE4, 0xCC, 0xEC, 0xCC, 0xEC, + 0xD4, 0xF4, 0xD4, 0xF4, 0xDC, 0xFC, 0xDC, 0xFC, + 0xC8, 0xE8, 0xD8, 0xF8, 0x4C, 0x6C, 0x5C, 0x7C, + 0xEC, 0xBC, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 2; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + ocdrev = 1; + + memory "eeprom" + paged = no; + size = 256; + page_size = 4; + num_pages = 64; + min_write_delay = 4000; + max_write_delay = 4000; + readback_p1 = 0xff; + readback_p2 = 0xff; + + read = " 1 0 1 0 0 0 0 0 x x x x x x x x", + "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0 x x x x x x x x", + "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x x x x", + " a7 a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 10; + blocksize = 4; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 4096; + page_size = 64; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 64; + readsize = 256; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 x x x x x x x x", + "x x x x x x x x x x x x x x o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 1 i i", + "x x x x x x x x x x x x x x x x"; + min_write_delay = 4500; + max_write_delay = 4500; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 4500; + max_write_delay = 4500; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 4500; + max_write_delay = 4500; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x x x x x x x x o"; + min_write_delay = 4500; + max_write_delay = 4500; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + +; + + +#------------------------------------------------------------ +# ATtiny861 +#------------------------------------------------------------ +# Close to ATtiny461 + +part + id = "t861"; + desc = "ATtiny861"; + has_debugwire = yes; + flash_instr = 0xB4, 0x00, 0x10; + eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, + 0xBC, 0x00, 0xB4, 0x00, 0xBA, 0x0D, 0xBB, 0xBC, + 0x99, 0xE1, 0xBB, 0xAC; +# stk500_devcode = 0x21; +# avr910_devcode = 0x5e; + signature = 0x1e 0x93 0x0d; + pagel = 0xb3; + bs2 = 0xb2; + chip_erase_delay = 4000; + + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; + + pp_controlstack = + 0xC4, 0xE4, 0xC4, 0xE4, 0xCC, 0xEC, 0xCC, 0xEC, + 0xD4, 0xF4, 0xD4, 0xF4, 0xDC, 0xFC, 0xDC, 0xFC, + 0xC8, 0xE8, 0xD8, 0xF8, 0x4C, 0x6C, 0x5C, 0x7C, + 0xEC, 0xBC, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 2; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + ocdrev = 1; + + memory "eeprom" + paged = no; + size = 512; + num_pages = 128; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4000; + readback_p1 = 0xff; + readback_p2 = 0xff; + + read = " 1 0 1 0 0 0 0 0 x x x x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0 x x x x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x x x a8", + " a7 a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 10; + blocksize = 4; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 64; + readsize = 256; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 x x x x x x x x", + "x x x x x x x x x x x x x x o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 1 i i", + "x x x x x x x x x x x x x x x x"; + min_write_delay = 4500; + max_write_delay = 4500; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 4500; + max_write_delay = 4500; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 4500; + max_write_delay = 4500; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x x x x x x x x o"; + min_write_delay = 4500; + max_write_delay = 4500; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + +; + + +#------------------------------------------------------------ +# ATmega48 +#------------------------------------------------------------ + +part + id = "m48"; + desc = "ATmega48"; + has_debugwire = yes; + flash_instr = 0xB6, 0x01, 0x11; + eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, + 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, + 0x99, 0xF9, 0xBB, 0xAF; + stk500_devcode = 0x59; +# avr910_devcode = 0x; + signature = 0x1e 0x92 0x05; + pagel = 0xd7; + bs2 = 0xc2; + chip_erase_delay = 45000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + ocdrev = 1; + + memory "eeprom" + paged = no; + page_size = 4; + size = 256; + min_write_delay = 3600; + max_write_delay = 3600; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " 0 0 0 x x x x x", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x x x x", + " a7 a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 20; + blocksize = 4; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 4096; + page_size = 64; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0x00; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 64; + readsize = 256; + ; + + memory "lfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; + + memory "hfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; + + memory "efuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x x x x x x x x o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; + ; + + memory "lock" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# ATmega48P +#------------------------------------------------------------ + +part parent "m48" + id = "m48p"; + desc = "ATmega48P"; + signature = 0x1e 0x92 0x0a; + + ocdrev = 1; + ; + +#------------------------------------------------------------ +# ATmega88 +#------------------------------------------------------------ + +part + id = "m88"; + desc = "ATmega88"; + has_debugwire = yes; + flash_instr = 0xB6, 0x01, 0x11; + eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, + 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, + 0x99, 0xF9, 0xBB, 0xAF; + stk500_devcode = 0x73; +# avr910_devcode = 0x; + signature = 0x1e 0x93 0x0a; + pagel = 0xd7; + bs2 = 0xc2; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + ocdrev = 1; + + memory "eeprom" + paged = no; + page_size = 4; + size = 512; + min_write_delay = 3600; + max_write_delay = 3600; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " 0 0 0 x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " 0 0 0 x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x x x a8", + " a7 a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 20; + blocksize = 4; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 64; + readsize = 256; + ; + + memory "lfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; + + memory "hfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; + + memory "efuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x x x x x x o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x i i i"; + ; + + memory "lock" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# ATmega88P +#------------------------------------------------------------ + +part parent "m88" + id = "m88p"; + desc = "ATmega88P"; + signature = 0x1e 0x93 0x0f; + + ocdrev = 1; + ; + +#------------------------------------------------------------ +# ATmega168 +#------------------------------------------------------------ + +part + id = "m168"; + desc = "ATmega168"; + has_debugwire = yes; + flash_instr = 0xB6, 0x01, 0x11; + eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, + 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, + 0x99, 0xF9, 0xBB, 0xAF; + stk500_devcode = 0x86; + # avr910_devcode = 0x; + signature = 0x1e 0x94 0x06; + pagel = 0xd7; + bs2 = 0xc2; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + ocdrev = 1; + + memory "eeprom" + paged = no; + page_size = 4; + size = 512; + min_write_delay = 3600; + max_write_delay = 3600; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " 0 0 0 x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " 0 0 0 x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x x x a8", + " a7 a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 20; + blocksize = 4; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 16384; + page_size = 128; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 128; + readsize = 256; + + ; + + memory "lfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; + + memory "hfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; + + memory "efuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x x x x x x o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x i i i"; + ; + + memory "lock" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; +; + +#------------------------------------------------------------ +# ATmega168P +#------------------------------------------------------------ + +part parent "m168" + id = "m168p"; + desc = "ATmega168P"; + signature = 0x1e 0x94 0x0b; + + ocdrev = 1; +; + +#------------------------------------------------------------ +# ATtiny88 +#------------------------------------------------------------ + +part + id = "t88"; + desc = "ATtiny88"; + has_debugwire = yes; + flash_instr = 0xB6, 0x01, 0x11; + eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, + 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, + 0x99, 0xF9, 0xBB, 0xAF; + stk500_devcode = 0x73; +# avr910_devcode = 0x; + signature = 0x1e 0x93 0x11; + pagel = 0xd7; + bs2 = 0xc2; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + ocdrev = 1; + + memory "eeprom" + paged = no; + page_size = 4; + size = 64; + min_write_delay = 3600; + max_write_delay = 3600; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " 0 0 0 x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x x x x", + " x a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 20; + blocksize = 4; + readsize = 64; + ; + memory "flash" + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 64; + readsize = 256; + ; + + memory "lfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; + + memory "hfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; + + memory "efuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x x x x x x o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; + ; + + memory "lock" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# ATmega328 +#------------------------------------------------------------ + +part + id = "m328"; + desc = "ATmega328"; + has_debugwire = yes; + flash_instr = 0xB6, 0x01, 0x11; + eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, + 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, + 0x99, 0xF9, 0xBB, 0xAF; + stk500_devcode = 0x86; + # avr910_devcode = 0x; + signature = 0x1e 0x95 0x14; + pagel = 0xd7; + bs2 = 0xc2; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + ocdrev = 1; + + memory "eeprom" + paged = no; + page_size = 4; + size = 1024; + min_write_delay = 3600; + max_write_delay = 3600; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " 0 0 0 x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " 0 0 0 x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 20; + blocksize = 4; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 32768; + page_size = 128; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 a13 a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 128; + readsize = 256; + + ; + + memory "lfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; + + memory "hfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; + + memory "efuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x x x x x x o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x i i i"; + ; + + memory "lock" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; +; + +part parent "m328" + id = "m328p"; + desc = "ATmega328P"; + signature = 0x1e 0x95 0x0F; + + ocdrev = 1; +; + +#------------------------------------------------------------ +# ATtiny2313 +#------------------------------------------------------------ + +part + id = "t2313"; + desc = "ATtiny2313"; + has_debugwire = yes; + flash_instr = 0xB2, 0x0F, 0x1F; + eeprom_instr = 0xBB, 0xFE, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, + 0xBA, 0x0F, 0xB2, 0x0F, 0xBA, 0x0D, 0xBB, 0xBC, + 0x99, 0xE1, 0xBB, 0xAC; + stk500_devcode = 0x23; +## Use the ATtiny26 devcode: + avr910_devcode = 0x5e; + signature = 0x1e 0x91 0x0a; + pagel = 0xD4; + bs2 = 0xD6; + reset = io; + chip_erase_delay = 9000; + + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + pp_controlstack = + 0x0E, 0x1E, 0x0E, 0x1E, 0x2E, 0x3E, 0x2E, 0x3E, + 0x4E, 0x5E, 0x4E, 0x5E, 0x6E, 0x7E, 0x6E, 0x7E, + 0x26, 0x36, 0x66, 0x76, 0x2A, 0x3A, 0x6A, 0x7A, + 0x2E, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + ocdrev = 0; + + memory "eeprom" + size = 128; + paged = no; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 0 0 0 x x x x x", + "x a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + + write = "1 1 0 0 0 0 0 0 0 0 0 x x x x x", + "x a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x x x x", + " x a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 4; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 2048; + page_size = 32; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 0 0 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 0 0 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + +# The information in the data sheet of April/2004 is wrong, this works: + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x x x a3 a2 a1 a0", + " i i i i i i i i"; + +# The information in the data sheet of April/2004 is wrong, this works: + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x x x a3 a2 a1 a0", + " i i i i i i i i"; + +# The information in the data sheet of April/2004 is wrong, this works: + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 0 0 a9 a8", + " a7 a6 a5 a4 x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 32; + readsize = 256; + ; +# ATtiny2313 has Signature Bytes: 0x1E 0x91 0x0A. + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "lock" + size = 1; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; +# The Tiny2313 has calibration data for both 4 MHz and 8 MHz. +# The information in the data sheet of April/2004 is wrong, this works: + + memory "calibration" + size = 2; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 a0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# ATtiny4313 +#------------------------------------------------------------ + +part + id = "t4313"; + desc = "ATtiny4313"; + has_debugwire = yes; + flash_instr = 0xB2, 0x0F, 0x1F; + eeprom_instr = 0xBB, 0xFE, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, + 0xBA, 0x0F, 0xB2, 0x0F, 0xBA, 0x0D, 0xBB, 0xBC, + 0x99, 0xE1, 0xBB, 0xAC; + stk500_devcode = 0x23; +## Use the ATtiny26 devcode: + avr910_devcode = 0x5e; + signature = 0x1e 0x92 0x0d; + pagel = 0xD4; + bs2 = 0xD6; + reset = io; + chip_erase_delay = 9000; + + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + pp_controlstack = + 0x0E, 0x1E, 0x0E, 0x1E, 0x2E, 0x3E, 0x2E, 0x3E, + 0x4E, 0x5E, 0x4E, 0x5E, 0x6E, 0x7E, 0x6E, 0x7E, + 0x26, 0x36, 0x66, 0x76, 0x2A, 0x3A, 0x6A, 0x7A, + 0x2E, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + ocdrev = 0; + + memory "eeprom" + size = 256; + paged = no; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 0 0 0 x x x x x", + "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + + write = "1 1 0 0 0 0 0 0 0 0 0 x x x x x", + "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x x x x", + " a7 a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 4; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 4096; + page_size = 64; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 32; + readsize = 256; + ; +# ATtiny4313 has Signature Bytes: 0x1E 0x92 0x0D. + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "lock" + size = 1; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "calibration" + size = 2; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 a0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# AT90PWM2 +#------------------------------------------------------------ + +part + id = "pwm2"; + desc = "AT90PWM2"; + has_debugwire = yes; + flash_instr = 0xB6, 0x01, 0x11; + eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, + 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, + 0x99, 0xF9, 0xBB, 0xAF; + stk500_devcode = 0x65; +## avr910_devcode = ?; + signature = 0x1e 0x93 0x81; + pagel = 0xD8; + bs2 = 0xE2; + reset = io; + chip_erase_delay = 9000; + + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + memory "eeprom" + size = 512; + paged = no; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 0 0 0 x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + + write = "1 1 0 0 0 0 0 0 0 0 0 x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x x x x", + " a7 a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 4; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 64; + readsize = 256; + ; +# AT90PWM2 has Signature Bytes: 0x1E 0x93 0x81. + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "lock" + size = 1; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# AT90PWM3 +#------------------------------------------------------------ + +# Completely identical to AT90PWM2 (including the signature!) + +part parent "pwm2" + id = "pwm3"; + desc = "AT90PWM3"; + ; + +#------------------------------------------------------------ +# AT90PWM2B +#------------------------------------------------------------ +# Same as AT90PWM2 but different signature. + +part parent "pwm2" + id = "pwm2b"; + desc = "AT90PWM2B"; + signature = 0x1e 0x93 0x83; + + ocdrev = 1; + ; + +#------------------------------------------------------------ +# AT90PWM3B +#------------------------------------------------------------ + +# Completely identical to AT90PWM2B (including the signature!) + +part parent "pwm2b" + id = "pwm3b"; + desc = "AT90PWM3B"; + + ocdrev = 1; + ; + +#------------------------------------------------------------ +# AT90PWM316 +#------------------------------------------------------------ + +# Similar to AT90PWM3B, but with 16 kiB flash, 512 B EEPROM, and 1024 B SRAM. + +part parent "pwm3b" + id = "pwm316"; + desc = "AT90PWM316"; + signature = 0x1e 0x94 0x83; + + ocdrev = 1; + + memory "flash" + paged = yes; + size = 16384; + page_size = 128; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 a13 a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; + + mode = 0x21; + delay = 6; + blocksize = 128; + readsize = 256; + ; + ; + +#------------------------------------------------------------ +# ATtiny25 +#------------------------------------------------------------ + +part + id = "t25"; + desc = "ATtiny25"; + has_debugwire = yes; + flash_instr = 0xB4, 0x02, 0x12; + eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, + 0xBC, 0x02, 0xB4, 0x02, 0xBA, 0x0D, 0xBB, 0xBC, + 0x99, 0xE1, 0xBB, 0xAC; +## no STK500 devcode in XML file, use the ATtiny45 one + stk500_devcode = 0x14; +## avr910_devcode = ?; +## Try the AT90S2313 devcode: + avr910_devcode = 0x20; + signature = 0x1e 0x91 0x08; + reset = io; + chip_erase_delay = 4500; + + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + hvsp_controlstack = + 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66, + 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, + 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; + hventerstabdelay = 100; + hvspcmdexedelay = 0; + synchcycles = 6; + latchcycles = 1; + togglevtg = 1; + poweroffdelay = 25; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; + chiperasetime = 0; + programfusepolltimeout = 25; + programlockpolltimeout = 25; + + ocdrev = 1; + + memory "eeprom" + size = 128; + paged = no; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 0 0 0 x x x x x", + "x a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + + write = "1 1 0 0 0 0 0 0 0 0 0 x x x x x", + "x a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x x x x", + " x a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 4; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 2048; + page_size = 32; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 0 0 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 0 0 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x x x a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x x x a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 0 0 a9 a8", + " a7 a6 a5 a4 x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 32; + readsize = 256; + ; +# ATtiny25 has Signature Bytes: 0x1E 0x91 0x08. + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "lock" + size = 1; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "calibration" + size = 2; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 a0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# ATtiny45 +#------------------------------------------------------------ + +part + id = "t45"; + desc = "ATtiny45"; + has_debugwire = yes; + flash_instr = 0xB4, 0x02, 0x12; + eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, + 0xBC, 0x02, 0xB4, 0x02, 0xBA, 0x0D, 0xBB, 0xBC, + 0x99, 0xE1, 0xBB, 0xAC; + stk500_devcode = 0x14; +## avr910_devcode = ?; +## Try the AT90S2313 devcode: + avr910_devcode = 0x20; + signature = 0x1e 0x92 0x06; + reset = io; + chip_erase_delay = 4500; + + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + hvsp_controlstack = + 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66, + 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, + 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + hvspcmdexedelay = 0; + synchcycles = 6; + latchcycles = 1; + togglevtg = 1; + poweroffdelay = 25; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; + chiperasetime = 0; + programfusepolltimeout = 25; + programlockpolltimeout = 25; + + ocdrev = 1; + + memory "eeprom" + size = 256; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 0 0 0 x x x x x", + "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + + write = "1 1 0 0 0 0 0 0 0 0 0 x x x x x", + "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x x x x", + " a7 a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 4; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 4096; + page_size = 64; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 32; + readsize = 256; + ; +# ATtiny45 has Signature Bytes: 0x1E 0x92 0x08. (Data sheet 2586C-AVR-06/05 (doc2586.pdf) indicates otherwise!) + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "lock" + size = 1; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "calibration" + size = 2; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 a0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# ATtiny85 +#------------------------------------------------------------ + +part + id = "t85"; + desc = "ATtiny85"; + has_debugwire = yes; + flash_instr = 0xB4, 0x02, 0x12; + eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, + 0xBC, 0x02, 0xB4, 0x02, 0xBA, 0x0D, 0xBB, 0xBC, + 0x99, 0xE1, 0xBB, 0xAC; +## no STK500 devcode in XML file, use the ATtiny45 one + stk500_devcode = 0x14; +## avr910_devcode = ?; +## Try the AT90S2313 devcode: + avr910_devcode = 0x20; + signature = 0x1e 0x93 0x0b; + reset = io; + chip_erase_delay = 4500; + + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + hvsp_controlstack = + 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66, + 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, + 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; + hventerstabdelay = 100; + hvspcmdexedelay = 0; + synchcycles = 6; + latchcycles = 1; + togglevtg = 1; + poweroffdelay = 25; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; + chiperasetime = 0; + programfusepolltimeout = 25; + programlockpolltimeout = 25; + + ocdrev = 1; + + memory "eeprom" + size = 512; + paged = no; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 0 0 0 x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + + write = "1 1 0 0 0 0 0 0 0 0 0 x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x x x a8", + " a7 a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 4; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 32; + readsize = 256; + ; +# ATtiny85 has Signature Bytes: 0x1E 0x93 0x08. + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "lock" + size = 1; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "calibration" + size = 2; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 a0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# ATmega640 +#------------------------------------------------------------ +# Almost same as ATmega1280, except for different memory sizes + +part + id = "m640"; + desc = "ATmega640"; + signature = 0x1e 0x96 0x08; + has_jtag = yes; +# stk500_devcode = 0xB2; +# avr910_devcode = 0x43; + chip_erase_delay = 9000; + pagel = 0xD7; + bs2 = 0xA0; + reset = dedicated; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + idr = 0x31; + spmcr = 0x57; + rampz = 0x3b; + allowfullpagebitstream = no; + + ocdrev = 3; + + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 4096; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0x00; + readback_p2 = 0x00; + read = " 1 0 1 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 0 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 10; + blocksize = 8; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 65536; + page_size = 256; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0x00; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 10; + blocksize = 256; + readsize = 256; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# ATmega1280 +#------------------------------------------------------------ + +part + id = "m1280"; + desc = "ATmega1280"; + signature = 0x1e 0x97 0x03; + has_jtag = yes; +# stk500_devcode = 0xB2; +# avr910_devcode = 0x43; + chip_erase_delay = 9000; + pagel = 0xD7; + bs2 = 0xA0; + reset = dedicated; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + idr = 0x31; + spmcr = 0x57; + rampz = 0x3b; + allowfullpagebitstream = no; + + ocdrev = 3; + + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 4096; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0x00; + readback_p2 = 0x00; + read = " 1 0 1 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 0 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 10; + blocksize = 8; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 131072; + page_size = 256; + num_pages = 512; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0x00; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 10; + blocksize = 256; + readsize = 256; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# ATmega1281 +#------------------------------------------------------------ +# Identical to ATmega1280 + +part parent "m1280" + id = "m1281"; + desc = "ATmega1281"; + signature = 0x1e 0x97 0x04; + + ocdrev = 3; + ; + +#------------------------------------------------------------ +# ATmega2560 +#------------------------------------------------------------ + +part + id = "m2560"; + desc = "ATmega2560"; + signature = 0x1e 0x98 0x01; + has_jtag = yes; +# stk500_devcode = 0xB2; +# avr910_devcode = 0x43; + chip_erase_delay = 9000; + pagel = 0xD7; + bs2 = 0xA0; + reset = dedicated; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + idr = 0x31; + spmcr = 0x57; + rampz = 0x3b; + allowfullpagebitstream = no; + + ocdrev = 4; + + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 4096; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0x00; + readback_p2 = 0x00; + read = " 1 0 1 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 0 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 10; + blocksize = 8; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 262144; + page_size = 256; + num_pages = 1024; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0x00; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; + + load_ext_addr = " 0 1 0 0 1 1 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 0 a16", + " 0 0 0 0 0 0 0 0"; + + mode = 0x41; + delay = 10; + blocksize = 256; + readsize = 256; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# ATmega2561 +#------------------------------------------------------------ + +part parent "m2560" + id = "m2561"; + desc = "ATmega2561"; + signature = 0x1e 0x98 0x02; + + ocdrev = 4; + ; + +#------------------------------------------------------------ +# ATmega128RFA1 +#------------------------------------------------------------ +# Identical to ATmega2561 but half the ROM + +part parent "m2561" + id = "m128rfa1"; + desc = "ATmega128RFA1"; + signature = 0x1e 0xa7 0x01; + chip_erase_delay = 55000; + bs2 = 0xE2; + + ocdrev = 3; + + memory "flash" + paged = yes; + size = 131072; + page_size = 256; + num_pages = 512; + min_write_delay = 50000; + max_write_delay = 50000; + readback_p1 = 0x00; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 20; + blocksize = 256; + readsize = 256; + ; + ; + +#------------------------------------------------------------ +# ATmega256RFR2 +#------------------------------------------------------------ + +part parent "m2561" + id = "m256rfr2"; + desc = "ATmega256RFR2"; + signature = 0x1e 0xa8 0x02; + chip_erase_delay = 55000; + bs2 = 0xE2; + + + ocdrev = 4; + ; + +#------------------------------------------------------------ +# ATmega128RFR2 +#------------------------------------------------------------ + +part parent "m128rfa1" + id = "m128rfr2"; + desc = "ATmega128RFR2"; + signature = 0x1e 0xa7 0x02; + + + ocdrev = 3; + ; + +#------------------------------------------------------------ +# ATmega64RFR2 +#------------------------------------------------------------ + +part parent "m128rfa1" + id = "m64rfr2"; + desc = "ATmega64RFR2"; + signature = 0x1e 0xa6 0x02; + + + ocdrev = 3; + + memory "flash" + paged = yes; + size = 65536; + page_size = 256; + num_pages = 256; + min_write_delay = 50000; + max_write_delay = 50000; + readback_p1 = 0x00; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 20; + blocksize = 256; + readsize = 256; + ; + ; + +#------------------------------------------------------------ +# ATmega2564RFR2 +#------------------------------------------------------------ + +part parent "m256rfr2" + id = "m2564rfr2"; + desc = "ATmega2564RFR2"; + signature = 0x1e 0xa8 0x03; + ; + +#------------------------------------------------------------ +# ATmega1284RFR2 +#------------------------------------------------------------ + +part parent "m128rfr2" + id = "m1284rfr2"; + desc = "ATmega1284RFR2"; + signature = 0x1e 0xa7 0x03; + ; + +#------------------------------------------------------------ +# ATmega644RFR2 +#------------------------------------------------------------ + +part parent "m64rfr2" + id = "m644rfr2"; + desc = "ATmega644RFR2"; + signature = 0x1e 0xa6 0x03; + ; + +#------------------------------------------------------------ +# ATtiny24 +#------------------------------------------------------------ + +part + id = "t24"; + desc = "ATtiny24"; + has_debugwire = yes; + flash_instr = 0xB4, 0x07, 0x17; + eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, + 0xBC, 0x07, 0xB4, 0x07, 0xBA, 0x0D, 0xBB, 0xBC, + 0x99, 0xE1, 0xBB, 0xAC; +## no STK500 devcode in XML file, use the ATtiny45 one + stk500_devcode = 0x14; +## avr910_devcode = ?; +## Try the AT90S2313 devcode: + avr910_devcode = 0x20; + signature = 0x1e 0x91 0x0b; + reset = io; + chip_erase_delay = 4500; + + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + hvsp_controlstack = + 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66, + 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, + 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x0F; + hventerstabdelay = 100; + hvspcmdexedelay = 0; + synchcycles = 6; + latchcycles = 1; + togglevtg = 1; + poweroffdelay = 25; + resetdelayms = 0; + resetdelayus = 70; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; + chiperasetime = 0; + programfusepolltimeout = 25; + programlockpolltimeout = 25; + + ocdrev = 1; + + memory "eeprom" + size = 128; + paged = no; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 0 0 0 x x x x x", + "x a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + + write = "1 1 0 0 0 0 0 0 0 0 0 x x x x x", + "x a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x x x x", + " x a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 4; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 2048; + page_size = 32; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 0 0 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 0 0 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x x x a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x x x a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 0 0 a9 a8", + " a7 a6 a5 a4 x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 32; + readsize = 256; + ; +# ATtiny24 has Signature Bytes: 0x1E 0x91 0x0B. + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "lock" + size = 1; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x x x x x x x i i"; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 a0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# ATtiny44 +#------------------------------------------------------------ + +part + id = "t44"; + desc = "ATtiny44"; + has_debugwire = yes; + flash_instr = 0xB4, 0x07, 0x17; + eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, + 0xBC, 0x07, 0xB4, 0x07, 0xBA, 0x0D, 0xBB, 0xBC, + 0x99, 0xE1, 0xBB, 0xAC; +## no STK500 devcode in XML file, use the ATtiny45 one + stk500_devcode = 0x14; +## avr910_devcode = ?; +## Try the AT90S2313 devcode: + avr910_devcode = 0x20; + signature = 0x1e 0x92 0x07; + reset = io; + chip_erase_delay = 4500; + + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + hvsp_controlstack = + 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66, + 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, + 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x0F; + hventerstabdelay = 100; + hvspcmdexedelay = 0; + synchcycles = 6; + latchcycles = 1; + togglevtg = 1; + poweroffdelay = 25; + resetdelayms = 0; + resetdelayus = 70; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; + chiperasetime = 0; + programfusepolltimeout = 25; + programlockpolltimeout = 25; + + ocdrev = 1; + + memory "eeprom" + size = 256; + paged = no; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 0 0 0 x x x x x", + "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + + write = "1 1 0 0 0 0 0 0 0 0 0 x x x x x", + "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x x x x", + " x a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 4; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 4096; + page_size = 64; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 32; + readsize = 256; + ; +# ATtiny44 has Signature Bytes: 0x1E 0x92 0x07. + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "lock" + size = 1; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x x x x x x x i i"; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 a0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# ATtiny84 +#------------------------------------------------------------ + +part + id = "t84"; + desc = "ATtiny84"; + has_debugwire = yes; + flash_instr = 0xB4, 0x07, 0x17; + eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, + 0xBC, 0x07, 0xB4, 0x07, 0xBA, 0x0D, 0xBB, 0xBC, + 0x99, 0xE1, 0xBB, 0xAC; +## no STK500 devcode in XML file, use the ATtiny45 one + stk500_devcode = 0x14; +## avr910_devcode = ?; +## Try the AT90S2313 devcode: + avr910_devcode = 0x20; + signature = 0x1e 0x93 0x0c; + reset = io; + chip_erase_delay = 4500; + + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + hvsp_controlstack = + 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66, + 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, + 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x0F; + hventerstabdelay = 100; + hvspcmdexedelay = 0; + synchcycles = 6; + latchcycles = 1; + togglevtg = 1; + poweroffdelay = 25; + resetdelayms = 0; + resetdelayus = 70; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; + chiperasetime = 0; + programfusepolltimeout = 25; + programlockpolltimeout = 25; + + ocdrev = 1; + + memory "eeprom" + size = 512; + paged = no; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 0 0 0 x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + + write = "1 1 0 0 0 0 0 0 0 0 0 x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x x x x", + " x a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 4; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 32; + readsize = 256; + ; +# ATtiny84 has Signature Bytes: 0x1E 0x93 0x0C. + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + + memory "lock" + size = 1; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x x x x x x x i i"; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 a0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# ATtiny43U +#------------------------------------------------------------ + +part + id = "t43u"; + desc = "ATtiny43u"; + has_debugwire = yes; + flash_instr = 0xB4, 0x07, 0x17; + eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, + 0xBC, 0x07, 0xB4, 0x07, 0xBA, 0x0D, 0xBB, 0xBC, + 0x99, 0xE1, 0xBB, 0xAC; + stk500_devcode = 0x14; +## avr910_devcode = ?; +## Try the AT90S2313 devcode: + avr910_devcode = 0x20; + signature = 0x1e 0x92 0x0C; + reset = io; + chip_erase_delay = 1000; + + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = 0x0E, 0x1E, 0x0E, 0x1E, 0x2E, 0x3E, 0x2E, 0x3E, 0x4E, 0x5E, + 0x4E, 0x5E, 0x6E, 0x7E, 0x6E, 0x7E, 0x06, 0x16, 0x46, 0x56, + 0x0A, 0x1A, 0x4A, 0x5A, 0x1E, 0x7C, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + hvspcmdexedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 20; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + memory "eeprom" + size = 64; + paged = yes; + page_size = 4; + num_pages = 16; + min_write_delay = 4000; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 0 0 0 x x x x x", + "0 0 a4 a3 a2 a1 a0 o o o o o o o o"; + + write = "1 1 0 0 0 0 0 0 0 0 0 x x x x x", + "0 0 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x x x x", + " 0 0 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 5; + blocksize = 4; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 4096; + page_size = 64; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 10; + blocksize = 64; + readsize = 256; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "lock" + size = 1; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 4500; + max_write_delay = 4500; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 4500; + max_write_delay = 4500; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 4500; + max_write_delay = 4500; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 4500; + max_write_delay = 4500; + ; + + memory "calibration" + size = 2; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 a0 o o o o o o o o"; + ; +; + +#------------------------------------------------------------ +# ATmega32u4 +#------------------------------------------------------------ + +part + id = "m32u4"; + desc = "ATmega32U4"; + signature = 0x1e 0x95 0x87; + has_jtag = yes; +# stk500_devcode = 0xB2; +# avr910_devcode = 0x43; + chip_erase_delay = 9000; + pagel = 0xD7; + bs2 = 0xA0; + reset = dedicated; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + idr = 0x31; + spmcr = 0x57; + rampz = 0x3b; + allowfullpagebitstream = no; + + ocdrev = 3; + + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 4; /* for parallel programming */ + size = 1024; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0x00; + readback_p2 = 0x00; + read = " 1 0 1 0 0 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x a10 a9 a8", + " a7 a6 a5 a4 a3 0 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 20; + blocksize = 4; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 32768; + page_size = 128; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0x00; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 128; + readsize = 256; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# AT90USB646 +#------------------------------------------------------------ + +part + id = "usb646"; + desc = "AT90USB646"; + signature = 0x1e 0x96 0x82; + has_jtag = yes; +# stk500_devcode = 0xB2; +# avr910_devcode = 0x43; + chip_erase_delay = 9000; + pagel = 0xD7; + bs2 = 0xA0; + reset = dedicated; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + idr = 0x31; + spmcr = 0x57; + rampz = 0x3b; + allowfullpagebitstream = no; + + ocdrev = 3; + + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 2048; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0x00; + readback_p2 = 0x00; + read = " 1 0 1 0 0 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x a10 a9 a8", + " a7 a6 a5 a4 a3 0 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 10; + blocksize = 8; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 65536; + page_size = 256; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0x00; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 256; + readsize = 256; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# AT90USB647 +#------------------------------------------------------------ +# identical to AT90USB646 + +part parent "usb646" + id = "usb647"; + desc = "AT90USB647"; + signature = 0x1e 0x96 0x82; + + ocdrev = 3; + ; + +#------------------------------------------------------------ +# AT90USB1286 +#------------------------------------------------------------ + +part + id = "usb1286"; + desc = "AT90USB1286"; + signature = 0x1e 0x97 0x82; + has_jtag = yes; +# stk500_devcode = 0xB2; +# avr910_devcode = 0x43; + chip_erase_delay = 9000; + pagel = 0xD7; + bs2 = 0xA0; + reset = dedicated; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + idr = 0x31; + spmcr = 0x57; + rampz = 0x3b; + allowfullpagebitstream = no; + + ocdrev = 3; + + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 4096; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0x00; + readback_p2 = 0x00; + read = " 1 0 1 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x a10 a9 a8", + " a7 a6 a5 a4 a3 0 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 10; + blocksize = 8; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 131072; + page_size = 256; + num_pages = 512; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0x00; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 256; + readsize = 256; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# AT90USB1287 +#------------------------------------------------------------ +# identical to AT90USB1286 + +part parent "usb1286" + id = "usb1287"; + desc = "AT90USB1287"; + signature = 0x1e 0x97 0x82; + + ocdrev = 3; + ; + +#------------------------------------------------------------ +# AT90USB162 +#------------------------------------------------------------ + +part + id = "usb162"; + desc = "AT90USB162"; + has_jtag = no; + has_debugwire = yes; + signature = 0x1e 0x94 0x82; + chip_erase_delay = 9000; + reset = io; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + pagel = 0xD7; + bs2 = 0xC6; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + ocdrev = 1; + + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 4; /* for parallel programming */ + size = 512; + num_pages = 128; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0x00; + readback_p2 = 0x00; + read = " 1 0 1 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 20; + blocksize = 4; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 16384; + page_size = 128; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0x00; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 128; + readsize = 256; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# AT90USB82 +#------------------------------------------------------------ +# Changes against AT90USB162 (beside IDs) +# memory "flash" +# size = 8192; +# num_pages = 64; + +part + id = "usb82"; + desc = "AT90USB82"; + has_jtag = no; + has_debugwire = yes; + signature = 0x1e 0x93 0x82; + chip_erase_delay = 9000; + reset = io; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + pagel = 0xD7; + bs2 = 0xC6; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + ocdrev = 1; + + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 4; /* for parallel programming */ + size = 512; + num_pages = 128; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0x00; + readback_p2 = 0x00; + read = " 1 0 1 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 20; + blocksize = 4; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 8192; + page_size = 128; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0x00; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 128; + readsize = 256; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# ATmega32U2 +#------------------------------------------------------------ +# Changes against AT90USB162 (beside IDs) +# memory "flash" +# size = 32768; +# num_pages = 256; +# memory "eeprom" +# size = 1024; +# num_pages = 256; +part + id = "m32u2"; + desc = "ATmega32U2"; + has_jtag = no; + has_debugwire = yes; + signature = 0x1e 0x95 0x8a; + chip_erase_delay = 9000; + reset = io; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + pagel = 0xD7; + bs2 = 0xC6; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + ocdrev = 1; + + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 4; /* for parallel programming */ + size = 1024; + num_pages = 256; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0x00; + readback_p2 = 0x00; + read = " 1 0 1 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 20; + blocksize = 4; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 32768; + page_size = 128; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0x00; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 128; + readsize = 256; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + ; +#------------------------------------------------------------ +# ATmega16U2 +#------------------------------------------------------------ +# Changes against ATmega32U2 (beside IDs) +# memory "flash" +# size = 16384; +# num_pages = 128; +# memory "eeprom" +# size = 512; +# num_pages = 128; +part + id = "m16u2"; + desc = "ATmega16U2"; + has_jtag = no; + has_debugwire = yes; + signature = 0x1e 0x94 0x89; + chip_erase_delay = 9000; + reset = io; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + pagel = 0xD7; + bs2 = 0xC6; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + ocdrev = 1; + + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 4; /* for parallel programming */ + size = 512; + num_pages = 128; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0x00; + readback_p2 = 0x00; + read = " 1 0 1 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 20; + blocksize = 4; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 16384; + page_size = 128; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0x00; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 128; + readsize = 256; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# ATmega8U2 +#------------------------------------------------------------ +# Changes against ATmega16U2 (beside IDs) +# memory "flash" +# size = 8192; +# page_size = 64; +# blocksize = 64; + +part + id = "m8u2"; + desc = "ATmega8U2"; + has_jtag = no; + has_debugwire = yes; + signature = 0x1e 0x93 0x89; + chip_erase_delay = 9000; + reset = io; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + pagel = 0xD7; + bs2 = 0xC6; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + ocdrev = 1; + + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 4; /* for parallel programming */ + size = 512; + num_pages = 128; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0x00; + readback_p2 = 0x00; + read = " 1 0 1 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 20; + blocksize = 4; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0x00; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 64; + readsize = 256; + ; + + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x i i i i i i i i"; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + ; +#------------------------------------------------------------ +# ATmega325 +#------------------------------------------------------------ + +part + id = "m325"; + desc = "ATmega325"; + signature = 0x1e 0x95 0x05; + has_jtag = yes; +# stk500_devcode = 0x??; # No STK500v1 support? +# avr910_devcode = 0x??; # Try the ATmega16 one + avr910_devcode = 0x74; + pagel = 0xd7; + bs2 = 0xa0; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + idr = 0x31; + spmcr = 0x57; + allowfullpagebitstream = no; + + ocdrev = 3; + + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 4; /* for parallel programming */ + size = 1024; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " 0 0 0 0 0 0 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " 0 0 0 0 0 0 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 0 0 0 0 a9 a8", + " a7 a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 10; + blocksize = 4; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 32768; + page_size = 128; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 0 0 0 0 0", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 0 0 0 0 0", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " x x x x x x x x"; + + mode = 0x41; + delay = 10; + blocksize = 128; + readsize = 256; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 0 0 0 0 0", + "0 0 0 0 0 0 0 0 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lfuse" + size = 1; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "0 0 0 0 0 0 0 0 i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "0 0 0 0 0 0 0 0 i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "0 0 0 0 0 0 0 0 1 1 1 1 1 i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; + + memory "calibration" + size = 1; + + read = "0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# ATmega645 +#------------------------------------------------------------ + +part + id = "m645"; + desc = "ATmega645"; + signature = 0x1E 0x96 0x05; + has_jtag = yes; +# stk500_devcode = 0x??; # No STK500v1 support? +# avr910_devcode = 0x??; # Try the ATmega16 one + avr910_devcode = 0x74; + pagel = 0xd7; + bs2 = 0xa0; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + idr = 0x31; + spmcr = 0x57; + allowfullpagebitstream = no; + + ocdrev = 3; + + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 2048; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 a4 a3 0 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 10; + blocksize = 8; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 65536; + page_size = 256; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 0 0 0 0 0", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 0 0 0 0 0", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " 0 0 0 0 0 0 0 0"; + + mode = 0x41; + delay = 10; + blocksize = 128; + readsize = 256; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 0 0 0 0 0", + "0 0 0 0 0 0 0 0 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lfuse" + size = 1; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "0 0 0 0 0 0 0 0 i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "0 0 0 0 0 0 0 0 i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "0 0 0 0 0 0 0 0 1 1 1 1 1 i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; + + memory "calibration" + size = 1; + + read = "0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + ; + +#------------------------------------------------------------ +# ATmega3250 +#------------------------------------------------------------ + +part parent "m325" + id = "m3250"; + desc = "ATmega3250"; + signature = 0x1E 0x95 0x06; + + ocdrev = 3; + ; + +#------------------------------------------------------------ +# ATmega6450 +#------------------------------------------------------------ + +part parent "m645" + id = "m6450"; + desc = "ATmega6450"; + signature = 0x1E 0x96 0x06; + + ocdrev = 3; + ; + +#------------------------------------------------------------ +# AVR XMEGA family common values +#------------------------------------------------------------ + +part + id = ".xmega"; + desc = "AVR XMEGA family common values"; + has_pdi = yes; + nvm_base = 0x01c0; + mcu_base = 0x0090; + + memory "signature" + size = 3; + offset = 0x1000090; + ; + + memory "prodsig" + size = 0x32; + offset = 0x8e0200; + page_size = 0x32; + readsize = 0x32; + ; + + memory "fuse1" + size = 1; + offset = 0x8f0021; + ; + + memory "fuse2" + size = 1; + offset = 0x8f0022; + ; + + memory "fuse4" + size = 1; + offset = 0x8f0024; + ; + + memory "fuse5" + size = 1; + offset = 0x8f0025; + ; + + memory "lock" + size = 1; + offset = 0x8f0027; + ; + + memory "data" + # SRAM, only used to supply the offset + offset = 0x1000000; + ; +; + +#------------------------------------------------------------ +# ATxmega16A4U +#------------------------------------------------------------ + +part parent ".xmega" + id = "x16a4u"; + desc = "ATxmega16A4U"; + signature = 0x1e 0x94 0x41; + + memory "eeprom" + size = 0x400; + offset = 0x8c0000; + page_size = 0x20; + readsize = 0x100; + ; + + memory "application" + size = 0x4000; + offset = 0x800000; + page_size = 0x100; + readsize = 0x100; + ; + + memory "apptable" + size = 0x1000; + offset = 0x803000; + page_size = 0x100; + readsize = 0x100; + ; + + memory "boot" + size = 0x1000; + offset = 0x804000; + page_size = 0x100; + readsize = 0x100; + ; + + memory "flash" + size = 0x5000; + offset = 0x800000; + page_size = 0x100; + readsize = 0x100; + ; + + memory "usersig" + size = 0x100; + offset = 0x8e0400; + page_size = 0x100; + readsize = 0x100; + ; +; + +#------------------------------------------------------------ +# ATxmega16C4 +#------------------------------------------------------------ + +part parent "x16a4u" + id = "x16c4"; + desc = "ATxmega16C4"; + signature = 0x1e 0x95 0x44; +; + +#------------------------------------------------------------ +# ATxmega16D4 +#------------------------------------------------------------ + +part parent "x16a4u" + id = "x16d4"; + desc = "ATxmega16D4"; + signature = 0x1e 0x94 0x42; +; + +#------------------------------------------------------------ +# ATxmega16A4 +#------------------------------------------------------------ + +part parent "x16a4u" + id = "x16a4"; + desc = "ATxmega16A4"; + signature = 0x1e 0x94 0x41; + has_jtag = yes; + + memory "fuse0" + size = 1; + offset = 0x8f0020; + ; +; + +#------------------------------------------------------------ +# ATxmega32A4U +#------------------------------------------------------------ + +part parent ".xmega" + id = "x32a4u"; + desc = "ATxmega32A4U"; + signature = 0x1e 0x95 0x41; + + memory "eeprom" + size = 0x400; + offset = 0x8c0000; + page_size = 0x20; + readsize = 0x100; + ; + + memory "application" + size = 0x8000; + offset = 0x800000; + page_size = 0x100; + readsize = 0x100; + ; + + memory "apptable" + size = 0x1000; + offset = 0x807000; + page_size = 0x100; + readsize = 0x100; + ; + + memory "boot" + size = 0x1000; + offset = 0x808000; + page_size = 0x100; + readsize = 0x100; + ; + + memory "flash" + size = 0x9000; + offset = 0x800000; + page_size = 0x100; + readsize = 0x100; + ; + + memory "usersig" + size = 0x100; + offset = 0x8e0400; + page_size = 0x100; + readsize = 0x100; + ; +; + +#------------------------------------------------------------ +# ATxmega32C4 +#------------------------------------------------------------ + +part parent "x32a4u" + id = "x32c4"; + desc = "ATxmega32C4"; + signature = 0x1e 0x94 0x43; +; + +#------------------------------------------------------------ +# ATxmega32D4 +#------------------------------------------------------------ + +part parent "x32a4u" + id = "x32d4"; + desc = "ATxmega32D4"; + signature = 0x1e 0x95 0x42; +; + +#------------------------------------------------------------ +# ATxmega32A4 +#------------------------------------------------------------ + +part parent "x32a4u" + id = "x32a4"; + desc = "ATxmega32A4"; + signature = 0x1e 0x95 0x41; + has_jtag = yes; + + memory "fuse0" + size = 1; + offset = 0x8f0020; + ; +; + +#------------------------------------------------------------ +# ATxmega64A4U +#------------------------------------------------------------ + +part parent ".xmega" + id = "x64a4u"; + desc = "ATxmega64A4U"; + signature = 0x1e 0x96 0x46; + + memory "eeprom" + size = 0x800; + offset = 0x8c0000; + page_size = 0x20; + readsize = 0x100; + ; + + memory "application" + size = 0x10000; + offset = 0x800000; + page_size = 0x100; + readsize = 0x100; + ; + + memory "apptable" + size = 0x1000; + offset = 0x80f000; + page_size = 0x100; + readsize = 0x100; + ; + + memory "boot" + size = 0x1000; + offset = 0x810000; + page_size = 0x100; + readsize = 0x100; + ; + + memory "flash" + size = 0x11000; + offset = 0x800000; + page_size = 0x100; + readsize = 0x100; + ; + + memory "usersig" + size = 0x100; + offset = 0x8e0400; + page_size = 0x100; + readsize = 0x100; + ; +; + +#------------------------------------------------------------ +# ATxmega64C3 +#------------------------------------------------------------ + +part parent "x64a4u" + id = "x64c3"; + desc = "ATxmega64C3"; + signature = 0x1e 0x96 0x49; +; + +#------------------------------------------------------------ +# ATxmega64D3 +#------------------------------------------------------------ + +part parent "x64a4u" + id = "x64d3"; + desc = "ATxmega64D3"; + signature = 0x1e 0x96 0x4a; +; + +#------------------------------------------------------------ +# ATxmega64D4 +#------------------------------------------------------------ + +part parent "x64a4u" + id = "x64d4"; + desc = "ATxmega64D4"; + signature = 0x1e 0x96 0x47; +; + +#------------------------------------------------------------ +# ATxmega64A1 +#------------------------------------------------------------ + +part parent "x64a4u" + id = "x64a1"; + desc = "ATxmega64A1"; + signature = 0x1e 0x96 0x4e; + has_jtag = yes; + + memory "fuse0" + size = 1; + offset = 0x8f0020; + ; +; + +#------------------------------------------------------------ +# ATxmega64A1U +#------------------------------------------------------------ + +part parent "x64a1" + id = "x64a1u"; + desc = "ATxmega64A1U"; + signature = 0x1e 0x96 0x4e; +; + +#------------------------------------------------------------ +# ATxmega64A3 +#------------------------------------------------------------ + +part parent "x64a1" + id = "x64a3"; + desc = "ATxmega64A3"; + signature = 0x1e 0x96 0x42; +; + +#------------------------------------------------------------ +# ATxmega64A3U +#------------------------------------------------------------ + +part parent "x64a1" + id = "x64a3u"; + desc = "ATxmega64A3U"; + signature = 0x1e 0x96 0x42; +; + +#------------------------------------------------------------ +# ATxmega64A4 +#------------------------------------------------------------ + +part parent "x64a1" + id = "x64a4"; + desc = "ATxmega64A4"; + signature = 0x1e 0x96 0x46; +; + +#------------------------------------------------------------ +# ATxmega64B1 +#------------------------------------------------------------ + +part parent "x64a1" + id = "x64b1"; + desc = "ATxmega64B1"; + signature = 0x1e 0x96 0x52; +; + +#------------------------------------------------------------ +# ATxmega64B3 +#------------------------------------------------------------ + +part parent "x64a1" + id = "x64b3"; + desc = "ATxmega64B3"; + signature = 0x1e 0x96 0x51; +; + +#------------------------------------------------------------ +# ATxmega128C3 +#------------------------------------------------------------ + +part parent ".xmega" + id = "x128c3"; + desc = "ATxmega128C3"; + signature = 0x1e 0x97 0x52; + + memory "eeprom" + size = 0x800; + offset = 0x8c0000; + page_size = 0x20; + readsize = 0x100; + ; + + memory "application" + size = 0x20000; + offset = 0x800000; + page_size = 0x200; + readsize = 0x100; + ; + + memory "apptable" + size = 0x2000; + offset = 0x81e000; + page_size = 0x200; + readsize = 0x100; + ; + + memory "boot" + size = 0x2000; + offset = 0x820000; + page_size = 0x200; + readsize = 0x100; + ; + + memory "flash" + size = 0x22000; + offset = 0x800000; + page_size = 0x200; + readsize = 0x100; + ; + + memory "usersig" + size = 0x200; + offset = 0x8e0400; + page_size = 0x200; + readsize = 0x100; + ; +; + +#------------------------------------------------------------ +# ATxmega128D3 +#------------------------------------------------------------ + +part parent "x128c3" + id = "x128d3"; + desc = "ATxmega128D3"; + signature = 0x1e 0x97 0x48; +; + +#------------------------------------------------------------ +# ATxmega128D4 +#------------------------------------------------------------ + +part parent "x128c3" + id = "x128d4"; + desc = "ATxmega128D4"; + signature = 0x1e 0x97 0x47; +; + +#------------------------------------------------------------ +# ATxmega128A1 +#------------------------------------------------------------ + +part parent "x128c3" + id = "x128a1"; + desc = "ATxmega128A1"; + signature = 0x1e 0x97 0x4c; + has_jtag = yes; + + memory "fuse0" + size = 1; + offset = 0x8f0020; + ; +; + +#------------------------------------------------------------ +# ATxmega128A1 revision D +#------------------------------------------------------------ + +part parent "x128a1" + id = "x128a1d"; + desc = "ATxmega128A1revD"; + signature = 0x1e 0x97 0x41; +; + +#------------------------------------------------------------ +# ATxmega128A1U +#------------------------------------------------------------ + +part parent "x128a1" + id = "x128a1u"; + desc = "ATxmega128A1U"; + signature = 0x1e 0x97 0x4c; +; + +#------------------------------------------------------------ +# ATxmega128A3 +#------------------------------------------------------------ + +part parent "x128a1" + id = "x128a3"; + desc = "ATxmega128A3"; + signature = 0x1e 0x97 0x42; +; + +#------------------------------------------------------------ +# ATxmega128A3U +#------------------------------------------------------------ + +part parent "x128a1" + id = "x128a3u"; + desc = "ATxmega128A3U"; + signature = 0x1e 0x97 0x42; +; + +#------------------------------------------------------------ +# ATxmega128A4 +#------------------------------------------------------------ + +part parent ".xmega" + id = "x128a4"; + desc = "ATxmega128A4"; + signature = 0x1e 0x97 0x46; + has_jtag = yes; + + memory "eeprom" + size = 0x800; + offset = 0x8c0000; + page_size = 0x20; + readsize = 0x100; + ; + + memory "application" + size = 0x20000; + offset = 0x800000; + page_size = 0x200; + readsize = 0x100; + ; + + memory "apptable" + size = 0x1000; + offset = 0x81f000; + page_size = 0x200; + readsize = 0x100; + ; + + memory "boot" + size = 0x2000; + offset = 0x820000; + page_size = 0x200; + readsize = 0x100; + ; + + memory "flash" + size = 0x22000; + offset = 0x800000; + page_size = 0x200; + readsize = 0x100; + ; + + memory "usersig" + size = 0x200; + offset = 0x8e0400; + page_size = 0x200; + readsize = 0x100; + ; + + memory "fuse0" + size = 1; + offset = 0x8f0020; + ; +; + +#------------------------------------------------------------ +# ATxmega128A4U +#------------------------------------------------------------ + +part parent ".xmega" + id = "x128a4u"; + desc = "ATxmega128A4U"; + signature = 0x1e 0x97 0x46; + + memory "eeprom" + size = 0x800; + offset = 0x8c0000; + page_size = 0x20; + readsize = 0x100; + ; + + memory "application" + size = 0x20000; + offset = 0x800000; + page_size = 0x100; + readsize = 0x100; + ; + + memory "apptable" + size = 0x1000; + offset = 0x81f000; + page_size = 0x100; + readsize = 0x100; + ; + + memory "boot" + size = 0x2000; + offset = 0x820000; + page_size = 0x100; + readsize = 0x100; + ; + + memory "flash" + size = 0x22000; + offset = 0x800000; + page_size = 0x100; + readsize = 0x100; + ; + + memory "usersig" + size = 0x100; + offset = 0x8e0400; + page_size = 0x100; + readsize = 0x100; + ; +; + +#------------------------------------------------------------ +# ATxmega128B1 +#------------------------------------------------------------ + +part parent ".xmega" + id = "x128b1"; + desc = "ATxmega128B1"; + signature = 0x1e 0x97 0x4d; + has_jtag = yes; + + memory "eeprom" + size = 0x800; + offset = 0x8c0000; + page_size = 0x20; + readsize = 0x100; + ; + + memory "application" + size = 0x20000; + offset = 0x800000; + page_size = 0x100; + readsize = 0x100; + ; + + memory "apptable" + size = 0x2000; + offset = 0x81e000; + page_size = 0x100; + readsize = 0x100; + ; + + memory "boot" + size = 0x2000; + offset = 0x820000; + page_size = 0x100; + readsize = 0x100; + ; + + memory "flash" + size = 0x22000; + offset = 0x800000; + page_size = 0x100; + readsize = 0x100; + ; + + memory "usersig" + size = 0x100; + offset = 0x8e0400; + page_size = 0x100; + readsize = 0x100; + ; + + memory "fuse0" + size = 1; + offset = 0x8f0020; + ; +; + +#------------------------------------------------------------ +# ATxmega128B3 +#------------------------------------------------------------ + +part parent "x128b1" + id = "x128b3"; + desc = "ATxmega128B3"; + signature = 0x1e 0x97 0x4b; +; + +#------------------------------------------------------------ +# ATxmega192C3 +#------------------------------------------------------------ + +part parent ".xmega" + id = "x192c3"; + desc = "ATxmega192C3"; + signature = 0x1e 0x97 0x51; + + memory "eeprom" + size = 0x800; + offset = 0x8c0000; + page_size = 0x20; + readsize = 0x100; + ; + + memory "application" + size = 0x30000; + offset = 0x800000; + page_size = 0x200; + readsize = 0x100; + ; + + memory "apptable" + size = 0x2000; + offset = 0x82e000; + page_size = 0x200; + readsize = 0x100; + ; + + memory "boot" + size = 0x2000; + offset = 0x830000; + page_size = 0x200; + readsize = 0x100; + ; + + memory "flash" + size = 0x32000; + offset = 0x800000; + page_size = 0x200; + readsize = 0x100; + ; + + memory "usersig" + size = 0x200; + offset = 0x8e0400; + page_size = 0x200; + readsize = 0x100; + ; +; + +#------------------------------------------------------------ +# ATxmega192D3 +#------------------------------------------------------------ + +part parent "x192c3" + id = "x192d3"; + desc = "ATxmega192D3"; + signature = 0x1e 0x97 0x49; +; + +#------------------------------------------------------------ +# ATxmega192A1 +#------------------------------------------------------------ + +part parent "x192c3" + id = "x192a1"; + desc = "ATxmega192A1"; + signature = 0x1e 0x97 0x4e; + has_jtag = yes; + + memory "fuse0" + size = 1; + offset = 0x8f0020; + ; +; + +#------------------------------------------------------------ +# ATxmega192A3 +#------------------------------------------------------------ + +part parent "x192a1" + id = "x192a3"; + desc = "ATxmega192A3"; + signature = 0x1e 0x97 0x44; +; + +#------------------------------------------------------------ +# ATxmega192A3U +#------------------------------------------------------------ + +part parent "x192a1" + id = "x192a3u"; + desc = "ATxmega192A3U"; + signature = 0x1e 0x97 0x44; +; + +#------------------------------------------------------------ +# ATxmega256C3 +#------------------------------------------------------------ + +part parent ".xmega" + id = "x256c3"; + desc = "ATxmega256C3"; + signature = 0x1e 0x98 0x46; + + memory "eeprom" + size = 0x1000; + offset = 0x8c0000; + page_size = 0x20; + readsize = 0x100; + ; + + memory "application" + size = 0x40000; + offset = 0x800000; + page_size = 0x200; + readsize = 0x100; + ; + + memory "apptable" + size = 0x2000; + offset = 0x83e000; + page_size = 0x200; + readsize = 0x100; + ; + + memory "boot" + size = 0x2000; + offset = 0x840000; + page_size = 0x200; + readsize = 0x100; + ; + + memory "flash" + size = 0x42000; + offset = 0x800000; + page_size = 0x200; + readsize = 0x100; + ; + + memory "usersig" + size = 0x200; + offset = 0x8e0400; + page_size = 0x200; + readsize = 0x100; + ; +; + +#------------------------------------------------------------ +# ATxmega256D3 +#------------------------------------------------------------ + +part parent "x256c3" + id = "x256d3"; + desc = "ATxmega256D3"; + signature = 0x1e 0x98 0x44; +; + +#------------------------------------------------------------ +# ATxmega256A1 +#------------------------------------------------------------ + +part parent "x256c3" + id = "x256a1"; + desc = "ATxmega256A1"; + signature = 0x1e 0x98 0x46; + has_jtag = yes; + + memory "fuse0" + size = 1; + offset = 0x8f0020; + ; +; + +#------------------------------------------------------------ +# ATxmega256A3 +#------------------------------------------------------------ + +part parent "x256a1" + id = "x256a3"; + desc = "ATxmega256A3"; + signature = 0x1e 0x98 0x42; +; + +#------------------------------------------------------------ +# ATxmega256A3U +#------------------------------------------------------------ + +part parent "x256a1" + id = "x256a3u"; + desc = "ATxmega256A3U"; + signature = 0x1e 0x98 0x42; +; + +#------------------------------------------------------------ +# ATxmega256A3B +#------------------------------------------------------------ + +part parent "x256a1" + id = "x256a3b"; + desc = "ATxmega256A3B"; + signature = 0x1e 0x98 0x43; +; + +#------------------------------------------------------------ +# ATxmega256A3BU +#------------------------------------------------------------ + +part parent "x256a1" + id = "x256a3bu"; + desc = "ATxmega256A3BU"; + signature = 0x1e 0x98 0x43; +; + +#------------------------------------------------------------ +# ATxmega384C3 +#------------------------------------------------------------ + +part parent ".xmega" + id = "x384c3"; + desc = "ATxmega384C3"; + signature = 0x1e 0x98 0x45; + + memory "eeprom" + size = 0x1000; + offset = 0x8c0000; + page_size = 0x20; + readsize = 0x100; + ; + + memory "application" + size = 0x60000; + offset = 0x800000; + page_size = 0x200; + readsize = 0x100; + ; + + memory "apptable" + size = 0x2000; + offset = 0x85e000; + page_size = 0x200; + readsize = 0x100; + ; + + memory "boot" + size = 0x2000; + offset = 0x860000; + page_size = 0x200; + readsize = 0x100; + ; + + memory "flash" + size = 0x62000; + offset = 0x800000; + page_size = 0x200; + readsize = 0x100; + ; + + memory "usersig" + size = 0x200; + offset = 0x8e0400; + page_size = 0x200; + readsize = 0x100; + ; +; + +#------------------------------------------------------------ +# ATxmega384D3 +#------------------------------------------------------------ + +part parent "x384c3" + id = "x384d3"; + desc = "ATxmega384D3"; + signature = 0x1e 0x98 0x47; +; + +#------------------------------------------------------------ +# ATxmega8E5 +#------------------------------------------------------------ + +part parent ".xmega" + id = "x8e5"; + desc = "ATxmega8E5"; + signature = 0x1e 0x93 0x41; + + memory "eeprom" + size = 0x0200; + offset = 0x08c0000; + page_size = 0x20; + readsize = 0x100; + ; + + memory "application" + size = 0x2000; + offset = 0x0800000; + page_size = 0x80; + readsize = 0x100; + ; + + memory "apptable" + size = 0x800; + offset = 0x00801800; + page_size = 0x80; + readsize = 0x100; + ; + + memory "boot" + size = 0x800; + offset = 0x00804000; + page_size = 0x80; + readsize = 0x100; + ; + + memory "flash" + size = 0x2800; + offset = 0x0800000; + page_size = 0x80; + readsize = 0x100; + ; + + memory "usersig" + size = 0x80; + offset = 0x8e0400; + page_size = 0x80; + readsize = 0x100; + ; +; + +#------------------------------------------------------------ +# ATxmega16E5 +#------------------------------------------------------------ + +part parent ".xmega" + id = "x16e5"; + desc = "ATxmega16E5"; + signature = 0x1e 0x94 0x45; + + memory "eeprom" + size = 0x0200; + offset = 0x08c0000; + page_size = 0x20; + readsize = 0x100; + ; + + memory "application" + size = 0x4000; + offset = 0x0800000; + page_size = 0x80; + readsize = 0x100; + ; + + memory "apptable" + size = 0x1000; + offset = 0x00803000; + page_size = 0x80; + readsize = 0x100; + ; + + memory "boot" + size = 0x1000; + offset = 0x00804000; + page_size = 0x80; + readsize = 0x100; + ; + + memory "flash" + size = 0x5000; + offset = 0x0800000; + page_size = 0x80; + readsize = 0x100; + ; + + memory "usersig" + size = 0x80; + offset = 0x8e0400; + page_size = 0x80; + readsize = 0x100; + ; +; + +#------------------------------------------------------------ +# ATxmega32E5 +#------------------------------------------------------------ + +part parent ".xmega" + id = "x32e5"; + desc = "ATxmega32E5"; + signature = 0x1e 0x95 0x4c; + + memory "eeprom" + size = 0x0400; + offset = 0x08c0000; + page_size = 0x20; + readsize = 0x100; + ; + + memory "application" + size = 0x8000; + offset = 0x0800000; + page_size = 0x80; + readsize = 0x100; + ; + + memory "apptable" + size = 0x1000; + offset = 0x00807000; + page_size = 0x80; + readsize = 0x100; + ; + + memory "boot" + size = 0x1000; + offset = 0x00804000; + page_size = 0x80; + readsize = 0x100; + ; + + memory "flash" + size = 0x9000; + offset = 0x0800000; + page_size = 0x80; + readsize = 0x100; + ; + + memory "usersig" + size = 0x80; + offset = 0x8e0400; + page_size = 0x80; + readsize = 0x100; + ; +; + +#------------------------------------------------------------ +# AVR32UC3A0512 +#------------------------------------------------------------ + +part + id = "uc3a0512"; + desc = "AT32UC3A0512"; + signature = 0xED 0xC0 0x3F; + has_jtag = yes; + is_avr32 = yes; + + memory "flash" + paged = yes; + page_size = 512; # bytes + readsize = 512; # bytes + num_pages = 1024; # could be set dynamicly + size = 0x00080000; # could be set dynamicly + offset = 0x80000000; + ; +; + +part parent "uc3a0512" + id = "ucr2"; + desc = "deprecated, use 'uc3a0512'"; +; + +#------------------------------------------------------------ +# ATtiny1634. +#------------------------------------------------------------ + +part + id = "t1634"; + desc = "ATtiny1634"; + has_debugwire = yes; + flash_instr = 0xB6, 0x01, 0x11; + eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, + 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, + 0x99, 0xF9, 0xBB, 0xAF; + stk500_devcode = 0x86; + # avr910_devcode = 0x; + signature = 0x1e 0x94 0x12; + pagel = 0xB3; + bs2 = 0xB1; + reset = io; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + + pp_controlstack = + 0x0E, 0x1E, 0x0E, 0x1E, 0x2E, 0x3E, 0x2E, 0x3E, + 0x4E, 0x5E, 0x4E, 0x5E, 0x6E, 0x7E, 0x6E, 0x7E, + 0x26, 0x36, 0x66, 0x76, 0x2A, 0x3A, 0x6A, 0x7A, + 0x2E, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 0; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + memory "eeprom" + paged = no; + page_size = 4; + size = 256; + min_write_delay = 3600; + max_write_delay = 3600; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " 0 0 0 x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " 0 0 0 x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x x x a8", + " a7 a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 5; + blocksize = 4; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 16384; + page_size = 32; + num_pages = 512; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; + + mode = 0x41; + delay = 6; + blocksize = 128; + readsize = 256; + + ; + + memory "lfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; + + memory "hfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; + + memory "efuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x x x x o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x i i i i i"; + ; + + memory "lock" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 1 1 1 1 i i"; + ; + + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; +; + +#------------------------------------------------------------ +# Common values for reduced core tinys (4/5/9/10/20/40) +#------------------------------------------------------------ + +part + id = ".reduced_core_tiny"; + desc = "Common values for reduced core tinys"; + has_tpi = yes; + + memory "signature" + size = 3; + offset = 0x3fc0; + page_size = 16; + ; + + memory "fuse" + size = 1; + offset = 0x3f40; + page_size = 16; + blocksize = 4; + ; + + memory "calibration" + size = 1; + offset = 0x3f80; + page_size = 16; + ; + + memory "lockbits" + size = 1; + offset = 0x3f00; + page_size = 16; + ; +; + +#------------------------------------------------------------ +# ATtiny4 +#------------------------------------------------------------ + +part parent ".reduced_core_tiny" + id = "t4"; + desc = "ATtiny4"; + signature = 0x1e 0x8f 0x0a; + + memory "flash" + size = 512; + offset = 0x4000; + page_size = 16; + blocksize = 128; + ; +; + +#------------------------------------------------------------ +# ATtiny5 +#------------------------------------------------------------ + +part parent "t4" + id = "t5"; + desc = "ATtiny5"; + signature = 0x1e 0x8f 0x09; +; + +#------------------------------------------------------------ +# ATtiny9 +#------------------------------------------------------------ + +part parent ".reduced_core_tiny" + id = "t9"; + desc = "ATtiny9"; + signature = 0x1e 0x90 0x08; + + memory "flash" + size = 1024; + offset = 0x4000; + page_size = 16; + blocksize = 128; + ; +; + +#------------------------------------------------------------ +# ATtiny10 +#------------------------------------------------------------ + +part parent "t9" + id = "t10"; + desc = "ATtiny10"; + signature = 0x1e 0x90 0x03; +; + +#------------------------------------------------------------ +# ATtiny20 +#------------------------------------------------------------ + +part parent ".reduced_core_tiny" + id = "t20"; + desc = "ATtiny20"; + signature = 0x1e 0x91 0x0F; + + memory "flash" + size = 2048; + offset = 0x4000; + page_size = 16; + blocksize = 128; + ; +; + +#------------------------------------------------------------ +# ATtiny40 +#------------------------------------------------------------ + +part parent ".reduced_core_tiny" + id = "t40"; + desc = "ATtiny40"; + signature = 0x1e 0x92 0x0E; + + memory "flash" + size = 4096; + offset = 0x4000; + page_size = 64; + blocksize = 128; + ; +; + +#------------------------------------------------------------ +# ATmega406 +#------------------------------------------------------------ + +part + id = "m406"; + desc = "ATMEGA406"; + has_jtag = yes; + signature = 0x1e 0x95 0x07; + + # STK500 parameters (parallel programming IO lines) + pagel = 0xa7; + bs2 = 0xa0; + serial = no; + parallel = yes; + + # STK500v2 HV programming parameters, from XML + pp_controlstack = 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, + 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, + 0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b, + 0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + + # JTAG ICE mkII parameters, also from XML files + allowfullpagebitstream = no; + enablepageprogramming = yes; + idr = 0x51; + rampz = 0x00; + spmcr = 0x57; + eecr = 0x3f; + + memory "eeprom" + paged = no; + size = 512; + page_size = 4; + blocksize = 4; + readsize = 4; + num_pages = 128; + ; + + memory "flash" + paged = yes; + size = 40960; + page_size = 128; + blocksize = 128; + readsize = 128; + num_pages = 320; + ; + + memory "hfuse" + size = 1; + ; + + memory "lfuse" + size = 1; + ; + + memory "lockbits" + size = 1; + ; + + memory "signature" + size = 3; + ; +; + + + +programmer + id = "peapod"; + desc = "Use the Linux sysfs interface to bitbang GPIO lines"; + type = "linuxgpio"; + reset = 5; + sck = 6; + mosi = 12; + miso = 13; +; \ No newline at end of file diff --git a/software/microcontroller/lib/I2CIP b/software/microcontroller/lib/I2CIP new file mode 160000 index 00000000..b7dcfcfc --- /dev/null +++ b/software/microcontroller/lib/I2CIP @@ -0,0 +1 @@ +Subproject commit b7dcfcfc1946602a9092264cdb7050f40fb42242 diff --git a/software/microcontroller/platformio.ini b/software/microcontroller/platformio.ini new file mode 100644 index 00000000..d6c586f3 --- /dev/null +++ b/software/microcontroller/platformio.ini @@ -0,0 +1,46 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[platformio] +default_envs = feather + +[env:nano] +platform = atmelavr +framework = arduino +board = nanoatmega328new +test_build_src = true +monitor_speed = 115200 +lib_deps = bblanchon/ArduinoJson@^7.2.1 +lib_extra_dirs = lib/I2CIP/lib + +[env:feather] +platform = espressif32 +framework = arduino +board = adafruit_feather_esp32_v2 +monitor_speed = 115200 +test_build_src = true +test_speed = 115200 +lib_deps = bblanchon/ArduinoJson@^7.2.1 +monitor_filters = esp32_exception_decoder +lib_extra_dirs = lib/I2CIP/lib + +[env:gpionano] +platform = atmelavr +framework = arduino +board = nanoatmega328new +upload_protocol = custom +upload_command = sudo avrdude -p $BOARD_MCU -C avrdude_gpio.conf -c peapod -v -U flash:w:$SOURCE:i +monitor_speed = 115200 +monitor_port = /dev/ttyS0 +test_build_src = true +test_speed = 115200 +test_port = /dev/ttyS0 +lib_deps = bblanchon/ArduinoJson@^7.2.1 +lib_extra_dirs = lib/I2CIP/lib \ No newline at end of file diff --git a/software/microcontroller/src/air.cc b/software/microcontroller/src/air.cc new file mode 100644 index 00000000..028da6bf --- /dev/null +++ b/software/microcontroller/src/air.cc @@ -0,0 +1,65 @@ +#include + +void PeaPod::callback_temperature(bool _, const FSM::Number& v) { + DebugJson::telemetry(millis(), (double)v, air_temperature.getKey()); + + #ifdef PEAPOD_SEVENSEG_TEMPERATURE + if(I2CIP::errlev[PEAPOD_MODULENUM_SEVENSEG] == I2CIP_ERR_NONE && I2CIP::modules[PEAPOD_MODULENUM_SEVENSEG] != nullptr) { + i2cip_ht16k33_mode_t seg_mode = SEG_1F; + i2cip_ht16k33_data_t seg_data = { .f = (float)v }; + i2cip_args_io_t seg_args = { .g = false, .a = nullptr, .s = &seg_data, .b = &seg_mode }; + + I2CIP::modules[PEAPOD_MODULENUM_SEVENSEG]->operator()(I2CIP::sevenSegmentFQA, true, seg_args, DebugJsonBreakpoints); + } + #endif +} + +void PeaPod::callback_humidity(bool _, const FSM::Number& v) { + DebugJson::telemetry(millis(), (double)v, air_humidity.getKey()); + + #ifdef PEAPOD_SEVENSEG_HUMIDITY + if(I2CIP::errlev[PEAPOD_MODULENUM_SEVENSEG] == I2CIP_ERR_NONE && I2CIP::modules[PEAPOD_MODULENUM_SEVENSEG] != nullptr) { + i2cip_ht16k33_mode_t seg_mode = SEG_1F; + i2cip_ht16k33_data_t seg_data = { .f = (float)v }; + i2cip_args_io_t seg_args = { .g = false, .a = nullptr, .s = &seg_data, .b = &seg_mode }; + + I2CIP::modules[PEAPOD_MODULENUM_SEVENSEG]->operator()(I2CIP::sevenSegmentFQA, true, seg_args, DebugJsonBreakpoints); + } + #endif +} + +void PeaPod::callback_co2(bool _, const FSM::Number& v) { + DebugJson::telemetry(millis(), (unsigned)v, air_co2.getKey()); + + #ifdef PEAPOD_SEVENSEG_CO2 + if(I2CIP::errlev[PEAPOD_MODULENUM_SEVENSEG] == I2CIP_ERR_NONE && I2CIP::modules[PEAPOD_MODULENUM_SEVENSEG] != nullptr) { + i2cip_ht16k33_mode_t seg_mode = SEG_UINT; + i2cip_ht16k33_data_t seg_data = { .h = (unsigned)v }; + i2cip_args_io_t seg_args = { .g = false, .a = nullptr, .s = &seg_data, .b = &seg_mode }; + + I2CIP::modules[PEAPOD_MODULENUM_SEVENSEG]->operator()(I2CIP::sevenSegmentFQA, true, seg_args, DebugJsonBreakpoints); + } + #endif +} + +PeaPod::PeaPodModuleAir::PeaPodModuleAir(bool chronoCallbacks) : PeaPodModule(PEAPOD_MODULENUM_AIR) { + if(chronoCallbacks) { + interval_sht45 = FSM::Chronos.addInterval(PEAPOD_SHT45_DELTA, PeaPodModuleAir::callback_sht45_mean); + interval_k30 = FSM::Chronos.addInterval(PEAPOD_K30_DELTA, PeaPodModuleAir::callback_k30_mean); + } + + air_temperature.addConditional(FSM::CMP_NEQ, FSM::notanumber, callback_temperature); + air_humidity.addConditional(FSM::CMP_NEQ, FSM::notanumber, callback_humidity); + air_co2.addConditional(FSM::CMP_NEQ, FSM::notanumber, callback_co2); + + registerVariable(&air_temperature, true); // LOCKED + registerVariable(&air_humidity, true); // LOCKED + registerVariable(&air_co2, true); // LOCKED +} + +PeaPod::PeaPodModuleAir::~PeaPodModuleAir() { + FSM::Chronos.removeInterval(interval_sht45); + FSM::Chronos.removeInterval(interval_k30); + interval_sht45 = nullptr; + interval_k30 = nullptr; +} \ No newline at end of file diff --git a/software/microcontroller/src/air.h b/software/microcontroller/src/air.h new file mode 100644 index 00000000..e475d086 --- /dev/null +++ b/software/microcontroller/src/air.h @@ -0,0 +1,36 @@ +#ifndef PEAPOD_AIR_H_ +#define PEAPOD_AIR_H_ + +#include + +#define PEAPOD_SHT45_DELTA 250 +#define PEAPOD_K30_DELTA 3000 + +#define PEAPOD_MODULE_AIR_EEPROM_CONTENTS {"[{\"24LC32\":[80],\"SHT45\":[" STR(I2CIP_SHT45_ADDRESS) "]},{\"SHT45\":[" STR(I2CIP_SHT45_ADDRESS) "],\"K30\":[" STR(I2CIP_K30_ADDRESS) "]},{\"SHT45\":[" STR(I2CIP_SHT45_ADDRESS) "]}]"} + +namespace PeaPod { + extern FSM::Variable air_temperature; + extern FSM::Variable air_humidity; + extern FSM::Variable air_co2; + + void callback_temperature(bool _, const FSM::Number& v); + void callback_humidity(bool _, const FSM::Number& v); + void callback_co2(bool _, const FSM::Number& v); + + class PeaPodModuleAir : public PeaPodModule { + private: + FSM::IntervalCallback* interval_sht45 = nullptr; + FSM::IntervalCallback* interval_k30 = nullptr; + public: + PeaPodModuleAir(bool chronoCallbacks = true); + + ~PeaPodModuleAir(); + + template static void callback_sht45_mean(bool _ = true, const FSM::fsm_timestamp_t& __ = 0); + template static void callback_k30_mean(bool _ = true, const FSM::fsm_timestamp_t& __ = 0); + }; +} + +#include + +#endif \ No newline at end of file diff --git a/software/microcontroller/src/air.tpp b/software/microcontroller/src/air.tpp new file mode 100644 index 00000000..11345fc2 --- /dev/null +++ b/software/microcontroller/src/air.tpp @@ -0,0 +1,82 @@ +#ifndef PEAPOD_AIR_H_ +#error __FILE__ should only be included AFTER +#endif + +#ifdef PEAPOD_AIR_H_ + +#ifndef PEAPOD_AIR_T_ +#define PEAPOD_AIR_T_ + +#include + +template void PeaPod::PeaPodModuleAir::callback_sht45_mean(bool _, const FSM::fsm_timestamp_t& __) { + if(M < 0 || M > I2CIP_MUX_COUNT || I2CIP::modules[M] == nullptr) return; + + // If the module is not in an errored state, + if(I2CIP::errlev[M] == I2CIP_ERR_NONE) { + // Get SHT45 device group + I2CIP::DeviceGroup* dg_sht45 = I2CIP::modules[M]->operator[]("SHT45"); + + // If we have devices, + if(dg_sht45 != nullptr && dg_sht45->getNumDevices() > 0) { + + // Read from all devices and take a mean + state_sht45_t th = {0.0f, 0.0f}; uint8_t c = 0; + for(uint8_t i = 0; i < dg_sht45->getNumDevices(); i++) { + SHT45* d = (SHT45*)(dg_sht45->getDevice(i)); + if(d == nullptr) continue; + + i2cip_errorlevel_t errlev_sht45 = I2CIP::modules[M]->operator()(d->getFQA(), true, _i2cip_args_io_default, DebugJsonBreakpoints); + if(errlev_sht45 != I2CIP_ERR_NONE) continue; + + th.temperature += d->getCache().temperature; + th.humidity += d->getCache().humidity; + c++; + } + + // If readings were taken, + if(c > 0) { + // Set variables according to averages + PeaPod::air_temperature.set(th.temperature / c); + PeaPod::air_humidity.set(th.humidity / c); + } + } + } +} + +template void PeaPod::PeaPodModuleAir::callback_k30_mean(bool _, const FSM::fsm_timestamp_t& __) { + if(M < 0 || M > I2CIP_MUX_COUNT || I2CIP::modules[M] == nullptr) return; + + // If the module is not in an errored state, + if(I2CIP::errlev[M] == I2CIP_ERR_NONE) { + // Get K30 device group + I2CIP::DeviceGroup* dg_k30 = I2CIP::modules[M]->operator[]("K30"); + + // If we have devices, + if(dg_k30 != nullptr && dg_k30->getNumDevices() > 0) { + + // Read from all devices and take a mean + uint16_t co2 = 0; uint8_t c = 0; + for(uint8_t i = 0; i < dg_k30->getNumDevices(); i++) { + K30* d = (K30*)(dg_k30->getDevice(i)); + if(d == nullptr) continue; + + i2cip_errorlevel_t errlev_k30 = I2CIP::modules[M]->operator()(d->getFQA(), true, _i2cip_args_io_default, DebugJsonBreakpoints); + if(errlev_k30 != I2CIP_ERR_NONE) continue; + + co2 += d->getCache(); + c++; + } + + // If readings were taken, + if(c > 0) { + // Set variable according to average + PeaPod::air_co2.set(co2 / c); + } + } + } +} + +#endif + +#endif \ No newline at end of file diff --git a/software/microcontroller/src/light.cc b/software/microcontroller/src/light.cc new file mode 100644 index 00000000..2f0b5b98 --- /dev/null +++ b/software/microcontroller/src/light.cc @@ -0,0 +1,96 @@ +#include + +FSM::Number calculate_pwm(const double& dutycycle) { + return FSM::Number(4096.0 * constrain(dutycycle, 0.0, 1.0), true); +} + +void PeaPod::callback_adc_voltage(bool _, const FSM::Number& v) { + DebugJson::telemetry(millis(), (double)v, adc_voltage.getKey()); + + #ifdef PEAPOD_SEVENSEG_ADC + if(I2CIP::errlev[PEAPOD_MODULENUM_SEVENSEG] == I2CIP_ERR_NONE && I2CIP::modules[PEAPOD_MODULENUM_SEVENSEG] != nullptr) { + i2cip_ht16k33_mode_t seg_mode = SEG_2F; + i2cip_ht16k33_data_t seg_data = { .f = (float)v }; + i2cip_args_io_t seg_args = { .g = false, .a = nullptr, .s = &seg_data, .b = &seg_mode }; + + I2CIP::modules[PEAPOD_MODULENUM_SEVENSEG]->operator()(I2CIP::sevenSegmentFQA, true, seg_args, DebugJsonBreakpoints); + } + #endif +} + +// void PeaPod::PeaPodModuleLighting::callback_pwm_cycle(bool _, const FSM::fsm_timestamp_t& __) { +// double pwm = ((cos((FSM::Chronos.get() % PEAPOD_MODULE_LIGHTING_PWMCYCLE_DELTA) / ((double)PEAPOD_MODULE_LIGHTING_PWMCYCLE_DELTA) * 2.0 * M_PI) + 1.0) * 2048.0 * PEAPOD_MODULE_LIGHTING_DUTY); // 0 to PEAPOD_MODULE_LIGHTING_DUTY over PEAPOD_MODULE_LIGHTING_PWMCYCLE_DELTA milliseconds + +// pwm_lighting_red.set(FSM::Number(pwm, true, false)); +// } + +void PeaPod::PeaPodModuleLighting::callback_lighting_gate(bool _, const bool& onoff) { + pwm_lighting_blue.resume(); + pwm_lighting_red.resume(); +} + +void PeaPod::PeaPodModuleLighting::callback_lighting_camera(bool _, const bool& onoff) { + // Turn off all lights, then turn on the camera light if `onoff` is true + // enable_lighting.set(!onoff); + if(onoff) { + callback_pca9685_analogWrite(true, calculate_pwm(PEAPOD_MODULE_LIGHTING_DUTY_CAMERA)); // ON PWM + } else { + callback_pca9685_onOff(true, false); // OFF + } +} + +PeaPod::PeaPodModuleLighting::PeaPodModuleLighting(bool chronoCallbacks) : PeaPodModule(PEAPOD_MODULENUM_LIGHTING) { + if(chronoCallbacks) { + // #ifdef PEAPOD_PROGRAM_DEFAULT + // interval_pwmcycle = FSM::Chronos.addInterval(50, 0, callback_pwm_cycle, false); + // #endif + + #ifdef PEAPOD_PROGRAM_DEFAULT + interval_lighting_on = FSM::Chronos.addIntervalFlag(PEAPOD_MODULE_LIGHTING_DELTA, 0, &enable_lighting, false); + interval_lighting_off = FSM::Chronos.addIntervalFlag(PEAPOD_MODULE_LIGHTING_DELTA, PEAPOD_MODULE_LIGHTING_PHASE, &enable_lighting, true); + pwm_lighting_blue.set(FSM::Number(4096 * PEAPOD_MODULE_LIGHTING_DUTY_BLUE, true)); + pwm_lighting_red.set(FSM::Number(4096 * PEAPOD_MODULE_LIGHTING_DUTY_RED, true)); + #endif + + // ADC + interval_adc = FSM::Chronos.addInterval(PEAPOD_MODULE_LIGHTING_ADC_DELTA, 0, callback_adc_read, false); + } + + // enable_lighting.addLatchingConditional(true, false, callback_lighting_onoff); + + adc_voltage.addConditional(FSM::CMP_NEQ, FSM::notanumber, callback_adc_voltage); + enable_lighting.addLatchingConditional(true, false, callback_lighting_gate); + enable_camera.addLatchingConditional(true, false, callback_lighting_camera); + pwm_lighting_red.addConditional(FSM::CMP_NEQ, FSM::notanumber, callback_lighting_modulate); + pwm_lighting_blue.addConditional(FSM::CMP_NEQ, FSM::notanumber, callback_lighting_modulate); + + /* A note on how the lighting gating and modulation logic works: + * The lighting modulation conditional callbacks added to pwm_lighting_red and pwm_lighting_blue execute each update (if the value is not NaN) and set the PWM of their respective channels according to the value of the variable DEPENDING ON whether enable_lighting is true or false. + * The lighting gate conditional callback added to enable_lighting executes each time enable_lighting changes state. Its only function is to resume/"refresh" pwm_lighting_red and pwm_lighting_blue, which retriggers the modulation callbacks. + */ + + // pwm_lighting_red.set(FSM::Number(0, true)); + // pwm_lighting_blue.set(FSM::Number(0, true)); + enable_lighting.set(false); + enable_camera.set(false); + + registerVariable(&adc_voltage, true); // LOCKED + registerVariable(&pwm_lighting_red); + registerVariable(&pwm_lighting_blue); + registerFlag(&enable_lighting); + registerFlag(&enable_camera); +} + +PeaPod::PeaPodModuleLighting::~PeaPodModuleLighting() { + enable_lighting.set(false); + enable_camera.set(false); + + FSM::Chronos.removeInterval(interval_adc); + FSM::Chronos.removeInterval(interval_lighting_on); + FSM::Chronos.removeInterval(interval_lighting_off); + // FSM::Chronos.removeInterval(interval_pwmcycle); + interval_adc = nullptr; + interval_lighting_on = nullptr; + interval_lighting_off = nullptr; + // interval_pwmcycle = nullptr; +} \ No newline at end of file diff --git a/software/microcontroller/src/light.h b/software/microcontroller/src/light.h new file mode 100644 index 00000000..f469c63f --- /dev/null +++ b/software/microcontroller/src/light.h @@ -0,0 +1,58 @@ +#ifndef PEAPOD_LIGHT_H_ +#define PEAPOD_LIGHT_H_ + +#include + +#define PEAPOD_MODULE_LIGHTING_EEPROM_CONTENTS {"[{\"24LC32\":[80],\"PCA9685\":[" STR(I2CIP_PCA9685_ADDRESS) "],\"ADS1115\":[" STR(I2CIP_ADS1115_ADDRESS) "]}]"} + +#define PEAPOD_MODULE_LIGHTING_PWM_CHANNEL_RED PCA9685_CH0 +#define PEAPOD_MODULE_LIGHTING_PWM_CHANNEL_BLUE PCA9685_CH1 +#define PEAPOD_MODULE_LIGHTING_PWM_CHANNEL_CAMERA PCA9685_CH2 +#define PEAPOD_MODULE_LIGHTING_PWM_FQA I2CIP_FQA_CREATE(PEAPOD_WIRENUM, PEAPOD_MODULENUM_LIGHTING, 0, I2CIP_PCA9685_ADDRESS) + +#define PEAPOD_MODULE_LIGHTING_ADC_CHANNEL ADS1115_CHANNEL_0 +#define PEAPOD_MODULE_LIGHTING_ADC_FQA I2CIP_FQA_CREATE(PEAPOD_WIRENUM, PEAPOD_MODULENUM_LIGHTING, 0, I2CIP_ADS1115_ADDRESS) + +#define PEAPOD_MODULE_LIGHTING_ADC_DELTA 100 +#define PEAPOD_MODULE_LIGHTING_PWMCYCLE_DELTA 2500 +#define PEAPOD_MODULE_LIGHTING_DELTA 86400000 // 24 hours +#define PEAPOD_MODULE_LIGHTING_PHASE 57600000 // 16 hours on +#define PEAPOD_MODULE_LIGHTING_DUTY_RED 0.5 // 50% Duty Cycle +#define PEAPOD_MODULE_LIGHTING_DUTY_BLUE 0.5 // 50% Duty Cycle +#define PEAPOD_MODULE_LIGHTING_DUTY_CAMERA 0.5 // 50% Duty Cycle + +namespace PeaPod { + extern FSM::Variable adc_voltage; + extern FSM::Variable pwm_lighting_red; + extern FSM::Variable pwm_lighting_blue; + extern FSM::Flag enable_lighting; + extern FSM::Flag enable_camera; + + template void callback_adc_read(bool _, const FSM::fsm_timestamp_t& __); + void callback_adc_voltage(bool _, const FSM::Number& v); + + class PeaPodModuleLighting : public PeaPodModule { + private: + FSM::IntervalCallback* interval_adc = nullptr; + FSM::IntervalCallback* interval_lighting_on = nullptr; + FSM::IntervalCallback* interval_lighting_off = nullptr; + // FSM::IntervalCallback* interval_pwmcycle = nullptr; + + template static void callback_lighting_modulate(bool _, const FSM::Number& pwm); + + static void callback_lighting_gate(bool _, const bool& onoff); + + static void callback_lighting_camera(bool _, const bool& onoff); + + // static void callback_pwm_cycle(bool _, const FSM::fsm_timestamp_t& __); + + public: + PeaPodModuleLighting(bool chronoCallbacks = true); + + ~PeaPodModuleLighting(); + }; +} + +#include + +#endif \ No newline at end of file diff --git a/software/microcontroller/src/light.tpp b/software/microcontroller/src/light.tpp new file mode 100644 index 00000000..a63c2ca4 --- /dev/null +++ b/software/microcontroller/src/light.tpp @@ -0,0 +1,41 @@ +#ifndef PEAPOD_LIGHT_H_ +#error __FILE__ should only be included AFTER +#endif + +#ifdef PEAPOD_LIGHT_H_ + +#ifndef PEAPOD_LIGHT_T_ +#define PEAPOD_LIGHT_T_ + +template void PeaPod::callback_adc_read(bool _, const FSM::fsm_timestamp_t& __) { + if(C > ADS1115_CHANNEL_3) return; // Invalid Channel + if(I2CIP::errlev[I2CIP_FQA_SEG_MODULE(F)] == I2CIP_ERR_NONE && I2CIP::modules[I2CIP_FQA_SEG_MODULE(F)] != nullptr) { + + i2cip_ads1115_chsel_t channel = (i2cip_ads1115_chsel_t)C; + i2cip_args_io_t args = { .g = true, .a = nullptr, .s = nullptr, .b = &channel }; + + i2cip_errorlevel_t errlev = I2CIP::modules[I2CIP_FQA_SEG_MODULE(F)]->operator()(F, true, args, DebugJsonBreakpoints); + + if(errlev == I2CIP_ERR_NONE){ + Device** dptr = I2CIP::devicetree[F]; + if(dptr != nullptr && *dptr != nullptr) { + ADS1115* ads = (ADS1115*)(*dptr); + float voltage = ads->getCache(); + adc_voltage.set(FSM::Number((double)voltage, true, false)); + } + } + } +} + +template void PeaPod::PeaPodModuleLighting::callback_lighting_modulate(bool _, const FSM::Number& pwm) { + if(P > PCA9685_CH15) return; // Invalid Channel + if(enable_lighting.get()) { + callback_pca9685_analogWrite(true, pwm); // ON PWM + // callback_pca9685_analogWrite(true, FSM::Number(4096.0 * PEAPOD_MODULE_LIGHTING_DUTY)); + } else { + callback_pca9685_onOff(true, false); // OFF + } +} + +#endif +#endif \ No newline at end of file diff --git a/software/microcontroller/src/main.cc b/software/microcontroller/src/main.cc new file mode 100644 index 00000000..932c22fe --- /dev/null +++ b/software/microcontroller/src/main.cc @@ -0,0 +1,392 @@ +#ifndef UNIT_TEST +#define UNIT_TEST 1 +#define IS_MAIN 1 + +// INCLUDES + +#include + +#include +#include +#include +#include + +// NAMESPACE USAGE + +using namespace PeaPod; +using namespace I2CIP; + +// TYPEDEFS +typedef enum PEAPOD_MENU_T { + PEAPOD_MENU_MAIN = 0, + PEAPOD_MENU_MODULE = 1, + PEAPOD_MENU_DEVICE = 2, + PEAPOD_MENU_FLAG = 3, + PEAPOD_MENU_VARIABLE = 4, + PEAPOD_MENU_SET = 5, +} PEAPOD_MENU_T; + +typedef struct peapod_menustate_t { + PEAPOD_MENU_T menu; // Top-level functionality selection + uint8_t submenu; // Ordinal of the selected item in the current menu, 0 is always "BACK" + uint8_t module_idx; +} peapod_menustate_t; + +const peapod_menustate_t _peapod_menustate_default = { + .menu = PEAPOD_MENU_MAIN, + .submenu = 0, + .module_idx = 0 +}; + +// FUNCTION PROTOTYPES + +// void callback_pwm_cycle(bool _, const FSM::fsm_timestamp_t& __); +void onEncoderChange(bool inc); +void writeLCDMenu(bool _, const peapod_menustate_t& menu); +void onEncoderPress(void); +template <> FSM::State::~State() = default; +template <> FSM::ConditionalCallback* FSM::State::addCallback(typename FSM::ConditionalCallback::cb_compval_t cb) { return addConditional(new FSM::ConditionalCallback(this->key, CMP_NOP, _peapod_menustate_default, cb)); } +template <> bool FSM::ConditionalCallback::compare(comparators_t cmp, const peapod_menustate_t& val, const peapod_menustate_t& ref) { return true; } // Every comparison is unequal, since we only use unconditional callbacks + +// GLOBAL VARIABLES + +FSM::State menu_state = FSM::State(_peapod_menustate_default, "menu"); + +PeaPodModule nomodule = PeaPodModule(I2CIP_MUX_NUM_FAKE); + +i2cip_fqa_t fqa_lcd = createFQA(PEAPOD_WIRENUM, I2CIP_MUX_NUM_FAKE, I2CIP_MUX_BUS_FAKE, I2CIP_JHD1313_ADDRESS); +i2cip_fqa_t fqa_encoder = createFQA(PEAPOD_WIRENUM, I2CIP_MUX_NUM_FAKE, I2CIP_MUX_BUS_FAKE, I2CIP_SEESAW_ADDRESS); + +i2cip_errorlevel_t errlev_lcd = I2CIP_ERR_NONE; +i2cip_errorlevel_t errlev_encoder = I2CIP_ERR_NONE; + +void setup(void) { + // Builtin LED Pinmode; Serial Begin + + pinMode(LED_BUILTIN, OUTPUT); + PEAPOD_SERIAL.begin(115200); + while(!PEAPOD_SERIAL) { digitalWrite(LED_BUILTIN, HIGH); delay(100); digitalWrite(LED_BUILTIN, LOW); delay(100); } + + delay(100); + + // Instantiate modules ahead of time + PeaPod::callback_module(); + PeaPod::callback_module(); + PeaPod::callback_module(); + + delay(100); + + // Initialize non-module devices + errlev_lcd = nomodule.operator()(fqa_lcd, false, _i2cip_args_io_default, DebugJsonOut); + errlev_encoder = nomodule.operator()(fqa_encoder, false, _i2cip_args_io_default, DebugJsonOut); + + if(errlev_lcd == I2CIP_ERR_NONE) { + String init = "PeaPod\nInitializing..."; + i2cip_args_io_t args = _i2cip_args_io_default; + args.g = false; + args.s = &init; + i2cip_jhd1313_args_t rgb = JHD1313::randomRGBLCD(); + i2cip_args_io_t args_lcd = { .a = nullptr, .s = nullptr, .b = &rgb }; + errlev_lcd = nomodule.operator()(fqa_lcd, true, args, DebugJsonOut); + + menu_state.addCallback(writeLCDMenu); + } + + delay(100); + + DebugJson::revision(I2CIP_REVISION, PEAPOD_SERIAL); + + // // Print all devices + // delay(100); + // DEBUG_JSON(I2CIP::devicetree.toString()); + // DEBUG_JSON(modules[PEAPOD_MODULENUM]->toString()); + + delay(100); + + PeaPod::registerCallbacks(); + + delay(100); +} + +// LOOP GLOBALS + +int32_t encoder_last = 0; +bool toggle = false; + +void loop(void) { + + // I2CIP_DEBUG_SERIAL.println(I2CIP::devicetree.toString()); + // I2CIP_DEBUG_SERIAL.println(modules[PEAPOD_MODULENUM]->toString()); + + PeaPod::cycle.set(PeaPod::cycle.get()++); + + errlev_encoder = nomodule.operator()(fqa_encoder, true, _i2cip_args_io_default, DebugJsonOut); + if(errlev_encoder == I2CIP_ERR_NONE) { + // Read encoder state and update menu + Device** dptr = devicetree[fqa_encoder]; + if(dptr && *dptr) { + RotaryEncoder* encoder = (RotaryEncoder*)(*dptr); + int32_t encoder_pos = encoder->getCache().encoder; + if(encoder_pos != encoder_last) { + onEncoderChange(encoder_last > encoder_pos); + } + if(encoder->getCache().button == PIN_ON && !toggle) { + onEncoderPress(); + toggle = true; + } + if(encoder->getCache().button == PIN_OFF) { + toggle = false; + } + encoder_last = encoder_pos; + } + } else { + String init = "PeaPod\nENCODER FAIL"; + i2cip_args_io_t args = _i2cip_args_io_default; + args.g = false; + args.s = &init; + i2cip_jhd1313_args_t rgb = JHD1313::randomRGBLCD(); + i2cip_args_io_t args_lcd = { .a = nullptr, .s = nullptr, .b = &rgb }; + errlev_lcd = nomodule.operator()(fqa_lcd, true, args, DebugJsonOut); + } +} + +#define MENU_SUBMENUS_MAIN 5 // Summary, Select Module & Device & Flag & Variable = 5 +#define MENU_SUBMENUS_MODULE 9 // 8 Modules + Back + +void onEncoderChange(bool inc) { + peapod_menustate_t menu = menu_state.get(); + + PeaPodModule* currentModule = (PeaPodModule*)modules[menu.module_idx]; + uint8_t moduleNumFlags = currentModule == nullptr ? 0 : currentModule->getNumFlags(); + uint8_t moduleNumVariables = currentModule == nullptr ? 0 : currentModule->getNumVariables(); + FSM::Variable* variable = currentModule == nullptr ? nullptr : currentModule->getVariableByIndex(menu.submenu - 1); + + int newSubmenu = (int)menu.submenu + (inc ? 1 : -1); + switch(menu.menu) { + case PEAPOD_MENU_MAIN: + if(newSubmenu < 0) newSubmenu = MENU_SUBMENUS_MAIN - (abs(newSubmenu) % MENU_SUBMENUS_MAIN); + newSubmenu %= MENU_SUBMENUS_MAIN; + break; + case PEAPOD_MENU_MODULE: + if(newSubmenu < 0) newSubmenu = MENU_SUBMENUS_MODULE - (abs(newSubmenu) % MENU_SUBMENUS_MODULE); + newSubmenu %= MENU_SUBMENUS_MODULE; // 8 Modules + Back + break; + case PEAPOD_MENU_DEVICE: + if(newSubmenu < 0) newSubmenu = devicetree.size() - (abs(newSubmenu) % devicetree.size()); + newSubmenu %= (devicetree.size() + 1); // All Devices + Back + break; + case PEAPOD_MENU_FLAG: + if(newSubmenu < 0) newSubmenu = moduleNumFlags - (abs(newSubmenu) % moduleNumFlags); + newSubmenu %= (moduleNumFlags + 1); // All Flags for the selected module + Back + break; + case PEAPOD_MENU_VARIABLE: + if(newSubmenu < 0) newSubmenu = moduleNumVariables - (abs(newSubmenu) % moduleNumVariables); + newSubmenu %= (moduleNumVariables + 1); // All Variables for the selected module + Back + break; + case PEAPOD_MENU_SET: + if(variable != nullptr) { + double val = variable->get(); + if(inc) { + val += 1; + } else { + if(val < 0) val += 1; + else val -= 1; + } + variable->set(val); + } + } + + if(menu.menu != PEAPOD_MENU_SET) menu.submenu = newSubmenu; + + menu_state.set(menu); +} + +void writeLCDMenu(bool _, const peapod_menustate_t& menu) { + FSM::Flag* flag; + FSM::Variable* variable; + String line1 = "", line2 = ""; // LCD has 2 lines of 16 characters each + switch(menu.menu) { + case PEAPOD_MENU_MAIN: + line1 = "PeaPod"; + switch(menu.submenu) { + case 0: + line2 = "Summary"; + break; + case 1: + line2 = "Select Module"; + break; + case 2: + line2 = "Select Device"; + break; + case 3: + line2 = "Select Flag"; + break; + case 4: + line2 = "Select Variable"; + break; + } + break; + case PEAPOD_MENU_MODULE: + line1 = menu.submenu == 0 ? "Modules" : String("Module ") + String(menu.submenu - 1); + if(menu.submenu == 0) { + line2 = "BACK"; + break; + } + if(menu.submenu - 1 < 8) { + // Display module info on line 2 + if(modules[menu.submenu - 1]) { + line2 = "FOUND 0x" + String(errlev[menu.submenu - 1], HEX); + } else { + line2 = "ENOENT"; + } + } + break; + case PEAPOD_MENU_DEVICE: + line1 = menu.submenu == 0 ? "Devices" : String("Device ") + String(menu.submenu - 1); + if(menu.submenu == 0) { + line2 = "BACK"; + break; + } + if(menu.submenu - 1 < devicetree.size()) { + // Display device info on line 2 + Device** dptr = devicetree.getByIndex(menu.submenu - 1); + if(!dptr || !(*dptr)) { + line2 = "ENOENT"; + break; + } + i2cip_fqa_t fqa = (*dptr)->getFQA(); + line2 = String((*dptr)->getID()) + " " + String(I2CIP_FQA_SEG_MODULE(fqa)) + ":" + String(I2CIP_FQA_SEG_MUXBUS(fqa)) + ":" + String(I2CIP_FQA_SEG_DEVADR(fqa), HEX); + } else { + line2 = "ENOENT"; + } + break; + case PEAPOD_MENU_FLAG: + flag = ((PeaPodModule*)modules[menu.module_idx])->getFlagByIndex(menu.submenu - 1); + line1 = menu.submenu == 0 ? "Flags" : String("F ") + (flag == nullptr ? "ENOENT" : flag->getKey()); + if(menu.submenu == 0) { + line2 = "BACK"; + break; + } + if(flag == nullptr) { + line2 = "ENOENT"; + break; + } + line2 = flag->get() ? "ON" : "OFF"; + break; + case PEAPOD_MENU_VARIABLE: + variable = ((PeaPodModule*)modules[menu.module_idx])->getVariableByIndex(menu.submenu - 1); + line1 = menu.submenu == 0 ? "Variables" : String("V ") + (variable == nullptr ? "ENOENT" : variable->getKey()); + if(menu.submenu == 0) { + line2 = "BACK"; + break; + } + if(variable == nullptr) { + line2 = "ENOENT"; + break; + } + line2 = String(variable->get(), 3); // 3 decimal places + break; + case PEAPOD_MENU_SET: + variable = ((PeaPodModule*)modules[menu.module_idx])->getVariableByIndex(menu.submenu - 1); + line1 = menu.submenu == 0 ? "Variables" : String("S ") + (variable == nullptr ? "ENOENT" : variable->getKey()); + if(menu.submenu == 0) { + line2 = "BACK"; + break; + } + if(variable == nullptr) { + line2 = "ENOENT"; + break; + } + line2 = String(variable->get(), 3); // 3 decimal places + break; + } + + String display = line1 + "\n" + line2; + + i2cip_args_io_t args = _i2cip_args_io_default; + args.g = false; + args.s = &display; + args.b = nullptr; + + errlev_lcd = nomodule.operator()(fqa_lcd, true, args, DebugJsonOut); +} + +void onEncoderPress(void) { + peapod_menustate_t menu = menu_state.get(); + + FSM::Flag* flag; + + switch(menu.menu) { + case PEAPOD_MENU_MAIN: + if(menu.submenu == 0) { + DebugJson::revision(0, PEAPOD_SERIAL); // FOR NOW + } else { + switch(menu.submenu) { + case 1: + menu.menu = PEAPOD_MENU_MODULE; + break; + case 2: + menu.menu = PEAPOD_MENU_DEVICE; + break; + case 3: + menu.menu = PEAPOD_MENU_FLAG; + break; + case 4: + menu.menu = PEAPOD_MENU_VARIABLE; + break; + case 5: + menu.menu = PEAPOD_MENU_SET; + break; + default: + break; + } + menu.submenu = 0; + } + break; + case PEAPOD_MENU_MODULE: + if(menu.submenu == 0) { + menu.menu = PEAPOD_MENU_MAIN; // Back to main menu + menu.submenu = 0; + } else { + menu.module_idx = menu.submenu - 1; // Set selected module index for use in the flag/variable menu + menu.submenu = 0; + break; + } + break; + case PEAPOD_MENU_DEVICE: + if(menu.submenu == 0) { + menu.menu = PEAPOD_MENU_MAIN; // Back to main menu + menu.submenu = 0; + } else { + // NOP for now - could implement device-specific actions here + menu.submenu = 0; + } + break; + case PEAPOD_MENU_FLAG: + if(menu.submenu == 0) { + menu.menu = PEAPOD_MENU_MAIN; // Back to main menu + menu.submenu = 0; + break; + } + flag = ((PeaPodModule*)modules[menu.module_idx])->getFlagByIndex(menu.submenu - 1); + if(flag == nullptr) { + break; + } + flag->set(!flag->get()); // Toggle the selected flag + break; + case PEAPOD_MENU_VARIABLE: + if(menu.submenu == 0) { + menu.menu = PEAPOD_MENU_MAIN; // Back to main menu + menu.submenu = 0; + } else { + menu.menu = PEAPOD_MENU_SET; // Go to variable set menu + } + break; + case PEAPOD_MENU_SET: + menu.menu = PEAPOD_MENU_VARIABLE; // Go back to variable view + } + + menu_state.set(menu); +} + +#endif \ No newline at end of file diff --git a/software/microcontroller/src/peapod.cc b/software/microcontroller/src/peapod.cc new file mode 100644 index 00000000..36fcc8ee --- /dev/null +++ b/software/microcontroller/src/peapod.cc @@ -0,0 +1,268 @@ +#include + +#include +#include +#include + +#include + +FSM::Variable PeaPod::cycle = FSM::Variable(FSM::Number(0, false, false), "cycle"); +FSM::Variable PeaPod::fps = FSM::Variable(FSM::Number(0, false, false), "fps"); +bool PeaPod::pinModeSet[255] = { false }; + +using namespace PeaPod; +using namespace I2CIP; + +DeviceGroup* PeaPodModule::deviceGroupFactory(const i2cip_id_t& id) { + DeviceGroup* dg = DeviceGroup::create(id); + if(dg != nullptr) return dg; + dg = DeviceGroup::create(id); + if(dg != nullptr) return dg; + dg = DeviceGroup::create(id); + if(dg != nullptr) return dg; + dg = DeviceGroup::create(id); + if(dg != nullptr) return dg; + dg = DeviceGroup::create(id); + if(dg != nullptr) return dg; + dg = DeviceGroup::create(id); + if(dg != nullptr) return dg; + dg = DeviceGroup::create(id); + if(dg != nullptr) return dg; + dg = DeviceGroup::create(id); + if(dg != nullptr) return dg; + dg = DeviceGroup::create(id); + if(dg != nullptr) return dg; + dg = DeviceGroup::create(id); + return dg; +} + +void PeaPodModule::handleCommand(JsonObject command, Print& out) { + JsonDocument doc; + doc["timestamp"] = millis(); + + i2cip_fqa_t fqa = command["fqa"].as(); + + Device** dptr = I2CIP::devicetree[fqa]; + if(dptr != nullptr && *dptr != nullptr) { + + Device* d = *dptr; + + DeviceGroup* dg = this->operator[](d->getID()); + + if(dg != nullptr && dg->handler != nullptr) { + i2cip_args_io_t args = _i2cip_args_io_default; + + JsonVariant argsG = command["g"]; + JsonVariant argsA = command["a"]; + JsonVariant argsS = command["s"]; + JsonVariant argsB = command["b"]; + + dg->handler(args, argsA, argsS, argsB); + + // DebugJson::StringWriter sw; + // i2cip_errorlevel_t errlev = this->operator()(d, true, args, sw); + unsigned long start = millis(); + String msg = String(d->getID()) + ' ' + fqaToString(fqa) + ' '; + bool spacer = false; + + i2cip_errorlevel_t errlev = MUX::setBus(fqa); + if(errlev == I2CIP_ERR_NONE) { + if(d->getOutput() != nullptr && !argsS.isNull()) { + errlev = d->set(args.s, args.b); + + // Print output cache + msg += "OUTSET "; + msg += d->getOutput()->valueToString(); + spacer = true; + } + if(errlev == I2CIP_ERR_NONE && d->getInput() != nullptr && !argsG.isNull()) { + errlev = d->get(args.a); + + // Print input cache + if(spacer) msg += "; "; + else spacer = true; + msg += "INPGET "; + msg += d->getInput()->printCache(); + + if(errlev == I2CIP_ERR_NONE) { + DebugJson::telemetryJsonString(d->getInput()->getLastRX(), d->getInput()->cacheToString()); + } + } + if(errlev == I2CIP_ERR_NONE && argsG.isNull() && argsS.isNull()) { + errlev = d->pingTimeout(false, true); + msg = "PING"; + } + } + + dg->cleanup(args); + + msg += " DELTA "; + msg += String(millis() - start); + msg += "ms"; + + msg += errlev == I2CIP_ERR_NONE ? " OK" : (errlev == I2CIP_ERR_SOFT ? " EINVAL" : " EIO"); + + + // TODO: Print to out with sw, errlev, timestamp + doc["type"] = "info"; + doc["id"] = d->getID(); + doc["fqa"] = d->getFQA(); + doc["errlev"] = errlev; + // doc["msg"] = sw.operator String(); + doc["msg"] = msg; + } else { + doc["type"] = "error"; + doc["msg"] = "LIBRARY ENOENT"; + doc["errlev"] = I2CIP_ERR_SOFT; + } + } else { + doc["type"] = "error"; + doc["msg"] = "DEVICE ENOENT"; + doc["errlev"] = I2CIP_ERR_SOFT; + } + + DebugJson::jsonPrintln(doc, out); +} + +void PeaPodModule::handleConfig(JsonObject config, Print& out) { + JsonDocument doc; + doc["timestamp"] = millis(); + doc["type"] = "config"; + + bool list = false; + for (JsonPair kv : config) { + const char* key = kv.key().c_str(); + + if(strcmp(key, "timestamp") == 0) continue; // Reserved key + if(strcmp(key, "list") == 0) { list = true; continue; } // Reserved key + + if(!doc["data"][key].isNull()) continue; // Already handled + + bool* locked = locker[key]; + if(locked && *locked) continue; // Locked, skip + + JsonVariant value = kv.value(); + + FSM::Flag* flag = flags[key]; + if(flag != nullptr) { + if(value.is()) { + flag->set(value.as()); + } + doc["data"][key] = flag->get(); + continue; + } + + FSM::Variable* variable = variables[key]; + if(variable != nullptr) { + if(value.is()) { + variable->set(FSM::Number(value.as(), false, false)); + } else if(value.is()) { + variable->set(FSM::Number(value.as(), false, true)); + } else if(value.is()) { + variable->set(FSM::Number(value.as(), true, true)); + } + doc["data"][key] = variable->get().operator double(); + continue; + } + } + + if(list) { + String* flagkeys = flags.keys(); + uint8_t flagcount = flags.size(); + + for(uint8_t i = 0; i < flagcount; i++) { + if(doc["data"][flagkeys[i]].isNull()) doc["data"][flagkeys[i]] = flags[flagkeys[i].c_str()]->get(); + } + + delete[] flagkeys; + + String* varkeys = variables.keys(); + uint8_t varcount = variables.size(); + + for(uint8_t i = 0; i < varcount; i++) { + if(doc["data"][varkeys[i]].isNull()) doc["data"][varkeys[i]] = variables[varkeys[i].c_str()]->get().operator double(); + } + + delete[] varkeys; + } + + DebugJson::jsonPrintln(doc, out); +} + +void PeaPodModule::registerFlag(FSM::Flag* flag, bool locked) { + this->flags.set(flag->getKey(), flag); + this->locker.set(flag->getKey(), new bool(locked)); // TODO: Memory leak? +} +void PeaPodModule::registerVariable(FSM::Variable* variable, bool locked) { + this->variables.set(variable->getKey(), variable); + this->locker.set(variable->getKey(), new bool(locked)); // TODO: Memory leak? +} + +FSM::Flag* PeaPodModule::getFlagByIndex(uint8_t index) const { + return this->flags.getByFirstOccurrence(index); +} +FSM::Variable* PeaPodModule::getVariableByIndex(uint8_t index) const { + return this->variables.getByFirstOccurrence(index); +} + +void PeaPod::configRouter(JsonObject command, Print& out) { + for(unsigned int i = 0; i < I2CIP_MUX_COUNT; i++) { + if(I2CIP::modules[i] != nullptr) { + I2CIP::modules[i]->handleConfig(command, out); + } + } +} + +void PeaPod::registerCallbacks(void) { + cycle.addConditional(FSM::CMP_NEQ, FSM::notanumber, callback_cycle); + + FSM::Chronos.addInterval(PEAPOD_DELTA_HEARTBEAT, PeaPod::callback_heartbeat); + + FSM::Chronos.addInterval(PEAPOD_DELTA_MODULECHECK, PeaPod::callback_module); + FSM::Chronos.addInterval(PEAPOD_DELTA_MODULECHECK, PeaPod::callback_module); + FSM::Chronos.addInterval(PEAPOD_DELTA_MODULECHECK, PeaPod::callback_module); +} + +unsigned long last = 0; +void PeaPod::callback_cycle(bool _, const FSM::Number& __) { + FSM::Chronos.set(millis()); + + unsigned long delta = millis() - last; + PeaPod::fps.set(((unsigned)PeaPod::fps.get() + 1000.f / max(1.f, (float)delta))/2); // Old FPS plus new FPS over two (moving average) + last = millis(); + + while(PEAPOD_SERIAL.available() > 0) { // With baud 115200, this should not block + DebugJson::update(PEAPOD_SERIAL, I2CIP::commandRouter, PeaPod::configRouter); + } +} + +void PeaPod::callback_heartbeat(bool _, const FSM::fsm_timestamp_t& __) { + DebugJson::heartbeat(millis(), PEAPOD_SERIAL); + DebugJson::revision(I2CIP_REVISION, PEAPOD_SERIAL); + DebugJson::telemetry(millis(), (unsigned)PeaPod::fps.get(), "fps", PEAPOD_SERIAL); + DebugJson::telemetry(millis(), (unsigned)PeaPod::cycle.get(), "cycle", PEAPOD_SERIAL); +} + +template ::value, int>::type = 0> void PeaPod::callback_module(bool _, const FSM::fsm_timestamp_t& __) { + if(M >= I2CIP_MUX_COUNT) return; + + if(I2CIP::MUX::pingMUX(PEAPOD_WIRENUM, M)) { + if(I2CIP::modules[M] == nullptr) { + I2CIP::modules[M] = new T(); + + // First Module - Add HT16K33 + if(M == 0) { + I2CIP::modules[0]->operator()(I2CIP::sevenSegmentFQA, true, _i2cip_args_io_default, NullStream); + } + } + + I2CIP::errlev[M] = I2CIP::modules[M]->operator()(); + } else { + I2CIP::errlev[M] = I2CIP_ERR_HARD; + } + + if(I2CIP::modules[M] != nullptr && I2CIP::errlev[M] == I2CIP_ERR_HARD) { + delete I2CIP::modules[M]; + I2CIP::modules[M] = nullptr; + } +} \ No newline at end of file diff --git a/software/microcontroller/src/peapod.h b/software/microcontroller/src/peapod.h new file mode 100644 index 00000000..345f64a3 --- /dev/null +++ b/software/microcontroller/src/peapod.h @@ -0,0 +1,120 @@ +#ifndef PEAPOD_H_ +#define PEAPOD_H_ + +#include + +// Select a Serial port for output +// #define PEAPOD_SERIAL Serial // USB +#define PEAPOD_SERIAL Serial1 // GPIO TX/RX + +#define DEBUG_SERIAL PEAPOD_SERIAL // For DebugJson + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define PEAPOD_WIRENUM 0 + +#define PEAPOD_MODULENUM_AIR 0 +#define PEAPOD_MODULENUM_WATERING 1 +#define PEAPOD_MODULENUM_LIGHTING 2 +#define PEAPOD_MODULENUM_CONTROL 3 + +#define PEAPOD_DELTA_HEARTBEAT 5000 +#define PEAPOD_DELTA_MODULECHECK 100 + +#define PEAPOD_MODULENUM_SEVENSEG 0 +#define PEAPOD_SEVENSEG_TEMPERATURE 1 // Uncomment to enable 7-segment display for temperature +// #define PEAPOD_SEVENSEG_HUMIDITY 1 // Uncomment to enable 7-segment display for humidity +// #define PEAPOD_SEVENSEG_CO2 1 // Uncomment to enable 7-segment display for CO2 +// #define PEAPOD_SEVENSEG_ADC 1 // Uncomment to enable 7-segment display for ADC voltage + +// #define PEAPOD_PROGRAM_DEFAULT 1 // Uncomment to enable default program on startup + +namespace PeaPod { + class PeaPodModule : public I2CIP::JsonModule { + private: + HashTable flags = HashTable(); + HashTable variables = HashTable(); + HashTable locker = HashTable(); + protected: + I2CIP::DeviceGroup* deviceGroupFactory(const i2cip_id_t& id) override; + + public: + PeaPodModule(const uint8_t& mux) : JsonModule(PEAPOD_WIRENUM, mux) { } + + void handleCommand(JsonObject command, Print& out) override; + + void handleConfig(JsonObject config, Print& out) override; + + void registerFlag(FSM::Flag* flag, bool locked = false); + void registerVariable(FSM::Variable* variable, bool locked = false); + + FSM::Flag* getFlagByIndex(uint8_t index) const; + FSM::Variable* getVariableByIndex(uint8_t index) const; + + uint8_t getNumFlags(void) const { return this->flags.size(); } + uint8_t getNumVariables(void) const { return this->variables.size(); } + }; + + // Global States + extern FSM::Variable cycle; + extern FSM::Variable fps; + + void registerCallbacks(void); + void configRouter(JsonObject command, Print& out); + + // Callbacks + void callback_cycle(bool _, const FSM::Number& __); + void callback_heartbeat(bool _ = true, const FSM::fsm_timestamp_t& __ = 0); + template ::value, int>::type = 0> void callback_module(bool _ = true, const FSM::fsm_timestamp_t& __ = 0); + + template void callback_mcp23017_digitalWrite(bool _, const bool& v); + template void callback_pca9685_analogWrite(bool _, const FSM::Number& v); + template void callback_pca9685_onOff(bool _, const bool& v); + + // Onboard GPIO Helpers + extern bool pinModeSet[255]; + + template void controlPin(const bool& s) { + if(!pinModeSet[P]) { pinMode(P, OUTPUT); pinModeSet[P] = true; } + if(s) { + digitalWrite(P, HIGH); + } else { + digitalWrite(P, LOW); + } + } + template void controlPWM(const uint8_t& v) { + if(!pinModeSet[P]) { pinMode(P, OUTPUT); pinModeSet[P] = true; } + analogWrite(P, v); + } + + template void controlPin(bool _, const bool& s) { controlPin

(s); } + + template void controlPWM(bool _, const FSM::Number& v) { + if(v.isFloating) { + // 0.0 - 1.0 + controlPWM

(min(255, max(0, (int)((double)v * 255.f)))); + } else { + // 0 - 255 + controlPWM

(min(255, max(0, (int)(v)))); + } + } +} + +#include + +#endif \ No newline at end of file diff --git a/software/microcontroller/src/peapod.tpp b/software/microcontroller/src/peapod.tpp new file mode 100644 index 00000000..0d864383 --- /dev/null +++ b/software/microcontroller/src/peapod.tpp @@ -0,0 +1,47 @@ +#ifndef PEAPOD_H_ +#error __FILE__ should only be included AFTER +#endif + +#ifdef PEAPOD_H_ + +#ifndef PEAPOD_T_ +#define PEAPOD_T_ + +template void PeaPod::callback_mcp23017_digitalWrite(bool _, const bool& v) { + if(P > PIN_B7) return; // Invalid Pin + if(I2CIP::errlev[I2CIP_FQA_SEG_MODULE(F)] == I2CIP_ERR_NONE && I2CIP::modules[I2CIP_FQA_SEG_MODULE(F)] != nullptr) { + + i2cip_mcp23017_bitmask_t gpio_mask = 1 << P; + i2cip_mcp23017_t gpio_data = v ? (1 << P) : 0; + i2cip_args_io_t gpio_args = { .g = false, .a = nullptr, .s = &gpio_data, .b = &gpio_mask }; + + modules[I2CIP_FQA_SEG_MODULE(F)]->operator()(F, true, gpio_args, DebugJsonBreakpoints); + } +} + +template void PeaPod::callback_pca9685_analogWrite(bool _, const FSM::Number& v) { + if(P > PCA9685_CH15) return; // Invalid Channel + if(I2CIP::errlev[I2CIP_FQA_SEG_MODULE(F)] == I2CIP_ERR_NONE && I2CIP::modules[I2CIP_FQA_SEG_MODULE(F)] != nullptr) { + + i2cip_pca9685_chsel_t channel = (i2cip_pca9685_chsel_t)P; + i2cip_pca9685_t data = (uint16_t)max(0, min(4096, (int)v)); + i2cip_args_io_t args = { .g = false, .a = nullptr, .s = &data, .b = &channel }; + + I2CIP::modules[I2CIP_FQA_SEG_MODULE(F)]->operator()(F, true, args, DebugJsonBreakpoints); + } + } + + template void PeaPod::callback_pca9685_onOff(bool _, const bool& v) { + if(P > PCA9685_CH15) return; // Invalid Channel + if(I2CIP::errlev[I2CIP_FQA_SEG_MODULE(F)] == I2CIP_ERR_NONE && I2CIP::modules[I2CIP_FQA_SEG_MODULE(F)] != nullptr) { + + i2cip_pca9685_chsel_t channel = (i2cip_pca9685_chsel_t)P; + i2cip_pca9685_t data = v ? 4096 : 0; + i2cip_args_io_t args = { .g = false, .a = nullptr, .s = &data, .b = &channel }; + + I2CIP::modules[I2CIP_FQA_SEG_MODULE(F)]->operator()(F, true, args, DebugJsonBreakpoints); + } + } + +#endif +#endif \ No newline at end of file diff --git a/software/microcontroller/src/states.cc b/software/microcontroller/src/states.cc new file mode 100644 index 00000000..fe2b58c8 --- /dev/null +++ b/software/microcontroller/src/states.cc @@ -0,0 +1,15 @@ +#include +#include +#include + +FSM::Variable PeaPod::air_temperature = FSM::Variable(FSM::notanumber, "air-temperature"); +FSM::Variable PeaPod::air_humidity = FSM::Variable(FSM::notanumber, "air-humidity"); +FSM::Variable PeaPod::air_co2 = FSM::Variable(FSM::notanumber, "air-ppm-carbondioxide"); + +FSM::Flag PeaPod::enable_watering = FSM::Flag(false, "enable_watering"); + +FSM::Variable PeaPod::adc_voltage = FSM::Variable(FSM::notanumber, "adc_voltage"); +FSM::Variable PeaPod::pwm_lighting_red = FSM::Variable(FSM::Number(0, true), "pwm_lighting_red"); +FSM::Variable PeaPod::pwm_lighting_blue = FSM::Variable(FSM::Number(0, true), "pwm_lighting_blue"); +FSM::Flag PeaPod::enable_lighting = FSM::Flag("enable_lighting"); +FSM::Flag PeaPod::enable_camera = FSM::Flag("enable_camera"); \ No newline at end of file diff --git a/software/microcontroller/src/water.cc b/software/microcontroller/src/water.cc new file mode 100644 index 00000000..f6900152 --- /dev/null +++ b/software/microcontroller/src/water.cc @@ -0,0 +1,25 @@ +#include + +PeaPod::PeaPodModuleWatering::PeaPodModuleWatering(bool chronoCallbacks) : PeaPodModule(PEAPOD_MODULENUM_WATERING) { + if(chronoCallbacks) { + #ifdef PEAPOD_PROGRAM_DEFAULT + interval_watering_on = FSM::Chronos.addIntervalFlag(PEAPOD_MODULE_WATERING_DELTA, 0, &enable_watering, false); + interval_watering_off = FSM::Chronos.addIntervalFlag(PEAPOD_MODULE_WATERING_DELTA, PEAPOD_MODULE_WATERING_PHASE, &enable_watering, true); + #endif + } + + enable_watering.addLatchingConditional(true, false, callback_mcp23017_digitalWrite); + + enable_watering.set(false); + + registerFlag(&enable_watering); +} + +PeaPod::PeaPodModuleWatering::~PeaPodModuleWatering() { + enable_watering.set(false); + + FSM::Chronos.removeInterval(interval_watering_on); + FSM::Chronos.removeInterval(interval_watering_off); + interval_watering_on = nullptr; + interval_watering_off = nullptr; +} \ No newline at end of file diff --git a/software/microcontroller/src/water.h b/software/microcontroller/src/water.h new file mode 100644 index 00000000..2b6226cd --- /dev/null +++ b/software/microcontroller/src/water.h @@ -0,0 +1,29 @@ +#ifndef PEAPOD_WATER_H_ +#define PEAPOD_WATER_H_ + +#include + +#define PEAPOD_MODULE_WATERING_EEPROM_CONTENTS {"[{\"24LC32\":[80],\"MCP23017\":[" STR(I2CIP_MCP23017_ADDRESS) "]}]"} +#define PEAPOD_MODULE_WATERING_GPIO_FQA I2CIP_FQA_CREATE(PEAPOD_WIRENUM, PEAPOD_MODULENUM_WATERING, 0, I2CIP_MCP23017_ADDRESS) +#define PEAPOD_MODULE_WATERING_GPIO_PIN PIN_B0 +#define PEAPOD_MODULE_WATERING_DELTA 1800000 // 30 minutes +#define PEAPOD_MODULE_WATERING_PHASE 5000 // 5 seconds + +namespace PeaPod { + + extern FSM::Flag enable_watering; + + class PeaPodModuleWatering : public PeaPodModule { + FSM::IntervalCallback* interval_watering_on = nullptr; + FSM::IntervalCallback* interval_watering_off = nullptr; + + public: + PeaPodModuleWatering(bool chronoCallbacks = true); + + ~PeaPodModuleWatering(); + }; +} + +// #include + +#endif \ No newline at end of file diff --git a/software/microcontroller/test/test_0_blink/test_0_blink.cc b/software/microcontroller/test/test_0_blink/test_0_blink.cc new file mode 100644 index 00000000..e22285cc --- /dev/null +++ b/software/microcontroller/test/test_0_blink/test_0_blink.cc @@ -0,0 +1,39 @@ +#include +#include + +void test_led_builtin_pin_number(void) { + TEST_ASSERT_EQUAL(13, LED_BUILTIN); +} + +void test_led_state_high(void) { + digitalWrite(LED_BUILTIN, HIGH); + TEST_ASSERT_EQUAL(HIGH, digitalRead(LED_BUILTIN)); +} + +void test_led_state_low(void) { + digitalWrite(LED_BUILTIN, LOW); + TEST_ASSERT_EQUAL(LOW, digitalRead(LED_BUILTIN)); +} + +void setup() { + delay(2000); + + UNITY_BEGIN(); + RUN_TEST(test_led_builtin_pin_number); + + pinMode(LED_BUILTIN, OUTPUT); +} + +uint8_t i = 0; + +void loop() { + if (i < 3) { + RUN_TEST(test_led_state_high); + delay(500); + RUN_TEST(test_led_state_low); + delay(500); + i++; + } else { + UNITY_END(); + } +} \ No newline at end of file diff --git a/software/microcontroller/test/test_1_module_air/test_1_module_air.cc b/software/microcontroller/test/test_1_module_air/test_1_module_air.cc new file mode 100644 index 00000000..d2d61a16 --- /dev/null +++ b/software/microcontroller/test/test_1_module_air/test_1_module_air.cc @@ -0,0 +1,116 @@ +#include +#include + +#include + +#include +#include + +using namespace I2CIP; + +bool run_temperature = false; +void callback_run_temperature() { run_temperature = true; } + +bool run_co2 = false; +void callback_run_co2() { run_co2 = true; } + +void test_eeprom_ping(void) { + EEPROM& eeprom = (I2CIP::modules[PEAPOD_MODULENUM_AIR]->operator EEPROM &()); + i2cip_fqa_t eeprom_fqa = eeprom.getFQA(); + + char msg[30]; + sprintf(msg, "Device unreachable (%01X.%01X.%01X.%02X)", I2CIP_FQA_SEG_I2CBUS(eeprom_fqa), I2CIP_FQA_SEG_MODULE(eeprom_fqa), I2CIP_FQA_SEG_MUXBUS(eeprom_fqa), I2CIP_FQA_SEG_DEVADR(eeprom_fqa)); + + i2cip_errorlevel_t result = eeprom.ping(true, true); + TEST_ASSERT_EQUAL_UINT8_MESSAGE(I2CIP_ERR_NONE, result, msg); +} + +void test_eeprom_overwrite(void) { + EEPROM& eeprom = (I2CIP::modules[PEAPOD_MODULENUM_AIR]->operator EEPROM &()); + + i2cip_errorlevel_t result = I2CIP_ERR_NONE; + const char* msg = PEAPOD_MODULE_AIR_EEPROM_CONTENTS; + size_t len = strlen(msg); + + result = eeprom.getOutput()->set(&msg, &len); + TEST_ASSERT_EQUAL_UINT8_MESSAGE(I2CIP_ERR_NONE, result, "EEPROM Output Setter (Default Value, Args)"); + + result = eeprom.getInput()->get(nullptr); + TEST_ASSERT_EQUAL_UINT8_MESSAGE(I2CIP_ERR_NONE, result, "EEPROM Input Getter (Default Args)"); + + const char* cache = eeprom.getCache(); + TEST_ASSERT_EQUAL_STRING_MESSAGE(msg, cache, "EEPROM Cache (Match)"); +} + +void test_module_check(void) { + i2cip_errorlevel_t errlev = I2CIP::modules[PEAPOD_MODULENUM_AIR]->operator()(); + TEST_ASSERT_EQUAL_UINT8_MESSAGE(I2CIP_ERR_NONE, errlev, "Module Check"); +} + +void test_devicegroups(void) { + // SHT45 + DeviceGroup* dg_sht45 = I2CIP::modules[PEAPOD_MODULENUM_AIR]->operator[]("SHT45"); + TEST_ASSERT_NOT_NULL_MESSAGE(dg_sht45, "SHT45 Device Group (Exists)"); + TEST_ASSERT_NOT_EQUAL_MESSAGE(0, dg_sht45->getNumDevices(), "SHT45 Device Group (Non-Empty)"); + TEST_ASSERT_NOT_NULL_MESSAGE(dg_sht45->getDevice(0), "SHT45 Device Group (Valid Device)"); + + // K30 + DeviceGroup* dg_k30 = I2CIP::modules[PEAPOD_MODULENUM_AIR]->operator[]("K30"); + TEST_ASSERT_NOT_NULL_MESSAGE(dg_k30, "K30 Device Group (Exists)"); + TEST_ASSERT_NOT_EQUAL_MESSAGE(0, dg_k30->getNumDevices(), "K30 Device Group (Non-Empty)"); + TEST_ASSERT_NOT_NULL_MESSAGE(dg_k30->getDevice(0), "K30 Device Group (Valid Device)"); +} + +void test_sht45_mean(void) { + run_temperature = false; + PeaPod::PeaPodModuleAir::callback_sht45_mean(); + TEST_ASSERT_TRUE_MESSAGE(run_temperature, "SHT45 Temperature Callback Execution"); +} + +void test_k30_mean(void) { + run_co2 = false; + PeaPod::PeaPodModuleAir::callback_k30_mean(); + TEST_ASSERT_TRUE_MESSAGE(run_co2, "K30 Mean Callback Execution"); +} + +void test_sevenseg(void) { + i2cip_ht16k33_mode_t seg_mode = SEG_ASCII; + i2cip_ht16k33_data_t seg_data = { .h = ('T') + ('E' << 8) + ('S' << 16) + ('T' << 24) }; + i2cip_args_io_t seg_args = { .g = false, .a = nullptr, .s = &seg_data, .b = &seg_mode }; + i2cip_errorlevel_t errlev = I2CIP::modules[PEAPOD_MODULENUM_AIR]->operator()(I2CIP::sevenSegmentFQA, true, seg_args); + TEST_ASSERT_EQUAL_UINT8_MESSAGE(I2CIP_ERR_NONE, errlev, "7-Segment Display"); +} + +void setup() { + Serial.begin(115200); + + I2CIP::modules[PEAPOD_MODULENUM_AIR] = new PeaPod::PeaPodModuleAir(false); + + PeaPod::air_temperature.addConditional(FSM::CMP_NEQ, FSM::notanumber, callback_run_temperature); + PeaPod::air_co2.addConditional(FSM::CMP_NEQ, FSM::notanumber, callback_run_co2); + + delay(2000); + + UNITY_BEGIN(); + + delay(1000); + RUN_TEST(test_eeprom_ping); + delay(1000); + RUN_TEST(test_eeprom_overwrite); + delay(1000); + RUN_TEST(test_module_check); + delay(1000); + RUN_TEST(test_devicegroups); + delay(1000); + RUN_TEST(test_sht45_mean); + delay(1000); + RUN_TEST(test_k30_mean); + delay(1000); + RUN_TEST(test_sevenseg); + + UNITY_END(); +} + +void loop() { + +} \ No newline at end of file diff --git a/software/microcontroller/test/test_2_module_water/test_2_module_water.cc b/software/microcontroller/test/test_2_module_water/test_2_module_water.cc new file mode 100644 index 00000000..a121d968 --- /dev/null +++ b/software/microcontroller/test/test_2_module_water/test_2_module_water.cc @@ -0,0 +1,77 @@ +#include +#include + +#include + +#include +#include + +using namespace I2CIP; + +void test_eeprom_ping(void) { + EEPROM& eeprom = (I2CIP::modules[PEAPOD_MODULENUM_WATERING]->operator EEPROM &()); + i2cip_fqa_t eeprom_fqa = eeprom.getFQA(); + + char msg[30]; + sprintf(msg, "Device unreachable (%01X.%01X.%01X.%02X)", I2CIP_FQA_SEG_I2CBUS(eeprom_fqa), I2CIP_FQA_SEG_MODULE(eeprom_fqa), I2CIP_FQA_SEG_MUXBUS(eeprom_fqa), I2CIP_FQA_SEG_DEVADR(eeprom_fqa)); + + i2cip_errorlevel_t result = eeprom.ping(true, true); + TEST_ASSERT_EQUAL_UINT8_MESSAGE(I2CIP_ERR_NONE, result, msg); +} + +void test_eeprom_overwrite(void) { + EEPROM& eeprom = (I2CIP::modules[PEAPOD_MODULENUM_WATERING]->operator EEPROM &()); + + i2cip_errorlevel_t result = I2CIP_ERR_NONE; + const char* msg = PEAPOD_MODULE_WATERING_EEPROM_CONTENTS; + size_t len = strlen(msg); + + result = eeprom.getOutput()->set(&msg, &len); + TEST_ASSERT_EQUAL_UINT8_MESSAGE(I2CIP_ERR_NONE, result, "EEPROM Output Setter (Default Value, Args)"); + + result = eeprom.getInput()->get(nullptr); + TEST_ASSERT_EQUAL_UINT8_MESSAGE(I2CIP_ERR_NONE, result, "EEPROM Input Getter (Default Args)"); + + const char* cache = eeprom.getCache(); + TEST_ASSERT_EQUAL_STRING_MESSAGE(msg, cache, "EEPROM Cache (Match)"); +} + +void test_module_check(void) { + i2cip_errorlevel_t errlev = I2CIP::modules[PEAPOD_MODULENUM_WATERING]->operator()(); + TEST_ASSERT_EQUAL_UINT8_MESSAGE(I2CIP_ERR_NONE, errlev, "Module Check"); +} + +void test_devicegroups(void) { + // MCP23017 + DeviceGroup* dg_gpio = I2CIP::modules[PEAPOD_MODULENUM_WATERING]->operator[]("MCP23017"); + TEST_ASSERT_NOT_NULL_MESSAGE(dg_gpio, "MCP23017 Device Group (Exists)"); + TEST_ASSERT_NOT_EQUAL_MESSAGE(0, dg_gpio->getNumDevices(), "MCP23017 Device Group (Non-Empty)"); + TEST_ASSERT_NOT_NULL_MESSAGE(dg_gpio->getDevice(0), "MCP23017 Device Group (Valid Device)"); +} + +void setup() { + Serial.begin(115200); + + I2CIP::modules[PEAPOD_MODULENUM_WATERING] = new PeaPod::PeaPodModuleWatering(false); + + delay(2000); + + UNITY_BEGIN(); + + delay(1000); + RUN_TEST(test_eeprom_ping); + delay(1000); + RUN_TEST(test_eeprom_overwrite); + delay(1000); + RUN_TEST(test_module_check); + delay(1000); + RUN_TEST(test_devicegroups); + + // TODO: More tests + + UNITY_END(); +} + +void loop() { + +} \ No newline at end of file diff --git a/software/microcontroller/test/test_3_module_light/test_3_module_light.cc b/software/microcontroller/test/test_3_module_light/test_3_module_light.cc new file mode 100644 index 00000000..540b8ca9 --- /dev/null +++ b/software/microcontroller/test/test_3_module_light/test_3_module_light.cc @@ -0,0 +1,77 @@ +#include +#include + +#include + +#include +#include + +using namespace I2CIP; + +void test_eeprom_ping(void) { + EEPROM& eeprom = (I2CIP::modules[PEAPOD_MODULENUM_LIGHTING]->operator EEPROM &()); + i2cip_fqa_t eeprom_fqa = eeprom.getFQA(); + + char msg[30]; + sprintf(msg, "Device unreachable (%01X.%01X.%01X.%02X)", I2CIP_FQA_SEG_I2CBUS(eeprom_fqa), I2CIP_FQA_SEG_MODULE(eeprom_fqa), I2CIP_FQA_SEG_MUXBUS(eeprom_fqa), I2CIP_FQA_SEG_DEVADR(eeprom_fqa)); + + i2cip_errorlevel_t result = eeprom.ping(true, true); + TEST_ASSERT_EQUAL_UINT8_MESSAGE(I2CIP_ERR_NONE, result, msg); +} + +void test_eeprom_overwrite(void) { + EEPROM& eeprom = (I2CIP::modules[PEAPOD_MODULENUM_LIGHTING]->operator EEPROM &()); + + i2cip_errorlevel_t result = I2CIP_ERR_NONE; + const char* msg = PEAPOD_MODULE_LIGHTING_EEPROM_CONTENTS; + size_t len = strlen(msg); + + result = eeprom.getOutput()->set(&msg, &len); + TEST_ASSERT_EQUAL_UINT8_MESSAGE(I2CIP_ERR_NONE, result, "EEPROM Output Setter (Default Value, Args)"); + + result = eeprom.getInput()->get(nullptr); + TEST_ASSERT_EQUAL_UINT8_MESSAGE(I2CIP_ERR_NONE, result, "EEPROM Input Getter (Default Args)"); + + const char* cache = eeprom.getCache(); + TEST_ASSERT_EQUAL_STRING_MESSAGE(msg, cache, "EEPROM Cache (Match)"); +} + +void test_module_check(void) { + i2cip_errorlevel_t errlev = I2CIP::modules[PEAPOD_MODULENUM_LIGHTING]->operator()(); + TEST_ASSERT_EQUAL_UINT8_MESSAGE(I2CIP_ERR_NONE, errlev, "Module Check"); +} + +void test_devicegroups(void) { + // PCA9685 + DeviceGroup* dg_pwm = I2CIP::modules[PEAPOD_MODULENUM_LIGHTING]->operator[]("PCA9685"); + TEST_ASSERT_NOT_NULL_MESSAGE(dg_pwm, "PCA9685 Device Group (Exists)"); + TEST_ASSERT_NOT_EQUAL_MESSAGE(0, dg_pwm->getNumDevices(), "PCA9685 Device Group (Non-Empty)"); + TEST_ASSERT_NOT_NULL_MESSAGE(dg_pwm->getDevice(0), "PCA9685 Device Group (Valid Device)"); +} + +void setup() { + Serial.begin(115200); + + I2CIP::modules[PEAPOD_MODULENUM_LIGHTING] = new PeaPod::PeaPodModuleLighting(false); + + delay(2000); + + UNITY_BEGIN(); + + delay(1000); + RUN_TEST(test_eeprom_ping); + delay(1000); + RUN_TEST(test_eeprom_overwrite); + delay(1000); + RUN_TEST(test_module_check); + delay(1000); + RUN_TEST(test_devicegroups); + + // TODO: More tests + + UNITY_END(); +} + +void loop() { + +} \ No newline at end of file diff --git a/software/next.config.ts b/software/next.config.ts new file mode 100644 index 00000000..6e562a14 --- /dev/null +++ b/software/next.config.ts @@ -0,0 +1,16 @@ +import type { NextConfig } from 'next'; + +console.log('Using next.config.ts with Node Version:', process.version); + +const nextConfig: NextConfig = { + /* config options here */ + typescript: { + tsconfigPath: './next.tsconfig.json', + }, + eslint: { + ignoreDuringBuilds: true, + }, + output: 'standalone', +}; + +export default nextConfig; diff --git a/software/next.tsconfig.json b/software/next.tsconfig.json new file mode 100644 index 00000000..2dc4b632 --- /dev/null +++ b/software/next.tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "target": "ES2017", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "strict": true, + "noEmit": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve", + "incremental": true, + "plugins": [ + { + "name": "next" + }, + ], + "paths": { + "@/*": ["./src/*"], + "$/*": ["./api/*"] + }, + }, + "include": ["next-env.d.ts", "./src/**/*.ts", "./src/**/*.tsx", ".next/types/**/*.ts"], + "exclude": ["./node_modules/**", "./api/**", "./lib/**", "serialport"] +} diff --git a/software/nginx.conf b/software/nginx.conf new file mode 100644 index 00000000..e16eae20 --- /dev/null +++ b/software/nginx.conf @@ -0,0 +1,30 @@ +events { + worker_connections 1024; +} + +http { + upstream peapod { + server peapodos:3000; + } + + server { + listen 80; + server_name localhost; + + location / { + proxy_pass http://peapod; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_cache_bypass $http_upgrade; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + + location /public/ { + alias /usr/share/nginx/html/; + expires 30d; + } + } +} \ No newline at end of file diff --git a/software/package-lock.json b/software/package-lock.json deleted file mode 100644 index aa6d80d0..00000000 --- a/software/package-lock.json +++ /dev/null @@ -1,4607 +0,0 @@ -{ - "name": "@peapodtech/peapodos", - "version": "0.0.8", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "@peapodtech/peapodos", - "version": "0.0.8", - "license": "MIT", - "dependencies": { - "@peapodtech/firebasedeviceflow": "^0.2.0", - "@types/yargs": "^16.0.0", - "chalk": "^4.1.0", - "dotenv": "^10.0.0", - "firebase": "^9.3.0", - "jsonwebtoken": "^8.5.1", - "mqtt": "^4.2.8", - "ora": "^5.3.0", - "pi-camera": "^1.6.0", - "rxjs": "^6.6.3", - "serialport": "^9.0.6", - "uuid": "^8.3.2", - "wrtc": "^0.4.7", - "yargs": "^16.2.0" - }, - "bin": { - "peapodos": "index.js" - }, - "devDependencies": { - "@serialport/parser-readline": "^9.0.1", - "@types/jsonwebtoken": "^8.5.5", - "@types/pi-camera": "^1.5.3", - "@types/project-name-generator": "^2.1.0", - "@types/serialport": "^8.0.2", - "@types/uuid": "^8.3.0" - } - }, - "node_modules/@firebase/analytics": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.7.4.tgz", - "integrity": "sha512-AU3XMwHW7SFGCNeUKKNW2wXGTdmS164ackt/Epu2bDXCT1OcauPE1AVd+ofULSIDCaDUAQVmvw3JrobgogEU7Q==", - "dependencies": { - "@firebase/component": "0.5.9", - "@firebase/installations": "0.5.4", - "@firebase/logger": "0.3.2", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app": "0.x" - } - }, - "node_modules/@firebase/analytics-compat": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/@firebase/analytics-compat/-/analytics-compat-0.1.5.tgz", - "integrity": "sha512-5cfr0uWwlhoHQYAr6UtQCHwnGjs/3J/bWrfA3INNtzaN4/tTTLTD02iobbccRcM7dM5TR0sZFWS5orfAU3OBFg==", - "dependencies": { - "@firebase/analytics": "0.7.4", - "@firebase/analytics-types": "0.7.0", - "@firebase/component": "0.5.9", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app-compat": "0.x" - } - }, - "node_modules/@firebase/analytics-types": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@firebase/analytics-types/-/analytics-types-0.7.0.tgz", - "integrity": "sha512-DNE2Waiwy5+zZnCfintkDtBfaW6MjIG883474v6Z0K1XZIvl76cLND4iv0YUb48leyF+PJK1KO2XrgHb/KpmhQ==" - }, - "node_modules/@firebase/app": { - "version": "0.7.7", - "resolved": "https://registry.npmjs.org/@firebase/app/-/app-0.7.7.tgz", - "integrity": "sha512-3yEJDg814CnYIODgLCr4vrIP5Of78WDdikJVE5LS7MN1MWDFeJpQ4n88BdjO2X4Dp22+UFkw7FiuduwfUJJYYQ==", - "dependencies": { - "@firebase/component": "0.5.9", - "@firebase/logger": "0.3.2", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - } - }, - "node_modules/@firebase/app-check": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/@firebase/app-check/-/app-check-0.5.1.tgz", - "integrity": "sha512-5TYzIM7lhvxt8kB98iULOCrRgI8/qu7LEdsJNm8jEymk3x4DBL3lK0oRw5nHbyUy+lK7cq9D1NmZZnLA3Snt4w==", - "dependencies": { - "@firebase/component": "0.5.9", - "@firebase/logger": "0.3.2", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app": "0.x" - } - }, - "node_modules/@firebase/app-check-compat": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@firebase/app-check-compat/-/app-check-compat-0.2.1.tgz", - "integrity": "sha512-nB34OoU0icJM0iVrSf7oRVVzrceSvKYdcwlqitrN9JaB+36KwQ0FiQ4saI/rE4DLjcNsviV2ojJ/PRPdv+P0QQ==", - "dependencies": { - "@firebase/app-check": "0.5.1", - "@firebase/component": "0.5.9", - "@firebase/logger": "0.3.2", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app-compat": "0.x" - } - }, - "node_modules/@firebase/app-check-interop-types": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@firebase/app-check-interop-types/-/app-check-interop-types-0.1.0.tgz", - "integrity": "sha512-uZfn9s4uuRsaX5Lwx+gFP3B6YsyOKUE+Rqa6z9ojT4VSRAsZFko9FRn6OxQUA1z5t5d08fY4pf+/+Dkd5wbdbA==" - }, - "node_modules/@firebase/app-compat": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/@firebase/app-compat/-/app-compat-0.1.8.tgz", - "integrity": "sha512-tDjJOoCHYXdswyci0UAPV9vMWp2Guxm8B2jw2A+A1DEcMBcL2z3dDp1JnAwFNbqvE9JHuMBVfEKq/fO0GgDXOg==", - "dependencies": { - "@firebase/app": "0.7.7", - "@firebase/component": "0.5.9", - "@firebase/logger": "0.3.2", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - } - }, - "node_modules/@firebase/app-types": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.7.0.tgz", - "integrity": "sha512-6fbHQwDv2jp/v6bXhBw2eSRbNBpxHcd1NBF864UksSMVIqIyri9qpJB1Mn6sGZE+bnDsSQBC5j2TbMxYsJQkQg==" - }, - "node_modules/@firebase/auth": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@firebase/auth/-/auth-0.19.2.tgz", - "integrity": "sha512-TH6v+wi3cHNdcshAjaWsAPYw/JmY5MYU8xCtZMQQaJdf+c/X+uCWv23s7Xs1fzda5+jecjVmENoXa+i/Onxeeg==", - "dependencies": { - "@firebase/component": "0.5.9", - "@firebase/logger": "0.3.2", - "@firebase/util": "1.4.2", - "node-fetch": "2.6.5", - "selenium-webdriver": "4.0.0-rc-1", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app": "0.x" - } - }, - "node_modules/@firebase/auth-compat": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/@firebase/auth-compat/-/auth-compat-0.2.2.tgz", - "integrity": "sha512-ywYVs/GdBGHTfIKh65IHkge9kyUqOBd24jCI1mmUeQjO3ChVZfdOJk2JvhegLwaRnPYiuzzrWo7wp87YXVL+TQ==", - "dependencies": { - "@firebase/auth": "0.19.2", - "@firebase/auth-types": "0.11.0", - "@firebase/component": "0.5.9", - "@firebase/util": "1.4.2", - "node-fetch": "2.6.5", - "selenium-webdriver": "^4.0.0-beta.2", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app-compat": "0.x" - } - }, - "node_modules/@firebase/auth-interop-types": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/@firebase/auth-interop-types/-/auth-interop-types-0.1.6.tgz", - "integrity": "sha512-etIi92fW3CctsmR9e3sYM3Uqnoq861M0Id9mdOPF6PWIg38BXL5k4upCNBggGUpLIS0H1grMOvy/wn1xymwe2g==", - "peerDependencies": { - "@firebase/app-types": "0.x", - "@firebase/util": "1.x" - } - }, - "node_modules/@firebase/auth-types": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@firebase/auth-types/-/auth-types-0.11.0.tgz", - "integrity": "sha512-q7Bt6cx+ySj9elQHTsKulwk3+qDezhzRBFC9zlQ1BjgMueUOnGMcvqmU0zuKlQ4RhLSH7MNAdBV2znVaoN3Vxw==", - "peerDependencies": { - "@firebase/app-types": "0.x", - "@firebase/util": "1.x" - } - }, - "node_modules/@firebase/component": { - "version": "0.5.9", - "resolved": "https://registry.npmjs.org/@firebase/component/-/component-0.5.9.tgz", - "integrity": "sha512-oLCY3x9WbM5rn06qmUvbtJuPj4dIw/C9T4Th52IiHF5tiCRC5k6YthvhfUVcTwfoUhK0fOgtwuKJKA/LpCPjgA==", - "dependencies": { - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - } - }, - "node_modules/@firebase/database": { - "version": "0.12.4", - "resolved": "https://registry.npmjs.org/@firebase/database/-/database-0.12.4.tgz", - "integrity": "sha512-XkrL1kXELRNkqKcltuT4hfG1gWmFiGvjFY+z7Lhb//12MqdkLjwa9YMK8c6Lo+Ro+IkWcJArQaOQYe3GkU5Wgg==", - "dependencies": { - "@firebase/auth-interop-types": "0.1.6", - "@firebase/component": "0.5.9", - "@firebase/logger": "0.3.2", - "@firebase/util": "1.4.2", - "faye-websocket": "0.11.4", - "tslib": "^2.1.0" - } - }, - "node_modules/@firebase/database-compat": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@firebase/database-compat/-/database-compat-0.1.4.tgz", - "integrity": "sha512-dIJiZLDFF3U+MoEwoPBy7zxWmBUro1KefmwSHlpOoxmPv76tuoPm85NumpW/HmMrtTcTkC2qowtb6NjGE8X7mw==", - "dependencies": { - "@firebase/component": "0.5.9", - "@firebase/database": "0.12.4", - "@firebase/database-types": "0.9.3", - "@firebase/logger": "0.3.2", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app-compat": "0.x" - } - }, - "node_modules/@firebase/database-types": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/@firebase/database-types/-/database-types-0.9.3.tgz", - "integrity": "sha512-R+YXLWy/Q7mNUxiUYiMboTwvVoprrgfyvf1Viyevskw6IoH1q8HV1UjlkLSgmRsOT9HPWt7XZUEStVZJFknHwg==", - "dependencies": { - "@firebase/app-types": "0.7.0", - "@firebase/util": "1.4.2" - } - }, - "node_modules/@firebase/firestore": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@firebase/firestore/-/firestore-3.3.0.tgz", - "integrity": "sha512-QMCwmBlUUFldszKtVqIlqwjZYY0eODI2R7F9lkPxiANw8F853bSyBY6wqN85657vfDS7Ij6i6s+1qWMCqFvHHA==", - "dependencies": { - "@firebase/component": "0.5.9", - "@firebase/logger": "0.3.2", - "@firebase/util": "1.4.2", - "@firebase/webchannel-wrapper": "0.6.1", - "@grpc/grpc-js": "^1.3.2", - "@grpc/proto-loader": "^0.6.0", - "node-fetch": "2.6.5", - "tslib": "^2.1.0" - }, - "engines": { - "node": ">=10.10.0" - }, - "peerDependencies": { - "@firebase/app": "0.x" - } - }, - "node_modules/@firebase/firestore-compat": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/@firebase/firestore-compat/-/firestore-compat-0.1.7.tgz", - "integrity": "sha512-34n9PxdenKRNqZRrr+SfjAcrPUvbfggLnRrADz7iVFYlDo9X1Jj6+fimzo0xC/p+2KZkPAiRYbT60WhjBLYUcg==", - "dependencies": { - "@firebase/component": "0.5.9", - "@firebase/firestore": "3.3.0", - "@firebase/firestore-types": "2.5.0", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app-compat": "0.x" - } - }, - "node_modules/@firebase/firestore-types": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@firebase/firestore-types/-/firestore-types-2.5.0.tgz", - "integrity": "sha512-I6c2m1zUhZ5SH0cWPmINabDyH5w0PPFHk2UHsjBpKdZllzJZ2TwTkXbDtpHUZNmnc/zAa0WNMNMvcvbb/xJLKA==", - "peerDependencies": { - "@firebase/app-types": "0.x", - "@firebase/util": "1.x" - } - }, - "node_modules/@firebase/functions": { - "version": "0.7.5", - "resolved": "https://registry.npmjs.org/@firebase/functions/-/functions-0.7.5.tgz", - "integrity": "sha512-eEA8WhvNqahbepl0DF1vPc8Ml8oPMkDUQr+HQFQSqVvhYaGc1r6yP+Xe5QChifGfrAd5s/AanchNDvkS86Dg9g==", - "dependencies": { - "@firebase/app-check-interop-types": "0.1.0", - "@firebase/auth-interop-types": "0.1.6", - "@firebase/component": "0.5.9", - "@firebase/messaging-interop-types": "0.1.0", - "@firebase/util": "1.4.2", - "node-fetch": "2.6.5", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app": "0.x" - } - }, - "node_modules/@firebase/functions-compat": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/@firebase/functions-compat/-/functions-compat-0.1.6.tgz", - "integrity": "sha512-YZZmToY5Psp0fH8IMdqb00RXsI+dT/+YHKjNNZ1mO/MQS1Uwk40rqaOwZa00xYVeiEyfMnT2ciXyHPEYD7nxPQ==", - "dependencies": { - "@firebase/component": "0.5.9", - "@firebase/functions": "0.7.5", - "@firebase/functions-types": "0.5.0", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app-compat": "0.x" - } - }, - "node_modules/@firebase/functions-types": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@firebase/functions-types/-/functions-types-0.5.0.tgz", - "integrity": "sha512-qza0M5EwX+Ocrl1cYI14zoipUX4gI/Shwqv0C1nB864INAD42Dgv4v94BCyxGHBg2kzlWy8PNafdP7zPO8aJQA==" - }, - "node_modules/@firebase/installations": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/@firebase/installations/-/installations-0.5.4.tgz", - "integrity": "sha512-rYb6Ju/tIBhojmM8FsgS96pErKl6gPgJFnffMO4bKH7HilXhOfgLfKU9k51ZDcps8N0npDx9+AJJ6pL1aYuYZQ==", - "dependencies": { - "@firebase/component": "0.5.9", - "@firebase/util": "1.4.2", - "idb": "3.0.2", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app": "0.x" - } - }, - "node_modules/@firebase/logger": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@firebase/logger/-/logger-0.3.2.tgz", - "integrity": "sha512-lzLrcJp9QBWpo40OcOM9B8QEtBw2Fk1zOZQdvv+rWS6gKmhQBCEMc4SMABQfWdjsylBcDfniD1Q+fUX1dcBTXA==", - "dependencies": { - "tslib": "^2.1.0" - } - }, - "node_modules/@firebase/messaging": { - "version": "0.9.4", - "resolved": "https://registry.npmjs.org/@firebase/messaging/-/messaging-0.9.4.tgz", - "integrity": "sha512-OvYV4MLPfDpdP/yltLqZXZRx6rXWz52bEilS2jL2B4sGiuTaXSkR6BIHB54EPTblu32nbyZYdlER4fssz4TfXw==", - "dependencies": { - "@firebase/component": "0.5.9", - "@firebase/installations": "0.5.4", - "@firebase/messaging-interop-types": "0.1.0", - "@firebase/util": "1.4.2", - "idb": "3.0.2", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app": "0.x" - } - }, - "node_modules/@firebase/messaging-compat": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@firebase/messaging-compat/-/messaging-compat-0.1.4.tgz", - "integrity": "sha512-6477jBw7w7hk0uhnTUMsPoukalpcwbxTTo9kMguHVSXe0t3OdoxeXEaapaNJlOmU4Kgc8j3rsms8IDLdKVpvlA==", - "dependencies": { - "@firebase/component": "0.5.9", - "@firebase/messaging": "0.9.4", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app-compat": "0.x" - } - }, - "node_modules/@firebase/messaging-interop-types": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@firebase/messaging-interop-types/-/messaging-interop-types-0.1.0.tgz", - "integrity": "sha512-DbvUl/rXAZpQeKBnwz0NYY5OCqr2nFA0Bj28Fmr3NXGqR4PAkfTOHuQlVtLO1Nudo3q0HxAYLa68ZDAcuv2uKQ==" - }, - "node_modules/@firebase/performance": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/@firebase/performance/-/performance-0.5.4.tgz", - "integrity": "sha512-ES6aS4eoMhf9CczntBADDsXhaFea/3a0FADwy/VpWXXBxVb8tqc5tPcoTwd9L5M/aDeSiQMy344rhrSsTbIZEg==", - "dependencies": { - "@firebase/component": "0.5.9", - "@firebase/installations": "0.5.4", - "@firebase/logger": "0.3.2", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app": "0.x" - } - }, - "node_modules/@firebase/performance-compat": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@firebase/performance-compat/-/performance-compat-0.1.4.tgz", - "integrity": "sha512-YuGfmpC0o+YvEBlEZCbPdNbT4Nn2qhi5uMXjqKnNIUepmXUsgOYDiAqM9nxHPoE/6IkvoFMdCj5nTUYVLCFXgg==", - "dependencies": { - "@firebase/component": "0.5.9", - "@firebase/logger": "0.3.2", - "@firebase/performance": "0.5.4", - "@firebase/performance-types": "0.1.0", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app-compat": "0.x" - } - }, - "node_modules/@firebase/performance-types": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@firebase/performance-types/-/performance-types-0.1.0.tgz", - "integrity": "sha512-6p1HxrH0mpx+622Ql6fcxFxfkYSBpE3LSuwM7iTtYU2nw91Hj6THC8Bc8z4nboIq7WvgsT/kOTYVVZzCSlXl8w==" - }, - "node_modules/@firebase/polyfill": { - "version": "0.3.36", - "resolved": "https://registry.npmjs.org/@firebase/polyfill/-/polyfill-0.3.36.tgz", - "integrity": "sha512-zMM9oSJgY6cT2jx3Ce9LYqb0eIpDE52meIzd/oe/y70F+v9u1LDqk5kUF5mf16zovGBWMNFmgzlsh6Wj0OsFtg==", - "dependencies": { - "core-js": "3.6.5", - "promise-polyfill": "8.1.3", - "whatwg-fetch": "2.0.4" - } - }, - "node_modules/@firebase/remote-config": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@firebase/remote-config/-/remote-config-0.3.3.tgz", - "integrity": "sha512-9hZWfB3k3IYsjHbWeUfhv/SDCcOgv/JMJpLXlUbTppXPm1IZ3X9ZW4I9bS86gGYr7m/kSv99U0oxQ7N9PoR8Iw==", - "dependencies": { - "@firebase/component": "0.5.9", - "@firebase/installations": "0.5.4", - "@firebase/logger": "0.3.2", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app": "0.x" - } - }, - "node_modules/@firebase/remote-config-compat": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@firebase/remote-config-compat/-/remote-config-compat-0.1.4.tgz", - "integrity": "sha512-6WeKR7E9KJ1RIF9GZiyle1uD4IsIPUBKUnUnFkQhj3FV6cGvQwbeG0rbh7QQLvd0IWuh9lABYjHXWp+rGHQk8A==", - "dependencies": { - "@firebase/component": "0.5.9", - "@firebase/logger": "0.3.2", - "@firebase/remote-config": "0.3.3", - "@firebase/remote-config-types": "0.2.0", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app-compat": "0.x" - } - }, - "node_modules/@firebase/remote-config-types": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@firebase/remote-config-types/-/remote-config-types-0.2.0.tgz", - "integrity": "sha512-hqK5sCPeZvcHQ1D6VjJZdW6EexLTXNMJfPdTwbD8NrXUw6UjWC4KWhLK/TSlL0QPsQtcKRkaaoP+9QCgKfMFPw==" - }, - "node_modules/@firebase/storage": { - "version": "0.8.6", - "resolved": "https://registry.npmjs.org/@firebase/storage/-/storage-0.8.6.tgz", - "integrity": "sha512-ltZinJHC+gvBwmq2MB9phOC5mOBcLE1LkHGjt2LfRyH4SFYdZ6QPwchQfJTvOPKWazsS/y9fud1TliLs7/ZEqQ==", - "dependencies": { - "@firebase/component": "0.5.9", - "@firebase/util": "1.4.2", - "node-fetch": "2.6.5", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app": "0.x" - } - }, - "node_modules/@firebase/storage-compat": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/@firebase/storage-compat/-/storage-compat-0.1.6.tgz", - "integrity": "sha512-4uzrDWAQpJ2wwjDBdWwhmy3F3T4KTV98qHlhXaquX3KRo3VxgZLcNwWYvD4fZwxi66COn2oZb70zMztcNmn7BA==", - "dependencies": { - "@firebase/component": "0.5.9", - "@firebase/storage": "0.8.6", - "@firebase/storage-types": "0.6.0", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app-compat": "0.x" - } - }, - "node_modules/@firebase/storage-types": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@firebase/storage-types/-/storage-types-0.6.0.tgz", - "integrity": "sha512-1LpWhcCb1ftpkP/akhzjzeFxgVefs6eMD2QeKiJJUGH1qOiows2w5o0sKCUSQrvrRQS1lz3SFGvNR1Ck/gqxeA==", - "peerDependencies": { - "@firebase/app-types": "0.x", - "@firebase/util": "1.x" - } - }, - "node_modules/@firebase/util": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/@firebase/util/-/util-1.4.2.tgz", - "integrity": "sha512-JMiUo+9QE9lMBvEtBjqsOFdmJgObFvi7OL1A0uFGwTmlCI1ZeNPOEBrwXkgTOelVCdiMO15mAebtEyxFuQ6FsA==", - "dependencies": { - "tslib": "^2.1.0" - } - }, - "node_modules/@firebase/webchannel-wrapper": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/@firebase/webchannel-wrapper/-/webchannel-wrapper-0.6.1.tgz", - "integrity": "sha512-9FqhNjKQWpQ3fGnSOCovHOm+yhhiorKEqYLAfd525jWavunDJcx8rOW6i6ozAh+FbwcYMkL7b+3j4UR/30MpoQ==" - }, - "node_modules/@grpc/grpc-js": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.4.4.tgz", - "integrity": "sha512-a6222b7Dl6fIlMgzVl7e+NiRoLiZFbpcwvBH2Oli56Bn7W4/3Ld+86hK4ffPn5rx2DlDidmIcvIJiOQXyhv9gA==", - "dependencies": { - "@grpc/proto-loader": "^0.6.4", - "@types/node": ">=12.12.47" - }, - "engines": { - "node": "^8.13.0 || >=10.10.0" - } - }, - "node_modules/@grpc/proto-loader": { - "version": "0.6.6", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.6.6.tgz", - "integrity": "sha512-cdMaPZ8AiFz6ua6PUbP+LKbhwJbFXnrQ/mlnKGUyzDUZ3wp7vPLksnmLCBX6SHgSmjX7CbNVNLFYD5GmmjO4GQ==", - "dependencies": { - "@types/long": "^4.0.1", - "lodash.camelcase": "^4.3.0", - "long": "^4.0.0", - "protobufjs": "^6.10.0", - "yargs": "^16.1.1" - }, - "bin": { - "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@peapodtech/firebasedeviceflow": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@peapodtech/firebasedeviceflow/-/firebasedeviceflow-0.2.0.tgz", - "integrity": "sha512-IOkEZt2P7hcMZX7a7URSvtOu4K3Bw8QhA2REsLHqBLywHkslm1dXx0PCZY12Dk2dBdMdY9iUWAfJtjANPWs5og==", - "dependencies": { - "@types/inquirer": "^7.3.1", - "axios": "^0.21.1", - "chalk": "^4.1.0", - "firebase": "^9.4.0", - "inquirer": "^7.3.3", - "ora": "^5.2.0", - "typescript": "^4.1.3" - } - }, - "node_modules/@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" - }, - "node_modules/@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" - }, - "node_modules/@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" - }, - "node_modules/@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" - }, - "node_modules/@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", - "dependencies": { - "@protobufjs/aspromise": "^1.1.1", - "@protobufjs/inquire": "^1.1.0" - } - }, - "node_modules/@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" - }, - "node_modules/@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" - }, - "node_modules/@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" - }, - "node_modules/@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" - }, - "node_modules/@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" - }, - "node_modules/@serialport/binding-abstract": { - "version": "9.2.3", - "resolved": "https://registry.npmjs.org/@serialport/binding-abstract/-/binding-abstract-9.2.3.tgz", - "integrity": "sha512-cQs9tbIlG3P0IrOWyVirqlhWuJ7Ms2Zh9m2108z6Y5UW/iVj6wEOiW8EmK9QX9jmJXYllE7wgGgvVozP5oCj3w==", - "dependencies": { - "debug": "^4.3.2" - }, - "engines": { - "node": ">=10.0.0" - }, - "funding": { - "url": "https://opencollective.com/serialport/donate" - } - }, - "node_modules/@serialport/binding-mock": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/@serialport/binding-mock/-/binding-mock-9.2.4.tgz", - "integrity": "sha512-dpEhACCs44oQhh6ajJfJdvQdK38Vq0N4W6iD/gdplglDCK7qXRQCMUjJIeKdS/HSEiWkC3bwumUhUufdsOyT4g==", - "dependencies": { - "@serialport/binding-abstract": "9.2.3", - "debug": "^4.3.2" - }, - "engines": { - "node": ">=10.0.0" - }, - "funding": { - "url": "https://opencollective.com/serialport/donate" - } - }, - "node_modules/@serialport/bindings": { - "version": "9.2.5", - "resolved": "https://registry.npmjs.org/@serialport/bindings/-/bindings-9.2.5.tgz", - "integrity": "sha512-fyabNg56gWbOMuYJc5c45z94sANC/WzTnGeML7Nr1IYVk0SJ1uksN4ETI8Nea9ZAtr4DhNiIMQ3/IOkyof6Tqg==", - "hasInstallScript": true, - "dependencies": { - "@serialport/binding-abstract": "9.2.3", - "@serialport/parser-readline": "9.2.4", - "bindings": "^1.5.0", - "debug": "^4.3.2", - "nan": "^2.15.0", - "prebuild-install": "^6.1.4" - }, - "engines": { - "node": ">=10.0.0" - }, - "funding": { - "url": "https://opencollective.com/serialport/donate" - } - }, - "node_modules/@serialport/parser-byte-length": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/@serialport/parser-byte-length/-/parser-byte-length-9.2.4.tgz", - "integrity": "sha512-sQD/iw4ZMU3xW9PLi0/GlvU6Y623jGeWecbMkO7izUo/6P7gtfv1c9ikd5h0kwL8AoAOpQA1lxdHIKox+umBUg==", - "engines": { - "node": ">=10.0.0" - }, - "funding": { - "url": "https://opencollective.com/serialport/donate" - } - }, - "node_modules/@serialport/parser-cctalk": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/@serialport/parser-cctalk/-/parser-cctalk-9.2.4.tgz", - "integrity": "sha512-T4TU5vQMwmo9AB3gQLFDWbfJXlW5jd9guEsB/nqKjFHTv0FXPdZ7DQ2TpSp8RnHWxU3GX6kYTaDO20BKzc8GPQ==", - "engines": { - "node": ">=10.0.0" - }, - "funding": { - "url": "https://opencollective.com/serialport/donate" - } - }, - "node_modules/@serialport/parser-delimiter": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/@serialport/parser-delimiter/-/parser-delimiter-9.2.4.tgz", - "integrity": "sha512-4nvTAoYAgkxFiXrkI+3CA49Yd43CODjeszh89EK+I9c8wOZ+etZduRCzINYPiy26g7zO+GRAb9FoPCsY+sYcbQ==", - "engines": { - "node": ">=10.0.0" - }, - "funding": { - "url": "https://opencollective.com/serialport/donate" - } - }, - "node_modules/@serialport/parser-inter-byte-timeout": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/@serialport/parser-inter-byte-timeout/-/parser-inter-byte-timeout-9.2.4.tgz", - "integrity": "sha512-SOAdvr0oBQIOCXX198hiTlxs4JTKg9j5piapw5tNq52fwDOWdbYrFneT/wN04UTMKaDrJuEvXq6T4rv4j7nJ5A==", - "engines": { - "node": ">=10.0.0" - }, - "funding": { - "url": "https://opencollective.com/serialport/donate" - } - }, - "node_modules/@serialport/parser-readline": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/@serialport/parser-readline/-/parser-readline-9.2.4.tgz", - "integrity": "sha512-Z1/qrZTQUVhNSJP1hd9YfDvq0o7d87rNwAjjRKbVpa7Qi51tG5BnKt43IV3NFMyBlVcRe0rnIb3tJu57E0SOwg==", - "dependencies": { - "@serialport/parser-delimiter": "9.2.4" - }, - "engines": { - "node": ">=10.0.0" - }, - "funding": { - "url": "https://opencollective.com/serialport/donate" - } - }, - "node_modules/@serialport/parser-ready": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/@serialport/parser-ready/-/parser-ready-9.2.4.tgz", - "integrity": "sha512-Pyi94Itjl6qAURwIZr/gmZpMAyTmKXThm6vL5DoAWGQjcRHWB0gwv2TY2v7N+mQLJYUKU3cMnvnATXxHm7xjxw==", - "engines": { - "node": ">=10.0.0" - }, - "funding": { - "url": "https://opencollective.com/serialport/donate" - } - }, - "node_modules/@serialport/parser-regex": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/@serialport/parser-regex/-/parser-regex-9.2.4.tgz", - "integrity": "sha512-sI/cVvPOYz+Dbv4ZdnW16qAwvXiFf/1pGASQdbveRTlgJDdz7sRNlCBifzfTN2xljwvCTZYqiudKvDdC1TepRQ==", - "engines": { - "node": ">=10.0.0" - }, - "funding": { - "url": "https://opencollective.com/serialport/donate" - } - }, - "node_modules/@serialport/stream": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/@serialport/stream/-/stream-9.2.4.tgz", - "integrity": "sha512-bLye8Ub4vUFQGmkh8qEqehr7SE7EJs2yDs0h9jzuL5oKi+F34CFmWkEErO8GAOQ8YNn7p6b3GxUgs+0BrHHDZQ==", - "dependencies": { - "debug": "^4.3.2" - }, - "engines": { - "node": ">=10.0.0" - }, - "funding": { - "url": "https://opencollective.com/serialport/donate" - } - }, - "node_modules/@types/inquirer": { - "version": "7.3.3", - "resolved": "https://registry.npmjs.org/@types/inquirer/-/inquirer-7.3.3.tgz", - "integrity": "sha512-HhxyLejTHMfohAuhRun4csWigAMjXTmRyiJTU1Y/I1xmggikFMkOUoMQRlFm+zQcPEGHSs3io/0FAmNZf8EymQ==", - "dependencies": { - "@types/through": "*", - "rxjs": "^6.4.0" - } - }, - "node_modules/@types/jsonwebtoken": { - "version": "8.5.5", - "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-8.5.5.tgz", - "integrity": "sha512-OGqtHQ7N5/Ap/TUwO6IgHDuLiAoTmHhGpNvgkCm/F4N6pKzx/RBSfr2OXZSwC6vkfnsEdb6+7DNZVtiXiwdwFw==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/long": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz", - "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==" - }, - "node_modules/@types/node": { - "version": "16.11.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.7.tgz", - "integrity": "sha512-QB5D2sqfSjCmTuWcBWyJ+/44bcjO7VbjSbOE0ucoVbAsSNQc4Lt6QkgkVXkTDwkL4z/beecZNDvVX15D4P8Jbw==" - }, - "node_modules/@types/pi-camera": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/@types/pi-camera/-/pi-camera-1.5.3.tgz", - "integrity": "sha512-9CGFEc7Cr0QDWdhqL+Bjb8+0xcYX8L9iv7YlQw+F5ntBh9GwZImDbaeJsFZg76TLGsTMLDTrowfHA7WWMX0csQ==", - "dev": true - }, - "node_modules/@types/project-name-generator": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@types/project-name-generator/-/project-name-generator-2.1.1.tgz", - "integrity": "sha512-VLd5FEVTJs8hNa/WF4pZRcFvv0OAcIGeTyki4RDcaID0TUhTc5/Xe/btYM2XIHwVCb67ila8wUJYKJNa5dVABw==", - "dev": true - }, - "node_modules/@types/serialport": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@types/serialport/-/serialport-8.0.2.tgz", - "integrity": "sha512-z4b1I8/vdZE3upgCcAL9VAWlVVFUVn5uo3faAHavkVfK/Hb1LUxKwp9YCtA5AZqEUCWoSWl20SRTOvAI/5fQWQ==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/through": { - "version": "0.0.30", - "resolved": "https://registry.npmjs.org/@types/through/-/through-0.0.30.tgz", - "integrity": "sha512-FvnCJljyxhPM3gkRgWmxmDZyAQSiBQQWLI0A0VFL0K7W1oRUrPJSqNO0NvTnLkBcotdlp3lKvaT0JrnyRDkzOg==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/uuid": { - "version": "8.3.1", - "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.1.tgz", - "integrity": "sha512-Y2mHTRAbqfFkpjldbkHGY8JIzRN6XqYRliG8/24FcHm2D2PwW24fl5xMRTVGdrb7iMrwCaIEbLWerGIkXuFWVg==", - "dev": true - }, - "node_modules/@types/yargs": { - "version": "16.0.4", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", - "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", - "dependencies": { - "@types/yargs-parser": "*" - } - }, - "node_modules/@types/yargs-parser": { - "version": "20.2.1", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.1.tgz", - "integrity": "sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw==" - }, - "node_modules/ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", - "dependencies": { - "type-fest": "^0.21.3" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" - }, - "node_modules/are-we-there-yet": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", - "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "node_modules/are-we-there-yet/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/are-we-there-yet/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/are-we-there-yet/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "dependencies": { - "follow-redirects": "^1.14.0" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "dependencies": { - "file-uri-to-path": "1.0.0" - } - }, - "node_modules/bl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "node_modules/buffer-equal-constant-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" - }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" - }, - "node_modules/chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" - }, - "node_modules/cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", - "dependencies": { - "restore-cursor": "^3.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cli-spinners": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.1.tgz", - "integrity": "sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==", - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cli-width": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", - "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", - "engines": { - "node": ">= 10" - } - }, - "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "node_modules/clone": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", - "engines": { - "node": ">=0.8" - } - }, - "node_modules/code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "node_modules/commist": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/commist/-/commist-1.1.0.tgz", - "integrity": "sha512-rraC8NXWOEjhADbZe9QBNzLAN5Q3fsTPQtBV+fEVj6xKIgDgNiEVE6ZNfHpZOqfQ21YUzfVNUXLOEZquYvQPPg==", - "dependencies": { - "leven": "^2.1.0", - "minimist": "^1.1.0" - } - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "node_modules/concat-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", - "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", - "engines": [ - "node >= 6.0" - ], - "dependencies": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.0.2", - "typedarray": "^0.0.6" - } - }, - "node_modules/console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" - }, - "node_modules/core-js": { - "version": "3.6.5", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.5.tgz", - "integrity": "sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA==", - "hasInstallScript": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/core-js" - } - }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" - }, - "node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/decompress-response": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", - "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", - "dependencies": { - "mimic-response": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/defaults": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", - "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", - "dependencies": { - "clone": "^1.0.2" - } - }, - "node_modules/delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" - }, - "node_modules/detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", - "bin": { - "detect-libc": "bin/detect-libc.js" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/domexception": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", - "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", - "optional": true, - "dependencies": { - "webidl-conversions": "^4.0.2" - } - }, - "node_modules/domexception/node_modules/webidl-conversions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", - "optional": true - }, - "node_modules/dotenv": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", - "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==", - "engines": { - "node": ">=10" - } - }, - "node_modules/duplexify": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.2.tgz", - "integrity": "sha512-fz3OjcNCHmRP12MJoZMPglx8m4rrFP8rovnk4vT8Fs+aonZoCwGg10dSsQsfP/E62eZcPTMSMP6686fu9Qlqtw==", - "dependencies": { - "end-of-stream": "^1.4.1", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1", - "stream-shift": "^1.0.0" - } - }, - "node_modules/ecdsa-sig-formatter": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", - "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", - "dependencies": { - "safe-buffer": "^5.0.1" - } - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dependencies": { - "once": "^1.4.0" - } - }, - "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "engines": { - "node": ">=6" - } - }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/expand-template": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", - "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", - "engines": { - "node": ">=6" - } - }, - "node_modules/external-editor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", - "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", - "dependencies": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/faye-websocket": { - "version": "0.11.4", - "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz", - "integrity": "sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==", - "dependencies": { - "websocket-driver": ">=0.5.1" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", - "dependencies": { - "escape-string-regexp": "^1.0.5" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" - }, - "node_modules/firebase": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/firebase/-/firebase-9.4.0.tgz", - "integrity": "sha512-VcdMVYf02OZtDWp6IYnlcostwqWZHlumxgnY5K87EKBHIjGcjkpdb39mguXZCVfQ44TRid2yaBouGDKAacnFwQ==", - "dependencies": { - "@firebase/analytics": "0.7.4", - "@firebase/analytics-compat": "0.1.5", - "@firebase/app": "0.7.7", - "@firebase/app-check": "0.5.1", - "@firebase/app-check-compat": "0.2.1", - "@firebase/app-compat": "0.1.8", - "@firebase/app-types": "0.7.0", - "@firebase/auth": "0.19.2", - "@firebase/auth-compat": "0.2.2", - "@firebase/database": "0.12.4", - "@firebase/database-compat": "0.1.4", - "@firebase/firestore": "3.3.0", - "@firebase/firestore-compat": "0.1.7", - "@firebase/functions": "0.7.5", - "@firebase/functions-compat": "0.1.6", - "@firebase/installations": "0.5.4", - "@firebase/messaging": "0.9.4", - "@firebase/messaging-compat": "0.1.4", - "@firebase/performance": "0.5.4", - "@firebase/performance-compat": "0.1.4", - "@firebase/polyfill": "0.3.36", - "@firebase/remote-config": "0.3.3", - "@firebase/remote-config-compat": "0.1.4", - "@firebase/storage": "0.8.6", - "@firebase/storage-compat": "0.1.6", - "@firebase/util": "1.4.2" - } - }, - "node_modules/follow-redirects": { - "version": "1.14.5", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.5.tgz", - "integrity": "sha512-wtphSXy7d4/OR+MvIFbCVBDzZ5520qV8XfPklSN5QtxuMUJZ+b0Wnst1e1lCDocfzuCkHqj8k0FpZqO+UIaKNA==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, - "node_modules/fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "node_modules/gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "dependencies": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "node_modules/gauge/node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/gauge/node_modules/is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dependencies": { - "number-is-nan": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/gauge/node_modules/string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dependencies": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/gauge/node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/github-from-package": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", - "integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=" - }, - "node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" - }, - "node_modules/help-me": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/help-me/-/help-me-3.0.0.tgz", - "integrity": "sha512-hx73jClhyk910sidBB7ERlnhMlFsJJIBqSVMFDwPN8o2v9nmp5KgLq1Xz1Bf1fCMMZ6mPrX159iG0VLy/fPMtQ==", - "dependencies": { - "glob": "^7.1.6", - "readable-stream": "^3.6.0" - } - }, - "node_modules/http-parser-js": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.3.tgz", - "integrity": "sha512-t7hjvef/5HEK7RWTdUzVUhl8zkEu+LlaE0IYzdMuvbSDipxBRpOn4Uhw8ZyECEa808iVT8XCjzo6xmYt4CiLZg==" - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/idb": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/idb/-/idb-3.0.2.tgz", - "integrity": "sha512-+FLa/0sTXqyux0o6C+i2lOR0VoS60LU/jzUo5xjfY6+7sEEgy4Gz1O7yFBXvjd7N0NyIGWIRg8DcQSLEG+VSPw==" - }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/immediate": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", - "integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=" - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" - }, - "node_modules/inquirer": { - "version": "7.3.3", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz", - "integrity": "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==", - "dependencies": { - "ansi-escapes": "^4.2.1", - "chalk": "^4.1.0", - "cli-cursor": "^3.1.0", - "cli-width": "^3.0.0", - "external-editor": "^3.0.3", - "figures": "^3.0.0", - "lodash": "^4.17.19", - "mute-stream": "0.0.8", - "run-async": "^2.4.0", - "rxjs": "^6.6.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0", - "through": "^2.3.6" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-interactive": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", - "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "node_modules/jsonwebtoken": { - "version": "8.5.1", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", - "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==", - "dependencies": { - "jws": "^3.2.2", - "lodash.includes": "^4.3.0", - "lodash.isboolean": "^3.0.3", - "lodash.isinteger": "^4.0.4", - "lodash.isnumber": "^3.0.3", - "lodash.isplainobject": "^4.0.6", - "lodash.isstring": "^4.0.1", - "lodash.once": "^4.0.0", - "ms": "^2.1.1", - "semver": "^5.6.0" - }, - "engines": { - "node": ">=4", - "npm": ">=1.4.28" - } - }, - "node_modules/jsonwebtoken/node_modules/jwa": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", - "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", - "dependencies": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.11", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/jsonwebtoken/node_modules/jws": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", - "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", - "dependencies": { - "jwa": "^1.4.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/jszip": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.7.1.tgz", - "integrity": "sha512-ghL0tz1XG9ZEmRMcEN2vt7xabrDdqHHeykgARpmZ0BiIctWxM47Vt63ZO2dnp4QYt/xJVLLy5Zv1l/xRdh2byg==", - "dependencies": { - "lie": "~3.3.0", - "pako": "~1.0.2", - "readable-stream": "~2.3.6", - "set-immediate-shim": "~1.0.1" - } - }, - "node_modules/jszip/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/jszip/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/jszip/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/leven": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", - "integrity": "sha1-wuep93IJTe6dNCAq6KzORoeHVYA=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/lie": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", - "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", - "dependencies": { - "immediate": "~3.0.5" - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "node_modules/lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=" - }, - "node_modules/lodash.includes": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", - "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=" - }, - "node_modules/lodash.isboolean": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", - "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=" - }, - "node_modules/lodash.isinteger": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", - "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=" - }, - "node_modules/lodash.isnumber": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", - "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=" - }, - "node_modules/lodash.isplainobject": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" - }, - "node_modules/lodash.isstring": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" - }, - "node_modules/lodash.once": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", - "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" - }, - "node_modules/log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - "dependencies": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" - }, - "node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "engines": { - "node": ">=6" - } - }, - "node_modules/mimic-response": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", - "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" - }, - "node_modules/mkdirp-classic": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", - "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" - }, - "node_modules/mqtt": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/mqtt/-/mqtt-4.2.8.tgz", - "integrity": "sha512-DJYjlXODVXtSDecN8jnNzi6ItX3+ufGsEs9OB3YV24HtkRrh7kpx8L5M1LuyF0KzaiGtWr2PzDcMGAY60KGOSA==", - "dependencies": { - "commist": "^1.0.0", - "concat-stream": "^2.0.0", - "debug": "^4.1.1", - "duplexify": "^4.1.1", - "help-me": "^3.0.0", - "inherits": "^2.0.3", - "minimist": "^1.2.5", - "mqtt-packet": "^6.8.0", - "pump": "^3.0.0", - "readable-stream": "^3.6.0", - "reinterval": "^1.1.0", - "split2": "^3.1.0", - "ws": "^7.5.0", - "xtend": "^4.0.2" - }, - "bin": { - "mqtt": "bin/mqtt.js", - "mqtt_pub": "bin/pub.js", - "mqtt_sub": "bin/sub.js" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/mqtt-packet": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/mqtt-packet/-/mqtt-packet-6.10.0.tgz", - "integrity": "sha512-ja8+mFKIHdB1Tpl6vac+sktqy3gA8t9Mduom1BA75cI+R9AHnZOiaBQwpGiWnaVJLDGRdNhQmFaAqd7tkKSMGA==", - "dependencies": { - "bl": "^4.0.2", - "debug": "^4.1.1", - "process-nextick-args": "^2.0.1" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/mute-stream": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", - "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" - }, - "node_modules/nan": { - "version": "2.15.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", - "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==" - }, - "node_modules/napi-build-utils": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", - "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==" - }, - "node_modules/node-abi": { - "version": "2.30.1", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.30.1.tgz", - "integrity": "sha512-/2D0wOQPgaUWzVSVgRMx+trKJRC2UG4SUc4oCJoXx9Uxjtp0Vy3/kt7zcbxHF8+Z/pK3UloLWzBISg72brfy1w==", - "dependencies": { - "semver": "^5.4.1" - } - }, - "node_modules/node-fetch": { - "version": "2.6.5", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz", - "integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - } - }, - "node_modules/npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "dependencies": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "node_modules/number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dependencies": { - "mimic-fn": "^2.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ora": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", - "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", - "dependencies": { - "bl": "^4.1.0", - "chalk": "^4.1.0", - "cli-cursor": "^3.1.0", - "cli-spinners": "^2.5.0", - "is-interactive": "^1.0.0", - "is-unicode-supported": "^0.1.0", - "log-symbols": "^4.1.0", - "strip-ansi": "^6.0.0", - "wcwidth": "^1.0.1" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/pi-camera": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/pi-camera/-/pi-camera-1.6.0.tgz", - "integrity": "sha512-WrnJ4R1X/5qA5/vXeou/Ty97c7urrnla03j5FhctF9nZy1lXnfYkPOsL+qDZAZcvg40cbkTE217WlHNnMMftaw==", - "engines": { - "node": ">=6.10.0" - } - }, - "node_modules/prebuild-install": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-6.1.4.tgz", - "integrity": "sha512-Z4vpywnK1lBg+zdPCVCsKq0xO66eEV9rWo2zrROGGiRS4JtueBOdlB1FnY8lcy7JsUud/Q3ijUxyWN26Ika0vQ==", - "dependencies": { - "detect-libc": "^1.0.3", - "expand-template": "^2.0.3", - "github-from-package": "0.0.0", - "minimist": "^1.2.3", - "mkdirp-classic": "^0.5.3", - "napi-build-utils": "^1.0.1", - "node-abi": "^2.21.0", - "npmlog": "^4.0.1", - "pump": "^3.0.0", - "rc": "^1.2.7", - "simple-get": "^3.0.3", - "tar-fs": "^2.0.0", - "tunnel-agent": "^0.6.0" - }, - "bin": { - "prebuild-install": "bin.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" - }, - "node_modules/promise-polyfill": { - "version": "8.1.3", - "resolved": "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-8.1.3.tgz", - "integrity": "sha512-MG5r82wBzh7pSKDRa9y+vllNHz3e3d4CNj1PQE4BQYxLme0gKYYBm9YENq+UkEikyZ0XbiGWxYlVw3Rl9O/U8g==" - }, - "node_modules/protobufjs": { - "version": "6.11.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.2.tgz", - "integrity": "sha512-4BQJoPooKJl2G9j3XftkIXjoC9C0Av2NOrWmbLWT1vH32GcSUHjM0Arra6UfTsVyfMAuFzaLucXn1sadxJydAw==", - "hasInstallScript": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": ">=13.7.0", - "long": "^4.0.0" - }, - "bin": { - "pbjs": "bin/pbjs", - "pbts": "bin/pbts" - } - }, - "node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "node_modules/rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dependencies": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "bin": { - "rc": "cli.js" - } - }, - "node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/reinterval": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/reinterval/-/reinterval-1.1.0.tgz", - "integrity": "sha1-M2Hs+jymwYKDOA3Qu5VG85D17Oc=" - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", - "dependencies": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/run-async": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", - "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/rxjs": { - "version": "6.6.7", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", - "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", - "dependencies": { - "tslib": "^1.9.0" - }, - "engines": { - "npm": ">=2.0.0" - } - }, - "node_modules/rxjs/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "node_modules/selenium-webdriver": { - "version": "4.0.0-rc-1", - "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.0.0-rc-1.tgz", - "integrity": "sha512-bcrwFPRax8fifRP60p7xkWDGSJJoMkPAzufMlk5K2NyLPht/YZzR2WcIk1+3gR8VOCLlst1P2PI+MXACaFzpIw==", - "dependencies": { - "jszip": "^3.6.0", - "rimraf": "^3.0.2", - "tmp": "^0.2.1", - "ws": ">=7.4.6" - }, - "engines": { - "node": ">= 10.15.0" - } - }, - "node_modules/selenium-webdriver/node_modules/tmp": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", - "dependencies": { - "rimraf": "^3.0.0" - }, - "engines": { - "node": ">=8.17.0" - } - }, - "node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/serialport": { - "version": "9.2.5", - "resolved": "https://registry.npmjs.org/serialport/-/serialport-9.2.5.tgz", - "integrity": "sha512-nsDsD2GN/43T2a8jQYr1HH76gmDZ575Ts8FOdcBRUY8ecaI16BPbXa612cPPkQjOfg28+KL5qtQL9c0vvTaidg==", - "dependencies": { - "@serialport/binding-mock": "9.2.4", - "@serialport/bindings": "9.2.5", - "@serialport/parser-byte-length": "9.2.4", - "@serialport/parser-cctalk": "9.2.4", - "@serialport/parser-delimiter": "9.2.4", - "@serialport/parser-inter-byte-timeout": "9.2.4", - "@serialport/parser-readline": "9.2.4", - "@serialport/parser-ready": "9.2.4", - "@serialport/parser-regex": "9.2.4", - "@serialport/stream": "9.2.4", - "debug": "^4.3.2" - }, - "engines": { - "node": ">=10.0.0" - }, - "funding": { - "url": "https://opencollective.com/serialport/donate" - } - }, - "node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" - }, - "node_modules/set-immediate-shim": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", - "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/signal-exit": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz", - "integrity": "sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ==" - }, - "node_modules/simple-concat": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", - "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/simple-get": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz", - "integrity": "sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA==", - "dependencies": { - "decompress-response": "^4.2.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" - } - }, - "node_modules/split2": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", - "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", - "dependencies": { - "readable-stream": "^3.0.0" - } - }, - "node_modules/stream-shift": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", - "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==" - }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/tar-fs": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", - "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", - "dependencies": { - "chownr": "^1.1.1", - "mkdirp-classic": "^0.5.2", - "pump": "^3.0.0", - "tar-stream": "^2.1.4" - } - }, - "node_modules/tar-stream": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", - "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", - "dependencies": { - "bl": "^4.0.3", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" - }, - "node_modules/tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dependencies": { - "os-tmpdir": "~1.0.2" - }, - "engines": { - "node": ">=0.6.0" - } - }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" - }, - "node_modules/tslib": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", - "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" - }, - "node_modules/tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dependencies": { - "safe-buffer": "^5.0.1" - }, - "engines": { - "node": "*" - } - }, - "node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" - }, - "node_modules/typescript": { - "version": "4.4.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", - "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "node_modules/wcwidth": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", - "dependencies": { - "defaults": "^1.0.3" - } - }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" - }, - "node_modules/websocket-driver": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz", - "integrity": "sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==", - "dependencies": { - "http-parser-js": ">=0.5.1", - "safe-buffer": ">=5.1.0", - "websocket-extensions": ">=0.1.1" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/websocket-extensions": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz", - "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/whatwg-fetch": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz", - "integrity": "sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==" - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "node_modules/wide-align": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", - "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", - "dependencies": { - "string-width": "^1.0.2 || 2 || 3 || 4" - } - }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "node_modules/wrtc": { - "version": "0.4.7", - "resolved": "https://registry.npmjs.org/wrtc/-/wrtc-0.4.7.tgz", - "integrity": "sha512-P6Hn7VT4lfSH49HxLHcHhDq+aFf/jd9dPY7lDHeFhZ22N3858EKuwm2jmnlPzpsRGEPaoF6XwkcxY5SYnt4f/g==", - "bundleDependencies": [ - "node-pre-gyp" - ], - "hasInstallScript": true, - "dependencies": { - "node-pre-gyp": "^0.13.0" - }, - "engines": { - "node": "^8.11.2 || >=10.0.0" - }, - "optionalDependencies": { - "domexception": "^1.0.1" - } - }, - "node_modules/ws": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz", - "integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==", - "engines": { - "node": ">=8.3.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "engines": { - "node": ">=0.4" - } - }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "engines": { - "node": ">=10" - } - } - }, - "dependencies": { - "@firebase/analytics": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.7.4.tgz", - "integrity": "sha512-AU3XMwHW7SFGCNeUKKNW2wXGTdmS164ackt/Epu2bDXCT1OcauPE1AVd+ofULSIDCaDUAQVmvw3JrobgogEU7Q==", - "requires": { - "@firebase/component": "0.5.9", - "@firebase/installations": "0.5.4", - "@firebase/logger": "0.3.2", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - } - }, - "@firebase/analytics-compat": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/@firebase/analytics-compat/-/analytics-compat-0.1.5.tgz", - "integrity": "sha512-5cfr0uWwlhoHQYAr6UtQCHwnGjs/3J/bWrfA3INNtzaN4/tTTLTD02iobbccRcM7dM5TR0sZFWS5orfAU3OBFg==", - "requires": { - "@firebase/analytics": "0.7.4", - "@firebase/analytics-types": "0.7.0", - "@firebase/component": "0.5.9", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - } - }, - "@firebase/analytics-types": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@firebase/analytics-types/-/analytics-types-0.7.0.tgz", - "integrity": "sha512-DNE2Waiwy5+zZnCfintkDtBfaW6MjIG883474v6Z0K1XZIvl76cLND4iv0YUb48leyF+PJK1KO2XrgHb/KpmhQ==" - }, - "@firebase/app": { - "version": "0.7.7", - "resolved": "https://registry.npmjs.org/@firebase/app/-/app-0.7.7.tgz", - "integrity": "sha512-3yEJDg814CnYIODgLCr4vrIP5Of78WDdikJVE5LS7MN1MWDFeJpQ4n88BdjO2X4Dp22+UFkw7FiuduwfUJJYYQ==", - "requires": { - "@firebase/component": "0.5.9", - "@firebase/logger": "0.3.2", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - } - }, - "@firebase/app-check": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/@firebase/app-check/-/app-check-0.5.1.tgz", - "integrity": "sha512-5TYzIM7lhvxt8kB98iULOCrRgI8/qu7LEdsJNm8jEymk3x4DBL3lK0oRw5nHbyUy+lK7cq9D1NmZZnLA3Snt4w==", - "requires": { - "@firebase/component": "0.5.9", - "@firebase/logger": "0.3.2", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - } - }, - "@firebase/app-check-compat": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@firebase/app-check-compat/-/app-check-compat-0.2.1.tgz", - "integrity": "sha512-nB34OoU0icJM0iVrSf7oRVVzrceSvKYdcwlqitrN9JaB+36KwQ0FiQ4saI/rE4DLjcNsviV2ojJ/PRPdv+P0QQ==", - "requires": { - "@firebase/app-check": "0.5.1", - "@firebase/component": "0.5.9", - "@firebase/logger": "0.3.2", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - } - }, - "@firebase/app-check-interop-types": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@firebase/app-check-interop-types/-/app-check-interop-types-0.1.0.tgz", - "integrity": "sha512-uZfn9s4uuRsaX5Lwx+gFP3B6YsyOKUE+Rqa6z9ojT4VSRAsZFko9FRn6OxQUA1z5t5d08fY4pf+/+Dkd5wbdbA==" - }, - "@firebase/app-compat": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/@firebase/app-compat/-/app-compat-0.1.8.tgz", - "integrity": "sha512-tDjJOoCHYXdswyci0UAPV9vMWp2Guxm8B2jw2A+A1DEcMBcL2z3dDp1JnAwFNbqvE9JHuMBVfEKq/fO0GgDXOg==", - "requires": { - "@firebase/app": "0.7.7", - "@firebase/component": "0.5.9", - "@firebase/logger": "0.3.2", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - } - }, - "@firebase/app-types": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.7.0.tgz", - "integrity": "sha512-6fbHQwDv2jp/v6bXhBw2eSRbNBpxHcd1NBF864UksSMVIqIyri9qpJB1Mn6sGZE+bnDsSQBC5j2TbMxYsJQkQg==" - }, - "@firebase/auth": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@firebase/auth/-/auth-0.19.2.tgz", - "integrity": "sha512-TH6v+wi3cHNdcshAjaWsAPYw/JmY5MYU8xCtZMQQaJdf+c/X+uCWv23s7Xs1fzda5+jecjVmENoXa+i/Onxeeg==", - "requires": { - "@firebase/component": "0.5.9", - "@firebase/logger": "0.3.2", - "@firebase/util": "1.4.2", - "node-fetch": "2.6.5", - "selenium-webdriver": "4.0.0-rc-1", - "tslib": "^2.1.0" - } - }, - "@firebase/auth-compat": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/@firebase/auth-compat/-/auth-compat-0.2.2.tgz", - "integrity": "sha512-ywYVs/GdBGHTfIKh65IHkge9kyUqOBd24jCI1mmUeQjO3ChVZfdOJk2JvhegLwaRnPYiuzzrWo7wp87YXVL+TQ==", - "requires": { - "@firebase/auth": "0.19.2", - "@firebase/auth-types": "0.11.0", - "@firebase/component": "0.5.9", - "@firebase/util": "1.4.2", - "node-fetch": "2.6.5", - "selenium-webdriver": "^4.0.0-beta.2", - "tslib": "^2.1.0" - } - }, - "@firebase/auth-interop-types": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/@firebase/auth-interop-types/-/auth-interop-types-0.1.6.tgz", - "integrity": "sha512-etIi92fW3CctsmR9e3sYM3Uqnoq861M0Id9mdOPF6PWIg38BXL5k4upCNBggGUpLIS0H1grMOvy/wn1xymwe2g==", - "requires": {} - }, - "@firebase/auth-types": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@firebase/auth-types/-/auth-types-0.11.0.tgz", - "integrity": "sha512-q7Bt6cx+ySj9elQHTsKulwk3+qDezhzRBFC9zlQ1BjgMueUOnGMcvqmU0zuKlQ4RhLSH7MNAdBV2znVaoN3Vxw==", - "requires": {} - }, - "@firebase/component": { - "version": "0.5.9", - "resolved": "https://registry.npmjs.org/@firebase/component/-/component-0.5.9.tgz", - "integrity": "sha512-oLCY3x9WbM5rn06qmUvbtJuPj4dIw/C9T4Th52IiHF5tiCRC5k6YthvhfUVcTwfoUhK0fOgtwuKJKA/LpCPjgA==", - "requires": { - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - } - }, - "@firebase/database": { - "version": "0.12.4", - "resolved": "https://registry.npmjs.org/@firebase/database/-/database-0.12.4.tgz", - "integrity": "sha512-XkrL1kXELRNkqKcltuT4hfG1gWmFiGvjFY+z7Lhb//12MqdkLjwa9YMK8c6Lo+Ro+IkWcJArQaOQYe3GkU5Wgg==", - "requires": { - "@firebase/auth-interop-types": "0.1.6", - "@firebase/component": "0.5.9", - "@firebase/logger": "0.3.2", - "@firebase/util": "1.4.2", - "faye-websocket": "0.11.4", - "tslib": "^2.1.0" - } - }, - "@firebase/database-compat": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@firebase/database-compat/-/database-compat-0.1.4.tgz", - "integrity": "sha512-dIJiZLDFF3U+MoEwoPBy7zxWmBUro1KefmwSHlpOoxmPv76tuoPm85NumpW/HmMrtTcTkC2qowtb6NjGE8X7mw==", - "requires": { - "@firebase/component": "0.5.9", - "@firebase/database": "0.12.4", - "@firebase/database-types": "0.9.3", - "@firebase/logger": "0.3.2", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - } - }, - "@firebase/database-types": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/@firebase/database-types/-/database-types-0.9.3.tgz", - "integrity": "sha512-R+YXLWy/Q7mNUxiUYiMboTwvVoprrgfyvf1Viyevskw6IoH1q8HV1UjlkLSgmRsOT9HPWt7XZUEStVZJFknHwg==", - "requires": { - "@firebase/app-types": "0.7.0", - "@firebase/util": "1.4.2" - } - }, - "@firebase/firestore": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@firebase/firestore/-/firestore-3.3.0.tgz", - "integrity": "sha512-QMCwmBlUUFldszKtVqIlqwjZYY0eODI2R7F9lkPxiANw8F853bSyBY6wqN85657vfDS7Ij6i6s+1qWMCqFvHHA==", - "requires": { - "@firebase/component": "0.5.9", - "@firebase/logger": "0.3.2", - "@firebase/util": "1.4.2", - "@firebase/webchannel-wrapper": "0.6.1", - "@grpc/grpc-js": "^1.3.2", - "@grpc/proto-loader": "^0.6.0", - "node-fetch": "2.6.5", - "tslib": "^2.1.0" - } - }, - "@firebase/firestore-compat": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/@firebase/firestore-compat/-/firestore-compat-0.1.7.tgz", - "integrity": "sha512-34n9PxdenKRNqZRrr+SfjAcrPUvbfggLnRrADz7iVFYlDo9X1Jj6+fimzo0xC/p+2KZkPAiRYbT60WhjBLYUcg==", - "requires": { - "@firebase/component": "0.5.9", - "@firebase/firestore": "3.3.0", - "@firebase/firestore-types": "2.5.0", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - } - }, - "@firebase/firestore-types": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@firebase/firestore-types/-/firestore-types-2.5.0.tgz", - "integrity": "sha512-I6c2m1zUhZ5SH0cWPmINabDyH5w0PPFHk2UHsjBpKdZllzJZ2TwTkXbDtpHUZNmnc/zAa0WNMNMvcvbb/xJLKA==", - "requires": {} - }, - "@firebase/functions": { - "version": "0.7.5", - "resolved": "https://registry.npmjs.org/@firebase/functions/-/functions-0.7.5.tgz", - "integrity": "sha512-eEA8WhvNqahbepl0DF1vPc8Ml8oPMkDUQr+HQFQSqVvhYaGc1r6yP+Xe5QChifGfrAd5s/AanchNDvkS86Dg9g==", - "requires": { - "@firebase/app-check-interop-types": "0.1.0", - "@firebase/auth-interop-types": "0.1.6", - "@firebase/component": "0.5.9", - "@firebase/messaging-interop-types": "0.1.0", - "@firebase/util": "1.4.2", - "node-fetch": "2.6.5", - "tslib": "^2.1.0" - } - }, - "@firebase/functions-compat": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/@firebase/functions-compat/-/functions-compat-0.1.6.tgz", - "integrity": "sha512-YZZmToY5Psp0fH8IMdqb00RXsI+dT/+YHKjNNZ1mO/MQS1Uwk40rqaOwZa00xYVeiEyfMnT2ciXyHPEYD7nxPQ==", - "requires": { - "@firebase/component": "0.5.9", - "@firebase/functions": "0.7.5", - "@firebase/functions-types": "0.5.0", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - } - }, - "@firebase/functions-types": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@firebase/functions-types/-/functions-types-0.5.0.tgz", - "integrity": "sha512-qza0M5EwX+Ocrl1cYI14zoipUX4gI/Shwqv0C1nB864INAD42Dgv4v94BCyxGHBg2kzlWy8PNafdP7zPO8aJQA==" - }, - "@firebase/installations": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/@firebase/installations/-/installations-0.5.4.tgz", - "integrity": "sha512-rYb6Ju/tIBhojmM8FsgS96pErKl6gPgJFnffMO4bKH7HilXhOfgLfKU9k51ZDcps8N0npDx9+AJJ6pL1aYuYZQ==", - "requires": { - "@firebase/component": "0.5.9", - "@firebase/util": "1.4.2", - "idb": "3.0.2", - "tslib": "^2.1.0" - } - }, - "@firebase/logger": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@firebase/logger/-/logger-0.3.2.tgz", - "integrity": "sha512-lzLrcJp9QBWpo40OcOM9B8QEtBw2Fk1zOZQdvv+rWS6gKmhQBCEMc4SMABQfWdjsylBcDfniD1Q+fUX1dcBTXA==", - "requires": { - "tslib": "^2.1.0" - } - }, - "@firebase/messaging": { - "version": "0.9.4", - "resolved": "https://registry.npmjs.org/@firebase/messaging/-/messaging-0.9.4.tgz", - "integrity": "sha512-OvYV4MLPfDpdP/yltLqZXZRx6rXWz52bEilS2jL2B4sGiuTaXSkR6BIHB54EPTblu32nbyZYdlER4fssz4TfXw==", - "requires": { - "@firebase/component": "0.5.9", - "@firebase/installations": "0.5.4", - "@firebase/messaging-interop-types": "0.1.0", - "@firebase/util": "1.4.2", - "idb": "3.0.2", - "tslib": "^2.1.0" - } - }, - "@firebase/messaging-compat": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@firebase/messaging-compat/-/messaging-compat-0.1.4.tgz", - "integrity": "sha512-6477jBw7w7hk0uhnTUMsPoukalpcwbxTTo9kMguHVSXe0t3OdoxeXEaapaNJlOmU4Kgc8j3rsms8IDLdKVpvlA==", - "requires": { - "@firebase/component": "0.5.9", - "@firebase/messaging": "0.9.4", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - } - }, - "@firebase/messaging-interop-types": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@firebase/messaging-interop-types/-/messaging-interop-types-0.1.0.tgz", - "integrity": "sha512-DbvUl/rXAZpQeKBnwz0NYY5OCqr2nFA0Bj28Fmr3NXGqR4PAkfTOHuQlVtLO1Nudo3q0HxAYLa68ZDAcuv2uKQ==" - }, - "@firebase/performance": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/@firebase/performance/-/performance-0.5.4.tgz", - "integrity": "sha512-ES6aS4eoMhf9CczntBADDsXhaFea/3a0FADwy/VpWXXBxVb8tqc5tPcoTwd9L5M/aDeSiQMy344rhrSsTbIZEg==", - "requires": { - "@firebase/component": "0.5.9", - "@firebase/installations": "0.5.4", - "@firebase/logger": "0.3.2", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - } - }, - "@firebase/performance-compat": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@firebase/performance-compat/-/performance-compat-0.1.4.tgz", - "integrity": "sha512-YuGfmpC0o+YvEBlEZCbPdNbT4Nn2qhi5uMXjqKnNIUepmXUsgOYDiAqM9nxHPoE/6IkvoFMdCj5nTUYVLCFXgg==", - "requires": { - "@firebase/component": "0.5.9", - "@firebase/logger": "0.3.2", - "@firebase/performance": "0.5.4", - "@firebase/performance-types": "0.1.0", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - } - }, - "@firebase/performance-types": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@firebase/performance-types/-/performance-types-0.1.0.tgz", - "integrity": "sha512-6p1HxrH0mpx+622Ql6fcxFxfkYSBpE3LSuwM7iTtYU2nw91Hj6THC8Bc8z4nboIq7WvgsT/kOTYVVZzCSlXl8w==" - }, - "@firebase/polyfill": { - "version": "0.3.36", - "resolved": "https://registry.npmjs.org/@firebase/polyfill/-/polyfill-0.3.36.tgz", - "integrity": "sha512-zMM9oSJgY6cT2jx3Ce9LYqb0eIpDE52meIzd/oe/y70F+v9u1LDqk5kUF5mf16zovGBWMNFmgzlsh6Wj0OsFtg==", - "requires": { - "core-js": "3.6.5", - "promise-polyfill": "8.1.3", - "whatwg-fetch": "2.0.4" - } - }, - "@firebase/remote-config": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@firebase/remote-config/-/remote-config-0.3.3.tgz", - "integrity": "sha512-9hZWfB3k3IYsjHbWeUfhv/SDCcOgv/JMJpLXlUbTppXPm1IZ3X9ZW4I9bS86gGYr7m/kSv99U0oxQ7N9PoR8Iw==", - "requires": { - "@firebase/component": "0.5.9", - "@firebase/installations": "0.5.4", - "@firebase/logger": "0.3.2", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - } - }, - "@firebase/remote-config-compat": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@firebase/remote-config-compat/-/remote-config-compat-0.1.4.tgz", - "integrity": "sha512-6WeKR7E9KJ1RIF9GZiyle1uD4IsIPUBKUnUnFkQhj3FV6cGvQwbeG0rbh7QQLvd0IWuh9lABYjHXWp+rGHQk8A==", - "requires": { - "@firebase/component": "0.5.9", - "@firebase/logger": "0.3.2", - "@firebase/remote-config": "0.3.3", - "@firebase/remote-config-types": "0.2.0", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - } - }, - "@firebase/remote-config-types": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@firebase/remote-config-types/-/remote-config-types-0.2.0.tgz", - "integrity": "sha512-hqK5sCPeZvcHQ1D6VjJZdW6EexLTXNMJfPdTwbD8NrXUw6UjWC4KWhLK/TSlL0QPsQtcKRkaaoP+9QCgKfMFPw==" - }, - "@firebase/storage": { - "version": "0.8.6", - "resolved": "https://registry.npmjs.org/@firebase/storage/-/storage-0.8.6.tgz", - "integrity": "sha512-ltZinJHC+gvBwmq2MB9phOC5mOBcLE1LkHGjt2LfRyH4SFYdZ6QPwchQfJTvOPKWazsS/y9fud1TliLs7/ZEqQ==", - "requires": { - "@firebase/component": "0.5.9", - "@firebase/util": "1.4.2", - "node-fetch": "2.6.5", - "tslib": "^2.1.0" - } - }, - "@firebase/storage-compat": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/@firebase/storage-compat/-/storage-compat-0.1.6.tgz", - "integrity": "sha512-4uzrDWAQpJ2wwjDBdWwhmy3F3T4KTV98qHlhXaquX3KRo3VxgZLcNwWYvD4fZwxi66COn2oZb70zMztcNmn7BA==", - "requires": { - "@firebase/component": "0.5.9", - "@firebase/storage": "0.8.6", - "@firebase/storage-types": "0.6.0", - "@firebase/util": "1.4.2", - "tslib": "^2.1.0" - } - }, - "@firebase/storage-types": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@firebase/storage-types/-/storage-types-0.6.0.tgz", - "integrity": "sha512-1LpWhcCb1ftpkP/akhzjzeFxgVefs6eMD2QeKiJJUGH1qOiows2w5o0sKCUSQrvrRQS1lz3SFGvNR1Ck/gqxeA==", - "requires": {} - }, - "@firebase/util": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/@firebase/util/-/util-1.4.2.tgz", - "integrity": "sha512-JMiUo+9QE9lMBvEtBjqsOFdmJgObFvi7OL1A0uFGwTmlCI1ZeNPOEBrwXkgTOelVCdiMO15mAebtEyxFuQ6FsA==", - "requires": { - "tslib": "^2.1.0" - } - }, - "@firebase/webchannel-wrapper": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/@firebase/webchannel-wrapper/-/webchannel-wrapper-0.6.1.tgz", - "integrity": "sha512-9FqhNjKQWpQ3fGnSOCovHOm+yhhiorKEqYLAfd525jWavunDJcx8rOW6i6ozAh+FbwcYMkL7b+3j4UR/30MpoQ==" - }, - "@grpc/grpc-js": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.4.4.tgz", - "integrity": "sha512-a6222b7Dl6fIlMgzVl7e+NiRoLiZFbpcwvBH2Oli56Bn7W4/3Ld+86hK4ffPn5rx2DlDidmIcvIJiOQXyhv9gA==", - "requires": { - "@grpc/proto-loader": "^0.6.4", - "@types/node": ">=12.12.47" - } - }, - "@grpc/proto-loader": { - "version": "0.6.6", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.6.6.tgz", - "integrity": "sha512-cdMaPZ8AiFz6ua6PUbP+LKbhwJbFXnrQ/mlnKGUyzDUZ3wp7vPLksnmLCBX6SHgSmjX7CbNVNLFYD5GmmjO4GQ==", - "requires": { - "@types/long": "^4.0.1", - "lodash.camelcase": "^4.3.0", - "long": "^4.0.0", - "protobufjs": "^6.10.0", - "yargs": "^16.1.1" - } - }, - "@peapodtech/firebasedeviceflow": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@peapodtech/firebasedeviceflow/-/firebasedeviceflow-0.2.0.tgz", - "integrity": "sha512-IOkEZt2P7hcMZX7a7URSvtOu4K3Bw8QhA2REsLHqBLywHkslm1dXx0PCZY12Dk2dBdMdY9iUWAfJtjANPWs5og==", - "requires": { - "@types/inquirer": "^7.3.1", - "axios": "^0.21.1", - "chalk": "^4.1.0", - "firebase": "^9.4.0", - "inquirer": "^7.3.3", - "ora": "^5.2.0", - "typescript": "^4.1.3" - } - }, - "@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" - }, - "@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" - }, - "@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" - }, - "@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" - }, - "@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", - "requires": { - "@protobufjs/aspromise": "^1.1.1", - "@protobufjs/inquire": "^1.1.0" - } - }, - "@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" - }, - "@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" - }, - "@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" - }, - "@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" - }, - "@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" - }, - "@serialport/binding-abstract": { - "version": "9.2.3", - "resolved": "https://registry.npmjs.org/@serialport/binding-abstract/-/binding-abstract-9.2.3.tgz", - "integrity": "sha512-cQs9tbIlG3P0IrOWyVirqlhWuJ7Ms2Zh9m2108z6Y5UW/iVj6wEOiW8EmK9QX9jmJXYllE7wgGgvVozP5oCj3w==", - "requires": { - "debug": "^4.3.2" - } - }, - "@serialport/binding-mock": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/@serialport/binding-mock/-/binding-mock-9.2.4.tgz", - "integrity": "sha512-dpEhACCs44oQhh6ajJfJdvQdK38Vq0N4W6iD/gdplglDCK7qXRQCMUjJIeKdS/HSEiWkC3bwumUhUufdsOyT4g==", - "requires": { - "@serialport/binding-abstract": "9.2.3", - "debug": "^4.3.2" - } - }, - "@serialport/bindings": { - "version": "9.2.5", - "resolved": "https://registry.npmjs.org/@serialport/bindings/-/bindings-9.2.5.tgz", - "integrity": "sha512-fyabNg56gWbOMuYJc5c45z94sANC/WzTnGeML7Nr1IYVk0SJ1uksN4ETI8Nea9ZAtr4DhNiIMQ3/IOkyof6Tqg==", - "requires": { - "@serialport/binding-abstract": "9.2.3", - "@serialport/parser-readline": "9.2.4", - "bindings": "^1.5.0", - "debug": "^4.3.2", - "nan": "^2.15.0", - "prebuild-install": "^6.1.4" - } - }, - "@serialport/parser-byte-length": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/@serialport/parser-byte-length/-/parser-byte-length-9.2.4.tgz", - "integrity": "sha512-sQD/iw4ZMU3xW9PLi0/GlvU6Y623jGeWecbMkO7izUo/6P7gtfv1c9ikd5h0kwL8AoAOpQA1lxdHIKox+umBUg==" - }, - "@serialport/parser-cctalk": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/@serialport/parser-cctalk/-/parser-cctalk-9.2.4.tgz", - "integrity": "sha512-T4TU5vQMwmo9AB3gQLFDWbfJXlW5jd9guEsB/nqKjFHTv0FXPdZ7DQ2TpSp8RnHWxU3GX6kYTaDO20BKzc8GPQ==" - }, - "@serialport/parser-delimiter": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/@serialport/parser-delimiter/-/parser-delimiter-9.2.4.tgz", - "integrity": "sha512-4nvTAoYAgkxFiXrkI+3CA49Yd43CODjeszh89EK+I9c8wOZ+etZduRCzINYPiy26g7zO+GRAb9FoPCsY+sYcbQ==" - }, - "@serialport/parser-inter-byte-timeout": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/@serialport/parser-inter-byte-timeout/-/parser-inter-byte-timeout-9.2.4.tgz", - "integrity": "sha512-SOAdvr0oBQIOCXX198hiTlxs4JTKg9j5piapw5tNq52fwDOWdbYrFneT/wN04UTMKaDrJuEvXq6T4rv4j7nJ5A==" - }, - "@serialport/parser-readline": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/@serialport/parser-readline/-/parser-readline-9.2.4.tgz", - "integrity": "sha512-Z1/qrZTQUVhNSJP1hd9YfDvq0o7d87rNwAjjRKbVpa7Qi51tG5BnKt43IV3NFMyBlVcRe0rnIb3tJu57E0SOwg==", - "requires": { - "@serialport/parser-delimiter": "9.2.4" - } - }, - "@serialport/parser-ready": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/@serialport/parser-ready/-/parser-ready-9.2.4.tgz", - "integrity": "sha512-Pyi94Itjl6qAURwIZr/gmZpMAyTmKXThm6vL5DoAWGQjcRHWB0gwv2TY2v7N+mQLJYUKU3cMnvnATXxHm7xjxw==" - }, - "@serialport/parser-regex": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/@serialport/parser-regex/-/parser-regex-9.2.4.tgz", - "integrity": "sha512-sI/cVvPOYz+Dbv4ZdnW16qAwvXiFf/1pGASQdbveRTlgJDdz7sRNlCBifzfTN2xljwvCTZYqiudKvDdC1TepRQ==" - }, - "@serialport/stream": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/@serialport/stream/-/stream-9.2.4.tgz", - "integrity": "sha512-bLye8Ub4vUFQGmkh8qEqehr7SE7EJs2yDs0h9jzuL5oKi+F34CFmWkEErO8GAOQ8YNn7p6b3GxUgs+0BrHHDZQ==", - "requires": { - "debug": "^4.3.2" - } - }, - "@types/inquirer": { - "version": "7.3.3", - "resolved": "https://registry.npmjs.org/@types/inquirer/-/inquirer-7.3.3.tgz", - "integrity": "sha512-HhxyLejTHMfohAuhRun4csWigAMjXTmRyiJTU1Y/I1xmggikFMkOUoMQRlFm+zQcPEGHSs3io/0FAmNZf8EymQ==", - "requires": { - "@types/through": "*", - "rxjs": "^6.4.0" - } - }, - "@types/jsonwebtoken": { - "version": "8.5.5", - "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-8.5.5.tgz", - "integrity": "sha512-OGqtHQ7N5/Ap/TUwO6IgHDuLiAoTmHhGpNvgkCm/F4N6pKzx/RBSfr2OXZSwC6vkfnsEdb6+7DNZVtiXiwdwFw==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/long": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz", - "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==" - }, - "@types/node": { - "version": "16.11.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.7.tgz", - "integrity": "sha512-QB5D2sqfSjCmTuWcBWyJ+/44bcjO7VbjSbOE0ucoVbAsSNQc4Lt6QkgkVXkTDwkL4z/beecZNDvVX15D4P8Jbw==" - }, - "@types/pi-camera": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/@types/pi-camera/-/pi-camera-1.5.3.tgz", - "integrity": "sha512-9CGFEc7Cr0QDWdhqL+Bjb8+0xcYX8L9iv7YlQw+F5ntBh9GwZImDbaeJsFZg76TLGsTMLDTrowfHA7WWMX0csQ==", - "dev": true - }, - "@types/project-name-generator": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@types/project-name-generator/-/project-name-generator-2.1.1.tgz", - "integrity": "sha512-VLd5FEVTJs8hNa/WF4pZRcFvv0OAcIGeTyki4RDcaID0TUhTc5/Xe/btYM2XIHwVCb67ila8wUJYKJNa5dVABw==", - "dev": true - }, - "@types/serialport": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@types/serialport/-/serialport-8.0.2.tgz", - "integrity": "sha512-z4b1I8/vdZE3upgCcAL9VAWlVVFUVn5uo3faAHavkVfK/Hb1LUxKwp9YCtA5AZqEUCWoSWl20SRTOvAI/5fQWQ==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/through": { - "version": "0.0.30", - "resolved": "https://registry.npmjs.org/@types/through/-/through-0.0.30.tgz", - "integrity": "sha512-FvnCJljyxhPM3gkRgWmxmDZyAQSiBQQWLI0A0VFL0K7W1oRUrPJSqNO0NvTnLkBcotdlp3lKvaT0JrnyRDkzOg==", - "requires": { - "@types/node": "*" - } - }, - "@types/uuid": { - "version": "8.3.1", - "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.1.tgz", - "integrity": "sha512-Y2mHTRAbqfFkpjldbkHGY8JIzRN6XqYRliG8/24FcHm2D2PwW24fl5xMRTVGdrb7iMrwCaIEbLWerGIkXuFWVg==", - "dev": true - }, - "@types/yargs": { - "version": "16.0.4", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", - "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", - "requires": { - "@types/yargs-parser": "*" - } - }, - "@types/yargs-parser": { - "version": "20.2.1", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.1.tgz", - "integrity": "sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw==" - }, - "ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", - "requires": { - "type-fest": "^0.21.3" - } - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { - "color-convert": "^2.0.1" - } - }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" - }, - "are-we-there-yet": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", - "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "requires": { - "follow-redirects": "^1.14.0" - } - }, - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" - }, - "base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" - }, - "bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "requires": { - "file-uri-to-path": "1.0.0" - } - }, - "bl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "requires": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "buffer-equal-constant-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" - }, - "buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" - }, - "chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" - }, - "cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", - "requires": { - "restore-cursor": "^3.1.0" - } - }, - "cli-spinners": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.1.tgz", - "integrity": "sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==" - }, - "cli-width": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", - "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==" - }, - "cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "clone": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=" - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "commist": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/commist/-/commist-1.1.0.tgz", - "integrity": "sha512-rraC8NXWOEjhADbZe9QBNzLAN5Q3fsTPQtBV+fEVj6xKIgDgNiEVE6ZNfHpZOqfQ21YUzfVNUXLOEZquYvQPPg==", - "requires": { - "leven": "^2.1.0", - "minimist": "^1.1.0" - } - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "concat-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", - "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.0.2", - "typedarray": "^0.0.6" - } - }, - "console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" - }, - "core-js": { - "version": "3.6.5", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.5.tgz", - "integrity": "sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA==" - }, - "core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" - }, - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "requires": { - "ms": "2.1.2" - } - }, - "decompress-response": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", - "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", - "requires": { - "mimic-response": "^2.0.0" - } - }, - "deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" - }, - "defaults": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", - "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", - "requires": { - "clone": "^1.0.2" - } - }, - "delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" - }, - "detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=" - }, - "domexception": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", - "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", - "optional": true, - "requires": { - "webidl-conversions": "^4.0.2" - }, - "dependencies": { - "webidl-conversions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", - "optional": true - } - } - }, - "dotenv": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", - "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==" - }, - "duplexify": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.2.tgz", - "integrity": "sha512-fz3OjcNCHmRP12MJoZMPglx8m4rrFP8rovnk4vT8Fs+aonZoCwGg10dSsQsfP/E62eZcPTMSMP6686fu9Qlqtw==", - "requires": { - "end-of-stream": "^1.4.1", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1", - "stream-shift": "^1.0.0" - } - }, - "ecdsa-sig-formatter": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", - "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "requires": { - "once": "^1.4.0" - } - }, - "escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" - }, - "expand-template": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", - "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==" - }, - "external-editor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", - "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", - "requires": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" - } - }, - "faye-websocket": { - "version": "0.11.4", - "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz", - "integrity": "sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==", - "requires": { - "websocket-driver": ">=0.5.1" - } - }, - "figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", - "requires": { - "escape-string-regexp": "^1.0.5" - } - }, - "file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" - }, - "firebase": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/firebase/-/firebase-9.4.0.tgz", - "integrity": "sha512-VcdMVYf02OZtDWp6IYnlcostwqWZHlumxgnY5K87EKBHIjGcjkpdb39mguXZCVfQ44TRid2yaBouGDKAacnFwQ==", - "requires": { - "@firebase/analytics": "0.7.4", - "@firebase/analytics-compat": "0.1.5", - "@firebase/app": "0.7.7", - "@firebase/app-check": "0.5.1", - "@firebase/app-check-compat": "0.2.1", - "@firebase/app-compat": "0.1.8", - "@firebase/app-types": "0.7.0", - "@firebase/auth": "0.19.2", - "@firebase/auth-compat": "0.2.2", - "@firebase/database": "0.12.4", - "@firebase/database-compat": "0.1.4", - "@firebase/firestore": "3.3.0", - "@firebase/firestore-compat": "0.1.7", - "@firebase/functions": "0.7.5", - "@firebase/functions-compat": "0.1.6", - "@firebase/installations": "0.5.4", - "@firebase/messaging": "0.9.4", - "@firebase/messaging-compat": "0.1.4", - "@firebase/performance": "0.5.4", - "@firebase/performance-compat": "0.1.4", - "@firebase/polyfill": "0.3.36", - "@firebase/remote-config": "0.3.3", - "@firebase/remote-config-compat": "0.1.4", - "@firebase/storage": "0.8.6", - "@firebase/storage-compat": "0.1.6", - "@firebase/util": "1.4.2" - } - }, - "follow-redirects": { - "version": "1.14.5", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.5.tgz", - "integrity": "sha512-wtphSXy7d4/OR+MvIFbCVBDzZ5520qV8XfPklSN5QtxuMUJZ+b0Wnst1e1lCDocfzuCkHqj8k0FpZqO+UIaKNA==" - }, - "fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "requires": { - "ansi-regex": "^2.0.0" - } - } - } - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" - }, - "github-from-package": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", - "integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=" - }, - "glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" - }, - "has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" - }, - "help-me": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/help-me/-/help-me-3.0.0.tgz", - "integrity": "sha512-hx73jClhyk910sidBB7ERlnhMlFsJJIBqSVMFDwPN8o2v9nmp5KgLq1Xz1Bf1fCMMZ6mPrX159iG0VLy/fPMtQ==", - "requires": { - "glob": "^7.1.6", - "readable-stream": "^3.6.0" - } - }, - "http-parser-js": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.3.tgz", - "integrity": "sha512-t7hjvef/5HEK7RWTdUzVUhl8zkEu+LlaE0IYzdMuvbSDipxBRpOn4Uhw8ZyECEa808iVT8XCjzo6xmYt4CiLZg==" - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "idb": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/idb/-/idb-3.0.2.tgz", - "integrity": "sha512-+FLa/0sTXqyux0o6C+i2lOR0VoS60LU/jzUo5xjfY6+7sEEgy4Gz1O7yFBXvjd7N0NyIGWIRg8DcQSLEG+VSPw==" - }, - "ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" - }, - "immediate": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", - "integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=" - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" - }, - "inquirer": { - "version": "7.3.3", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz", - "integrity": "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==", - "requires": { - "ansi-escapes": "^4.2.1", - "chalk": "^4.1.0", - "cli-cursor": "^3.1.0", - "cli-width": "^3.0.0", - "external-editor": "^3.0.3", - "figures": "^3.0.0", - "lodash": "^4.17.19", - "mute-stream": "0.0.8", - "run-async": "^2.4.0", - "rxjs": "^6.6.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0", - "through": "^2.3.6" - } - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" - }, - "is-interactive": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", - "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==" - }, - "is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==" - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "jsonwebtoken": { - "version": "8.5.1", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", - "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==", - "requires": { - "jws": "^3.2.2", - "lodash.includes": "^4.3.0", - "lodash.isboolean": "^3.0.3", - "lodash.isinteger": "^4.0.4", - "lodash.isnumber": "^3.0.3", - "lodash.isplainobject": "^4.0.6", - "lodash.isstring": "^4.0.1", - "lodash.once": "^4.0.0", - "ms": "^2.1.1", - "semver": "^5.6.0" - }, - "dependencies": { - "jwa": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", - "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", - "requires": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.11", - "safe-buffer": "^5.0.1" - } - }, - "jws": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", - "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", - "requires": { - "jwa": "^1.4.1", - "safe-buffer": "^5.0.1" - } - } - } - }, - "jszip": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.7.1.tgz", - "integrity": "sha512-ghL0tz1XG9ZEmRMcEN2vt7xabrDdqHHeykgARpmZ0BiIctWxM47Vt63ZO2dnp4QYt/xJVLLy5Zv1l/xRdh2byg==", - "requires": { - "lie": "~3.3.0", - "pako": "~1.0.2", - "readable-stream": "~2.3.6", - "set-immediate-shim": "~1.0.1" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "leven": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", - "integrity": "sha1-wuep93IJTe6dNCAq6KzORoeHVYA=" - }, - "lie": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", - "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", - "requires": { - "immediate": "~3.0.5" - } - }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=" - }, - "lodash.includes": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", - "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=" - }, - "lodash.isboolean": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", - "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=" - }, - "lodash.isinteger": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", - "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=" - }, - "lodash.isnumber": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", - "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=" - }, - "lodash.isplainobject": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" - }, - "lodash.isstring": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" - }, - "lodash.once": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", - "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" - }, - "log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - "requires": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" - } - }, - "long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" - }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" - }, - "mimic-response": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", - "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==" - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" - }, - "mkdirp-classic": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", - "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" - }, - "mqtt": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/mqtt/-/mqtt-4.2.8.tgz", - "integrity": "sha512-DJYjlXODVXtSDecN8jnNzi6ItX3+ufGsEs9OB3YV24HtkRrh7kpx8L5M1LuyF0KzaiGtWr2PzDcMGAY60KGOSA==", - "requires": { - "commist": "^1.0.0", - "concat-stream": "^2.0.0", - "debug": "^4.1.1", - "duplexify": "^4.1.1", - "help-me": "^3.0.0", - "inherits": "^2.0.3", - "minimist": "^1.2.5", - "mqtt-packet": "^6.8.0", - "pump": "^3.0.0", - "readable-stream": "^3.6.0", - "reinterval": "^1.1.0", - "split2": "^3.1.0", - "ws": "^7.5.0", - "xtend": "^4.0.2" - } - }, - "mqtt-packet": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/mqtt-packet/-/mqtt-packet-6.10.0.tgz", - "integrity": "sha512-ja8+mFKIHdB1Tpl6vac+sktqy3gA8t9Mduom1BA75cI+R9AHnZOiaBQwpGiWnaVJLDGRdNhQmFaAqd7tkKSMGA==", - "requires": { - "bl": "^4.0.2", - "debug": "^4.1.1", - "process-nextick-args": "^2.0.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "mute-stream": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", - "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" - }, - "nan": { - "version": "2.15.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", - "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==" - }, - "napi-build-utils": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", - "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==" - }, - "node-abi": { - "version": "2.30.1", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.30.1.tgz", - "integrity": "sha512-/2D0wOQPgaUWzVSVgRMx+trKJRC2UG4SUc4oCJoXx9Uxjtp0Vy3/kt7zcbxHF8+Z/pK3UloLWzBISg72brfy1w==", - "requires": { - "semver": "^5.4.1" - } - }, - "node-fetch": { - "version": "2.6.5", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz", - "integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==", - "requires": { - "whatwg-url": "^5.0.0" - } - }, - "npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1" - } - }, - "onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "requires": { - "mimic-fn": "^2.1.0" - } - }, - "ora": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", - "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", - "requires": { - "bl": "^4.1.0", - "chalk": "^4.1.0", - "cli-cursor": "^3.1.0", - "cli-spinners": "^2.5.0", - "is-interactive": "^1.0.0", - "is-unicode-supported": "^0.1.0", - "log-symbols": "^4.1.0", - "strip-ansi": "^6.0.0", - "wcwidth": "^1.0.1" - } - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" - }, - "pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" - }, - "pi-camera": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/pi-camera/-/pi-camera-1.6.0.tgz", - "integrity": "sha512-WrnJ4R1X/5qA5/vXeou/Ty97c7urrnla03j5FhctF9nZy1lXnfYkPOsL+qDZAZcvg40cbkTE217WlHNnMMftaw==" - }, - "prebuild-install": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-6.1.4.tgz", - "integrity": "sha512-Z4vpywnK1lBg+zdPCVCsKq0xO66eEV9rWo2zrROGGiRS4JtueBOdlB1FnY8lcy7JsUud/Q3ijUxyWN26Ika0vQ==", - "requires": { - "detect-libc": "^1.0.3", - "expand-template": "^2.0.3", - "github-from-package": "0.0.0", - "minimist": "^1.2.3", - "mkdirp-classic": "^0.5.3", - "napi-build-utils": "^1.0.1", - "node-abi": "^2.21.0", - "npmlog": "^4.0.1", - "pump": "^3.0.0", - "rc": "^1.2.7", - "simple-get": "^3.0.3", - "tar-fs": "^2.0.0", - "tunnel-agent": "^0.6.0" - } - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" - }, - "promise-polyfill": { - "version": "8.1.3", - "resolved": "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-8.1.3.tgz", - "integrity": "sha512-MG5r82wBzh7pSKDRa9y+vllNHz3e3d4CNj1PQE4BQYxLme0gKYYBm9YENq+UkEikyZ0XbiGWxYlVw3Rl9O/U8g==" - }, - "protobufjs": { - "version": "6.11.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.2.tgz", - "integrity": "sha512-4BQJoPooKJl2G9j3XftkIXjoC9C0Av2NOrWmbLWT1vH32GcSUHjM0Arra6UfTsVyfMAuFzaLucXn1sadxJydAw==", - "requires": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": ">=13.7.0", - "long": "^4.0.0" - } - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - } - }, - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "reinterval": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/reinterval/-/reinterval-1.1.0.tgz", - "integrity": "sha1-M2Hs+jymwYKDOA3Qu5VG85D17Oc=" - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" - }, - "restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", - "requires": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - } - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "requires": { - "glob": "^7.1.3" - } - }, - "run-async": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", - "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==" - }, - "rxjs": { - "version": "6.6.7", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", - "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", - "requires": { - "tslib": "^1.9.0" - }, - "dependencies": { - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - } - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "selenium-webdriver": { - "version": "4.0.0-rc-1", - "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.0.0-rc-1.tgz", - "integrity": "sha512-bcrwFPRax8fifRP60p7xkWDGSJJoMkPAzufMlk5K2NyLPht/YZzR2WcIk1+3gR8VOCLlst1P2PI+MXACaFzpIw==", - "requires": { - "jszip": "^3.6.0", - "rimraf": "^3.0.2", - "tmp": "^0.2.1", - "ws": ">=7.4.6" - }, - "dependencies": { - "tmp": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", - "requires": { - "rimraf": "^3.0.0" - } - } - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" - }, - "serialport": { - "version": "9.2.5", - "resolved": "https://registry.npmjs.org/serialport/-/serialport-9.2.5.tgz", - "integrity": "sha512-nsDsD2GN/43T2a8jQYr1HH76gmDZ575Ts8FOdcBRUY8ecaI16BPbXa612cPPkQjOfg28+KL5qtQL9c0vvTaidg==", - "requires": { - "@serialport/binding-mock": "9.2.4", - "@serialport/bindings": "9.2.5", - "@serialport/parser-byte-length": "9.2.4", - "@serialport/parser-cctalk": "9.2.4", - "@serialport/parser-delimiter": "9.2.4", - "@serialport/parser-inter-byte-timeout": "9.2.4", - "@serialport/parser-readline": "9.2.4", - "@serialport/parser-ready": "9.2.4", - "@serialport/parser-regex": "9.2.4", - "@serialport/stream": "9.2.4", - "debug": "^4.3.2" - } - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" - }, - "set-immediate-shim": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", - "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=" - }, - "signal-exit": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz", - "integrity": "sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ==" - }, - "simple-concat": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", - "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==" - }, - "simple-get": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz", - "integrity": "sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA==", - "requires": { - "decompress-response": "^4.2.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" - } - }, - "split2": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", - "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", - "requires": { - "readable-stream": "^3.0.0" - } - }, - "stream-shift": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", - "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==" - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "requires": { - "safe-buffer": "~5.2.0" - } - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "requires": { - "has-flag": "^4.0.0" - } - }, - "tar-fs": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", - "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", - "requires": { - "chownr": "^1.1.1", - "mkdirp-classic": "^0.5.2", - "pump": "^3.0.0", - "tar-stream": "^2.1.4" - } - }, - "tar-stream": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", - "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", - "requires": { - "bl": "^4.0.3", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" - } - }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" - }, - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "requires": { - "os-tmpdir": "~1.0.2" - } - }, - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" - }, - "tslib": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", - "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==" - }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" - }, - "typescript": { - "version": "4.4.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", - "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==" - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" - }, - "wcwidth": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", - "requires": { - "defaults": "^1.0.3" - } - }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" - }, - "websocket-driver": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz", - "integrity": "sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==", - "requires": { - "http-parser-js": ">=0.5.1", - "safe-buffer": ">=5.1.0", - "websocket-extensions": ">=0.1.1" - } - }, - "websocket-extensions": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz", - "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==" - }, - "whatwg-fetch": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz", - "integrity": "sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==" - }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "wide-align": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", - "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", - "requires": { - "string-width": "^1.0.2 || 2 || 3 || 4" - } - }, - "wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "wrtc": { - "version": "0.4.7", - "resolved": "https://registry.npmjs.org/wrtc/-/wrtc-0.4.7.tgz", - "integrity": "sha512-P6Hn7VT4lfSH49HxLHcHhDq+aFf/jd9dPY7lDHeFhZ22N3858EKuwm2jmnlPzpsRGEPaoF6XwkcxY5SYnt4f/g==", - "requires": { - "domexception": "^1.0.1", - "node-pre-gyp": "^0.13.0" - } - }, - "ws": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz", - "integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==", - "requires": {} - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - }, - "y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" - }, - "yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "requires": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - } - }, - "yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==" - } - } -} diff --git a/software/package.json b/software/package.json index af73d922..7b7302a9 100644 --- a/software/package.json +++ b/software/package.json @@ -1,17 +1,20 @@ { "name": "@peapodtech/peapodos", - "version": "0.0.8", - "description": "A cloud-enabled IoT automated plant growth environment. Designed as a research tool for precise and distributed mapping of the plant-environment relationship.", + "version": "0.2.0", + "description": "Main software for PeaPod.", "main": "index.js", "directories": { "lib": "lib" }, "scripts": { - "test": "node . simulate offline", - "offline": "node . offline", - "simulate": "node . simulate", - "build": "npm i && tsc", - "start": "node ." + "dev": "yarn buildapi && yarn start", + "devsim": "yarn buildapi && yarn startsim", + "build": "yarn upgrade && next build", + "buildapi": "rm -f api/*.mjs server.mjs serialtest.mjs && yarn install && node api.esbuild.mjs", + "start": "node server.mjs", + "startsim": "node server.mjs --simulator", + "lint": "next lint --fix", + "deploy_functions": "firebase deploy --only functions" }, "repository": { "type": "git", @@ -29,31 +32,83 @@ }, "homepage": "https://github.com/PeaPodTechnologies/PeaPod#readme", "dependencies": { + "@base-ui/react": "^1.0.0", + "@emotion/cache": "^11.14.0", + "@emotion/react": "^11.14.0", + "@emotion/styled": "^11.14.1", + "@inquirer/prompts": "^8.1.0", + "@mapbox/node-pre-gyp": "^1.0.8", + "@mui/icons-material": "^7.3.1", + "@mui/material": "^7.3.1", + "@mui/material-nextjs": "^7.3.0", + "@mui/x-charts": "^8.10.0", + "@mui/x-data-grid": "^8.10.1", + "@mui/x-date-pickers": "^9.0.4", "@peapodtech/firebasedeviceflow": "^0.2.0", - "@types/yargs": "^16.0.0", - "chalk": "^4.1.0", - "dotenv": "^10.0.0", - "firebase": "^9.3.0", + "@tailwindcss/postcss": "^4.1.11", + "@xyflow/react": "^12.8.4", + "autoprefixer": "^10.4.21", + "blessed": "^0.1.81", + "chalk": "^5.4.1", + "dayjs": "^1.11.20", + "debug": "^4.4.0", + "dotenv": "^17.2.3", + "firebase": "^12.7.0", + "jest": "^29.7.0", + "json-edit-react": "^1.29.0", "jsonwebtoken": "^8.5.1", "mqtt": "^4.2.8", - "ora": "^5.3.0", + "next": "15.1.3", + "onoff": "^6.0.3", + "ora": "^8.1.1", "pi-camera": "^1.6.0", + "postcss": "^8.5.6", + "react": "^19.0.0", + "react-dom": "^19.0.0", "rxjs": "^6.6.3", - "serialport": "^9.0.6", - "uuid": "^8.3.2", - "wrtc": "^0.4.7", - "yargs": "^16.2.0" + "serialport": "^13.0.0", + "socket.io-client": "^4.8.1", + "tailwindcss": "^4.1.11", + "ts-jest": "^29.2.5", + "uuid": "^11.0.3", + "yargs": "^17.7.2" }, "devDependencies": { + "@eslint/eslintrc": "^3", + "@eslint/js": "^9.17.0", + "@serialport/binding-mock": "^10.2.2", + "@serialport/bindings-cpp": "^13.0.1", "@serialport/parser-readline": "^9.0.1", + "@types/blessed": "^0.1.25", + "@types/debug": "^4.1.12", + "@types/jest": "^29.5.14", "@types/jsonwebtoken": "^8.5.5", + "@types/node": "^20", "@types/pi-camera": "^1.5.3", "@types/project-name-generator": "^2.1.0", + "@types/react": "^19", + "@types/react-dom": "^19", "@types/serialport": "^8.0.2", - "@types/uuid": "^8.3.0" + "@types/uuid": "^10.0.0", + "@types/yargs": "^17.0.33", + "@typescript-eslint/eslint-plugin": "^8.19.1", + "@typescript-eslint/parser": "^8.0.0", + "esbuild": "^0.24.2", + "esbuild-plugin-file-path-extensions": "^2.1.4", + "eslint": "^9.17.0", + "eslint-config-next": "15.1.3", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-react": "^7.37.3", + "globals": "^15.14.0", + "prettier": "3.4.2", + "socket.io": "^4.8.1", + "typescript": "^5", + "typescript-eslint": "^8.19.0" }, "publishConfig": { "access": "public" }, - "bin": "index.js" + "bin": { + "peapodos": "./index.js" + } } diff --git a/software/postcss.config.mjs b/software/postcss.config.mjs new file mode 100644 index 00000000..f598fedd --- /dev/null +++ b/software/postcss.config.mjs @@ -0,0 +1,7 @@ +/** @type {import('postcss-load-config').Config} */ +const config = { + plugins: ["@tailwindcss/postcss"], +}; + +export default config; + diff --git a/software/public/file.svg b/software/public/file.svg new file mode 100644 index 00000000..004145cd --- /dev/null +++ b/software/public/file.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/software/public/globe.svg b/software/public/globe.svg new file mode 100644 index 00000000..567f17b0 --- /dev/null +++ b/software/public/globe.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/software/public/next.svg b/software/public/next.svg new file mode 100644 index 00000000..5174b28c --- /dev/null +++ b/software/public/next.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/software/public/vercel.svg b/software/public/vercel.svg new file mode 100644 index 00000000..77053960 --- /dev/null +++ b/software/public/vercel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/software/public/window.svg b/software/public/window.svg new file mode 100644 index 00000000..b2b2a44f --- /dev/null +++ b/software/public/window.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/software/scheduler.json b/software/scheduler.json new file mode 100644 index 00000000..2316aec1 --- /dev/null +++ b/software/scheduler.json @@ -0,0 +1,34 @@ +[ + { + "id": "127c24ff-667d-4738-8247-aab7ea80c512", + "entry": "interval", + "title": "Lighting ON", + "description": "Turns lighting on every 2 minutes.", + "date": "2026-05-05T19:05:00.000Z", + "instruction": { + "type": "config", + "data": { + "enable_lighting": true + } + }, + "interval": 120000, + "endDate": null, + "last": 1778007887861 + }, + { + "id": "58100375-39c6-4c11-821d-8350a6c83902", + "entry": "interval", + "title": "Lighting OFF", + "description": "Turns lighting off every 2 minutes.", + "date": "2026-05-05T19:06:00.000Z", + "instruction": { + "type": "config", + "data": { + "enable_lighting": false + } + }, + "interval": 120000, + "endDate": null, + "last": 1778007925157 + } +] \ No newline at end of file diff --git a/software/scripts/attach.sh b/software/scripts/attach.sh new file mode 100755 index 00000000..f9d6c0ea --- /dev/null +++ b/software/scripts/attach.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +docker compose exec -it peapodos node server.mjs \ No newline at end of file diff --git a/software/scripts/build.sh b/software/scripts/build.sh new file mode 100755 index 00000000..270e83f2 --- /dev/null +++ b/software/scripts/build.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +set -euo pipefail + +IMAGE_OWNER="${1:-}" +IMAGE_TAG="${2:-latest}" + +docker buildx create --use --name peapodos 2>/dev/null || true + +if [[ -n "$IMAGE_OWNER" ]]; then + IMAGE_NAME="$IMAGE_OWNER/peapodos:$IMAGE_TAG" + docker buildx build \ + --platform linux/arm64 \ + --target peapodos \ + --tag "$IMAGE_NAME" \ + --load \ + . + echo "Built image: $IMAGE_NAME" +else + rm out.tar.gz && docker buildx build \ + --platform linux/arm64 \ + --target export \ + --output type=local,dest=. \ + . + echo "Exported runtime bundle to ./out.tar.gz" +fi \ No newline at end of file diff --git a/software/scripts/launch.dev.sh b/software/scripts/launch.dev.sh new file mode 100755 index 00000000..c9d367de --- /dev/null +++ b/software/scripts/launch.dev.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +docker compose -f docker-compose.dev.yml up --build \ No newline at end of file diff --git a/software/scripts/launch.sh b/software/scripts/launch.sh new file mode 100755 index 00000000..8b11d3db --- /dev/null +++ b/software/scripts/launch.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +docker compose up --build \ No newline at end of file diff --git a/software/scripts/publish.sh b/software/scripts/publish.sh new file mode 100755 index 00000000..8c33fa64 --- /dev/null +++ b/software/scripts/publish.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -euo pipefail + +IMAGE_OWNER="${1:?Usage: ./scripts/publish.sh [tag]}" +IMAGE_TAG="${2:-latest}" + +docker login --username "$IMAGE_OWNER" + +docker push "$IMAGE_OWNER/peapodos:$IMAGE_TAG" \ No newline at end of file diff --git a/software/scripts/upload.sh b/software/scripts/upload.sh new file mode 100755 index 00000000..f53e8ed5 --- /dev/null +++ b/software/scripts/upload.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +scp out.tar.gz pi@peapod.local:~/ \ No newline at end of file diff --git a/software/serialtest.ts b/software/serialtest.ts new file mode 100644 index 00000000..5ccf40ef --- /dev/null +++ b/software/serialtest.ts @@ -0,0 +1,104 @@ +import { SerialPort, ReadlineParser } from 'serialport'; +import select from '@inquirer/select'; + +const BAUDRATE = 115200; + +// eslint-disable-next-line prefer-const +let serialport: SerialPort | undefined; + +function restoreTerminal() { + try { + if (process.stdin.isTTY) { + process.stdin.setRawMode(false); + } + process.stdin.pause(); + } catch {} +} + +function exitCleanly(code = 0) { + restoreTerminal(); + + if (serialport?.isOpen) { + serialport.close(() => process.exit(code)); + } else { + process.exit(code); + } +} + +process.on('SIGINT', () => { + console.log('\nCaught Ctrl-C'); + exitCleanly(0); +}); + +process.on('SIGTERM', () => { + console.log('\nCaught SIGTERM'); + exitCleanly(0); +}); + +const ports = await SerialPort.list(); + +console.log('Available Serial Ports:'); +ports.forEach((port) => { + console.log(`- ${port.path} (${port.manufacturer || 'Unknown Manufacturer'})`); +}); + +const serial = await select({ + message: 'Select Serial Port:', + choices: ports.map((ser, i) => ({ + value: ser.path, + name: `${i}: ${ser.path}`, + })), +}); + +restoreTerminal(); + +console.log(`Selected Serial Port: ${serial}`); + +serialport = new SerialPort({ + path: serial, + baudRate: BAUDRATE, + autoOpen: false, +}); + +const parser = serialport.pipe(new ReadlineParser({ delimiter: '\n' })); + +parser.on('data', (line) => { + console.log(JSON.stringify(line)); +}); + +serialport.on('open', () => { + console.log('OPEN EVENT'); +}); + +serialport.on('error', (err) => { + console.error('ERROR EVENT:', err); +}); + +serialport.on('close', () => { + console.log('CLOSE EVENT'); +}); + +console.log('About to open serial port'); + +const timer = setTimeout(() => { + console.error('serialport.open() callback did not fire after 5s', { + isOpen: serialport?.isOpen, + readable: serialport?.readable, + writable: serialport?.writable, + }); + + // Do not process.exit immediately if you want to keep observing data. + // exitCleanly(1); +}, 5000); + +serialport.open((err) => { + clearTimeout(timer); + + if (err) { + console.error('Error opening serial port:', err.message); + exitCleanly(1); + return; + } + + console.log(`Serial port ${serial} opened at baud rate ${BAUDRATE}`); +}); \ No newline at end of file diff --git a/software/server.ts b/software/server.ts new file mode 100644 index 00000000..b7934ce6 --- /dev/null +++ b/software/server.ts @@ -0,0 +1,591 @@ +import { createServer } from 'http'; +import { Server } from 'socket.io'; + +import next from 'next'; +import nextConfig from './next.config'; + +import { findSerialPort, MicroController, CONTROLLER_REVISION, Controller, SimulatedController, SimulatorConfig } from './api/controller'; +// import { pushDebugMessage, pushDebugMessages } from './api/firebase'; +import ui, { _logRedirect, _errRedirect } from './api/ui'; +import {DebugJsonSerialportError} from './api/errors'; +import { appendFileSync, readFileSync, writeFileSync } from 'fs'; +import yargs from 'yargs'; +import { hideBin } from 'yargs/helpers'; +import { initializeApp } from 'firebase/app'; +import { getAuth } from 'firebase/auth'; +import { DeviceFlowUI } from '@peapodtech/firebasedeviceflow'; +import { DebugJsonInstruction } from './api/types'; +import checkbox from '@inquirer/checkbox'; +import select from '@inquirer/select'; +import { cameraCapture, ipv4Lookup, updateMicrocontroller } from './api/utils'; +import { pushDebugMessages, uploadFile } from './api/firebase'; +import loadDotEnv from './api/env'; +import { SchedulerEntry } from './api/types'; + +loadDotEnv(); + +const SCHEDULER_INTERVAL = 5000; // ms - How often to check the scheduler for pending tasks + +enum PublishingMode { + FIREBASE = 'Firebase (CloudPonics)', + LOCAL = 'Local (Filesystem)', + FRONTEND = 'Dashboard (Frontend)' +} + +// Handle Command-Line Arguments +const argv = await yargs(hideBin(process.argv)) + .option('simulator', { + alias: 's', + type: 'boolean', + describe: 'Run against the simulated controller' + }) + .option('port', { + alias: 'p', + type: 'number', + describe: 'HTTP port' + }) + .option('host', { + alias: 'h', + type: 'string', + describe: 'Hostname to bind' + }) + .option('serialport', { + alias: 'd', + type: 'string', + describe: 'SerialPort device path (overrides auto-detection)', + }) + .help().parse(); + +type Linker = { + instruction: DebugJsonInstruction, + key: string, + cast: 'string' | 'number' | 'boolean', + eval: string +}; + +// Redirect console.log/.error calls to ui.log/.err +console.log = _logRedirect; +console.error = _errRedirect; + +// Options: SerialPort Message Logging +// const _msg_print_delta = 1; +let _msg_print_count = 0; + +const intervals: { [key: string]: NodeJS.Timeout } = {}; // { [key: instruction string]: NodeJS.Timeout} - Scheduled tasks +const scheduler : {entry: SchedulerEntry & ({entry: 'event', executed: boolean} | {entry: 'interval', last: number}), interval: NodeJS.Timeout, instruction: DebugJsonInstruction}[] = []; // Scheduler Entries +const linker: { + [key: string]: Linker[] +} = {}; +// var linker = {encoder: [{key: 's', cast: 'number', eval: 'value * (-15)', instruction: {type: 'command', data: {fqa: 8183, b: 3}}}]}; // { [key: `telemetry key`]: { `instruction`: object, `key`: string, `cast`: 'string' | 'number' | 'boolean' }[] } - On `telemetry key`, send {...`instruction`, [`key`]: telemetry value as `cast`} + +const linkerTyper = (value, cast) => { + if(cast === 'string') return String(value); + if(cast === 'number') return Number(value); + if(cast === 'boolean') return Boolean(value); + return undefined; +}; + +const linkerChecker = (value, cast) => { + if(cast === 'string') return typeof value === 'string'; + if(cast === 'number') return typeof value === 'number' && !isNaN(value); + if(cast === 'boolean') return typeof value === 'boolean'; + return false; +}; + +const linkerEvaluator = (value, evalStr) => { + if(!evalStr || typeof evalStr !== 'string') return value; + try { + return eval(evalStr.replace(/value/g, value)); + // eslint-disable-next-line @typescript-eslint/no-unused-vars + } catch (err) { + return undefined; + } +}; + +const SIMULATOR_CONFIG: SimulatorConfig = { + 'temperature': { min: 20, max: 30, interval: 1000 }, + 'humidity': { min: 30, max: 70, interval: 1500 }, +}; + +// const DEFAULT_SERIALPORT_STEM = '/dev/ttyACM'; // Linux default +// const DEFAULT_SERIALPORT_STEM = '/dev/ttyS'; +// const DEFAULT_SERIALPORT_STEM = 'usbserial'; + +const findController = async (simulator?: boolean): Promise => { + if(simulator) return new SimulatedController(SIMULATOR_CONFIG); + ui.start('SerialPort: Scanning...'); + return findSerialPort(process.env.SERIALPORT ?? undefined, !!process.env.SERIALPORT).then(async (ports) => { + if(ports.length === 0) throw new DebugJsonSerialportError('No Serial Ports Found!'); + + ui.succeed(`Serial Ports Found: ${ports.length}`); + + if(ports.length === 1) { + ui.log(`Serial Port Auto-Selected: ${ports[0]}`); + return new MicroController(ports[0], true); + } + + const serial = await select({ + message: 'Select Serial Port:', + choices: ports.map((ser, i) => ({ + value: ser, + name: `${i}: ${ser}` + })), + }); + + return new MicroController(serial, true); + }); +}; + +let io: Server | undefined = undefined; +let schedulerInterval: NodeJS.Timeout | undefined = undefined; + +// ===== MAIN ===== +(async () => { + // 4. Select & Prepare Publishing Modes + const pms = await checkbox({ + message: 'Select publishing modes:', + choices: Object.entries(PublishingMode).map(pm => ({ + // Object.entries casts `PublishingMode` values to `string`. This recasts them to PublishingMode enum values (TypeScript magic) + value: PublishingMode[pm[0] as keyof typeof PublishingMode], + name: pm[1] + })), + }); + + // 4A. Firebase w/ Auth + if(pms.includes(PublishingMode.FIREBASE)) { + const firebaseApp = initializeApp({ + apiKey: process.env.FIREBASE_APIKEY, + authDomain: process.env.FIREBASE_AUTHDOMAIN, + projectId: process.env.FIREBASE_PROJECTID, + storageBucket: process.env.FIREBASE_STORAGEBUCKET, + messagingSenderId: process.env.FIREBASE_MESSAGINGSENDERID, + appId: process.env.FIREBASE_APPID, + measurementId: process.env.FIREBASE_MEASUREMENTID + }); + + getAuth(firebaseApp); + + const deviceFlowUI = new DeviceFlowUI(firebaseApp, { + Google : { + clientid: process.env.GOOGLE_CLIENTID, + clientsecret: process.env.GOOGLE_CLIENTSECRET, + scopes: process.env.GOOGLE_SCOPES?.split(' ') + }, + GitHub : { + clientid: process.env.GITHUB_CLIENTID, + clientsecret: process.env.GITHUB_CLIENTSECRET, + scopes: process.env.GITHUB_SCOPES?.split(' ') + } + }); + + await deviceFlowUI.signIn().then((user) => { + ui.succeed(`Firebase Auth: Signed in as ${user.email}!`); + }); + } + + if(pms.includes(PublishingMode.FRONTEND)) { + // 1. IPv4 Lookup + // ui.start('IPv4: Lookup...'); + // const host = await ipv4Lookup(); + // ui.succeed(`IPv4: ${host}`); + + // const hostname = argv.host ?? host ?? 'localhost'; + const hostname = argv.host ?? process.env.NEXT_HOST ?? 'localhost'; + const port = argv.port ?? process.env.NEXT_PORT ?? 3000; + + // 2. Next.JS App and HTTP Server + ui.start(`Next.JS: Preparing${process.env.NODE_ENV === 'production' ? ' (Production)' : ' (Development)'}...`); + const app = next({ dev: (process.env.NODE_ENV !== 'production'), hostname, port, conf: nextConfig }); + await app.prepare(); + const handler = app.getRequestHandler(); + const server = createServer((req, res) => { + // console.log('[HTTP]', req.method, req.url); + handler(req, res); + }); + ui.succeed('Next.JS: Ready!'); + + await new Promise(r => server.listen(port, hostname, () => { + ui.log(`HTTP Server Listening: http://${hostname}:${port}/`); + r(); + })); + + // 3. WebSockets + io = new Server(server, { + cors: { + origin: '*', + }, + }); + } + + // 5. SerialPort DebugJson Controller + const controller = await findController(argv.simulator || false); + if(!controller) throw new DebugJsonSerialportError('Controller Not Found!'); + controller.start((messages) => { + + // Message Handling + messages.forEach((msg) => { + + // 1. Emit to WebSocket Clients + if(pms.includes(PublishingMode.FRONTEND) && !!io) io.emit('microcontroller', msg); + + // 2. (aka 4B.) Local Filesystem Logging + if(pms.includes(PublishingMode.LOCAL)) appendFileSync(`logs/${argv.simulator ? 'simulator_' : ''}${(new Date()).toISOString().split('T')[0]}.txt`, JSON.stringify(msg) + '\n'); + + // LINKER HANDLER + if(msg.data) { + Object.keys(linker).forEach((key) => { + linker[key].forEach((item) => { + if(msg.data[key] !== undefined) { + const evalStr = item.eval; + const cast = item.cast; + const value = linkerTyper(linkerEvaluator(msg.data[key], evalStr), cast); + if(!linkerChecker(value, cast)) { + ui.fail(`LINKER ERROR: Invalid Type ${cast} for ${key} -> ${value} (${typeof value})`); + return; // Next key + } + const instruction = { ...item.instruction, data: { ...item.instruction.data, [item.key]: value } }; + ui.log(`LINKER: ${key}: ${msg.data[key]} -> '${evalStr}' as ${cast} = ${value} -> ${JSON.stringify(instruction)}`); + try { + controller.write(instruction); + } catch (err) { + ui.fail(`LINKER ERROR: ${err}`); + if(pms.includes(PublishingMode.FRONTEND) && !!io) io.emit('server', {type: 'error', msg: `Linker TX Error: ${err}`}); + return; // Next key + } + } + }); + }); + } + }); + + // 3. (aka 4Aii.) Push to Firebase Realtime Database + if(pms.includes(PublishingMode.FIREBASE)) pushDebugMessages(messages, 'microcontroller'); + + // if (_msg_print_count % _msg_print_delta === 0) { + ui.log(`CONTROLLER JSON[${_msg_print_count}]: ${JSON.stringify(messages[0])}`); + // } + _msg_print_count++; + + // const timestamp = messages.reduce((max, msg) => ((msg['timestamp'] ? (msg['timestamp'] > max ? msg['timestamp'] : max) : max)), 0); + // if(timestamp) microcontroller.write({ + // type: 'command', + // data: { + // 'fqa': 8183, + // 's': Math.floor(timestamp / 1000), + // 'b': 2 + // } + // }); + + }).catch((err) => { + if(!!io) io.emit('server', {type: 'error', msg: `Lost Controller: ${err}`}); + ui.fail(err); + // io.off('connection', handleSocketConnection); + // microcontroller.reset(); + }).then(() => { + ui.succeed('PeaPodOS: Ready!'); + + if(pms.includes(PublishingMode.FRONTEND) && !!io) { + // 6. Socket.IO Connection Handler + io.on('connection', (socket) => { + ui.log('Socket.IO ++'); + + socket.emit('scheduler'); + + setTimeout(() => { + ui.log(`Socket.IO: ${socket.id}`); + socket.emit('json', { type: 'info', msg: 'Server Start', _socket: 'server' }); // Open subsocket 'server' + socket.emit('json', { type: 'info', msg: 'Scheduler Start', _socket: 'scheduler' }); // Open subsocket 'scheduler' + socket.emit('json', { type: 'revision', msg: 'Microcontroller Revision Match', data: CONTROLLER_REVISION, _socket: 'microcontroller' }); // Open subsocket 'microcontroller' + }, 1000); + + socket.on('disconnect', () => { + ui.log('Socket.IO --'); + }); + + // SERIAL INPUT SOCKET HANDLERS + + socket.on('serialinput', (data: DebugJsonInstruction, callback: (error?: {error: string}) => void) => { + ui.log(`CONTROLLER INPUT: ${JSON.stringify(data)}`); + if(!data || !data.type || !data.data) { + ui.fail('CONTROLLER INPUT ERROR: Invalid Data'); + socket.emit('server', {type: 'error', msg: 'Controller Input Error: Invalid Data'}); + callback({error: 'Invalid Serial Data'}); + return; + } + try { + controller.write({type: data.type, data: data.data}); + } catch (err) { + ui.fail(`CONTROLLER INPUT ERROR: ${err}`); + + socket.emit('server', {type: 'error', msg: `Controller TX Error: ${err}`}); + callback({error: `Controller TX Error: ${err}`}); + return; + } + callback(); + }); + + // INTERVALS SOCKET HANDLERS + + socket.on('intervals-post', (data: { interval: number, instruction: DebugJsonInstruction }, callback: (error?: {error: string}) => void) => { + ui.log(`INTERVALS POST: ${JSON.stringify(data)}`); + if(!data || !data.interval || !data.instruction || !data.instruction.type || !data.instruction.data) { + ui.fail('INTERVALS POST ERROR: Invalid Data; Missing Fields: ' + Object.keys(data).filter(k => !data[k as keyof typeof data]).join(', ')); + socket.emit('server', {type: 'error', msg: 'Intervals Post Error: Invalid Data'}); + callback({error: 'Invalid Intervals Data'}); + return; + } + const schedulerLabel = JSON.stringify(data.instruction); + if(intervals[schedulerLabel]) { + ui.log(`CONTROLLER INPUT INTERVAL CLEARED: ${schedulerLabel}`); + clearInterval(intervals[schedulerLabel]); + delete intervals[schedulerLabel]; + } + if(typeof data.interval === 'number' && data.interval >= 100) { + ui.log(`CONTROLLER INPUT INTERVAL: ${schedulerLabel} @${data.interval}ms`); + intervals[schedulerLabel] = setInterval(() => { + ui.log(`CONTROLLER INPUT INTERVAL: ${schedulerLabel} @${data.interval}ms`); + try { + controller.write({type: data.instruction.type, data: data.instruction.data}); + } catch (err) { + ui.fail(`CONTROLLER INPUT ERROR: ${err}`); + socket.emit('server', {type: 'error', msg: `Controller TX Error: ${err}`}); + clearInterval(intervals[schedulerLabel]); + delete intervals[schedulerLabel]; + + callback({error: `Controller TX Error: ${err}`}); + return; + } + }, data.interval); + callback(); + } + }); + + socket.on('intervals-get', (data: unknown, callback: (keys: string[]) => void) => { + ui.log('INTERVALS GET'); + callback(Object.keys(intervals)); + }); + + socket.on('intervals-clear', (key: string, callback: (error?: {error: string}) => void) => { + ui.log(`INTERVALS CLEAR: ${key}`); + if(!intervals[key]) { + ui.fail(`INTERVALS CLEAR ERROR: No such key "${key}"`); + socket.emit('server', {type: 'error', msg: `Intervals Clear Error: No such key "${key}"`}); + callback({error: `No such key "${key}"`}); + return; + } + clearInterval(intervals[key]); + delete intervals[key]; + callback(); + }); + + // LINKER SOCKET HANDLERS + + socket.on('linker-post', (data: Linker & {label: string}, callback: (error?: {error: string}) => void) => { + ui.log(`LINKER POST: ${JSON.stringify(data)}`); + if(!data || !data.label || !data.key || !data.cast || !data.instruction || !data.eval || !data.instruction.type || !data.instruction.data) { + ui.fail('LINKER POST ERROR: Invalid Data'); + socket.emit('server', {type: 'error', msg: 'Linker Post Error: Invalid Data'}); + callback({error: 'Invalid Linker Data'}); + return; + } + if(!linker[data.label]) linker[data.label] = []; + linker[data.label].push({ + instruction: { + type: data.instruction.type, + data: { + ...data.instruction.data, + [data.key]: undefined + } + }, + key: data.key, + eval: data.eval, + cast: data.cast + }); + callback(); + }); + + socket.on('linker-get', (data: unknown, callback: (linker: {[key: string]: Linker[]}) => void) => { + ui.log('LINKER GET'); + callback(linker); + }); + + socket.on('linker-clear', (label: string, instruction: DebugJsonInstruction, callback: (error?: {error: string}) => void) => { + ui.log(`LINKER CLEAR: ${label} ${JSON.stringify(instruction)}`); + if(linker[label]) { + linker[label] = linker[label].filter((item) => { + return !(item.instruction.type === instruction.type && JSON.stringify(item.instruction.data) === JSON.stringify(instruction.data)); + }); + } + callback(); + }); + + // FIRMWARE & CAMERA HANDLERS + + socket.on('firmware', (_: unknown, callback: (error?: {error: string}) => void) => { + ui.start('FIRMWARE FLASH'); + if(argv.simulator) {callback({error: 'Simulator!'}); return;} + controller.stop(); + updateMicrocontroller().then(() => { + ui.succeed('FIRMWARE FLASH SUCCESSFUL'); + callback(); + }).catch((err) => { + ui.fail(`FIRMWARE FLASH ERROR: ${err}`); + socket.emit('server', {type: 'error', msg: `Firmware Flash Error: ${err}`}); + callback({error: `Firmware Flash Error: ${err}`}); + }); + }); + + socket.on('camera', async (_: unknown, callback: (response: {error?: string, mime?: string, blob?: Buffer}) => void) => { + if(argv.simulator) { callback({mime: 'image/jpeg', blob: readFileSync('sample.jpg')}); return; } + controller.write({type: 'config', data: { enable_camera: true }}); + try { + ui.start('CAMERA CAPTURE'); + const path = await cameraCapture(); + const buf = readFileSync(path); + ui.succeed('CAMERA CAPTURE SUCCESSFUL: ' + path); + callback({mime: 'image/jpeg', blob: buf}); + + if(pms.includes(PublishingMode.FIREBASE)) { + await uploadFile(buf, `camera-${Date.now()}.jpg`); + ui.succeed('CAMERA UPLOAD SUCCESSFUL'); + } + } catch (err) { + ui.fail(`CAMERA CAPTURE ERROR: ${err}`); + socket.emit('server', {type: 'error', msg: `Camera Capture Error: ${err}`}); + callback({error: `Camera Capture Error: ${err}`}); + } finally { + controller.write({type: 'config', data: { enable_camera: false }}); + } + }); + + // SCHEDULER + + const deleteScheduledById = (id: string) => { + const index = scheduler.findIndex((item) => item.entry.id === id); + if(index !== -1) { + const item = scheduler[index]; + if(item.interval) clearInterval(item.interval); + scheduler.splice(index, 1); + schedulerEmit(); + } + }; + + const schedulerEmit = () => { + scheduler.forEach((item) => { + socket.emit('scheduler', item.entry); + }); + console.log(`SCHEDULER EMIT (${scheduler.length} entries)`); + }; + + socket.on('scheduler-save', (callback: (error?: {error: string}) => void) => { + ui.log(`SCHEDULER SAVE ${JSON.stringify(scheduler.map((item) => item.entry))} => scheduler.json`); + try { + const data = JSON.stringify(scheduler.map((item) => item.entry)); + writeFileSync('scheduler.json', data, 'utf-8'); + ui.succeed('SCHEDULER SAVE SUCCESSFUL'); + callback(); + } catch (err) { + ui.fail(`SCHEDULER SAVE ERROR: ${err}`); + socket.emit('server', {type: 'error', msg: `Scheduler Save Error: ${err}`}); + callback({error: `Scheduler Save Error: ${err}`}); + } + }); + + const addSchedulerEntry = (data: SchedulerEntry) => { + scheduler.push({entry: {...data, date: new Date(data.date), endDate: data.entry === 'interval' ? new Date(data.endDate) : undefined, executed: data.entry === 'event' ? false : undefined, last: data.entry === 'interval' ? Date.now() : undefined}, instruction: data.instruction, interval: data.entry === 'interval' ? setTimeout(() => { + try{ + ui.log(`SCHEDULER INTERVAL START: ${JSON.stringify(data)}`); + controller.write(data.instruction); + setInterval(() => { + try { + ui.log(`SCHEDULER INTERVAL TRIGGER: ${JSON.stringify(data)}`); + controller.write(data.instruction); + } catch (err) { + ui.fail(`SCHEDULER INTERVAL ERROR: ${err}`); + socket.emit('server', {type: 'error', msg: `Scheduler Interval TX Error: ${err}`}); + deleteScheduledById(data.id); + } + }, data.interval); + } catch (err) { + ui.fail(`SCHEDULER INTERVAL ERROR: ${err}`); + socket.emit('server', {type: 'error', msg: `Scheduler Interval TX Error: ${err}`}); + deleteScheduledById(data.id); + } + }, new Date(data.date).getTime() - Date.now()) : data.entry === 'event' ? setTimeout(() => { + try { + ui.log(`SCHEDULER EVENT TRIGGER: ${JSON.stringify(data)}`); + controller.write(data.instruction); + } + catch (err) { + ui.fail(`SCHEDULER EVENT ERROR: ${err}`); + socket.emit('server', {type: 'error', msg: `Scheduler Event TX Error: ${err}`}); + } + deleteScheduledById(data.id); + }, new Date(data.date).getTime() - Date.now()) : undefined}); + }; + + socket.on('scheduler-load', (callback: (error?: {error: string}) => void) => { + // Overwrite entire scheduler with loaded data from scheduler.json + ui.log('SCHEDULER LOAD scheduler.json'); + try { + const data = readFileSync('scheduler.json', 'utf-8'); + const entries = JSON.parse(data); + scheduler.length = 0; + entries.forEach((entry: SchedulerEntry) => { + addSchedulerEntry(entry); + }); + ui.succeed('SCHEDULER LOAD SUCCESSFUL'); + callback(); + schedulerEmit(); + } catch (err) { + ui.fail(`SCHEDULER LOAD ERROR: ${err}`); + socket.emit('server', {type: 'error', msg: `Scheduler Load Error: ${err}`}); + callback({error: `Scheduler Load Error: ${err}`}); + } + }); + + socket.on('scheduler-post', (data: SchedulerEntry, callback: (error?: {error: string}) => void) => { + ui.log(`SCHEDULER CREATE ${data.entry === 'interval' ? 'INTERVAL' : 'EVENT'}: ${JSON.stringify(data)}`); + if(!data || !data.id || !data.entry || !data.instruction || !data.instruction.type || !data.instruction.data) { + ui.fail(`SCHEDULER CREATE ERROR: Invalid Data ${JSON.stringify(data)}`); + socket.emit('server', {type: 'error', msg: 'Scheduler Create Error: Invalid Data'}); + callback({error: 'Invalid Scheduler Data'}); + return; + } + + const idx = scheduler.findIndex((item) => item.entry.id === data.id); + if(idx !== -1) { + ui.fail(`SCHEDULER CREATE: ID "${data.id}" already exists; replacing...`); + deleteScheduledById(data.id); + } + + addSchedulerEntry(data); + callback(); + schedulerEmit(); + }); + + socket.on('scheduler-delete', (id: string, callback: (error?: {error: string}) => void) => { + ui.log(`SCHEDULER DELETE: ${id}`); + const index = scheduler.findIndex((item) => item.entry.id === id); + if(index === -1) { + ui.fail(`SCHEDULER DELETE ERROR: No such id "${id}"`); + socket.emit('server', {type: 'error', msg: `Scheduler Delete Error: No such id "${id}"`}); + callback({error: `No such id "${id}"`}); + return; + } + const item = scheduler[index]; + if(item.interval) clearInterval(item.interval); + scheduler.splice(index, 1); + callback(); + schedulerEmit(); + }); + + schedulerInterval = setInterval(schedulerEmit, SCHEDULER_INTERVAL); + }); + } + }); +})().catch((err) => { + ui.fail(`FATAL! ${err}`); + console.error(err); + process.exit(1); +}); \ No newline at end of file diff --git a/software/src/app/favicon.ico b/software/src/app/favicon.ico new file mode 100644 index 00000000..89dfd893 Binary files /dev/null and b/software/src/app/favicon.ico differ diff --git a/software/src/app/globals.css b/software/src/app/globals.css new file mode 100644 index 00000000..73130952 --- /dev/null +++ b/software/src/app/globals.css @@ -0,0 +1,20 @@ +@layer theme, base, mui, components, utilities; +@import 'tailwindcss'; + +:root { + --background: #fbfbf2; + --foreground: #203563; +} + +@media (prefers-color-scheme: dark) { + :root { + --background: #0a0a0a; + --foreground: #ededed; + } +} + +body { + color: var(--foreground); + background: var(--background); + font-family: Arial, Helvetica, sans-serif; +} \ No newline at end of file diff --git a/software/src/app/layout.tsx b/software/src/app/layout.tsx new file mode 100644 index 00000000..16d0af0d --- /dev/null +++ b/software/src/app/layout.tsx @@ -0,0 +1,44 @@ +import type { Metadata } from 'next'; +import React from 'react'; +import { Geist, Geist_Mono } from 'next/font/google'; +import '@/app/globals.css'; +import Footer from '@/atoms/footer'; +import { AppRouterCacheProvider } from '@mui/material-nextjs/v15-appRouter'; +import { ThemeProvider } from '@mui/material/styles'; +import theme from '../theme'; + +const geistSans = Geist({ + variable: '--font-geist-sans', + subsets: ['latin'], +}); + +const geistMono = Geist_Mono({ + variable: '--font-geist-mono', + subsets: ['latin'], +}); + +export const metadata: Metadata = { + title: 'PeaPod Dashboard', + // description: '', +}; + +export default function RootLayout({ + children, +}: Readonly<{ + children: React.ReactNode; +}>) { + return ( + + +

+ + {children} + +
+