\doxysection{BNO08x\+SH2\+HAL.\+hpp}
\hypertarget{_b_n_o08x_s_h2_h_a_l_8hpp_source}{}\label{_b_n_o08x_s_h2_h_a_l_8hpp_source}\index{include/BNO08xSH2HAL.hpp@{include/BNO08xSH2HAL.hpp}}
\mbox{\hyperlink{_b_n_o08x_s_h2_h_a_l_8hpp}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ }
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#pragma\ once}}
\DoxyCodeLine{00007\ }
\DoxyCodeLine{00008\ \textcolor{comment}{//\ hill-\/crest\ labs\ includes\ (apache\ 2.0\ license,\ compatible\ with\ MIT)}}
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ "{}sh2.h"{}}}
\DoxyCodeLine{00010\ \textcolor{preprocessor}{\#include\ "{}sh2\_SensorValue.h"{}}}
\DoxyCodeLine{00011\ \textcolor{preprocessor}{\#include\ "{}sh2\_err.h"{}}}
\DoxyCodeLine{00012\ \textcolor{comment}{//\ esp-\/idf\ includes}}
\DoxyCodeLine{00013\ \textcolor{preprocessor}{\#include\ <esp\_log.h>}}
\DoxyCodeLine{00014\ \textcolor{preprocessor}{\#include\ <esp\_timer.h>}}
\DoxyCodeLine{00015\ \textcolor{comment}{//\ in-\/house\ includes}}
\DoxyCodeLine{00016\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{_b_n_o08x_private_types_8hpp}{BNO08xPrivateTypes.hpp}}"{}}}
\DoxyCodeLine{00017\ }
\DoxyCodeLine{00024\ \textcolor{preprocessor}{\#define\ UINT16\_CLR\_MSB(val\_16bit)\ ((val\_16bit)\ \&\ 0x00FFU)}}
\DoxyCodeLine{00025\ }
\DoxyCodeLine{00032\ \textcolor{preprocessor}{\#define\ UINT16\_CLR\_LSB(val\_16bit)\ ((val\_16bit)\ \&\ 0xFF00U)}}
\DoxyCodeLine{00033\ }
\DoxyCodeLine{00041\ \textcolor{preprocessor}{\#define\ UINT32\_CLR\_BYTE(val\_32bit,\ byte2clear)\ ((val\_32bit)\ \&\ \string~(0xFFUL\ <<\ (byte2clear\ *\ 8UL)))}}
\DoxyCodeLine{00042\ }
\DoxyCodeLine{00050\ \textcolor{preprocessor}{\#define\ UINT32\_MSK\_BYTE(val\_32bit,\ byte2mask)\ ((val\_32bit)\ \&\ (0xFFUL\ <<\ (byte2mask\ *\ 8UL)))}}
\DoxyCodeLine{00051\ }
\DoxyCodeLine{00052\ \textcolor{comment}{//\ parsing\ universal\ to\ any\ packet}}
\DoxyCodeLine{00053\ }
\DoxyCodeLine{00060\ \textcolor{preprocessor}{\#define\ PARSE\_PACKET\_LENGTH(header)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00061\ \textcolor{preprocessor}{\ \ \ \ (UINT16\_CLR\_LSB(static\_cast<uint16\_t>(header[1])\ <<\ 8U)\ |\ UINT16\_CLR\_MSB(static\_cast<uint16\_t>(header[0])))}}
\DoxyCodeLine{00062\ }
\DoxyCodeLine{00063\ \textcolor{comment}{//\ forward\ dec\ to\ prevent\ compile\ errors}}
\DoxyCodeLine{00064\ \textcolor{keyword}{class\ }\mbox{\hyperlink{class_b_n_o08x}{BNO08x}};}
\DoxyCodeLine{00065\ }
\DoxyCodeLine{00071\ \textcolor{keyword}{class\ }\mbox{\hyperlink{class_b_n_o08x_s_h2_h_a_l}{BNO08xSH2HAL}}}
\DoxyCodeLine{00072\ \{}
\DoxyCodeLine{00073\ \ \ \ \ \textcolor{keyword}{public}:}
\DoxyCodeLine{00074\ \ \ \ \ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{class_b_n_o08x_s_h2_h_a_l_a236ccf0ff8d36060b465bc1f4f0a37fa}{set\_hal\_imu}}(\mbox{\hyperlink{class_b_n_o08x}{BNO08x}}*\ hal\_imu);}
\DoxyCodeLine{00075\ }
\DoxyCodeLine{00076\ \ \ \ \ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{int}\ \mbox{\hyperlink{class_b_n_o08x_s_h2_h_a_l_ae079b1384cba806a778eb0e27f981da0}{spi\_open}}(sh2\_Hal\_t*\ self);}
\DoxyCodeLine{00077\ \ \ \ \ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{class_b_n_o08x_s_h2_h_a_l_a5fa6b901d1790fcd7dc0905f62ae040f}{spi\_close}}(sh2\_Hal\_t*\ self);}
\DoxyCodeLine{00078\ \ \ \ \ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{int}\ \mbox{\hyperlink{class_b_n_o08x_s_h2_h_a_l_a3e691461235b3e3c59866ac179d06f25}{spi\_read}}(sh2\_Hal\_t*\ self,\ uint8\_t*\ pBuffer,\ \textcolor{keywordtype}{unsigned}\ len,\ uint32\_t*\ t\_us);}
\DoxyCodeLine{00079\ \ \ \ \ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{int}\ \mbox{\hyperlink{class_b_n_o08x_s_h2_h_a_l_a96d5b8fa7669f22cd0ecaf1feee13299}{spi\_write}}(sh2\_Hal\_t*\ self,\ uint8\_t*\ pBuffer,\ \textcolor{keywordtype}{unsigned}\ len);}
\DoxyCodeLine{00080\ \ \ \ \ \ \ \ \ \textcolor{keyword}{static}\ uint32\_t\ \mbox{\hyperlink{class_b_n_o08x_s_h2_h_a_l_ad89b6a3166e2eee003ad87a517a31cd5}{get\_time\_us}}(sh2\_Hal\_t*\ self);}
\DoxyCodeLine{00081\ \ \ \ \ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{class_b_n_o08x_s_h2_h_a_l_a1add67e38698c9f33541af7bd2912d8f}{hal\_cb}}(\textcolor{keywordtype}{void}*\ cookie,\ sh2\_AsyncEvent\_t*\ pEvent);}
\DoxyCodeLine{00082\ \ \ \ \ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{class_b_n_o08x_s_h2_h_a_l_a19c041ef614d7eda85b94b10202a3997}{sensor\_event\_cb}}(\textcolor{keywordtype}{void}*\ cookie,\ sh2\_SensorEvent\_t*\ event);}
\DoxyCodeLine{00083\ }
\DoxyCodeLine{00084\ \ \ \ \ \textcolor{keyword}{private}:}
\DoxyCodeLine{00085\ \ \ \ \ \ \ \ \ \textcolor{keyword}{static}\ \mbox{\hyperlink{class_b_n_o08x}{BNO08x}}*\ \mbox{\hyperlink{class_b_n_o08x_s_h2_h_a_l_a1c77b8db18fc54406af8bb8a36e346c8}{imu}};}
\DoxyCodeLine{00086\ \ \ \ \ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{class_b_n_o08x_s_h2_h_a_l_a0c4cc938180a997fb94c0c34c0dce07e}{hardware\_reset}}();}
\DoxyCodeLine{00087\ \ \ \ \ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{class_b_n_o08x_s_h2_h_a_l_a15b568922a498b988bd8b897b3ae2278}{spi\_wait\_for\_int}}();}
\DoxyCodeLine{00088\ \ \ \ \ \ \ \ \ \textcolor{keyword}{static}\ uint16\_t\ \mbox{\hyperlink{class_b_n_o08x_s_h2_h_a_l_ac63619162addd952a2af599cb414783f}{spi\_read\_sh2\_packet\_header}}(uint8\_t*\ pBuffer);}
\DoxyCodeLine{00089\ \ \ \ \ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{int}\ \mbox{\hyperlink{class_b_n_o08x_s_h2_h_a_l_a6003e3011b0e8208e2632f729e195922}{spi\_read\_sh2\_packet\_body}}(uint8\_t*\ pBuffer,\ uint16\_t\ packet\_sz);}
\DoxyCodeLine{00090\ }
\DoxyCodeLine{00091\ \ \ \ \ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keyword}{const}\ \textcolor{keyword}{constexpr}\ \textcolor{keywordtype}{char}*\ \mbox{\hyperlink{class_b_n_o08x_s_h2_h_a_l_a36760cb9c002cfa410197ecd552f5a8a}{TAG}}\ =\ \textcolor{stringliteral}{"{}BNO08xSH2HAL"{}};}
\DoxyCodeLine{00092\ \};}

\end{DoxyCode}
