123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292 |
- /** \mainpage
- *
- ****************************************************************************
- * Copyright (C) 2014 Bosch Sensortec GmbH
- *
- * File : bmi160.h
- *
- * Date : 2014/12/12
- *
- * Revision : 2.0.5 $
- *
- * Usage: Sensor Driver for BMI160 sensor
- *
- ****************************************************************************
- *
- * \section License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * Neither the name of the copyright holder nor the names of the
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER
- * OR CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- * OR CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
- *
- * The information provided is believed to be accurate and reliable.
- * The copyright holder assumes no responsibility
- * for the consequences of use
- * of such information nor for any infringement of patents or
- * other rights of third parties which may result from its use.
- * No license is granted by implication or otherwise under any patent or
- * patent rights of the copyright holder.
- **************************************************************************/
- /*! \file bmi160.h
- \brief BMI160 Sensor Driver Support Header File */
- /* user defined code to be added here ... */
- #ifndef __BMI160_H__
- #define __BMI160_H__
- /*!
- * @brief The following definition uses for define the data types
- *
- * @note While porting the API please consider the following
- * @note Please check the version of C standard
- * @note Are you using Linux platform
- */
- /*!
- * @brief For the Linux platform support
- * Please use the types.h for your data types definitions
- */
- #ifdef __KERNEL__
- #include <linux/types.h>
- /* singed integer type*/
- typedef int8_t s8;/**< used for signed 8bit */
- typedef int16_t s16;/**< used for signed 16bit */
- typedef int32_t s32;/**< used for signed 32bit */
- typedef int64_t s64;/**< used for signed 64bit */
- typedef u_int8_t u8;/**< used for unsigned 8bit */
- typedef u_int16_t u16;/**< used for unsigned 16bit */
- typedef u_int32_t u32;/**< used for unsigned 32bit */
- typedef u_int64_t u64;/**< used for unsigned 64bit */
- #else /* ! __KERNEL__ */
- /**********************************************************
- * These definition uses for define the C
- * standard version data types
- ***********************************************************/
- # if !defined(__STDC_VERSION__)
- /************************************************
- * compiler is C11 C standard
- ************************************************/
- #if (__STDC_VERSION__ == 201112L)
- /************************************************/
- #include <stdint.h>
- /************************************************/
- /*unsigned integer types*/
- typedef uint8_t u8;/**< used for unsigned 8bit */
- typedef uint16_t u16;/**< used for unsigned 16bit */
- typedef uint32_t u32;/**< used for unsigned 32bit */
- typedef uint64_t u64;/**< used for unsigned 64bit */
- /*signed integer types*/
- typedef int8_t s8;/**< used for signed 8bit */
- typedef int16_t s16;/**< used for signed 16bit */
- typedef int32_t s32;/**< used for signed 32bit */
- typedef int64_t s64;/**< used for signed 64bit */
- /************************************************
- * compiler is C99 C standard
- ************************************************/
- #elif (__STDC_VERSION__ == 199901L)
- /* stdint.h is a C99 supported c library.
- which is used to fixed the integer size*/
- /************************************************/
- #include <stdint.h>
- /************************************************/
- /*unsigned integer types*/
- typedef uint8_t u8;/**< used for unsigned 8bit */
- typedef uint16_t u16;/**< used for unsigned 16bit */
- typedef uint32_t u32;/**< used for unsigned 32bit */
- typedef uint64_t u64;/**< used for unsigned 64bit */
- /*signed integer types*/
- typedef int8_t s8;/**< used for signed 8bit */
- typedef int16_t s16;/**< used for signed 16bit */
- typedef int32_t s32;/**< used for signed 32bit */
- typedef int64_t s64;/**< used for signed 64bit */
- /************************************************
- * compiler is C89 or other C standard
- ************************************************/
- #else /* !defined(__STDC_VERSION__) */
- /*!
- * @brief By default it is defined as 32 bit machine configuration
- * define your data types based on your
- * machine/compiler/controller configuration
- */
- #define MACHINE_32_BIT
- /*! @brief
- * If your machine support 16 bit
- * define the MACHINE_16_BIT
- */
- #ifdef MACHINE_16_BIT
- #include <limits.h>
- /*signed integer types*/
- typedef signed char s8;/**< used for signed 8bit */
- typedef signed short int s16;/**< used for signed 16bit */
- typedef signed long int s32;/**< used for signed 32bit */
- #if defined(LONG_MAX) && LONG_MAX == 0x7fffffffffffffffL
- typedef long int s64;/**< used for signed 64bit */
- typedef unsigned long int u64;/**< used for unsigned 64bit */
- #elif defined(LLONG_MAX) && (LLONG_MAX == 0x7fffffffffffffffLL)
- typedef long long int s64;/**< used for signed 64bit */
- typedef unsigned long long int u64;/**< used for unsigned 64bit */
- #else
- #warning Either the correct data type for signed 64 bit integer \
- could not be found, or 64 bit integers are not supported in your environment.
- #warning If 64 bit integers are supported on your platform, \
- please set s64 manually.
- #endif
- /*unsigned integer types*/
- typedef unsigned char u8;/**< used for unsigned 8bit */
- typedef unsigned short int u16;/**< used for unsigned 16bit */
- typedef unsigned long int u32;/**< used for unsigned 32bit */
- /* If your machine support 32 bit
- define the MACHINE_32_BIT*/
- #elif defined MACHINE_32_BIT
- /*signed integer types*/
- typedef signed char s8;/**< used for signed 8bit */
- typedef signed short int s16;/**< used for signed 16bit */
- typedef signed int s32;/**< used for signed 32bit */
- typedef signed long long int s64;/**< used for signed 64bit */
- /*unsigned integer types*/
- typedef unsigned char u8;/**< used for unsigned 8bit */
- typedef unsigned short int u16;/**< used for unsigned 16bit */
- typedef unsigned int u32;/**< used for unsigned 32bit */
- typedef unsigned long long int u64;/**< used for unsigned 64bit */
- /* If your machine support 64 bit
- define the MACHINE_64_BIT*/
- #elif defined MACHINE_64_BIT
- /*signed integer types*/
- typedef signed char s8;/**< used for signed 8bit */
- typedef signed short int s16;/**< used for signed 16bit */
- typedef signed int s32;/**< used for signed 32bit */
- typedef signed long int s64;/**< used for signed 64bit */
- /*unsigned integer types*/
- typedef unsigned char u8;/**< used for unsigned 8bit */
- typedef unsigned short int u16;/**< used for unsigned 16bit */
- typedef unsigned int u32;/**< used for unsigned 32bit */
- typedef unsigned long int u64;/**< used for unsigned 64bit */
- #else
- #warning The data types defined above which not supported \
- define the data types manually
- #endif
- #endif
- /*** This else will execute for the compilers
- * which are not supported the C standards
- * Like C89/C99/C11***/
- #else
- /*!
- * @brief By default it is defined as 32 bit machine configuration
- * define your data types based on your
- * machine/compiler/controller configuration
- */
- #define MACHINE_32_BIT
- /* If your machine support 16 bit
- define the MACHINE_16_BIT*/
- #ifdef MACHINE_16_BIT
- #include <limits.h>
- /*signed integer types*/
- typedef signed char s8;/**< used for signed 8bit */
- typedef signed short int s16;/**< used for signed 16bit */
- typedef signed long int s32;/**< used for signed 32bit */
- #if defined(LONG_MAX) && LONG_MAX == 0x7fffffffffffffffL
- typedef long int s64;/**< used for signed 64bit */
- typedef unsigned long int u64;/**< used for unsigned 64bit */
- #elif defined(LLONG_MAX) && (LLONG_MAX == 0x7fffffffffffffffLL)
- typedef long long int s64;/**< used for signed 64bit */
- typedef unsigned long long int u64;/**< used for unsigned 64bit */
- #else
- #warning Either the correct data type for signed 64 bit integer \
- could not be found, or 64 bit integers are not supported in your environment.
- #warning If 64 bit integers are supported on your platform, \
- please set s64 manually.
- #endif
- /*unsigned integer types*/
- typedef unsigned char u8;/**< used for unsigned 8bit */
- typedef unsigned short int u16;/**< used for unsigned 16bit */
- typedef unsigned long int u32;/**< used for unsigned 32bit */
- /*! @brief If your machine support 32 bit
- define the MACHINE_32_BIT*/
- #elif defined MACHINE_32_BIT
- /*signed integer types*/
- typedef signed char s8;/**< used for signed 8bit */
- typedef signed short int s16;/**< used for signed 16bit */
- typedef signed int s32;/**< used for signed 32bit */
- typedef signed long long int s64;/**< used for signed 64bit */
- /*unsigned integer types*/
- typedef unsigned char u8;/**< used for unsigned 8bit */
- typedef unsigned short int u16;/**< used for unsigned 16bit */
- typedef unsigned int u32;/**< used for unsigned 32bit */
- typedef unsigned long long int u64;/**< used for unsigned 64bit */
- /* If your machine support 64 bit
- define the MACHINE_64_BIT*/
- #elif defined MACHINE_64_BIT
- /*signed integer types*/
- typedef signed char s8;/**< used for signed 8bit */
- typedef signed short int s16;/**< used for signed 16bit */
- typedef signed int s32;/**< used for signed 32bit */
- typedef signed long int s64;/**< used for signed 64bit */
- /*unsigned integer types*/
- typedef unsigned char u8;/**< used for unsigned 8bit */
- typedef unsigned short int u16;/**< used for unsigned 16bit */
- typedef unsigned int u32;/**< used for unsigned 32bit */
- typedef unsigned long int u64;/**< used for unsigned 64bit */
- #else
- #warning The data types defined above which not supported \
- define the data types manually
- #endif
- #endif
- #endif
- /***************************************************************/
- /**\name BUS READ AND WRITE FUNCTION POINTERS */
- /***************************************************************/
- /*!
- @brief Define the calling convention of YOUR bus communication routine.
- @note This includes types of parameters. This example shows the
- configuration for an SPI bus link.
- If your communication function looks like this:
- write_my_bus_xy(u8 device_addr, u8 register_addr,
- u8 * data, u8 length);
- The BMI160_WR_FUNC_PTR would equal:
- BMI160_WR_FUNC_PTR s8 (* bus_write)(u8,
- u8, u8 *, u8)
- Parameters can be mixed as needed refer to the
- @ref BMI160_BUS_WRITE_FUNC macro.
- */
- #define BMI160_WR_FUNC_PTR s8 (*bus_write)(u8, u8 ,\
- u8 *, u8)
- /**< link macro between API function calls and bus write function
- @note The bus write function can change since this is a
- system dependant issue.
- If the bus_write parameter calling order is like: reg_addr,
- reg_data, wr_len it would be as it is here.
- If the parameters are differently ordered or your communication
- function like I2C need to know the device address,
- you can change this macro accordingly.
- BMI160_BUS_WRITE_FUNC(dev_addr, reg_addr, reg_data, wr_len)\
- bus_write(dev_addr, reg_addr, reg_data, wr_len)
- This macro lets all API functions call YOUR communication routine in a
- way that equals your definition in the
- @ref BMI160_WR_FUNC_PTR definition.
- */
- #define BMI160_BUS_WRITE_FUNC(dev_addr, reg_addr, reg_data, wr_len)\
- bus_write(dev_addr, reg_addr, reg_data, wr_len)
- /**< Define the calling convention of YOUR bus communication routine.
- @note This includes types of parameters. This example shows the
- configuration for an SPI bus link.
- If your communication function looks like this:
- read_my_bus_xy(u8 device_addr, u8 register_addr,
- u8 * data, u8 length);
- The BMI160_RD_FUNC_PTR would equal:
- BMI160_RD_FUNC_PTR s8 (* bus_read)(u8,
- u8, u8 *, u8)
- Parameters can be mixed as needed refer to the
- refer BMI160_BUS_READ_FUNC macro.
- */
- #define BMI160_SPI_RD_MASK 0x80 /* for spi read transactions on SPI the
- MSB has to be set */
- #define BMI160_RD_FUNC_PTR s8 (*bus_read)(u8,\
- u8 , u8 *, u8)
- #define BMI160_BRD_FUNC_PTR s8 \
- (*burst_read)(u8, u8, u8 *, u32)
- /**< link macro between API function calls and bus read function
- @note The bus write function can change since this is a
- system dependant issue.
- If the bus_read parameter calling order is like: reg_addr,
- reg_data, wr_len it would be as it is here.
- If the parameters are differently ordered or your communication
- function like I2C need to know the device address,
- you can change this macro accordingly.
- BMI160_BUS_READ_FUNC(dev_addr, reg_addr, reg_data, wr_len)\
- bus_read(dev_addr, reg_addr, reg_data, wr_len)
- This macro lets all API functions call YOUR communication routine in a
- way that equals your definition in the
- refer BMI160_WR_FUNC_PTR definition.
- @note: this macro also includes the "MSB='1'
- for reading BMI160 addresses.
- */
- #define BMI160_BUS_READ_FUNC(dev_addr, reg_addr, reg_data, r_len)\
- bus_read(dev_addr, reg_addr, reg_data, r_len)
- #define BMI160_BURST_READ_FUNC(device_addr, \
- register_addr, register_data, rd_len)\
- burst_read(device_addr, register_addr, register_data, rd_len)
- #define BMI160_MDELAY_DATA_TYPE u32
- /***************************************************************/
- /**\name BUS READ AND WRITE FUNCTION POINTERS */
- /***************************************************************/
- #define BMI160_I2C_ADDR1 0x68 /**< I2C Address needs to be changed */
- #define BMI160_I2C_ADDR2 0x69 /**< I2C Address needs to be changed */
- #define BMI160_BMM150_I2C_ADDRESS 0x10/**< I2C address of BMM150*/
- #define BMI160_AKM09911_I2C_ADDRESS 0x0C/**< I2C address of AKM09911*/
- #define BMI160_YAS532_I2C_ADDRESS 0x2E/**< I2C address of YAS532*/
- /*******************************************/
- /**\name CONSTANTS */
- /******************************************/
- #define C_BMI160_ZERO_U8X ((u8)0)
- #define C_BMI160_ONE_U8X ((u8)1)
- #define C_BMI160_TWO_U8X ((u8)2)
- #define C_BMI160_THREE_U8X ((u8)3)
- #define C_BMI160_FOUR_U8X ((u8)4)
- #define C_BMI160_FIVE_U8X ((u8)5)
- #define C_BMI160_SIX_U8X ((u8)6)
- #define C_BMI160_SEVEN_U8X ((u8)7)
- #define C_BMI160_EIGHT_U8X ((u8)8)
- #define C_BMI160_NINE_U8X ((u8)9)
- #define C_BMI160_TEN_U8X ((u8)10)
- #define C_BMI160_ELEVEN_U8X ((u8)11)
- #define C_BMI160_TWELVE_U8X ((u8)12)
- #define C_BMI160_THIRTEEN_U8X ((u8)13)
- #define C_BMI160_FOURTEEN_U8X ((u8)14)
- #define C_BMI160_FIVETEEN_U8X ((u8)15)
- #define C_BMI160_SEVENTEEN_U8X ((u8)17)
- #define C_BMI160_EIGHTEEN_U8X ((u8)18)
- #define C_BMI160_NINETEEN_U8X ((u8)19)
- #define C_BMI160_TWENTY_U8X ((u8)20)
- #define C_BMI160_THIRTY_TWO_U8X ((u8)32)
- #define C_BMI160_THIRTY_EIGHT_U8X ((u8)38)
- #define C_BMI160_FIVETY_U8X ((u8)50)
- #define C_BMI160_SIXTY_U8X ((u8)60)
- #define C_BMI160_SIXTY_ONE_U8X ((u8)61)
- #define C_BMI160_SIXTY_FOUR_U8X ((u8)64)
- #define C_BMI160_HUNDRED_U8X ((u8)100)
- #define C_BMI160_TWO_HUNDRED_U8X ((u8)200)
- #define C_BMI160_THOUSAND_U8X ((u16)1000)
- #define C_BMI160_MINUS_ONE_S8X ((s8)-1)
- #define C_BMI160_FIFTEEN_U8X ((u8)15)
- #define C_BMI160_SIXTEEN_U8X ((u8)16)
- #define C_BMI160_THIRTYONE_U8X ((u8)31)
- #define C_BMI160_THIRTYTWO_U8X ((u8)32)
- #define BMI160_MAXIMUM_TIMEOUT ((u8)10)
- /****************************************************/
- /**\name ARRAY SIZE DEFINITIONS */
- /***************************************************/
- #define ARRAY_SIZE_TWO 2
- #define ARRAY_SIZE_THREE 3
- #define ARRAY_SIZE_SIX 6
- #define ARRAY_SIZE_FIVE 5
- #define ARRAY_SIZE_EIGHT 8
- #define ARRAY_SIZE_SIXTEEN 16
- #define ARRAY_SIZE_FOURTEEN 14
- #define INDEX_ZERO 0
- #define INDEX_ONE 1
- #define INDEX_TWO 2
- #define INDEX_THREE 3
- #define INDEX_FOUR 4
- #define INDEX_FIVE 5
- #define INDEX_SIX 6
- #define INDEX_SEVEN 7
- #define INDEX_EIGHT 8
- #define INDEX_NINE 9
- #define INDEX_TEN 10
- #define INDEX_ELEVEN 11
- #define INDEX_TWELVE 12
- #define INDEX_THIRTEEN 13
- /****************************************************/
- /**\name ARRAY PARAMETERS */
- /***************************************************/
- #define LSB_ZERO 0
- #define MSB_ONE 1
- #define LSB_TWO 2
- #define MSB_THREE 3
- #define LSB_FOUR 4
- #define MSB_FIVE 5
- #define LSB_SIX 6
- #define MSB_SEVEN 7
- /****************************************************/
- /**\name ERROR CODES */
- /***************************************************/
- #define E_BMI160_NULL_PTR ((s8)-127)
- #define E_BMI160_COMM_RES ((s8)-1)
- #define E_BMI160_OUT_OF_RANGE ((s8)-2)
- #define E_BMI160_BUSY ((s8)-3)
- #define SUCCESS ((u8)0)
- #define ERROR ((s8)-1)
- /* Constants */
- #define BMI160_NULL 0
- #define BMI160_DELAY_SETTLING_TIME 5
- /*This refers BMI160 return type as s8 */
- #define BMI160_RETURN_FUNCTION_TYPE s8
- /****************************************************/
- /**\name REGISTER DEFINITIONS */
- /***************************************************/
- /*******************/
- /**\name CHIP ID */
- /*******************/
- #define BMI160_USER_CHIP_ID_ADDR 0x00
- /*******************/
- /**\name ERROR STATUS */
- /*******************/
- #define BMI160_USER_ERROR_ADDR 0X02
- /*******************/
- /**\name POWER MODE STATUS */
- /*******************/
- #define BMI160_USER_PMU_STAT_ADDR 0X03
- /*******************/
- /**\name MAG DATA REGISTERS */
- /*******************/
- #define BMI160_USER_DATA_0_ADDR 0X04
- #define BMI160_USER_DATA_1_ADDR 0X05
- #define BMI160_USER_DATA_2_ADDR 0X06
- #define BMI160_USER_DATA_3_ADDR 0X07
- #define BMI160_USER_DATA_4_ADDR 0X08
- #define BMI160_USER_DATA_5_ADDR 0X09
- #define BMI160_USER_DATA_6_ADDR 0X0A
- #define BMI160_USER_DATA_7_ADDR 0X0B
- /*******************/
- /**\name GYRO DATA REGISTERS */
- /*******************/
- #define BMI160_USER_DATA_8_ADDR 0X0C
- #define BMI160_USER_DATA_9_ADDR 0X0D
- #define BMI160_USER_DATA_10_ADDR 0X0E
- #define BMI160_USER_DATA_11_ADDR 0X0F
- #define BMI160_USER_DATA_12_ADDR 0X10
- #define BMI160_USER_DATA_13_ADDR 0X11
- #define BMI160_USER_DATA_14_ADDR 0X12
- #define BMI160_USER_DATA_15_ADDR 0X13
- /*******************/
- /**\name ACCEL DATA REGISTERS */
- /*******************/
- #define BMI160_USER_DATA_16_ADDR 0X14
- #define BMI160_USER_DATA_17_ADDR 0X15
- #define BMI160_USER_DATA_18_ADDR 0X16
- #define BMI160_USER_DATA_19_ADDR 0X17
- /*******************/
- /**\name SENSOR TIME REGISTERS */
- /*******************/
- #define BMI160_USER_SENSORTIME_0_ADDR 0X18
- #define BMI160_USER_SENSORTIME_1_ADDR 0X19
- #define BMI160_USER_SENSORTIME_2_ADDR 0X1A
- /*******************/
- /**\name STATUS REGISTER FOR SENSOR STATUS FLAG */
- /*******************/
- #define BMI160_USER_STAT_ADDR 0X1B
- /*******************/
- /**\name INTERRUPY STATUS REGISTERS */
- /*******************/
- #define BMI160_USER_INTR_STAT_0_ADDR 0X1C
- #define BMI160_USER_INTR_STAT_1_ADDR 0X1D
- #define BMI160_USER_INTR_STAT_2_ADDR 0X1E
- #define BMI160_USER_INTR_STAT_3_ADDR 0X1F
- /*******************/
- /**\name TEMPERATURE REGISTERS */
- /*******************/
- #define BMI160_USER_TEMPERATURE_0_ADDR 0X20
- #define BMI160_USER_TEMPERATURE_1_ADDR 0X21
- /*******************/
- /**\name FIFO REGISTERS */
- /*******************/
- #define BMI160_USER_FIFO_LENGTH_0_ADDR 0X22
- #define BMI160_USER_FIFO_LENGTH_1_ADDR 0X23
- #define BMI160_USER_FIFO_DATA_ADDR 0X24
- /***************************************************/
- /**\name ACCEL CONFIG REGISTERS FOR ODR, BANDWIDTH AND UNDERSAMPLING*/
- /******************************************************/
- #define BMI160_USER_ACCEL_CONFIG_ADDR 0X40
- /*******************/
- /**\name ACCEL RANGE */
- /*******************/
- #define BMI160_USER_ACCEL_RANGE_ADDR 0X41
- /***************************************************/
- /**\name GYRO CONFIG REGISTERS FOR ODR AND BANDWIDTH */
- /******************************************************/
- #define BMI160_USER_GYRO_CONFIG_ADDR 0X42
- /*******************/
- /**\name GYRO RANGE */
- /*******************/
- #define BMI160_USER_GYRO_RANGE_ADDR 0X43
- /***************************************************/
- /**\name MAG CONFIG REGISTERS FOR ODR*/
- /******************************************************/
- #define BMI160_USER_MAG_CONFIG_ADDR 0X44
- /***************************************************/
- /**\name REGISTER FOR GYRO AND ACCEL DOWNSAMPLING RATES FOR FIFO*/
- /******************************************************/
- #define BMI160_USER_FIFO_DOWN_ADDR 0X45
- /***************************************************/
- /**\name FIFO CONFIG REGISTERS*/
- /******************************************************/
- #define BMI160_USER_FIFO_CONFIG_0_ADDR 0X46
- #define BMI160_USER_FIFO_CONFIG_1_ADDR 0X47
- /***************************************************/
- /**\name MAG INTERFACE REGISTERS*/
- /******************************************************/
- #define BMI160_USER_MAG_IF_0_ADDR 0X4B
- #define BMI160_USER_MAG_IF_1_ADDR 0X4C
- #define BMI160_USER_MAG_IF_2_ADDR 0X4D
- #define BMI160_USER_MAG_IF_3_ADDR 0X4E
- #define BMI160_USER_MAG_IF_4_ADDR 0X4F
- /***************************************************/
- /**\name INTERRUPT ENABLE REGISTERS*/
- /******************************************************/
- #define BMI160_USER_INTR_ENABLE_0_ADDR 0X50
- #define BMI160_USER_INTR_ENABLE_1_ADDR 0X51
- #define BMI160_USER_INTR_ENABLE_2_ADDR 0X52
- #define BMI160_USER_INTR_OUT_CTRL_ADDR 0X53
- /***************************************************/
- /**\name LATCH DURATION REGISTERS*/
- /******************************************************/
- #define BMI160_USER_INTR_LATCH_ADDR 0X54
- /***************************************************/
- /**\name MAP INTERRUPT 1 and 2 REGISTERS*/
- /******************************************************/
- #define BMI160_USER_INTR_MAP_0_ADDR 0X55
- #define BMI160_USER_INTR_MAP_1_ADDR 0X56
- #define BMI160_USER_INTR_MAP_2_ADDR 0X57
- /***************************************************/
- /**\name DATA SOURCE REGISTERS*/
- /******************************************************/
- #define BMI160_USER_INTR_DATA_0_ADDR 0X58
- #define BMI160_USER_INTR_DATA_1_ADDR 0X59
- /***************************************************/
- /**\name
- INTERRUPT THRESHOLD, HYSTERESIS, DURATION, MODE CONFIGURATION REGISTERS*/
- /******************************************************/
- #define BMI160_USER_INTR_LOWHIGH_0_ADDR 0X5A
- #define BMI160_USER_INTR_LOWHIGH_1_ADDR 0X5B
- #define BMI160_USER_INTR_LOWHIGH_2_ADDR 0X5C
- #define BMI160_USER_INTR_LOWHIGH_3_ADDR 0X5D
- #define BMI160_USER_INTR_LOWHIGH_4_ADDR 0X5E
- #define BMI160_USER_INTR_MOTION_0_ADDR 0X5F
- #define BMI160_USER_INTR_MOTION_1_ADDR 0X60
- #define BMI160_USER_INTR_MOTION_2_ADDR 0X61
- #define BMI160_USER_INTR_MOTION_3_ADDR 0X62
- #define BMI160_USER_INTR_TAP_0_ADDR 0X63
- #define BMI160_USER_INTR_TAP_1_ADDR 0X64
- #define BMI160_USER_INTR_ORIENT_0_ADDR 0X65
- #define BMI160_USER_INTR_ORIENT_1_ADDR 0X66
- #define BMI160_USER_INTR_FLAT_0_ADDR 0X67
- #define BMI160_USER_INTR_FLAT_1_ADDR 0X68
- /***************************************************/
- /**\name FAST OFFSET CONFIGURATION REGISTER*/
- /******************************************************/
- #define BMI160_USER_FOC_CONFIG_ADDR 0X69
- /***************************************************/
- /**\name MISCELLANEOUS CONFIGURATION REGISTER*/
- /******************************************************/
- #define BMI160_USER_CONFIG_ADDR 0X6A
- /***************************************************/
- /**\name SERIAL INTERFACE SETTINGS REGISTER*/
- /******************************************************/
- #define BMI160_USER_IF_CONFIG_ADDR 0X6B
- /***************************************************/
- /**\name GYRO POWER MODE TRIGGER REGISTER */
- /******************************************************/
- #define BMI160_USER_PMU_TRIGGER_ADDR 0X6C
- /***************************************************/
- /**\name SELF_TEST REGISTER*/
- /******************************************************/
- #define BMI160_USER_SELF_TEST_ADDR 0X6D
- /***************************************************/
- /**\name SPI,I2C SELECTION REGISTER*/
- /******************************************************/
- #define BMI160_USER_NV_CONFIG_ADDR 0x70
- /***************************************************/
- /**\name ACCEL AND GYRO OFFSET REGISTERS*/
- /******************************************************/
- #define BMI160_USER_OFFSET_0_ADDR 0X71
- #define BMI160_USER_OFFSET_1_ADDR 0X72
- #define BMI160_USER_OFFSET_2_ADDR 0X73
- #define BMI160_USER_OFFSET_3_ADDR 0X74
- #define BMI160_USER_OFFSET_4_ADDR 0X75
- #define BMI160_USER_OFFSET_5_ADDR 0X76
- #define BMI160_USER_OFFSET_6_ADDR 0X77
- /***************************************************/
- /**\name STEP COUNTER INTERRUPT REGISTERS*/
- /******************************************************/
- #define BMI160_USER_STEP_COUNT_0_ADDR 0X78
- #define BMI160_USER_STEP_COUNT_1_ADDR 0X79
- /***************************************************/
- /**\name STEP COUNTER CONFIGURATION REGISTERS*/
- /******************************************************/
- #define BMI160_USER_STEP_CONFIG_0_ADDR 0X7A
- #define BMI160_USER_STEP_CONFIG_1_ADDR 0X7B
- /***************************************************/
- /**\name COMMAND REGISTER*/
- /******************************************************/
- #define BMI160_CMD_COMMANDS_ADDR 0X7E
- /***************************************************/
- /**\name PAGE REGISTERS*/
- /******************************************************/
- #define BMI160_CMD_EXT_MODE_ADDR 0X7F
- #define BMI160_COM_C_TRIM_FIVE_ADDR 0X85
- /****************************************************/
- /**\name SHIFT VALUE DEFINITION */
- /***************************************************/
- #define BMI160_SHIFT_1_POSITION 1
- #define BMI160_SHIFT_2_POSITION 2
- #define BMI160_SHIFT_3_POSITION 3
- #define BMI160_SHIFT_4_POSITION 4
- #define BMI160_SHIFT_5_POSITION 5
- #define BMI160_SHIFT_6_POSITION 6
- #define BMI160_SHIFT_7_POSITION 7
- #define BMI160_SHIFT_8_POSITION 8
- #define BMI160_SHIFT_9_POSITION 9
- #define BMI160_SHIFT_12_POSITION 12
- #define BMI160_SHIFT_13_POSITION 13
- #define BMI160_SHIFT_14_POSITION 14
- #define BMI160_SHIFT_15_POSITION 15
- #define BMI160_SHIFT_16_POSITION 16
- /****************************************************/
- /**\name DEFINITIONS USED FOR YAMAHA-YAS532 */
- /***************************************************/
- #define YAS532_MAG_STATE_NORMAL (0)
- #define YAS532_MAG_STATE_INIT_COIL (1)
- #define YAS532_MAG_STATE_MEASURE_OFFSET (2)
- #define YAS532_MAG_INITCOIL_TIMEOUT (1000)
- #define YAS532_MAG_NOTRANS_POSITION (3)
- #define YAS532_DEFAULT_SENSOR_DELAY (50)
- #define YAS532_DATA_OVERFLOW (8190)
- #define YAS532_DATA_UNDERFLOW (0)
- #define YAS532_MAG_TEMPERATURE_LOG (10)
- #define YAS532_TEMP20DEGREE_TYPICAL (390)
- #define YAS532_VERSION_AC_COEF_X (850)
- #define YAS532_VERSION_AC_COEF_Y1 (750)
- #define YAS532_VERSION_AC_COEF_Y2 (750)
- #define YAS532_DATA_CENTER (4096)
- /****************************************************/
- /**\name YAMAHA-YAS532 OFFSET DEFINITION */
- /***************************************************/
- static const s8 INVALID_OFFSET[] = {0x7f, 0x7f, 0x7f};
- #define set_vector(to, from) \
- {int _l; for (_l = 0; _l < 3; _l++) (to)[_l] = (from)[_l]; }
- #define is_valid_offset(a) \
- (((a)[0] <= 31) && ((a)[1] <= 31) && ((a)[2] <= 31) \
- && (-31 <= (a)[0]) && (-31 <= (a)[1]) && (-31 <= (a)[2]))
- /**************************************************/
- /**\name YAS532 CALIB DATA DEFINITIONS */
- /*************************************************/
- #define YAS532_CALIB_THOUSAND_TWO_EIGHTY 1280
- #define YAS532_CALIB_HEX_ZERO_THREE_F 0x03F
- #define YAS532_CALIB_HEX_ZERO_C 0x0C
- #define YAS532_CALIB_HEX_ZERO_THREE 0x03
- #define YAS532_CALIB_HEX_THREE_F 0x3F
- #define YAS532_CALIB_HEX_THREE_ZERO 0x30
- #define YAS532_CALIB_HEX_ZERO_F 0x0F
- #define YAS532_CALIB_HEX_SEVEN_EIGHT 0x78
- #define YAS532_CALIB_HEX_ZERO_SEVEN 0x07
- #define YAS532_CALIB_HEX_THREE_E 0x3E
- #define YAS532_CALIB_HEX_ZERO_ONE 0x01
- #define YAS532_CALIB_HEX_F_E 0xFE
- #define YAS532_CALIB_HEX_ONE_F 0x1F
- #define YAS532_CALIB_CX 0
- #define YAS532_CALIB_CY1 1
- #define YAS532_CALIB_CY2 2
- /* register address of YAS532*/
- #define BMI160_YAS532_TESTR1 0x88
- #define BMI160_YAS532_TESTR2 0x89
- #define BMI160_YAS532_RCOIL 0x81
- #define BMI160_YAS532_COMMAND_REGISTER 0x82
- #define BMI160_YAS532_DATA_REGISTER 0xB0
- /* calib data register definition*/
- #define BMI160_YAS532_CALIB_CX 0x90
- #define BMI160_YAS532_CALIB_CY1 0x91
- #define BMI160_YAS532_CALIB_CY2 0x92
- #define BMI160_YAS532_CALIB1 0x93
- #define BMI160_YAS532_CALIB2 0x94
- #define BMI160_YAS532_CALIB3 0x95
- #define BMI160_YAS532_CALIB4 0x96
- #define BMI160_YAS532_CALIB5 0x97
- #define BMI160_YAS532_CLAIB6 0x98
- #define BMI160_YAS532_CALIB7 0x99
- #define BMI160_YAS532_CALIB8 0x9A
- #define BMI160_YAS532_CALIIB9 0x9B
- #define BMI160_YAS532_CALIB10 0x9C
- #define BMI160_YAS532_CALIB11 0x9D
- /* offset definition */
- #define BMI160_YAS532_OFFSET_X 0x85
- #define BMI160_YAS532_OFFSET_Y 0x86
- #define BMI160_YAS532_OFFSET_Z 0x87
- /* data to write register for yas532*/
- #define BMI160_YAS532_WRITE_DATA_ZERO 0x00
- /**************************************************/
- /**\name YAS532 DATA REGISTER */
- /*************************************************/
- #define YAS532_HEX_ZERO_ONE 0x01
- #define YAS532_HEX_THREE_F_EIGHT 0x3F8
- #define YAS532_HEX_ZERO_SEVEN 0x07
- #define YAS532_HEX_ONE_F_C_ZERO 0x1FC0
- #define YAS532_HEX_THREE_F 0x3F
- /**************************************************/
- /**\name YAS532 OFFSET */
- /*************************************************/
- #define YAS532_CORRECT_OFFSET_16 16
- #define YAS532_CORRECT_OFFSET_8 8
- #define YAS532_CORRECT_OFFSET_4 4
- #define YAS532_CORRECT_OFFSET_2 2
- #define YAS532_CORRECT_OFFSET_1 1
- #define CALIB_LINEAR_3721 3721
- #define CALIB_LINEAR_3971 3971
- #define CALIB_LINEAR_4221 4221
- #define CALIB_LINEAR_4471 4471
- /****************************************************/
- /**\name AKM09911 DEFINITION */
- /***************************************************/
- #define AKM09911_SENSITIVITY_DIV 128
- #define AKM_ASAX 0
- #define AKM_ASAY 1
- #define AKM_ASAZ 2
- #define AKM_POWER_DOWN_MODE_DATA 0x00
- #define AKM_FUSE_ROM_MODE 0x1F
- #define AKM_POWER_MODE_REG 0x31
- #define AKM_SINGLE_MEASUREMENT_MODE 0x01
- #define AKM_DATA_REGISTER 0x11
- /****************************************************/
- /**\name BMM150 DEFINITION */
- /***************************************************/
- #define BMM150_HEX_0_1_DATA 0x01
- #define BMM150_HEX_0_0_DATA 0x00
- #define BMM150_MAX_RETRY_WAKEUP 5
- #define BMM150_POWER_ON 0x01
- #define BMM150_POWER_OFF 0x00
- #define BMM150_FORCE_MODE 0x02
- #define BMM150_POWER_ON_SUCCESS 0
- #define BMM150_POWER_ON_FAIL ((s8)-1)
- #define BMM150_CALIB_HEX_FOUR_THOUSAND 0x4000
- #define BMM150_CALIB_HEX_LACKS 0x100000
- #define BMM150_CALIB_HEX_A_ZERO 0xA0
- #define BMM150_DIG_X1 0
- #define BMM150_DIG_Y1 1
- #define BMM150_DIG_X2 2
- #define BMM150_DIG_Y3 3
- #define BMM150_DIG_XY1 4
- #define BMM150_DIG_XY2 5
- #define BMM150_DIG_Z1_LSB 6
- #define BMM150_DIG_Z1_MSB 7
- #define BMM150_DIG_Z2_LSB 8
- #define BMM150_DIG_Z2_MSB 9
- #define BMM150_DIG_DIG_Z3_LSB 10
- #define BMM150_DIG_DIG_Z3_MSB 11
- #define BMM150_DIG_DIG_Z4_LSB 12
- #define BMM150_DIG_DIG_Z4_MSB 13
- #define BMM150_DIG_DIG_XYZ1_LSB 14
- #define BMM150_DIG_DIG_XYZ1_MSB 15
- /**************************************************************/
- /**\name STRUCTURE DEFINITIONS */
- /**************************************************************/
- /*!
- * @brief bmi160 structure
- * This structure holds all relevant information about bmi160
- */
- struct bmi160_t {
- u8 chip_id;/**< chip id of BMI160 */
- u8 dev_addr;/**< device address of BMI160 */
- u8 mag_manual_enable;/**< used for check the mag manual/auto mode status */
- BMI160_WR_FUNC_PTR;/**< bus write function pointer */
- BMI160_RD_FUNC_PTR;/**< bus read function pointer */
- BMI160_BRD_FUNC_PTR;/**< burst write function pointer */
- void (*delay_msec)(BMI160_MDELAY_DATA_TYPE);/**< delay function pointer */
- };
- /*!
- * @brief Structure containing bmm150 and akm09911
- * magnetometer values for x,y and
- * z-axis in s16
- */
- struct bmi160_mag_t {
- s16 x;/**< BMM150 and AKM09911 X raw data*/
- s16 y;/**< BMM150 and AKM09911 Y raw data*/
- s16 z;/**< BMM150 and AKM09911 Z raw data*/
- };
- /*!
- * @brief Structure containing bmm150 xyz data and temperature
- */
- struct bmi160_mag_xyzr_t {
- s16 x;/**< BMM150 X raw data*/
- s16 y;/**< BMM150 Y raw data*/
- s16 z;/**<BMM150 Z raw data*/
- u16 r;/**<BMM150 R raw data*/
- };
- /*!
- * @brief Structure containing gyro xyz data
- */
- struct bmi160_gyro_t {
- s16 x;/**<gyro X data*/
- s16 y;/**<gyro Y data*/
- s16 z;/**<gyro Z data*/
- };
- /*!
- * @brief Structure containing accel xyz data
- */
- struct bmi160_accel_t {
- s16 x;/**<accel X data*/
- s16 y;/**<accel Y data*/
- s16 z;/**<accel Z data*/
- };
- /*!
- * @brief Structure bmm150 mag compensated data with s32 output
- */
- struct bmi160_mag_xyz_s32_t {
- s32 x;/**<BMM150 X compensated data*/
- s32 y;/**<BMM150 Y compensated data*/
- s32 z;/**<BMM150 Z compensated data*/
- };
- /*!
- * @brief Structure bmm150 mag trim data
- */
- struct trim_data_t {
- s8 dig_x1;/**<BMM150 trim x1 data*/
- s8 dig_y1;/**<BMM150 trim y1 data*/
- s8 dig_x2;/**<BMM150 trim x2 data*/
- s8 dig_y2;/**<BMM150 trim y2 data*/
- u16 dig_z1;/**<BMM150 trim z1 data*/
- s16 dig_z2;/**<BMM150 trim z2 data*/
- s16 dig_z3;/**<BMM150 trim z3 data*/
- s16 dig_z4;/**<BMM150 trim z4 data*/
- u8 dig_xy1;/**<BMM150 trim xy1 data*/
- s8 dig_xy2;/**<BMM150 trim xy2 data*/
- u16 dig_xyz1;/**<BMM150 trim xyz1 data*/
- };
- /*!
- * @brief Used to read the akm compensated values
- */
- struct bmi160_bst_akm_xyz_t {
- s16 x;/**<AKM09911 X compensated data*/
- s16 y;/**<AKM09911 Y compensated data*/
- s16 z;/**<AKM09911 Z compensated data*/
- };
- /*!
- * @brief Structure for reading AKM compensating data
- */
- struct bst_akm_sensitivity_data_t {
- s8 asax;/**<AKM09911 X sensitivity data*/
- s8 asay;/**<AKM09911 Y sensitivity data*/
- s8 asaz;/**<AKM09911 Z sensitivity data*/
- };
- /*!
- * @brief YAMAHA-YAS532 struct
- * Calibration YAS532 data struct
- */
- struct bst_yas532_calib_data_t {
- s32 cx;/**<YAS532 calib cx data */
- s32 cy1;/**<YAS532 calib cy1 data */
- s32 cy2;/**<YAS532 calib cy2 data */
- s32 a2;/**<YAS532 calib a2 data */
- s32 a3;/**<YAS532 calib a3 data */
- s32 a4;/**<YAS532 calib a4 data */
- s32 a5;/**<YAS532 calib a5 data */
- s32 a6;/**<YAS532 calib a6 data */
- s32 a7;/**<YAS532 calib a7 data */
- s32 a8;/**<YAS532 calib a8 data */
- s32 a9;/**<YAS532 calib a9 data */
- s32 k;/**<YAS532 calib k data */
- s8 rxy1y2[3];/**<YAS532 calib rxy1y2 data */
- u8 fxy1y2[3];/**<YAS532 calib fxy1y2 data */
- };
- /*!
- * @brief YAS532 Temperature structure
- */
- #if 1 < YAS532_MAG_TEMPERATURE_LOG
- struct yas_temp_filter_t {
- u16 log[YAS532_MAG_TEMPERATURE_LOG];/**<YAS532 temp log array */
- u8 num;/**< used for increment the index */
- u8 idx;/**< used for increment the index */
- };
- #endif
- /*!
- * @brief YAS532 sensor initialization
- */
- struct yas532_t {
- struct bst_yas532_calib_data_t calib_yas532;/**< calib data */
- s8 measure_state;/**< update measure state */
- s8 v_hard_offset_s8[3];/**< offset write array*/
- s32 coef[3];/**< co efficient data */
- s8 overflow;/**< over flow condition check */
- u8 dev_id;/**< device id information */
- const s8 *transform;/**< transform condition check */
- #if 1 < YAS532_MAG_TEMPERATURE_LOG
- struct yas_temp_filter_t temp_data;/**< temp data */
- #endif
- u16 last_raw[4];/**< raw data */
- };
- /*!
- * @brief Used for reading the YAS532 XYZ data
- */
- struct yas532_vector {
- s32 yas532_vector_xyz[3];/**< YAS532 compensated xyz data*/
- };
- /**************************************************************/
- /**\name USER DATA REGISTERS DEFINITION START */
- /**************************************************************/
- /**************************************************************/
- /**\name CHIP ID LENGTH, POSITION AND MASK */
- /**************************************************************/
- /* Chip ID Description - Reg Addr --> 0x00, Bit --> 0...7 */
- #define BMI160_USER_CHIP_ID__POS 0
- #define BMI160_USER_CHIP_ID__MSK 0xFF
- #define BMI160_USER_CHIP_ID__LEN 8
- #define BMI160_USER_CHIP_ID__REG BMI160_USER_CHIP_ID_ADDR
- /**************************************************************/
- /**\name ERROR STATUS LENGTH, POSITION AND MASK */
- /**************************************************************/
- /* Error Description - Reg Addr --> 0x02, Bit --> 0 */
- #define BMI160_USER_ERR_STAT__POS 0
- #define BMI160_USER_ERR_STAT__LEN 8
- #define BMI160_USER_ERR_STAT__MSK 0xFF
- #define BMI160_USER_ERR_STAT__REG BMI160_USER_ERROR_ADDR
- #define BMI160_USER_FATAL_ERR__POS 0
- #define BMI160_USER_FATAL_ERR__LEN 1
- #define BMI160_USER_FATAL_ERR__MSK 0x01
- #define BMI160_USER_FATAL_ERR__REG BMI160_USER_ERROR_ADDR
- /* Error Description - Reg Addr --> 0x02, Bit --> 1...4 */
- #define BMI160_USER_ERR_CODE__POS 1
- #define BMI160_USER_ERR_CODE__LEN 4
- #define BMI160_USER_ERR_CODE__MSK 0x1E
- #define BMI160_USER_ERR_CODE__REG BMI160_USER_ERROR_ADDR
- /* Error Description - Reg Addr --> 0x02, Bit --> 5 */
- #define BMI160_USER_I2C_FAIL_ERR__POS 5
- #define BMI160_USER_I2C_FAIL_ERR__LEN 1
- #define BMI160_USER_I2C_FAIL_ERR__MSK 0x20
- #define BMI160_USER_I2C_FAIL_ERR__REG BMI160_USER_ERROR_ADDR
- /* Error Description - Reg Addr --> 0x02, Bit --> 6 */
- #define BMI160_USER_DROP_CMD_ERR__POS 6
- #define BMI160_USER_DROP_CMD_ERR__LEN 1
- #define BMI160_USER_DROP_CMD_ERR__MSK 0x40
- #define BMI160_USER_DROP_CMD_ERR__REG BMI160_USER_ERROR_ADDR
- /**************************************************************/
- /**\name MAG DATA READY LENGTH, POSITION AND MASK */
- /**************************************************************/
- /* Error Description - Reg Addr --> 0x02, Bit --> 7 */
- #define BMI160_USER_MAG_DADA_RDY_ERR__POS 7
- #define BMI160_USER_MAG_DADA_RDY_ERR__LEN 1
- #define BMI160_USER_MAG_DADA_RDY_ERR__MSK 0x80
- #define BMI160_USER_MAG_DADA_RDY_ERR__REG BMI160_USER_ERROR_ADDR
- /**************************************************************/
- /**\name MAG POWER MODE LENGTH, POSITION AND MASK */
- /**************************************************************/
- /* PMU_Status Description of MAG - Reg Addr --> 0x03, Bit --> 1..0 */
- #define BMI160_USER_MAG_POWER_MODE_STAT__POS 0
- #define BMI160_USER_MAG_POWER_MODE_STAT__LEN 2
- #define BMI160_USER_MAG_POWER_MODE_STAT__MSK 0x03
- #define BMI160_USER_MAG_POWER_MODE_STAT__REG \
- BMI160_USER_PMU_STAT_ADDR
- /**************************************************************/
- /**\name GYRO POWER MODE LENGTH, POSITION AND MASK */
- /**************************************************************/
- /* PMU_Status Description of GYRO - Reg Addr --> 0x03, Bit --> 3...2 */
- #define BMI160_USER_GYRO_POWER_MODE_STAT__POS 2
- #define BMI160_USER_GYRO_POWER_MODE_STAT__LEN 2
- #define BMI160_USER_GYRO_POWER_MODE_STAT__MSK 0x0C
- #define BMI160_USER_GYRO_POWER_MODE_STAT__REG \
- BMI160_USER_PMU_STAT_ADDR
- /**************************************************************/
- /**\name ACCEL POWER MODE LENGTH, POSITION AND MASK */
- /**************************************************************/
- /* PMU_Status Description of ACCEL - Reg Addr --> 0x03, Bit --> 5...4 */
- #define BMI160_USER_ACCEL_POWER_MODE_STAT__POS 4
- #define BMI160_USER_ACCEL_POWER_MODE_STAT__LEN 2
- #define BMI160_USER_ACCEL_POWER_MODE_STAT__MSK 0x30
- #define BMI160_USER_ACCEL_POWER_MODE_STAT__REG \
- BMI160_USER_PMU_STAT_ADDR
- /**************************************************************/
- /**\name MAG DATA XYZ LENGTH, POSITION AND MASK */
- /**************************************************************/
- /* Mag_X(LSB) Description - Reg Addr --> 0x04, Bit --> 0...7 */
- #define BMI160_USER_DATA_0_MAG_X_LSB__POS 0
- #define BMI160_USER_DATA_0_MAG_X_LSB__LEN 8
- #define BMI160_USER_DATA_0_MAG_X_LSB__MSK 0xFF
- #define BMI160_USER_DATA_0_MAG_X_LSB__REG BMI160_USER_DATA_0_ADDR
- /* Mag_X(LSB) Description - Reg Addr --> 0x04, Bit --> 3...7 */
- #define BMI160_USER_DATA_MAG_X_LSB__POS 3
- #define BMI160_USER_DATA_MAG_X_LSB__LEN 5
- #define BMI160_USER_DATA_MAG_X_LSB__MSK 0xF8
- #define BMI160_USER_DATA_MAG_X_LSB__REG BMI160_USER_DATA_0_ADDR
- /* Mag_X(MSB) Description - Reg Addr --> 0x05, Bit --> 0...7 */
- #define BMI160_USER_DATA_1_MAG_X_MSB__POS 0
- #define BMI160_USER_DATA_1_MAG_X_MSB__LEN 8
- #define BMI160_USER_DATA_1_MAG_X_MSB__MSK 0xFF
- #define BMI160_USER_DATA_1_MAG_X_MSB__REG BMI160_USER_DATA_1_ADDR
- /* Mag_Y(LSB) Description - Reg Addr --> 0x06, Bit --> 0...7 */
- #define BMI160_USER_DATA_2_MAG_Y_LSB__POS 0
- #define BMI160_USER_DATA_2_MAG_Y_LSB__LEN 8
- #define BMI160_USER_DATA_2_MAG_Y_LSB__MSK 0xFF
- #define BMI160_USER_DATA_2_MAG_Y_LSB__REG BMI160_USER_DATA_2_ADDR
- /* Mag_Y(LSB) Description - Reg Addr --> 0x06, Bit --> 3...7 */
- #define BMI160_USER_DATA_MAG_Y_LSB__POS 3
- #define BMI160_USER_DATA_MAG_Y_LSB__LEN 5
- #define BMI160_USER_DATA_MAG_Y_LSB__MSK 0xF8
- #define BMI160_USER_DATA_MAG_Y_LSB__REG BMI160_USER_DATA_2_ADDR
- /* Mag_Y(MSB) Description - Reg Addr --> 0x07, Bit --> 0...7 */
- #define BMI160_USER_DATA_3_MAG_Y_MSB__POS 0
- #define BMI160_USER_DATA_3_MAG_Y_MSB__LEN 8
- #define BMI160_USER_DATA_3_MAG_Y_MSB__MSK 0xFF
- #define BMI160_USER_DATA_3_MAG_Y_MSB__REG BMI160_USER_DATA_3_ADDR
- /* Mag_Z(LSB) Description - Reg Addr --> 0x08, Bit --> 0...7 */
- #define BMI160_USER_DATA_4_MAG_Z_LSB__POS 0
- #define BMI160_USER_DATA_4_MAG_Z_LSB__LEN 8
- #define BMI160_USER_DATA_4_MAG_Z_LSB__MSK 0xFF
- #define BMI160_USER_DATA_4_MAG_Z_LSB__REG BMI160_USER_DATA_4_ADDR
- /* Mag_X(LSB) Description - Reg Addr --> 0x08, Bit --> 3...7 */
- #define BMI160_USER_DATA_MAG_Z_LSB__POS 1
- #define BMI160_USER_DATA_MAG_Z_LSB__LEN 7
- #define BMI160_USER_DATA_MAG_Z_LSB__MSK 0xFE
- #define BMI160_USER_DATA_MAG_Z_LSB__REG BMI160_USER_DATA_4_ADDR
- /* Mag_Z(MSB) Description - Reg Addr --> 0x09, Bit --> 0...7 */
- #define BMI160_USER_DATA_5_MAG_Z_MSB__POS 0
- #define BMI160_USER_DATA_5_MAG_Z_MSB__LEN 8
- #define BMI160_USER_DATA_5_MAG_Z_MSB__MSK 0xFF
- #define BMI160_USER_DATA_5_MAG_Z_MSB__REG BMI160_USER_DATA_5_ADDR
- /* RHALL(LSB) Description - Reg Addr --> 0x0A, Bit --> 0...7 */
- #define BMI160_USER_DATA_6_RHALL_LSB__POS 0
- #define BMI160_USER_DATA_6_RHALL_LSB__LEN 8
- #define BMI160_USER_DATA_6_RHALL_LSB__MSK 0xFF
- #define BMI160_USER_DATA_6_RHALL_LSB__REG BMI160_USER_DATA_6_ADDR
- /* Mag_R(LSB) Description - Reg Addr --> 0x0A, Bit --> 3...7 */
- #define BMI160_USER_DATA_MAG_R_LSB__POS 2
- #define BMI160_USER_DATA_MAG_R_LSB__LEN 6
- #define BMI160_USER_DATA_MAG_R_LSB__MSK 0xFC
- #define BMI160_USER_DATA_MAG_R_LSB__REG BMI160_USER_DATA_6_ADDR
- /* RHALL(MSB) Description - Reg Addr --> 0x0B, Bit --> 0...7 */
- #define BMI160_USER_DATA_7_RHALL_MSB__POS 0
- #define BMI160_USER_DATA_7_RHALL_MSB__LEN 8
- #define BMI160_USER_DATA_7_RHALL_MSB__MSK 0xFF
- #define BMI160_USER_DATA_7_RHALL_MSB__REG BMI160_USER_DATA_7_ADDR
- /**************************************************************/
- /**\name GYRO DATA XYZ LENGTH, POSITION AND MASK */
- /**************************************************************/
- /* GYR_X (LSB) Description - Reg Addr --> 0x0C, Bit --> 0...7 */
- #define BMI160_USER_DATA_8_GYRO_X_LSB__POS 0
- #define BMI160_USER_DATA_8_GYRO_X_LSB__LEN 8
- #define BMI160_USER_DATA_8_GYRO_X_LSB__MSK 0xFF
- #define BMI160_USER_DATA_8_GYRO_X_LSB__REG BMI160_USER_DATA_8_ADDR
- /* GYR_X (MSB) Description - Reg Addr --> 0x0D, Bit --> 0...7 */
- #define BMI160_USER_DATA_9_GYRO_X_MSB__POS 0
- #define BMI160_USER_DATA_9_GYRO_X_MSB__LEN 8
- #define BMI160_USER_DATA_9_GYRO_X_MSB__MSK 0xFF
- #define BMI160_USER_DATA_9_GYRO_X_MSB__REG BMI160_USER_DATA_9_ADDR
- /* GYR_Y (LSB) Description - Reg Addr --> 0x0E, Bit --> 0...7 */
- #define BMI160_USER_DATA_10_GYRO_Y_LSB__POS 0
- #define BMI160_USER_DATA_10_GYRO_Y_LSB__LEN 8
- #define BMI160_USER_DATA_10_GYRO_Y_LSB__MSK 0xFF
- #define BMI160_USER_DATA_10_GYRO_Y_LSB__REG BMI160_USER_DATA_10_ADDR
- /* GYR_Y (MSB) Description - Reg Addr --> 0x0F, Bit --> 0...7 */
- #define BMI160_USER_DATA_11_GYRO_Y_MSB__POS 0
- #define BMI160_USER_DATA_11_GYRO_Y_MSB__LEN 8
- #define BMI160_USER_DATA_11_GYRO_Y_MSB__MSK 0xFF
- #define BMI160_USER_DATA_11_GYRO_Y_MSB__REG BMI160_USER_DATA_11_ADDR
- /* GYR_Z (LSB) Description - Reg Addr --> 0x10, Bit --> 0...7 */
- #define BMI160_USER_DATA_12_GYRO_Z_LSB__POS 0
- #define BMI160_USER_DATA_12_GYRO_Z_LSB__LEN 8
- #define BMI160_USER_DATA_12_GYRO_Z_LSB__MSK 0xFF
- #define BMI160_USER_DATA_12_GYRO_Z_LSB__REG BMI160_USER_DATA_12_ADDR
- /* GYR_Z (MSB) Description - Reg Addr --> 0x11, Bit --> 0...7 */
- #define BMI160_USER_DATA_13_GYRO_Z_MSB__POS 0
- #define BMI160_USER_DATA_13_GYRO_Z_MSB__LEN 8
- #define BMI160_USER_DATA_13_GYRO_Z_MSB__MSK 0xFF
- #define BMI160_USER_DATA_13_GYRO_Z_MSB__REG BMI160_USER_DATA_13_ADDR
- /**************************************************************/
- /**\name ACCEL DATA XYZ LENGTH, POSITION AND MASK */
- /**************************************************************/
- /* ACC_X (LSB) Description - Reg Addr --> 0x12, Bit --> 0...7 */
- #define BMI160_USER_DATA_14_ACCEL_X_LSB__POS 0
- #define BMI160_USER_DATA_14_ACCEL_X_LSB__LEN 8
- #define BMI160_USER_DATA_14_ACCEL_X_LSB__MSK 0xFF
- #define BMI160_USER_DATA_14_ACCEL_X_LSB__REG BMI160_USER_DATA_14_ADDR
- /* ACC_X (MSB) Description - Reg Addr --> 0x13, Bit --> 0...7 */
- #define BMI160_USER_DATA_15_ACCEL_X_MSB__POS 0
- #define BMI160_USER_DATA_15_ACCEL_X_MSB__LEN 8
- #define BMI160_USER_DATA_15_ACCEL_X_MSB__MSK 0xFF
- #define BMI160_USER_DATA_15_ACCEL_X_MSB__REG BMI160_USER_DATA_15_ADDR
- /* ACC_Y (LSB) Description - Reg Addr --> 0x14, Bit --> 0...7 */
- #define BMI160_USER_DATA_16_ACCEL_Y_LSB__POS 0
- #define BMI160_USER_DATA_16_ACCEL_Y_LSB__LEN 8
- #define BMI160_USER_DATA_16_ACCEL_Y_LSB__MSK 0xFF
- #define BMI160_USER_DATA_16_ACCEL_Y_LSB__REG BMI160_USER_DATA_16_ADDR
- /* ACC_Y (MSB) Description - Reg Addr --> 0x15, Bit --> 0...7 */
- #define BMI160_USER_DATA_17_ACCEL_Y_MSB__POS 0
- #define BMI160_USER_DATA_17_ACCEL_Y_MSB__LEN 8
- #define BMI160_USER_DATA_17_ACCEL_Y_MSB__MSK 0xFF
- #define BMI160_USER_DATA_17_ACCEL_Y_MSB__REG BMI160_USER_DATA_17_ADDR
- /* ACC_Z (LSB) Description - Reg Addr --> 0x16, Bit --> 0...7 */
- #define BMI160_USER_DATA_18_ACCEL_Z_LSB__POS 0
- #define BMI160_USER_DATA_18_ACCEL_Z_LSB__LEN 8
- #define BMI160_USER_DATA_18_ACCEL_Z_LSB__MSK 0xFF
- #define BMI160_USER_DATA_18_ACCEL_Z_LSB__REG BMI160_USER_DATA_18_ADDR
- /* ACC_Z (MSB) Description - Reg Addr --> 0x17, Bit --> 0...7 */
- #define BMI160_USER_DATA_19_ACCEL_Z_MSB__POS 0
- #define BMI160_USER_DATA_19_ACCEL_Z_MSB__LEN 8
- #define BMI160_USER_DATA_19_ACCEL_Z_MSB__MSK 0xFF
- #define BMI160_USER_DATA_19_ACCEL_Z_MSB__REG BMI160_USER_DATA_19_ADDR
- /**************************************************************/
- /**\name SENSOR TIME LENGTH, POSITION AND MASK */
- /**************************************************************/
- /* SENSORTIME_0 (LSB) Description - Reg Addr --> 0x18, Bit --> 0...7 */
- #define BMI160_USER_SENSORTIME_0_SENSOR_TIME_LSB__POS 0
- #define BMI160_USER_SENSORTIME_0_SENSOR_TIME_LSB__LEN 8
- #define BMI160_USER_SENSORTIME_0_SENSOR_TIME_LSB__MSK 0xFF
- #define BMI160_USER_SENSORTIME_0_SENSOR_TIME_LSB__REG \
- BMI160_USER_SENSORTIME_0_ADDR
- /* SENSORTIME_1 (MSB) Description - Reg Addr --> 0x19, Bit --> 0...7 */
- #define BMI160_USER_SENSORTIME_1_SENSOR_TIME_MSB__POS 0
- #define BMI160_USER_SENSORTIME_1_SENSOR_TIME_MSB__LEN 8
- #define BMI160_USER_SENSORTIME_1_SENSOR_TIME_MSB__MSK 0xFF
- #define BMI160_USER_SENSORTIME_1_SENSOR_TIME_MSB__REG \
- BMI160_USER_SENSORTIME_1_ADDR
- /* SENSORTIME_2 (MSB) Description - Reg Addr --> 0x1A, Bit --> 0...7 */
- #define BMI160_USER_SENSORTIME_2_SENSOR_TIME_MSB__POS 0
- #define BMI160_USER_SENSORTIME_2_SENSOR_TIME_MSB__LEN 8
- #define BMI160_USER_SENSORTIME_2_SENSOR_TIME_MSB__MSK 0xFF
- #define BMI160_USER_SENSORTIME_2_SENSOR_TIME_MSB__REG \
- BMI160_USER_SENSORTIME_2_ADDR
- /**************************************************************/
- /**\name GYRO SELF TEST LENGTH, POSITION AND MASK */
- /**************************************************************/
- /* Status Description - Reg Addr --> 0x1B, Bit --> 1 */
- #define BMI160_USER_STAT_GYRO_SELFTEST_OK__POS 1
- #define BMI160_USER_STAT_GYRO_SELFTEST_OK__LEN 1
- #define BMI160_USER_STAT_GYRO_SELFTEST_OK__MSK 0x02
- #define BMI160_USER_STAT_GYRO_SELFTEST_OK__REG \
- BMI160_USER_STAT_ADDR
- /**************************************************************/
- /**\name MAG MANUAL OPERATION LENGTH, POSITION AND MASK */
- /**************************************************************/
- /* Status Description - Reg Addr --> 0x1B, Bit --> 2 */
- #define BMI160_USER_STAT_MAG_MANUAL_OPERATION__POS 2
- #define BMI160_USER_STAT_MAG_MANUAL_OPERATION__LEN 1
- #define BMI160_USER_STAT_MAG_MANUAL_OPERATION__MSK 0x04
- #define BMI160_USER_STAT_MAG_MANUAL_OPERATION__REG \
- BMI160_USER_STAT_ADDR
- /**************************************************************/
- /**\name FOC STATUS LENGTH, POSITION AND MASK */
- /**************************************************************/
- /* Status Description - Reg Addr --> 0x1B, Bit --> 3 */
- #define BMI160_USER_STAT_FOC_RDY__POS 3
- #define BMI160_USER_STAT_FOC_RDY__LEN 1
- #define BMI160_USER_STAT_FOC_RDY__MSK 0x08
- #define BMI160_USER_STAT_FOC_RDY__REG BMI160_USER_STAT_ADDR
- /**************************************************************/
- /**\name NVM READY LENGTH, POSITION AND MASK */
- /**************************************************************/
- /* Status Description - Reg Addr --> 0x1B, Bit --> 4 */
- #define BMI160_USER_STAT_NVM_RDY__POS 4
- #define BMI160_USER_STAT_NVM_RDY__LEN 1
- #define BMI160_USER_STAT_NVM_RDY__MSK 0x10
- #define BMI160_USER_STAT_NVM_RDY__REG BMI160_USER_STAT_ADDR
- /**************************************************************/
- /**\name DATA READY LENGTH, POSITION AND MASK FOR ACCEL, MAG AND GYRO*/
- /**************************************************************/
- /* Status Description - Reg Addr --> 0x1B, Bit --> 5 */
- #define BMI160_USER_STAT_DATA_RDY_MAG__POS 5
- #define BMI160_USER_STAT_DATA_RDY_MAG__LEN 1
- #define BMI160_USER_STAT_DATA_RDY_MAG__MSK 0x20
- #define BMI160_USER_STAT_DATA_RDY_MAG__REG BMI160_USER_STAT_ADDR
- /* Status Description - Reg Addr --> 0x1B, Bit --> 6 */
- #define BMI160_USER_STAT_DATA_RDY_GYRO__POS 6
- #define BMI160_USER_STAT_DATA_RDY_GYRO__LEN 1
- #define BMI160_USER_STAT_DATA_RDY_GYRO__MSK 0x40
- #define BMI160_USER_STAT_DATA_RDY_GYRO__REG BMI160_USER_STAT_ADDR
- /* Status Description - Reg Addr --> 0x1B, Bit --> 7 */
- #define BMI160_USER_STAT_DATA_RDY_ACCEL__POS 7
- #define BMI160_USER_STAT_DATA_RDY_ACCEL__LEN 1
- #define BMI160_USER_STAT_DATA_RDY_ACCEL__MSK 0x80
- #define BMI160_USER_STAT_DATA_RDY_ACCEL__REG BMI160_USER_STAT_ADDR
- /**************************************************************/
- /**\name INTERRUPT STATUS LENGTH, POSITION AND MASK */
- /**************************************************************/
- /* Int_Status_0 Description - Reg Addr --> 0x1C, Bit --> 0 */
- #define BMI160_USER_INTR_STAT_0_STEP_INTR__POS 0
- #define BMI160_USER_INTR_STAT_0_STEP_INTR__LEN 1
- #define BMI160_USER_INTR_STAT_0_STEP_INTR__MSK 0x01
- #define BMI160_USER_INTR_STAT_0_STEP_INTR__REG \
- BMI160_USER_INTR_STAT_0_ADDR
- /**************************************************************/
- /**\name SIGNIFICANT INTERRUPT STATUS LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Status_0 Description - Reg Addr --> 0x1C, Bit --> 1 */
- #define BMI160_USER_INTR_STAT_0_SIGNIFICANT_INTR__POS 1
- #define BMI160_USER_INTR_STAT_0_SIGNIFICANT_INTR__LEN 1
- #define BMI160_USER_INTR_STAT_0_SIGNIFICANT_INTR__MSK 0x02
- #define BMI160_USER_INTR_STAT_0_SIGNIFICANT_INTR__REG \
- BMI160_USER_INTR_STAT_0_ADDR
- /**************************************************************/
- /**\name ANY_MOTION INTERRUPT STATUS LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Status_0 Description - Reg Addr --> 0x1C, Bit --> 2 */
- #define BMI160_USER_INTR_STAT_0_ANY_MOTION__POS 2
- #define BMI160_USER_INTR_STAT_0_ANY_MOTION__LEN 1
- #define BMI160_USER_INTR_STAT_0_ANY_MOTION__MSK 0x04
- #define BMI160_USER_INTR_STAT_0_ANY_MOTION__REG \
- BMI160_USER_INTR_STAT_0_ADDR
- /**************************************************************/
- /**\name PMU TRIGGER INTERRUPT STATUS LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Status_0 Description - Reg Addr --> 0x1C, Bit --> 3 */
- #define BMI160_USER_INTR_STAT_0_PMU_TRIGGER__POS 3
- #define BMI160_USER_INTR_STAT_0_PMU_TRIGGER__LEN 1
- #define BMI160_USER_INTR_STAT_0_PMU_TRIGGER__MSK 0x08
- #define BMI160_USER_INTR_STAT_0_PMU_TRIGGER__REG \
- BMI160_USER_INTR_STAT_0_ADDR
- /**************************************************************/
- /**\name DOUBLE TAP INTERRUPT STATUS LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Status_0 Description - Reg Addr --> 0x1C, Bit --> 4 */
- #define BMI160_USER_INTR_STAT_0_DOUBLE_TAP_INTR__POS 4
- #define BMI160_USER_INTR_STAT_0_DOUBLE_TAP_INTR__LEN 1
- #define BMI160_USER_INTR_STAT_0_DOUBLE_TAP_INTR__MSK 0x10
- #define BMI160_USER_INTR_STAT_0_DOUBLE_TAP_INTR__REG \
- BMI160_USER_INTR_STAT_0_ADDR
- /**************************************************************/
- /**\name SINGLE TAP INTERRUPT STATUS LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Status_0 Description - Reg Addr --> 0x1C, Bit --> 5 */
- #define BMI160_USER_INTR_STAT_0_SINGLE_TAP_INTR__POS 5
- #define BMI160_USER_INTR_STAT_0_SINGLE_TAP_INTR__LEN 1
- #define BMI160_USER_INTR_STAT_0_SINGLE_TAP_INTR__MSK 0x20
- #define BMI160_USER_INTR_STAT_0_SINGLE_TAP_INTR__REG \
- BMI160_USER_INTR_STAT_0_ADDR
- /**************************************************************/
- /**\name ORIENT INTERRUPT STATUS LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Status_0 Description - Reg Addr --> 0x1C, Bit --> 6 */
- #define BMI160_USER_INTR_STAT_0_ORIENT__POS 6
- #define BMI160_USER_INTR_STAT_0_ORIENT__LEN 1
- #define BMI160_USER_INTR_STAT_0_ORIENT__MSK 0x40
- #define BMI160_USER_INTR_STAT_0_ORIENT__REG \
- BMI160_USER_INTR_STAT_0_ADDR
- /**************************************************************/
- /**\name FLAT INTERRUPT STATUS LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Status_0 Description - Reg Addr --> 0x1C, Bit --> 7 */
- #define BMI160_USER_INTR_STAT_0_FLAT__POS 7
- #define BMI160_USER_INTR_STAT_0_FLAT__LEN 1
- #define BMI160_USER_INTR_STAT_0_FLAT__MSK 0x80
- #define BMI160_USER_INTR_STAT_0_FLAT__REG \
- BMI160_USER_INTR_STAT_0_ADDR
- /**************************************************************/
- /**\name HIGH_G INTERRUPT STATUS LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Status_1 Description - Reg Addr --> 0x1D, Bit --> 2 */
- #define BMI160_USER_INTR_STAT_1_HIGH_G_INTR__POS 2
- #define BMI160_USER_INTR_STAT_1_HIGH_G_INTR__LEN 1
- #define BMI160_USER_INTR_STAT_1_HIGH_G_INTR__MSK 0x04
- #define BMI160_USER_INTR_STAT_1_HIGH_G_INTR__REG \
- BMI160_USER_INTR_STAT_1_ADDR
- /**************************************************************/
- /**\name LOW_G INTERRUPT STATUS LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Status_1 Description - Reg Addr --> 0x1D, Bit --> 3 */
- #define BMI160_USER_INTR_STAT_1_LOW_G_INTR__POS 3
- #define BMI160_USER_INTR_STAT_1_LOW_G_INTR__LEN 1
- #define BMI160_USER_INTR_STAT_1_LOW_G_INTR__MSK 0x08
- #define BMI160_USER_INTR_STAT_1_LOW_G_INTR__REG \
- BMI160_USER_INTR_STAT_1_ADDR
- /**************************************************************/
- /**\name DATA READY INTERRUPT STATUS LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Status_1 Description - Reg Addr --> 0x1D, Bit --> 4 */
- #define BMI160_USER_INTR_STAT_1_DATA_RDY_INTR__POS 4
- #define BMI160_USER_INTR_STAT_1_DATA_RDY_INTR__LEN 1
- #define BMI160_USER_INTR_STAT_1_DATA_RDY_INTR__MSK 0x10
- #define BMI160_USER_INTR_STAT_1_DATA_RDY_INTR__REG \
- BMI160_USER_INTR_STAT_1_ADDR
- /**************************************************************/
- /**\name FIFO FULL INTERRUPT STATUS LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Status_1 Description - Reg Addr --> 0x1D, Bit --> 5 */
- #define BMI160_USER_INTR_STAT_1_FIFO_FULL_INTR__POS 5
- #define BMI160_USER_INTR_STAT_1_FIFO_FULL_INTR__LEN 1
- #define BMI160_USER_INTR_STAT_1_FIFO_FULL_INTR__MSK 0x20
- #define BMI160_USER_INTR_STAT_1_FIFO_FULL_INTR__REG \
- BMI160_USER_INTR_STAT_1_ADDR
- /**************************************************************/
- /**\name FIFO WATERMARK INTERRUPT STATUS LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Status_1 Description - Reg Addr --> 0x1D, Bit --> 6 */
- #define BMI160_USER_INTR_STAT_1_FIFO_WM_INTR__POS 6
- #define BMI160_USER_INTR_STAT_1_FIFO_WM_INTR__LEN 1
- #define BMI160_USER_INTR_STAT_1_FIFO_WM_INTR__MSK 0x40
- #define BMI160_USER_INTR_STAT_1_FIFO_WM_INTR__REG \
- BMI160_USER_INTR_STAT_1_ADDR
- /**************************************************************/
- /**\name NO MOTION INTERRUPT STATUS LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Status_1 Description - Reg Addr --> 0x1D, Bit --> 7 */
- #define BMI160_USER_INTR_STAT_1_NOMOTION_INTR__POS 7
- #define BMI160_USER_INTR_STAT_1_NOMOTION_INTR__LEN 1
- #define BMI160_USER_INTR_STAT_1_NOMOTION_INTR__MSK 0x80
- #define BMI160_USER_INTR_STAT_1_NOMOTION_INTR__REG \
- BMI160_USER_INTR_STAT_1_ADDR
- /**************************************************************/
- /**\name ANY MOTION-XYZ AXIS INTERRUPT STATUS LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Status_2 Description - Reg Addr --> 0x1E, Bit --> 0 */
- #define BMI160_USER_INTR_STAT_2_ANY_MOTION_FIRST_X__POS 0
- #define BMI160_USER_INTR_STAT_2_ANY_MOTION_FIRST_X__LEN 1
- #define BMI160_USER_INTR_STAT_2_ANY_MOTION_FIRST_X__MSK 0x01
- #define BMI160_USER_INTR_STAT_2_ANY_MOTION_FIRST_X__REG \
- BMI160_USER_INTR_STAT_2_ADDR
- /* Int_Status_2 Description - Reg Addr --> 0x1E, Bit --> 1 */
- #define BMI160_USER_INTR_STAT_2_ANY_MOTION_FIRST_Y__POS 1
- #define BMI160_USER_INTR_STAT_2_ANY_MOTION_FIRST_Y__LEN 1
- #define BMI160_USER_INTR_STAT_2_ANY_MOTION_FIRST_Y__MSK 0x02
- #define BMI160_USER_INTR_STAT_2_ANY_MOTION_FIRST_Y__REG \
- BMI160_USER_INTR_STAT_2_ADDR
- /* Int_Status_2 Description - Reg Addr --> 0x1E, Bit --> 2 */
- #define BMI160_USER_INTR_STAT_2_ANY_MOTION_FIRST_Z__POS 2
- #define BMI160_USER_INTR_STAT_2_ANY_MOTION_FIRST_Z__LEN 1
- #define BMI160_USER_INTR_STAT_2_ANY_MOTION_FIRST_Z__MSK 0x04
- #define BMI160_USER_INTR_STAT_2_ANY_MOTION_FIRST_Z__REG \
- BMI160_USER_INTR_STAT_2_ADDR
- /**************************************************************/
- /**\name ANY MOTION SIGN LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Status_2 Description - Reg Addr --> 0x1E, Bit --> 3 */
- #define BMI160_USER_INTR_STAT_2_ANY_MOTION_SIGN__POS 3
- #define BMI160_USER_INTR_STAT_2_ANY_MOTION_SIGN__LEN 1
- #define BMI160_USER_INTR_STAT_2_ANY_MOTION_SIGN__MSK 0x08
- #define BMI160_USER_INTR_STAT_2_ANY_MOTION_SIGN__REG \
- BMI160_USER_INTR_STAT_2_ADDR
- /**************************************************************/
- /**\name TAP_XYZ AND SIGN LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Status_2 Description - Reg Addr --> 0x1E, Bit --> 4 */
- #define BMI160_USER_INTR_STAT_2_TAP_FIRST_X__POS 4
- #define BMI160_USER_INTR_STAT_2_TAP_FIRST_X__LEN 1
- #define BMI160_USER_INTR_STAT_2_TAP_FIRST_X__MSK 0x10
- #define BMI160_USER_INTR_STAT_2_TAP_FIRST_X__REG \
- BMI160_USER_INTR_STAT_2_ADDR
- /* Int_Status_2 Description - Reg Addr --> 0x1E, Bit --> 5 */
- #define BMI160_USER_INTR_STAT_2_TAP_FIRST_Y__POS 5
- #define BMI160_USER_INTR_STAT_2_TAP_FIRST_Y__LEN 1
- #define BMI160_USER_INTR_STAT_2_TAP_FIRST_Y__MSK 0x20
- #define BMI160_USER_INTR_STAT_2_TAP_FIRST_Y__REG \
- BMI160_USER_INTR_STAT_2_ADDR
- /* Int_Status_2 Description - Reg Addr --> 0x1E, Bit --> 6 */
- #define BMI160_USER_INTR_STAT_2_TAP_FIRST_Z__POS 6
- #define BMI160_USER_INTR_STAT_2_TAP_FIRST_Z__LEN 1
- #define BMI160_USER_INTR_STAT_2_TAP_FIRST_Z__MSK 0x40
- #define BMI160_USER_INTR_STAT_2_TAP_FIRST_Z__REG \
- BMI160_USER_INTR_STAT_2_ADDR
- /* Int_Status_2 Description - Reg Addr --> 0x1E, Bit --> 7 */
- #define BMI160_USER_INTR_STAT_2_TAP_SIGN__POS 7
- #define BMI160_USER_INTR_STAT_2_TAP_SIGN__LEN 1
- #define BMI160_USER_INTR_STAT_2_TAP_SIGN__MSK 0x80
- #define BMI160_USER_INTR_STAT_2_TAP_SIGN__REG \
- BMI160_USER_INTR_STAT_2_ADDR
- /**************************************************************/
- /**\name INTERRUPT SATAUS FOR WHOLE 0x1E LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Status_2 Description - Reg Addr --> 0x1E, Bit --> 0...7 */
- #define BMI160_USER_INTR_STAT_2__POS 0
- #define BMI160_USER_INTR_STAT_2__LEN 8
- #define BMI160_USER_INTR_STAT_2__MSK 0xFF
- #define BMI160_USER_INTR_STAT_2__REG \
- BMI160_USER_INTR_STAT_2_ADDR
- /**************************************************************/
- /**\name HIGH_G-XYZ AND SIGN LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Status_3 Description - Reg Addr --> 0x1F, Bit --> 0 */
- #define BMI160_USER_INTR_STAT_3_HIGH_G_FIRST_X__POS 0
- #define BMI160_USER_INTR_STAT_3_HIGH_G_FIRST_X__LEN 1
- #define BMI160_USER_INTR_STAT_3_HIGH_G_FIRST_X__MSK 0x01
- #define BMI160_USER_INTR_STAT_3_HIGH_G_FIRST_X__REG \
- BMI160_USER_INTR_STAT_3_ADDR
- /* Int_Status_3 Description - Reg Addr --> 0x1E, Bit --> 1 */
- #define BMI160_USER_INTR_STAT_3_HIGH_G_FIRST_Y__POS 1
- #define BMI160_USER_INTR_STAT_3_HIGH_G_FIRST_Y__LEN 1
- #define BMI160_USER_INTR_STAT_3_HIGH_G_FIRST_Y__MSK 0x02
- #define BMI160_USER_INTR_STAT_3_HIGH_G_FIRST_Y__REG \
- BMI160_USER_INTR_STAT_3_ADDR
- /* Int_Status_3 Description - Reg Addr --> 0x1F, Bit --> 2 */
- #define BMI160_USER_INTR_STAT_3_HIGH_G_FIRST_Z__POS 2
- #define BMI160_USER_INTR_STAT_3_HIGH_G_FIRST_Z__LEN 1
- #define BMI160_USER_INTR_STAT_3_HIGH_G_FIRST_Z__MSK 0x04
- #define BMI160_USER_INTR_STAT_3_HIGH_G_FIRST_Z__REG \
- BMI160_USER_INTR_STAT_3_ADDR
- /* Int_Status_3 Description - Reg Addr --> 0x1F, Bit --> 3 */
- #define BMI160_USER_INTR_STAT_3_HIGH_G_SIGN__POS 3
- #define BMI160_USER_INTR_STAT_3_HIGH_G_SIGN__LEN 1
- #define BMI160_USER_INTR_STAT_3_HIGH_G_SIGN__MSK 0x08
- #define BMI160_USER_INTR_STAT_3_HIGH_G_SIGN__REG \
- BMI160_USER_INTR_STAT_3_ADDR
- /**************************************************************/
- /**\name ORIENT XY and Z AXIS LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Status_3 Description - Reg Addr --> 0x1F, Bit --> 4...5 */
- #define BMI160_USER_INTR_STAT_3_ORIENT_XY__POS 4
- #define BMI160_USER_INTR_STAT_3_ORIENT_XY__LEN 2
- #define BMI160_USER_INTR_STAT_3_ORIENT_XY__MSK 0x30
- #define BMI160_USER_INTR_STAT_3_ORIENT_XY__REG \
- BMI160_USER_INTR_STAT_3_ADDR
- /* Int_Status_3 Description - Reg Addr --> 0x1F, Bit --> 6 */
- #define BMI160_USER_INTR_STAT_3_ORIENT_Z__POS 6
- #define BMI160_USER_INTR_STAT_3_ORIENT_Z__LEN 1
- #define BMI160_USER_INTR_STAT_3_ORIENT_Z__MSK 0x40
- #define BMI160_USER_INTR_STAT_3_ORIENT_Z__REG \
- BMI160_USER_INTR_STAT_3_ADDR
- /**************************************************************/
- /**\name FLAT LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Status_3 Description - Reg Addr --> 0x1F, Bit --> 7 */
- #define BMI160_USER_INTR_STAT_3_FLAT__POS 7
- #define BMI160_USER_INTR_STAT_3_FLAT__LEN 1
- #define BMI160_USER_INTR_STAT_3_FLAT__MSK 0x80
- #define BMI160_USER_INTR_STAT_3_FLAT__REG \
- BMI160_USER_INTR_STAT_3_ADDR
- /**************************************************************/
- /**\name 0x1F LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Status_3 Description - Reg Addr --> 0x1F, Bit --> 0...7 */
- #define BMI160_USER_INTR_STAT_3__POS 0
- #define BMI160_USER_INTR_STAT_3__LEN 8
- #define BMI160_USER_INTR_STAT_3__MSK 0xFF
- #define BMI160_USER_INTR_STAT_3__REG \
- BMI160_USER_INTR_STAT_3_ADDR
- /**************************************************************/
- /**\name TEMPERATURE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Temperature Description - LSB Reg Addr --> 0x20, Bit --> 0...7 */
- #define BMI160_USER_TEMP_LSB_VALUE__POS 0
- #define BMI160_USER_TEMP_LSB_VALUE__LEN 8
- #define BMI160_USER_TEMP_LSB_VALUE__MSK 0xFF
- #define BMI160_USER_TEMP_LSB_VALUE__REG \
- BMI160_USER_TEMPERATURE_0_ADDR
- /* Temperature Description - LSB Reg Addr --> 0x21, Bit --> 0...7 */
- #define BMI160_USER_TEMP_MSB_VALUE__POS 0
- #define BMI160_USER_TEMP_MSB_VALUE__LEN 8
- #define BMI160_USER_TEMP_MSB_VALUE__MSK 0xFF
- #define BMI160_USER_TEMP_MSB_VALUE__REG \
- BMI160_USER_TEMPERATURE_1_ADDR
- /**************************************************************/
- /**\name FIFO BYTE COUNTER LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Fifo_Length0 Description - Reg Addr --> 0x22, Bit --> 0...7 */
- #define BMI160_USER_FIFO_BYTE_COUNTER_LSB__POS 0
- #define BMI160_USER_FIFO_BYTE_COUNTER_LSB__LEN 8
- #define BMI160_USER_FIFO_BYTE_COUNTER_LSB__MSK 0xFF
- #define BMI160_USER_FIFO_BYTE_COUNTER_LSB__REG \
- BMI160_USER_FIFO_LENGTH_0_ADDR
- /*Fifo_Length1 Description - Reg Addr --> 0x23, Bit --> 0...2 */
- #define BMI160_USER_FIFO_BYTE_COUNTER_MSB__POS 0
- #define BMI160_USER_FIFO_BYTE_COUNTER_MSB__LEN 3
- #define BMI160_USER_FIFO_BYTE_COUNTER_MSB__MSK 0x07
- #define BMI160_USER_FIFO_BYTE_COUNTER_MSB__REG \
- BMI160_USER_FIFO_LENGTH_1_ADDR
- /**************************************************************/
- /**\name FIFO DATA LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Fifo_Data Description - Reg Addr --> 0x24, Bit --> 0...7 */
- #define BMI160_USER_FIFO_DATA__POS 0
- #define BMI160_USER_FIFO_DATA__LEN 8
- #define BMI160_USER_FIFO_DATA__MSK 0xFF
- #define BMI160_USER_FIFO_DATA__REG BMI160_USER_FIFO_DATA_ADDR
- /**************************************************************/
- /**\name ACCEL CONFIGURATION LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Acc_Conf Description - Reg Addr --> 0x40, Bit --> 0...3 */
- #define BMI160_USER_ACCEL_CONFIG_OUTPUT_DATA_RATE__POS 0
- #define BMI160_USER_ACCEL_CONFIG_OUTPUT_DATA_RATE__LEN 4
- #define BMI160_USER_ACCEL_CONFIG_OUTPUT_DATA_RATE__MSK 0x0F
- #define BMI160_USER_ACCEL_CONFIG_OUTPUT_DATA_RATE__REG \
- BMI160_USER_ACCEL_CONFIG_ADDR
- /* Acc_Conf Description - Reg Addr --> 0x40, Bit --> 4...6 */
- #define BMI160_USER_ACCEL_CONFIG_ACCEL_BW__POS 4
- #define BMI160_USER_ACCEL_CONFIG_ACCEL_BW__LEN 3
- #define BMI160_USER_ACCEL_CONFIG_ACCEL_BW__MSK 0x70
- #define BMI160_USER_ACCEL_CONFIG_ACCEL_BW__REG BMI160_USER_ACCEL_CONFIG_ADDR
- /* Acc_Conf Description - Reg Addr --> 0x40, Bit --> 7 */
- #define BMI160_USER_ACCEL_CONFIG_ACCEL_UNDER_SAMPLING__POS 7
- #define BMI160_USER_ACCEL_CONFIG_ACCEL_UNDER_SAMPLING__LEN 1
- #define BMI160_USER_ACCEL_CONFIG_ACCEL_UNDER_SAMPLING__MSK 0x80
- #define BMI160_USER_ACCEL_CONFIG_ACCEL_UNDER_SAMPLING__REG \
- BMI160_USER_ACCEL_CONFIG_ADDR
- /* Acc_Range Description - Reg Addr --> 0x41, Bit --> 0...3 */
- #define BMI160_USER_ACCEL_RANGE__POS 0
- #define BMI160_USER_ACCEL_RANGE__LEN 4
- #define BMI160_USER_ACCEL_RANGE__MSK 0x0F
- #define BMI160_USER_ACCEL_RANGE__REG BMI160_USER_ACCEL_RANGE_ADDR
- /**************************************************************/
- /**\name GYRO CONFIGURATION LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Gyro_Conf Description - Reg Addr --> 0x42, Bit --> 0...3 */
- #define BMI160_USER_GYRO_CONFIG_OUTPUT_DATA_RATE__POS 0
- #define BMI160_USER_GYRO_CONFIG_OUTPUT_DATA_RATE__LEN 4
- #define BMI160_USER_GYRO_CONFIG_OUTPUT_DATA_RATE__MSK 0x0F
- #define BMI160_USER_GYRO_CONFIG_OUTPUT_DATA_RATE__REG \
- BMI160_USER_GYRO_CONFIG_ADDR
- /* Gyro_Conf Description - Reg Addr --> 0x42, Bit --> 4...5 */
- #define BMI160_USER_GYRO_CONFIG_BW__POS 4
- #define BMI160_USER_GYRO_CONFIG_BW__LEN 2
- #define BMI160_USER_GYRO_CONFIG_BW__MSK 0x30
- #define BMI160_USER_GYRO_CONFIG_BW__REG \
- BMI160_USER_GYRO_CONFIG_ADDR
- /* Gyr_Range Description - Reg Addr --> 0x43, Bit --> 0...2 */
- #define BMI160_USER_GYRO_RANGE__POS 0
- #define BMI160_USER_GYRO_RANGE__LEN 3
- #define BMI160_USER_GYRO_RANGE__MSK 0x07
- #define BMI160_USER_GYRO_RANGE__REG BMI160_USER_GYRO_RANGE_ADDR
- /**************************************************************/
- /**\name MAG CONFIGURATION LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Mag_Conf Description - Reg Addr --> 0x44, Bit --> 0...3 */
- #define BMI160_USER_MAG_CONFIG_OUTPUT_DATA_RATE__POS 0
- #define BMI160_USER_MAG_CONFIG_OUTPUT_DATA_RATE__LEN 4
- #define BMI160_USER_MAG_CONFIG_OUTPUT_DATA_RATE__MSK 0x0F
- #define BMI160_USER_MAG_CONFIG_OUTPUT_DATA_RATE__REG \
- BMI160_USER_MAG_CONFIG_ADDR
- /**************************************************************/
- /**\name FIFO DOWNS LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Fifo_Downs Description - Reg Addr --> 0x45, Bit --> 0...2 */
- #define BMI160_USER_FIFO_DOWN_GYRO__POS 0
- #define BMI160_USER_FIFO_DOWN_GYRO__LEN 3
- #define BMI160_USER_FIFO_DOWN_GYRO__MSK 0x07
- #define BMI160_USER_FIFO_DOWN_GYRO__REG BMI160_USER_FIFO_DOWN_ADDR
- /**************************************************************/
- /**\name FIFO FILTER FOR ACCEL AND GYRO LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Fifo_filt Description - Reg Addr --> 0x45, Bit --> 3 */
- #define BMI160_USER_FIFO_FILTER_GYRO__POS 3
- #define BMI160_USER_FIFO_FILTER_GYRO__LEN 1
- #define BMI160_USER_FIFO_FILTER_GYRO__MSK 0x08
- #define BMI160_USER_FIFO_FILTER_GYRO__REG BMI160_USER_FIFO_DOWN_ADDR
- /* Fifo_Downs Description - Reg Addr --> 0x45, Bit --> 4...6 */
- #define BMI160_USER_FIFO_DOWN_ACCEL__POS 4
- #define BMI160_USER_FIFO_DOWN_ACCEL__LEN 3
- #define BMI160_USER_FIFO_DOWN_ACCEL__MSK 0x70
- #define BMI160_USER_FIFO_DOWN_ACCEL__REG BMI160_USER_FIFO_DOWN_ADDR
- /* Fifo_FILT Description - Reg Addr --> 0x45, Bit --> 7 */
- #define BMI160_USER_FIFO_FILTER_ACCEL__POS 7
- #define BMI160_USER_FIFO_FILTER_ACCEL__LEN 1
- #define BMI160_USER_FIFO_FILTER_ACCEL__MSK 0x80
- #define BMI160_USER_FIFO_FILTER_ACCEL__REG BMI160_USER_FIFO_DOWN_ADDR
- /**************************************************************/
- /**\name FIFO WATER MARK LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Fifo_Config_0 Description - Reg Addr --> 0x46, Bit --> 0...7 */
- #define BMI160_USER_FIFO_WM__POS 0
- #define BMI160_USER_FIFO_WM__LEN 8
- #define BMI160_USER_FIFO_WM__MSK 0xFF
- #define BMI160_USER_FIFO_WM__REG BMI160_USER_FIFO_CONFIG_0_ADDR
- /**************************************************************/
- /**\name FIFO STOP ON FULL LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Fifo_Config_1 Description - Reg Addr --> 0x47, Bit --> 0 */
- #define BMI160_USER_FIFO_STOP_ON_FULL__POS 0
- #define BMI160_USER_FIFO_STOP_ON_FULL__LEN 1
- #define BMI160_USER_FIFO_STOP_ON_FULL__MSK 0x01
- #define BMI160_USER_FIFO_STOP_ON_FULL__REG BMI160_USER_FIFO_CONFIG_1_ADDR
- /**************************************************************/
- /**\name FIFO TIME LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Fifo_Config_1 Description - Reg Addr --> 0x47, Bit --> 1 */
- #define BMI160_USER_FIFO_TIME_ENABLE__POS 1
- #define BMI160_USER_FIFO_TIME_ENABLE__LEN 1
- #define BMI160_USER_FIFO_TIME_ENABLE__MSK 0x02
- #define BMI160_USER_FIFO_TIME_ENABLE__REG BMI160_USER_FIFO_CONFIG_1_ADDR
- /**************************************************************/
- /**\name FIFO TAG INTERRUPT LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Fifo_Config_1 Description - Reg Addr --> 0x47, Bit --> 2 */
- #define BMI160_USER_FIFO_TAG_INTR2_ENABLE__POS 2
- #define BMI160_USER_FIFO_TAG_INTR2_ENABLE__LEN 1
- #define BMI160_USER_FIFO_TAG_INTR2_ENABLE__MSK 0x04
- #define BMI160_USER_FIFO_TAG_INTR2_ENABLE__REG BMI160_USER_FIFO_CONFIG_1_ADDR
- /* Fifo_Config_1 Description - Reg Addr --> 0x47, Bit --> 3 */
- #define BMI160_USER_FIFO_TAG_INTR1_ENABLE__POS 3
- #define BMI160_USER_FIFO_TAG_INTR1_ENABLE__LEN 1
- #define BMI160_USER_FIFO_TAG_INTR1_ENABLE__MSK 0x08
- #define BMI160_USER_FIFO_TAG_INTR1_ENABLE__REG BMI160_USER_FIFO_CONFIG_1_ADDR
- /**************************************************************/
- /**\name FIFO HEADER LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Fifo_Config_1 Description - Reg Addr --> 0x47, Bit --> 4 */
- #define BMI160_USER_FIFO_HEADER_ENABLE__POS 4
- #define BMI160_USER_FIFO_HEADER_ENABLE__LEN 1
- #define BMI160_USER_FIFO_HEADER_ENABLE__MSK 0x10
- #define BMI160_USER_FIFO_HEADER_ENABLE__REG \
- BMI160_USER_FIFO_CONFIG_1_ADDR
- /**************************************************************/
- /**\name FIFO MAG ENABLE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Fifo_Config_1 Description - Reg Addr --> 0x47, Bit --> 5 */
- #define BMI160_USER_FIFO_MAG_ENABLE__POS 5
- #define BMI160_USER_FIFO_MAG_ENABLE__LEN 1
- #define BMI160_USER_FIFO_MAG_ENABLE__MSK 0x20
- #define BMI160_USER_FIFO_MAG_ENABLE__REG \
- BMI160_USER_FIFO_CONFIG_1_ADDR
- /**************************************************************/
- /**\name FIFO ACCEL ENABLE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Fifo_Config_1 Description - Reg Addr --> 0x47, Bit --> 6 */
- #define BMI160_USER_FIFO_ACCEL_ENABLE__POS 6
- #define BMI160_USER_FIFO_ACCEL_ENABLE__LEN 1
- #define BMI160_USER_FIFO_ACCEL_ENABLE__MSK 0x40
- #define BMI160_USER_FIFO_ACCEL_ENABLE__REG \
- BMI160_USER_FIFO_CONFIG_1_ADDR
- /**************************************************************/
- /**\name FIFO GYRO ENABLE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Fifo_Config_1 Description - Reg Addr --> 0x47, Bit --> 7 */
- #define BMI160_USER_FIFO_GYRO_ENABLE__POS 7
- #define BMI160_USER_FIFO_GYRO_ENABLE__LEN 1
- #define BMI160_USER_FIFO_GYRO_ENABLE__MSK 0x80
- #define BMI160_USER_FIFO_GYRO_ENABLE__REG \
- BMI160_USER_FIFO_CONFIG_1_ADDR
- /**************************************************************/
- /**\name MAG I2C ADDRESS SELECTION LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Mag_IF_0 Description - Reg Addr --> 0x4b, Bit --> 1...7 */
- #define BMI160_USER_I2C_DEVICE_ADDR__POS 1
- #define BMI160_USER_I2C_DEVICE_ADDR__LEN 7
- #define BMI160_USER_I2C_DEVICE_ADDR__MSK 0xFE
- #define BMI160_USER_I2C_DEVICE_ADDR__REG BMI160_USER_MAG_IF_0_ADDR
- /**************************************************************/
- /**\name MAG CONFIGURATION FOR SECONDARY
- INTERFACE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Mag_IF_1 Description - Reg Addr --> 0x4c, Bit --> 0...1 */
- #define BMI160_USER_MAG_BURST__POS 0
- #define BMI160_USER_MAG_BURST__LEN 2
- #define BMI160_USER_MAG_BURST__MSK 0x03
- #define BMI160_USER_MAG_BURST__REG BMI160_USER_MAG_IF_1_ADDR
- /* Mag_IF_1 Description - Reg Addr --> 0x4c, Bit --> 2...5 */
- #define BMI160_USER_MAG_OFFSET__POS 2
- #define BMI160_USER_MAG_OFFSET__LEN 4
- #define BMI160_USER_MAG_OFFSET__MSK 0x3C
- #define BMI160_USER_MAG_OFFSET__REG BMI160_USER_MAG_IF_1_ADDR
- /* Mag_IF_1 Description - Reg Addr --> 0x4c, Bit --> 7 */
- #define BMI160_USER_MAG_MANUAL_ENABLE__POS 7
- #define BMI160_USER_MAG_MANUAL_ENABLE__LEN 1
- #define BMI160_USER_MAG_MANUAL_ENABLE__MSK 0x80
- #define BMI160_USER_MAG_MANUAL_ENABLE__REG \
- BMI160_USER_MAG_IF_1_ADDR
- /* Mag_IF_2 Description - Reg Addr --> 0x4d, Bit -->0... 7 */
- #define BMI160_USER_READ_ADDR__POS 0
- #define BMI160_USER_READ_ADDR__LEN 8
- #define BMI160_USER_READ_ADDR__MSK 0xFF
- #define BMI160_USER_READ_ADDR__REG BMI160_USER_MAG_IF_2_ADDR
- /* Mag_IF_3 Description - Reg Addr --> 0x4e, Bit -->0... 7 */
- #define BMI160_USER_WRITE_ADDR__POS 0
- #define BMI160_USER_WRITE_ADDR__LEN 8
- #define BMI160_USER_WRITE_ADDR__MSK 0xFF
- #define BMI160_USER_WRITE_ADDR__REG BMI160_USER_MAG_IF_3_ADDR
- /* Mag_IF_4 Description - Reg Addr --> 0x4f, Bit -->0... 7 */
- #define BMI160_USER_WRITE_DATA__POS 0
- #define BMI160_USER_WRITE_DATA__LEN 8
- #define BMI160_USER_WRITE_DATA__MSK 0xFF
- #define BMI160_USER_WRITE_DATA__REG BMI160_USER_MAG_IF_4_ADDR
- /**************************************************************/
- /**\name ANY MOTION XYZ AXIS ENABLE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_En_0 Description - Reg Addr --> 0x50, Bit -->0 */
- #define BMI160_USER_INTR_ENABLE_0_ANY_MOTION_X_ENABLE__POS 0
- #define BMI160_USER_INTR_ENABLE_0_ANY_MOTION_X_ENABLE__LEN 1
- #define BMI160_USER_INTR_ENABLE_0_ANY_MOTION_X_ENABLE__MSK 0x01
- #define BMI160_USER_INTR_ENABLE_0_ANY_MOTION_X_ENABLE__REG \
- BMI160_USER_INTR_ENABLE_0_ADDR
- /* Int_En_0 Description - Reg Addr --> 0x50, Bit -->1 */
- #define BMI160_USER_INTR_ENABLE_0_ANY_MOTION_Y_ENABLE__POS 1
- #define BMI160_USER_INTR_ENABLE_0_ANY_MOTION_Y_ENABLE__LEN 1
- #define BMI160_USER_INTR_ENABLE_0_ANY_MOTION_Y_ENABLE__MSK 0x02
- #define BMI160_USER_INTR_ENABLE_0_ANY_MOTION_Y_ENABLE__REG \
- BMI160_USER_INTR_ENABLE_0_ADDR
- /* Int_En_0 Description - Reg Addr --> 0x50, Bit -->2 */
- #define BMI160_USER_INTR_ENABLE_0_ANY_MOTION_Z_ENABLE__POS 2
- #define BMI160_USER_INTR_ENABLE_0_ANY_MOTION_Z_ENABLE__LEN 1
- #define BMI160_USER_INTR_ENABLE_0_ANY_MOTION_Z_ENABLE__MSK 0x04
- #define BMI160_USER_INTR_ENABLE_0_ANY_MOTION_Z_ENABLE__REG \
- BMI160_USER_INTR_ENABLE_0_ADDR
- /**************************************************************/
- /**\name DOUBLE TAP ENABLE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_En_0 Description - Reg Addr --> 0x50, Bit -->4 */
- #define BMI160_USER_INTR_ENABLE_0_DOUBLE_TAP_ENABLE__POS 4
- #define BMI160_USER_INTR_ENABLE_0_DOUBLE_TAP_ENABLE__LEN 1
- #define BMI160_USER_INTR_ENABLE_0_DOUBLE_TAP_ENABLE__MSK 0x10
- #define BMI160_USER_INTR_ENABLE_0_DOUBLE_TAP_ENABLE__REG \
- BMI160_USER_INTR_ENABLE_0_ADDR
- /**************************************************************/
- /**\name SINGLE TAP ENABLE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_En_0 Description - Reg Addr --> 0x50, Bit -->5 */
- #define BMI160_USER_INTR_ENABLE_0_SINGLE_TAP_ENABLE__POS 5
- #define BMI160_USER_INTR_ENABLE_0_SINGLE_TAP_ENABLE__LEN 1
- #define BMI160_USER_INTR_ENABLE_0_SINGLE_TAP_ENABLE__MSK 0x20
- #define BMI160_USER_INTR_ENABLE_0_SINGLE_TAP_ENABLE__REG \
- BMI160_USER_INTR_ENABLE_0_ADDR
- /**************************************************************/
- /**\name ORIENT ENABLE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_En_0 Description - Reg Addr --> 0x50, Bit -->6 */
- #define BMI160_USER_INTR_ENABLE_0_ORIENT_ENABLE__POS 6
- #define BMI160_USER_INTR_ENABLE_0_ORIENT_ENABLE__LEN 1
- #define BMI160_USER_INTR_ENABLE_0_ORIENT_ENABLE__MSK 0x40
- #define BMI160_USER_INTR_ENABLE_0_ORIENT_ENABLE__REG \
- BMI160_USER_INTR_ENABLE_0_ADDR
- /**************************************************************/
- /**\name FLAT ENABLE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_En_0 Description - Reg Addr --> 0x50, Bit -->7 */
- #define BMI160_USER_INTR_ENABLE_0_FLAT_ENABLE__POS 7
- #define BMI160_USER_INTR_ENABLE_0_FLAT_ENABLE__LEN 1
- #define BMI160_USER_INTR_ENABLE_0_FLAT_ENABLE__MSK 0x80
- #define BMI160_USER_INTR_ENABLE_0_FLAT_ENABLE__REG \
- BMI160_USER_INTR_ENABLE_0_ADDR
- /**************************************************************/
- /**\name HIGH_G XYZ ENABLE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_En_1 Description - Reg Addr --> 0x51, Bit -->0 */
- #define BMI160_USER_INTR_ENABLE_1_HIGH_G_X_ENABLE__POS 0
- #define BMI160_USER_INTR_ENABLE_1_HIGH_G_X_ENABLE__LEN 1
- #define BMI160_USER_INTR_ENABLE_1_HIGH_G_X_ENABLE__MSK 0x01
- #define BMI160_USER_INTR_ENABLE_1_HIGH_G_X_ENABLE__REG \
- BMI160_USER_INTR_ENABLE_1_ADDR
- /* Int_En_1 Description - Reg Addr --> 0x51, Bit -->1 */
- #define BMI160_USER_INTR_ENABLE_1_HIGH_G_Y_ENABLE__POS 1
- #define BMI160_USER_INTR_ENABLE_1_HIGH_G_Y_ENABLE__LEN 1
- #define BMI160_USER_INTR_ENABLE_1_HIGH_G_Y_ENABLE__MSK 0x02
- #define BMI160_USER_INTR_ENABLE_1_HIGH_G_Y_ENABLE__REG \
- BMI160_USER_INTR_ENABLE_1_ADDR
- /* Int_En_1 Description - Reg Addr --> 0x51, Bit -->2 */
- #define BMI160_USER_INTR_ENABLE_1_HIGH_G_Z_ENABLE__POS 2
- #define BMI160_USER_INTR_ENABLE_1_HIGH_G_Z_ENABLE__LEN 1
- #define BMI160_USER_INTR_ENABLE_1_HIGH_G_Z_ENABLE__MSK 0x04
- #define BMI160_USER_INTR_ENABLE_1_HIGH_G_Z_ENABLE__REG \
- BMI160_USER_INTR_ENABLE_1_ADDR
- /**************************************************************/
- /**\name LOW_G ENABLE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_En_1 Description - Reg Addr --> 0x51, Bit -->3 */
- #define BMI160_USER_INTR_ENABLE_1_LOW_G_ENABLE__POS 3
- #define BMI160_USER_INTR_ENABLE_1_LOW_G_ENABLE__LEN 1
- #define BMI160_USER_INTR_ENABLE_1_LOW_G_ENABLE__MSK 0x08
- #define BMI160_USER_INTR_ENABLE_1_LOW_G_ENABLE__REG \
- BMI160_USER_INTR_ENABLE_1_ADDR
- /**************************************************************/
- /**\name DATA READY ENABLE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_En_1 Description - Reg Addr --> 0x51, Bit -->4 */
- #define BMI160_USER_INTR_ENABLE_1_DATA_RDY_ENABLE__POS 4
- #define BMI160_USER_INTR_ENABLE_1_DATA_RDY_ENABLE__LEN 1
- #define BMI160_USER_INTR_ENABLE_1_DATA_RDY_ENABLE__MSK 0x10
- #define BMI160_USER_INTR_ENABLE_1_DATA_RDY_ENABLE__REG \
- BMI160_USER_INTR_ENABLE_1_ADDR
- /**************************************************************/
- /**\name FIFO FULL AND WATER MARK ENABLE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_En_1 Description - Reg Addr --> 0x51, Bit -->5 */
- #define BMI160_USER_INTR_ENABLE_1_FIFO_FULL_ENABLE__POS 5
- #define BMI160_USER_INTR_ENABLE_1_FIFO_FULL_ENABLE__LEN 1
- #define BMI160_USER_INTR_ENABLE_1_FIFO_FULL_ENABLE__MSK 0x20
- #define BMI160_USER_INTR_ENABLE_1_FIFO_FULL_ENABLE__REG \
- BMI160_USER_INTR_ENABLE_1_ADDR
- /* Int_En_1 Description - Reg Addr --> 0x51, Bit -->6 */
- #define BMI160_USER_INTR_ENABLE_1_FIFO_WM_ENABLE__POS 6
- #define BMI160_USER_INTR_ENABLE_1_FIFO_WM_ENABLE__LEN 1
- #define BMI160_USER_INTR_ENABLE_1_FIFO_WM_ENABLE__MSK 0x40
- #define BMI160_USER_INTR_ENABLE_1_FIFO_WM_ENABLE__REG \
- BMI160_USER_INTR_ENABLE_1_ADDR
- /**************************************************************/
- /**\name NO MOTION XYZ ENABLE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_En_2 Description - Reg Addr --> 0x52, Bit -->0 */
- #define BMI160_USER_INTR_ENABLE_2_NOMOTION_X_ENABLE__POS 0
- #define BMI160_USER_INTR_ENABLE_2_NOMOTION_X_ENABLE__LEN 1
- #define BMI160_USER_INTR_ENABLE_2_NOMOTION_X_ENABLE__MSK 0x01
- #define BMI160_USER_INTR_ENABLE_2_NOMOTION_X_ENABLE__REG \
- BMI160_USER_INTR_ENABLE_2_ADDR
- /* Int_En_2 Description - Reg Addr --> 0x52, Bit -->1 */
- #define BMI160_USER_INTR_ENABLE_2_NOMOTION_Y_ENABLE__POS 1
- #define BMI160_USER_INTR_ENABLE_2_NOMOTION_Y_ENABLE__LEN 1
- #define BMI160_USER_INTR_ENABLE_2_NOMOTION_Y_ENABLE__MSK 0x02
- #define BMI160_USER_INTR_ENABLE_2_NOMOTION_Y_ENABLE__REG \
- BMI160_USER_INTR_ENABLE_2_ADDR
- /* Int_En_2 Description - Reg Addr --> 0x52, Bit -->2 */
- #define BMI160_USER_INTR_ENABLE_2_NOMOTION_Z_ENABLE__POS 2
- #define BMI160_USER_INTR_ENABLE_2_NOMOTION_Z_ENABLE__LEN 1
- #define BMI160_USER_INTR_ENABLE_2_NOMOTION_Z_ENABLE__MSK 0x04
- #define BMI160_USER_INTR_ENABLE_2_NOMOTION_Z_ENABLE__REG \
- BMI160_USER_INTR_ENABLE_2_ADDR
- /**************************************************************/
- /**\name STEP DETECTOR ENABLE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_En_2 Description - Reg Addr --> 0x52, Bit -->3 */
- #define BMI160_USER_INTR_ENABLE_2_STEP_DETECTOR_ENABLE__POS 3
- #define BMI160_USER_INTR_ENABLE_2_STEP_DETECTOR_ENABLE__LEN 1
- #define BMI160_USER_INTR_ENABLE_2_STEP_DETECTOR_ENABLE__MSK 0x08
- #define BMI160_USER_INTR_ENABLE_2_STEP_DETECTOR_ENABLE__REG \
- BMI160_USER_INTR_ENABLE_2_ADDR
- /**************************************************************/
- /**\name EDGE CONTROL ENABLE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Out_Ctrl Description - Reg Addr --> 0x53, Bit -->0 */
- #define BMI160_USER_INTR1_EDGE_CTRL__POS 0
- #define BMI160_USER_INTR1_EDGE_CTRL__LEN 1
- #define BMI160_USER_INTR1_EDGE_CTRL__MSK 0x01
- #define BMI160_USER_INTR1_EDGE_CTRL__REG \
- BMI160_USER_INTR_OUT_CTRL_ADDR
- /**************************************************************/
- /**\name LEVEL CONTROL ENABLE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Out_Ctrl Description - Reg Addr --> 0x53, Bit -->1 */
- #define BMI160_USER_INTR1_LEVEL__POS 1
- #define BMI160_USER_INTR1_LEVEL__LEN 1
- #define BMI160_USER_INTR1_LEVEL__MSK 0x02
- #define BMI160_USER_INTR1_LEVEL__REG \
- BMI160_USER_INTR_OUT_CTRL_ADDR
- /**************************************************************/
- /**\name OUTPUT TYPE ENABLE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Out_Ctrl Description - Reg Addr --> 0x53, Bit -->2 */
- #define BMI160_USER_INTR1_OUTPUT_TYPE__POS 2
- #define BMI160_USER_INTR1_OUTPUT_TYPE__LEN 1
- #define BMI160_USER_INTR1_OUTPUT_TYPE__MSK 0x04
- #define BMI160_USER_INTR1_OUTPUT_TYPE__REG \
- BMI160_USER_INTR_OUT_CTRL_ADDR
- /**************************************************************/
- /**\name OUTPUT TYPE ENABLE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Out_Ctrl Description - Reg Addr --> 0x53, Bit -->3 */
- #define BMI160_USER_INTR1_OUTPUT_ENABLE__POS 3
- #define BMI160_USER_INTR1_OUTPUT_ENABLE__LEN 1
- #define BMI160_USER_INTR1_OUTPUT_ENABLE__MSK 0x08
- #define BMI160_USER_INTR1_OUTPUT_ENABLE__REG \
- BMI160_USER_INTR_OUT_CTRL_ADDR
- /**************************************************************/
- /**\name EDGE CONTROL ENABLE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Out_Ctrl Description - Reg Addr --> 0x53, Bit -->4 */
- #define BMI160_USER_INTR2_EDGE_CTRL__POS 4
- #define BMI160_USER_INTR2_EDGE_CTRL__LEN 1
- #define BMI160_USER_INTR2_EDGE_CTRL__MSK 0x10
- #define BMI160_USER_INTR2_EDGE_CTRL__REG \
- BMI160_USER_INTR_OUT_CTRL_ADDR
- /**************************************************************/
- /**\name LEVEL CONTROL ENABLE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Out_Ctrl Description - Reg Addr --> 0x53, Bit -->5 */
- #define BMI160_USER_INTR2_LEVEL__POS 5
- #define BMI160_USER_INTR2_LEVEL__LEN 1
- #define BMI160_USER_INTR2_LEVEL__MSK 0x20
- #define BMI160_USER_INTR2_LEVEL__REG \
- BMI160_USER_INTR_OUT_CTRL_ADDR
- /**************************************************************/
- /**\name OUTPUT TYPE ENABLE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Out_Ctrl Description - Reg Addr --> 0x53, Bit -->6 */
- #define BMI160_USER_INTR2_OUTPUT_TYPE__POS 6
- #define BMI160_USER_INTR2_OUTPUT_TYPE__LEN 1
- #define BMI160_USER_INTR2_OUTPUT_TYPE__MSK 0x40
- #define BMI160_USER_INTR2_OUTPUT_TYPE__REG \
- BMI160_USER_INTR_OUT_CTRL_ADDR
- /* Int_Out_Ctrl Description - Reg Addr --> 0x53, Bit -->7 */
- #define BMI160_USER_INTR2_OUTPUT_EN__POS 7
- #define BMI160_USER_INTR2_OUTPUT_EN__LEN 1
- #define BMI160_USER_INTR2_OUTPUT_EN__MSK 0x80
- #define BMI160_USER_INTR2_OUTPUT_EN__REG \
- BMI160_USER_INTR_OUT_CTRL_ADDR
- /**************************************************************/
- /**\name LATCH INTERRUPT LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Latch Description - Reg Addr --> 0x54, Bit -->0...3 */
- #define BMI160_USER_INTR_LATCH__POS 0
- #define BMI160_USER_INTR_LATCH__LEN 4
- #define BMI160_USER_INTR_LATCH__MSK 0x0F
- #define BMI160_USER_INTR_LATCH__REG BMI160_USER_INTR_LATCH_ADDR
- /**************************************************************/
- /**\name INPUT ENABLE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Latch Description - Reg Addr --> 0x54, Bit -->4 */
- #define BMI160_USER_INTR1_INPUT_ENABLE__POS 4
- #define BMI160_USER_INTR1_INPUT_ENABLE__LEN 1
- #define BMI160_USER_INTR1_INPUT_ENABLE__MSK 0x10
- #define BMI160_USER_INTR1_INPUT_ENABLE__REG \
- BMI160_USER_INTR_LATCH_ADDR
- /* Int_Latch Description - Reg Addr --> 0x54, Bit -->5*/
- #define BMI160_USER_INTR2_INPUT_ENABLE__POS 5
- #define BMI160_USER_INTR2_INPUT_ENABLE__LEN 1
- #define BMI160_USER_INTR2_INPUT_ENABLE__MSK 0x20
- #define BMI160_USER_INTR2_INPUT_ENABLE__REG \
- BMI160_USER_INTR_LATCH_ADDR
- /**************************************************************/
- /**\name INTERRUPT1 MAPPIONG OF LOW_G LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Map_0 Description - Reg Addr --> 0x55, Bit -->0 */
- #define BMI160_USER_INTR_MAP_0_INTR1_LOW_G__POS 0
- #define BMI160_USER_INTR_MAP_0_INTR1_LOW_G__LEN 1
- #define BMI160_USER_INTR_MAP_0_INTR1_LOW_G__MSK 0x01
- #define BMI160_USER_INTR_MAP_0_INTR1_LOW_G__REG BMI160_USER_INTR_MAP_0_ADDR
- /**************************************************************/
- /**\name INTERRUPT1 MAPPIONG OF HIGH_G LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Map_0 Description - Reg Addr --> 0x55, Bit -->1 */
- #define BMI160_USER_INTR_MAP_0_INTR1_HIGH_G__POS 1
- #define BMI160_USER_INTR_MAP_0_INTR1_HIGH_G__LEN 1
- #define BMI160_USER_INTR_MAP_0_INTR1_HIGH_G__MSK 0x02
- #define BMI160_USER_INTR_MAP_0_INTR1_HIGH_G__REG \
- BMI160_USER_INTR_MAP_0_ADDR
- /**************************************************************/
- /**\name INTERRUPT MAPPIONG OF ANY MOTION_G LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Map_0 Description - Reg Addr --> 0x55, Bit -->2 */
- #define BMI160_USER_INTR_MAP_0_INTR1_ANY_MOTION__POS 2
- #define BMI160_USER_INTR_MAP_0_INTR1_ANY_MOTION__LEN 1
- #define BMI160_USER_INTR_MAP_0_INTR1_ANY_MOTION__MSK 0x04
- #define BMI160_USER_INTR_MAP_0_INTR1_ANY_MOTION__REG BMI160_USER_INTR_MAP_0_ADDR
- /**************************************************************/
- /**\name INTERRUPT1 MAPPIONG OF NO MOTION LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Map_0 Description - Reg Addr --> 0x55, Bit -->3 */
- #define BMI160_USER_INTR_MAP_0_INTR1_NOMOTION__POS 3
- #define BMI160_USER_INTR_MAP_0_INTR1_NOMOTION__LEN 1
- #define BMI160_USER_INTR_MAP_0_INTR1_NOMOTION__MSK 0x08
- #define BMI160_USER_INTR_MAP_0_INTR1_NOMOTION__REG BMI160_USER_INTR_MAP_0_ADDR
- /**************************************************************/
- /**\name INTERRUPT1 MAPPIONG OF DOUBLE TAP LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Map_0 Description - Reg Addr --> 0x55, Bit -->4 */
- #define BMI160_USER_INTR_MAP_0_INTR1_DOUBLE_TAP__POS 4
- #define BMI160_USER_INTR_MAP_0_INTR1_DOUBLE_TAP__LEN 1
- #define BMI160_USER_INTR_MAP_0_INTR1_DOUBLE_TAP__MSK 0x10
- #define BMI160_USER_INTR_MAP_0_INTR1_DOUBLE_TAP__REG \
- BMI160_USER_INTR_MAP_0_ADDR
- /**************************************************************/
- /**\name INTERRUPT1 MAPPIONG OF SINGLE TAP LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Map_0 Description - Reg Addr --> 0x55, Bit -->5 */
- #define BMI160_USER_INTR_MAP_0_INTR1_SINGLE_TAP__POS 5
- #define BMI160_USER_INTR_MAP_0_INTR1_SINGLE_TAP__LEN 1
- #define BMI160_USER_INTR_MAP_0_INTR1_SINGLE_TAP__MSK 0x20
- #define BMI160_USER_INTR_MAP_0_INTR1_SINGLE_TAP__REG \
- BMI160_USER_INTR_MAP_0_ADDR
- /**************************************************************/
- /**\name INTERRUPT1 MAPPIONG OF ORIENT LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Map_0 Description - Reg Addr --> 0x55, Bit -->6 */
- #define BMI160_USER_INTR_MAP_0_INTR1_ORIENT__POS 6
- #define BMI160_USER_INTR_MAP_0_INTR1_ORIENT__LEN 1
- #define BMI160_USER_INTR_MAP_0_INTR1_ORIENT__MSK 0x40
- #define BMI160_USER_INTR_MAP_0_INTR1_ORIENT__REG \
- BMI160_USER_INTR_MAP_0_ADDR
- /**************************************************************/
- /**\name INTERRUPT MAPPIONG OF FLAT LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Map_0 Description - Reg Addr --> 0x56, Bit -->7 */
- #define BMI160_USER_INTR_MAP_0_INTR1_FLAT__POS 7
- #define BMI160_USER_INTR_MAP_0_INTR1_FLAT__LEN 1
- #define BMI160_USER_INTR_MAP_0_INTR1_FLAT__MSK 0x80
- #define BMI160_USER_INTR_MAP_0_INTR1_FLAT__REG BMI160_USER_INTR_MAP_0_ADDR
- /**************************************************************/
- /**\name INTERRUPT1 MAPPIONG OF PMU TRIGGER LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Map_1 Description - Reg Addr --> 0x56, Bit -->0 */
- #define BMI160_USER_INTR_MAP_1_INTR2_PMU_TRIG__POS 0
- #define BMI160_USER_INTR_MAP_1_INTR2_PMU_TRIG__LEN 1
- #define BMI160_USER_INTR_MAP_1_INTR2_PMU_TRIG__MSK 0x01
- #define BMI160_USER_INTR_MAP_1_INTR2_PMU_TRIG__REG BMI160_USER_INTR_MAP_1_ADDR
- /**************************************************************/
- /**\name INTERRUPT1 MAPPIONG OF FIFO FULL AND
- WATER MARK LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Map_1 Description - Reg Addr --> 0x56, Bit -->1 */
- #define BMI160_USER_INTR_MAP_1_INTR2_FIFO_FULL__POS 1
- #define BMI160_USER_INTR_MAP_1_INTR2_FIFO_FULL__LEN 1
- #define BMI160_USER_INTR_MAP_1_INTR2_FIFO_FULL__MSK 0x02
- #define BMI160_USER_INTR_MAP_1_INTR2_FIFO_FULL__REG \
- BMI160_USER_INTR_MAP_1_ADDR
- /* Int_Map_1 Description - Reg Addr --> 0x56, Bit -->2 */
- #define BMI160_USER_INTR_MAP_1_INTR2_FIFO_WM__POS 2
- #define BMI160_USER_INTR_MAP_1_INTR2_FIFO_WM__LEN 1
- #define BMI160_USER_INTR_MAP_1_INTR2_FIFO_WM__MSK 0x04
- #define BMI160_USER_INTR_MAP_1_INTR2_FIFO_WM__REG \
- BMI160_USER_INTR_MAP_1_ADDR
- /**************************************************************/
- /**\name INTERRUPT1 MAPPIONG OF DATA READY LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Map_1 Description - Reg Addr --> 0x56, Bit -->3 */
- #define BMI160_USER_INTR_MAP_1_INTR2_DATA_RDY__POS 3
- #define BMI160_USER_INTR_MAP_1_INTR2_DATA_RDY__LEN 1
- #define BMI160_USER_INTR_MAP_1_INTR2_DATA_RDY__MSK 0x08
- #define BMI160_USER_INTR_MAP_1_INTR2_DATA_RDY__REG \
- BMI160_USER_INTR_MAP_1_ADDR
- /**************************************************************/
- /**\name INTERRUPT1 MAPPIONG OF PMU TRIGGER LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Map_1 Description - Reg Addr --> 0x56, Bit -->4 */
- #define BMI160_USER_INTR_MAP_1_INTR1_PMU_TRIG__POS 4
- #define BMI160_USER_INTR_MAP_1_INTR1_PMU_TRIG__LEN 1
- #define BMI160_USER_INTR_MAP_1_INTR1_PMU_TRIG__MSK 0x10
- #define BMI160_USER_INTR_MAP_1_INTR1_PMU_TRIG__REG BMI160_USER_INTR_MAP_1_ADDR
- /**************************************************************/
- /**\name INTERRUPT1 MAPPIONG OF FIFO FULL AND
- WATER MARK LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Map_1 Description - Reg Addr --> 0x56, Bit -->5 */
- #define BMI160_USER_INTR_MAP_1_INTR1_FIFO_FULL__POS 5
- #define BMI160_USER_INTR_MAP_1_INTR1_FIFO_FULL__LEN 1
- #define BMI160_USER_INTR_MAP_1_INTR1_FIFO_FULL__MSK 0x20
- #define BMI160_USER_INTR_MAP_1_INTR1_FIFO_FULL__REG \
- BMI160_USER_INTR_MAP_1_ADDR
- /* Int_Map_1 Description - Reg Addr --> 0x56, Bit -->6 */
- #define BMI160_USER_INTR_MAP_1_INTR1_FIFO_WM__POS 6
- #define BMI160_USER_INTR_MAP_1_INTR1_FIFO_WM__LEN 1
- #define BMI160_USER_INTR_MAP_1_INTR1_FIFO_WM__MSK 0x40
- #define BMI160_USER_INTR_MAP_1_INTR1_FIFO_WM__REG \
- BMI160_USER_INTR_MAP_1_ADDR
- /**************************************************************/
- /**\name INTERRUPT1 MAPPIONG OF DATA READY LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Map_1 Description - Reg Addr --> 0x56, Bit -->7 */
- #define BMI160_USER_INTR_MAP_1_INTR1_DATA_RDY__POS 7
- #define BMI160_USER_INTR_MAP_1_INTR1_DATA_RDY__LEN 1
- #define BMI160_USER_INTR_MAP_1_INTR1_DATA_RDY__MSK 0x80
- #define BMI160_USER_INTR_MAP_1_INTR1_DATA_RDY__REG \
- BMI160_USER_INTR_MAP_1_ADDR
- /**************************************************************/
- /**\name INTERRUPT2 MAPPIONG OF LOW_G LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Map_2 Description - Reg Addr --> 0x57, Bit -->0 */
- #define BMI160_USER_INTR_MAP_2_INTR2_LOW_G__POS 0
- #define BMI160_USER_INTR_MAP_2_INTR2_LOW_G__LEN 1
- #define BMI160_USER_INTR_MAP_2_INTR2_LOW_G__MSK 0x01
- #define BMI160_USER_INTR_MAP_2_INTR2_LOW_G__REG BMI160_USER_INTR_MAP_2_ADDR
- /**************************************************************/
- /**\name INTERRUPT2 MAPPIONG OF HIGH_G LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Map_2 Description - Reg Addr --> 0x57, Bit -->1 */
- #define BMI160_USER_INTR_MAP_2_INTR2_HIGH_G__POS 1
- #define BMI160_USER_INTR_MAP_2_INTR2_HIGH_G__LEN 1
- #define BMI160_USER_INTR_MAP_2_INTR2_HIGH_G__MSK 0x02
- #define BMI160_USER_INTR_MAP_2_INTR2_HIGH_G__REG \
- BMI160_USER_INTR_MAP_2_ADDR
- /**************************************************************/
- /**\name INTERRUPT2 MAPPIONG OF ANY MOTION LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Map_2 Description - Reg Addr --> 0x57, Bit -->2 */
- #define BMI160_USER_INTR_MAP_2_INTR2_ANY_MOTION__POS 2
- #define BMI160_USER_INTR_MAP_2_INTR2_ANY_MOTION__LEN 1
- #define BMI160_USER_INTR_MAP_2_INTR2_ANY_MOTION__MSK 0x04
- #define BMI160_USER_INTR_MAP_2_INTR2_ANY_MOTION__REG BMI160_USER_INTR_MAP_2_ADDR
- /**************************************************************/
- /**\name INTERRUPT2 MAPPIONG OF NO MOTION LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Map_2 Description - Reg Addr --> 0x57, Bit -->3 */
- #define BMI160_USER_INTR_MAP_2_INTR2_NOMOTION__POS 3
- #define BMI160_USER_INTR_MAP_2_INTR2_NOMOTION__LEN 1
- #define BMI160_USER_INTR_MAP_2_INTR2_NOMOTION__MSK 0x08
- #define BMI160_USER_INTR_MAP_2_INTR2_NOMOTION__REG BMI160_USER_INTR_MAP_2_ADDR
- /**************************************************************/
- /**\name INTERRUPT2 MAPPIONG OF DOUBLE TAP LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Map_2 Description - Reg Addr --> 0x57, Bit -->4 */
- #define BMI160_USER_INTR_MAP_2_INTR2_DOUBLE_TAP__POS 4
- #define BMI160_USER_INTR_MAP_2_INTR2_DOUBLE_TAP__LEN 1
- #define BMI160_USER_INTR_MAP_2_INTR2_DOUBLE_TAP__MSK 0x10
- #define BMI160_USER_INTR_MAP_2_INTR2_DOUBLE_TAP__REG \
- BMI160_USER_INTR_MAP_2_ADDR
- /**************************************************************/
- /**\name INTERRUPT2 MAPPIONG OF SINGLE TAP LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Map_2 Description - Reg Addr --> 0x57, Bit -->5 */
- #define BMI160_USER_INTR_MAP_2_INTR2_SINGLE_TAP__POS 5
- #define BMI160_USER_INTR_MAP_2_INTR2_SINGLE_TAP__LEN 1
- #define BMI160_USER_INTR_MAP_2_INTR2_SINGLE_TAP__MSK 0x20
- #define BMI160_USER_INTR_MAP_2_INTR2_SINGLE_TAP__REG \
- BMI160_USER_INTR_MAP_2_ADDR
- /**************************************************************/
- /**\name INTERRUPT2 MAPPIONG OF ORIENT LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Map_2 Description - Reg Addr --> 0x57, Bit -->6 */
- #define BMI160_USER_INTR_MAP_2_INTR2_ORIENT__POS 6
- #define BMI160_USER_INTR_MAP_2_INTR2_ORIENT__LEN 1
- #define BMI160_USER_INTR_MAP_2_INTR2_ORIENT__MSK 0x40
- #define BMI160_USER_INTR_MAP_2_INTR2_ORIENT__REG \
- BMI160_USER_INTR_MAP_2_ADDR
- /**************************************************************/
- /**\name INTERRUPT2 MAPPIONG OF FLAT LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Map_2 Description - Reg Addr --> 0x57, Bit -->7 */
- #define BMI160_USER_INTR_MAP_2_INTR2_FLAT__POS 7
- #define BMI160_USER_INTR_MAP_2_INTR2_FLAT__LEN 1
- #define BMI160_USER_INTR_MAP_2_INTR2_FLAT__MSK 0x80
- #define BMI160_USER_INTR_MAP_2_INTR2_FLAT__REG BMI160_USER_INTR_MAP_2_ADDR
- /**************************************************************/
- /**\name TAP SOURCE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Data_0 Description - Reg Addr --> 0x58, Bit --> 3 */
- #define BMI160_USER_INTR_DATA_0_INTR_TAP_SOURCE__POS 3
- #define BMI160_USER_INTR_DATA_0_INTR_TAP_SOURCE__LEN 1
- #define BMI160_USER_INTR_DATA_0_INTR_TAP_SOURCE__MSK 0x08
- #define BMI160_USER_INTR_DATA_0_INTR_TAP_SOURCE__REG \
- BMI160_USER_INTR_DATA_0_ADDR
- /**************************************************************/
- /**\name HIGH SOURCE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Data_0 Description - Reg Addr --> 0x58, Bit --> 7 */
- #define BMI160_USER_INTR_DATA_0_INTR_LOW_HIGH_SOURCE__POS 7
- #define BMI160_USER_INTR_DATA_0_INTR_LOW_HIGH_SOURCE__LEN 1
- #define BMI160_USER_INTR_DATA_0_INTR_LOW_HIGH_SOURCE__MSK 0x80
- #define BMI160_USER_INTR_DATA_0_INTR_LOW_HIGH_SOURCE__REG \
- BMI160_USER_INTR_DATA_0_ADDR
- /**************************************************************/
- /**\name MOTION SOURCE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Data_1 Description - Reg Addr --> 0x59, Bit --> 7 */
- #define BMI160_USER_INTR_DATA_1_INTR_MOTION_SOURCE__POS 7
- #define BMI160_USER_INTR_DATA_1_INTR_MOTION_SOURCE__LEN 1
- #define BMI160_USER_INTR_DATA_1_INTR_MOTION_SOURCE__MSK 0x80
- #define BMI160_USER_INTR_DATA_1_INTR_MOTION_SOURCE__REG \
- BMI160_USER_INTR_DATA_1_ADDR
- /**************************************************************/
- /**\name LOW HIGH DURATION LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_LowHigh_0 Description - Reg Addr --> 0x5a, Bit --> 0...7 */
- #define BMI160_USER_INTR_LOWHIGH_0_INTR_LOW_DURN__POS 0
- #define BMI160_USER_INTR_LOWHIGH_0_INTR_LOW_DURN__LEN 8
- #define BMI160_USER_INTR_LOWHIGH_0_INTR_LOW_DURN__MSK 0xFF
- #define BMI160_USER_INTR_LOWHIGH_0_INTR_LOW_DURN__REG \
- BMI160_USER_INTR_LOWHIGH_0_ADDR
- /**************************************************************/
- /**\name LOW THRESHOLD LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_LowHigh_1 Description - Reg Addr --> 0x5b, Bit --> 0...7 */
- #define BMI160_USER_INTR_LOWHIGH_1_INTR_LOW_THRES__POS 0
- #define BMI160_USER_INTR_LOWHIGH_1_INTR_LOW_THRES__LEN 8
- #define BMI160_USER_INTR_LOWHIGH_1_INTR_LOW_THRES__MSK 0xFF
- #define BMI160_USER_INTR_LOWHIGH_1_INTR_LOW_THRES__REG \
- BMI160_USER_INTR_LOWHIGH_1_ADDR
- /**************************************************************/
- /**\name LOW HYSTERESIS LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_LowHigh_2 Description - Reg Addr --> 0x5c, Bit --> 0...1 */
- #define BMI160_USER_INTR_LOWHIGH_2_INTR_LOW_G_HYST__POS 0
- #define BMI160_USER_INTR_LOWHIGH_2_INTR_LOW_G_HYST__LEN 2
- #define BMI160_USER_INTR_LOWHIGH_2_INTR_LOW_G_HYST__MSK 0x03
- #define BMI160_USER_INTR_LOWHIGH_2_INTR_LOW_G_HYST__REG \
- BMI160_USER_INTR_LOWHIGH_2_ADDR
- /**************************************************************/
- /**\name LOW MODE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_LowHigh_2 Description - Reg Addr --> 0x5c, Bit --> 2 */
- #define BMI160_USER_INTR_LOWHIGH_2_INTR_LOW_G_MODE__POS 2
- #define BMI160_USER_INTR_LOWHIGH_2_INTR_LOW_G_MODE__LEN 1
- #define BMI160_USER_INTR_LOWHIGH_2_INTR_LOW_G_MODE__MSK 0x04
- #define BMI160_USER_INTR_LOWHIGH_2_INTR_LOW_G_MODE__REG \
- BMI160_USER_INTR_LOWHIGH_2_ADDR
- /**************************************************************/
- /**\name HIGH_G HYSTERESIS LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_LowHigh_2 Description - Reg Addr --> 0x5c, Bit --> 6...7 */
- #define BMI160_USER_INTR_LOWHIGH_2_INTR_HIGH_G_HYST__POS 6
- #define BMI160_USER_INTR_LOWHIGH_2_INTR_HIGH_G_HYST__LEN 2
- #define BMI160_USER_INTR_LOWHIGH_2_INTR_HIGH_G_HYST__MSK 0xC0
- #define BMI160_USER_INTR_LOWHIGH_2_INTR_HIGH_G_HYST__REG \
- BMI160_USER_INTR_LOWHIGH_2_ADDR
- /**************************************************************/
- /**\name HIGH_G DURATION LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_LowHigh_3 Description - Reg Addr --> 0x5d, Bit --> 0...7 */
- #define BMI160_USER_INTR_LOWHIGH_3_INTR_HIGH_G_DURN__POS 0
- #define BMI160_USER_INTR_LOWHIGH_3_INTR_HIGH_G_DURN__LEN 8
- #define BMI160_USER_INTR_LOWHIGH_3_INTR_HIGH_G_DURN__MSK 0xFF
- #define BMI160_USER_INTR_LOWHIGH_3_INTR_HIGH_G_DURN__REG \
- BMI160_USER_INTR_LOWHIGH_3_ADDR
- /**************************************************************/
- /**\name HIGH_G THRESHOLD LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_LowHigh_4 Description - Reg Addr --> 0x5e, Bit --> 0...7 */
- #define BMI160_USER_INTR_LOWHIGH_4_INTR_HIGH_THRES__POS 0
- #define BMI160_USER_INTR_LOWHIGH_4_INTR_HIGH_THRES__LEN 8
- #define BMI160_USER_INTR_LOWHIGH_4_INTR_HIGH_THRES__MSK 0xFF
- #define BMI160_USER_INTR_LOWHIGH_4_INTR_HIGH_THRES__REG \
- BMI160_USER_INTR_LOWHIGH_4_ADDR
- /**************************************************************/
- /**\name ANY MOTION DURATION LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Motion_0 Description - Reg Addr --> 0x5f, Bit --> 0...1 */
- #define BMI160_USER_INTR_MOTION_0_INTR_ANY_MOTION_DURN__POS 0
- #define BMI160_USER_INTR_MOTION_0_INTR_ANY_MOTION_DURN__LEN 2
- #define BMI160_USER_INTR_MOTION_0_INTR_ANY_MOTION_DURN__MSK 0x03
- #define BMI160_USER_INTR_MOTION_0_INTR_ANY_MOTION_DURN__REG \
- BMI160_USER_INTR_MOTION_0_ADDR
- /**************************************************************/
- /**\name SLOW/NO MOTION DURATION LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Motion_0 Description - Reg Addr --> 0x5f, Bit --> 2...7 */
- #define BMI160_USER_INTR_MOTION_0_INTR_SLOW_NO_MOTION_DURN__POS 2
- #define BMI160_USER_INTR_MOTION_0_INTR_SLOW_NO_MOTION_DURN__LEN 6
- #define BMI160_USER_INTR_MOTION_0_INTR_SLOW_NO_MOTION_DURN__MSK 0xFC
- #define BMI160_USER_INTR_MOTION_0_INTR_SLOW_NO_MOTION_DURN__REG \
- BMI160_USER_INTR_MOTION_0_ADDR
- /**************************************************************/
- /**\name ANY MOTION THRESHOLD LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Motion_1 Description - Reg Addr --> 0x60, Bit --> 0...7 */
- #define BMI160_USER_INTR_MOTION_1_INTR_ANY_MOTION_THRES__POS 0
- #define BMI160_USER_INTR_MOTION_1_INTR_ANY_MOTION_THRES__LEN 8
- #define BMI160_USER_INTR_MOTION_1_INTR_ANY_MOTION_THRES__MSK 0xFF
- #define BMI160_USER_INTR_MOTION_1_INTR_ANY_MOTION_THRES__REG \
- BMI160_USER_INTR_MOTION_1_ADDR
- /**************************************************************/
- /**\name SLOW/NO MOTION THRESHOLD LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Motion_2 Description - Reg Addr --> 0x61, Bit --> 0...7 */
- #define BMI160_USER_INTR_MOTION_2_INTR_SLOW_NO_MOTION_THRES__POS 0
- #define BMI160_USER_INTR_MOTION_2_INTR_SLOW_NO_MOTION_THRES__LEN 8
- #define BMI160_USER_INTR_MOTION_2_INTR_SLOW_NO_MOTION_THRES__MSK 0xFF
- #define BMI160_USER_INTR_MOTION_2_INTR_SLOW_NO_MOTION_THRES__REG \
- BMI160_USER_INTR_MOTION_2_ADDR
- /**************************************************************/
- /**\name SLOW/NO MOTION SELECT LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Motion_3 Description - Reg Addr --> 0x62, Bit --> 0 */
- #define BMI160_USER_INTR_MOTION_3_INTR_SLOW_NO_MOTION_SELECT__POS 0
- #define BMI160_USER_INTR_MOTION_3_INTR_SLOW_NO_MOTION_SELECT__LEN 1
- #define BMI160_USER_INTR_MOTION_3_INTR_SLOW_NO_MOTION_SELECT__MSK 0x01
- #define BMI160_USER_INTR_MOTION_3_INTR_SLOW_NO_MOTION_SELECT__REG \
- BMI160_USER_INTR_MOTION_3_ADDR
- /**************************************************************/
- /**\name SIGNIFICANT MOTION SELECT LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Motion_3 Description - Reg Addr --> 0x62, Bit --> 1 */
- #define BMI160_USER_INTR_SIGNIFICATION_MOTION_SELECT__POS 1
- #define BMI160_USER_INTR_SIGNIFICATION_MOTION_SELECT__LEN 1
- #define BMI160_USER_INTR_SIGNIFICATION_MOTION_SELECT__MSK 0x02
- #define BMI160_USER_INTR_SIGNIFICATION_MOTION_SELECT__REG \
- BMI160_USER_INTR_MOTION_3_ADDR
- /* Int_Motion_3 Description - Reg Addr --> 0x62, Bit --> 3..2 */
- #define BMI160_USER_INTR_SIGNIFICANT_MOTION_SKIP__POS 2
- #define BMI160_USER_INTR_SIGNIFICANT_MOTION_SKIP__LEN 2
- #define BMI160_USER_INTR_SIGNIFICANT_MOTION_SKIP__MSK 0x0C
- #define BMI160_USER_INTR_SIGNIFICANT_MOTION_SKIP__REG \
- BMI160_USER_INTR_MOTION_3_ADDR
- /* Int_Motion_3 Description - Reg Addr --> 0x62, Bit --> 5..4 */
- #define BMI160_USER_INTR_SIGNIFICANT_MOTION_PROOF__POS 4
- #define BMI160_USER_INTR_SIGNIFICANT_MOTION_PROOF__LEN 2
- #define BMI160_USER_INTR_SIGNIFICANT_MOTION_PROOF__MSK 0x30
- #define BMI160_USER_INTR_SIGNIFICANT_MOTION_PROOF__REG \
- BMI160_USER_INTR_MOTION_3_ADDR
- /**************************************************************/
- /**\name TAP DURATION LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* INT_TAP_0 Description - Reg Addr --> 0x63, Bit --> 0..2*/
- #define BMI160_USER_INTR_TAP_0_INTR_TAP_DURN__POS 0
- #define BMI160_USER_INTR_TAP_0_INTR_TAP_DURN__LEN 3
- #define BMI160_USER_INTR_TAP_0_INTR_TAP_DURN__MSK 0x07
- #define BMI160_USER_INTR_TAP_0_INTR_TAP_DURN__REG \
- BMI160_USER_INTR_TAP_0_ADDR
- /**************************************************************/
- /**\name TAP SHOCK LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Tap_0 Description - Reg Addr --> 0x63, Bit --> 6 */
- #define BMI160_USER_INTR_TAP_0_INTR_TAP_SHOCK__POS 6
- #define BMI160_USER_INTR_TAP_0_INTR_TAP_SHOCK__LEN 1
- #define BMI160_USER_INTR_TAP_0_INTR_TAP_SHOCK__MSK 0x40
- #define BMI160_USER_INTR_TAP_0_INTR_TAP_SHOCK__REG BMI160_USER_INTR_TAP_0_ADDR
- /**************************************************************/
- /**\name TAP QUIET LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Tap_0 Description - Reg Addr --> 0x63, Bit --> 7 */
- #define BMI160_USER_INTR_TAP_0_INTR_TAP_QUIET__POS 7
- #define BMI160_USER_INTR_TAP_0_INTR_TAP_QUIET__LEN 1
- #define BMI160_USER_INTR_TAP_0_INTR_TAP_QUIET__MSK 0x80
- #define BMI160_USER_INTR_TAP_0_INTR_TAP_QUIET__REG BMI160_USER_INTR_TAP_0_ADDR
- /**************************************************************/
- /**\name TAP THRESHOLD LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Tap_1 Description - Reg Addr --> 0x64, Bit --> 0...4 */
- #define BMI160_USER_INTR_TAP_1_INTR_TAP_THRES__POS 0
- #define BMI160_USER_INTR_TAP_1_INTR_TAP_THRES__LEN 5
- #define BMI160_USER_INTR_TAP_1_INTR_TAP_THRES__MSK 0x1F
- #define BMI160_USER_INTR_TAP_1_INTR_TAP_THRES__REG BMI160_USER_INTR_TAP_1_ADDR
- /**************************************************************/
- /**\name ORIENT MODE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Orient_0 Description - Reg Addr --> 0x65, Bit --> 0...1 */
- #define BMI160_USER_INTR_ORIENT_0_INTR_ORIENT_MODE__POS 0
- #define BMI160_USER_INTR_ORIENT_0_INTR_ORIENT_MODE__LEN 2
- #define BMI160_USER_INTR_ORIENT_0_INTR_ORIENT_MODE__MSK 0x03
- #define BMI160_USER_INTR_ORIENT_0_INTR_ORIENT_MODE__REG \
- BMI160_USER_INTR_ORIENT_0_ADDR
- /**************************************************************/
- /**\name ORIENT BLOCKING LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Orient_0 Description - Reg Addr --> 0x65, Bit --> 2...3 */
- #define BMI160_USER_INTR_ORIENT_0_INTR_ORIENT_BLOCKING__POS 2
- #define BMI160_USER_INTR_ORIENT_0_INTR_ORIENT_BLOCKING__LEN 2
- #define BMI160_USER_INTR_ORIENT_0_INTR_ORIENT_BLOCKING__MSK 0x0C
- #define BMI160_USER_INTR_ORIENT_0_INTR_ORIENT_BLOCKING__REG \
- BMI160_USER_INTR_ORIENT_0_ADDR
- /**************************************************************/
- /**\name ORIENT HYSTERESIS LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Orient_0 Description - Reg Addr --> 0x65, Bit --> 4...7 */
- #define BMI160_USER_INTR_ORIENT_0_INTR_ORIENT_HYST__POS 4
- #define BMI160_USER_INTR_ORIENT_0_INTR_ORIENT_HYST__LEN 4
- #define BMI160_USER_INTR_ORIENT_0_INTR_ORIENT_HYST__MSK 0xF0
- #define BMI160_USER_INTR_ORIENT_0_INTR_ORIENT_HYST__REG \
- BMI160_USER_INTR_ORIENT_0_ADDR
- /**************************************************************/
- /**\name ORIENT THETA LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Orient_1 Description - Reg Addr --> 0x66, Bit --> 0...5 */
- #define BMI160_USER_INTR_ORIENT_1_INTR_ORIENT_THETA__POS 0
- #define BMI160_USER_INTR_ORIENT_1_INTR_ORIENT_THETA__LEN 6
- #define BMI160_USER_INTR_ORIENT_1_INTR_ORIENT_THETA__MSK 0x3F
- #define BMI160_USER_INTR_ORIENT_1_INTR_ORIENT_THETA__REG \
- BMI160_USER_INTR_ORIENT_1_ADDR
- /**************************************************************/
- /**\name ORIENT UD LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Orient_1 Description - Reg Addr --> 0x66, Bit --> 6 */
- #define BMI160_USER_INTR_ORIENT_1_INTR_ORIENT_UD_ENABLE__POS 6
- #define BMI160_USER_INTR_ORIENT_1_INTR_ORIENT_UD_ENABLE__LEN 1
- #define BMI160_USER_INTR_ORIENT_1_INTR_ORIENT_UD_ENABLE__MSK 0x40
- #define BMI160_USER_INTR_ORIENT_1_INTR_ORIENT_UD_ENABLE__REG \
- BMI160_USER_INTR_ORIENT_1_ADDR
- /**************************************************************/
- /**\name ORIENT AXIS LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Orient_1 Description - Reg Addr --> 0x66, Bit --> 7 */
- #define BMI160_USER_INTR_ORIENT_1_INTR_ORIENT_AXES_EX__POS 7
- #define BMI160_USER_INTR_ORIENT_1_INTR_ORIENT_AXES_EX__LEN 1
- #define BMI160_USER_INTR_ORIENT_1_INTR_ORIENT_AXES_EX__MSK 0x80
- #define BMI160_USER_INTR_ORIENT_1_INTR_ORIENT_AXES_EX__REG \
- BMI160_USER_INTR_ORIENT_1_ADDR
- /**************************************************************/
- /**\name FLAT THETA LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Flat_0 Description - Reg Addr --> 0x67, Bit --> 0...5 */
- #define BMI160_USER_INTR_FLAT_0_INTR_FLAT_THETA__POS 0
- #define BMI160_USER_INTR_FLAT_0_INTR_FLAT_THETA__LEN 6
- #define BMI160_USER_INTR_FLAT_0_INTR_FLAT_THETA__MSK 0x3F
- #define BMI160_USER_INTR_FLAT_0_INTR_FLAT_THETA__REG \
- BMI160_USER_INTR_FLAT_0_ADDR
- /**************************************************************/
- /**\name FLAT HYSTERESIS LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Flat_1 Description - Reg Addr --> 0x68, Bit --> 0...3 */
- #define BMI160_USER_INTR_FLAT_1_INTR_FLAT_HYST__POS 0
- #define BMI160_USER_INTR_FLAT_1_INTR_FLAT_HYST__LEN 4
- #define BMI160_USER_INTR_FLAT_1_INTR_FLAT_HYST__MSK 0x0F
- #define BMI160_USER_INTR_FLAT_1_INTR_FLAT_HYST__REG \
- BMI160_USER_INTR_FLAT_1_ADDR
- /**************************************************************/
- /**\name FLAT HOLD LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Int_Flat_1 Description - Reg Addr --> 0x68, Bit --> 4...5 */
- #define BMI160_USER_INTR_FLAT_1_INTR_FLAT_HOLD__POS 4
- #define BMI160_USER_INTR_FLAT_1_INTR_FLAT_HOLD__LEN 2
- #define BMI160_USER_INTR_FLAT_1_INTR_FLAT_HOLD__MSK 0x30
- #define BMI160_USER_INTR_FLAT_1_INTR_FLAT_HOLD__REG \
- BMI160_USER_INTR_FLAT_1_ADDR
- /**************************************************************/
- /**\name FOC ACCEL XYZ LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Foc_Conf Description - Reg Addr --> 0x69, Bit --> 0...1 */
- #define BMI160_USER_FOC_ACCEL_Z__POS 0
- #define BMI160_USER_FOC_ACCEL_Z__LEN 2
- #define BMI160_USER_FOC_ACCEL_Z__MSK 0x03
- #define BMI160_USER_FOC_ACCEL_Z__REG BMI160_USER_FOC_CONFIG_ADDR
- /* Foc_Conf Description - Reg Addr --> 0x69, Bit --> 2...3 */
- #define BMI160_USER_FOC_ACCEL_Y__POS 2
- #define BMI160_USER_FOC_ACCEL_Y__LEN 2
- #define BMI160_USER_FOC_ACCEL_Y__MSK 0x0C
- #define BMI160_USER_FOC_ACCEL_Y__REG BMI160_USER_FOC_CONFIG_ADDR
- /* Foc_Conf Description - Reg Addr --> 0x69, Bit --> 4...5 */
- #define BMI160_USER_FOC_ACCEL_X__POS 4
- #define BMI160_USER_FOC_ACCEL_X__LEN 2
- #define BMI160_USER_FOC_ACCEL_X__MSK 0x30
- #define BMI160_USER_FOC_ACCEL_X__REG BMI160_USER_FOC_CONFIG_ADDR
- /**************************************************************/
- /**\name FOC GYRO LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Foc_Conf Description - Reg Addr --> 0x69, Bit --> 6 */
- #define BMI160_USER_FOC_GYRO_ENABLE__POS 6
- #define BMI160_USER_FOC_GYRO_ENABLE__LEN 1
- #define BMI160_USER_FOC_GYRO_ENABLE__MSK 0x40
- #define BMI160_USER_FOC_GYRO_ENABLE__REG \
- BMI160_USER_FOC_CONFIG_ADDR
- /**************************************************************/
- /**\name NVM PROGRAM LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* CONF Description - Reg Addr --> 0x6A, Bit --> 1 */
- #define BMI160_USER_CONFIG_NVM_PROG_ENABLE__POS 1
- #define BMI160_USER_CONFIG_NVM_PROG_ENABLE__LEN 1
- #define BMI160_USER_CONFIG_NVM_PROG_ENABLE__MSK 0x02
- #define BMI160_USER_CONFIG_NVM_PROG_ENABLE__REG \
- BMI160_USER_CONFIG_ADDR
- /*IF_CONF Description - Reg Addr --> 0x6B, Bit --> 0 */
- #define BMI160_USER_IF_CONFIG_SPI3__POS 0
- #define BMI160_USER_IF_CONFIG_SPI3__LEN 1
- #define BMI160_USER_IF_CONFIG_SPI3__MSK 0x01
- #define BMI160_USER_IF_CONFIG_SPI3__REG BMI160_USER_IF_CONFIG_ADDR
- /*IF_CONF Description - Reg Addr --> 0x6B, Bit --> 5..4 */
- #define BMI160_USER_IF_CONFIG_IF_MODE__POS 4
- #define BMI160_USER_IF_CONFIG_IF_MODE__LEN 2
- #define BMI160_USER_IF_CONFIG_IF_MODE__MSK 0x30
- #define BMI160_USER_IF_CONFIG_IF_MODE__REG \
- BMI160_USER_IF_CONFIG_ADDR
- /**************************************************************/
- /**\name GYRO SLEEP CONFIGURATION LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Pmu_Trigger Description - Reg Addr --> 0x6c, Bit --> 0...2 */
- #define BMI160_USER_GYRO_SLEEP_TRIGGER__POS 0
- #define BMI160_USER_GYRO_SLEEP_TRIGGER__LEN 3
- #define BMI160_USER_GYRO_SLEEP_TRIGGER__MSK 0x07
- #define BMI160_USER_GYRO_SLEEP_TRIGGER__REG BMI160_USER_PMU_TRIGGER_ADDR
- /* Pmu_Trigger Description - Reg Addr --> 0x6c, Bit --> 3...4 */
- #define BMI160_USER_GYRO_WAKEUP_TRIGGER__POS 3
- #define BMI160_USER_GYRO_WAKEUP_TRIGGER__LEN 2
- #define BMI160_USER_GYRO_WAKEUP_TRIGGER__MSK 0x18
- #define BMI160_USER_GYRO_WAKEUP_TRIGGER__REG BMI160_USER_PMU_TRIGGER_ADDR
- /* Pmu_Trigger Description - Reg Addr --> 0x6c, Bit --> 5 */
- #define BMI160_USER_GYRO_SLEEP_STATE__POS 5
- #define BMI160_USER_GYRO_SLEEP_STATE__LEN 1
- #define BMI160_USER_GYRO_SLEEP_STATE__MSK 0x20
- #define BMI160_USER_GYRO_SLEEP_STATE__REG BMI160_USER_PMU_TRIGGER_ADDR
- /* Pmu_Trigger Description - Reg Addr --> 0x6c, Bit --> 6 */
- #define BMI160_USER_GYRO_WAKEUP_INTR__POS 6
- #define BMI160_USER_GYRO_WAKEUP_INTR__LEN 1
- #define BMI160_USER_GYRO_WAKEUP_INTR__MSK 0x40
- #define BMI160_USER_GYRO_WAKEUP_INTR__REG BMI160_USER_PMU_TRIGGER_ADDR
- /**************************************************************/
- /**\name ACCEL SELF TEST LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Self_Test Description - Reg Addr --> 0x6d, Bit --> 0...1 */
- #define BMI160_USER_ACCEL_SELFTEST_AXIS__POS 0
- #define BMI160_USER_ACCEL_SELFTEST_AXIS__LEN 2
- #define BMI160_USER_ACCEL_SELFTEST_AXIS__MSK 0x03
- #define BMI160_USER_ACCEL_SELFTEST_AXIS__REG BMI160_USER_SELF_TEST_ADDR
- /* Self_Test Description - Reg Addr --> 0x6d, Bit --> 2 */
- #define BMI160_USER_ACCEL_SELFTEST_SIGN__POS 2
- #define BMI160_USER_ACCEL_SELFTEST_SIGN__LEN 1
- #define BMI160_USER_ACCEL_SELFTEST_SIGN__MSK 0x04
- #define BMI160_USER_ACCEL_SELFTEST_SIGN__REG BMI160_USER_SELF_TEST_ADDR
- /* Self_Test Description - Reg Addr --> 0x6d, Bit --> 3 */
- #define BMI160_USER_SELFTEST_AMP__POS 3
- #define BMI160_USER_SELFTEST_AMP__LEN 1
- #define BMI160_USER_SELFTEST_AMP__MSK 0x08
- #define BMI160_USER_SELFTEST_AMP__REG BMI160_USER_SELF_TEST_ADDR
- /**************************************************************/
- /**\name GYRO SELF TEST LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Self_Test Description - Reg Addr --> 0x6d, Bit --> 4 */
- #define BMI160_USER_GYRO_SELFTEST_START__POS 4
- #define BMI160_USER_GYRO_SELFTEST_START__LEN 1
- #define BMI160_USER_GYRO_SELFTEST_START__MSK 0x10
- #define BMI160_USER_GYRO_SELFTEST_START__REG \
- BMI160_USER_SELF_TEST_ADDR
- /**************************************************************/
- /**\name NV_CONFIG LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* NV_CONF Description - Reg Addr --> 0x70, Bit --> 0 */
- #define BMI160_USER_NV_CONFIG_SPI_ENABLE__POS 0
- #define BMI160_USER_NV_CONFIG_SPI_ENABLE__LEN 1
- #define BMI160_USER_NV_CONFIG_SPI_ENABLE__MSK 0x01
- #define BMI160_USER_NV_CONFIG_SPI_ENABLE__REG BMI160_USER_NV_CONFIG_ADDR
- /*IF_CONF Description - Reg Addr --> 0x70, Bit --> 1 */
- #define BMI160_USER_IF_CONFIG_I2C_WDT_SELECT__POS 1
- #define BMI160_USER_IF_CONFIG_I2C_WDT_SELECT__LEN 1
- #define BMI160_USER_IF_CONFIG_I2C_WDT_SELECT__MSK 0x02
- #define BMI160_USER_IF_CONFIG_I2C_WDT_SELECT__REG \
- BMI160_USER_NV_CONFIG_ADDR
- /*IF_CONF Description - Reg Addr --> 0x70, Bit --> 2 */
- #define BMI160_USER_IF_CONFIG_I2C_WDT_ENABLE__POS 2
- #define BMI160_USER_IF_CONFIG_I2C_WDT_ENABLE__LEN 1
- #define BMI160_USER_IF_CONFIG_I2C_WDT_ENABLE__MSK 0x04
- #define BMI160_USER_IF_CONFIG_I2C_WDT_ENABLE__REG \
- BMI160_USER_NV_CONFIG_ADDR
- /* NV_CONF Description - Reg Addr --> 0x70, Bit --> 3 */
- #define BMI160_USER_NV_CONFIG_SPARE0__POS 3
- #define BMI160_USER_NV_CONFIG_SPARE0__LEN 1
- #define BMI160_USER_NV_CONFIG_SPARE0__MSK 0x08
- #define BMI160_USER_NV_CONFIG_SPARE0__REG BMI160_USER_NV_CONFIG_ADDR
- /* NV_CONF Description - Reg Addr --> 0x70, Bit --> 4...7 */
- #define BMI160_USER_NV_CONFIG_NVM_COUNTER__POS 4
- #define BMI160_USER_NV_CONFIG_NVM_COUNTER__LEN 4
- #define BMI160_USER_NV_CONFIG_NVM_COUNTER__MSK 0xF0
- #define BMI160_USER_NV_CONFIG_NVM_COUNTER__REG BMI160_USER_NV_CONFIG_ADDR
- /**************************************************************/
- /**\name ACCEL MANUAL OFFSET LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Offset_0 Description - Reg Addr --> 0x71, Bit --> 0...7 */
- #define BMI160_USER_OFFSET_0_ACCEL_OFF_X__POS 0
- #define BMI160_USER_OFFSET_0_ACCEL_OFF_X__LEN 8
- #define BMI160_USER_OFFSET_0_ACCEL_OFF_X__MSK 0xFF
- #define BMI160_USER_OFFSET_0_ACCEL_OFF_X__REG BMI160_USER_OFFSET_0_ADDR
- /* Offset_1 Description - Reg Addr --> 0x72, Bit --> 0...7 */
- #define BMI160_USER_OFFSET_1_ACCEL_OFF_Y__POS 0
- #define BMI160_USER_OFFSET_1_ACCEL_OFF_Y__LEN 8
- #define BMI160_USER_OFFSET_1_ACCEL_OFF_Y__MSK 0xFF
- #define BMI160_USER_OFFSET_1_ACCEL_OFF_Y__REG BMI160_USER_OFFSET_1_ADDR
- /* Offset_2 Description - Reg Addr --> 0x73, Bit --> 0...7 */
- #define BMI160_USER_OFFSET_2_ACCEL_OFF_Z__POS 0
- #define BMI160_USER_OFFSET_2_ACCEL_OFF_Z__LEN 8
- #define BMI160_USER_OFFSET_2_ACCEL_OFF_Z__MSK 0xFF
- #define BMI160_USER_OFFSET_2_ACCEL_OFF_Z__REG BMI160_USER_OFFSET_2_ADDR
- /**************************************************************/
- /**\name GYRO MANUAL OFFSET LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Offset_3 Description - Reg Addr --> 0x74, Bit --> 0...7 */
- #define BMI160_USER_OFFSET_3_GYRO_OFF_X__POS 0
- #define BMI160_USER_OFFSET_3_GYRO_OFF_X__LEN 8
- #define BMI160_USER_OFFSET_3_GYRO_OFF_X__MSK 0xFF
- #define BMI160_USER_OFFSET_3_GYRO_OFF_X__REG BMI160_USER_OFFSET_3_ADDR
- /* Offset_4 Description - Reg Addr --> 0x75, Bit --> 0...7 */
- #define BMI160_USER_OFFSET_4_GYRO_OFF_Y__POS 0
- #define BMI160_USER_OFFSET_4_GYRO_OFF_Y__LEN 8
- #define BMI160_USER_OFFSET_4_GYRO_OFF_Y__MSK 0xFF
- #define BMI160_USER_OFFSET_4_GYRO_OFF_Y__REG BMI160_USER_OFFSET_4_ADDR
- /* Offset_5 Description - Reg Addr --> 0x76, Bit --> 0...7 */
- #define BMI160_USER_OFFSET_5_GYRO_OFF_Z__POS 0
- #define BMI160_USER_OFFSET_5_GYRO_OFF_Z__LEN 8
- #define BMI160_USER_OFFSET_5_GYRO_OFF_Z__MSK 0xFF
- #define BMI160_USER_OFFSET_5_GYRO_OFF_Z__REG BMI160_USER_OFFSET_5_ADDR
- /* Offset_6 Description - Reg Addr --> 0x77, Bit --> 0..1 */
- #define BMI160_USER_OFFSET_6_GYRO_OFF_X__POS 0
- #define BMI160_USER_OFFSET_6_GYRO_OFF_X__LEN 2
- #define BMI160_USER_OFFSET_6_GYRO_OFF_X__MSK 0x03
- #define BMI160_USER_OFFSET_6_GYRO_OFF_X__REG BMI160_USER_OFFSET_6_ADDR
- /* Offset_6 Description - Reg Addr --> 0x77, Bit --> 2...3 */
- #define BMI160_USER_OFFSET_6_GYRO_OFF_Y__POS 2
- #define BMI160_USER_OFFSET_6_GYRO_OFF_Y__LEN 2
- #define BMI160_USER_OFFSET_6_GYRO_OFF_Y__MSK 0x0C
- #define BMI160_USER_OFFSET_6_GYRO_OFF_Y__REG BMI160_USER_OFFSET_6_ADDR
- /* Offset_6 Description - Reg Addr --> 0x77, Bit --> 4...5 */
- #define BMI160_USER_OFFSET_6_GYRO_OFF_Z__POS 4
- #define BMI160_USER_OFFSET_6_GYRO_OFF_Z__LEN 2
- #define BMI160_USER_OFFSET_6_GYRO_OFF_Z__MSK 0x30
- #define BMI160_USER_OFFSET_6_GYRO_OFF_Z__REG BMI160_USER_OFFSET_6_ADDR
- /**************************************************************/
- /**\name ACCEL OFFSET ENABLE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Offset_6 Description - Reg Addr --> 0x77, Bit --> 6 */
- #define BMI160_USER_OFFSET_6_ACCEL_OFF_ENABLE__POS 6
- #define BMI160_USER_OFFSET_6_ACCEL_OFF_ENABLE__LEN 1
- #define BMI160_USER_OFFSET_6_ACCEL_OFF_ENABLE__MSK 0x40
- #define BMI160_USER_OFFSET_6_ACCEL_OFF_ENABLE__REG \
- BMI160_USER_OFFSET_6_ADDR
- /**************************************************************/
- /**\name GYRO OFFSET ENABLE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Offset_6 Description - Reg Addr --> 0x77, Bit --> 7 */
- #define BMI160_USER_OFFSET_6_GYRO_OFF_EN__POS 7
- #define BMI160_USER_OFFSET_6_GYRO_OFF_EN__LEN 1
- #define BMI160_USER_OFFSET_6_GYRO_OFF_EN__MSK 0x80
- #define BMI160_USER_OFFSET_6_GYRO_OFF_EN__REG BMI160_USER_OFFSET_6_ADDR
- /**************************************************************/
- /**\name STEP COUNTER LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* STEP_CNT_0 Description - Reg Addr --> 0x78, Bit --> 0 to 7 */
- #define BMI160_USER_STEP_COUNT_LSB__POS 0
- #define BMI160_USER_STEP_COUNT_LSB__LEN 7
- #define BMI160_USER_STEP_COUNT_LSB__MSK 0xFF
- #define BMI160_USER_STEP_COUNT_LSB__REG BMI160_USER_STEP_COUNT_0_ADDR
- /* STEP_CNT_1 Description - Reg Addr --> 0x79, Bit --> 0 to 7 */
- #define BMI160_USER_STEP_COUNT_MSB__POS 0
- #define BMI160_USER_STEP_COUNT_MSB__LEN 7
- #define BMI160_USER_STEP_COUNT_MSB__MSK 0xFF
- #define BMI160_USER_STEP_COUNT_MSB__REG BMI160_USER_STEP_COUNT_1_ADDR
- /**************************************************************/
- /**\name STEP COUNTER CONFIGURATION LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* STEP_CONFIG_0 Description - Reg Addr --> 0x7A, Bit --> 0 to 7 */
- #define BMI160_USER_STEP_CONFIG_ZERO__POS 0
- #define BMI160_USER_STEP_CONFIG_ZERO__LEN 7
- #define BMI160_USER_STEP_CONFIG_ZERO__MSK 0xFF
- #define BMI160_USER_STEP_CONFIG_ZERO__REG BMI160_USER_STEP_CONFIG_0_ADDR
- /* STEP_CONFIG_1 Description - Reg Addr --> 0x7B, Bit --> 0 to 2 and
- 4 to 7 */
- #define BMI160_USER_STEP_CONFIG_ONE_CNF1__POS 0
- #define BMI160_USER_STEP_CONFIG_ONE_CNF1__LEN 3
- #define BMI160_USER_STEP_CONFIG_ONE_CNF1__MSK 0x07
- #define BMI160_USER_STEP_CONFIG_ONE_CNF1__REG BMI160_USER_STEP_CONFIG_1_ADDR
- #define BMI160_USER_STEP_CONFIG_ONE_CNF2__POS 4
- #define BMI160_USER_STEP_CONFIG_ONE_CNF2__LEN 4
- #define BMI160_USER_STEP_CONFIG_ONE_CNF2__MSK 0xF0
- #define BMI160_USER_STEP_CONFIG_ONE_CNF2__REG BMI160_USER_STEP_CONFIG_1_ADDR
- /**************************************************************/
- /**\name STEP COUNTER ENABLE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* STEP_CONFIG_1 Description - Reg Addr --> 0x7B, Bit --> 0 to 2 */
- #define BMI160_USER_STEP_CONFIG_1_STEP_COUNT_ENABLE__POS 3
- #define BMI160_USER_STEP_CONFIG_1_STEP_COUNT_ENABLE__LEN 1
- #define BMI160_USER_STEP_CONFIG_1_STEP_COUNT_ENABLE__MSK 0x08
- #define BMI160_USER_STEP_CONFIG_1_STEP_COUNT_ENABLE__REG \
- BMI160_USER_STEP_CONFIG_1_ADDR
- /* USER REGISTERS DEFINITION END */
- /**************************************************************************/
- /* CMD REGISTERS DEFINITION START */
- /**************************************************************/
- /**\name COMMAND REGISTER LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Command description address - Reg Addr --> 0x7E, Bit --> 0....7 */
- #define BMI160_CMD_COMMANDS__POS 0
- #define BMI160_CMD_COMMANDS__LEN 8
- #define BMI160_CMD_COMMANDS__MSK 0xFF
- #define BMI160_CMD_COMMANDS__REG BMI160_CMD_COMMANDS_ADDR
- /**************************************************************/
- /**\name PAGE ENABLE LENGTH, POSITION AND MASK*/
- /**************************************************************/
- /* Target page address - Reg Addr --> 0x7F, Bit --> 4....5 */
- #define BMI160_CMD_TARGET_PAGE__POS 4
- #define BMI160_CMD_TARGET_PAGE__LEN 2
- #define BMI160_CMD_TARGET_PAGE__MSK 0x30
- #define BMI160_CMD_TARGET_PAGE__REG BMI160_CMD_EXT_MODE_ADDR
- /* Target page address - Reg Addr --> 0x7F, Bit --> 4....5 */
- #define BMI160_CMD_PAGING_EN__POS 7
- #define BMI160_CMD_PAGING_EN__LEN 1
- #define BMI160_CMD_PAGING_EN__MSK 0x80
- #define BMI160_CMD_PAGING_EN__REG BMI160_CMD_EXT_MODE_ADDR
- /* Target page address - Reg Addr --> 0x7F, Bit --> 4....5 */
- #define BMI160_COM_C_TRIM_FIVE__POS 4
- #define BMI160_COM_C_TRIM_FIVE__LEN 2
- #define BMI160_COM_C_TRIM_FIVE__MSK 0x30
- #define BMI160_COM_C_TRIM_FIVE__REG BMI160_COM_C_TRIM_FIVE_ADDR
- /**************************************************************************/
- /* CMD REGISTERS DEFINITION END */
- /**************************************************/
- /**\name FIFO FRAME COUNT DEFINITION */
- /*************************************************/
- #define FIFO_FRAME 1024
- #define FIFO_CONFIG_CHECK1 0x00
- #define FIFO_CONFIG_CHECK2 0x80
- /**************************************************/
- /**\name MAG SENSOR SELECT */
- /*************************************************/
- #define BST_BMM 0
- #define BST_AKM 1
- /**************************************************/
- /**\name ACCEL RANGE */
- /*************************************************/
- #define BMI160_ACCEL_RANGE_2G 0X03
- #define BMI160_ACCEL_RANGE_4G 0X05
- #define BMI160_ACCEL_RANGE_8G 0X08
- #define BMI160_ACCEL_RANGE_16G 0X0C
- /**************************************************/
- /**\name ACCEL ODR */
- /*************************************************/
- #define BMI160_ACCEL_OUTPUT_DATA_RATE_RESERVED 0x00
- #define BMI160_ACCEL_OUTPUT_DATA_RATE_0_78HZ 0x01
- #define BMI160_ACCEL_OUTPUT_DATA_RATE_1_56HZ 0x02
- #define BMI160_ACCEL_OUTPUT_DATA_RATE_3_12HZ 0x03
- #define BMI160_ACCEL_OUTPUT_DATA_RATE_6_25HZ 0x04
- #define BMI160_ACCEL_OUTPUT_DATA_RATE_12_5HZ 0x05
- #define BMI160_ACCEL_OUTPUT_DATA_RATE_25HZ 0x06
- #define BMI160_ACCEL_OUTPUT_DATA_RATE_50HZ 0x07
- #define BMI160_ACCEL_OUTPUT_DATA_RATE_100HZ 0x08
- #define BMI160_ACCEL_OUTPUT_DATA_RATE_200HZ 0x09
- #define BMI160_ACCEL_OUTPUT_DATA_RATE_400HZ 0x0A
- #define BMI160_ACCEL_OUTPUT_DATA_RATE_800HZ 0x0B
- #define BMI160_ACCEL_OUTPUT_DATA_RATE_1600HZ 0x0C
- #define BMI160_ACCEL_OUTPUT_DATA_RATE_RESERVED0 0x0D
- #define BMI160_ACCEL_OUTPUT_DATA_RATE_RESERVED1 0x0E
- #define BMI160_ACCEL_OUTPUT_DATA_RATE_RESERVED2 0x0F
- /**************************************************/
- /**\name ACCEL BANDWIDTH PARAMETER */
- /*************************************************/
- #define BMI160_ACCEL_OSR4_AVG1 0x00
- #define BMI160_ACCEL_OSR2_AVG2 0x01
- #define BMI160_ACCEL_NORMAL_AVG4 0x02
- #define BMI160_ACCEL_CIC_AVG8 0x03
- #define BMI160_ACCEL_RES_AVG16 0x04
- #define BMI160_ACCEL_RES_AVG32 0x05
- #define BMI160_ACCEL_RES_AVG64 0x06
- #define BMI160_ACCEL_RES_AVG128 0x07
- /**************************************************/
- /**\name GYRO ODR */
- /*************************************************/
- #define BMI160_GYRO_OUTPUT_DATA_RATE_RESERVED 0x00
- #define BMI160_GYRO_OUTPUT_DATA_RATE_25HZ 0x06
- #define BMI160_GYRO_OUTPUT_DATA_RATE_50HZ 0x07
- #define BMI160_GYRO_OUTPUT_DATA_RATE_100HZ 0x08
- #define BMI160_GYRO_OUTPUT_DATA_RATE_200HZ 0x09
- #define BMI160_GYRO_OUTPUT_DATA_RATE_400HZ 0x0A
- #define BMI160_GYRO_OUTPUT_DATA_RATE_800HZ 0x0B
- #define BMI160_GYRO_OUTPUT_DATA_RATE_1600HZ 0x0C
- #define BMI160_GYRO_OUTPUT_DATA_RATE_3200HZ 0x0D
- /**************************************************/
- /**\name GYRO BANDWIDTH PARAMETER */
- /*************************************************/
- #define BMI160_GYRO_OSR4_MODE 0x00
- #define BMI160_GYRO_OSR2_MODE 0x01
- #define BMI160_GYRO_NORMAL_MODE 0x02
- #define BMI160_GYRO_CIC_MODE 0x03
- /**************************************************/
- /**\name GYROSCOPE RANGE PARAMETER */
- /*************************************************/
- #define BMI160_GYRO_RANGE_2000_DEG_SEC 0x00
- #define BMI160_GYRO_RANGE_1000_DEG_SEC 0x01
- #define BMI160_GYRO_RANGE_500_DEG_SEC 0x02
- #define BMI160_GYRO_RANGE_250_DEG_SEC 0x03
- #define BMI160_GYRO_RANGE_125_DEG_SEC 0x04
- /**************************************************/
- /**\name MAG ODR */
- /*************************************************/
- #define BMI160_MAG_OUTPUT_DATA_RATE_RESERVED 0x00
- #define BMI160_MAG_OUTPUT_DATA_RATE_0_78HZ 0x01
- #define BMI160_MAG_OUTPUT_DATA_RATE_1_56HZ 0x02
- #define BMI160_MAG_OUTPUT_DATA_RATE_3_12HZ 0x03
- #define BMI160_MAG_OUTPUT_DATA_RATE_6_25HZ 0x04
- #define BMI160_MAG_OUTPUT_DATA_RATE_12_5HZ 0x05
- #define BMI160_MAG_OUTPUT_DATA_RATE_25HZ 0x06
- #define BMI160_MAG_OUTPUT_DATA_RATE_50HZ 0x07
- #define BMI160_MAG_OUTPUT_DATA_RATE_100HZ 0x08
- #define BMI160_MAG_OUTPUT_DATA_RATE_200HZ 0x09
- #define BMI160_MAG_OUTPUT_DATA_RATE_400HZ 0x0A
- #define BMI160_MAG_OUTPUT_DATA_RATE_800HZ 0x0B
- #define BMI160_MAG_OUTPUT_DATA_RATE_1600HZ 0x0C
- #define BMI160_MAG_OUTPUT_DATA_RATE_RESERVED0 0x0D
- #define BMI160_MAG_OUTPUT_DATA_RATE_RESERVED1 0x0E
- #define BMI160_MAG_OUTPUT_DATA_RATE_RESERVED2 0x0F
- /**************************************************/
- /**\name ENABLE/DISABLE SELECTIONS */
- /*************************************************/
- /* Enable accel and gyro offset */
- #define ACCEL_OFFSET_ENABLE 0x01
- #define GYRO_OFFSET_ENABLE 0x01
- /* command register definition */
- #define START_FOC_ACCEL_GYRO 0X03
- /* INT ENABLE 1 */
- #define BMI160_ANY_MOTION_X_ENABLE 0
- #define BMI160_ANY_MOTION_Y_ENABLE 1
- #define BMI160_ANY_MOTION_Z_ENABLE 2
- #define BMI160_DOUBLE_TAP_ENABLE 4
- #define BMI160_SINGLE_TAP_ENABLE 5
- #define BMI160_ORIENT_ENABLE 6
- #define BMI160_FLAT_ENABLE 7
- /* INT ENABLE 1 */
- #define BMI160_HIGH_G_X_ENABLE 0
- #define BMI160_HIGH_G_Y_ENABLE 1
- #define BMI160_HIGH_G_Z_ENABLE 2
- #define BMI160_LOW_G_ENABLE 3
- #define BMI160_DATA_RDY_ENABLE 4
- #define BMI160_FIFO_FULL_ENABLE 5
- #define BMI160_FIFO_WM_ENABLE 6
- /* INT ENABLE 2 */
- #define BMI160_NOMOTION_X_ENABLE 0
- #define BMI160_NOMOTION_Y_ENABLE 1
- #define BMI160_NOMOTION_Z_ENABLE 2
- /* FOC axis selection for accel*/
- #define FOC_X_AXIS 0
- #define FOC_Y_AXIS 1
- #define FOC_Z_AXIS 2
- /* IN OUT CONTROL */
- #define BMI160_INTR1_EDGE_CTRL 0
- #define BMI160_INTR2_EDGE_CTRL 1
- #define BMI160_INTR1_LEVEL 0
- #define BMI160_INTR2_LEVEL 1
- #define BMI160_INTR1_OUTPUT_TYPE 0
- #define BMI160_INTR2_OUTPUT_TYPE 1
- #define BMI160_INTR1_OUTPUT_ENABLE 0
- #define BMI160_INTR2_OUTPUT_ENABLE 1
- #define BMI160_INTR1_INPUT_ENABLE 0
- #define BMI160_INTR2_INPUT_ENABLE 1
- /* INTERRUPT MAPS */
- #define BMI160_INTR1_MAP_LOW_G 0
- #define BMI160_INTR2_MAP_LOW_G 1
- #define BMI160_INTR1_MAP_HIGH_G 0
- #define BMI160_INTR2_MAP_HIGH_G 1
- #define BMI160_INTR1_MAP_ANY_MOTION 0
- #define BMI160_INTR2_MAP_ANY_MOTION 1
- #define BMI160_INTR1_MAP_NOMO 0
- #define BMI160_INTR2_MAP_NOMO 1
- #define BMI160_INTR1_MAP_DOUBLE_TAP 0
- #define BMI160_INTR2_MAP_DOUBLE_TAP 1
- #define BMI160_INTR1_MAP_SINGLE_TAP 0
- #define BMI160_INTR2_MAP_SINGLE_TAP 1
- #define BMI160_INTR1_MAP_ORIENT 0
- #define BMI160_INTR2_MAP_ORIENT 1
- #define BMI160_INTR1_MAP_FLAT 0
- #define BMI160_INTR2_MAP_FLAT 1
- #define BMI160_INTR1_MAP_DATA_RDY 0
- #define BMI160_INTR2_MAP_DATA_RDY 1
- #define BMI160_INTR1_MAP_FIFO_WM 0
- #define BMI160_INTR2_MAP_FIFO_WM 1
- #define BMI160_INTR1_MAP_FIFO_FULL 0
- #define BMI160_INTR2_MAP_FIFO_FULL 1
- #define BMI160_INTR1_MAP_PMUTRIG 0
- #define BMI160_INTR2_MAP_PMUTRIG 1
- /* Interrupt mapping*/
- #define BMI160_MAP_INTR1 0
- #define BMI160_MAP_INTR2 1
- /**************************************************/
- /**\name TAP DURATION */
- /*************************************************/
- #define BMI160_TAP_DURN_50MS 0x00
- #define BMI160_TAP_DURN_100MS 0x01
- #define BMI160_TAP_DURN_150MS 0x02
- #define BMI160_TAP_DURN_200MS 0x03
- #define BMI160_TAP_DURN_250MS 0x04
- #define BMI160_TAP_DURN_375MS 0x05
- #define BMI160_TAP_DURN_500MS 0x06
- #define BMI160_TAP_DURN_700MS 0x07
- /**************************************************/
- /**\name TAP SHOCK */
- /*************************************************/
- #define BMI160_TAP_SHOCK_50MS 0x00
- #define BMI160_TAP_SHOCK_75MS 0x01
- /**************************************************/
- /**\name TAP QUIET */
- /*************************************************/
- #define BMI160_TAP_QUIET_30MS 0x00
- #define BMI160_TAP_QUIET_20MS 0x01
- /**************************************************/
- /**\name STEP DETECTION SELECTION MODES */
- /*************************************************/
- #define BMI160_STEP_NORMAL_MODE 0
- #define BMI160_STEP_SENSITIVE_MODE 1
- #define BMI160_STEP_ROBUST_MODE 2
- /**************************************************/
- /**\name STEP CONFIGURATION SELECT MODE */
- /*************************************************/
- #define STEP_CONFIG_NORMAL 0X315
- #define STEP_CONFIG_SENSITIVE 0X2D
- #define STEP_CONFIG_ROBUST 0X71D
- /**************************************************/
- /**\name BMM150 TRIM DATA DEFINITIONS */
- /*************************************************/
- #define BMI160_MAG_DIG_X1 0x5D
- #define BMI160_MAG_DIG_Y1 0x5E
- #define BMI160_MAG_DIG_Z4_LSB 0x62
- #define BMI160_MAG_DIG_Z4_MSB 0x63
- #define BMI160_MAG_DIG_X2 0x64
- #define BMI160_MAG_DIG_Y2 0x65
- #define BMI160_MAG_DIG_Z2_LSB 0x68
- #define BMI160_MAG_DIG_Z2_MSB 0x69
- #define BMI160_MAG_DIG_Z1_LSB 0x6A
- #define BMI160_MAG_DIG_Z1_MSB 0x6B
- #define BMI160_MAG_DIG_XYZ1_LSB 0x6C
- #define BMI160_MAG_DIG_XYZ1_MSB 0x6D
- #define BMI160_MAG_DIG_Z3_LSB 0x6E
- #define BMI160_MAG_DIG_Z3_MSB 0x6F
- #define BMI160_MAG_DIG_XY2 0x70
- #define BMI160_MAG_DIG_XY1 0x71
- /**************************************************/
- /**\name BMM150 PRE-SET MODE DEFINITIONS */
- /*************************************************/
- #define BMI160_MAG_PRESETMODE_LOWPOWER 1
- #define BMI160_MAG_PRESETMODE_REGULAR 2
- #define BMI160_MAG_PRESETMODE_HIGHACCURACY 3
- #define BMI160_MAG_PRESETMODE_ENHANCED 4
- /**************************************************/
- /**\name BMM150 PRESET MODES - DATA RATES */
- /*************************************************/
- #define BMI160_MAG_LOWPOWER_DR 0x02
- #define BMI160_MAG_REGULAR_DR 0x02
- #define BMI160_MAG_HIGHACCURACY_DR 0x2A
- #define BMI160_MAG_ENHANCED_DR 0x02
- /**************************************************/
- /**\name BMM150 PRESET MODES - REPETITIONS-XY RATES */
- /*************************************************/
- #define BMI160_MAG_LOWPOWER_REPXY 1
- #define BMI160_MAG_REGULAR_REPXY 4
- #define BMI160_MAG_HIGHACCURACY_REPXY 23
- #define BMI160_MAG_ENHANCED_REPXY 7
- /**************************************************/
- /**\name BMM150 PRESET MODES - REPETITIONS-Z RATES */
- /*************************************************/
- #define BMI160_MAG_LOWPOWER_REPZ 2
- #define BMI160_MAG_REGULAR_REPZ 14
- #define BMI160_MAG_HIGHACCURACY_REPZ 82
- #define BMI160_MAG_ENHANCED_REPZ 26
- /**************************************************/
- /**\name USED FOR MAG OVERFLOW CHECK FOR BMM150 */
- /*************************************************/
- #define BMI160_MAG_OVERFLOW_OUTPUT ((s16)-32768)
- #define BMI160_MAG_OVERFLOW_OUTPUT_S32 ((s32)(-2147483647-1))
- #define BMI160_MAG_NEGATIVE_SATURATION_Z ((s16)-32767)
- #define BMI160_MAG_POSITIVE_SATURATION_Z ((u16)32767)
- #define BMI160_MAG_FLIP_OVERFLOW_ADCVAL ((s16)-4096)
- #define BMI160_MAG_HALL_OVERFLOW_ADCVAL ((s16)-16384)
- /**************************************************/
- /**\name BMM150 REGISTER DEFINITION */
- /*************************************************/
- #define BMI160_BMM150_POWE_CONTROL_REG 0x4B
- #define BMI160_BMM150_POWE_MODE_REG 0x4C
- #define BMI160_BMM150_DATA_REG 0x42
- #define BMI160_BMM150_XY_REP 0x51
- #define BMI160_BMM150_Z_REP 0x52
- /**************************************************/
- /**\name AKM COMPENSATING DATA REGISTERS */
- /*************************************************/
- #define BMI160_BST_AKM_ASAX 0x60
- #define BMI160_BST_AKM_ASAY 0x61
- #define BMI160_BST_AKM_ASAZ 0x62
- /**************************************************/
- /**\name AKM POWER MODE SELECTION */
- /*************************************************/
- #define AKM_POWER_DOWN_MODE 0
- #define AKM_SINGLE_MEAS_MODE 1
- #define FUSE_ROM_MODE 2
- /**************************************************/
- /**\name SECONDARY_MAG POWER MODE SELECTION */
- /*************************************************/
- #define BMI160_MAG_FORCE_MODE 0
- #define BMI160_MAG_SUSPEND_MODE 1
- /**************************************************/
- /**\name MAG POWER MODE SELECTION */
- /*************************************************/
- #define FORCE_MODE 0
- #define SUSPEND_MODE 1
- #define NORMAL_MODE 2
- #define MAG_SUSPEND_MODE 1
- /**************************************************/
- /**\name FIFO CONFIGURATIONS */
- /*************************************************/
- #define FIFO_HEADER_ENABLE 0X01
- #define FIFO_MAG_ENABLE 0X01
- #define FIFO_ACCEL_ENABLE 0X01
- #define FIFO_GYRO_ENABLE 0X01
- #define FIFO_TIME_ENABLE 0X01
- #define FIFO_STOPONFULL_ENABLE 0X01
- #define FIFO_WM_INTERRUPT_ENABLE 0X01
- /* FIFO definitions*/
- #define FIFO_HEAD_A 0x84
- #define FIFO_HEAD_G 0x88
- #define FIFO_HEAD_M 0x90
- #define FIFO_HEAD_G_A 0x8C
- #define FIFO_HEAD_M_A 0x94
- #define FIFO_HEAD_M_G 0x98
- #define FIFO_HEAD_M_G_A 0x9C
- #define FIFO_HEAD_SENSOR_TIME 0x44
- #define FIFO_HEAD_SKIP_FRAME 0x40
- #define FIFO_HEAD_OVER_READ_LSB 0x80
- #define FIFO_HEAD_OVER_READ_MSB 0x00
- /* FIFO 1024 byte, max fifo frame count not over 150 */
- #define FIFO_FRAME_CNT 146
- #define FIFO_OVER_READ_RETURN ((s8)-10)
- #define FIFO_SENSORTIME_RETURN ((s8)-9)
- #define FIFO_SKIP_OVER_LEN ((s8)-8)
- #define FIFO_M_G_A_OVER_LEN ((s8)-7)
- #define FIFO_M_G_OVER_LEN ((s8)-6)
- #define FIFO_M_A_OVER_LEN ((s8)-5)
- #define FIFO_G_A_OVER_LEN ((s8)-4)
- #define FIFO_M_OVER_LEN ((s8)-3)
- #define FIFO_G_OVER_LEN ((s8)-2)
- #define FIFO_A_OVER_LEN ((s8)-1)
- /**************************************************/
- /**\name ACCEL POWER MODE */
- /*************************************************/
- #define ACCEL_MODE_NORMAL 0x11
- #define ACCEL_LOWPOWER 0X12
- #define ACCEL_SUSPEND 0X10
- /**************************************************/
- /**\name GYRO POWER MODE */
- /*************************************************/
- #define GYRO_MODE_SUSPEND 0x14
- #define GYRO_MODE_NORMAL 0x15
- #define GYRO_MODE_FASTSTARTUP 0x17
- /**************************************************/
- /**\name MAG POWER MODE */
- /*************************************************/
- #define MAG_MODE_SUSPEND 0x18
- #define MAG_MODE_NORMAL 0x19
- #define MAG_MODE_LOWPOWER 0x1A
- /**************************************************/
- /**\name ENABLE/DISABLE BIT VALUES */
- /*************************************************/
- #define BMI160_ENABLE 0x01
- #define BMI160_DISABLE 0x00
- /**************************************************/
- /**\name INTERRUPT EDGE TRIGGER ENABLE */
- /*************************************************/
- #define BMI160_EDGE 0x01
- #define BMI160_LEVEL 0x00
- /**************************************************/
- /**\name INTERRUPT LEVEL ENABLE */
- /*************************************************/
- #define BMI160_LEVEL_LOW 0x00
- #define BMI160_LEVEL_HIGH 0x01
- /**************************************************/
- /**\name INTERRUPT OUTPUT ENABLE */
- /*************************************************/
- #define BMI160_OPEN_DRAIN 0x01
- #define BMI160_PUSH_PULL 0x00
- /* interrupt output enable*/
- #define BMI160_INPUT 0x01
- #define BMI160_OUTPUT 0x00
- /**************************************************/
- /**\name INTERRUPT TAP SOURCE ENABLE */
- /*************************************************/
- #define FILTER_DATA 0x00
- #define UNFILTER_DATA 0x01
- /**************************************************/
- /**\name SLOW MOTION/ NO MOTION SELECT */
- /*************************************************/
- #define SLOW_MOTION 0x00
- #define NO_MOTION 0x01
- /**************************************************/
- /**\name SIGNIFICANT MOTION SELECTION */
- /*************************************************/
- #define ANY_MOTION 0x00
- #define SIGNIFICANT_MOTION 0x01
- /**************************************************/
- /**\name LATCH DURATION */
- /*************************************************/
- #define BMI160_LATCH_DUR_NONE 0x00
- #define BMI160_LATCH_DUR_312_5_MICRO_SEC 0x01
- #define BMI160_LATCH_DUR_625_MICRO_SEC 0x02
- #define BMI160_LATCH_DUR_1_25_MILLI_SEC 0x03
- #define BMI160_LATCH_DUR_2_5_MILLI_SEC 0x04
- #define BMI160_LATCH_DUR_5_MILLI_SEC 0x05
- #define BMI160_LATCH_DUR_10_MILLI_SEC 0x06
- #define BMI160_LATCH_DUR_20_MILLI_SEC 0x07
- #define BMI160_LATCH_DUR_40_MILLI_SEC 0x08
- #define BMI160_LATCH_DUR_80_MILLI_SEC 0x09
- #define BMI160_LATCH_DUR_160_MILLI_SEC 0x0A
- #define BMI160_LATCH_DUR_320_MILLI_SEC 0x0B
- #define BMI160_LATCH_DUR_640_MILLI_SEC 0x0C
- #define BMI160_LATCH_DUR_1_28_SEC 0x0D
- #define BMI160_LATCH_DUR_2_56_SEC 0x0E
- #define BMI160_LATCHED 0x0F
- /**************************************************/
- /**\name GYRO OFFSET MASK DEFINITION */
- /*************************************************/
- #define BMI160_GYRO_MANUAL_OFFSET_0_7 0x00FF
- #define BMI160_GYRO_MANUAL_OFFSET_8_9 0x0300
- /**************************************************/
- /**\name STEP CONFIGURATION MASK DEFINITION */
- /*************************************************/
- #define BMI160_STEP_CONFIG_0_7 0x00FF
- #define BMI160_STEP_CONFIG_8_10 0x0700
- #define BMI160_STEP_CONFIG_11_14 0xF000
- /**************************************************/
- /**\name DEFINITION USED FOR DIFFERENT WRITE */
- /*************************************************/
- #define BMI160_HEX_0_0_DATA 0x00
- #define BMI160_HEX_0_2_DATA 0x02
- #define BMI160_HEX_0_3_DATA 0x03
- #define BMI160_HEX_0_4_DATA 0x04
- #define BMI160_HEX_0_6_DATA 0x06
- #define BMI160_HEX_0_7_DATA 0x07
- #define BMI160_HEX_0_8_DATA 0x08
- #define BMI160_HEX_0_9_DATA 0x09
- #define BMI160_HEX_1_0_DATA 0x10
- #define BMI160_HEX_1_1_DATA 0x11
- #define BMI160_HEX_3_1_DATA 0x31
- #define BMI160_HEX_1_F_DATA 0x1F
- #define BMI160_HEX_8_0_DATA 0x80
- #define BMI160_HEX_0_1_DATA 0x01
- /**************************************************/
- /**\name MAG INIT DEFINITION */
- /*************************************************/
- #define BMI160_COMMAND_REG_ONE 0x37
- #define BMI160_COMMAND_REG_TWO 0x9A
- #define BMI160_COMMAND_REG_THREE 0xC0
- #define RESET_STEP_COUNTER 0xB2
- /**************************************************/
- /**\name BIT SLICE GET AND SET FUNCTIONS */
- /*************************************************/
- #define BMI160_GET_BITSLICE(regvar, bitname)\
- ((regvar & bitname##__MSK) >> bitname##__POS)
- #define BMI160_SET_BITSLICE(regvar, bitname, val)\
- ((regvar & ~bitname##__MSK) | \
- ((val<<bitname##__POS)&bitname##__MSK))
- /**************************************************/
- /**\name FUNCTION DECLARATIONS */
- /*************************************************/
- /**************************************************/
- /**\name FUNCTION FOR BMI160 INITIALIZE */
- /*************************************************/
- /*!
- * @brief
- * This function is used for initialize
- * bus read and bus write functions
- * assign the chip id and device address
- * chip id is read in the register 0x00 bit from 0 to 7
- *
- * @param bmi160 : structure pointer
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- * @note
- * While changing the parameter of the bmi160_t
- * consider the following point:
- * Changing the reference value of the parameter
- * will changes the local copy or local reference
- * make sure your changes will not
- * affect the reference value of the parameter
- * (Better case don't change the reference value of the parameter)
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_init(struct bmi160_t *bmi160);
- /**************************************************/
- /**\name FUNCTION FOR READ AND WRITE REGISTERS */
- /*************************************************/
- /*!
- * @brief
- * This API write the data to
- * the given register
- *
- *
- * @param v_addr_u8 -> Address of the register
- * @param v_data_u8 -> The data from the register
- * @param v_len_u8 -> no of bytes to read
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_write_reg(u8 v_addr_u8,
- u8 *v_data_u8, u8 v_len_u8);
- /*!
- * @brief
- * This API reads the data from
- * the given register
- *
- *
- * @param v_addr_u8 -> Address of the register
- * @param v_data_u8 -> The data from the register
- * @param v_len_u8 -> no of bytes to read
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_read_reg(u8 v_addr_u8,
- u8 *v_data_u8, u8 v_len_u8);
- /**************************************************/
- /**\name FUNCTION FOR ERROR CODES */
- /*************************************************/
- /*!
- * @brief This API used to reads the fatal error
- * from the Register 0x02 bit 0
- * This flag will be reset only by power-on-reset and soft reset
- *
- *
- * @param v_fatal_err_u8 : The status of fatal error
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_fatal_err(u8
- *v_fatal_err_u8);
- /*!
- * @brief This API used to read the error code
- * from register 0x02 bit 1 to 4
- *
- *
- * @param v_err_code_u8 : The status of error codes
- * error_code | description
- * ------------|---------------
- * 0x00 |no error
- * 0x01 |ACC_CONF error (accel ODR and bandwidth not compatible)
- * 0x02 |GYR_CONF error (Gyroscope ODR and bandwidth not compatible)
- * 0x03 |Under sampling mode and interrupt uses pre filtered data
- * 0x04 |reserved
- * 0x05 |Selected trigger-readout offset in
- * - |MAG_IF greater than selected ODR
- * 0x06 |FIFO configuration error for header less mode
- * 0x07 |Under sampling mode and pre filtered data as FIFO source
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_err_code(u8
- *v_error_code_u8);
- /*!
- * @brief This API Reads the i2c error code from the
- * Register 0x02 bit 5.
- * This error occurred in I2C master detected
- *
- * @param v_i2c_err_code_u8 : The status of i2c fail error
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_i2c_fail_err(u8
- *v_i2c_error_code_u8);
- /*!
- * @brief This API Reads the dropped command error
- * from the register 0x02 bit 6
- *
- *
- * @param v_drop_cmd_err_u8 : The status of drop command error
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_drop_cmd_err(u8
- *v_drop_cmd_err_u8);
- /*!
- * @brief This API reads the magnetometer data ready
- * interrupt not active.
- * It reads from the error register 0x0x2 bit 7
- *
- *
- *
- *
- * @param v_mag_data_rdy_err_u8 : The status of mag data ready interrupt
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_mag_dada_rdy_err(u8
- *v_mag_data_rdy_err_u8);
- /*!
- * @brief This API reads the error status
- * from the error register 0x02 bit 0 to 7
- *
- * @param v_mag_data_rdy_err_u8 : The status of mag data ready interrupt
- * @param v_fatal_er_u8r : The status of fatal error
- * @param v_err_code_u8 : The status of error code
- * @param v_i2c_fail_err_u8 : The status of I2C fail error
- * @param v_drop_cmd_err_u8 : The status of drop command error
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_error_status(u8 *v_fatal_er_u8r,
- u8 *v_err_code_u8, u8 *v_i2c_fail_err_u8,
- u8 *v_drop_cmd_err_u8, u8 *v_mag_data_rdy_err_u8);
- /******************************************************************/
- /**\name FUNCTIONS FOR MAG,ACCEL AND GYRO POWER MODE STATUS */
- /*****************************************************************/
- /*!
- * @brief This API reads the magnetometer power mode from
- * PMU status register 0x03 bit 0 and 1
- *
- * @param v_mag_power_mode_stat_u8 : The value of mag power mode
- * mag_powermode | value
- * ------------------|----------
- * SUSPEND | 0x00
- * NORMAL | 0x01
- * LOW POWER | 0x02
- *
- *
- * @note The power mode of mag set by the 0x7E command register
- * @note using the function "bmi160_set_command_register()"
- * value | mode
- * ---------|----------------
- * 0x18 | MAG_MODE_SUSPEND
- * 0x19 | MAG_MODE_NORMAL
- * 0x1A | MAG_MODE_LOWPOWER
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_mag_power_mode_stat(u8
- *v_mag_power_mode_stat_u8);
- /*!
- * @brief This API reads the gyroscope power mode from
- * PMU status register 0x03 bit 2 and 3
- *
- * @param v_gyro_power_mode_stat_u8 : The value of gyro power mode
- * gyro_powermode | value
- * ------------------|----------
- * SUSPEND | 0x00
- * NORMAL | 0x01
- * FAST POWER UP | 0x03
- *
- * @note The power mode of gyro set by the 0x7E command register
- * @note using the function "bmi160_set_command_register()"
- * value | mode
- * ---------|----------------
- * 0x14 | GYRO_MODE_SUSPEND
- * 0x15 | GYRO_MODE_NORMAL
- * 0x17 | GYRO_MODE_FASTSTARTUP
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_power_mode_stat(u8
- *v_gyro_power_mode_stat_u8);
- /*!
- * @brief This API reads the accelerometer power mode from
- * PMU status register 0x03 bit 4 and 5
- *
- *
- * @param v_accel_power_mode_stat_u8 : The value of accel power mode
- * accel_powermode | value
- * ------------------|----------
- * SUSPEND | 0x00
- * NORMAL | 0x01
- * LOW POWER | 0x03
- *
- * @note The power mode of accel set by the 0x7E command register
- * @note using the function "bmi160_set_command_register()"
- * value | mode
- * ---------|----------------
- * 0x11 | ACCEL_MODE_NORMAL
- * 0x12 | ACCEL_LOWPOWER
- * 0x10 | ACCEL_SUSPEND
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_accel_power_mode_stat(u8
- *v_accel_power_mode_stat_u8);
- /**************************************************/
- /**\name FUNCTION FOR Mag XYZ data read */
- /*************************************************/
- /*!
- * @brief This API reads magnetometer data X values
- * from the register 0x04 and 0x05
- * @brief The mag sensor data read form auxiliary mag
- *
- * @param v_mag_x_s16 : The value of mag x
- * @param v_sensor_select_u8 : Mag selection value
- * value | sensor
- * ---------|----------------
- * 0 | BMM150
- * 1 | AKM09911
- *
- * @note For mag data output rate configuration use the following function
- * @note bmi160_set_mag_output_data_rate()
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_read_mag_x(s16 *v_mag_x_s16,
- u8 v_sensor_select_u8);
- /*!
- * @brief This API reads magnetometer data Y values
- * from the register 0x06 and 0x07
- * @brief The mag sensor data read form auxiliary mag
- *
- * @param v_mag_y_s16 : The value of mag y
- * @param v_sensor_select_u8 : Mag selection value
- * value | sensor
- * ---------|----------------
- * 0 | BMM150
- * 1 | AKM09911
- *
- * @note For mag data output rate configuration use the following function
- * @note bmi160_set_mag_output_data_rate()
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_read_mag_y(s16 *v_mag_y_s16,
- u8 v_sensor_select_u8);
- /*!
- * @brief This API reads magnetometer data Z values
- * from the register 0x08 and 0x09
- * @brief The mag sensor data read form auxiliary mag
- *
- * @param v_mag_z_s16 : The value of mag z
- * @param v_sensor_select_u8 : Mag selection value
- * value | sensor
- * ---------|----------------
- * 0 | BMM150
- * 1 | AKM09911
- *
- * @note For mag data output rate configuration use the following function
- * @note bmi160_set_mag_output_data_rate()
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_read_mag_z(s16 *v_mag_z_s16,
- u8 v_sensor_select_u8);
- /*!
- * @brief This API reads magnetometer data RHALL values
- * from the register 0x0A and 0x0B
- *
- *
- * @param v_mag_r_s16 : The value of BMM150 r data
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_read_mag_r(
- s16 *v_mag_r_s16);
- /*!
- * @brief This API reads magnetometer data X,Y,Z values
- * from the register 0x04 to 0x09
- *
- * @brief The mag sensor data read form auxiliary mag
- *
- * @param mag : The value of mag xyz data
- * @param v_sensor_select_u8 : Mag selection value
- * value | sensor
- * ---------|----------------
- * 0 | BMM150
- * 1 | AKM09911
- *
- * @note For mag data output rate configuration use the following function
- * @note bmi160_set_mag_output_data_rate()
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_read_mag_xyz(
- struct bmi160_mag_t *mag, u8 v_sensor_select_u8);
- /*!*
- * @brief This API reads magnetometer data X,Y,Z,r
- * values from the register 0x04 to 0x0B
- *
- * @brief The mag sensor data read form auxiliary mag
- *
- * @param mag : The value of mag-BMM150 xyzr data
- *
- * @note For mag data output rate configuration use the following function
- * @note bmi160_set_mag_output_data_rate()
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_read_mag_xyzr(
- struct bmi160_mag_xyzr_t *mag);
- /**************************************************/
- /**\name FUNCTION FOR GYRO XYZ DATA READ */
- /*************************************************/
- /*!
- * @brief This API reads gyro data X values
- * form the register 0x0C and 0x0D
- *
- *
- *
- *
- * @param v_gyro_x_s16 : The value of gyro x data
- *
- * @note Gyro Configuration use the following function
- * @note bmi160_set_gyro_output_data_rate()
- * @note bmi160_set_gyro_bw()
- * @note bmi160_set_gyro_range()
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_read_gyro_x(
- s16 *v_gyro_x_s16);
- /*!
- * @brief This API reads gyro data Y values
- * form the register 0x0E and 0x0F
- *
- *
- *
- *
- * @param v_gyro_y_s16 : The value of gyro y data
- *
- * @note Gyro Configuration use the following function
- * @note bmi160_set_gyro_output_data_rate()
- * @note bmi160_set_gyro_bw()
- * @note bmi160_set_gyro_range()
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error result of communication routines
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_read_gyro_y(
- s16 *v_gyro_y_s16);
- /*!
- * @brief This API reads gyro data Z values
- * form the register 0x10 and 0x11
- *
- *
- *
- *
- * @param v_gyro_z_s16 : The value of gyro z data
- *
- * @note Gyro Configuration use the following function
- * @note bmi160_set_gyro_output_data_rate()
- * @note bmi160_set_gyro_bw()
- * @note bmi160_set_gyro_range()
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_read_gyro_z(
- s16 *v_gyro_z_s16);
- /*!
- * @brief This API reads gyro data X,Y,Z values
- * from the register 0x0C to 0x11
- *
- *
- *
- *
- * @param gyro : The value of gyro xyz
- *
- * @note Gyro Configuration use the following function
- * @note bmi160_set_gyro_output_data_rate()
- * @note bmi160_set_gyro_bw()
- * @note bmi160_set_gyro_range()
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_read_gyro_xyz(
- struct bmi160_gyro_t *gyro);
- /**************************************************/
- /**\name FUNCTION FOR ACCEL XYZ DATA READ */
- /*************************************************/
- /*!
- * @brief This API reads accelerometer data X values
- * form the register 0x12 and 0x13
- *
- *
- *
- *
- * @param v_accel_x_s16 : The value of accel x
- *
- * @note For accel configuration use the following functions
- * @note bmi160_set_accel_output_data_rate()
- * @note bmi160_set_accel_bw()
- * @note bmi160_set_accel_under_sampling_parameter()
- * @note bmi160_set_accel_range()
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_read_accel_x(
- s16 *v_accel_x_s16);
- /*!
- * @brief This API reads accelerometer data Y values
- * form the register 0x14 and 0x15
- *
- *
- *
- *
- * @param v_accel_y_s16 : The value of accel y
- *
- * @note For accel configuration use the following functions
- * @note bmi160_set_accel_output_data_rate()
- * @note bmi160_set_accel_bw()
- * @note bmi160_set_accel_under_sampling_parameter()
- * @note bmi160_set_accel_range()
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_read_accel_y(
- s16 *v_accel_y_s16);
- /*!
- * @brief This API reads accelerometer data Z values
- * form the register 0x16 and 0x17
- *
- *
- *
- *
- * @param v_accel_z_s16 : The value of accel z
- *
- * @note For accel configuration use the following functions
- * @note bmi160_set_accel_output_data_rate()
- * @note bmi160_set_accel_bw()
- * @note bmi160_set_accel_under_sampling_parameter()
- * @note bmi160_set_accel_range()
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_read_accel_z(
- s16 *v_accel_z_s16);
- /*!
- * @brief This API reads accelerometer data X,Y,Z values
- * from the register 0x12 to 0x17
- *
- *
- *
- *
- * @param accel :The value of accel xyz
- *
- * @note For accel configuration use the following functions
- * @note bmi160_set_accel_output_data_rate()
- * @note bmi160_set_accel_bw()
- * @note bmi160_set_accel_under_sampling_parameter()
- * @note bmi160_set_accel_range()
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_read_accel_xyz(
- struct bmi160_accel_t *accel);
- /**************************************************/
- /**\name FUNCTION FOR SENSOR TIME */
- /*************************************************/
- /*!
- * @brief This API reads sensor_time from the register
- * 0x18 to 0x1A
- *
- *
- * @param v_sensor_time_u32 : The value of sensor time
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_sensor_time(
- u32 *v_sensor_time_u32);
- /**************************************************/
- /**\name FUNCTION FOR GYRO SLEF TEST */
- /*************************************************/
- /*!
- * @brief This API reads the Gyroscope self test
- * status from the register 0x1B bit 1
- *
- *
- * @param v_gyro_selftest_u8 : The value of gyro self test status
- * value | status
- * ---------|----------------
- * 0 | Gyroscope self test is running or failed
- * 1 | Gyroscope self test completed successfully
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_selftest(u8
- *v_gyro_selftest_u8);
- /**************************************************/
- /**\name FUNCTION FOR MANUAL INTERFACE */
- /*************************************************/
- /*!
- * @brief This API reads the status of
- * mag manual interface operation form the register 0x1B bit 2
- *
- *
- *
- * @param v_mag_manual_stat_u8 : The value of mag manual operation status
- * value | status
- * ---------|----------------
- * 0 | Indicates no manual magnetometer
- * - | interface operation is ongoing
- * 1 | Indicates manual magnetometer
- * - | interface operation is ongoing
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_mag_manual_operation_stat(u8
- *v_mag_manual_stat_u8);
- /**************************************************/
- /**\name FUNCTION FOR FAST OFFSET READY */
- /*************************************************/
- /*!
- * @brief This API reads the fast offset compensation
- * status form the register 0x1B bit 3
- *
- *
- * @param v_foc_rdy_u8 : The status of fast compensation
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_foc_rdy(u8
- *v_foc_rdy_u8);
- /**************************************************/
- /**\name FUNCTION FOR NVM READY */
- /*************************************************/
- /*!
- * @brief This API Reads the nvm_rdy status from the
- * resister 0x1B bit 4
- *
- *
- * @param v_nvm_rdy_u8 : The value of NVM ready status
- * value | status
- * ---------|----------------
- * 0 | NVM write operation in progress
- * 1 | NVM is ready to accept a new write trigger
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_nvm_rdy(u8
- *v_nvm_rdy_u8);
- /**************************************************/
- /**\name FUNCTION FOR DATA READY FOR MAG, GYRO, AND ACCEL */
- /*************************************************/
- /*!
- * @brief This API reads the status of mag data ready
- * from the register 0x1B bit 5
- * The status get reset when one mag data register is read out
- *
- * @param v_data_rdy_u8 : The value of mag data ready status
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_data_rdy_mag(u8
- *v_data_rdy_u8);
- /*!
- * @brief This API reads the status of gyro data ready form the
- * register 0x1B bit 6
- * The status get reset when gyro data register read out
- *
- *
- * @param v_data_rdy_u8 : The value of gyro data ready
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_data_rdy(u8
- *v_data_rdy_u8);
- /*!
- * @brief This API reads the status of accel data ready form the
- * register 0x1B bit 7
- * The status get reset when accel data register read out
- *
- *
- * @param v_data_rdy_u8 : The value of accel data ready status
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_accel_data_rdy(u8
- *drdy_acc);
- /**************************************************/
- /**\name FUNCTION FOR STEP INTERRUPT STATUS */
- /*************************************************/
- /*!
- * @brief This API reads the step detector interrupt status
- * from the register 0x1C bit 0
- * flag is associated with a specific interrupt function.
- * It is set when the single tab interrupt triggers. The
- * setting of INT_LATCH controls if the interrupt
- * signal and hence the
- * respective interrupt flag will be
- * permanently latched, temporarily latched
- * or not latched.
- *
- *
- *
- *
- * @param v_step_intr_u8 : The status of step detector interrupt
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat0_step_intr(u8
- *v_step_intr_u8);
- /**************************************************/
- /**\name FUNCTION FOR SIGNIFICANT INTERRUPT STATUS */
- /*************************************************/
- /*!
- * @brief This API reads the
- * significant motion interrupt status
- * from the register 0x1C bit 1
- * flag is associated with a specific interrupt function.
- * It is set when the single tab interrupt triggers. The
- * setting of INT_LATCH controls if the interrupt
- * signal and hence the
- * respective interrupt flag will be
- * permanently latched, temporarily latched
- * or not latched.
- *
- *
- *
- *
- *
- * @param v_significant_intr_u8 : The status of step
- * motion interrupt
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat0_significant_intr(u8
- *sigmot_intr);
- /**************************************************/
- /**\name FUNCTION FOR ANY MOTION INTERRUPT STATUS */
- /*************************************************/
- /*!
- * @brief This API reads the any motion interrupt status
- * from the register 0x1C bit 2
- * flag is associated with a specific interrupt function.
- * It is set when the single tab interrupt triggers. The
- * setting of INT_LATCH controls if the interrupt
- * signal and hence the
- * respective interrupt flag will be
- * permanently latched, temporarily latched
- * or not latched.
- *
- *
- *
- * @param v_any_motion_intr_u8 : The status of any-motion interrupt
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat0_any_motion_intr(u8
- *v_any_motion_intr_u8);
- /**************************************************/
- /**\name FUNCTION FOR PMU TRIGGER INTERRUPT STATUS */
- /*************************************************/
- /*!
- * @brief This API reads the power mode trigger interrupt status
- * from the register 0x1C bit 3
- * flag is associated with a specific interrupt function.
- * It is set when the single tab interrupt triggers. The
- * setting of INT_LATCH controls if the interrupt
- * signal and hence the
- * respective interrupt flag will be
- * permanently latched, temporarily latched
- * or not latched.
- *
- *
- *
- *
- *
- * @param v_pmu_trigger_intr_u8 : The status of power mode trigger interrupt
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat0_pmu_trigger_intr(u8
- *v_pmu_trigger_intr_u8);
- /**************************************************/
- /**\name FUNCTION FOR DOUBLE TAB STATUS */
- /*************************************************/
- /*!
- * @brief This API reads the double tab status
- * from the register 0x1C bit 4
- * flag is associated with a specific interrupt function.
- * It is set when the single tab interrupt triggers. The
- * setting of INT_LATCH controls if the interrupt
- * signal and hence the
- * respective interrupt flag will be
- * permanently latched, temporarily latched
- * or not latched.
- *
- *
- *
- *
- * @param v_double_tap_intr_u8 :The status of double tab interrupt
- *
- * @note Double tap interrupt can be configured by the following functions
- * @note INTERRUPT MAPPING
- * @note bmi160_set_intr_double_tap()
- * @note AXIS MAPPING
- * @note bmi160_get_stat2_tap_first_x()
- * @note bmi160_get_stat2_tap_first_y()
- * @note bmi160_get_stat2_tap_first_z()
- * @note DURATION
- * @note bmi160_set_intr_tap_durn()
- * @note THRESHOLD
- * @note bmi160_set_intr_tap_thres()
- * @note TAP QUIET
- * @note bmi160_set_intr_tap_quiet()
- * @note TAP SHOCK
- * @note bmi160_set_intr_tap_shock()
- * @note TAP SOURCE
- * @note bmi160_set_intr_tap_source()
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat0_double_tap_intr(u8
- *v_double_tap_intr_u8);
- /**************************************************/
- /**\name FUNCTION FOR SINGLE TAB STATUS */
- /*************************************************/
- /*!
- * @brief This API reads the single tab status
- * from the register 0x1C bit 5
- * flag is associated with a specific interrupt function.
- * It is set when the single tab interrupt triggers. The
- * setting of INT_LATCH controls if the interrupt
- * signal and hence the
- * respective interrupt flag will be
- * permanently latched, temporarily latched
- * or not latched.
- *
- *
- *
- *
- * @param v_single_tap_intr_u8 :The status of single tap interrupt
- *
- * @note Single tap interrupt can be configured by the following functions
- * @note INTERRUPT MAPPING
- * @note bmi160_set_intr_single_tap()
- * @note AXIS MAPPING
- * @note bmi160_get_stat2_tap_first_x()
- * @note bmi160_get_stat2_tap_first_y()
- * @note bmi160_get_stat2_tap_first_z()
- * @note DURATION
- * @note bmi160_set_intr_tap_durn()
- * @note THRESHOLD
- * @note bmi160_set_intr_tap_thres()
- * @note TAP QUIET
- * @note bmi160_set_intr_tap_quiet()
- * @note TAP SHOCK
- * @note bmi160_set_intr_tap_shock()
- * @note TAP SOURCE
- * @note bmi160_set_intr_tap_source()
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat0_single_tap_intr(u8
- *v_single_tap_intr_u8);
- /**************************************************/
- /**\name FUNCTION FOR ORIENT INTERRUPT STATUS */
- /*************************************************/
- /*!
- * @brief This API reads the orient status
- * from the register 0x1C bit 6
- * flag is associated with a specific interrupt function.
- * It is set when the orient interrupt triggers. The
- * setting of INT_LATCH controls if the
- * interrupt signal and hence the
- * respective interrupt flag will be
- * permanently latched, temporarily latched
- * or not latched.
- *
- *
- *
- *
- * @param v_orient_intr_u8 : The status of orient interrupt
- *
- * @note For orient interrupt configuration use the following functions
- * @note STATUS
- * @note bmi160_get_stat0_orient_intr()
- * @note AXIS MAPPING
- * @note bmi160_get_stat3_orient_xy()
- * @note bmi160_get_stat3_orient_z()
- * @note bmi160_set_intr_orient_axes_enable()
- * @note INTERRUPT MAPPING
- * @note bmi160_set_intr_orient()
- * @note INTERRUPT OUTPUT
- * @note bmi160_set_intr_orient_ud_enable()
- * @note THETA
- * @note bmi160_set_intr_orient_theta()
- * @note HYSTERESIS
- * @note bmi160_set_intr_orient_hyst()
- * @note BLOCKING
- * @note bmi160_set_intr_orient_blocking()
- * @note MODE
- * @note bmi160_set_intr_orient_mode()
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat0_orient_intr(u8
- *v_orient_intr_u8);
- /**************************************************/
- /**\name FUNCTION FOR FLAT INTERRUPT STATUS */
- /*************************************************/
- /*!
- * @brief This API reads the flat interrupt status
- * from the register 0x1C bit 7
- * flag is associated with a specific interrupt function.
- * It is set when the flat interrupt triggers. The
- * setting of INT_LATCH controls if the
- * interrupt signal and hence the
- * respective interrupt flag will be
- * permanently latched, temporarily latched
- * or not latched.
- *
- *
- *
- *
- * @param v_flat_intr_u8 : The status of flat interrupt
- *
- * @note For flat configuration use the following functions
- * @note STATS
- * @note bmi160_get_stat0_flat_intr()
- * @note bmi160_get_stat3_flat()
- * @note INTERRUPT MAPPING
- * @note bmi160_set_intr_flat()
- * @note THETA
- * @note bmi160_set_intr_flat_theta()
- * @note HOLD TIME
- * @note bmi160_set_intr_flat_hold()
- * @note HYSTERESIS
- * @note bmi160_set_intr_flat_hyst()
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat0_flat_intr(u8
- *v_flat_intr_u8);
- /**************************************************/
- /**\name FUNCTION FOR HIGH_G INTERRUPT STATUS */
- /*************************************************/
- /*!
- * @brief This API reads the high_g interrupt status
- * from the register 0x1D bit 2
- * flag is associated with a specific interrupt function.
- * It is set when the high g interrupt triggers. The
- * setting of INT_LATCH controls if the interrupt signal and hence the
- * respective interrupt flag will be permanently
- * latched, temporarily latched
- * or not latched.
- *
- *
- *
- *
- * @param v_high_g_intr_u8 : The status of high_g interrupt
- *
- * @note High_g interrupt configured by following functions
- * @note STATUS
- * @note bmi160_get_stat1_high_g_intr()
- * @note AXIS MAPPING
- * @note bmi160_get_stat3_high_g_first_x()
- * @note bmi160_get_stat3_high_g_first_y()
- * @note bmi160_get_stat3_high_g_first_z()
- * @note SIGN MAPPING
- * @note bmi160_get_stat3_high_g_first_sign()
- * @note INTERRUPT MAPPING
- * @note bmi160_set_intr_high_g()
- * @note HYSTERESIS
- * @note bmi160_set_intr_high_g_hyst()
- * @note DURATION
- * @note bmi160_set_intr_high_g_durn()
- * @note THRESHOLD
- * @note bmi160_set_intr_high_g_thres()
- * @note SOURCE
- * @note bmi160_set_intr_low_high_source()
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat1_high_g_intr(u8
- *v_high_g_intr_u8);
- /**************************************************/
- /**\name FUNCTION FOR LOW_G INTERRUPT STATUS */
- /*************************************************/
- /*!
- * @brief This API reads the low g interrupt status
- * from the register 0x1D bit 3
- * flag is associated with a specific interrupt function.
- * It is set when the low g interrupt triggers. The
- * setting of INT_LATCH controls if the interrupt signal and hence the
- * respective interrupt flag will be
- * permanently latched, temporarily latched
- * or not latched.
- *
- *
- *
- *
- * @param v_low_g_intr_u8 : The status of low_g interrupt
- *
- * @note Low_g interrupt configured by following functions
- * @note STATUS
- * @note bmi160_get_stat1_low_g_intr()
- * @note INTERRUPT MAPPING
- * @note bmi160_set_intr_low_g()
- * @note SOURCE
- * @note bmi160_set_intr_low_high_source()
- * @note DURATION
- * @note bmi160_set_intr_low_g_durn()
- * @note THRESHOLD
- * @note bmi160_set_intr_low_g_thres()
- * @note HYSTERESIS
- * @note bmi160_set_intr_low_g_hyst()
- * @note MODE
- * @note bmi160_set_intr_low_g_mode()
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat1_low_g_intr(u8
- *v_low_g_intr_u8);
- /**************************************************/
- /**\name FUNCTION FOR DATA READY INTERRUPT STATUS */
- /*************************************************/
- /*!
- * @brief This API reads data ready interrupt status
- * from the register 0x1D bit 4
- * flag is associated with a specific interrupt function.
- * It is set when the data ready interrupt triggers. The
- * setting of INT_LATCH controls if the interrupt signal and hence the
- * respective interrupt flag will be
- * permanently latched, temporarily latched
- * or not latched.
- *
- *
- *
- *
- * @param v_data_rdy_intr_u8 : The status of data ready interrupt
- *
- * @note Data ready interrupt configured by following functions
- * @note STATUS
- * @note bmi160_get_stat1_data_rdy_intr()
- * @note INTERRUPT MAPPING
- * @note bmi160_set_intr_data_rdy()
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat1_data_rdy_intr(u8
- *v_data_rdy_intr_u8);
- /**************************************************/
- /**\name FUNCTIONS FOR FIFO FULL AND WATER MARK INTERRUPT STATUS*/
- /*************************************************/
- /*!
- * @brief This API reads data ready FIFO full interrupt status
- * from the register 0x1D bit 5
- * flag is associated with a specific interrupt function.
- * It is set when the FIFO full interrupt triggers. The
- * setting of INT_LATCH controls if the
- * interrupt signal and hence the
- * respective interrupt flag will
- * be permanently latched, temporarily latched
- * or not latched.
- *
- *
- *
- *
- * @param v_fifo_full_intr_u8 : The status of fifo full interrupt
- *
- * @note FIFO full interrupt can be configured by following functions
- * @note bmi160_set_intr_fifo_full()
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat1_fifo_full_intr(u8
- *v_fifo_full_intr_u8);
- /*!
- * @brief This API reads data
- * ready FIFO watermark interrupt status
- * from the register 0x1D bit 6
- * flag is associated with a specific interrupt function.
- * It is set when the FIFO watermark interrupt triggers. The
- * setting of INT_LATCH controls if the
- * interrupt signal and hence the
- * respective interrupt flag will be
- * permanently latched, temporarily latched
- * or not latched.
- *
- *
- *
- *
- * @param v_fifo_wm_intr_u8 : The status of fifo water mark interrupt
- *
- * @note FIFO full interrupt can be configured by following functions
- * @note bmi160_set_intr_fifo_wm()
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat1_fifo_wm_intr(u8
- *v_fifo_wm_intr_u8);
- /**************************************************/
- /**\name FUNCTIONS FOR NO MOTION INTERRUPT STATUS*/
- /*************************************************/
- /*!
- * @brief This API reads data ready no motion interrupt status
- * from the register 0x1D bit 7
- * flag is associated with a specific interrupt function.
- * It is set when the no motion interrupt triggers. The
- * setting of INT_LATCH controls if the interrupt signal and hence the
- * respective interrupt flag will be permanently
- * latched, temporarily latched
- * or not latched.
- *
- *
- *
- *
- * @param v_nomotion_intr_u8 : The status of no motion interrupt
- *
- * @note No motion interrupt can be configured by following function
- * @note STATUS
- * @note bmi160_get_stat1_nomotion_intr()
- * @note INTERRUPT MAPPING
- * @note bmi160_set_intr_nomotion()
- * @note DURATION
- * @note bmi160_set_intr_slow_no_motion_durn()
- * @note THRESHOLD
- * @note bmi160_set_intr_slow_no_motion_thres()
- * @note SLOW/NO MOTION SELECT
- * @note bmi160_set_intr_slow_no_motion_select()
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat1_nomotion_intr(u8
- *nomo_intr);
- /**************************************************/
- /**\name FUNCTIONS FOR ANY MOTION FIRST XYZ AND SIGN INTERRUPT STATUS*/
- /*************************************************/
- /*!
- * @brief This API reads the status of any motion first x
- * from the register 0x1E bit 0
- *
- *
- * @param v_anymotion_first_x_u8 : The status of any motion first x interrupt
- * value | status
- * -----------|-------------
- * 0 | not triggered
- * 1 | triggered by x axis
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat2_any_motion_first_x(u8
- *v_anymotion_first_x_u8);
- /*!
- * @brief This API reads the status of any motion first y interrupt
- * from the register 0x1E bit 1
- *
- *
- *
- *@param v_any_motion_first_y_u8 : The status of any motion first y interrupt
- * value | status
- * -----------|-------------
- * 0 | not triggered
- * 1 | triggered by y axis
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat2_any_motion_first_y(u8
- *v_any_motion_first_y_u8);
- /*!
- * @brief This API reads the status of any motion first z interrupt
- * from the register 0x1E bit 2
- *
- *
- *
- *
- *@param v_any_motion_first_z_u8 : The status of any motion first z interrupt
- * value | status
- * -----------|-------------
- * 0 | not triggered
- * 1 | triggered by y axis
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat2_any_motion_first_z(u8
- *v_any_motion_first_z_u8);
- /*!
- * @brief This API reads the any motion sign status from the
- * register 0x1E bit 3
- *
- *
- *
- *
- * @param v_anymotion_sign_u8 : The status of any motion sign
- * value | sign
- * -----------|-------------
- * 0 | positive
- * 1 | negative
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat2_any_motion_sign(u8
- *v_anymotion_sign_u8);
- /**************************************************/
- /**\name FUNCTIONS FOR TAP FIRST XYZ AND SIGN INTERRUPT STATUS*/
- /*************************************************/
- /*!
- * @brief This API reads the any motion tap first x status from the
- * register 0x1E bit 4
- *
- *
- *
- *
- * @param v_tap_first_x_u8 :The status of any motion tap first x
- * value | status
- * -----------|-------------
- * 0 | not triggered
- * 1 | triggered by x axis
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat2_tap_first_x(u8
- *v_tap_first_x_u8);
- /*!
- * @brief This API reads the tap first y interrupt status from the
- * register 0x1E bit 5
- *
- *
- *
- *
- * @param v_tap_first_y_u8 :The status of tap first y interrupt
- * value | status
- * -----------|-------------
- * 0 | not triggered
- * 1 | triggered by y axis
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat2_tap_first_y(u8
- *v_tap_first_y_u8);
- /*!
- * @brief This API reads the tap first z interrupt status from the
- * register 0x1E bit 6
- *
- *
- *
- *
- * @param v_tap_first_z_u8 :The status of tap first z interrupt
- * value | status
- * -----------|-------------
- * 0 | not triggered
- * 1 | triggered by z axis
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat2_tap_first_z(u8
- *v_tap_first_z_u8);
- /*!
- * @brief This API reads the tap sign status from the
- * register 0x1E bit 7
- *
- *
- *
- *
- * @param v_tap_sign_u8 : The status of tap sign
- * value | sign
- * -----------|-------------
- * 0 | positive
- * 1 | negative
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat2_tap_sign(u8
- *tap_sign);
- /**************************************************/
- /**\name FUNCTIONS FOR HIGH_G FIRST XYZ AND SIGN INTERRUPT STATUS*/
- /*************************************************/
- /*!
- * @brief This API reads the high_g first x status from the
- * register 0x1F bit 0
- *
- *
- *
- *
- * @param v_high_g_first_x_u8 :The status of high_g first x
- * value | status
- * -----------|-------------
- * 0 | not triggered
- * 1 | triggered by x axis
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat3_high_g_first_x(u8
- *v_high_g_first_x_u8);
- /*!
- * @brief This API reads the high_g first y status from the
- * register 0x1F bit 1
- *
- *
- *
- *
- * @param v_high_g_first_y_u8 : The status of high_g first y
- * value | status
- * -----------|-------------
- * 0 | not triggered
- * 1 | triggered by y axis
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat3_high_g_first_y(u8
- *v_high_g_first_y_u8);
- /*!
- * @brief This API reads the high_g first z status from the
- * register 0x1F bit 3
- *
- *
- *
- *
- * @param v_high_g_first_z_u8 : The status of high_g first z
- * value | status
- * -----------|-------------
- * 0 | not triggered
- * 1 | triggered by z axis
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat3_high_g_first_z(u8
- *v_high_g_first_z_u8);
- /*!
- * @brief This API reads the high sign status from the
- * register 0x1F bit 3
- *
- *
- *
- *
- * @param v_high_g_sign_u8 :The status of high sign
- * value | sign
- * -----------|-------------
- * 0 | positive
- * 1 | negative
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat3_high_g_sign(u8
- *v_high_g_sign_u8);
- /**************************************************/
- /**\name FUNCTIONS FOR ORIENT XY AND Z INTERRUPT STATUS*/
- /*************************************************/
- /*!
- * @brief This API reads the status of orient_xy plane
- * from the register 0x1F bit 4 and 5
- *
- *
- * @param v_orient_xy_u8 :The status of orient_xy plane
- * value | status
- * -----------|-------------
- * 0x00 | portrait upright
- * 0x01 | portrait upside down
- * 0x02 | landscape left
- * 0x03 | landscape right
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat3_orient_xy(u8
- *v_orient_xy_u8);
- /*!
- * @brief This API reads the status of orient z plane
- * from the register 0x1F bit 6
- *
- *
- * @param v_orient_z_u8 :The status of orient z
- * value | status
- * -----------|-------------
- * 0x00 | upward looking
- * 0x01 | downward looking
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat3_orient_z(u8
- *v_orient_z_u8);
- /**************************************************/
- /**\name FUNCTIONS FOR FLAT INTERRUPT STATUS*/
- /*************************************************/
- /*!
- * @brief This API reads the flat status from the register
- * 0x1F bit 7
- *
- *
- * @param v_flat_u8 : The status of flat interrupt
- * value | status
- * -----------|-------------
- * 0x00 | non flat
- * 0x01 | flat position
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat3_flat(u8
- *flat);
- /**************************************************/
- /**\name FUNCTION FOR TEMPERATUE READ */
- /*************************************************/
- /*!
- * @brief This API reads the temperature of the sensor
- * from the register 0x21 bit 0 to 7
- *
- *
- *
- * @param v_temp_s16 : The value of temperature
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_temp(s16
- *v_temp_s16);
- /**************************************************/
- /**\name FUNCTION FOR FIFO LENGTH AND FIFO DATA READ */
- /*************************************************/
- /*!
- * @brief This API reads the of the sensor
- * form the register 0x23 and 0x24 bit 0 to 7 and 0 to 2
- * @brief this byte counter is updated each time a complete frame
- * was read or writtern
- *
- *
- * @param v_fifo_length_u32 : The value of fifo byte counter
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_fifo_length(
- u32 *v_fifo_length_u32);
- /*!
- * @brief This API reads the fifo data of the sensor
- * from the register 0x24
- * @brief Data format depends on the setting of register FIFO_CONFIG
- *
- *
- *
- * @param v_fifo_data_u8 : Pointer holding the fifo data
- *
- * @note For reading FIFO data use the following functions
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_fifo_data(
- u8 *v_fifo_data_u8);
- /**************************************************/
- /**\name FUNCTION FOR ACCEL CONFIGURATIONS */
- /*************************************************/
- /*!
- * @brief This API is used to get the
- * accel output date rate form the register 0x40 bit 0 to 3
- *
- *
- * @param v_output_data_rate_u8 :The value of accel output date rate
- * value | output data rate
- * -------|--------------------------
- * 0 | BMI160_ACCEL_OUTPUT_DATA_RATE_RESERVED
- * 1 | BMI160_ACCEL_OUTPUT_DATA_RATE_0_78HZ
- * 2 | BMI160_ACCEL_OUTPUT_DATA_RATE_1_56HZ
- * 3 | BMI160_ACCEL_OUTPUT_DATA_RATE_3_12HZ
- * 4 | BMI160_ACCEL_OUTPUT_DATA_RATE_6_25HZ
- * 5 | BMI160_ACCEL_OUTPUT_DATA_RATE_12_5HZ
- * 6 | BMI160_ACCEL_OUTPUT_DATA_RATE_25HZ
- * 7 | BMI160_ACCEL_OUTPUT_DATA_RATE_50HZ
- * 8 | BMI160_ACCEL_OUTPUT_DATA_RATE_100HZ
- * 9 | BMI160_ACCEL_OUTPUT_DATA_RATE_200HZ
- * 10 | BMI160_ACCEL_OUTPUT_DATA_RATE_400HZ
- * 11 | BMI160_ACCEL_OUTPUT_DATA_RATE_800HZ
- * 12 | BMI160_ACCEL_OUTPUT_DATA_RATE_1600HZ
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_accel_output_data_rate(
- u8 *v_output_data_rate_u8);
- /*!
- * @brief This API is used to set the
- * accel output date rate form the register 0x40 bit 0 to 3
- *
- *
- * @param v_output_data_rate_u8 :The value of accel output date rate
- * value | output data rate
- * -------|--------------------------
- * 0 | BMI160_ACCEL_OUTPUT_DATA_RATE_RESERVED
- * 1 | BMI160_ACCEL_OUTPUT_DATA_RATE_0_78HZ
- * 2 | BMI160_ACCEL_OUTPUT_DATA_RATE_1_56HZ
- * 3 | BMI160_ACCEL_OUTPUT_DATA_RATE_3_12HZ
- * 4 | BMI160_ACCEL_OUTPUT_DATA_RATE_6_25HZ
- * 5 | BMI160_ACCEL_OUTPUT_DATA_RATE_12_5HZ
- * 6 | BMI160_ACCEL_OUTPUT_DATA_RATE_25HZ
- * 7 | BMI160_ACCEL_OUTPUT_DATA_RATE_50HZ
- * 8 | BMI160_ACCEL_OUTPUT_DATA_RATE_100HZ
- * 9 | BMI160_ACCEL_OUTPUT_DATA_RATE_200HZ
- * 10 | BMI160_ACCEL_OUTPUT_DATA_RATE_400HZ
- * 11 | BMI160_ACCEL_OUTPUT_DATA_RATE_800HZ
- * 12 | BMI160_ACCEL_OUTPUT_DATA_RATE_1600HZ
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_accel_output_data_rate(u8 odr);
- /*!
- * @brief This API is used to get the
- * accel bandwidth from the register 0x40 bit 4 to 6
- * @brief bandwidth parameter determines filter configuration(acc_us=0)
- * and averaging for under sampling mode(acc_us=1)
- *
- *
- * @param v_bw_u8 : The value of accel bandwidth
- *
- * @note accel bandwidth depends on under sampling parameter
- * @note under sampling parameter cab be set by the function
- * "BMI160_SET_ACCEL_UNDER_SAMPLING_PARAMETER"
- *
- * @note Filter configuration
- * accel_us | Filter configuration
- * -----------|---------------------
- * 0x00 | OSR4 mode
- * 0x01 | OSR2 mode
- * 0x02 | normal mode
- * 0x03 | CIC mode
- * 0x04 | Reserved
- * 0x05 | Reserved
- * 0x06 | Reserved
- * 0x07 | Reserved
- *
- * @note accel under sampling mode
- * accel_us | Under sampling mode
- * -----------|---------------------
- * 0x00 | no averaging
- * 0x01 | average 2 samples
- * 0x02 | average 4 samples
- * 0x03 | average 8 samples
- * 0x04 | average 16 samples
- * 0x05 | average 32 samples
- * 0x06 | average 64 samples
- * 0x07 | average 128 samples
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_accel_bw(u8 *v_bw_u8);
- /*!
- * @brief This API is used to set the
- * accel bandwidth from the register 0x40 bit 4 to 6
- * @brief bandwidth parameter determines filter configuration(acc_us=0)
- * and averaging for under sampling mode(acc_us=1)
- *
- *
- * @param v_bw_u8 : The value of accel bandwidth
- *
- * @note accel bandwidth depends on under sampling parameter
- * @note under sampling parameter cab be set by the function
- * "BMI160_SET_ACCEL_UNDER_SAMPLING_PARAMETER"
- *
- * @note Filter configuration
- * accel_us | Filter configuration
- * -----------|---------------------
- * 0x00 | OSR4 mode
- * 0x01 | OSR2 mode
- * 0x02 | normal mode
- * 0x03 | CIC mode
- * 0x04 | Reserved
- * 0x05 | Reserved
- * 0x06 | Reserved
- * 0x07 | Reserved
- *
- * @note accel under sampling mode
- * accel_us | Under sampling mode
- * -----------|---------------------
- * 0x00 | no averaging
- * 0x01 | average 2 samples
- * 0x02 | average 4 samples
- * 0x03 | average 8 samples
- * 0x04 | average 16 samples
- * 0x05 | average 32 samples
- * 0x06 | average 64 samples
- * 0x07 | average 128 samples
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_accel_bw(u8 v_bw_u8);
- /*!
- * @brief This API is used to get the accel
- * under sampling parameter form the register 0x40 bit 7
- *
- *
- *
- *
- * @param v_accel_under_sampling_u8 : The value of accel under sampling
- * value | under_sampling
- * ----------|---------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_accel_under_sampling_parameter(
- u8 *v_accel_under_sampling_u8);
- /*!
- * @brief This API is used to set the accel
- * under sampling parameter form the register 0x40 bit 7
- *
- *
- *
- *
- * @param v_accel_under_sampling_u8 : The value of accel under sampling
- * value | under_sampling
- * ----------|---------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_accel_under_sampling_parameter(
- u8 v_accel_under_sampling_u8);
- /*!
- * @brief This API is used to get the ranges
- * (g values) of the accel from the register 0x41 bit 0 to 3
- *
- *
- *
- *
- * @param v_range_u8 : The value of accel g range
- * value | g_range
- * ----------|-----------
- * 0x03 | BMI160_ACCEL_RANGE_2G
- * 0x05 | BMI160_ACCEL_RANGE_4G
- * 0x08 | BMI160_ACCEL_RANGE_8G
- * 0x0C | BMI160_ACCEL_RANGE_16G
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_accel_range(
- u8 *v_range_u8);
- /*!
- * @brief This API is used to set the ranges
- * (g values) of the accel from the register 0x41 bit 0 to 3
- *
- *
- *
- *
- * @param v_range_u8 : The value of accel g range
- * value | g_range
- * ----------|-----------
- * 0x03 | BMI160_ACCEL_RANGE_2G
- * 0x05 | BMI160_ACCEL_RANGE_4G
- * 0x08 | BMI160_ACCEL_RANGE_8G
- * 0x0C | BMI160_ACCEL_RANGE_16G
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_accel_range(
- u8 v_range_u8);
- /**************************************************/
- /**\name FUNCTION FOR GYRO CONFIGURATIONS */
- /*************************************************/
- /*!
- * @brief This API is used to get the
- * gyroscope output data rate from the register 0x42 bit 0 to 3
- *
- *
- *
- *
- * @param v_output_data_rate_u8 :The value of gyro output data rate
- * value | gyro output data rate
- * -----------|-----------------------------
- * 0x00 | BMI160_GYRO_OUTPUT_DATA_RATE_RESERVED
- * 0x01 | BMI160_GYRO_OUTPUT_DATA_RATE_RESERVED
- * 0x02 | BMI160_GYRO_OUTPUT_DATA_RATE_RESERVED
- * 0x03 | BMI160_GYRO_OUTPUT_DATA_RATE_RESERVED
- * 0x04 | BMI160_GYRO_OUTPUT_DATA_RATE_RESERVED
- * 0x05 | BMI160_GYRO_OUTPUT_DATA_RATE_RESERVED
- * 0x06 | BMI160_GYRO_OUTPUT_DATA_RATE_25HZ
- * 0x07 | BMI160_GYRO_OUTPUT_DATA_RATE_50HZ
- * 0x08 | BMI160_GYRO_OUTPUT_DATA_RATE_100HZ
- * 0x09 | BMI160_GYRO_OUTPUT_DATA_RATE_200HZ
- * 0x0A | BMI160_GYRO_OUTPUT_DATA_RATE_400HZ
- * 0x0B | BMI160_GYRO_OUTPUT_DATA_RATE_800HZ
- * 0x0C | BMI160_GYRO_OUTPUT_DATA_RATE_1600HZ
- * 0x0D | BMI160_GYRO_OUTPUT_DATA_RATE_3200HZ
- * 0x0E | BMI160_GYRO_OUTPUT_DATA_RATE_RESERVED
- * 0x0F | BMI160_GYRO_OUTPUT_DATA_RATE_RESERVED
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_output_data_rate(
- u8 *gyro_output_typer);
- /*!
- * @brief This API is used to set the
- * gyroscope output data rate from the register 0x42 bit 0 to 3
- *
- *
- *
- *
- * @param v_output_data_rate_u8 :The value of gyro output data rate
- * value | gyro output data rate
- * -----------|-----------------------------
- * 0x00 | BMI160_GYRO_OUTPUT_DATA_RATE_RESERVED
- * 0x01 | BMI160_GYRO_OUTPUT_DATA_RATE_RESERVED
- * 0x02 | BMI160_GYRO_OUTPUT_DATA_RATE_RESERVED
- * 0x03 | BMI160_GYRO_OUTPUT_DATA_RATE_RESERVED
- * 0x04 | BMI160_GYRO_OUTPUT_DATA_RATE_RESERVED
- * 0x05 | BMI160_GYRO_OUTPUT_DATA_RATE_RESERVED
- * 0x06 | BMI160_GYRO_OUTPUT_DATA_RATE_25HZ
- * 0x07 | BMI160_GYRO_OUTPUT_DATA_RATE_50HZ
- * 0x08 | BMI160_GYRO_OUTPUT_DATA_RATE_100HZ
- * 0x09 | BMI160_GYRO_OUTPUT_DATA_RATE_200HZ
- * 0x0A | BMI160_GYRO_OUTPUT_DATA_RATE_400HZ
- * 0x0B | BMI160_GYRO_OUTPUT_DATA_RATE_800HZ
- * 0x0C | BMI160_GYRO_OUTPUT_DATA_RATE_1600HZ
- * 0x0D | BMI160_GYRO_OUTPUT_DATA_RATE_3200HZ
- * 0x0E | BMI160_GYRO_OUTPUT_DATA_RATE_RESERVED
- * 0x0F | BMI160_GYRO_OUTPUT_DATA_RATE_RESERVED
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_gyro_output_data_rate(
- u8 gyro_output_typer);
- /*!
- * @brief This API is used to get the
- * data of gyro from the register 0x42 bit 4 to 5
- *
- *
- *
- *
- * @param v_bw_u8 : The value of gyro bandwidth
- * value | gyro bandwidth
- * ----------|----------------
- * 0x00 | BMI160_GYRO_OSR4_MODE
- * 0x01 | BMI160_GYRO_OSR2_MODE
- * 0x02 | BMI160_GYRO_NORMAL_MODE
- * 0x03 | BMI160_GYRO_CIC_MODE
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_bw(u8 *v_bw_u8);
- /*!
- * @brief This API is used to set the
- * data of gyro from the register 0x42 bit 4 to 5
- *
- *
- *
- *
- * @param v_bw_u8 : The value of gyro bandwidth
- * value | gyro bandwidth
- * ----------|----------------
- * 0x00 | BMI160_GYRO_OSR4_MODE
- * 0x01 | BMI160_GYRO_OSR2_MODE
- * 0x02 | BMI160_GYRO_NORMAL_MODE
- * 0x03 | BMI160_GYRO_CIC_MODE
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_gyro_bw(u8 v_bw_u8);
- /*!
- * @brief This API reads the range
- * of gyro from the register 0x43 bit 0 to 2
- *
- * @param v_range_u8 : The value of gyro range
- * value | range
- * ----------|-------------------------------
- * 0x00 | BMI160_GYRO_RANGE_2000_DEG_SEC
- * 0x01 | BMI160_GYRO_RANGE_1000_DEG_SEC
- * 0x02 | BMI160_GYRO_RANGE_500_DEG_SEC
- * 0x03 | BMI160_GYRO_RANGE_250_DEG_SEC
- * 0x04 | BMI160_GYRO_RANGE_125_DEG_SEC
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_range(
- u8 *v_range_u8);
- /*!
- * @brief This API set the range
- * of gyro from the register 0x43 bit 0 to 2
- *
- * @param v_range_u8 : The value of gyro range
- * value | range
- * ----------|-------------------------------
- * 0x00 | BMI160_GYRO_RANGE_2000_DEG_SEC
- * 0x01 | BMI160_GYRO_RANGE_1000_DEG_SEC
- * 0x02 | BMI160_GYRO_RANGE_500_DEG_SEC
- * 0x03 | BMI160_GYRO_RANGE_250_DEG_SEC
- * 0x04 | BMI160_GYRO_RANGE_125_DEG_SEC
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_gyro_range(
- u8 v_range_u8);
- /**************************************************/
- /**\name FUNCTION FOR MAG CONFIGURATIONS */
- /*************************************************/
- /*!
- * @brief This API is used to get the
- * output data rate of magnetometer from the register 0x44 bit 0 to 3
- *
- *
- *
- *
- * @param v_output_data_rat_u8e : The value of mag output data rate
- * value | mag output data rate
- * ---------|---------------------------
- * 0x00 |BMI160_MAG_OUTPUT_DATA_RATE_RESERVED
- * 0x01 |BMI160_MAG_OUTPUT_DATA_RATE_0_78HZ
- * 0x02 |BMI160_MAG_OUTPUT_DATA_RATE_1_56HZ
- * 0x03 |BMI160_MAG_OUTPUT_DATA_RATE_3_12HZ
- * 0x04 |BMI160_MAG_OUTPUT_DATA_RATE_6_25HZ
- * 0x05 |BMI160_MAG_OUTPUT_DATA_RATE_12_5HZ
- * 0x06 |BMI160_MAG_OUTPUT_DATA_RATE_25HZ
- * 0x07 |BMI160_MAG_OUTPUT_DATA_RATE_50HZ
- * 0x08 |BMI160_MAG_OUTPUT_DATA_RATE_100HZ
- * 0x09 |BMI160_MAG_OUTPUT_DATA_RATE_200HZ
- * 0x0A |BMI160_MAG_OUTPUT_DATA_RATE_400HZ
- * 0x0B |BMI160_MAG_OUTPUT_DATA_RATE_800HZ
- * 0x0C |BMI160_MAG_OUTPUT_DATA_RATE_1600HZ
- * 0x0D |BMI160_MAG_OUTPUT_DATA_RATE_RESERVED0
- * 0x0E |BMI160_MAG_OUTPUT_DATA_RATE_RESERVED1
- * 0x0F |BMI160_MAG_OUTPUT_DATA_RATE_RESERVED2
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_mag_output_data_rate(u8 *odr);
- /*!
- * @brief This API is used to set the
- * output data rate of magnetometer from the register 0x44 bit 0 to 3
- *
- *
- *
- *
- * @param v_output_data_rat_u8e : The value of mag output data rate
- * value | mag output data rate
- * ---------|---------------------------
- * 0x00 |BMI160_MAG_OUTPUT_DATA_RATE_RESERVED
- * 0x01 |BMI160_MAG_OUTPUT_DATA_RATE_0_78HZ
- * 0x02 |BMI160_MAG_OUTPUT_DATA_RATE_1_56HZ
- * 0x03 |BMI160_MAG_OUTPUT_DATA_RATE_3_12HZ
- * 0x04 |BMI160_MAG_OUTPUT_DATA_RATE_6_25HZ
- * 0x05 |BMI160_MAG_OUTPUT_DATA_RATE_12_5HZ
- * 0x06 |BMI160_MAG_OUTPUT_DATA_RATE_25HZ
- * 0x07 |BMI160_MAG_OUTPUT_DATA_RATE_50HZ
- * 0x08 |BMI160_MAG_OUTPUT_DATA_RATE_100HZ
- * 0x09 |BMI160_MAG_OUTPUT_DATA_RATE_200HZ
- * 0x0A |BMI160_MAG_OUTPUT_DATA_RATE_400HZ
- * 0x0B |BMI160_MAG_OUTPUT_DATA_RATE_800HZ
- * 0x0C |BMI160_MAG_OUTPUT_DATA_RATE_1600HZ
- * 0x0D |BMI160_MAG_OUTPUT_DATA_RATE_RESERVED0
- * 0x0E |BMI160_MAG_OUTPUT_DATA_RATE_RESERVED1
- * 0x0F |BMI160_MAG_OUTPUT_DATA_RATE_RESERVED2
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_mag_output_data_rate(u8 odr);
- /**************************************************/
- /**\name FUNCTION FOR FIFO CONFIGURATIONS */
- /*************************************************/
- /*!
- * @brief This API is used to read Down sampling
- * for gyro (2**downs_gyro) in the register 0x45 bit 0 to 2
- *
- *
- *
- *
- * @param v_fifo_down_gyro_u8 :The value of gyro fifo down
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_fifo_down_gyro(
- u8 *v_fifo_down_gyro_u8);
- /*!
- * @brief This API is used to set Down sampling
- * for gyro (2**downs_gyro) in the register 0x45 bit 0 to 2
- *
- *
- *
- *
- * @param v_fifo_down_gyro_u8 :The value of gyro fifo down
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_fifo_down_gyro(
- u8 v_fifo_down_gyro_u8);
- /*!
- * @brief This API is used to read gyro fifo filter data
- * from the register 0x45 bit 3
- *
- *
- *
- * @param v_gyro_fifo_filter_data_u8 :The value of gyro filter data
- * value | gyro_fifo_filter_data
- * ------------|-------------------------
- * 0x00 | Unfiltered data
- * 0x01 | Filtered data
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_fifo_filter_data(
- u8 *v_gyro_fifo_filter_data_u8);
- /*!
- * @brief This API is used to set gyro fifo filter data
- * from the register 0x45 bit 3
- *
- *
- *
- * @param v_gyro_fifo_filter_data_u8 :The value of gyro filter data
- * value | gyro_fifo_filter_data
- * ------------|-------------------------
- * 0x00 | Unfiltered data
- * 0x01 | Filtered data
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_gyro_fifo_filter_data(
- u8 v_gyro_fifo_filter_data_u8);
- /*!
- * @brief This API is used to read Down sampling
- * for accel (2*downs_accel) from the register 0x45 bit 4 to 6
- *
- *
- *
- *
- * @param v_fifo_down_u8 :The value of accel fifo down
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_fifo_down_accel(
- u8 *v_fifo_down_u8);
- /*!
- * @brief This API is used to set Down sampling
- * for accel (2*downs_accel) from the register 0x45 bit 4 to 6
- *
- *
- *
- *
- * @param v_fifo_down_u8 :The value of accel fifo down
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_fifo_down_accel(
- u8 v_fifo_down_u8);
- /*!
- * @brief This API is used to read accel fifo filter data
- * from the register 0x45 bit 7
- *
- *
- *
- * @param v_accel_fifo_filter_u8 :The value of accel filter data
- * value | accel_fifo_filter_data
- * ------------|-------------------------
- * 0x00 | Unfiltered data
- * 0x01 | Filtered data
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_accel_fifo_filter_data(
- u8 *v_accel_fifo_filter_u8);
- /*!
- * @brief This API is used to set accel fifo filter data
- * from the register 0x45 bit 7
- *
- *
- *
- * @param v_accel_fifo_filter_u8 :The value of accel filter data
- * value | accel_fifo_filter_data
- * ------------|-------------------------
- * 0x00 | Unfiltered data
- * 0x01 | Filtered data
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_accel_fifo_filter_data(
- u8 v_accel_fifo_filter_u8);
- /**************************************************/
- /**\name FUNCTION FOR FIFO WATER MARK ENABLE */
- /*************************************************/
- /*!
- * @brief This API is used to Trigger an interrupt
- * when FIFO contains water mark level from the register 0x46 bit 0 to 7
- *
- *
- *
- * @param v_fifo_wm_u8 : The value of fifo water mark level
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_fifo_wm(
- u8 *v_fifo_wm_u8);
- /*!
- * @brief This API is used to Trigger an interrupt
- * when FIFO contains water mark level from the register 0x46 bit 0 to 7
- *
- *
- *
- * @param v_fifo_wm_u8 : The value of fifo water mark level
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_fifo_wm(
- u8 v_fifo_wm_u8);
- /**************************************************/
- /**\name FUNCTION FOR FIFO CONFIGURATIONS */
- /*************************************************/
- /*!
- * @brief This API reads the fifo stop on full in the register 0x47 bit 0
- * @brief It stop writing samples into FIFO when FIFO is full
- *
- *
- *
- * @param v_fifo_stop_on_full_u8 :The value of fifo stop on full
- * value | fifo stop on full
- * ------------|-------------------------
- * 0x00 | do not stop writing to FIFO when full
- * 0x01 | Stop writing into FIFO when full.
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_fifo_stop_on_full(
- u8 *v_fifo_stop_on_full_u8);
- /*!
- * @brief This API sey the fifo stop on full in the register 0x47 bit 0
- * @brief It stop writing samples into FIFO when FIFO is full
- *
- *
- *
- * @param v_fifo_stop_on_full_u8 :The value of fifo stop on full
- * value | fifo stop on full
- * ------------|-------------------------
- * 0x00 | do not stop writing to FIFO when full
- * 0x01 | Stop writing into FIFO when full.
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_fifo_stop_on_full(
- u8 v_fifo_stop_on_full_u8);
- /*!
- * @brief This API reads fifo sensor time
- * frame after the last valid data frame form the register 0x47 bit 1
- *
- *
- *
- *
- * @param v_fifo_time_enable_u8 : The value of sensor time
- * value | fifo sensor time
- * ------------|-------------------------
- * 0x00 | do not return sensortime frame
- * 0x01 | return sensortime frame
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_fifo_time_enable(
- u8 *v_fifo_time_enable_u8);
- /*!
- * @brief This API set fifo sensor time
- * frame after the last valid data frame form the register 0x47 bit 1
- *
- *
- *
- *
- * @param v_fifo_time_enable_u8 : The value of sensor time
- * value | fifo sensor time
- * ------------|-------------------------
- * 0x00 | do not return sensortime frame
- * 0x01 | return sensortime frame
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_fifo_time_enable(
- u8 v_fifo_time_enable_u8);
- /*!
- * @brief This API reads FIFO tag interrupt2 enable status
- * from the resister 0x47 bit 2
- *
- * @param v_fifo_tag_intr2_u8 : The value of fifo tag interrupt
- * value | fifo tag interrupt
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_fifo_tag_intr2_enable(
- u8 *v_fifo_tag_intr2_u8);
- /*!
- * @brief This API set FIFO tag interrupt2 enable status
- * from the resister 0x47 bit 2
- *
- * @param v_fifo_tag_intr2_u8 : The value of fifo tag interrupt
- * value | fifo tag interrupt
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_fifo_tag_intr2_enable(
- u8 v_fifo_tag_intr2_u8);
- /*!
- * @brief This API get FIFO tag interrupt1 enable status
- * from the resister 0x47 bit 3
- *
- * @param v_fifo_tag_intr1_u8 :The value of fifo tag interrupt1
- * value | fifo tag interrupt
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_fifo_tag_intr1_enable(
- u8 *v_fifo_tag_intr1_u8);
- /*!
- * @brief This API set FIFO tag interrupt1 enable status
- * from the resister 0x47 bit 3
- *
- * @param v_fifo_tag_intr1_u8 :The value of fifo tag interrupt1
- * value | fifo tag interrupt
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_fifo_tag_intr1_enable(
- u8 v_fifo_tag_intr1_u8);
- /*!
- * @brief This API reads FIFO frame
- * header enable from the register 0x47 bit 4
- *
- * @param v_fifo_header_u8 :The value of fifo header
- * value | fifo header
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_fifo_header_enable(
- u8 *v_fifo_header_u8);
- /*!
- * @brief This API set FIFO frame
- * header enable from the register 0x47 bit 4
- *
- * @param v_fifo_header_u8 :The value of fifo header
- * value | fifo header
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_fifo_header_enable(
- u8 v_fifo_header_u8);
- /*!
- * @brief This API is used to read stored
- * magnetometer data in FIFO (all 3 axes) from the register 0x47 bit 5
- *
- * @param v_fifo_mag_u8 : The value of fifo mag enble
- * value | fifo mag
- * ----------|-------------------
- * 0x00 | no magnetometer data is stored
- * 0x01 | magnetometer data is stored
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_fifo_mag_enable(
- u8 *v_fifo_mag_u8);
- /*!
- * @brief This API is used to set stored
- * magnetometer data in FIFO (all 3 axes) from the register 0x47 bit 5
- *
- * @param v_fifo_mag_u8 : The value of fifo mag enble
- * value | fifo mag
- * ----------|-------------------
- * 0x00 | no magnetometer data is stored
- * 0x01 | magnetometer data is stored
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_fifo_mag_enable(
- u8 v_fifo_mag_u8);
- /*!
- * @brief This API is used to read stored
- * accel data in FIFO (all 3 axes) from the register 0x47 bit 6
- *
- * @param v_fifo_accel_u8 : The value of fifo accel enble
- * value | fifo accel
- * ----------|-------------------
- * 0x00 | no accel data is stored
- * 0x01 | accel data is stored
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_fifo_accel_enable(
- u8 *v_fifo_accel_u8);
- /*!
- * @brief This API is used to set stored
- * accel data in FIFO (all 3 axes) from the register 0x47 bit 6
- *
- * @param v_fifo_accel_u8 : The value of fifo accel enble
- * value | fifo accel
- * ----------|-------------------
- * 0x00 | no accel data is stored
- * 0x01 | accel data is stored
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_fifo_accel_enable(
- u8 v_fifo_accel_u8);
- /*!
- * @brief This API is used to read stored
- * gyro data in FIFO (all 3 axes) from the resister 0x47 bit 7
- *
- *
- * @param v_fifo_gyro_u8 : The value of fifo gyro enble
- * value | fifo gyro
- * ----------|-------------------
- * 0x00 | no gyro data is stored
- * 0x01 | gyro data is stored
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_fifo_gyro_enable(
- u8 *v_fifo_gyro_u8);
- /*!
- * @brief This API is used to set stored
- * gyro data in FIFO (all 3 axes) from the resister 0x47 bit 7
- *
- *
- * @param v_fifo_gyro_u8 : The value of fifo gyro enble
- * value | fifo gyro
- * ----------|-------------------
- * 0x00 | no gyro data is stored
- * 0x01 | gyro data is stored
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_fifo_gyro_enable(
- u8 v_fifo_gyro_u8);
- /***************************************************************/
- /**\name FUNCTION FOR MAG I2C ADDRESS SELECTION */
- /***************************************************************/
- /*!
- * @brief This API is used to read
- * I2C device address of auxiliary mag from the register 0x4B bit 1 to 7
- *
- *
- *
- *
- * @param v_i2c_device_addr_u8 : The value of mag I2C device address
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_i2c_device_addr(
- u8 *v_i2c_device_addr_u8);
- /*!
- * @brief This API is used to set
- * I2C device address of auxiliary mag from the register 0x4B bit 1 to 7
- *
- *
- *
- *
- * @param v_i2c_device_addr_u8 : The value of mag I2C device address
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_i2c_device_addr(
- u8 v_i2c_device_addr_u8);
- /*!
- * @brief This API is used to read
- * Burst data length (1,2,6,8 byte) from the register 0x4C bit 0 to 1
- *
- *
- *
- *
- * @param v_mag_burst_u8 : The data of mag burst read lenth
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_mag_burst(
- u8 *v_mag_burst_u8);
- /*!
- * @brief This API is used to set
- * Burst data length (1,2,6,8 byte) from the register 0x4C bit 0 to 1
- *
- *
- *
- *
- * @param v_mag_burst_u8 : The data of mag burst read lenth
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_mag_burst(
- u8 v_mag_burst_u8);
- /***************************************************************/
- /**\name FUNCTION FOR MAG OFFSET */
- /***************************************************************/
- /*!
- * @brief This API is used to read
- * trigger-readout offset in units of 2.5 ms. If set to zero,
- * the offset is maximum, i.e. after readout a trigger
- * is issued immediately. from the register 0x4C bit 2 to 5
- *
- *
- *
- *
- * @param v_mag_offset_u8 : The value of mag offset
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_mag_offset(
- u8 *v_mag_offset_u8);
- /*!
- * @brief This API is used to set
- * trigger-readout offset in units of 2.5 ms. If set to zero,
- * the offset is maximum, i.e. after readout a trigger
- * is issued immediately. from the register 0x4C bit 2 to 5
- *
- *
- *
- *
- * @param v_mag_offset_u8 : The value of mag offset
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_mag_offset(
- u8 v_mag_offset_u8);
- /***************************************************************/
- /**\name FUNCTION FOR MAG MANUAL/AUTO MODE SELECTION */
- /***************************************************************/
- /*!
- * @brief This API is used to read
- * Enable register access on MAG_IF[2] or MAG_IF[3] writes.
- * This implies that the DATA registers are not updated with
- * magnetometer values. Accessing magnetometer requires
- * the magnetometer in normal mode in PMU_STATUS.
- * from the register 0x4C bit 7
- *
- *
- *
- * @param v_mag_manual_u8 : The value of mag manual enable
- * value | mag manual
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_mag_manual_enable(
- u8 *v_mag_manual_u8);
- /*!
- * @brief This API is used to set
- * Enable register access on MAG_IF[2] or MAG_IF[3] writes.
- * This implies that the DATA registers are not updated with
- * magnetometer values. Accessing magnetometer requires
- * the magnetometer in normal mode in PMU_STATUS.
- * from the register 0x4C bit 7
- *
- *
- *
- * @param v_mag_manual_u8 : The value of mag manual enable
- * value | mag manual
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_mag_manual_enable(
- u8 v_mag_manual_u8);
- /***************************************************************/
- /**\name FUNCTIONS FOR MAG READ, WRITE AND WRITE DATA ADDRESS */
- /***************************************************************/
- /*!
- * @brief This API is used to read data
- * magnetometer address to read from the register 0x4D bit 0 to 7
- * @brief It used to provide mag read address of auxiliary mag
- *
- *
- *
- *
- * @param v_mag_read_addr_u8 : The value of address need to be read
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_mag_read_addr(
- u8 *v_mag_read_addr_u8);
- /*!
- * @brief This API is used to set
- * magnetometer write address from the register 0x4D bit 0 to 7
- * @brief mag write address writes the address of auxiliary mag to write
- *
- *
- *
- * @param v_mag_read_addr_u8:
- * The data of auxiliary mag address to write data
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_mag_read_addr(
- u8 v_mag_read_addr_u8);
- /*!
- * @brief This API is used to read
- * magnetometer write address from the register 0x4E bit 0 to 7
- * @brief mag write address writes the address of auxiliary mag to write
- *
- *
- *
- * @param v_mag_write_addr_u8:
- * The data of auxiliary mag address to write data
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_mag_write_addr(
- u8 *v_mag_write_addr_u8);
- /*!
- * @brief This API is used to set
- * magnetometer write address from the register 0x4E bit 0 to 7
- * @brief mag write address writes the address of auxiliary mag to write
- *
- *
- *
- * @param v_mag_write_addr_u8:
- * The data of auxiliary mag address to write data
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_mag_write_addr(
- u8 v_mag_write_addr_u8);
- /*!
- * @brief This API is used to read magnetometer write data
- * form the resister 0x4F bit 0 to 7
- * @brief This writes the data will be wrote to mag
- *
- *
- *
- * @param v_mag_write_data_u8: The value of mag data
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_mag_write_data(
- u8 *v_mag_write_data_u8);
- /*!
- * @brief This API is used to set magnetometer write data
- * form the resister 0x4F bit 0 to 7
- * @brief This writes the data will be wrote to mag
- *
- *
- *
- * @param v_mag_write_data_u8: The value of mag data
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_mag_write_data(
- u8 v_mag_write_data_u8);
- /***************************************************************/
- /**\name FUNCTION FOR INTERRUPT ENABLE OF
- ANY-MOTION XYZ, DOUBLE AND SINGLE TAP, ORIENT AND FLAT */
- /***************************************************************/
- /*!
- * @brief This API is used to read
- * interrupt enable from the register 0x50 bit 0 to 7
- *
- *
- *
- *
- * @param v_enable_u8 : Value to decided to select interrupt
- * v_enable_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_ANY_MOTION_X_ENABLE
- * 1 | BMI160_ANY_MOTION_Y_ENABLE
- * 2 | BMI160_ANY_MOTION_Z_ENABLE
- * 3 | BMI160_DOUBLE_TAP_ENABLE
- * 4 | BMI160_SINGLE_TAP_ENABLE
- * 5 | BMI160_ORIENT_ENABLE
- * 6 | BMI160_FLAT_ENABLE
- *
- * @param v_intr_enable_zero_u8 : The interrupt enable value
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_enable_0(
- u8 enable, u8 *v_intr_enable_zero_u8);
- /*!
- * @brief This API is used to set
- * interrupt enable from the register 0x50 bit 0 to 7
- *
- *
- *
- *
- * @param v_enable_u8 : Value to decided to select interrupt
- * v_enable_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_ANY_MOTION_X_ENABLE
- * 1 | BMI160_ANY_MOTION_Y_ENABLE
- * 2 | BMI160_ANY_MOTION_Z_ENABLE
- * 3 | BMI160_DOUBLE_TAP_ENABLE
- * 4 | BMI160_SINGLE_TAP_ENABLE
- * 5 | BMI160_ORIENT_ENABLE
- * 6 | BMI160_FLAT_ENABLE
- *
- * @param v_intr_enable_zero_u8 : The interrupt enable value
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_enable_0(
- u8 enable, u8 v_intr_enable_zero_u8);
- /***************************************************************/
- /**\name FUNCTION FOR INTERRUPT ENABLE OF
- HIGH_G XYZ, LOW_G, DATA READY, FIFO FULL AND FIFO WATER MARK */
- /***************************************************************/
- /*!
- * @brief This API is used to read
- * interrupt enable byte1 from the register 0x51 bit 0 to 6
- * @brief It read the high_g_x,high_g_y,high_g_z,low_g_enable
- * data ready, fifo full and fifo water mark.
- *
- *
- *
- * @param v_enable_u8 : The value of interrupt enable
- * @param v_enable_u8 : Value to decided to select interrupt
- * v_enable_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_HIGH_G_X_ENABLE
- * 1 | BMI160_HIGH_G_Y_ENABLE
- * 2 | BMI160_HIGH_G_Z_ENABLE
- * 3 | BMI160_LOW_G_ENABLE
- * 4 | BMI160_DATA_RDY_ENABLE
- * 5 | BMI160_FIFO_FULL_ENABLE
- * 6 | BMI160_FIFO_WM_ENABLE
- *
- * @param v_intr_enable_1_u8 : The interrupt enable value
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_enable_1(
- u8 enable, u8 *v_intr_enable_1_u8);
- /*!
- * @brief This API is used to set
- * interrupt enable byte1 from the register 0x51 bit 0 to 6
- * @brief It read the high_g_x,high_g_y,high_g_z,low_g_enable
- * data ready, fifo full and fifo water mark.
- *
- *
- *
- * @param v_enable_u8 : The value of interrupt enable
- * @param v_enable_u8 : Value to decided to select interrupt
- * v_enable_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_HIGH_G_X_ENABLE
- * 1 | BMI160_HIGH_G_Y_ENABLE
- * 2 | BMI160_HIGH_G_Z_ENABLE
- * 3 | BMI160_LOW_G_ENABLE
- * 4 | BMI160_DATA_RDY_ENABLE
- * 5 | BMI160_FIFO_FULL_ENABLE
- * 6 | BMI160_FIFO_WM_ENABLE
- *
- * @param v_intr_enable_1_u8 : The interrupt enable value
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_enable_1(
- u8 enable, u8 v_intr_enable_1_u8);
- /***************************************************************/
- /**\name FUNCTION FOR INTERRUPT ENABLE OF
- NO MOTION XYZ */
- /***************************************************************/
- /*!
- * @brief This API is used to read
- * interrupt enable byte2 from the register bit 0x52 bit 0 to 3
- * @brief It reads no motion x,y and z
- *
- *
- *
- * @param v_enable_u8: The value of interrupt enable
- * v_enable_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_NOMOTION_X_ENABLE
- * 1 | BMI160_NOMOTION_Y_ENABLE
- * 2 | BMI160_NOMOTION_Z_ENABLE
- *
- * @param v_intr_enable_2_u8 : The interrupt enable value
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_enable_2(
- u8 enable, u8 *v_intr_enable_2_u8);
- /*!
- * @brief This API is used to set
- * interrupt enable byte2 from the register bit 0x52 bit 0 to 3
- * @brief It reads no motion x,y and z
- *
- *
- *
- * @param v_enable_u8: The value of interrupt enable
- * v_enable_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_NOMOTION_X_ENABLE
- * 1 | BMI160_NOMOTION_Y_ENABLE
- * 2 | BMI160_NOMOTION_Z_ENABLE
- *
- * @param v_intr_enable_2_u8 : The interrupt enable value
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_enable_2(
- u8 enable, u8 v_intr_enable_2_u8);
- /***************************************************************/
- /**\name FUNCTION FOR INTERRUPT ENABLE OF
- STEP DETECTOR */
- /***************************************************************/
- /*!
- * @brief This API is used to read
- * interrupt enable step detector interrupt from
- * the register bit 0x52 bit 3
- *
- *
- *
- *
- * @param v_step_intr_u8 : The value of step detector interrupt enable
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_stepdetector_enable(
- u8 *v_step_intr_u8);
- /*!
- * @brief This API is used to set
- * interrupt enable step detector interrupt from
- * the register bit 0x52 bit 3
- *
- *
- *
- *
- * @param v_step_intr_u8 : The value of step detector interrupt enable
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_step_detector_enable(
- u8 v_step_intr_u8);
- /***************************************************************/
- /**\name FUNCTION FOR INTERRUPT CONTROL */
- /***************************************************************/
- /*!
- * @brief Configure trigger condition of interrupt1
- * and interrupt2 pin from the register 0x53
- * @brief interrupt1 - bit 0
- * @brief interrupt2 - bit 4
- *
- * @param v_channel_u8: The value of edge trigger selection
- * v_channel_u8 | Edge trigger
- * ---------------|---------------
- * 0 | BMI160_INTR1_EDGE_CTRL
- * 1 | BMI160_INTR2_EDGE_CTRL
- *
- * @param v_intr_edge_ctrl_u8 : The value of edge trigger enable
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_EDGE
- * 0x00 | BMI160_LEVEL
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_edge_ctrl(
- u8 v_channel_u8, u8 *v_intr_edge_ctrl_u8);
- /*!
- * @brief Configure trigger condition of interrupt1
- * and interrupt2 pin from the register 0x53
- * @brief interrupt1 - bit 0
- * @brief interrupt2 - bit 4
- *
- * @param v_channel_u8: The value of edge trigger selection
- * v_channel_u8 | Edge trigger
- * ---------------|---------------
- * 0 | BMI160_INTR1_EDGE_CTRL
- * 1 | BMI160_INTR2_EDGE_CTRL
- *
- * @param v_intr_edge_ctrl_u8 : The value of edge trigger enable
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_EDGE
- * 0x00 | BMI160_LEVEL
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_edge_ctrl(
- u8 v_channel_u8, u8 v_intr_edge_ctrl_u8);
- /*!
- * @brief API used for get the Configure level condition of interrupt1
- * and interrupt2 pin form the register 0x53
- * @brief interrupt1 - bit 1
- * @brief interrupt2 - bit 5
- *
- * @param v_channel_u8: The value of level condition selection
- * v_channel_u8 | level selection
- * ---------------|---------------
- * 0 | BMI160_INTR1_LEVEL
- * 1 | BMI160_INTR2_LEVEL
- *
- * @param v_intr_level_u8 : The value of level of interrupt enable
- * value | Behaviour
- * ----------|-------------------
- * 0x01 | BMI160_LEVEL_HIGH
- * 0x00 | BMI160_LEVEL_LOW
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_level(
- u8 v_channel_u8, u8 *v_intr_level_u8);
- /*!
- * @brief API used for set the Configure level condition of interrupt1
- * and interrupt2 pin form the register 0x53
- * @brief interrupt1 - bit 1
- * @brief interrupt2 - bit 5
- *
- * @param v_channel_u8: The value of level condition selection
- * v_channel_u8 | level selection
- * ---------------|---------------
- * 0 | BMI160_INTR1_LEVEL
- * 1 | BMI160_INTR2_LEVEL
- *
- * @param v_intr_level_u8 : The value of level of interrupt enable
- * value | Behaviour
- * ----------|-------------------
- * 0x01 | BMI160_LEVEL_HIGH
- * 0x00 | BMI160_LEVEL_LOW
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_level(
- u8 v_channel_u8, u8 v_intr_level_u8);
- /*!
- * @brief API used to get configured output enable of interrupt1
- * and interrupt2 from the register 0x53
- * @brief interrupt1 - bit 2
- * @brief interrupt2 - bit 6
- *
- *
- * @param v_channel_u8: The value of output type enable selection
- * v_channel_u8 | level selection
- * ---------------|---------------
- * 0 | BMI160_INTR1_OUTPUT_TYPE
- * 1 | BMI160_INTR2_OUTPUT_TYPE
- *
- * @param v_intr_output_type_u8 :
- * The value of output type of interrupt enable
- * value | Behaviour
- * ----------|-------------------
- * 0x01 | BMI160_OPEN_DRAIN
- * 0x00 | BMI160_PUSH_PULL
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_output_type(
- u8 v_channel_u8, u8 *v_intr_output_type_u8);
- /*!
- * @brief API used to set output enable of interrupt1
- * and interrupt2 from the register 0x53
- * @brief interrupt1 - bit 2
- * @brief interrupt2 - bit 6
- *
- *
- * @param v_channel_u8: The value of output type enable selection
- * v_channel_u8 | level selection
- * ---------------|---------------
- * 0 | BMI160_INTR1_OUTPUT_TYPE
- * 1 | BMI160_INTR2_OUTPUT_TYPE
- *
- * @param v_intr_output_type_u8 :
- * The value of output type of interrupt enable
- * value | Behaviour
- * ----------|-------------------
- * 0x01 | BMI160_OPEN_DRAIN
- * 0x00 | BMI160_PUSH_PULL
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_output_type(
- u8 v_channel_u8, u8 v_intr_output_type_u8);
- /*!
- * @brief API used to get the Output enable for interrupt1
- * and interrupt1 pin from the register 0x53
- * @brief interrupt1 - bit 3
- * @brief interrupt2 - bit 7
- *
- * @param v_channel_u8: The value of output enable selection
- * v_channel_u8 | level selection
- * ---------------|---------------
- * 0 | BMI160_INTR1_OUTPUT_TYPE
- * 1 | BMI160_INTR2_OUTPUT_TYPE
- *
- * @param v_output_enable_u8 :
- * The value of output enable of interrupt enable
- * value | Behaviour
- * ----------|-------------------
- * 0x01 | BMI160_INPUT
- * 0x00 | BMI160_OUTPUT
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_output_enable(
- u8 v_channel_u8, u8 *v_output_enable_u8);
- /*!
- * @brief API used to set the Output enable for interrupt1
- * and interrupt1 pin from the register 0x53
- * @brief interrupt1 - bit 3
- * @brief interrupt2 - bit 7
- *
- * @param v_channel_u8: The value of output enable selection
- * v_channel_u8 | level selection
- * ---------------|---------------
- * 0 | BMI160_INTR1_OUTPUT_TYPE
- * 1 | BMI160_INTR2_OUTPUT_TYPE
- *
- * @param v_output_enable_u8 :
- * The value of output enable of interrupt enable
- * value | Behaviour
- * ----------|-------------------
- * 0x01 | BMI160_INPUT
- * 0x00 | BMI160_OUTPUT
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_output_enable(
- u8 v_channel_u8, u8 v_output_enable_u8);
- /***************************************************************/
- /**\name FUNCTION FOR INTERRUPT LATCH INTERRUPT */
- /***************************************************************/
- /*!
- * @brief This API is used to get the latch duration
- * from the register 0x54 bit 0 to 3
- * @brief This latch selection is not applicable for data ready,
- * orientation and flat interrupts.
- *
- *
- *
- * @param v_latch_intr_u8 : The value of latch duration
- * Latch Duration | value
- * --------------------------------------|------------------
- * BMI160_LATCH_DUR_NONE | 0x00
- * BMI160_LATCH_DUR_312_5_MICRO_SEC | 0x01
- * BMI160_LATCH_DUR_625_MICRO_SEC | 0x02
- * BMI160_LATCH_DUR_1_25_MILLI_SEC | 0x03
- * BMI160_LATCH_DUR_2_5_MILLI_SEC | 0x04
- * BMI160_LATCH_DUR_5_MILLI_SEC | 0x05
- * BMI160_LATCH_DUR_10_MILLI_SEC | 0x06
- * BMI160_LATCH_DUR_20_MILLI_SEC | 0x07
- * BMI160_LATCH_DUR_40_MILLI_SEC | 0x08
- * BMI160_LATCH_DUR_80_MILLI_SEC | 0x09
- * BMI160_LATCH_DUR_160_MILLI_SEC | 0x0A
- * BMI160_LATCH_DUR_320_MILLI_SEC | 0x0B
- * BMI160_LATCH_DUR_640_MILLI_SEC | 0x0C
- * BMI160_LATCH_DUR_1_28_SEC | 0x0D
- * BMI160_LATCH_DUR_2_56_SEC | 0x0E
- * BMI160_LATCHED | 0x0F
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_latch_intr(
- u8 *v_latch_intr_u8);
- /*!
- * @brief This API is used to set the latch duration
- * from the register 0x54 bit 0 to 3
- * @brief This latch selection is not applicable for data ready,
- * orientation and flat interrupts.
- *
- *
- *
- * @param v_latch_intr_u8 : The value of latch duration
- * Latch Duration | value
- * --------------------------------------|------------------
- * BMI160_LATCH_DUR_NONE | 0x00
- * BMI160_LATCH_DUR_312_5_MICRO_SEC | 0x01
- * BMI160_LATCH_DUR_625_MICRO_SEC | 0x02
- * BMI160_LATCH_DUR_1_25_MILLI_SEC | 0x03
- * BMI160_LATCH_DUR_2_5_MILLI_SEC | 0x04
- * BMI160_LATCH_DUR_5_MILLI_SEC | 0x05
- * BMI160_LATCH_DUR_10_MILLI_SEC | 0x06
- * BMI160_LATCH_DUR_20_MILLI_SEC | 0x07
- * BMI160_LATCH_DUR_40_MILLI_SEC | 0x08
- * BMI160_LATCH_DUR_80_MILLI_SEC | 0x09
- * BMI160_LATCH_DUR_160_MILLI_SEC | 0x0A
- * BMI160_LATCH_DUR_320_MILLI_SEC | 0x0B
- * BMI160_LATCH_DUR_640_MILLI_SEC | 0x0C
- * BMI160_LATCH_DUR_1_28_SEC | 0x0D
- * BMI160_LATCH_DUR_2_56_SEC | 0x0E
- * BMI160_LATCHED | 0x0F
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_latch_intr(
- u8 v_latch_intr_u8);
- /*!
- * @brief API used to get input enable for interrupt1
- * and interrupt2 pin from the register 0x54
- * @brief interrupt1 - bit 4
- * @brief interrupt2 - bit 5
- *
- * @param v_channel_u8: The value of input enable selection
- * v_channel_u8 | input selection
- * ---------------|---------------
- * 0 | BMI160_INTR1_INPUT_ENABLE
- * 1 | BMI160_INTR2_INPUT_ENABLE
- *
- * @param v_input_en_u8 :
- * The value of input enable of interrupt enable
- * value | Behaviour
- * ----------|-------------------
- * 0x01 | BMI160_INPUT
- * 0x00 | BMI160_OUTPUT
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_input_enable(
- u8 v_channel_u8, u8 *v_input_en_u8);
- /*!
- * @brief API used to set input enable for interrupt1
- * and interrupt2 pin from the register 0x54
- * @brief interrupt1 - bit 4
- * @brief interrupt2 - bit 5
- *
- * @param v_channel_u8: The value of input enable selection
- * v_channel_u8 | input selection
- * ---------------|---------------
- * 0 | BMI160_INTR1_INPUT_ENABLE
- * 1 | BMI160_INTR2_INPUT_ENABLE
- *
- * @param v_input_en_u8 :
- * The value of input enable of interrupt enable
- * value | Behaviour
- * ----------|-------------------
- * 0x01 | BMI160_INPUT
- * 0x00 | BMI160_OUTPUT
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_input_enable(
- u8 v_channel_u8, u8 v_input_en_u8);
- /***************************************************************/
- /**\name FUNCTION FOR INTERRUPT1 AND INTERRUPT2 MAPPING */
- /***************************************************************/
- /*!
- * @brief reads the Low g interrupt mapped to interrupt1
- * and interrupt2 from the register 0x55 and 0x57
- * @brief interrupt1 bit 0 in the register 0x55
- * @brief interrupt2 bit 0 in the register 0x57
- *
- *
- * @param v_channel_u8: The value of low_g selection
- * v_channel_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_INTR1_MAP_LOW_G
- * 1 | BMI160_INTR2_MAP_LOW_G
- *
- * @param v_intr_low_g_u8 : The value of low_g enable
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_low_g(
- u8 v_channel_u8, u8 *v_intr_low_g_u8);
- /*!
- * @brief set the Low g interrupt mapped to interrupt1
- * and interrupt2 from the register 0x55 and 0x57
- * @brief interrupt1 bit 0 in the register 0x55
- * @brief interrupt2 bit 0 in the register 0x57
- *
- *
- * @param v_channel_u8: The value of low_g selection
- * v_channel_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_INTR1_MAP_LOW_G
- * 1 | BMI160_INTR2_MAP_LOW_G
- *
- * @param v_intr_low_g_u8 : The value of low_g enable
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_low_g(
- u8 v_channel_u8, u8 v_intr_low_g_u8);
- /*!
- * @brief Reads the HIGH g interrupt mapped to interrupt1
- * and interrupt2 from the register 0x55 and 0x57
- * @brief interrupt1 bit 1 in the register 0x55
- * @brief interrupt2 bit 1 in the register 0x57
- *
- *
- * @param v_channel_u8: The value of high_g selection
- * v_channel_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_INTR1_MAP_HIGH_G
- * 1 | BMI160_INTR2_MAP_HIGH_G
- *
- * @param v_intr_high_g_u8 : The value of high_g enable
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_high_g(
- u8 v_channel_u8, u8 *v_intr_high_g_u8);
- /*!
- * @brief Write the HIGH g interrupt mapped to interrupt1
- * and interrupt2 from the register 0x55 and 0x57
- * @brief interrupt1 bit 1 in the register 0x55
- * @brief interrupt2 bit 1 in the register 0x57
- *
- *
- * @param v_channel_u8: The value of high_g selection
- * v_channel_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_INTR1_MAP_HIGH_G
- * 1 | BMI160_INTR2_MAP_HIGH_G
- *
- * @param v_intr_high_g_u8 : The value of high_g enable
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_high_g(
- u8 v_channel_u8, u8 v_intr_high_g_u8);
- /*!
- * @brief Reads the Any motion interrupt
- * interrupt mapped to interrupt1
- * and interrupt2 from the register 0x55 and 0x57
- * @brief interrupt1 bit 2 in the register 0x55
- * @brief interrupt2 bit 2 in the register 0x57
- *
- *
- * @param v_channel_u8: The value of any motion selection
- * v_channel_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_INTR1_MAP_ANY_MOTION
- * 1 | BMI160_INTR2_MAP_ANY_MOTION
- *
- * @param v_intr_any_motion_u8 : The value of any motion enable
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_any_motion(
- u8 v_channel_u8, u8 *v_intr_any_motion_u8);
- /*!
- * @brief Write the Any motion interrupt
- * interrupt mapped to interrupt1
- * and interrupt2 from the register 0x55 and 0x57
- * @brief interrupt1 bit 2 in the register 0x55
- * @brief interrupt2 bit 2 in the register 0x57
- *
- *
- * @param v_channel_u8: The value of any motion selection
- * v_channel_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_INTR1_MAP_ANY_MOTION
- * 1 | BMI160_INTR2_MAP_ANY_MOTION
- *
- * @param v_intr_any_motion_u8 : The value of any motion enable
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_any_motion(
- u8 v_channel_u8, u8 v_intr_any_motion_u8);
- /*!
- * @brief Reads the No motion interrupt
- * interrupt mapped to interrupt1
- * and interrupt2 from the register 0x55 and 0x57
- * @brief interrupt1 bit 3 in the register 0x55
- * @brief interrupt2 bit 3 in the register 0x57
- *
- *
- * @param v_channel_u8: The value of no motion selection
- * v_channel_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_INTR1_MAP_NOMO
- * 1 | BMI160_INTR2_MAP_NOMO
- *
- * @param v_intr_nomotion_u8 : The value of no motion enable
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_nomotion(
- u8 v_channel_u8, u8 *v_intr_nomotion_u8);
- /*!
- * @brief Write the No motion interrupt
- * interrupt mapped to interrupt1
- * and interrupt2 from the register 0x55 and 0x57
- * @brief interrupt1 bit 3 in the register 0x55
- * @brief interrupt2 bit 3 in the register 0x57
- *
- *
- * @param v_channel_u8: The value of no motion selection
- * v_channel_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_INTR1_MAP_NOMO
- * 1 | BMI160_INTR2_MAP_NOMO
- *
- * @param v_intr_nomotion_u8 : The value of no motion enable
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_nomotion(
- u8 v_channel_u8, u8 v_intr_nomotion_u8);
- /*!
- * @brief Reads the Double Tap interrupt
- * interrupt mapped to interrupt1
- * and interrupt2 from the register 0x55 and 0x57
- * @brief interrupt1 bit 4 in the register 0x55
- * @brief interrupt2 bit 4 in the register 0x57
- *
- *
- * @param v_channel_u8: The value of double tap interrupt selection
- * v_channel_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_INTR1_MAP_DOUBLE_TAP
- * 1 | BMI160_INTR2_MAP_DOUBLE_TAP
- *
- * @param v_intr_double_tap_u8 : The value of double tap enable
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_double_tap(
- u8 v_channel_u8, u8 *v_intr_double_tap_u8);
- /*!
- * @brief Write the Double Tap interrupt
- * interrupt mapped to interrupt1
- * and interrupt2 from the register 0x55 and 0x57
- * @brief interrupt1 bit 4 in the register 0x55
- * @brief interrupt2 bit 4 in the register 0x57
- *
- *
- * @param v_channel_u8: The value of double tap interrupt selection
- * v_channel_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_INTR1_MAP_DOUBLE_TAP
- * 1 | BMI160_INTR2_MAP_DOUBLE_TAP
- *
- * @param v_intr_double_tap_u8 : The value of double tap enable
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_double_tap(
- u8 v_channel_u8, u8 v_intr_double_tap_u8);
- /*!
- * @brief Reads the Single Tap interrupt
- * interrupt mapped to interrupt1
- * and interrupt2 from the register 0x55 and 0x57
- * @brief interrupt1 bit 5 in the register 0x55
- * @brief interrupt2 bit 5 in the register 0x57
- *
- *
- * @param v_channel_u8: The value of single tap interrupt selection
- * v_channel_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_INTR1_MAP_SINGLE_TAP
- * 1 | BMI160_INTR2_MAP_SINGLE_TAP
- *
- * @param v_intr_single_tap_u8 : The value of single tap enable
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_single_tap(
- u8 v_channel_u8, u8 *v_intr_single_tap_u8);
- /*!
- * @brief Write the Single Tap interrupt
- * interrupt mapped to interrupt1
- * and interrupt2 from the register 0x55 and 0x57
- * @brief interrupt1 bit 5 in the register 0x55
- * @brief interrupt2 bit 5 in the register 0x57
- *
- *
- * @param v_channel_u8: The value of single tap interrupt selection
- * v_channel_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_INTR1_MAP_SINGLE_TAP
- * 1 | BMI160_INTR2_MAP_SINGLE_TAP
- *
- * @param v_intr_single_tap_u8 : The value of single tap enable
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_single_tap(
- u8 v_channel_u8, u8 v_intr_single_tap_u8);
- /*!
- * @brief Reads the Orient interrupt
- * interrupt mapped to interrupt1
- * and interrupt2 from the register 0x55 and 0x57
- * @brief interrupt1 bit 6 in the register 0x55
- * @brief interrupt2 bit 6 in the register 0x57
- *
- *
- * @param v_channel_u8: The value of orient interrupt selection
- * v_channel_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_INTR1_MAP_ORIENT
- * 1 | BMI160_INTR2_MAP_ORIENT
- *
- * @param v_intr_orient_u8 : The value of orient enable
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_orient(
- u8 v_channel_u8, u8 *v_intr_orient_u8);
- /*!
- * @brief Write the Orient interrupt
- * interrupt mapped to interrupt1
- * and interrupt2 from the register 0x55 and 0x57
- * @brief interrupt1 bit 6 in the register 0x55
- * @brief interrupt2 bit 6 in the register 0x57
- *
- *
- * @param v_channel_u8: The value of orient interrupt selection
- * v_channel_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_INTR1_MAP_ORIENT
- * 1 | BMI160_INTR2_MAP_ORIENT
- *
- * @param v_intr_orient_u8 : The value of orient enable
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_orient(
- u8 v_channel_u8, u8 v_intr_orient_u8);
- /*!
- * @brief Reads the Flat interrupt
- * mapped to interrupt1
- * and interrupt2 from the register 0x55 and 0x57
- * @brief interrupt1 bit 7 in the register 0x55
- * @brief interrupt2 bit 7 in the register 0x57
- *
- *
- * @param v_channel_u8: The value of flat interrupt selection
- * v_channel_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_INTR1_MAP_FLAT
- * 1 | BMI160_INTR2_MAP_FLAT
- *
- * @param v_intr_flat_u8 : The value of flat enable
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_flat(
- u8 v_channel_u8, u8 *v_intr_flat_u8);
- /*!
- * @brief Write the Flat interrupt
- * mapped to interrupt1
- * and interrupt2 from the register 0x55 and 0x57
- * @brief interrupt1 bit 7 in the register 0x55
- * @brief interrupt2 bit 7 in the register 0x57
- *
- *
- * @param v_channel_u8: The value of flat interrupt selection
- * v_channel_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_INTR1_MAP_FLAT
- * 1 | BMI160_INTR2_MAP_FLAT
- *
- * @param v_intr_flat_u8 : The value of flat enable
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_flat(
- u8 v_channel_u8, u8 v_intr_flat_u8);
- /*!
- * @brief Reads PMU trigger interrupt mapped to interrupt1
- * and interrupt2 form the register 0x56 bit 0 and 4
- * @brief interrupt1 bit 0 in the register 0x56
- * @brief interrupt2 bit 4 in the register 0x56
- *
- *
- * @param v_channel_u8: The value of pmu trigger selection
- * v_channel_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_INTR1_MAP_PMUTRIG
- * 1 | BMI160_INTR2_MAP_PMUTRIG
- *
- * @param v_intr_pmu_trig_u8 : The value of pmu trigger enable
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_pmu_trig(
- u8 v_channel_u8, u8 *v_intr_pmu_trig_u8);
- /*!
- * @brief Write PMU trigger interrupt mapped to interrupt1
- * and interrupt2 form the register 0x56 bit 0 and 4
- * @brief interrupt1 bit 0 in the register 0x56
- * @brief interrupt2 bit 4 in the register 0x56
- *
- *
- * @param v_channel_u8: The value of pmu trigger selection
- * v_channel_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_INTR1_MAP_PMUTRIG
- * 1 | BMI160_INTR2_MAP_PMUTRIG
- *
- * @param v_intr_pmu_trig_u8 : The value of pmu trigger enable
- * value | trigger enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_pmu_trig(
- u8 v_channel_u8, u8 v_intr_pmu_trig_u8);
- /*!
- * @brief Reads FIFO Full interrupt mapped to interrupt1
- * and interrupt2 form the register 0x56 bit 5 and 1
- * @brief interrupt1 bit 5 in the register 0x56
- * @brief interrupt2 bit 1 in the register 0x56
- *
- *
- * @param v_channel_u8: The value of fifo full interrupt selection
- * v_channel_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_INTR1_MAP_FIFO_FULL
- * 1 | BMI160_INTR2_MAP_FIFO_FULL
- *
- * @param v_intr_fifo_full_u8 : The value of fifo full interrupt enable
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_fifo_full(
- u8 v_channel_u8, u8 *v_intr_fifo_full_u8);
- /*!
- * @brief Write FIFO Full interrupt mapped to interrupt1
- * and interrupt2 form the register 0x56 bit 5 and 1
- * @brief interrupt1 bit 5 in the register 0x56
- * @brief interrupt2 bit 1 in the register 0x56
- *
- *
- * @param v_channel_u8: The value of fifo full interrupt selection
- * v_channel_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_INTR1_MAP_FIFO_FULL
- * 1 | BMI160_INTR2_MAP_FIFO_FULL
- *
- * @param v_intr_fifo_full_u8 : The value of fifo full interrupt enable
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_fifo_full(
- u8 v_channel_u8, u8 v_intr_fifo_full_u8);
- /*!
- * @brief Reads FIFO Watermark interrupt mapped to interrupt1
- * and interrupt2 form the register 0x56 bit 6 and 2
- * @brief interrupt1 bit 6 in the register 0x56
- * @brief interrupt2 bit 2 in the register 0x56
- *
- *
- * @param v_channel_u8: The value of fifo Watermark interrupt selection
- * v_channel_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_INTR1_MAP_FIFO_WM
- * 1 | BMI160_INTR2_MAP_FIFO_WM
- *
- * @param v_intr_fifo_wm_u8 : The value of fifo Watermark interrupt enable
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_fifo_wm(
- u8 v_channel_u8, u8 *v_intr_fifo_wm_u8);
- /*!
- * @brief Write FIFO Watermark interrupt mapped to interrupt1
- * and interrupt2 form the register 0x56 bit 6 and 2
- * @brief interrupt1 bit 6 in the register 0x56
- * @brief interrupt2 bit 2 in the register 0x56
- *
- *
- * @param v_channel_u8: The value of fifo Watermark interrupt selection
- * v_channel_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_INTR1_MAP_FIFO_WM
- * 1 | BMI160_INTR2_MAP_FIFO_WM
- *
- * @param v_intr_fifo_wm_u8 : The value of fifo Watermark interrupt enable
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_fifo_wm(
- u8 v_channel_u8, u8 v_intr_fifo_wm_u8);
- /*!
- * @brief Reads Data Ready interrupt mapped to interrupt1
- * and interrupt2 form the register 0x56
- * @brief interrupt1 bit 7 in the register 0x56
- * @brief interrupt2 bit 3 in the register 0x56
- *
- *
- * @param v_channel_u8: The value of data ready interrupt selection
- * v_channel_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_INTR1_MAP_DATA_RDY
- * 1 | BMI160_INTR2_MAP_DATA_RDY
- *
- * @param v_intr_data_rdy_u8 : The value of data ready interrupt enable
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_data_rdy(
- u8 v_channel_u8, u8 *v_intr_data_rdy_u8);
- /*!
- * @brief Write Data Ready interrupt mapped to interrupt1
- * and interrupt2 form the register 0x56
- * @brief interrupt1 bit 7 in the register 0x56
- * @brief interrupt2 bit 3 in the register 0x56
- *
- *
- * @param v_channel_u8: The value of data ready interrupt selection
- * v_channel_u8 | interrupt
- * ---------------|---------------
- * 0 | BMI160_INTR1_MAP_DATA_RDY
- * 1 | BMI160_INTR2_MAP_DATA_RDY
- *
- * @param v_intr_data_rdy_u8 : The value of data ready interrupt enable
- * value | interrupt enable
- * ----------|-------------------
- * 0x01 | BMI160_ENABLE
- * 0x00 | BMI160_DISABLE
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_data_rdy(
- u8 v_channel_u8, u8 v_intr_data_rdy_u8);
- /***************************************************************/
- /**\name FUNCTION FOR TAP SOURCE CONFIGURATION */
- /***************************************************************/
- /*!
- * @brief This API reads data source for the interrupt
- * engine for the single and double tap interrupts from the register
- * 0x58 bit 3
- *
- *
- * @param v_tap_source_u8 : The value of the tap source
- * value | Description
- * ----------|-------------------
- * 0x01 | UNFILTER_DATA
- * 0x00 | FILTER_DATA
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_tap_source(
- u8 *v_tap_source_u8);
- /*!
- * @brief This API write data source for the interrupt
- * engine for the single and double tap interrupts from the register
- * 0x58 bit 3
- *
- *
- * @param v_tap_source_u8 : The value of the tap source
- * value | Description
- * ----------|-------------------
- * 0x01 | UNFILTER_DATA
- * 0x00 | FILTER_DATA
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_tap_source(
- u8 v_tap_source_u8);
- /***************************************************************/
- /**\name FUNCTION FOR LOW_G AND HIGH_G SOURCE CONFIGURATION */
- /***************************************************************/
- /*!
- * @brief This API Reads Data source for the
- * interrupt engine for the low and high g interrupts
- * from the register 0x58 bit 7
- *
- * @param v_low_high_source_u8 : The value of the tap source
- * value | Description
- * ----------|-------------------
- * 0x01 | UNFILTER_DATA
- * 0x00 | FILTER_DATA
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_low_high_source(
- u8 *v_low_high_source_u8);
- /*!
- * @brief This API write Data source for the
- * interrupt engine for the low and high g interrupts
- * from the register 0x58 bit 7
- *
- * @param v_low_high_source_u8 : The value of the tap source
- * value | Description
- * ----------|-------------------
- * 0x01 | UNFILTER_DATA
- * 0x00 | FILTER_DATA
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_low_high_source(
- u8 v_low_high_source_u8);
- /***************************************************************/
- /**\name FUNCTION FOR MOTION SOURCE CONFIGURATION */
- /***************************************************************/
- /*!
- * @brief This API reads Data source for the
- * interrupt engine for the nomotion and anymotion interrupts
- * from the register 0x59 bit 7
- *
- * @param v_motion_source_u8 :
- * The value of the any/no motion interrupt source
- * value | Description
- * ----------|-------------------
- * 0x01 | UNFILTER_DATA
- * 0x00 | FILTER_DATA
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_motion_source(
- u8 *v_motion_source_u8);
- /*!
- * @brief This API write Data source for the
- * interrupt engine for the nomotion and anymotion interrupts
- * from the register 0x59 bit 7
- *
- * @param v_motion_source_u8 :
- * The value of the any/no motion interrupt source
- * value | Description
- * ----------|-------------------
- * 0x01 | UNFILTER_DATA
- * 0x00 | FILTER_DATA
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_motion_source(
- u8 v_motion_source_u8);
- /***************************************************************/
- /**\name FUNCTION FOR LOW_G DURATION CONFIGURATION */
- /***************************************************************/
- /*!
- * @brief This API is used to read the low_g duration from register
- * 0x5A bit 0 to 7
- *
- *
- *
- *
- * @param v_low_g_durn_u8 : The value of low_g duration
- *
- * @note Low_g duration trigger trigger delay according to
- * "(v_low_g_durn_u8 * 2.5)ms" in a range from 2.5ms to 640ms.
- * the default corresponds delay is 20ms
- * @note When low_g data source of interrupt is unfiltered
- * the sensor must not be in low power mode
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_low_g_durn(
- u8 *v_low_durn_u8);
- /*!
- * @brief This API is used to write the low_g duration from register
- * 0x5A bit 0 to 7
- *
- *
- *
- *
- * @param v_low_g_durn_u8 : The value of low_g duration
- *
- * @note Low_g duration trigger trigger delay according to
- * "(v_low_g_durn_u8 * 2.5)ms" in a range from 2.5ms to 640ms.
- * the default corresponds delay is 20ms
- * @note When low_g data source of interrupt is unfiltered
- * the sensor must not be in low power mode
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_low_g_durn(
- u8 v_low_durn_u8);
- /***************************************************************/
- /**\name FUNCTION FOR LOW_G THRESH CONFIGURATION */
- /***************************************************************/
- /*!
- * @brief This API is used to read Threshold
- * definition for the low-g interrupt from the register 0x5B bit 0 to 7
- *
- *
- *
- *
- * @param v_low_g_thres_u8 : The value of low_g threshold
- *
- * @note Low_g interrupt trigger threshold according to
- * (v_low_g_thres_u8 * 7.81)mg for v_low_g_thres_u8 > 0
- * 3.91 mg for v_low_g_thres_u8 = 0
- * The threshold range is form 3.91mg to 2.000mg
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_low_g_thres(
- u8 *v_low_g_thres_u8);
- /*!
- * @brief This API is used to write Threshold
- * definition for the low-g interrupt from the register 0x5B bit 0 to 7
- *
- *
- *
- *
- * @param v_low_g_thres_u8 : The value of low_g threshold
- *
- * @note Low_g interrupt trigger threshold according to
- * (v_low_g_thres_u8 * 7.81)mg for v_low_g_thres_u8 > 0
- * 3.91 mg for v_low_g_thres_u8 = 0
- * The threshold range is form 3.91mg to 2.000mg
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_low_g_thres(
- u8 v_low_g_thres_u8);
- /***************************************************************/
- /**\name FUNCTION FOR LOW_G HYSTERESIS CONFIGURATION */
- /***************************************************************/
- /*!
- * @brief This API Reads Low-g interrupt hysteresis
- * from the register 0x5C bit 0 to 1
- *
- * @param v_low_hyst_u8 :The value of low_g hysteresis
- *
- * @note Low_g hysteresis calculated by v_low_hyst_u8*125 mg
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_low_g_hyst(
- u8 *v_low_hyst_u8);
- /*!
- * @brief This API write Low-g interrupt hysteresis
- * from the register 0x5C bit 0 to 1
- *
- * @param v_low_hyst_u8 :The value of low_g hysteresis
- *
- * @note Low_g hysteresis calculated by v_low_hyst_u8*125 mg
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_low_g_hyst(
- u8 v_low_hyst_u8);
- /***************************************************************/
- /**\name FUNCTION FOR LOW_G MODE CONFIGURATION */
- /***************************************************************/
- /*!
- * @brief This API reads Low-g interrupt mode
- * from the register 0x5C bit 2
- *
- * @param v_low_g_mode_u8 : The value of low_g mode
- * Value | Description
- * ----------|-----------------
- * 0 | single-axis
- * 1 | axis-summing
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_low_g_mode(
- u8 *v_low_g_mode_u8);
- /*!
- * @brief This API write Low-g interrupt mode
- * from the register 0x5C bit 2
- *
- * @param v_low_g_mode_u8 : The value of low_g mode
- * Value | Description
- * ----------|-----------------
- * 0 | single-axis
- * 1 | axis-summing
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_low_g_mode(
- u8 v_low_g_mode_u8);
- /***************************************************************/
- /**\name FUNCTION FOR HIGH_G HYST CONFIGURATION */
- /***************************************************************/
- /*!
- * @brief This API reads High-g interrupt hysteresis
- * from the register 0x5C bit 6 and 7
- *
- * @param v_high_g_hyst_u8 : The value of high hysteresis
- *
- * @note High_g hysteresis changes according to accel g range
- * accel g range can be set by the function ""
- * accel_range | high_g hysteresis
- * ----------------|---------------------
- * 2g | high_hy*125 mg
- * 4g | high_hy*250 mg
- * 8g | high_hy*500 mg
- * 16g | high_hy*1000 mg
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_high_g_hyst(
- u8 *v_high_g_hyst_u8);
- /*!
- * @brief This API write High-g interrupt hysteresis
- * from the register 0x5C bit 6 and 7
- *
- * @param v_high_g_hyst_u8 : The value of high hysteresis
- *
- * @note High_g hysteresis changes according to accel g range
- * accel g range can be set by the function ""
- * accel_range | high_g hysteresis
- * ----------------|---------------------
- * 2g | high_hy*125 mg
- * 4g | high_hy*250 mg
- * 8g | high_hy*500 mg
- * 16g | high_hy*1000 mg
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_high_g_hyst(
- u8 v_high_g_hyst_u8);
- /***************************************************************/
- /**\name FUNCTION FOR HIGH_G DURATION CONFIGURATION */
- /***************************************************************/
- /*!
- * @brief This API is used to read Delay
- * time definition for the high-g interrupt from the register
- * 0x5D bit 0 to 7
- *
- *
- *
- * @param v_high_g_durn_u8 : The value of high duration
- *
- * @note High_g interrupt delay triggered according to
- * v_high_g_durn_u8 * 2.5ms in a range from 2.5ms to 640ms
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_high_g_durn(
- u8 *v_high_g_durn_u8);
- /*!
- * @brief This API is used to write Delay
- * time definition for the high-g interrupt from the register
- * 0x5D bit 0 to 7
- *
- *
- *
- * @param v_high_g_durn_u8 : The value of high duration
- *
- * @note High_g interrupt delay triggered according to
- * v_high_g_durn_u8 * 2.5ms in a range from 2.5ms to 640ms
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_high_g_durn(
- u8 v_high_g_durn_u8);
- /***************************************************************/
- /**\name FUNCTION FOR HIGH_G THRESHOLD CONFIGURATION */
- /***************************************************************/
- /*!
- * @brief This API is used to read Threshold
- * definition for the high-g interrupt from the register 0x5E 0 to 7
- *
- *
- *
- *
- * @param v_high_g_thres_u8 : Pointer holding the value of Threshold
- * @note High_g threshold changes according to accel g range
- * accel g range can be set by the function ""
- * accel_range | high_g threshold
- * ----------------|---------------------
- * 2g | v_high_g_thres_u8*7.81 mg
- * 4g | v_high_g_thres_u8*15.63 mg
- * 8g | v_high_g_thres_u8*31.25 mg
- * 16g | v_high_g_thres_u8*62.5 mg
- * @note when v_high_g_thres_u8 = 0
- * accel_range | high_g threshold
- * ----------------|---------------------
- * 2g | 3.91 mg
- * 4g | 7.81 mg
- * 8g | 15.63 mg
- * 16g | 31.25 mg
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_high_g_thres(
- u8 *v_high_g_thres_u8);
- /*!
- * @brief This API is used to write Threshold
- * definition for the high-g interrupt from the register 0x5E 0 to 7
- *
- *
- *
- *
- * @param v_high_g_thres_u8 : Pointer holding the value of Threshold
- * @note High_g threshold changes according to accel g range
- * accel g range can be set by the function ""
- * accel_range | high_g threshold
- * ----------------|---------------------
- * 2g | v_high_g_thres_u8*7.81 mg
- * 4g | v_high_g_thres_u8*15.63 mg
- * 8g | v_high_g_thres_u8*31.25 mg
- * 16g | v_high_g_thres_u8*62.5 mg
- * @note when v_high_g_thres_u8 = 0
- * accel_range | high_g threshold
- * ----------------|---------------------
- * 2g | 3.91 mg
- * 4g | 7.81 mg
- * 8g | 15.63 mg
- * 16g | 31.25 mg
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_high_g_thres(
- u8 v_high_g_thres_u8);
- /***************************************************************/
- /**\name FUNCTION FOR ANY MOTION DURATION CONFIGURATION */
- /***************************************************************/
- /*!
- * @brief This API reads any motion duration
- * from the register 0x5F bit 0 and 1
- *
- * @param v_any_motion_durn_u8 : The value of any motion duration
- *
- * @note Any motion duration can be calculated by "v_any_motion_durn_u8 + 1"
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_any_motion_durn(
- u8 *v_any_motion_durn_u8);
- /*!
- * @brief This API write any motion duration
- * from the register 0x5F bit 0 and 1
- *
- * @param v_any_motion_durn_u8 : The value of any motion duration
- *
- * @note Any motion duration can be calculated by "v_any_motion_durn_u8 + 1"
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_any_motion_durn(
- u8 nomotion);
- /***************************************************************/
- /**\name FUNCTION FOR SLOW NO MOTION DURATION CONFIGURATION */
- /***************************************************************/
- /*!
- * @brief This API read Slow/no-motion
- * interrupt trigger delay duration from the register 0x5F bit 2 to 7
- *
- * @param v_slow_no_motion_u8 :The value of slow no motion duration
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- * @note
- * @note v_slow_no_motion_u8(5:4)=0b00 ->
- * [v_slow_no_motion_u8(3:0) + 1] * 1.28s (1.28s-20.48s)
- * @note v_slow_no_motion_u8(5:4)=1 ->
- * [v_slow_no_motion_u8(3:0)+5] * 5.12s (25.6s-102.4s)
- * @note v_slow_no_motion_u8(5)='1' ->
- * [(v_slow_no_motion_u8:0)+11] * 10.24s (112.64s-430.08s);
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_slow_no_motion_durn(
- u8 *v_slow_no_motion_u8);
- /*!
- * @brief This API write Slow/no-motion
- * interrupt trigger delay duration from the register 0x5F bit 2 to 7
- *
- * @param v_slow_no_motion_u8 :The value of slow no motion duration
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- * @note
- * @note v_slow_no_motion_u8(5:4)=0b00 ->
- * [v_slow_no_motion_u8(3:0) + 1] * 1.28s (1.28s-20.48s)
- * @note v_slow_no_motion_u8(5:4)=1 ->
- * [v_slow_no_motion_u8(3:0)+5] * 5.12s (25.6s-102.4s)
- * @note v_slow_no_motion_u8(5)='1' ->
- * [(v_slow_no_motion_u8:0)+11] * 10.24s (112.64s-430.08s);
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_slow_no_motion_durn(
- u8 v_slow_no_motion_u8);
- /***************************************************************/
- /**\name FUNCTION FOR ANY MOTION THRESHOLD CONFIGURATION */
- /***************************************************************/
- /*!
- * @brief This API is used to read threshold
- * definition for the any-motion interrupt
- * from the register 0x60 bit 0 to 7
- *
- *
- * @param v_any_motion_thres_u8 : The value of any motion threshold
- *
- * @note any motion threshold changes according to accel g range
- * accel g range can be set by the function ""
- * accel_range | any motion threshold
- * ----------------|---------------------
- * 2g | v_any_motion_thres_u8*3.91 mg
- * 4g | v_any_motion_thres_u8*7.81 mg
- * 8g | v_any_motion_thres_u8*15.63 mg
- * 16g | v_any_motion_thres_u8*31.25 mg
- * @note when v_any_motion_thres_u8 = 0
- * accel_range | any motion threshold
- * ----------------|---------------------
- * 2g | 1.95 mg
- * 4g | 3.91 mg
- * 8g | 7.81 mg
- * 16g | 15.63 mg
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_any_motion_thres(
- u8 *v_any_motion_thres_u8);
- /*!
- * @brief This API is used to write threshold
- * definition for the any-motion interrupt
- * from the register 0x60 bit 0 to 7
- *
- *
- * @param v_any_motion_thres_u8 : The value of any motion threshold
- *
- * @note any motion threshold changes according to accel g range
- * accel g range can be set by the function ""
- * accel_range | any motion threshold
- * ----------------|---------------------
- * 2g | v_any_motion_thres_u8*3.91 mg
- * 4g | v_any_motion_thres_u8*7.81 mg
- * 8g | v_any_motion_thres_u8*15.63 mg
- * 16g | v_any_motion_thres_u8*31.25 mg
- * @note when v_any_motion_thres_u8 = 0
- * accel_range | any motion threshold
- * ----------------|---------------------
- * 2g | 1.95 mg
- * 4g | 3.91 mg
- * 8g | 7.81 mg
- * 16g | 15.63 mg
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_any_motion_thres(
- u8 v_any_motion_thres_u8);
- /***************************************************************/
- /**\name FUNCTION FOR SLO/NO MOTION THRESHOLD CONFIGURATION */
- /***************************************************************/
- /*!
- * @brief This API is used to read threshold
- * for the slow/no-motion interrupt
- * from the register 0x61 bit 0 to 7
- *
- *
- *
- *
- * @param v_slow_no_motion_thres_u8 : The value of slow no motion threshold
- * @note slow no motion threshold changes according to accel g range
- * accel g range can be set by the function ""
- * accel_range | slow no motion threshold
- * ----------------|---------------------
- * 2g | v_slow_no_motion_thres_u8*3.91 mg
- * 4g | v_slow_no_motion_thres_u8*7.81 mg
- * 8g | v_slow_no_motion_thres_u8*15.63 mg
- * 16g | v_slow_no_motion_thres_u8*31.25 mg
- * @note when v_slow_no_motion_thres_u8 = 0
- * accel_range | slow no motion threshold
- * ----------------|---------------------
- * 2g | 1.95 mg
- * 4g | 3.91 mg
- * 8g | 7.81 mg
- * 16g | 15.63 mg
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_slow_no_motion_thres(
- u8 *v_slow_no_motion_thres_u8);
- /*!
- * @brief This API is used to write threshold
- * for the slow/no-motion interrupt
- * from the register 0x61 bit 0 to 7
- *
- *
- *
- *
- * @param v_slow_no_motion_thres_u8 : The value of slow no motion threshold
- * @note slow no motion threshold changes according to accel g range
- * accel g range can be set by the function ""
- * accel_range | slow no motion threshold
- * ----------------|---------------------
- * 2g | v_slow_no_motion_thres_u8*3.91 mg
- * 4g | v_slow_no_motion_thres_u8*7.81 mg
- * 8g | v_slow_no_motion_thres_u8*15.63 mg
- * 16g | v_slow_no_motion_thres_u8*31.25 mg
- * @note when v_slow_no_motion_thres_u8 = 0
- * accel_range | slow no motion threshold
- * ----------------|---------------------
- * 2g | 1.95 mg
- * 4g | 3.91 mg
- * 8g | 7.81 mg
- * 16g | 15.63 mg
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_slow_no_motion_thres(
- u8 v_slow_no_motion_thres_u8);
- /***************************************************************/
- /**\name FUNCTION FOR SLO/NO MOTION SELECT CONFIGURATION */
- /***************************************************************/
- /*!
- * @brief This API is used to read
- * the slow/no-motion selection from the register 0x62 bit 0
- *
- *
- *
- *
- * @param v_intr_slow_no_motion_select_u8 :
- * The value of slow/no-motion select
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | SLOW_MOTION
- * 0x01 | NO_MOTION
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_slow_no_motion_select(
- u8 *v_intr_slow_no_motion_select_u8);
- /*!
- * @brief This API is used to write
- * the slow/no-motion selection from the register 0x62 bit 0
- *
- *
- *
- *
- * @param v_intr_slow_no_motion_select_u8 :
- * The value of slow/no-motion select
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | SLOW_MOTION
- * 0x01 | NO_MOTION
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_slow_no_motion_select(
- u8 v_intr_slow_no_motion_select_u8);
- /***************************************************************/
- /**\name FUNCTION FOR SIGNIFICANT MOTION SELECT CONFIGURATION*/
- /***************************************************************/
- /*!
- * @brief This API is used to select
- * the significant or any motion interrupt from the register 0x62 bit 1
- *
- *
- *
- *
- * @param v_intr_significant_motion_select_u8 :
- * the value of significant or any motion interrupt selection
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | ANY_MOTION
- * 0x01 | SIGNIFICANT_MOTION
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_significant_motion_select(
- u8 *int_sig_mot_sel);
- /*!
- * @brief This API is used to write, select
- * the significant or any motion interrupt from the register 0x62 bit 1
- *
- *
- *
- *
- * @param v_intr_significant_motion_select_u8 :
- * the value of significant or any motion interrupt selection
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | ANY_MOTION
- * 0x01 | SIGNIFICANT_MOTION
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_significant_motion_select(
- u8 int_sig_mot_sel);
- /*!
- * @brief This API is used to read
- * the significant skip time from the register 0x62 bit 2 and 3
- *
- *
- *
- *
- * @param v_int_sig_mot_skip_u8 : the value of significant skip time
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | skip time 1.5 seconds
- * 0x01 | skip time 3 seconds
- * 0x02 | skip time 6 seconds
- * 0x03 | skip time 12 seconds
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_significant_motion_skip(
- u8 *v_int_sig_mot_skip_u8);
- /*!
- * @brief This API is used to write
- * the significant skip time from the register 0x62 bit 2 and 3
- *
- *
- *
- *
- * @param v_int_sig_mot_skip_u8 : the value of significant skip time
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | skip time 1.5 seconds
- * 0x01 | skip time 3 seconds
- * 0x02 | skip time 6 seconds
- * 0x03 | skip time 12 seconds
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_significant_motion_skip(
- u8 v_int_sig_mot_skip_u8);
- /*!
- * @brief This API is used to read
- * the significant proof time from the register 0x62 bit 4 and 5
- *
- *
- *
- *
- * @param v_significant_motion_proof_u8 :
- * the value of significant proof time
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | proof time 0.25 seconds
- * 0x01 | proof time 0.5 seconds
- * 0x02 | proof time 1 seconds
- * 0x03 | proof time 2 seconds
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_significant_motion_proof(
- u8 *int_sig_mot_proof);
- /*!
- * @brief This API is used to write
- * the significant proof time from the register 0x62 bit 4 and 5
- *
- *
- *
- *
- * @param v_significant_motion_proof_u8 :
- * the value of significant proof time
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | proof time 0.25 seconds
- * 0x01 | proof time 0.5 seconds
- * 0x02 | proof time 1 seconds
- * 0x03 | proof time 2 seconds
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_significant_motion_proof(
- u8 int_sig_mot_proof);
- /***************************************************************/
- /**\name FUNCTION FOR TAP DURATION CONFIGURATION*/
- /***************************************************************/
- /*!
- * @brief This API is used to get the tap duration
- * from the register 0x63 bit 0 to 2
- *
- *
- *
- * @param v_tap_durn_u8 : The value of tap duration
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | BMI160_TAP_DURN_50MS
- * 0x01 | BMI160_TAP_DURN_100MS
- * 0x03 | BMI160_TAP_DURN_150MS
- * 0x04 | BMI160_TAP_DURN_200MS
- * 0x05 | BMI160_TAP_DURN_250MS
- * 0x06 | BMI160_TAP_DURN_375MS
- * 0x07 | BMI160_TAP_DURN_700MS
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_tap_durn(
- u8 *v_tap_durn_u8);
- /*!
- * @brief This API is used to write the tap duration
- * from the register 0x63 bit 0 to 2
- *
- *
- *
- * @param v_tap_durn_u8 : The value of tap duration
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | BMI160_TAP_DURN_50MS
- * 0x01 | BMI160_TAP_DURN_100MS
- * 0x03 | BMI160_TAP_DURN_150MS
- * 0x04 | BMI160_TAP_DURN_200MS
- * 0x05 | BMI160_TAP_DURN_250MS
- * 0x06 | BMI160_TAP_DURN_375MS
- * 0x07 | BMI160_TAP_DURN_700MS
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_tap_durn(
- u8 v_tap_durn_u8);
- /***************************************************************/
- /**\name FUNCTION FOR TAP SHOCK CONFIGURATION*/
- /***************************************************************/
- /*!
- * @brief This API read the
- * tap shock duration from the register 0x63 bit 2
- *
- * @param v_tap_shock_u8 :The value of tap shock
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | BMI160_TAP_SHOCK_50MS
- * 0x01 | BMI160_TAP_SHOCK_75MS
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_tap_shock(
- u8 *v_tap_shock_u8);
- /*!
- * @brief This API write the
- * tap shock duration from the register 0x63 bit 2
- *
- * @param v_tap_shock_u8 :The value of tap shock
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | BMI160_TAP_SHOCK_50MS
- * 0x01 | BMI160_TAP_SHOCK_75MS
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_tap_shock(
- u8 v_tap_shock_u8);
- /***************************************************************/
- /**\name FUNCTION FOR TAP QUIET CONFIGURATION*/
- /***************************************************************/
- /*!
- * @brief This API read
- * tap quiet duration from the register 0x63 bit 7
- *
- *
- * @param v_tap_quiet_u8 : The value of tap quiet
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | BMI160_TAP_QUIET_30MS
- * 0x01 | BMI160_TAP_QUIET_20MS
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_tap_quiet(
- u8 *v_tap_quiet_u8);
- /*!
- * @brief This API write
- * tap quiet duration from the register 0x63 bit 7
- *
- *
- * @param v_tap_quiet_u8 : The value of tap quiet
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | BMI160_TAP_QUIET_30MS
- * 0x01 | BMI160_TAP_QUIET_20MS
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_tap_quiet(
- u8 v_tap_quiet_u8);
- /***************************************************************/
- /**\name FUNCTION FOR TAP THRESHOLD CONFIGURATION*/
- /***************************************************************/
- /*!
- * @brief This API read Threshold of the
- * single/double tap interrupt from the register 0x64 bit 0 to 4
- *
- *
- * @param v_tap_thres_u8 : The value of single/double tap threshold
- *
- * @note single/double tap threshold changes according to accel g range
- * accel g range can be set by the function ""
- * accel_range | single/double tap threshold
- * ----------------|---------------------
- * 2g | ((v_tap_thres_u8 + 1) * 62.5)mg
- * 4g | ((v_tap_thres_u8 + 1) * 125)mg
- * 8g | ((v_tap_thres_u8 + 1) * 250)mg
- * 16g | ((v_tap_thres_u8 + 1) * 500)mg
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_tap_thres(
- u8 *v_tap_thres_u8);
- /*!
- * @brief This API write Threshold of the
- * single/double tap interrupt from the register 0x64 bit 0 to 4
- *
- *
- * @param v_tap_thres_u8 : The value of single/double tap threshold
- *
- * @note single/double tap threshold changes according to accel g range
- * accel g range can be set by the function ""
- * accel_range | single/double tap threshold
- * ----------------|---------------------
- * 2g | ((v_tap_thres_u8 + 1) * 62.5)mg
- * 4g | ((v_tap_thres_u8 + 1) * 125)mg
- * 8g | ((v_tap_thres_u8 + 1) * 250)mg
- * 16g | ((v_tap_thres_u8 + 1) * 500)mg
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_tap_thres(
- u8 v_tap_thres_u8);
- /***************************************************************/
- /**\name FUNCTION FOR ORIENT MODE CONFIGURATION*/
- /***************************************************************/
- /*!
- * @brief This API read the threshold for orientation interrupt
- * from the register 0x65 bit 0 and 1
- *
- * @param v_orient_mode_u8 : The value of threshold for orientation
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | symmetrical
- * 0x01 | high-asymmetrical
- * 0x02 | low-asymmetrical
- * 0x03 | symmetrical
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_orient_mode(
- u8 *v_orient_mode_u8);
- /*!
- * @brief This API write the threshold for orientation interrupt
- * from the register 0x65 bit 0 and 1
- *
- * @param v_orient_mode_u8 : The value of threshold for orientation
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | symmetrical
- * 0x01 | high-asymmetrical
- * 0x02 | low-asymmetrical
- * 0x03 | symmetrical
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_orient_mode(
- u8 v_orient_mode_u8);
- /***************************************************************/
- /**\name FUNCTION FOR ORIENT BLOCKING CONFIGURATION*/
- /***************************************************************/
- /*!
- * @brief This API read the orient blocking mode
- * that is used for the generation of the orientation interrupt.
- * from the register 0x65 bit 2 and 3
- *
- * @param v_orient_blocking_u8 : The value of orient blocking mode
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | No blocking
- * 0x01 | Theta blocking or acceleration in any axis > 1.5g
- * 0x02 | Theta blocking or acceleration slope in any axis >
- * - | 0.2g or acceleration in any axis > 1.5g
- * 0x03 | Theta blocking or acceleration slope in any axis >
- * - | 0.4g or acceleration in any axis >
- * - | 1.5g and value of orient is not stable
- * - | for at least 100 ms
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_orient_blocking(
- u8 *v_orient_blocking_u8);
- /*!
- * @brief This API write the orient blocking mode
- * that is used for the generation of the orientation interrupt.
- * from the register 0x65 bit 2 and 3
- *
- * @param v_orient_blocking_u8 : The value of orient blocking mode
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | No blocking
- * 0x01 | Theta blocking or acceleration in any axis > 1.5g
- * 0x02 | Theta blocking or acceleration slope in any axis >
- * - | 0.2g or acceleration in any axis > 1.5g
- * 0x03 | Theta blocking or acceleration slope in any axis >
- * - | 0.4g or acceleration in any axis >
- * - | 1.5g and value of orient is not stable
- * - | for at least 100 ms
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_orient_blocking(
- u8 v_orient_blocking_u8);
- /***************************************************************/
- /**\name FUNCTION FOR ORIENT HYSTERESIS CONFIGURATION*/
- /***************************************************************/
- /*!
- * @brief This API read Orient interrupt
- * hysteresis, from the register 0x64 bit 4 to 7
- *
- *
- *
- * @param v_orient_hyst_u8 : The value of orient hysteresis
- *
- * @note 1 LSB corresponds to 62.5 mg,
- * irrespective of the selected accel range
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_orient_hyst(
- u8 *v_orient_hyst_u8);
- /*!
- * @brief This API write Orient interrupt
- * hysteresis, from the register 0x64 bit 4 to 7
- *
- *
- *
- * @param v_orient_hyst_u8 : The value of orient hysteresis
- *
- * @note 1 LSB corresponds to 62.5 mg,
- * irrespective of the selected accel range
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_orient_hyst(
- u8 v_orient_hyst_u8);
- /***************************************************************/
- /**\name FUNCTION FOR ORIENT THETA CONFIGURATION*/
- /***************************************************************/
- /*!
- * @brief This API read Orient
- * blocking angle (0 to 44.8) from the register 0x66 bit 0 to 5
- *
- * @param v_orient_theta_u8 : The value of Orient blocking angle
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_orient_theta(
- u8 *v_orient_theta_u8);
- /*!
- * @brief This API write Orient
- * blocking angle (0 to 44.8) from the register 0x66 bit 0 to 5
- *
- * @param v_orient_theta_u8 : The value of Orient blocking angle
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_orient_theta(
- u8 v_orient_theta_u8);
- /***************************************************************/
- /**\name FUNCTION FOR ORIENT OUTPUT ENABLE CONFIGURATION*/
- /***************************************************************/
- /*!
- * @brief This API read orient change
- * of up/down bit from the register 0x66 bit 6
- *
- * @param v_orient_ud_u8 : The value of orient change of up/down
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | Is ignored
- * 0x01 | Generates orientation interrupt
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_orient_ud_enable(
- u8 *v_orient_ud_u8);
- /*!
- * @brief This API write orient change
- * of up/down bit from the register 0x66 bit 6
- *
- * @param v_orient_ud_u8 : The value of orient change of up/down
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | Is ignored
- * 0x01 | Generates orientation interrupt
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_orient_ud_enable(
- u8 v_orient_ud_u8);
- /***************************************************************/
- /**\name FUNCTION FOR ORIENT AXIS ENABLE CONFIGURATION*/
- /***************************************************************/
- /*!
- * @brief This API read orientation axes changes
- * from the register 0x66 bit 7
- *
- * @param v_orient_axes_u8 : The value of orient axes assignment
- * value | Behaviour | Name
- * ----------|--------------------|------
- * 0x00 | x = x, y = y, z = z|orient_ax_noex
- * 0x01 | x = y, y = z, z = x|orient_ax_ex
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_orient_axes_enable(
- u8 *v_orient_axes_u8);
- /*!
- * @brief This API write orientation axes changes
- * from the register 0x66 bit 7
- *
- * @param v_orient_axes_u8 : The value of orient axes assignment
- * value | Behaviour | Name
- * ----------|--------------------|------
- * 0x00 | x = x, y = y, z = z|orient_ax_noex
- * 0x01 | x = y, y = z, z = x|orient_ax_ex
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_orient_axes_enable(
- u8 v_orient_axes_u8);
- /***************************************************************/
- /**\name FUNCTION FOR FLAT THETA CONFIGURATION*/
- /***************************************************************/
- /*!
- * @brief This API read Flat angle (0 to 44.8) for flat interrupt
- * from the register 0x67 bit 0 to 5
- *
- * @param v_flat_theta_u8 : The value of flat angle
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_flat_theta(
- u8 *v_flat_theta_u8);
- /*!
- * @brief This API write Flat angle (0 to 44.8) for flat interrupt
- * from the register 0x67 bit 0 to 5
- *
- * @param v_flat_theta_u8 : The value of flat angle
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_flat_theta(
- u8 v_flat_theta_u8);
- /***************************************************************/
- /**\name FUNCTION FOR FLAT HOLD CONFIGURATION*/
- /***************************************************************/
- /*!
- * @brief This API read Flat interrupt hold time;
- * from the register 0x68 bit 4 and 5
- *
- * @param v_flat_hold_u8 : The value of flat hold time
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | 0ms
- * 0x01 | 512ms
- * 0x01 | 1024ms
- * 0x01 | 2048ms
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_flat_hold(
- u8 *v_flat_hold_u8);
- /*!
- * @brief This API write Flat interrupt hold time;
- * from the register 0x68 bit 4 and 5
- *
- * @param v_flat_hold_u8 : The value of flat hold time
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | 0ms
- * 0x01 | 512ms
- * 0x01 | 1024ms
- * 0x01 | 2048ms
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_flat_hold(
- u8 v_flat_hold_u8);
- /***************************************************************/
- /**\name FUNCTION FOR FLAT HYSTERESIS CONFIGURATION*/
- /***************************************************************/
- /*!
- * @brief This API read flat interrupt hysteresis
- * from the register 0x68 bit 0 to 3
- *
- * @param v_flat_hyst_u8 : The value of flat hysteresis
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_flat_hyst(
- u8 *v_flat_hyst_u8);
- /*!
- * @brief This API write flat interrupt hysteresis
- * from the register 0x68 bit 0 to 3
- *
- * @param v_flat_hyst_u8 : The value of flat hysteresis
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_flat_hyst(
- u8 v_flat_hyst_u8);
- /***************************************************************/
- /**\name FUNCTION FAST OFFSET COMPENSATION FOR ACCEL */
- /***************************************************************/
- /*!
- * @brief This API read accel offset compensation
- * target value for z-axis from the register 0x69 bit 0 and 1
- *
- * @param v_foc_accel_z_u8 : the value of accel offset compensation z axis
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | disable
- * 0x01 | +1g
- * 0x01 | -1g
- * 0x01 | 0g
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_foc_accel_z(
- u8 *v_foc_accel_z_u8);
- /*!
- * @brief This API write accel offset compensation
- * target value for z-axis from the register 0x69 bit 0 and 1
- *
- * @param v_foc_accel_z_u8 : the value of accel offset compensation z axis
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | disable
- * 0x01 | +1g
- * 0x01 | -1g
- * 0x01 | 0g
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_foc_accel_z(
- u8 v_foc_accel_z_u8);
- /*!
- * @brief This API read accel offset compensation
- * target value for y-axis
- * from the register 0x69 bit 2 and 3
- *
- * @param v_foc_accel_y_u8 : the value of accel offset compensation y axis
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | disable
- * 0x01 | +1g
- * 0x01 | -1g
- * 0x01 | 0g
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_foc_accel_y(
- u8 *v_foc_accel_y_u8);
- /*!
- * @brief This API write accel offset compensation
- * target value for y-axis
- * from the register 0x69 bit 2 and 3
- *
- * @param v_foc_accel_y_u8 : the value of accel offset compensation y axis
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | disable
- * 0x01 | +1g
- * 0x01 | -1g
- * 0x01 | 0g
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_foc_accel_y(
- u8 v_foc_accel_y_u8);
- /*!
- * @brief This API read accel offset compensation
- * target value for x-axis is
- * from the register 0x69 bit 4 and 5
- *
- * @param v_foc_accel_x_u8 : the value of accel offset compensation x axis
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | disable
- * 0x01 | +1g
- * 0x01 | -1g
- * 0x01 | 0g
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_foc_accel_x(
- u8 *v_foc_accel_x_u8);
- /*!
- * @brief This API write accel offset compensation
- * target value for x-axis is
- * from the register 0x69 bit 4 and 5
- *
- * @param v_foc_accel_x_u8 : the value of accel offset compensation x axis
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | disable
- * 0x01 | +1g
- * 0x01 | -1g
- * 0x01 | 0g
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_foc_accel_x(
- u8 v_foc_accel_x_u8);
- /***************************************************************/
- /**\name FUNCTION FAST OFFSET COMPENSATION FOR GYRO */
- /***************************************************************/
- /*!
- * @brief This API write gyro fast offset enable
- * from the register 0x69 bit 6
- *
- * @param v_foc_gyro_u8 : The value of gyro fast offset enable
- * value | Description
- * ----------|-------------
- * 0 | fast offset compensation disabled
- * 1 | fast offset compensation enabled
- *
- * @param v_gyro_off_x_s16 : The value of gyro fast offset x axis data
- * @param v_gyro_off_y_s16 : The value of gyro fast offset y axis data
- * @param v_gyro_off_z_s16 : The value of gyro fast offset z axis data
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_foc_gyro_enable(
- u8 v_foc_gyro_u8, s16 *v_gyro_off_x_s16,
- s16 *v_gyro_off_y_s16, s16 *v_gyro_off_z_s16);
- /***************************************************/
- /**\name FUNCTION FOR NVM*/
- /***************************************************/
- /*!
- * @brief This API read NVM program enable
- * from the register 0x6A bit 1
- *
- * @param v_nvm_prog_u8 : The value of NVM program enable
- * Value | Description
- * --------|-------------
- * 0 | DISABLE
- * 1 | ENABLE
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_nvm_prog_enable(
- u8 *v_nvm_prog_u8);
- /*!
- * @brief This API write NVM program enable
- * from the register 0x6A bit 1
- *
- * @param v_nvm_prog_u8 : The value of NVM program enable
- * Value | Description
- * --------|-------------
- * 0 | DISABLE
- * 1 | ENABLE
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_nvm_prog_enable(
- u8 v_nvm_prog_u8);
- /***************************************************/
- /**\name FUNCTION FOR SPI MODE*/
- /***************************************************/
- /*!
- * @brief This API read to configure SPI
- * Interface Mode for primary and OIS interface
- * from the register 0x6B bit 0
- *
- * @param v_spi3_u8 : The value of SPI mode selection
- * Value | Description
- * --------|-------------
- * 0 | SPI 4-wire mode
- * 1 | SPI 3-wire mode
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_spi3(
- u8 *v_spi3_u8);
- /*!
- * @brief This API write to configure SPI
- * Interface Mode for primary and OIS interface
- * from the register 0x6B bit 0
- *
- * @param v_spi3_u8 : The value of SPI mode selection
- * Value | Description
- * --------|-------------
- * 0 | SPI 4-wire mode
- * 1 | SPI 3-wire mode
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_spi3(
- u8 v_spi3_u8);
- /***************************************************/
- /**\name FUNCTION FOR FOC GYRO */
- /***************************************************/
- /*!
- * @brief This API read gyro fast offset enable
- * from the register 0x69 bit 6
- *
- * @param v_foc_gyro_u8 : The value of gyro fast offset enable
- * value | Description
- * ----------|-------------
- * 0 | fast offset compensation disabled
- * 1 | fast offset compensation enabled
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_foc_gyro_enable(
- u8 *v_foc_gyro_u8);
- /***************************************************/
- /**\name FUNCTION FOR I2C WATCHDOG TIMBER */
- /***************************************************/
- /*!
- * @brief This API read I2C Watchdog timer
- * from the register 0x70 bit 1
- *
- * @param v_i2c_wdt_u8 : The value of I2C watch dog timer
- * Value | Description
- * --------|-------------
- * 0 | I2C watchdog v_timeout_u8 after 1 ms
- * 1 | I2C watchdog v_timeout_u8 after 50 ms
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_i2c_wdt_select(
- u8 *v_i2c_wdt_u8);
- /*!
- * @brief This API write I2C Watchdog timer
- * from the register 0x70 bit 1
- *
- * @param v_i2c_wdt_u8 : The value of I2C watch dog timer
- * Value | Description
- * --------|-------------
- * 0 | I2C watchdog v_timeout_u8 after 1 ms
- * 1 | I2C watchdog v_timeout_u8 after 50 ms
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE
- bmi160_set_i2c_wdt_select(u8 v_i2c_wdt_u8);
- /*!
- * @brief This API read I2C watchdog enable
- * from the register 0x70 bit 2
- *
- * @param v_i2c_wdt_u8 : The value of I2C watchdog enable
- * Value | Description
- * --------|-------------
- * 0 | DISABLE
- * 1 | ENABLE
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_i2c_wdt_enable(
- u8 *v_i2c_wdt_u8);
- /*!
- * @brief This API write I2C watchdog enable
- * from the register 0x70 bit 2
- *
- * @param v_i2c_wdt_u8 : The value of I2C watchdog enable
- * Value | Description
- * --------|-------------
- * 0 | DISABLE
- * 1 | ENABLE
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_i2c_wdt_enable(
- u8 v_i2c_wdt_u8);
- /***************************************************/
- /**\name FUNCTION FOR IF MODE*/
- /***************************************************/
- /*!
- * @brief This API read I2C interface configuration(if) moe
- * from the register 0x6B bit 4 and 5
- *
- * @param v_if_mode_u8 : The value of interface configuration mode
- * Value | Description
- * --------|-------------
- * 0x00 | Primary interface:autoconfig / secondary interface:off
- * 0x01 | Primary interface:I2C / secondary interface:OIS
- * 0x02 | Primary interface:autoconfig/secondary interface:Magnetometer
- * 0x03 | Reserved
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_if_mode(
- u8 *v_if_mode_u8);
- /*!
- * @brief This API write I2C interface configuration(if) moe
- * from the register 0x6B bit 4 and 5
- *
- * @param v_if_mode_u8 : The value of interface configuration mode
- * Value | Description
- * --------|-------------
- * 0x00 | Primary interface:autoconfig / secondary interface:off
- * 0x01 | Primary interface:I2C / secondary interface:OIS
- * 0x02 | Primary interface:autoconfig/secondary interface:Magnetometer
- * 0x03 | Reserved
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_if_mode(
- u8 v_if_mode_u8);
- /***************************************************/
- /**\name FUNCTION FOR GYRO SLEEP TRIGGER INTERRUPT CONFIGURATION*/
- /***************************************************/
- /*!
- * @brief This API read gyro sleep trigger
- * from the register 0x6C bit 0 to 2
- *
- * @param v_gyro_sleep_trigger_u8 : The value of gyro sleep trigger
- * Value | Description
- * --------|-------------
- * 0x00 | nomotion: no / Not INT1 pin: no / INT2 pin: no
- * 0x01 | nomotion: no / Not INT1 pin: no / INT2 pin: yes
- * 0x02 | nomotion: no / Not INT1 pin: yes / INT2 pin: no
- * 0x03 | nomotion: no / Not INT1 pin: yes / INT2 pin: yes
- * 0x04 | nomotion: yes / Not INT1 pin: no / INT2 pin: no
- * 0x05 | anymotion: yes / Not INT1 pin: no / INT2 pin: yes
- * 0x06 | anymotion: yes / Not INT1 pin: yes / INT2 pin: no
- * 0x07 | anymotion: yes / Not INT1 pin: yes / INT2 pin: yes
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_sleep_trigger(
- u8 *v_gyro_sleep_trigger_u8);
- /*!
- * @brief This API write gyro sleep trigger
- * from the register 0x6C bit 0 to 2
- *
- * @param v_gyro_sleep_trigger_u8 : The value of gyro sleep trigger
- * Value | Description
- * --------|-------------
- * 0x00 | nomotion: no / Not INT1 pin: no / INT2 pin: no
- * 0x01 | nomotion: no / Not INT1 pin: no / INT2 pin: yes
- * 0x02 | nomotion: no / Not INT1 pin: yes / INT2 pin: no
- * 0x03 | nomotion: no / Not INT1 pin: yes / INT2 pin: yes
- * 0x04 | nomotion: yes / Not INT1 pin: no / INT2 pin: no
- * 0x05 | anymotion: yes / Not INT1 pin: no / INT2 pin: yes
- * 0x06 | anymotion: yes / Not INT1 pin: yes / INT2 pin: no
- * 0x07 | anymotion: yes / Not INT1 pin: yes / INT2 pin: yes
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_gyro_sleep_trigger(
- u8 v_gyro_sleep_trigger_u8);
- /*!
- * @brief This API read gyro wakeup trigger
- * from the register 0x6C bit 3 and 4
- *
- * @param v_gyro_wakeup_trigger_u8 : The value of gyro wakeup trigger
- * Value | Description
- * --------|-------------
- * 0x00 | anymotion: no / INT1 pin: no
- * 0x01 | anymotion: no / INT1 pin: yes
- * 0x02 | anymotion: yes / INT1 pin: no
- * 0x03 | anymotion: yes / INT1 pin: yes
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_wakeup_trigger(
- u8 *v_gyro_wakeup_trigger_u8);
- /*!
- * @brief This API write gyro wakeup trigger
- * from the register 0x6C bit 3 and 4
- *
- * @param v_gyro_wakeup_trigger_u8 : The value of gyro wakeup trigger
- * Value | Description
- * --------|-------------
- * 0x00 | anymotion: no / INT1 pin: no
- * 0x01 | anymotion: no / INT1 pin: yes
- * 0x02 | anymotion: yes / INT1 pin: no
- * 0x03 | anymotion: yes / INT1 pin: yes
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_gyro_wakeup_trigger(
- u8 v_gyro_wakeup_trigger_u8);
- /*!
- * @brief This API read Target state for gyro sleep mode
- * from the register 0x6C bit 5
- *
- * @param v_gyro_sleep_state_u8 : The value of gyro sleep mode
- * Value | Description
- * --------|-------------
- * 0x00 | Sleep transition to fast wake up state
- * 0x01 | Sleep transition to suspend state
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_sleep_state(
- u8 *v_gyro_sleep_state_u8);
- /*!
- * @brief This API write Target state for gyro sleep mode
- * from the register 0x6C bit 5
- *
- * @param v_gyro_sleep_state_u8 : The value of gyro sleep mode
- * Value | Description
- * --------|-------------
- * 0x00 | Sleep transition to fast wake up state
- * 0x01 | Sleep transition to suspend state
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_gyro_sleep_state(
- u8 v_gyro_sleep_state_u8);
- /*!
- * @brief This API read gyro wakeup interrupt
- * from the register 0x6C bit 6
- *
- * @param v_gyro_wakeup_intr_u8 : The valeu of gyro wakeup interrupt
- * Value | Description
- * --------|-------------
- * 0x00 | DISABLE
- * 0x01 | ENABLE
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_wakeup_intr(
- u8 *v_gyro_wakeup_intr_u8);
- /*!
- * @brief This API write gyro wakeup interrupt
- * from the register 0x6C bit 6
- *
- * @param v_gyro_wakeup_intr_u8 : The valeu of gyro wakeup interrupt
- * Value | Description
- * --------|-------------
- * 0x00 | DISABLE
- * 0x01 | ENABLE
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_gyro_wakeup_intr(
- u8 v_gyro_wakeup_intr_u8);
- /***************************************************/
- /**\name FUNCTION FOR ACCEL SELF TEST */
- /***************************************************/
- /*!
- * @brief This API read accel select axis to be self-test
- *
- * @param v_accel_selftest_axis_u8 :
- * The value of accel self test axis selection
- * Value | Description
- * --------|-------------
- * 0x00 | disabled
- * 0x01 | x-axis
- * 0x02 | y-axis
- * 0x03 | z-axis
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_accel_selftest_axis(
- u8 *acc_selftest_axis);
- /*!
- * @brief This API write accel select axis to be self-test
- *
- * @param v_accel_selftest_axis_u8 :
- * The value of accel self test axis selection
- * Value | Description
- * --------|-------------
- * 0x00 | disabled
- * 0x01 | x-axis
- * 0x02 | y-axis
- * 0x03 | z-axis
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_accel_selftest_axis(
- u8 acc_selftest_axis);
- /*!
- * @brief This API read accel self test axis sign
- * from the register 0x6D bit 2
- *
- * @param v_accel_selftest_sign_u8: The value of accel self test axis sign
- * Value | Description
- * --------|-------------
- * 0x00 | negative
- * 0x01 | positive
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_accel_selftest_sign(
- u8 *acc_selftest_sign);
- /*!
- * @brief This API write accel self test axis sign
- * from the register 0x6D bit 2
- *
- * @param v_accel_selftest_sign_u8: The value of accel self test axis sign
- * Value | Description
- * --------|-------------
- * 0x00 | negative
- * 0x01 | positive
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_accel_selftest_sign(
- u8 acc_selftest_sign);
- /*!
- * @brief This API read accel self test amplitude
- * from the register 0x6D bit 3
- * select amplitude of the selftest deflection:
- *
- * @param v_accel_selftest_amp_u8 : The value of accel self test amplitude
- * Value | Description
- * --------|-------------
- * 0x00 | LOW
- * 0x01 | HIGH
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_accel_selftest_amp(
- u8 *acc_selftest_amp);
- /*!
- * @brief This API write accel self test amplitude
- * from the register 0x6D bit 3
- * select amplitude of the selftest deflection:
- *
- * @param v_accel_selftest_amp_u8 : The value of accel self test amplitude
- * Value | Description
- * --------|-------------
- * 0x00 | LOW
- * 0x01 | HIGH
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_accel_selftest_amp(
- u8 acc_selftest_amp);
- /***************************************************/
- /**\name FUNCTION FOR GYRO SELF TEST */
- /***************************************************/
- /*!
- * @brief This API read gyro self test trigger
- *
- * @param v_gyro_selftest_start_u8: The value of gyro self test start
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_selftest_start(
- u8 *v_gyro_selftest_start_u8);
- /*!
- * @brief This API write gyro self test trigger
- *
- * @param v_gyro_selftest_start_u8: The value of gyro self test start
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_gyro_selftest_start(
- u8 v_gyro_selftest_start_u8);
- /***************************************************/
- /**\name FUNCTION FOR SPI/I2C ENABLE */
- /***************************************************/
- /*!
- * @brief This API read primary interface selection I2C or SPI
- * from the register 0x70 bit 0
- *
- * @param v_spi_enable_u8: The value of Interface selection
- * Value | Description
- * --------|-------------
- * 0x00 | I2C Enable
- * 0x01 | I2C DISBALE
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_spi_enable(
- u8 *v_spi_enable_u8);
- /*!
- * @brief This API write primary interface selection I2C or SPI
- * from the register 0x70 bit 0
- *
- * @param v_spi_enable_u8: The value of Interface selection
- * Value | Description
- * --------|-------------
- * 0x00 | I2C Enable
- * 0x01 | I2C DISBALE
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_spi_enable(
- u8 v_spi_enable_u8);
- /*!
- * @brief This API read the spare zero
- * form register 0x70 bit 3
- *
- *
- * @param v_spare0_trim_u8: The value of spare zero
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_spare0_trim
- (u8 *v_spare0_trim_u8);
- /*!
- * @brief This API write the spare zero
- * form register 0x70 bit 3
- *
- *
- * @param v_spare0_trim_u8: The value of spare zero
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_spare0_trim
- (u8 v_spare0_trim_u8);
- /***************************************************/
- /**\name FUNCTION FOR NVM COUNTER */
- /***************************************************/
- /*!
- * @brief This API read the NVM counter
- * form register 0x70 bit 4 to 7
- *
- *
- * @param v_nvm_counter_u8: The value of NVM counter
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_nvm_counter(
- u8 *v_nvm_counter_u8);
- /*!
- * @brief This API write the NVM counter
- * form register 0x70 bit 4 to 7
- *
- *
- * @param v_nvm_counter_u8: The value of NVM counter
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_nvm_counter(
- u8 v_nvm_counter_u8);
- /***************************************************/
- /**\name FUNCTION FOR ACCEL MANUAL OFFSET COMPENSATION */
- /***************************************************/
- /*!
- * @brief This API read accel manual offset compensation of x axis
- * from the register 0x71 bit 0 to 7
- *
- *
- *
- * @param v_accel_off_x_s8:
- * The value of accel manual offset compensation of x axis
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_accel_offset_compensation_xaxis(
- s8 *v_accel_off_x_s8);
- /*!
- * @brief This API write accel manual offset compensation of x axis
- * from the register 0x71 bit 0 to 7
- *
- *
- *
- * @param v_accel_off_x_s8:
- * The value of accel manual offset compensation of x axis
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_accel_offset_compensation_xaxis(
- s8 v_accel_off_x_s8);
- /*!
- * @brief This API read accel manual offset compensation of y axis
- * from the register 0x72 bit 0 to 7
- *
- *
- *
- * @param v_accel_off_y_s8:
- * The value of accel manual offset compensation of y axis
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_accel_offset_compensation_yaxis(
- s8 *v_accel_off_y_s8);
- /*!
- * @brief This API write accel manual offset compensation of y axis
- * from the register 0x72 bit 0 to 7
- *
- *
- *
- * @param v_accel_off_y_s8:
- * The value of accel manual offset compensation of y axis
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_accel_offset_compensation_yaxis(
- s8 v_accel_off_y_s8);
- /*!
- * @brief This API read accel manual offset compensation of z axis
- * from the register 0x73 bit 0 to 7
- *
- *
- *
- * @param v_accel_off_z_s8:
- * The value of accel manual offset compensation of z axis
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_accel_offset_compensation_zaxis(
- s8 *v_accel_off_z_s8);
- /*!
- * @brief This API write accel manual offset compensation of z axis
- * from the register 0x73 bit 0 to 7
- *
- *
- *
- * @param v_accel_off_z_s8:
- * The value of accel manual offset compensation of z axis
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_accel_offset_compensation_zaxis(
- s8 v_accel_off_z_s8);
- /***************************************************/
- /**\name FUNCTION FOR GYRO MANUAL OFFSET COMPENSATION */
- /***************************************************/
- /*!
- * @brief This API read gyro manual offset compensation of x axis
- * from the register 0x74 bit 0 to 7 and 0x77 bit 0 and 1
- *
- *
- *
- * @param v_gyro_off_x_s16:
- * The value of gyro manual offset compensation of x axis
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_offset_compensation_xaxis(
- s16 *v_gyro_off_x_s16);
- /*!
- * @brief This API write gyro manual offset compensation of x axis
- * from the register 0x74 bit 0 to 7 and 0x77 bit 0 and 1
- *
- *
- *
- * @param v_gyro_off_x_s16:
- * The value of gyro manual offset compensation of x axis
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_gyro_offset_compensation_xaxis(
- s16 v_gyro_off_x_s16);
- /*!
- * @brief This API read gyro manual offset compensation of y axis
- * from the register 0x75 bit 0 to 7 and 0x77 bit 2 and 3
- *
- *
- *
- * @param v_gyro_off_y_s16:
- * The value of gyro manual offset compensation of y axis
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_offset_compensation_yaxis(
- s16 *v_gyro_off_y_s16);
- /*!
- * @brief This API write gyro manual offset compensation of y axis
- * from the register 0x75 bit 0 to 7 and 0x77 bit 2 and 3
- *
- *
- *
- * @param v_gyro_off_y_s16:
- * The value of gyro manual offset compensation of y axis
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_gyro_offset_compensation_yaxis(
- s16 v_gyro_off_y_s16);
- /*!
- * @brief This API read gyro manual offset compensation of z axis
- * from the register 0x76 bit 0 to 7 and 0x77 bit 4 and 5
- *
- *
- *
- * @param v_gyro_off_z_s16:
- * The value of gyro manual offset compensation of z axis
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_offset_compensation_zaxis(
- s16 *v_gyro_off_z_s16);
- /*!
- * @brief This API write gyro manual offset compensation of z axis
- * from the register 0x76 bit 0 to 7 and 0x77 bit 4 and 5
- *
- *
- *
- * @param v_gyro_off_z_s16:
- * The value of gyro manual offset compensation of z axis
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_gyro_offset_compensation_zaxis(
- s16 v_gyro_off_z_s16);
- /*!
- * @brief This API writes accel fast offset compensation
- * from the register 0x69 bit 0 to 5
- * @brief This API writes each axis individually
- * FOC_X_AXIS - bit 4 and 5
- * FOC_Y_AXIS - bit 2 and 3
- * FOC_Z_AXIS - bit 0 and 1
- *
- * @param v_foc_accel_u8: The value of accel offset compensation
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | disable
- * 0x01 | +1g
- * 0x01 | -1g
- * 0x01 | 0g
- *
- * @param v_axis_u8: The value of accel offset axis selection
- * value | axis
- * ----------|-------------------
- * 0 | FOC_X_AXIS
- * 1 | FOC_Y_AXIS
- * 2 | FOC_Z_AXIS
- *
- * @param v_accel_offset_s8: The accel offset value
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_accel_foc_trigger(u8 axis,
- u8 foc_acc, s8 *accel_offset);
- /*!
- * @brief This API write fast accel offset compensation
- * it writes all axis together.To the register 0x69 bit 0 to 5
- * FOC_X_AXIS - bit 4 and 5
- * FOC_Y_AXIS - bit 2 and 3
- * FOC_Z_AXIS - bit 0 and 1
- *
- * @param v_foc_accel_x_u8: The value of accel offset x compensation
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | disable
- * 0x01 | +1g
- * 0x01 | -1g
- * 0x01 | 0g
- *
- * @param v_foc_accel_y_u8: The value of accel offset y compensation
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | disable
- * 0x01 | +1g
- * 0x01 | -1g
- * 0x01 | 0g
- *
- * @param v_foc_accel_z_u8: The value of accel offset z compensation
- * value | Behaviour
- * ----------|-------------------
- * 0x00 | disable
- * 0x01 | +1g
- * 0x01 | -1g
- * 0x01 | 0g
- *
- * @param v_accel_off_x_s8: The value of accel offset x axis
- * @param v_accel_off_y_s8: The value of accel offset y axis
- * @param v_accel_off_z_s8: The value of accel offset z axis
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_accel_foc_trigger_xyz(u8 v_foc_accel_x_u8,
- u8 v_foc_accel_y_u8, u8 v_foc_accel_z_u8,
- s8 *acc_off_x, s8 *acc_off_y, s8 *acc_off_z);
- /***************************************************/
- /**\name FUNCTION FOR ACEL AND GYRO OFFSET ENABLE */
- /***************************************************/
- /*!
- * @brief This API read the accel offset enable bit
- * from the register 0x77 bit 6
- *
- *
- *
- * @param v_accel_off_enable_u8: The value of accel offset enable
- * value | Description
- * ----------|--------------
- * 0x01 | ENABLE
- * 0x00 | DISABLE
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_accel_offset_enable(
- u8 *acc_off_en);
- /*!
- * @brief This API write the accel offset enable bit
- * from the register 0x77 bit 6
- *
- *
- *
- * @param v_accel_off_enable_u8: The value of accel offset enable
- * value | Description
- * ----------|--------------
- * 0x01 | ENABLE
- * 0x00 | DISABLE
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_accel_offset_enable(
- u8 acc_off_en);
- /*!
- * @brief This API read the accel offset enable bit
- * from the register 0x77 bit 7
- *
- *
- *
- * @param v_gyro_off_enable_u8: The value of gyro offset enable
- * value | Description
- * ----------|--------------
- * 0x01 | ENABLE
- * 0x00 | DISABLE
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_offset_enable(
- u8 *v_gyro_off_enable_u8);
- /*!
- * @brief This API write the accel offset enable bit
- * from the register 0x77 bit 7
- *
- *
- *
- * @param v_gyro_off_enable_u8: The value of gyro offset enable
- * value | Description
- * ----------|--------------
- * 0x01 | ENABLE
- * 0x00 | DISABLE
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_gyro_offset_enable(
- u8 v_gyro_off_enable_u8);
- /***************************************************/
- /**\name FUNCTION FOR STEP COUNTER INTERRUPT */
- /***************************************************/
- /*!
- * @brief This API reads step counter value
- * form the register 0x78 and 0x79
- *
- *
- *
- *
- * @param v_step_cnt_s16 : The value of step counter
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_read_step_count(s16 *v_step_cnt_s16);
- /*!
- * @brief This API Reads
- * step counter configuration
- * from the register 0x7A bit 0 to 7
- * and from the register 0x7B bit 0 to 2 and 4 to 7
- *
- *
- * @param v_step_config_u16 : The value of step configuration
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_step_config(
- u16 *v_step_config_u16);
- /*!
- * @brief This API write
- * step counter configuration
- * from the register 0x7A bit 0 to 7
- * and from the register 0x7B bit 0 to 2 and 4 to 7
- *
- *
- * @param v_step_config_u16 :
- * the value of Enable step configuration
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_step_config(
- u16 v_step_config_u16);
- /*!
- * @brief This API read enable step counter
- * from the register 0x7B bit 3
- *
- *
- * @param v_step_counter_u8 : The value of step counter enable
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_step_counter_enable(
- u8 *v_step_counter_u8);
- /*!
- * @brief This API write enable step counter
- * from the register 0x7B bit 3
- *
- *
- * @param v_step_counter_u8 : The value of step counter enable
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_step_counter_enable(
- u8 v_step_counter_u8);
- /*!
- * @brief This API set Step counter modes
- *
- *
- * @param v_step_mode_u8 : The value of step counter mode
- * value | mode
- * ----------|-----------
- * 0 | BMI160_STEP_NORMAL_MODE
- * 1 | BMI160_STEP_SENSITIVE_MODE
- * 2 | BMI160_STEP_ROBUST_MODE
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_step_mode(u8 v_step_mode_u8);
- /*!
- * @brief This API used to trigger the signification motion
- * interrupt
- *
- *
- * @param v_significant_u8 : The value of interrupt selection
- * value | interrupt
- * ----------|-----------
- * 0 | BMI160_MAP_INTR1
- * 1 | BMI160_MAP_INTR2
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_map_significant_motion_intr(
- u8 v_significant_u8);
- /*!
- * @brief This API used to trigger the step detector
- * interrupt
- *
- *
- * @param v_step_detector_u8 : The value of interrupt selection
- * value | interrupt
- * ----------|-----------
- * 0 | BMI160_MAP_INTR1
- * 1 | BMI160_MAP_INTR2
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_map_step_detector_intr(
- u8 v_step_detector_u8);
- /*!
- * @brief This API used to clear the step counter interrupt
- * interrupt
- *
- *
- * @param : None
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_clear_step_counter(void);
- /***************************************************/
- /**\name FUNCTION FOR STEP COMMAND REGISTER WRITE */
- /***************************************************/
- /*!
- * @brief This API writes value to the register 0x7E bit 0 to 7
- *
- *
- * @param v_command_reg_u8 : The value to write command register
- * value | Description
- * ---------|--------------------------------------------------------
- * 0x00 | Reserved
- * 0x03 | Starts fast offset calibration for the accel and gyro
- * 0x10 | Sets the PMU mode for the Accelerometer to suspend
- * 0x11 | Sets the PMU mode for the Accelerometer to normal
- * 0x12 | Sets the PMU mode for the Accelerometer Lowpower
- * 0x14 | Sets the PMU mode for the Gyroscope to suspend
- * 0x15 | Sets the PMU mode for the Gyroscope to normal
- * 0x16 | Reserved
- * 0x17 | Sets the PMU mode for the Gyroscope to fast start-up
- * 0x18 | Sets the PMU mode for the Magnetometer to suspend
- * 0x19 | Sets the PMU mode for the Magnetometer to normal
- * 0x1A | Sets the PMU mode for the Magnetometer to Lowpower
- * 0xB0 | Clears all data in the FIFO
- * 0xB1 | Resets the interrupt engine
- * 0xB2 | step_cnt_clr Clears the step counter
- * 0xB6 | Triggers a reset
- * 0x37 | See extmode_en_last
- * 0x9A | See extmode_en_last
- * 0xC0 | Enable the extended mode
- * 0xC4 | Erase NVM cell
- * 0xC8 | Load NVM cell
- * 0xF0 | Reset acceleration data path
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_command_register(
- u8 v_command_reg_u8);
- /***************************************************/
- /**\name FUNCTION FOR PAGE ENABLE */
- /***************************************************/
- /*!
- * @brief This API read target page from the register 0x7F bit 4 and 5
- *
- * @param v_target_page_u8: The value of target page
- * value | page
- * ---------|-----------
- * 0 | User data/configure page
- * 1 | Chip level trim/test page
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_target_page(
- u8 *v_target_page_u8);
- /*!
- * @brief This API write target page from the register 0x7F bit 4 and 5
- *
- * @param v_target_page_u8: The value of target page
- * value | page
- * ---------|-----------
- * 0 | User data/configure page
- * 1 | Chip level trim/test page
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_target_page(
- u8 v_target_page_u8);
- /*!
- * @brief This API read page enable from the register 0x7F bit 7
- *
- *
- *
- * @param v_page_enable_u8: The value of page enable
- * value | page
- * ---------|-----------
- * 0 | DISABLE
- * 1 | ENABLE
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_paging_enable(
- u8 *v_page_enable_u8);
- /*!
- * @brief This API write page enable from the register 0x7F bit 7
- *
- *
- *
- * @param v_page_enable_u8: The value of page enable
- * value | page
- * ---------|-----------
- * 0 | DISABLE
- * 1 | ENABLE
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_paging_enable(
- u8 v_page_enable_u8);
- /*!
- * @brief This API read
- * pull up configuration from the register 0X85 bit 4 an 5
- *
- *
- *
- * @param v_control_pullup_u8: The value of pull up register
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_get_pullup_configuration(
- u8 *v_control_pullup_u8);
- /*!
- * @brief This API write
- * pull up configuration from the register 0X85 bit 4 an 5
- *
- *
- *
- * @param v_control_pullup_u8: The value of pull up register
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_pullup_configuration(
- u8 v_control_pullup_u8);
- /***************************************************/
- /**\name FUNCTION FOR BMM150 */
- /***************************************************/
- /*!
- * @brief This function used for initialize the bmm150 sensor
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_bmm150_mag_interface_init(void);
- /*!
- * @brief This function used for set the mag power control
- * bit enable
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_bmm150_mag_wakeup(void);
- /*!
- * @brief This function used for read the trim values of magnetometer
- *
- * @note
- * Before reading the mag trimming values
- * make sure the following two points are addressed
- * @note
- * 1. Make sure the mag interface is enabled or not,
- * by using the bmi160_get_if_mode() function.
- * If mag interface is not enabled set the value of 0x02
- * to the function bmi160_get_if_mode(0x02)
- * @note
- * 2. And also confirm the secondary-interface power mode
- * is not in the SUSPEND mode.
- * by using the function bmi160_get_mag_pmu_status().
- * If the secondary-interface power mode is in SUSPEND mode
- * set the value of 0x19(NORMAL mode)by using the
- * bmi160_set_command_register(0x19) function.
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_read_bmm150_mag_trim(void);
- /*!
- * @brief This function used for read the compensated value of mag
- * Before start reading the mag compensated data's
- * make sure the following two points are addressed
- * @note
- * 1. Make sure the mag interface is enabled or not,
- * by using the bmi160_get_if_mode() function.
- * If mag interface is not enabled set the value of 0x02
- * to the function bmi160_get_if_mode(0x02)
- * @note
- * 2. And also confirm the secondary-interface power mode
- * is not in the SUSPEND mode.
- * by using the function bmi160_get_mag_pmu_status().
- * If the secondary-interface power mode is in SUSPEND mode
- * set the value of 0x19(NORMAL mode)by using the
- * bmi160_set_command_register(0x19) function.
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_bmm150_mag_compensate_xyz(
- struct bmi160_mag_xyz_s32_t *mag_comp_xyz);
- /*!
- * @brief This API used to get the compensated BMM150-X data
- * the out put of X as s32
- * Before start reading the mag compensated X data
- * make sure the following two points are addressed
- * @note
- * 1. Make sure the mag interface is enabled or not,
- * by using the bmi160_get_if_mode() function.
- * If mag interface is not enabled set the value of 0x02
- * to the function bmi160_get_if_mode(0x02)
- * @note
- * 2. And also confirm the secondary-interface power mode
- * is not in the SUSPEND mode.
- * by using the function bmi160_get_mag_pmu_status().
- * If the secondary-interface power mode is in SUSPEND mode
- * set the value of 0x19(NORMAL mode)by using the
- * bmi160_set_command_register(0x19) function.
- *
- *
- *
- * @param v_mag_data_x_s16 : The value of mag raw X data
- * @param v_data_r_u16 : The value of mag R data
- *
- * @return results of compensated X data value output as s32
- *
- */
- s32 bmi160_bmm150_mag_compensate_X(s16 v_mag_data_x_s16, u16 v_data_r_u16);
- /*!
- * @brief This API used to get the compensated BMM150-Y data
- * the out put of Y as s32
- * Before start reading the mag compensated Y data
- * make sure the following two points are addressed
- * @note
- * 1. Make sure the mag interface is enabled or not,
- * by using the bmi160_get_if_mode() function.
- * If mag interface is not enabled set the value of 0x02
- * to the function bmi160_get_if_mode(0x02)
- * @note
- * 2. And also confirm the secondary-interface power mode
- * is not in the SUSPEND mode.
- * by using the function bmi160_get_mag_pmu_status().
- * If the secondary-interface power mode is in SUSPEND mode
- * set the value of 0x19(NORMAL mode)by using the
- * bmi160_set_command_register(0x19) function.
- *
- *
- *
- * @param v_mag_data_y_s16 : The value of mag raw Y data
- * @param v_data_r_u16 : The value of mag R data
- *
- * @return results of compensated Y data value output as s32
- */
- s32 bmi160_bmm150_mag_compensate_Y(s16 v_mag_data_y_s16, u16 v_data_r_u16);
- /*!
- * @brief This API used to get the compensated BMM150-Z data
- * the out put of Z as s32
- * Before start reading the mag compensated Z data
- * make sure the following two points are addressed
- * @note
- * 1. Make sure the mag interface is enabled or not,
- * by using the bmi160_get_if_mode() function.
- * If mag interface is not enabled set the value of 0x02
- * to the function bmi160_get_if_mode(0x02)
- * @note
- * 2. And also confirm the secondary-interface power mode
- * is not in the SUSPEND mode.
- * by using the function bmi160_get_mag_pmu_status().
- * If the secondary-interface power mode is in SUSPEND mode
- * set the value of 0x19(NORMAL mode)by using the
- * bmi160_set_command_register(0x19) function.
- *
- *
- *
- * @param v_mag_data_z_s16 : The value of mag raw Z data
- * @param v_data_r_u16 : The value of mag R data
- *
- * @return results of compensated Z data value output as s32
- */
- s32 bmi160_bmm150_mag_compensate_Z(s16 v_mag_data_z_s16, u16 v_data_r_u16);
- /*!
- * @brief This API used to set the pre-set modes of bmm150
- * The pre-set mode setting is depend on data rate and xy and z repetitions
- *
- * @note
- * Before set the mag preset mode
- * make sure the following two points are addressed
- * @note
- * 1. Make sure the mag interface is enabled or not,
- * by using the bmi160_get_if_mode() function.
- * If mag interface is not enabled set the value of 0x02
- * to the function bmi160_get_if_mode(0x02)
- * @note
- * 2. And also confirm the secondary-interface power mode
- * is not in the SUSPEND mode.
- * by using the function bmi160_get_mag_pmu_status().
- * If the secondary-interface power mode is in SUSPEND mode
- * set the value of 0x19(NORMAL mode)by using the
- * bmi160_set_command_register(0x19) function.
- *
- *
- * @param v_mode_u8: The value of pre-set mode selection value
- * value | pre_set mode
- * ----------|------------
- * 1 | BMI160_MAG_PRESETMODE_LOWPOWER
- * 2 | BMI160_MAG_PRESETMODE_REGULAR
- * 3 | BMI160_MAG_PRESETMODE_HIGHACCURACY
- * 4 | BMI160_MAG_PRESETMODE_ENHANCED
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_bmm150_mag_presetmode(u8 mode);
- /*!
- * @brief This function used for set the magnetometer
- * power mode.
- * @note
- * Before set the mag power mode
- * make sure the following two points are addressed
- * @note
- * 1. Make sure the mag interface is enabled or not,
- * by using the bmi160_get_if_mode() function.
- * If mag interface is not enabled set the value of 0x02
- * to the function bmi160_get_if_mode(0x02)
- * @note
- * 2. And also confirm the secondary-interface power mode
- * is not in the SUSPEND mode.
- * by using the function bmi160_get_mag_pmu_status().
- * If the secondary-interface power mode is in SUSPEND mode
- * set the value of 0x19(NORMAL mode)by using the
- * bmi160_set_command_register(0x19) function.
- *
- * @param v_mag_pow_mode_u8 : The value of mag power mode
- * value | mode
- * ----------|------------
- * 0 | FORCE_MODE
- * 1 | SUSPEND_MODE
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_bmm150_mag_set_power_mode(u8 mag_pow_mode);
- /*!
- * @brief This function used for set the magnetometer
- * power mode.
- * @note
- * Before set the mag power mode
- * make sure the following two point is addressed
- * Make sure the mag interface is enabled or not,
- * by using the bmi160_get_if_mode() function.
- * If mag interface is not enabled set the value of 0x02
- * to the function bmi160_get_if_mode(0x02)
- *
- * @param v_mag_sec_if_pow_mode_u8 : The value of mag power mode
- * value | mode
- * ----------|------------
- * 0 | BMI160_MAG_FORCE_MODE
- * 1 | BMI160_MAG_SUSPEND_MODE
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_bmm150_mag_and_secondary_if_power_mode(
- u8 v_mag_sec_if_pow_mode_u8);
- /***************************************************/
- /**\name FUNCTIONS FOR AKM09911 */
- /***************************************************/
- /*!
- * Description: This function used for initialize the AKM09911 sensor
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_bst_akm_mag_interface_init(void);
- /*!
- * @brief This function used for read the sensitivity data of
- * AKM09911
- *
- * @note Before reading the mag sensitivity values
- * make sure the following two points are addressed
- * @note 1. Make sure the mag interface is enabled or not,
- * by using the bmi160_get_if_mode() function.
- * If mag interface is not enabled set the value of 0x02
- * to the function bmi160_get_if_mode(0x02)
- * @note 2. And also confirm the secondary-interface power mode
- * is not in the SUSPEND mode.
- * by using the function bmi160_get_mag_pmu_status().
- * If the secondary-interface power mode is in SUSPEND mode
- * set the value of 0x19(NORMAL mode)by using the
- * bmi160_set_command_register(0x19) function.
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_read_bst_akm_sensitivity_data(void);
- /*!
- * @brief This API used to get the compensated X data
- * of AKM09911 the out put of X as s16
- * @note Before start reading the mag compensated X data
- * make sure the following two points are addressed
- * @note 1. Make sure the mag interface is enabled or not,
- * by using the bmi160_get_if_mode() function.
- * If mag interface is not enabled set the value of 0x02
- * to the function bmi160_get_if_mode(0x02)
- * @note 2. And also confirm the secondary-interface power mode
- * is not in the SUSPEND mode.
- * by using the function bmi160_get_mag_pmu_status().
- * If the secondary-interface power mode is in SUSPEND mode
- * set the value of 0x19(NORMAL mode)by using the
- * bmi160_set_command_register(0x19) function.
- *
- *
- * @param v_bst_akm_x_s16 : The value of X data
- *
- * @return results of compensated X data value output as s16
- *
- */
- s16 bmi160_bst_akm_compensate_X(s16 v_bst_akm_x_s16);
- /*!
- * @brief This API used to get the compensated Y data
- * of AKM09911 the out put of Y as s16
- * @note Before start reading the mag compensated Y data
- * make sure the following two points are addressed
- * @note 1. Make sure the mag interface is enabled or not,
- * by using the bmi160_get_if_mode() function.
- * If mag interface is not enabled set the value of 0x02
- * to the function bmi160_get_if_mode(0x02)
- * @note 2. And also confirm the secondary-interface power mode
- * is not in the SUSPEND mode.
- * by using the function bmi160_get_mag_pmu_status().
- * If the secondary-interface power mode is in SUSPEND mode
- * set the value of 0x19(NORMAL mode)by using the
- * bmi160_set_command_register(0x19) function.
- *
- *
- * @param v_bst_akm_y_s16 : The value of Y data
- *
- * @return results of compensated Y data value output as s16
- *
- */
- s16 bmi160_bst_akm_compensate_Y(s16 v_bst_akm_y_s16);
- /*!
- * @brief This API used to get the compensated Z data
- * of AKM09911 the out put of Z as s16
- * @note Before start reading the mag compensated Z data
- * make sure the following two points are addressed
- * @note 1. Make sure the mag interface is enabled or not,
- * by using the bmi160_get_if_mode() function.
- * If mag interface is not enabled set the value of 0x02
- * to the function bmi160_get_if_mode(0x02)
- * @note 2. And also confirm the secondary-interface power mode
- * is not in the SUSPEND mode.
- * by using the function bmi160_get_mag_pmu_status().
- * If the secondary-interface power mode is in SUSPEND mode
- * set the value of 0x19(NORMAL mode)by using the
- * bmi160_set_command_register(0x19) function.
- *
- *
- * @param v_bst_akm_z_s16 : The value of Z data
- *
- * @return results of compensated Z data value output as s16
- *
- */
- s16 bmi160_bst_akm_compensate_Z(s16 v_bst_akm_z_s16);
- /*!
- * @brief This function used for read the compensated value of
- * AKM09911
- * @note Before start reading the mag compensated v_data_u8's
- * make sure the following two points are addressed
- * @note 1. Make sure the mag interface is enabled or not,
- * by using the bmi160_get_if_mode() function.
- * If mag interface is not enabled set the value of 0x02
- * to the function bmi160_get_if_mode(0x02)
- * @note 2. And also confirm the secondary-interface power mode
- * is not in the SUSPEND mode.
- * by using the function bmi160_get_mag_pmu_status().
- * If the secondary-interface power mode is in SUSPEND mode
- * set the value of 0x19(NORMAL mode)by using the
- * bmi160_set_command_register(0x19) function.
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_bst_akm_compensate_xyz(
- struct bmi160_bst_akm_xyz_t *bst_akm_xyz);
- /*!
- * @brief This function used for set the AKM09911
- * power mode.
- * @note Before set the AKM power mode
- * make sure the following two points are addressed
- * @note 1. Make sure the mag interface is enabled or not,
- * by using the bmi160_get_if_mode() function.
- * If mag interface is not enabled set the value of 0x02
- * to the function bmi160_get_if_mode(0x02)
- * @note 2. And also confirm the secondary-interface power mode
- * is not in the SUSPEND mode.
- * by using the function bmi160_get_mag_pmu_status().
- * If the secondary-interface power mode is in SUSPEND mode
- * set the value of 0x19(NORMAL mode)by using the
- * bmi160_set_command_register(0x19) function.
- *
- * @param v_akm_pow_mode_u8 : The value of akm power mode
- * value | Description
- * ---------|--------------------
- * 0 | AKM_POWER_DOWN_MODE
- * 1 | AKM_SINGLE_MEAS_MODE
- * 2 | FUSE_ROM_MODE
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_bst_akm_set_powermode(u8 v_akm_pow_mode_u8);
- /*!
- * @brief This function used for set the magnetometer
- * power mode.
- * @note Before set the mag power mode
- * make sure the following two point is addressed
- * Make sure the mag interface is enabled or not,
- * by using the bmi160_get_if_mode() function.
- * If mag interface is not enabled set the value of 0x02
- * to the function bmi160_get_if_mode(0x02)
- *
- * @param v_mag_sec_if_pow_mode_u8 : The value of secondary if power mode
- * value | Description
- * ---------|--------------------
- * 0 | BMI160_MAG_FORCE_MODE
- * 1 | BMI160_MAG_SUSPEND_MODE
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_set_bst_akm_and_secondary_if_powermode(
- u8 v_mag_sec_if_pow_mode_u8);
- /***************************************************/
- /**\name FUNCTIONS FOR YAMAH-YAS532 */
- /***************************************************/
- /*!
- * @brief This function used for read the YAMAH-YAS532 init
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_bst_yamaha_yas532_mag_interface_init(
- void);
- /*!
- * @brief This function used to set the YAS532 initial values
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_bst_yas532_set_initial_values(void);
- /*!
- * @brief This function used for YAS532 offset correction
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_bst_yas532_magnetic_measure_set_offset(
- void);
- /*!
- * @brief This function used for read the
- * YAMAHA YAS532 calibration data
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_bst_yamaha_yas532_calib_values(void);
- /*!
- * @brief This function used for calculate the
- * YAS532 read the linear data
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_bst_yas532_xy1y2_to_linear(
- u16 *v_xy1y2_u16, s32 *xy1y2_linear);
- /*!
- * @brief This function used for read the YAS532 sensor data
- * @param v_acquisition_command_u8: used to set the data acquisition
- * acquisition_command | operation
- * ---------------------|-------------------------
- * 0x17 | turn on the acquisition coil
- * - | set direction of the coil
- * _ | (x and y as minus(-))
- * _ | Deferred acquisition mode
- * 0x07 | turn on the acquisition coil
- * _ | set direction of the coil
- * _ | (x and y as minus(-))
- * _ | Normal acquisition mode
- * 0x11 | turn OFF the acquisition coil
- * _ | set direction of the coil
- * _ | (x and y as plus(+))
- * _ | Deferred acquisition mode
- * 0x01 | turn OFF the acquisition coil
- * _ | set direction of the coil
- * _ | (x and y as plus(+))
- * _ | Normal acquisition mode
- *
- * @param v_busy_u8 : used to get the busy flay for sensor data read
- * @param v_temp_u16 : used to get the temperature data
- * @param v_xy1y2_u16 : used to get the sensor xy1y2 data
- * @param v_overflow_u8 : used to get the overflow data
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_bst_yas532_normal_measurement_data(
- u8 v_acquisition_command_u8, u8 *v_busy_u8,
- u16 *v_temp_u16, u16 *v_xy1y2_u16, u8 *v_overflow_u8);
- /*!
- * @brief This function used for YAS532 sensor data
- * @param v_acquisition_command_u8 : the value of CMDR
- * acquisition_command | operation
- * ---------------------|-------------------------
- * 0x17 | turn on the acquisition coil
- * - | set direction of the coil
- * _ | (x and y as minus(-))
- * _ | Deferred acquisition mode
- * 0x07 | turn on the acquisition coil
- * _ | set direction of the coil
- * _ | (x and y as minus(-))
- * _ | Normal acquisition mode
- * 0x11 | turn OFF the acquisition coil
- * _ | set direction of the coil
- * _ | (x and y as plus(+))
- * _ | Deferred acquisition mode
- * 0x01 | turn OFF the acquisition coil
- * _ | set direction of the coil
- * _ | (x and y as plus(+))
- * _ | Normal acquisition mode
- *
- * @param xyz_data : the vector xyz output
- * @param v_overflow_s8 : the value of overflow
- * @param v_temp_correction_u8 : the value of temperate correction enable
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_bst_yas532_measurement_xyz_data(
- struct yas532_vector *xyz_data, u8 *v_overflow_s8, u8 v_temp_correction_u8,
- u8 v_acquisition_command_u8);
- /*!
- * @brief This function used for YAS532 write data acquisition
- * command register write
- * @param v_command_reg_data_u8 : the value of data acquisition
- * acquisition_command | operation
- * ---------------------|-------------------------
- * 0x17 | turn on the acquisition coil
- * - | set direction of the coil
- * _ | (x and y as minus(-))
- * _ | Deferred acquisition mode
- * 0x07 | turn on the acquisition coil
- * _ | set direction of the coil
- * _ | (x and y as minus(-))
- * _ | Normal acquisition mode
- * 0x11 | turn OFF the acquisition coil
- * _ | set direction of the coil
- * _ | (x and y as plus(+))
- * _ | Deferred acquisition mode
- * 0x01 | turn OFF the acquisition coil
- * _ | set direction of the coil
- * _ | (x and y as plus(+))
- * _ | Normal acquisition mode
- *
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_bst_yas532_acquisition_command_register(
- u8 v_command_reg_data_u8);
- /*!
- * @brief This function used write offset of YAS532
- *
- * @param p_offset_s8 : The value of offset to write
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_bst_yas532_set_offset(
- const s8 *p_offset_s8);
- /***************************************************/
- /**\name FUNCTIONS FOR FIFO DATA READ */
- /***************************************************/
- /*!
- * @brief This function used for reading the
- * fifo data of header less mode
- *
- * @param v_fifo_length_u32 : The value of FIFO length
- *
- *
- * @note Configure the below functions for FIFO header less mode
- * @note 1. bmi160_set_fifo_down_gyro()
- * @note 2. bmi160_set_gyro_fifo_filter_data()
- * @note 3. bmi160_set_fifo_down_accel()
- * @note 4. bmi160_set_accel_fifo_filter_dat()
- * @note 5. bmi160_set_fifo_mag_enable()
- * @note 6. bmi160_set_fifo_accel_enable()
- * @note 7. bmi160_set_fifo_gyro_enable()
- * @note For interrupt configuration
- * @note 1. bmi160_set_intr_fifo_full()
- * @note 2. bmi160_set_intr_fifo_wm()
- * @note 3. bmi160_set_fifo_tag_intr2_enable()
- * @note 4. bmi160_set_fifo_tag_intr1_enable()
- *
- *
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_read_fifo_headerless_mode(
- u32 v_fifo_length_u32);
- /*!
- * @brief This function used for reading the
- * fifo data of header mode
- *
- * @param v_fifo_length_u32 : The value of FIFO length
- *
- * @note Configure the below functions for FIFO header mode
- * @note 1. bmi160_set_fifo_down_gyro()
- * @note 2. bmi160_set_gyro_fifo_filter_data()
- * @note 3. bmi160_set_fifo_down_accel()
- * @note 4. bmi160_set_accel_fifo_filter_dat()
- * @note 5. bmi160_set_fifo_mag_enable()
- * @note 6. bmi160_set_fifo_accel_enable()
- * @note 7. bmi160_set_fifo_gyro_enable()
- * @note 8. bmi160_set_fifo_header_enable()
- * @note For interrupt configuration
- * @note 1. bmi160_set_intr_fifo_full()
- * @note 2. bmi160_set_intr_fifo_wm()
- * @note 3. bmi160_set_fifo_tag_intr2_enable()
- * @note 4. bmi160_set_fifo_tag_intr1_enable()
- * @return results of bus communication function
- * @retval 0 -> Success
- * @retval -1 -> Error
- *
- *
- */
- BMI160_RETURN_FUNCTION_TYPE bmi160_read_fifo_header_data(u32 v_fifo_length_u32);
- //add by lwy
- BMI160_RETURN_FUNCTION_TYPE bmi160_read_accel_gyro_fifo_data(u8 *r_v_accel_index_u8, struct bmi160_accel_t **r_accel_fifo, u8 *r_v_gyro_index_u8,struct bmi160_gyro_t **r_gyro_fifo);
- BMI160_RETURN_FUNCTION_TYPE bmi160_fifo_data_get_set_integration(u8 *v_fifo_data_u8, u32 *fifo_len_u32);
- /*!
- * @brief This function used for reading
- * bmi160_t structure
- *
- * @return the reference and values of bmi160_t
- *
- *
- */
- struct bmi160_t *bmi160_get_ptr(void);
- #endif
|