diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-04-24 07:14:13 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-04-24 07:14:13 +0200 |
| commit | 33fcf6f036ceb43e6766a3c3dceea7b31db38b69 (patch) | |
| tree | aba69d9d362a68ef10b57d07eefa87cab0b6a9bd /docs | |
| parent | 6d8d4718dea52236e8c5e8284bc6edad7c589ab8 (diff) | |
dev, lib: 30pin protocol added, fix bootnet header too.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/tex/30pin.tex | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/docs/tex/30pin.tex b/docs/tex/30pin.tex new file mode 100644 index 0000000..53ef393 --- /dev/null +++ b/docs/tex/30pin.tex @@ -0,0 +1,73 @@ + +\documentclass{article} +\usepackage{listings} +\usepackage{xcolor} +\usepackage{geometry} +\usepackage{titlesec} +\usepackage{fancyhdr} +\usepackage{amsmath} +\usepackage{amsfonts} +\usepackage{graphicx} +\usepackage{enumitem} +\geometry{margin=1in} + +\titleformat{\section}{\large\bfseries}{\thesection}{1em}{} +\titleformat{\subsection}{\normalsize\bfseries}{\thesubsection}{1em}{} + +\title{\texttt{30pin.h} Specification} +\author{Amlal EL Mahrouss} +\date{2024} + +\lstset{ + basicstyle=\ttfamily\footnotesize, + keywordstyle=\color{blue}, + commentstyle=\color{gray}, + stringstyle=\color{red}, + showstringspaces=false, + breaklines=true +} + +\begin{document} + +\maketitle + +\section*{File Description} +\textbf{File:} \texttt{30pin.h} \\ +\textbf{Description:} This header defines the 30pin recovery protocol structures, constants, and packet kinds. + +\section{Constants} +\begin{itemize}[leftmargin=2em] + \item \texttt{CB\_30PIN\_MAG} - Magic number identifier for a 30pin packet. Defined as \texttt{"TP"}. + \item \texttt{CP\_30PIN\_MAG\_LEN} - Length of the magic number (\texttt{2} bytes). + \item \texttt{CB\_30PIN\_BUFFER\_LEN} - Length of the data buffer in the packet (\texttt{498} bytes). + \item \texttt{CB\_30PIN\_EOP\_LEN} - Length of the end-of-packet data (\texttt{11} bytes). +\end{itemize} + +\section{Data Structures} +\subsection{\texttt{cb\_tpin\_recovery\_packet}} +\begin{lstlisting}[language=C] +struct _cb_tpin_recovery_packet +{ + uint8_t mag[CP_30PIN_MAG_LEN]; // Magic number + uint8_t kind; // Packet kind identifier + uint8_t buffer[CB_30PIN_BUFFER_LEN]; // Packet data buffer + uint8_t eop[CB_30PIN_EOP_LEN]; // End-of-packet data +}; +\end{lstlisting} + +\textbf{Typedef:} \texttt{cb\_tpin\_recovery\_packet\_t} + +\section{Enumerations} +\subsection{Packet Kinds} +Defines the kinds of packets used in the 30pin recovery protocol: + +\begin{itemize}[leftmargin=2em] + \item \texttt{TPIN\_RECOVERY\_PACKET\_KIND\_UNKNOWN = 0} + \item \texttt{TPIN\_RECOVERY\_PACKET\_KIND\_BOOT = 1} + \item \texttt{TPIN\_RECOVERY\_PACKET\_KIND\_DATA = 2} + \item \texttt{TPIN\_RECOVERY\_PACKET\_KIND\_EOP = 3} + \item \texttt{TPIN\_RECOVERY\_PACKET\_KIND\_EOP\_ACK = 4} + \item \texttt{TPIN\_RECOVERY\_PACKET\_KIND\_EOP\_NACK = 5} +\end{itemize} + +\end{document} |
