\doxysection{ICM20948\+\_\+platform.\+h}
\hypertarget{ICM20948__platform_8h_source}{}\label{ICM20948__platform_8h_source}\index{src/ICM20948\_platform.h@{src/ICM20948\_platform.h}}
\mbox{\hyperlink{ICM20948__platform_8h}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00001}00001\ \textcolor{preprocessor}{\#ifndef\ ICM20948\_PLATFORM\_H}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00002}00002\ \textcolor{preprocessor}{\#define\ ICM20948\_PLATFORM\_H}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00003}00003\ }
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00004}00004\ \textcolor{comment}{//\ \#include\ <stdint.h>}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00005}00005\ \textcolor{comment}{//\ \#include\ <stddef.h>}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00006}00006\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00007}00007\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00008}00008\ \textcolor{comment}{\ *\ 7Semi\ comment\ style}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00009}00009\ \textcolor{comment}{\ *\ -\/\ Platform\ glue\ for\ bus\ IO,\ delays,\ and\ timing}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00010}00010\ \textcolor{comment}{\ *\ -\/\ Implement\ these\ for\ your\ system\ (I2C\ or\ SPI)}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00011}00011\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00012}00012\ }
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00013}\mbox{\hyperlink{structicm__plat__t}{00013}}\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct\ }\{\textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00014}00014\ \textcolor{comment}{\ \ /**\ }}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00015}00015\ \textcolor{comment}{\ \ \ \ \ *\ -\/\ Bus\ read:\ read\ \`{}len`\ bytes\ from\ \`{}reg`\ into\ \`{}buf`}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00016}00016\ \textcolor{comment}{\ \ \ \ \ *\ -\/\ Return\ 0\ on\ success,\ nonzero\ on\ error}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00017}00017\ \textcolor{comment}{\ \ \ \ \ */}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00018}\mbox{\hyperlink{structicm__plat__t_a5bdf6aab09ac76687060aab3f429177c}{00018}}\ \ \ int\ (*read)(uint8\_t\ reg,\ uint8\_t\ *buf,\ \textcolor{keywordtype}{size\_t}\ len,\ \textcolor{keywordtype}{void}\ *user);\textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00019}00019\ \textcolor{comment}{\ \ /**\ }}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00020}00020\ \textcolor{comment}{\ \ \ \ \ *\ -\/\ Bus\ write:\ write\ \`{}len`\ bytes\ from\ \`{}buf`\ to\ \`{}reg`}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00021}00021\ \textcolor{comment}{\ \ \ \ \ *\ -\/\ Return\ 0\ on\ success,\ nonzero\ on\ error}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00022}00022\ \textcolor{comment}{\ \ \ \ \ */}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00023}\mbox{\hyperlink{structicm__plat__t_a9df1e04508e6883fa346566871d0db8c}{00023}}\ \ \ int\ (*write)(uint8\_t\ reg,\ \textcolor{keyword}{const}\ uint8\_t\ *buf,\ \textcolor{keywordtype}{size\_t}\ len,\ \textcolor{keywordtype}{void}\ *user);\textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00024}00024\ \textcolor{comment}{\ \ /**\ }}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00025}00025\ \textcolor{comment}{\ \ \ \ \ *\ -\/\ Optional:\ SPI\ transfers\ may\ need\ register\ R/W\ bit\ mangling}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00026}00026\ \textcolor{comment}{\ \ \ \ \ *\ -\/\ For\ I2C,\ leave\ as\ NULL}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00027}00027\ \textcolor{comment}{\ \ \ \ \ */}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00028}\mbox{\hyperlink{structicm__plat__t_aa062ed0b3b8deab83c3eec08852eb1b0}{00028}}\ \ \ uint8\_t\ (*spi\_reg\_rw\_bits)(uint8\_t\ reg,\ \textcolor{keywordtype}{int}\ is\_write);\textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00029}00029\ \textcolor{comment}{\ \ /**\ }}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00030}00030\ \textcolor{comment}{\ \ \ \ \ *\ -\/\ Millisecond\ delay}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00031}00031\ \textcolor{comment}{\ \ \ \ \ */}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00032}\mbox{\hyperlink{structicm__plat__t_a007afe99d158d09cfd11bccc56e60cf9}{00032}}\ \ \ void\ (*delay\_ms)(uint32\_t\ ms);\textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00033}00033\ \textcolor{comment}{\ \ /**\ }}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00034}00034\ \textcolor{comment}{\ \ \ \ \ *\ -\/\ User\ context\ pointer\ passed\ to\ read/write}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00035}00035\ \textcolor{comment}{\ \ \ \ \ */}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00036}\mbox{\hyperlink{structicm__plat__t_aa568650352ead6ca41379e9468dbd204}{00036}}\ \ \ \textcolor{keywordtype}{void}\ *\mbox{\hyperlink{structicm__plat__t_aa568650352ead6ca41379e9468dbd204}{user}};\textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00037}00037\ \textcolor{comment}{\ \ /**\ }}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00038}00038\ \textcolor{comment}{\ \ \ \ \ *\ -\/\ If\ using\ SPI:\ set\ chip\ select\ active\ (1)\ or\ inactive\ (0)}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00039}00039\ \textcolor{comment}{\ \ \ \ \ *\ -\/\ For\ I2C:\ leave\ as\ NULL}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00040}00040\ \textcolor{comment}{\ \ \ \ \ */}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00041}\mbox{\hyperlink{structicm__plat__t_a26ca1c8442adbe5b2cf19163c8b77a49}{00041}}\ \ \ void\ (*spi\_cs)(\textcolor{keywordtype}{int}\ level,\ \textcolor{keywordtype}{void}\ *user);\textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00042}00042\ \textcolor{comment}{\ \ /**\ }}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00043}00043\ \textcolor{comment}{\ \ \ \ \ *\ -\/\ Device\ address\ (I2C)\ or\ ignored\ for\ SPI\ if\ you\ wrap\ inside\ user}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00044}00044\ \textcolor{comment}{\ \ \ \ \ */}}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00045}\mbox{\hyperlink{structicm__plat__t_a4c7b153cd772538a1e63ade3e8b792e6}{00045}}\ \ \ uint8\_t\ \mbox{\hyperlink{structicm__plat__t_a4c7b153cd772538a1e63ade3e8b792e6}{i2c\_addr}};}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00046}00046\ \}\ \mbox{\hyperlink{structicm__plat__t}{icm\_plat\_t}};}
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00047}00047\ }
\DoxyCodeLine{\Hypertarget{ICM20948__platform_8h_source_l00048}00048\ \textcolor{preprocessor}{\#endif}}

\end{DoxyCode}
