esp32_BNO08x/documentation/latex/class_b_n_o08x_rpt_gravity.tex

244 lines
16 KiB
TeX

\doxysection{BNO08x\+Rpt\+Gravity Class Reference}
\hypertarget{class_b_n_o08x_rpt_gravity}{}\label{class_b_n_o08x_rpt_gravity}\index{BNO08xRptGravity@{BNO08xRptGravity}}
Class to represent gravity reports. (See Ref. Manual 6.\+5.\+11)
{\ttfamily \#include $<$BNO08x\+Rpt\+Gravity.\+hpp$>$}
Inheritance diagram for BNO08x\+Rpt\+Gravity\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=178pt]{class_b_n_o08x_rpt_gravity__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for BNO08x\+Rpt\+Gravity\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=270pt]{class_b_n_o08x_rpt_gravity__coll__graph}
\end{center}
\end{figure}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item
\mbox{\hyperlink{class_b_n_o08x_rpt_gravity_a472ced1c466461f64dda3d9132813dba}{BNO08x\+Rpt\+Gravity}} (uint8\+\_\+t \mbox{\hyperlink{class_b_n_o08x_rpt_a63cd4ac9e96baa43eebe580f03307512}{ID}}, Event\+Bits\+\_\+t \mbox{\hyperlink{class_b_n_o08x_rpt_ae78feab5682a4697c5acad3ca6f12c2e}{rpt\+\_\+bit}}, \mbox{\hyperlink{struct_b_n_o08x_private_types_1_1bno08x__sync__ctx__t}{BNO08x\+Private\+Types\+::bno08x\+\_\+sync\+\_\+ctx\+\_\+t}} \texorpdfstring{$\ast$}{*}\mbox{\hyperlink{class_b_n_o08x_rpt_a5a1404a08918d66bb0f41f55220db6e5}{sync\+\_\+ctx}})
\item
bool \mbox{\hyperlink{class_b_n_o08x_rpt_gravity_a5bb33cf233c6721fac992e447bd5b571}{enable}} (uint32\+\_\+t time\+\_\+between\+\_\+reports, sh2\+\_\+\+Sensor\+Config\+\_\+t sensor\+\_\+cfg=\mbox{\hyperlink{namespace_b_n_o08x_private_types_a4f68e627c3c54e471ec83756b97924da}{BNO08x\+Private\+Types\+::default\+\_\+sensor\+\_\+cfg}}) override
\begin{DoxyCompactList}\small\item\em Enables gravity reports such that the \doxylink{class_b_n_o08x}{BNO08x} begins sending them. \end{DoxyCompactList}\item
\mbox{\hyperlink{structbno08x__accel__t}{bno08x\+\_\+accel\+\_\+t}} \mbox{\hyperlink{class_b_n_o08x_rpt_gravity_a18ebbe93997c3ea985290e5b8fc23115}{get}} ()
\begin{DoxyCompactList}\small\item\em Grabs most recent gravity data, units are in m/s\texorpdfstring{$^\wedge$}{\string^}2. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions inherited from \mbox{\hyperlink{class_b_n_o08x_rpt}{BNO08x\+Rpt}}}
\begin{DoxyCompactItemize}
\item
bool \mbox{\hyperlink{class_b_n_o08x_rpt_a7d147e7540a4c6aa19749844e14cdadc}{disable}} (sh2\+\_\+\+Sensor\+Config\+\_\+t sensor\+\_\+cfg=\mbox{\hyperlink{namespace_b_n_o08x_private_types_a4f68e627c3c54e471ec83756b97924da}{BNO08x\+Private\+Types\+::default\+\_\+sensor\+\_\+cfg}})
\begin{DoxyCompactList}\small\item\em Disables a sensor report by setting its period to 0us such that the \doxylink{class_b_n_o08x}{BNO08x} stops sending it. \end{DoxyCompactList}\item
bool \mbox{\hyperlink{class_b_n_o08x_rpt_a5b542b28c81fcd05cf2e3f3d2d437d46}{register\+\_\+cb}} (std\+::function$<$ void(void)$>$ cb\+\_\+fxn)
\begin{DoxyCompactList}\small\item\em Registers a callback to execute when new data from a specific report is received. \end{DoxyCompactList}\item
bool \mbox{\hyperlink{class_b_n_o08x_rpt_a74f6037286b51382535bab61680297ed}{has\+\_\+new\+\_\+data}} ()
\begin{DoxyCompactList}\small\item\em Checks if a new report has been received since the last time this function was called. \end{DoxyCompactList}\item
bool \mbox{\hyperlink{class_b_n_o08x_rpt_ab3bb962696b135841ef7313bc631fc72}{flush}} ()
\begin{DoxyCompactList}\small\item\em Flush all buffered reports for this sensor/report module. \end{DoxyCompactList}\item
bool \mbox{\hyperlink{class_b_n_o08x_rpt_a7ce8e48cadf59f49068af7f1cb680b38}{get\+\_\+sample\+\_\+counts}} (\mbox{\hyperlink{structbno08x__sample__counts__t}{bno08x\+\_\+sample\+\_\+counts\+\_\+t}} \&sample\+\_\+counts)
\begin{DoxyCompactList}\small\item\em Gets sample counts for this sensor (see SH-\/2 ref manual 6.\+4.\+3.\+1) \end{DoxyCompactList}\item
bool \mbox{\hyperlink{class_b_n_o08x_rpt_a1418be33824d3102dbc8f92558a402a6}{clear\+\_\+sample\+\_\+counts}} ()
\begin{DoxyCompactList}\small\item\em Clears \doxylink{class_b_n_o08x}{BNO08x} internal sample counts for this sensor. (see SH-\/2 ref manual 6.\+4.\+3.\+1) \end{DoxyCompactList}\item
bool \mbox{\hyperlink{class_b_n_o08x_rpt_ad5b054279b01204f61b4c0408acf51cf}{get\+\_\+meta\+\_\+data}} (\mbox{\hyperlink{structbno08x__meta__data__t}{bno08x\+\_\+meta\+\_\+data\+\_\+t}} \&meta\+\_\+data)
\begin{DoxyCompactList}\small\item\em Retrieves meta data for this sensor/report by reading respective record in FRS (flash record system). \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item
void \mbox{\hyperlink{class_b_n_o08x_rpt_gravity_a47a5d1d8f89834662efaaae60a74b4c2}{update\+\_\+data}} (sh2\+\_\+\+Sensor\+Value\+\_\+t \texorpdfstring{$\ast$}{*}sensor\+\_\+val) override
\begin{DoxyCompactList}\small\item\em Updates gravity data from decoded sensor event. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item
\mbox{\hyperlink{structbno08x__accel__t}{bno08x\+\_\+accel\+\_\+t}} \mbox{\hyperlink{class_b_n_o08x_rpt_gravity_ab9fddb16529de63f82d04b29503e7dbe}{data}}
\end{DoxyCompactItemize}
\doxysubsubsection*{Static Private Attributes}
\begin{DoxyCompactItemize}
\item
static const constexpr char \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{class_b_n_o08x_rpt_gravity_a03dfa109a427c7657a2a5bdd3b5af68c}{TAG}} = "{}BNO08x\+Rpt\+Gravity"{}
\end{DoxyCompactItemize}
\doxysubsubsection*{Additional Inherited Members}
\doxysubsection*{Protected Member Functions inherited from \mbox{\hyperlink{class_b_n_o08x_rpt}{BNO08x\+Rpt}}}
\begin{DoxyCompactItemize}
\item
bool \mbox{\hyperlink{class_b_n_o08x_rpt_aa0bed98a9a497d1f39e8245d05b02e9c}{rpt\+\_\+enable}} (uint32\+\_\+t time\+\_\+between\+\_\+reports, sh2\+\_\+\+Sensor\+Config\+\_\+t sensor\+\_\+cfg=\mbox{\hyperlink{namespace_b_n_o08x_private_types_a4f68e627c3c54e471ec83756b97924da}{BNO08x\+Private\+Types\+::default\+\_\+sensor\+\_\+cfg}})
\begin{DoxyCompactList}\small\item\em Enables a sensor report such that the \doxylink{class_b_n_o08x}{BNO08x} begins sending it. \end{DoxyCompactList}\item
\mbox{\hyperlink{class_b_n_o08x_rpt_a15e8eebe3fe90ac19837e3860c76374c}{BNO08x\+Rpt}} (uint8\+\_\+t \mbox{\hyperlink{class_b_n_o08x_rpt_a63cd4ac9e96baa43eebe580f03307512}{ID}}, Event\+Bits\+\_\+t \mbox{\hyperlink{class_b_n_o08x_rpt_ae78feab5682a4697c5acad3ca6f12c2e}{rpt\+\_\+bit}}, \mbox{\hyperlink{struct_b_n_o08x_private_types_1_1bno08x__sync__ctx__t}{BNO08x\+Private\+Types\+::bno08x\+\_\+sync\+\_\+ctx\+\_\+t}} \texorpdfstring{$\ast$}{*}\mbox{\hyperlink{class_b_n_o08x_rpt_a5a1404a08918d66bb0f41f55220db6e5}{sync\+\_\+ctx}})
\begin{DoxyCompactList}\small\item\em \doxylink{class_b_n_o08x_rpt}{BNO08x\+Rpt} report constructor. \end{DoxyCompactList}\item
void \mbox{\hyperlink{class_b_n_o08x_rpt_a61e3451e93806e1b7eaf5f1387726765}{unlock\+\_\+sh2\+\_\+\+HAL}} ()
\begin{DoxyCompactList}\small\item\em Unlocks sh2 HAL lib to allow other tasks to call its APIs. \end{DoxyCompactList}\item
void \mbox{\hyperlink{class_b_n_o08x_rpt_a7a5619a74c1237c5abde2e4bd6619d12}{lock\+\_\+sh2\+\_\+\+HAL}} ()
\begin{DoxyCompactList}\small\item\em Locks sh2 HAL lib to only allow the calling task to call its APIs. \end{DoxyCompactList}\item
void \mbox{\hyperlink{class_b_n_o08x_rpt_a26bacc572187119339ec248bb4e7d6f3}{unlock\+\_\+user\+\_\+data}} ()
\begin{DoxyCompactList}\small\item\em Unlocks user data to allow other tasks to read/modify it. \end{DoxyCompactList}\item
void \mbox{\hyperlink{class_b_n_o08x_rpt_a48e7b1a2c2ebc6b1f2f292735c0832a0}{lock\+\_\+user\+\_\+data}} ()
\begin{DoxyCompactList}\small\item\em Locks locks user data to only allow the calling task to read/modify it. \end{DoxyCompactList}\item
void \mbox{\hyperlink{class_b_n_o08x_rpt_a47a623eb0a1db51af76a03a103c32329}{signal\+\_\+data\+\_\+available}} ()
\begin{DoxyCompactList}\small\item\em Signals to \doxylink{class_b_n_o08x_a367d525d1c0ba119b3dca3067bb5bccc}{BNO08x\+::data\+\_\+available()} that a new report has arrived. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Protected Attributes inherited from \mbox{\hyperlink{class_b_n_o08x_rpt}{BNO08x\+Rpt}}}
\begin{DoxyCompactItemize}
\item
uint8\+\_\+t \mbox{\hyperlink{class_b_n_o08x_rpt_a63cd4ac9e96baa43eebe580f03307512}{ID}}
\begin{DoxyCompactList}\small\item\em Report ID, ex. SH2\+\_\+\+ACCELERATION. \end{DoxyCompactList}\item
Event\+Bits\+\_\+t \mbox{\hyperlink{class_b_n_o08x_rpt_ae78feab5682a4697c5acad3ca6f12c2e}{rpt\+\_\+bit}}
\begin{DoxyCompactList}\small\item\em Respective enable and data bit for report in evt\+\_\+grp\+\_\+rpt\+\_\+en and evt\+\_\+grp\+\_\+rpt\+\_\+data. \end{DoxyCompactList}\item
uint32\+\_\+t \mbox{\hyperlink{class_b_n_o08x_rpt_a1d4d6f4cc6f1eae503863eedf7fb9f52}{period\+\_\+us}}
\begin{DoxyCompactList}\small\item\em The period/interval of the report in microseconds. \end{DoxyCompactList}\item
\mbox{\hyperlink{struct_b_n_o08x_private_types_1_1bno08x__sync__ctx__t}{BNO08x\+Private\+Types\+::bno08x\+\_\+sync\+\_\+ctx\+\_\+t}} \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{class_b_n_o08x_rpt_a5a1404a08918d66bb0f41f55220db6e5}{sync\+\_\+ctx}}
\end{DoxyCompactItemize}
\doxysubsection*{Static Protected Attributes inherited from \mbox{\hyperlink{class_b_n_o08x_rpt}{BNO08x\+Rpt}}}
\begin{DoxyCompactItemize}
\item
static const constexpr float \mbox{\hyperlink{class_b_n_o08x_rpt_a201aeb71fefb0d9d485914176a82dd80}{RAD\+\_\+2\+\_\+\+DEG}}
\begin{DoxyCompactList}\small\item\em Constant for radian to degree conversions, sed in quaternion to euler function conversions. \end{DoxyCompactList}\item
static const constexpr char \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{class_b_n_o08x_rpt_a2c57f370fb08b793bb10ec22d5acca45}{TAG}} = "{}BNO08x\+Rpt"{}
\end{DoxyCompactItemize}
\doxysubsection{Detailed Description}
Class to represent gravity reports. (See Ref. Manual 6.\+5.\+11)
\doxysubsection{Constructor \& Destructor Documentation}
\Hypertarget{class_b_n_o08x_rpt_gravity_a472ced1c466461f64dda3d9132813dba}\label{class_b_n_o08x_rpt_gravity_a472ced1c466461f64dda3d9132813dba}
\index{BNO08xRptGravity@{BNO08xRptGravity}!BNO08xRptGravity@{BNO08xRptGravity}}
\index{BNO08xRptGravity@{BNO08xRptGravity}!BNO08xRptGravity@{BNO08xRptGravity}}
\doxysubsubsection{\texorpdfstring{BNO08xRptGravity()}{BNO08xRptGravity()}}
{\footnotesize\ttfamily BNO08x\+Rpt\+Gravity\+::\+BNO08x\+Rpt\+Gravity (\begin{DoxyParamCaption}\item[{uint8\+\_\+t}]{ID, }\item[{Event\+Bits\+\_\+t}]{rpt\+\_\+bit, }\item[{\mbox{\hyperlink{struct_b_n_o08x_private_types_1_1bno08x__sync__ctx__t}{BNO08x\+Private\+Types\+::bno08x\+\_\+sync\+\_\+ctx\+\_\+t}} \texorpdfstring{$\ast$}{*}}]{sync\+\_\+ctx }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}
\doxysubsection{Member Function Documentation}
\Hypertarget{class_b_n_o08x_rpt_gravity_a5bb33cf233c6721fac992e447bd5b571}\label{class_b_n_o08x_rpt_gravity_a5bb33cf233c6721fac992e447bd5b571}
\index{BNO08xRptGravity@{BNO08xRptGravity}!enable@{enable}}
\index{enable@{enable}!BNO08xRptGravity@{BNO08xRptGravity}}
\doxysubsubsection{\texorpdfstring{enable()}{enable()}}
{\footnotesize\ttfamily bool BNO08x\+Rpt\+Gravity\+::enable (\begin{DoxyParamCaption}\item[{uint32\+\_\+t}]{time\+\_\+between\+\_\+reports, }\item[{sh2\+\_\+\+Sensor\+Config\+\_\+t}]{sensor\+\_\+cfg = {\ttfamily \mbox{\hyperlink{namespace_b_n_o08x_private_types_a4f68e627c3c54e471ec83756b97924da}{BNO08x\+Private\+Types\+::default\+\_\+sensor\+\_\+cfg}}} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [virtual]}}
Enables gravity reports such that the \doxylink{class_b_n_o08x}{BNO08x} begins sending them.
\begin{DoxyParams}{Parameters}
{\em report\+\_\+period\+\_\+us} & The period/interval of the report in microseconds. \\
\hline
{\em sensor\+\_\+cfg} & Sensor special configuration (optional, see \doxylink{namespace_b_n_o08x_private_types_a4f68e627c3c54e471ec83756b97924da}{BNO08x\+Private\+Types\+::default\+\_\+sensor\+\_\+cfg} for defaults).\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
True if report was successfully enabled.
\end{DoxyReturn}
Implements \mbox{\hyperlink{class_b_n_o08x_rpt_a4ee529725467412df396d5c610ff7bb4}{BNO08x\+Rpt}}.
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{class_b_n_o08x_rpt_gravity_a5bb33cf233c6721fac992e447bd5b571_cgraph}
\end{center}
\end{figure}
Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=321pt]{class_b_n_o08x_rpt_gravity_a5bb33cf233c6721fac992e447bd5b571_icgraph}
\end{center}
\end{figure}
\Hypertarget{class_b_n_o08x_rpt_gravity_a18ebbe93997c3ea985290e5b8fc23115}\label{class_b_n_o08x_rpt_gravity_a18ebbe93997c3ea985290e5b8fc23115}
\index{BNO08xRptGravity@{BNO08xRptGravity}!get@{get}}
\index{get@{get}!BNO08xRptGravity@{BNO08xRptGravity}}
\doxysubsubsection{\texorpdfstring{get()}{get()}}
{\footnotesize\ttfamily \mbox{\hyperlink{structbno08x__accel__t}{bno08x\+\_\+accel\+\_\+t}} BNO08x\+Rpt\+Gravity\+::get (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}
Grabs most recent gravity data, units are in m/s\texorpdfstring{$^\wedge$}{\string^}2.
\begin{DoxyReturn}{Returns}
Struct containing requested data.
\end{DoxyReturn}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{class_b_n_o08x_rpt_gravity_a18ebbe93997c3ea985290e5b8fc23115_cgraph}
\end{center}
\end{figure}
Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=306pt]{class_b_n_o08x_rpt_gravity_a18ebbe93997c3ea985290e5b8fc23115_icgraph}
\end{center}
\end{figure}
\Hypertarget{class_b_n_o08x_rpt_gravity_a47a5d1d8f89834662efaaae60a74b4c2}\label{class_b_n_o08x_rpt_gravity_a47a5d1d8f89834662efaaae60a74b4c2}
\index{BNO08xRptGravity@{BNO08xRptGravity}!update\_data@{update\_data}}
\index{update\_data@{update\_data}!BNO08xRptGravity@{BNO08xRptGravity}}
\doxysubsubsection{\texorpdfstring{update\_data()}{update\_data()}}
{\footnotesize\ttfamily void BNO08x\+Rpt\+Gravity\+::update\+\_\+data (\begin{DoxyParamCaption}\item[{sh2\+\_\+\+Sensor\+Value\+\_\+t \texorpdfstring{$\ast$}{*}}]{sensor\+\_\+val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [private]}, {\ttfamily [virtual]}}
Updates gravity data from decoded sensor event.
\begin{DoxyParams}{Parameters}
{\em sensor\+\_\+val} & The sh2\+\_\+\+Sensor\+Value\+\_\+t struct used in sh2\+\_\+decode\+Sensor\+Event() call.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void, nothing to return
\end{DoxyReturn}
Implements \mbox{\hyperlink{class_b_n_o08x_rpt_a970fb7e7d3745c62fec626f0ccf0759f}{BNO08x\+Rpt}}.
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{class_b_n_o08x_rpt_gravity_a47a5d1d8f89834662efaaae60a74b4c2_cgraph}
\end{center}
\end{figure}
\doxysubsection{Member Data Documentation}
\Hypertarget{class_b_n_o08x_rpt_gravity_ab9fddb16529de63f82d04b29503e7dbe}\label{class_b_n_o08x_rpt_gravity_ab9fddb16529de63f82d04b29503e7dbe}
\index{BNO08xRptGravity@{BNO08xRptGravity}!data@{data}}
\index{data@{data}!BNO08xRptGravity@{BNO08xRptGravity}}
\doxysubsubsection{\texorpdfstring{data}{data}}
{\footnotesize\ttfamily \mbox{\hyperlink{structbno08x__accel__t}{bno08x\+\_\+accel\+\_\+t}} BNO08x\+Rpt\+Gravity\+::data\hspace{0.3cm}{\ttfamily [private]}}
\Hypertarget{class_b_n_o08x_rpt_gravity_a03dfa109a427c7657a2a5bdd3b5af68c}\label{class_b_n_o08x_rpt_gravity_a03dfa109a427c7657a2a5bdd3b5af68c}
\index{BNO08xRptGravity@{BNO08xRptGravity}!TAG@{TAG}}
\index{TAG@{TAG}!BNO08xRptGravity@{BNO08xRptGravity}}
\doxysubsubsection{\texorpdfstring{TAG}{TAG}}
{\footnotesize\ttfamily const constexpr char\texorpdfstring{$\ast$}{*} BNO08x\+Rpt\+Gravity\+::\+TAG = "{}BNO08x\+Rpt\+Gravity"{}\hspace{0.3cm}{\ttfamily [static]}, {\ttfamily [constexpr]}, {\ttfamily [private]}}
The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item
include/report/\mbox{\hyperlink{_b_n_o08x_rpt_gravity_8hpp}{BNO08x\+Rpt\+Gravity.\+hpp}}\item
source/report/\mbox{\hyperlink{_b_n_o08x_rpt_gravity_8cpp}{BNO08x\+Rpt\+Gravity.\+cpp}}\end{DoxyCompactItemize}