| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112 |
- commit 24788033c89e3148989e8d99d7e417edde0ae477
- Author: karim <karim.rabhi-ext@st.com>
- Date: Mon Apr 8 11:29:52 2024 +0100
- Release v1.7.0
- diff --git a/LICENSE.md b/LICENSE.md
- index 9226612ae..e349e2328 100644
- --- a/LICENSE.md
- +++ b/LICENSE.md
- @@ -1,4 +1,4 @@
- -Copyright 2021 STMicroelectronics.
- +Copyright 2019 STMicroelectronics.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without modification,
- diff --git a/Release_Notes.html b/Release_Notes.html
- index c52b7d0dd..4da65558c 100644
- --- a/Release_Notes.html
- +++ b/Release_Notes.html
- @@ -1,236 +1,257 @@
- -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- -<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
- -
- -<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- -<link rel="File-List" href="Library_files/filelist.xml">
- -<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for LSM6DSO component</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
- -
- -
- -<style>
- -<!--
- -/* Style Definitions */
- -p.MsoNormal, li.MsoNormal, div.MsoNormal
- -{mso-style-parent:"";
- -margin:0in;
- -margin-bottom:.0001pt;
- -mso-pagination:widow-orphan;
- -font-size:12.0pt;
- -font-family:"Times New Roman";
- -mso-fareast-font-family:"Times New Roman";}
- -h2
- -{mso-style-next:Normal;
- -margin-top:12.0pt;
- -margin-right:0in;
- -margin-bottom:3.0pt;
- -margin-left:0in;
- -mso-pagination:widow-orphan;
- -page-break-after:avoid;
- -mso-outline-level:2;
- -font-size:14.0pt;
- -font-family:Arial;
- -font-weight:bold;
- -font-style:italic;}
- -a:link, span.MsoHyperlink
- -{color:blue;
- -text-decoration:underline;
- -text-underline:single;}
- -a:visited, span.MsoHyperlinkFollowed
- -{color:blue;
- -text-decoration:underline;
- -text-underline:single;}
- -p
- -{mso-margin-top-alt:auto;
- -margin-right:0in;
- -mso-margin-bottom-alt:auto;
- -margin-left:0in;
- -mso-pagination:widow-orphan;
- -font-size:12.0pt;
- -font-family:"Times New Roman";
- -mso-fareast-font-family:"Times New Roman";}
- -@page Section1
- -{size:8.5in 11.0in;
- -margin:1.0in 1.25in 1.0in 1.25in;
- -mso-header-margin:.5in;
- -mso-footer-margin:.5in;
- -mso-paper-source:0;}
- -div.Section1
- -{page:Section1;}
- --->
- -</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
- -<meta content="MCD Application Team" name="author"></head><body link="blue" vlink="blue">
- -<div class="Section1">
- -<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
- -</o:p></span></p>
- -<div align="center">
- -<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
- -<tbody>
- -<tr>
- -<td style="padding: 0cm;" valign="top">
- -<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
- -<tbody>
- -<tr>
- -<td style="vertical-align: top;">
- -<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
- -</td>
- -</tr>
- -<tr style="">
- -<td style="padding: 1.5pt;">
- -<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release Notes for LSM6DSO component</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
- -<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
- -2021 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
- -<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
- -</td>
- -</tr>
- -</tbody>
- -</table>
- -<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
- -<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" width="900">
- -<tbody>
- -<tr style="">
- -<td style="padding: 0cm;" valign="top">
- -<span style="font-family: "Times New Roman";">
- -</span>
- -<h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -
- -<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.5.0
- -/ 03-March-2021</span></h3>
- -<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
- -Changes<o:p></o:p></span></u></b></p>
- -<ul style="list-style-type: square;">
- -<li><span style="font-size: 10pt; font-family: Verdana;">Synchronize PID with latest version on ST GitHub</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
- +<!DOCTYPE html>
- +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
- +<head>
- + <meta charset="utf-8" />
- + <meta name="generator" content="pandoc" />
- + <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
- + <title>Release Notes for LSM6DSO Component</title>
- + <style>
- + code{white-space: pre-wrap;}
- + span.smallcaps{font-variant: small-caps;}
- + div.columns{display: flex; gap: min(4vw, 1.5em);}
- + div.column{flex: auto; overflow-x: auto;}
- + div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
- + ul.task-list{list-style: none;}
- + ul.task-list li input[type="checkbox"] {
- + width: 0.8em;
- + margin: 0 0.8em 0.2em -1.6em;
- + vertical-align: middle;
- + }
- + .display.math{display: block; text-align: center; margin: 0.5rem auto;}
- + </style>
- + <link rel="stylesheet" href="_htmresc/mini-st_2020.css" />
- + <link rel="icon" type="image/x-icon" href="_htmresc/favicon.png" />
- + <!--[if lt IE 9]>
- + <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
- + <![endif]-->
- +</head>
- +<body>
- +<div class="row">
- +<div class="col-sm-12 col-lg-4">
- +<center>
- +<h1 id="release-notes-for-lsm6dso-component-driver">Release Notes for
- +LSM6DSO Component Driver</h1>
- +<p>Copyright © 2022 STMicroelectronics<br />
- +</p>
- +<a href="https://www.st.com" class="logo"><img
- +src="_htmresc/st_logo_2020.png" alt="ST logo" /></a>
- +</center>
- +<h1 id="purpose">Purpose</h1>
- +<p>This directory contains the LSM6DSO component drivers.</p>
- +</div>
- +<section id="update-history" class="col-sm-12 col-lg-8">
- +<h1>Update history</h1>
- +<div class="collapse">
- +<input type="checkbox" id="collapse-section15" checked aria-hidden="true">
- +<label for="collapse-section15" aria-hidden="true">V1.7.0 /
- +31-October-2022</label>
- +<div>
- +<h2 id="main-changes">Main changes</h2>
- +<h3 id="maintenance-release">Maintenance release</h3>
- +<ul>
- +<li>Synchronized PID with currently latest version on ST GitHub</li>
- +<li>Added Delay function</li>
- +</ul>
- +<h2 id="section"></h2>
- +</div>
- +</div>
- +<div class="collapse">
- +<input type="checkbox" id="collapse-section14" aria-hidden="true">
- +<label for="collapse-section14" aria-hidden="true">V1.6.0 /
- +23-March-2022</label>
- +<div>
- +<h2 id="main-changes-1">Main changes</h2>
- +<h3 id="maintenance-release-1">Maintenance release</h3>
- +<ul>
- +<li>Synchronized PID with currently latest version on ST GitHub</li>
- +</ul>
- +<h2 id="section-1"></h2>
- +</div>
- +</div>
- +<div class="collapse">
- +<input type="checkbox" id="collapse-section13" aria-hidden="true">
- +<label for="collapse-section13" aria-hidden="true">V1.5.4 /
- +09-February-2022</label>
- +<div>
- +<h2 id="main-changes-2">Main changes</h2>
- +<h3 id="patch-release">Patch release</h3>
- +<ul>
- +<li>Update License to new format</li>
- +</ul>
- +<h2 id="section-2"></h2>
- +</div>
- +</div>
- +<div class="collapse">
- +<input type="checkbox" id="collapse-section12" aria-hidden="true">
- +<label for="collapse-section12" aria-hidden="true">V1.5.3 /
- +17-November-2021</label>
- +<div>
- +<h2 id="main-changes-3">Main changes</h2>
- +<h3 id="patch-release-1">Patch release</h3>
- +<ul>
- +<li>Fix C++ compiler errors</li>
- </ul>
- -
- -<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.4.0
- -/ 28-October-2020</span></h3>
- -<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
- -Changes<o:p></o:p></span></u></b></p>
- -<ul style="list-style-type: square;">
- -<li><span style="font-size: 10pt; font-family: Verdana;">Update PID</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
- +<h2 id="section-3"></h2>
- +</div>
- +</div>
- +<div class="collapse">
- +<input type="checkbox" id="collapse-section11" aria-hidden="true">
- +<label for="collapse-section11" aria-hidden="true">V1.5.2 /
- +21-April-2021</label>
- +<div>
- +<h2 id="main-changes-4">Main changes</h2>
- +<h3 id="patch-release-2">Patch release</h3>
- +<ul>
- +<li>Update Release Notes to new format</li>
- +</ul>
- +<h2 id="section-4"></h2>
- +</div>
- +</div>
- +<div class="collapse">
- +<input type="checkbox" id="collapse-section10" aria-hidden="true">
- +<label for="collapse-section10" aria-hidden="true">V1.5.1 /
- +15-April-2021</label>
- +<div>
- +<h2 id="main-changes-5">Main changes</h2>
- +<h3 id="patch-release-3">Patch release</h3>
- +<ul>
- +<li>Fix issues on INT2 events</li>
- +</ul>
- +<h2 id="section-5"></h2>
- +</div>
- +</div>
- +<div class="collapse">
- +<input type="checkbox" id="collapse-section9" aria-hidden="true">
- +<label for="collapse-section9" aria-hidden="true">V1.5.0 /
- +03-March-2021</label>
- +<div>
- +<h2 id="main-changes-6">Main changes</h2>
- +<h3 id="maintenance-release-2">Maintenance release</h3>
- +<ul>
- +<li>Synchronize PID with latest version on ST GitHub</li>
- +</ul>
- +<h2 id="section-6"></h2>
- +</div>
- +</div>
- +<div class="collapse">
- +<input type="checkbox" id="collapse-section8" aria-hidden="true">
- +<label for="collapse-section8" aria-hidden="true">V1.4.0 /
- +28-October-2020</label>
- +<div>
- +<h2 id="main-changes-7">Main changes</h2>
- +<h3 id="maintenance-release-3">Maintenance release</h3>
- +<ul>
- +<li>Update PID</li>
- </ul>
- -
- -
- -<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.3.0
- -/ 3-March-2020</span></h3>
- -<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
- -Changes<o:p></o:p></span></u></b></p>
- -<ul style="list-style-type: square;">
- -<li><span style="font-size: 10pt; font-family: Verdana;">Update PID</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
- -<li><span style="font-size: 10pt; font-family: Verdana;">Add MISRA 2012 compliancy</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
- +<h2 id="section-7"></h2>
- +</div>
- +</div>
- +<div class="collapse">
- +<input type="checkbox" id="collapse-section7" aria-hidden="true">
- +<label for="collapse-section7" aria-hidden="true">V1.3.0 /
- +03-March-2020</label>
- +<div>
- +<h2 id="main-changes-8">Main changes</h2>
- +<h3 id="maintenance-release-4">Maintenance release</h3>
- +<ul>
- +<li>Update PID</li>
- +<li>Add MISRA 2012 compliancy</li>
- </ul>
- -
- -<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.2.3
- -/ 10-February-2020</span></h3>
- -<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
- -Changes<o:p></o:p></span></u></b></p>
- -<ul style="list-style-type: square;">
- -<li><span style="font-size: 10pt; font-family: Verdana;">Align ODR values like PID</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
- +<h2 id="section-8"></h2>
- +</div>
- +</div>
- +<div class="collapse">
- +<input type="checkbox" id="collapse-section6" aria-hidden="true">
- +<label for="collapse-section6" aria-hidden="true">V1.2.3 /
- +10-February-2020</label>
- +<div>
- +<h2 id="main-changes-9">Main changes</h2>
- +<h3 id="patch-release-4">Patch release</h3>
- +<ul>
- +<li>Align ODR values like PID</li>
- </ul>
- -
- -<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.2.2
- -/ 11-October-2019</span></h3>
- -<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
- -Changes<o:p></o:p></span></u></b></p>
- -<ul style="list-style-type: square;">
- -<li><span style="font-size: 10pt; font-family: Verdana;">Rename context type to universal stmdev_ctx_t</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
- -<li><span style="font-size: 10pt; font-family: Verdana;">Move unions from PID to HLD</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
- +<h2 id="section-9"></h2>
- +</div>
- +</div>
- +<div class="collapse">
- +<input type="checkbox" id="collapse-section5" aria-hidden="true">
- +<label for="collapse-section5" aria-hidden="true">V1.2.2 /
- +11-October-2019</label>
- +<div>
- +<h2 id="main-changes-10">Main changes</h2>
- +<h3 id="patch-release-5">Patch release</h3>
- +<ul>
- +<li>Rename context type to universal stmdev_ctx_t</li>
- +<li>Move unions from PID to HLD</li>
- </ul>
- -
- -<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.2.1
- -/ 23-July-2019</span></h3>
- -<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
- -Changes<o:p></o:p></span></u></b></p>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<ul style="list-style-type: square;">
- -<li><span style="font-size: 10pt; font-family: Verdana;">Update license</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
- +<h2 id="section-10"></h2>
- +</div>
- +</div>
- +<div class="collapse">
- +<input type="checkbox" id="collapse-section4" aria-hidden="true">
- +<label for="collapse-section4" aria-hidden="true">V1.2.1 /
- +23-July-2019</label>
- +<div>
- +<h2 id="main-changes-11">Main changes</h2>
- +<h3 id="patch-release-6">Patch release</h3>
- +<ul>
- +<li>Update license</li>
- </ul>
- -
- -<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.2.0
- -/ 28-May-2019</span></h3>
- -<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
- -Changes<o:p></o:p></span></u></b></p>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<ul style="list-style-type: square;">
- -<li><span style="font-size: 10pt; font-family: Verdana;">PID update from ST GitHub</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
- -<li><span style="font-size: 10pt; font-family: Verdana;">Add new APIs for VibrationMonitoring to HLD</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
- -<li><span style="font-size: 10pt; font-family: Verdana;">HLD coding style update</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
- +<h2 id="section-11"></h2>
- +</div>
- +</div>
- +<div class="collapse">
- +<input type="checkbox" id="collapse-section3" aria-hidden="true">
- +<label for="collapse-section3" aria-hidden="true">V1.2.0 /
- +28-May-2019</label>
- +<div>
- +<h2 id="main-changes-12">Main changes</h2>
- +<h3 id="maintenance-release-5">Maintenance release</h3>
- +<ul>
- +<li>PID update from ST GitHub</li>
- +<li>Add new APIs for VibrationMonitoring to HLD</li>
- +<li>HLD coding style update</li>
- </ul>
- -
- -<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.1.0
- -/ 4-April-2019</span></h3>
- -<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
- -Changes<o:p></o:p></span></u></b></p>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<ul style="list-style-type: square;">
- -<li><span style="font-size: 10pt; font-family: Verdana;">Add new APIs</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
- +<h2 id="section-12"></h2>
- +</div>
- +</div>
- +<div class="collapse">
- +<input type="checkbox" id="collapse-section2" aria-hidden="true">
- +<label for="collapse-section2" aria-hidden="true">V1.1.0 /
- +04-April-2019</label>
- +<div>
- +<h2 id="main-changes-13">Main changes</h2>
- +<h3 id="maintenance-release-6">Maintenance release</h3>
- +<ul>
- +<li>Add new APIs</li>
- </ul>
- -
- -<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0
- -/ 31-January-2019</span></h3>
- -<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
- -Changes<o:p></o:p></span></u></b></p>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<span style="font-size: 10pt; font-family: Verdana;"></span>
- -<ul style="list-style-type: square;">
- -<li><span style="font-size: 10pt; font-family: Verdana;">First
- -official release</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
- +<h2 id="section-13"></h2>
- +</div>
- +</div>
- +<div class="collapse">
- +<input type="checkbox" id="collapse-section1" aria-hidden="true">
- +<label for="collapse-section1" aria-hidden="true">V1.0.0 /
- +31-January-2019</label>
- +<div>
- +<h2 id="main-changes-14">Main changes</h2>
- +<h3 id="first-release">First release</h3>
- +<ul>
- +<li>First official release</li>
- </ul>
- -
- -<span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span>
- -<h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br>
- -</h2>
- -
- -
- -<div style="text-align: justify;">
- -<div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
- -<p>Licensed by ST under BSD 3-Clause license (the "License"). You may not use this package except in compliance with the License. You may obtain a copy of the License at:</p>
- -<p><a href="https://opensource.org/licenses/BSD-3-Clause">https://opensource.org/licenses/BSD-3-Clause</a></p>
- -</div>
- -<span style="font-family: "Verdana","sans-serif";"></span></div>
- -
- -
- -
- -</td>
- -</tr>
- -</tbody>
- -</table>
- -<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
- -</td>
- -</tr>
- -</tbody>
- -</table>
- -</div>
- -<p class="MsoNormal"><o:p> </o:p></p>
- -</div>
- -</body></html>
- \ No newline at end of file
- +<h2 id="section-14"></h2>
- +</div>
- +</div>
- +</section>
- +</div>
- +<footer class="sticky">
- +<div class="columns">
- +<div class="column" style="width:95%;">
- +<p>For complete documentation on LSM6DSO, visit: <a
- +href="https://www.st.com/content/st_com/en/products/mems-and-sensors/inemo-inertial-modules/lsm6dso.html">LSM6DSO</a></p>
- +</div><div class="column" style="width:5%;">
- +<p><abbr title="Based on template cx566953 version 2.0">Info</abbr></p>
- +</div>
- +</div>
- +</footer>
- +</body>
- +</html>
- diff --git a/_htmresc/favicon.png b/_htmresc/favicon.png
- new file mode 100644
- index 000000000..06713eec4
- Binary files /dev/null and b/_htmresc/favicon.png differ
- diff --git a/_htmresc/mini-st_2020.css b/_htmresc/mini-st_2020.css
- new file mode 100644
- index 000000000..986f4d420
- --- /dev/null
- +++ b/_htmresc/mini-st_2020.css
- @@ -0,0 +1,1711 @@
- +@charset "UTF-8";
- +/*
- + Flavor name: Custom (mini-custom)
- + Generated online - https://minicss.org/flavors
- + mini.css version: v3.0.1
- +*/
- +/*
- + Browsers resets and base typography.
- +*/
- +/* Core module CSS variable definitions */
- +:root {
- + --fore-color: #03234b;
- + --secondary-fore-color: #03234b;
- + --back-color: #ffffff;
- + --secondary-back-color: #ffffff;
- + --blockquote-color: #e6007e;
- + --pre-color: #e6007e;
- + --border-color: #3cb4e6;
- + --secondary-border-color: #3cb4e6;
- + --heading-ratio: 1.2;
- + --universal-margin: 0.5rem;
- + --universal-padding: 0.25rem;
- + --universal-border-radius: 0.075rem;
- + --background-margin: 1.5%;
- + --a-link-color: #3cb4e6;
- + --a-visited-color: #8c0078; }
- +
- +html {
- + font-size: 13.5px; }
- +
- +a, b, del, em, i, ins, q, span, strong, u {
- + font-size: 1em; }
- +
- +html, * {
- + font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif;
- + line-height: 1.25;
- + -webkit-text-size-adjust: 100%; }
- +
- +* {
- + font-size: 1rem; }
- +
- +body {
- + margin: 0;
- + color: var(--fore-color);
- + @background: var(--back-color);
- + background: var(--back-color) linear-gradient(#ffd200, #ffd200) repeat-y left top;
- + background-size: var(--background-margin);
- + }
- +
- +details {
- + display: block; }
- +
- +summary {
- + display: list-item; }
- +
- +abbr[title] {
- + border-bottom: none;
- + text-decoration: underline dotted; }
- +
- +input {
- + overflow: visible; }
- +
- +img {
- + max-width: 100%;
- + height: auto; }
- +
- +h1, h2, h3, h4, h5, h6 {
- + line-height: 1.25;
- + margin: calc(1.5 * var(--universal-margin)) var(--universal-margin);
- + font-weight: 400; }
- + h1 small, h2 small, h3 small, h4 small, h5 small, h6 small {
- + color: var(--secondary-fore-color);
- + display: block;
- + margin-top: -0.25rem; }
- +
- +h1 {
- + font-size: calc(1rem * var(--heading-ratio) * var(--heading-ratio) * var(--heading-ratio)); }
- +
- +h2 {
- + font-size: calc(1rem * var(--heading-ratio) * var(--heading-ratio) );
- + border-style: none none solid none ;
- + border-width: thin;
- + border-color: var(--border-color); }
- +h3 {
- + font-size: calc(1rem * var(--heading-ratio) ); }
- +
- +h4 {
- + font-size: calc(1rem * var(--heading-ratio)); }
- +
- +h5 {
- + font-size: 1rem; }
- +
- +h6 {
- + font-size: calc(1rem / var(--heading-ratio)); }
- +
- +p {
- + margin: var(--universal-margin); }
- +
- +ol, ul {
- + margin: var(--universal-margin);
- + padding-left: calc(3 * var(--universal-margin)); }
- +
- +b, strong {
- + font-weight: 700; }
- +
- +hr {
- + box-sizing: content-box;
- + border: 0;
- + line-height: 1.25em;
- + margin: var(--universal-margin);
- + height: 0.0714285714rem;
- + background: linear-gradient(to right, transparent, var(--border-color) 20%, var(--border-color) 80%, transparent); }
- +
- +blockquote {
- + display: block;
- + position: relative;
- + font-style: italic;
- + color: var(--secondary-fore-color);
- + margin: var(--universal-margin);
- + padding: calc(3 * var(--universal-padding));
- + border: 0.0714285714rem solid var(--secondary-border-color);
- + border-left: 0.3rem solid var(--blockquote-color);
- + border-radius: 0 var(--universal-border-radius) var(--universal-border-radius) 0; }
- + blockquote:before {
- + position: absolute;
- + top: calc(0rem - var(--universal-padding));
- + left: 0;
- + font-family: sans-serif;
- + font-size: 2rem;
- + font-weight: 800;
- + content: "\201c";
- + color: var(--blockquote-color); }
- + blockquote[cite]:after {
- + font-style: normal;
- + font-size: 0.75em;
- + font-weight: 700;
- + content: "\a— " attr(cite);
- + white-space: pre; }
- +
- +code, kbd, pre, samp {
- + font-family: Menlo, Consolas, monospace;
- + font-size: 0.85em; }
- +
- +code {
- + background: var(--secondary-back-color);
- + border-radius: var(--universal-border-radius);
- + padding: calc(var(--universal-padding) / 4) calc(var(--universal-padding) / 2); }
- +
- +kbd {
- + background: var(--fore-color);
- + color: var(--back-color);
- + border-radius: var(--universal-border-radius);
- + padding: calc(var(--universal-padding) / 4) calc(var(--universal-padding) / 2); }
- +
- +pre {
- + overflow: auto;
- + background: var(--secondary-back-color);
- + padding: calc(1.5 * var(--universal-padding));
- + margin: var(--universal-margin);
- + border: 0.0714285714rem solid var(--secondary-border-color);
- + border-left: 0.2857142857rem solid var(--pre-color);
- + border-radius: 0 var(--universal-border-radius) var(--universal-border-radius) 0; }
- +
- +sup, sub, code, kbd {
- + line-height: 0;
- + position: relative;
- + vertical-align: baseline; }
- +
- +small, sup, sub, figcaption {
- + font-size: 0.75em; }
- +
- +sup {
- + top: -0.5em; }
- +
- +sub {
- + bottom: -0.25em; }
- +
- +figure {
- + margin: var(--universal-margin); }
- +
- +figcaption {
- + color: var(--secondary-fore-color); }
- +
- +a {
- + text-decoration: none; }
- + a:link {
- + color: var(--a-link-color); }
- + a:visited {
- + color: var(--a-visited-color); }
- + a:hover, a:focus {
- + text-decoration: underline; }
- +
- +/*
- + Definitions for the grid system, cards and containers.
- +*/
- +.container {
- + margin: 0 auto;
- + padding: 0 calc(1.5 * var(--universal-padding)); }
- +
- +.row {
- + box-sizing: border-box;
- + display: flex;
- + flex: 0 1 auto;
- + flex-flow: row wrap;
- + margin: 0 0 0 var(--background-margin); }
- +
- +.col-sm,
- +[class^='col-sm-'],
- +[class^='col-sm-offset-'],
- +.row[class*='cols-sm-'] > * {
- + box-sizing: border-box;
- + flex: 0 0 auto;
- + padding: 0 calc(var(--universal-padding) / 2); }
- +
- +.col-sm,
- +.row.cols-sm > * {
- + max-width: 100%;
- + flex-grow: 1;
- + flex-basis: 0; }
- +
- +.col-sm-1,
- +.row.cols-sm-1 > * {
- + max-width: 8.3333333333%;
- + flex-basis: 8.3333333333%; }
- +
- +.col-sm-offset-0 {
- + margin-left: 0; }
- +
- +.col-sm-2,
- +.row.cols-sm-2 > * {
- + max-width: 16.6666666667%;
- + flex-basis: 16.6666666667%; }
- +
- +.col-sm-offset-1 {
- + margin-left: 8.3333333333%; }
- +
- +.col-sm-3,
- +.row.cols-sm-3 > * {
- + max-width: 25%;
- + flex-basis: 25%; }
- +
- +.col-sm-offset-2 {
- + margin-left: 16.6666666667%; }
- +
- +.col-sm-4,
- +.row.cols-sm-4 > * {
- + max-width: 33.3333333333%;
- + flex-basis: 33.3333333333%; }
- +
- +.col-sm-offset-3 {
- + margin-left: 25%; }
- +
- +.col-sm-5,
- +.row.cols-sm-5 > * {
- + max-width: 41.6666666667%;
- + flex-basis: 41.6666666667%; }
- +
- +.col-sm-offset-4 {
- + margin-left: 33.3333333333%; }
- +
- +.col-sm-6,
- +.row.cols-sm-6 > * {
- + max-width: 50%;
- + flex-basis: 50%; }
- +
- +.col-sm-offset-5 {
- + margin-left: 41.6666666667%; }
- +
- +.col-sm-7,
- +.row.cols-sm-7 > * {
- + max-width: 58.3333333333%;
- + flex-basis: 58.3333333333%; }
- +
- +.col-sm-offset-6 {
- + margin-left: 50%; }
- +
- +.col-sm-8,
- +.row.cols-sm-8 > * {
- + max-width: 66.6666666667%;
- + flex-basis: 66.6666666667%; }
- +
- +.col-sm-offset-7 {
- + margin-left: 58.3333333333%; }
- +
- +.col-sm-9,
- +.row.cols-sm-9 > * {
- + max-width: 75%;
- + flex-basis: 75%; }
- +
- +.col-sm-offset-8 {
- + margin-left: 66.6666666667%; }
- +
- +.col-sm-10,
- +.row.cols-sm-10 > * {
- + max-width: 83.3333333333%;
- + flex-basis: 83.3333333333%; }
- +
- +.col-sm-offset-9 {
- + margin-left: 75%; }
- +
- +.col-sm-11,
- +.row.cols-sm-11 > * {
- + max-width: 91.6666666667%;
- + flex-basis: 91.6666666667%; }
- +
- +.col-sm-offset-10 {
- + margin-left: 83.3333333333%; }
- +
- +.col-sm-12,
- +.row.cols-sm-12 > * {
- + max-width: 100%;
- + flex-basis: 100%; }
- +
- +.col-sm-offset-11 {
- + margin-left: 91.6666666667%; }
- +
- +.col-sm-normal {
- + order: initial; }
- +
- +.col-sm-first {
- + order: -999; }
- +
- +.col-sm-last {
- + order: 999; }
- +
- +@media screen and (min-width: 500px) {
- + .col-md,
- + [class^='col-md-'],
- + [class^='col-md-offset-'],
- + .row[class*='cols-md-'] > * {
- + box-sizing: border-box;
- + flex: 0 0 auto;
- + padding: 0 calc(var(--universal-padding) / 2); }
- +
- + .col-md,
- + .row.cols-md > * {
- + max-width: 100%;
- + flex-grow: 1;
- + flex-basis: 0; }
- +
- + .col-md-1,
- + .row.cols-md-1 > * {
- + max-width: 8.3333333333%;
- + flex-basis: 8.3333333333%; }
- +
- + .col-md-offset-0 {
- + margin-left: 0; }
- +
- + .col-md-2,
- + .row.cols-md-2 > * {
- + max-width: 16.6666666667%;
- + flex-basis: 16.6666666667%; }
- +
- + .col-md-offset-1 {
- + margin-left: 8.3333333333%; }
- +
- + .col-md-3,
- + .row.cols-md-3 > * {
- + max-width: 25%;
- + flex-basis: 25%; }
- +
- + .col-md-offset-2 {
- + margin-left: 16.6666666667%; }
- +
- + .col-md-4,
- + .row.cols-md-4 > * {
- + max-width: 33.3333333333%;
- + flex-basis: 33.3333333333%; }
- +
- + .col-md-offset-3 {
- + margin-left: 25%; }
- +
- + .col-md-5,
- + .row.cols-md-5 > * {
- + max-width: 41.6666666667%;
- + flex-basis: 41.6666666667%; }
- +
- + .col-md-offset-4 {
- + margin-left: 33.3333333333%; }
- +
- + .col-md-6,
- + .row.cols-md-6 > * {
- + max-width: 50%;
- + flex-basis: 50%; }
- +
- + .col-md-offset-5 {
- + margin-left: 41.6666666667%; }
- +
- + .col-md-7,
- + .row.cols-md-7 > * {
- + max-width: 58.3333333333%;
- + flex-basis: 58.3333333333%; }
- +
- + .col-md-offset-6 {
- + margin-left: 50%; }
- +
- + .col-md-8,
- + .row.cols-md-8 > * {
- + max-width: 66.6666666667%;
- + flex-basis: 66.6666666667%; }
- +
- + .col-md-offset-7 {
- + margin-left: 58.3333333333%; }
- +
- + .col-md-9,
- + .row.cols-md-9 > * {
- + max-width: 75%;
- + flex-basis: 75%; }
- +
- + .col-md-offset-8 {
- + margin-left: 66.6666666667%; }
- +
- + .col-md-10,
- + .row.cols-md-10 > * {
- + max-width: 83.3333333333%;
- + flex-basis: 83.3333333333%; }
- +
- + .col-md-offset-9 {
- + margin-left: 75%; }
- +
- + .col-md-11,
- + .row.cols-md-11 > * {
- + max-width: 91.6666666667%;
- + flex-basis: 91.6666666667%; }
- +
- + .col-md-offset-10 {
- + margin-left: 83.3333333333%; }
- +
- + .col-md-12,
- + .row.cols-md-12 > * {
- + max-width: 100%;
- + flex-basis: 100%; }
- +
- + .col-md-offset-11 {
- + margin-left: 91.6666666667%; }
- +
- + .col-md-normal {
- + order: initial; }
- +
- + .col-md-first {
- + order: -999; }
- +
- + .col-md-last {
- + order: 999; } }
- +@media screen and (min-width: 1280px) {
- + .col-lg,
- + [class^='col-lg-'],
- + [class^='col-lg-offset-'],
- + .row[class*='cols-lg-'] > * {
- + box-sizing: border-box;
- + flex: 0 0 auto;
- + padding: 0 calc(var(--universal-padding) / 2); }
- +
- + .col-lg,
- + .row.cols-lg > * {
- + max-width: 100%;
- + flex-grow: 1;
- + flex-basis: 0; }
- +
- + .col-lg-1,
- + .row.cols-lg-1 > * {
- + max-width: 8.3333333333%;
- + flex-basis: 8.3333333333%; }
- +
- + .col-lg-offset-0 {
- + margin-left: 0; }
- +
- + .col-lg-2,
- + .row.cols-lg-2 > * {
- + max-width: 16.6666666667%;
- + flex-basis: 16.6666666667%; }
- +
- + .col-lg-offset-1 {
- + margin-left: 8.3333333333%; }
- +
- + .col-lg-3,
- + .row.cols-lg-3 > * {
- + max-width: 25%;
- + flex-basis: 25%; }
- +
- + .col-lg-offset-2 {
- + margin-left: 16.6666666667%; }
- +
- + .col-lg-4,
- + .row.cols-lg-4 > * {
- + max-width: 33.3333333333%;
- + flex-basis: 33.3333333333%; }
- +
- + .col-lg-offset-3 {
- + margin-left: 25%; }
- +
- + .col-lg-5,
- + .row.cols-lg-5 > * {
- + max-width: 41.6666666667%;
- + flex-basis: 41.6666666667%; }
- +
- + .col-lg-offset-4 {
- + margin-left: 33.3333333333%; }
- +
- + .col-lg-6,
- + .row.cols-lg-6 > * {
- + max-width: 50%;
- + flex-basis: 50%; }
- +
- + .col-lg-offset-5 {
- + margin-left: 41.6666666667%; }
- +
- + .col-lg-7,
- + .row.cols-lg-7 > * {
- + max-width: 58.3333333333%;
- + flex-basis: 58.3333333333%; }
- +
- + .col-lg-offset-6 {
- + margin-left: 50%; }
- +
- + .col-lg-8,
- + .row.cols-lg-8 > * {
- + max-width: 66.6666666667%;
- + flex-basis: 66.6666666667%; }
- +
- + .col-lg-offset-7 {
- + margin-left: 58.3333333333%; }
- +
- + .col-lg-9,
- + .row.cols-lg-9 > * {
- + max-width: 75%;
- + flex-basis: 75%; }
- +
- + .col-lg-offset-8 {
- + margin-left: 66.6666666667%; }
- +
- + .col-lg-10,
- + .row.cols-lg-10 > * {
- + max-width: 83.3333333333%;
- + flex-basis: 83.3333333333%; }
- +
- + .col-lg-offset-9 {
- + margin-left: 75%; }
- +
- + .col-lg-11,
- + .row.cols-lg-11 > * {
- + max-width: 91.6666666667%;
- + flex-basis: 91.6666666667%; }
- +
- + .col-lg-offset-10 {
- + margin-left: 83.3333333333%; }
- +
- + .col-lg-12,
- + .row.cols-lg-12 > * {
- + max-width: 100%;
- + flex-basis: 100%; }
- +
- + .col-lg-offset-11 {
- + margin-left: 91.6666666667%; }
- +
- + .col-lg-normal {
- + order: initial; }
- +
- + .col-lg-first {
- + order: -999; }
- +
- + .col-lg-last {
- + order: 999; } }
- +/* Card component CSS variable definitions */
- +:root {
- + --card-back-color: #3cb4e6;
- + --card-fore-color: #03234b;
- + --card-border-color: #03234b; }
- +
- +.card {
- + display: flex;
- + flex-direction: column;
- + justify-content: space-between;
- + align-self: center;
- + position: relative;
- + width: 100%;
- + background: var(--card-back-color);
- + color: var(--card-fore-color);
- + border: 0.0714285714rem solid var(--card-border-color);
- + border-radius: var(--universal-border-radius);
- + margin: var(--universal-margin);
- + overflow: hidden; }
- + @media screen and (min-width: 320px) {
- + .card {
- + max-width: 320px; } }
- + .card > .sectione {
- + background: var(--card-back-color);
- + color: var(--card-fore-color);
- + box-sizing: border-box;
- + margin: 0;
- + border: 0;
- + border-radius: 0;
- + border-bottom: 0.0714285714rem solid var(--card-border-color);
- + padding: var(--universal-padding);
- + width: 100%; }
- + .card > .sectione.media {
- + height: 200px;
- + padding: 0;
- + -o-object-fit: cover;
- + object-fit: cover; }
- + .card > .sectione:last-child {
- + border-bottom: 0; }
- +
- +/*
- + Custom elements for card elements.
- +*/
- +@media screen and (min-width: 240px) {
- + .card.small {
- + max-width: 240px; } }
- +@media screen and (min-width: 480px) {
- + .card.large {
- + max-width: 480px; } }
- +.card.fluid {
- + max-width: 100%;
- + width: auto; }
- +
- +.card.warning {
- + --card-back-color: #e5b8b7;
- + --card-fore-color: #3b234b;
- + --card-border-color: #8c0078; }
- +
- +.card.error {
- + --card-back-color: #464650;
- + --card-fore-color: #ffffff;
- + --card-border-color: #8c0078; }
- +
- +.card > .sectione.dark {
- + --card-back-color: #3b234b;
- + --card-fore-color: #ffffff; }
- +
- +.card > .sectione.double-padded {
- + padding: calc(1.5 * var(--universal-padding)); }
- +
- +/*
- + Definitions for forms and input elements.
- +*/
- +/* Input_control module CSS variable definitions */
- +:root {
- + --form-back-color: #ffe97f;
- + --form-fore-color: #03234b;
- + --form-border-color: #3cb4e6;
- + --input-back-color: #ffffff;
- + --input-fore-color: #03234b;
- + --input-border-color: #3cb4e6;
- + --input-focus-color: #0288d1;
- + --input-invalid-color: #d32f2f;
- + --button-back-color: #e2e2e2;
- + --button-hover-back-color: #dcdcdc;
- + --button-fore-color: #212121;
- + --button-border-color: transparent;
- + --button-hover-border-color: transparent;
- + --button-group-border-color: rgba(124, 124, 124, 0.54); }
- +
- +form {
- + background: var(--form-back-color);
- + color: var(--form-fore-color);
- + border: 0.0714285714rem solid var(--form-border-color);
- + border-radius: var(--universal-border-radius);
- + margin: var(--universal-margin);
- + padding: calc(2 * var(--universal-padding)) var(--universal-padding); }
- +
- +fieldset {
- + border: 0.0714285714rem solid var(--form-border-color);
- + border-radius: var(--universal-border-radius);
- + margin: calc(var(--universal-margin) / 4);
- + padding: var(--universal-padding); }
- +
- +legend {
- + box-sizing: border-box;
- + display: table;
- + max-width: 100%;
- + white-space: normal;
- + font-weight: 500;
- + padding: calc(var(--universal-padding) / 2); }
- +
- +label {
- + padding: calc(var(--universal-padding) / 2) var(--universal-padding); }
- +
- +.input-group {
- + display: inline-block; }
- + .input-group.fluid {
- + display: flex;
- + align-items: center;
- + justify-content: center; }
- + .input-group.fluid > input {
- + max-width: 100%;
- + flex-grow: 1;
- + flex-basis: 0px; }
- + @media screen and (max-width: 499px) {
- + .input-group.fluid {
- + align-items: stretch;
- + flex-direction: column; } }
- + .input-group.vertical {
- + display: flex;
- + align-items: stretch;
- + flex-direction: column; }
- + .input-group.vertical > input {
- + max-width: 100%;
- + flex-grow: 1;
- + flex-basis: 0px; }
- +
- +[type="number"]::-webkit-inner-spin-button, [type="number"]::-webkit-outer-spin-button {
- + height: auto; }
- +
- +[type="search"] {
- + -webkit-appearance: textfield;
- + outline-offset: -2px; }
- +
- +[type="search"]::-webkit-search-cancel-button,
- +[type="search"]::-webkit-search-decoration {
- + -webkit-appearance: none; }
- +
- +input:not([type]), [type="text"], [type="email"], [type="number"], [type="search"],
- +[type="password"], [type="url"], [type="tel"], [type="checkbox"], [type="radio"], textarea, select {
- + box-sizing: border-box;
- + background: var(--input-back-color);
- + color: var(--input-fore-color);
- + border: 0.0714285714rem solid var(--input-border-color);
- + border-radius: var(--universal-border-radius);
- + margin: calc(var(--universal-margin) / 2);
- + padding: var(--universal-padding) calc(1.5 * var(--universal-padding)); }
- +
- +input:not([type="button"]):not([type="submit"]):not([type="reset"]):hover, input:not([type="button"]):not([type="submit"]):not([type="reset"]):focus, textarea:hover, textarea:focus, select:hover, select:focus {
- + border-color: var(--input-focus-color);
- + box-shadow: none; }
- +input:not([type="button"]):not([type="submit"]):not([type="reset"]):invalid, input:not([type="button"]):not([type="submit"]):not([type="reset"]):focus:invalid, textarea:invalid, textarea:focus:invalid, select:invalid, select:focus:invalid {
- + border-color: var(--input-invalid-color);
- + box-shadow: none; }
- +input:not([type="button"]):not([type="submit"]):not([type="reset"])[readonly], textarea[readonly], select[readonly] {
- + background: var(--secondary-back-color); }
- +
- +select {
- + max-width: 100%; }
- +
- +option {
- + overflow: hidden;
- + text-overflow: ellipsis; }
- +
- +[type="checkbox"], [type="radio"] {
- + -webkit-appearance: none;
- + -moz-appearance: none;
- + appearance: none;
- + position: relative;
- + height: calc(1rem + var(--universal-padding) / 2);
- + width: calc(1rem + var(--universal-padding) / 2);
- + vertical-align: text-bottom;
- + padding: 0;
- + flex-basis: calc(1rem + var(--universal-padding) / 2) !important;
- + flex-grow: 0 !important; }
- + [type="checkbox"]:checked:before, [type="radio"]:checked:before {
- + position: absolute; }
- +
- +[type="checkbox"]:checked:before {
- + content: '\2713';
- + font-family: sans-serif;
- + font-size: calc(1rem + var(--universal-padding) / 2);
- + top: calc(0rem - var(--universal-padding));
- + left: calc(var(--universal-padding) / 4); }
- +
- +[type="radio"] {
- + border-radius: 100%; }
- + [type="radio"]:checked:before {
- + border-radius: 100%;
- + content: '';
- + top: calc(0.0714285714rem + var(--universal-padding) / 2);
- + left: calc(0.0714285714rem + var(--universal-padding) / 2);
- + background: var(--input-fore-color);
- + width: 0.5rem;
- + height: 0.5rem; }
- +
- +:placeholder-shown {
- + color: var(--input-fore-color); }
- +
- +::-ms-placeholder {
- + color: var(--input-fore-color);
- + opacity: 0.54; }
- +
- +button::-moz-focus-inner, [type="button"]::-moz-focus-inner, [type="reset"]::-moz-focus-inner, [type="submit"]::-moz-focus-inner {
- + border-style: none;
- + padding: 0; }
- +
- +button, html [type="button"], [type="reset"], [type="submit"] {
- + -webkit-appearance: button; }
- +
- +button {
- + overflow: visible;
- + text-transform: none; }
- +
- +button, [type="button"], [type="submit"], [type="reset"],
- +a.button, label.button, .button,
- +a[role="button"], label[role="button"], [role="button"] {
- + display: inline-block;
- + background: var(--button-back-color);
- + color: var(--button-fore-color);
- + border: 0.0714285714rem solid var(--button-border-color);
- + border-radius: var(--universal-border-radius);
- + padding: var(--universal-padding) calc(1.5 * var(--universal-padding));
- + margin: var(--universal-margin);
- + text-decoration: none;
- + cursor: pointer;
- + transition: background 0.3s; }
- + button:hover, button:focus, [type="button"]:hover, [type="button"]:focus, [type="submit"]:hover, [type="submit"]:focus, [type="reset"]:hover, [type="reset"]:focus,
- + a.button:hover,
- + a.button:focus, label.button:hover, label.button:focus, .button:hover, .button:focus,
- + a[role="button"]:hover,
- + a[role="button"]:focus, label[role="button"]:hover, label[role="button"]:focus, [role="button"]:hover, [role="button"]:focus {
- + background: var(--button-hover-back-color);
- + border-color: var(--button-hover-border-color); }
- +
- +input:disabled, input[disabled], textarea:disabled, textarea[disabled], select:disabled, select[disabled], button:disabled, button[disabled], .button:disabled, .button[disabled], [role="button"]:disabled, [role="button"][disabled] {
- + cursor: not-allowed;
- + opacity: 0.75; }
- +
- +.button-group {
- + display: flex;
- + border: 0.0714285714rem solid var(--button-group-border-color);
- + border-radius: var(--universal-border-radius);
- + margin: var(--universal-margin); }
- + .button-group > button, .button-group [type="button"], .button-group > [type="submit"], .button-group > [type="reset"], .button-group > .button, .button-group > [role="button"] {
- + margin: 0;
- + max-width: 100%;
- + flex: 1 1 auto;
- + text-align: center;
- + border: 0;
- + border-radius: 0;
- + box-shadow: none; }
- + .button-group > :not(:first-child) {
- + border-left: 0.0714285714rem solid var(--button-group-border-color); }
- + @media screen and (max-width: 499px) {
- + .button-group {
- + flex-direction: column; }
- + .button-group > :not(:first-child) {
- + border: 0;
- + border-top: 0.0714285714rem solid var(--button-group-border-color); } }
- +
- +/*
- + Custom elements for forms and input elements.
- +*/
- +button.primary, [type="button"].primary, [type="submit"].primary, [type="reset"].primary, .button.primary, [role="button"].primary {
- + --button-back-color: #1976d2;
- + --button-fore-color: #f8f8f8; }
- + button.primary:hover, button.primary:focus, [type="button"].primary:hover, [type="button"].primary:focus, [type="submit"].primary:hover, [type="submit"].primary:focus, [type="reset"].primary:hover, [type="reset"].primary:focus, .button.primary:hover, .button.primary:focus, [role="button"].primary:hover, [role="button"].primary:focus {
- + --button-hover-back-color: #1565c0; }
- +
- +button.secondary, [type="button"].secondary, [type="submit"].secondary, [type="reset"].secondary, .button.secondary, [role="button"].secondary {
- + --button-back-color: #d32f2f;
- + --button-fore-color: #f8f8f8; }
- + button.secondary:hover, button.secondary:focus, [type="button"].secondary:hover, [type="button"].secondary:focus, [type="submit"].secondary:hover, [type="submit"].secondary:focus, [type="reset"].secondary:hover, [type="reset"].secondary:focus, .button.secondary:hover, .button.secondary:focus, [role="button"].secondary:hover, [role="button"].secondary:focus {
- + --button-hover-back-color: #c62828; }
- +
- +button.tertiary, [type="button"].tertiary, [type="submit"].tertiary, [type="reset"].tertiary, .button.tertiary, [role="button"].tertiary {
- + --button-back-color: #308732;
- + --button-fore-color: #f8f8f8; }
- + button.tertiary:hover, button.tertiary:focus, [type="button"].tertiary:hover, [type="button"].tertiary:focus, [type="submit"].tertiary:hover, [type="submit"].tertiary:focus, [type="reset"].tertiary:hover, [type="reset"].tertiary:focus, .button.tertiary:hover, .button.tertiary:focus, [role="button"].tertiary:hover, [role="button"].tertiary:focus {
- + --button-hover-back-color: #277529; }
- +
- +button.inverse, [type="button"].inverse, [type="submit"].inverse, [type="reset"].inverse, .button.inverse, [role="button"].inverse {
- + --button-back-color: #212121;
- + --button-fore-color: #f8f8f8; }
- + button.inverse:hover, button.inverse:focus, [type="button"].inverse:hover, [type="button"].inverse:focus, [type="submit"].inverse:hover, [type="submit"].inverse:focus, [type="reset"].inverse:hover, [type="reset"].inverse:focus, .button.inverse:hover, .button.inverse:focus, [role="button"].inverse:hover, [role="button"].inverse:focus {
- + --button-hover-back-color: #111; }
- +
- +button.small, [type="button"].small, [type="submit"].small, [type="reset"].small, .button.small, [role="button"].small {
- + padding: calc(0.5 * var(--universal-padding)) calc(0.75 * var(--universal-padding));
- + margin: var(--universal-margin); }
- +
- +button.large, [type="button"].large, [type="submit"].large, [type="reset"].large, .button.large, [role="button"].large {
- + padding: calc(1.5 * var(--universal-padding)) calc(2 * var(--universal-padding));
- + margin: var(--universal-margin); }
- +
- +/*
- + Definitions for navigation elements.
- +*/
- +/* Navigation module CSS variable definitions */
- +:root {
- + --header-back-color: #03234b;
- + --header-hover-back-color: #ffd200;
- + --header-fore-color: #ffffff;
- + --header-border-color: #3cb4e6;
- + --nav-back-color: #ffffff;
- + --nav-hover-back-color: #ffe97f;
- + --nav-fore-color: #e6007e;
- + --nav-border-color: #3cb4e6;
- + --nav-link-color: #3cb4e6;
- + --footer-fore-color: #ffffff;
- + --footer-back-color: #03234b;
- + --footer-border-color: #3cb4e6;
- + --footer-link-color: #3cb4e6;
- + --drawer-back-color: #ffffff;
- + --drawer-hover-back-color: #ffe97f;
- + --drawer-border-color: #3cb4e6;
- + --drawer-close-color: #e6007e; }
- +
- +header {
- + height: 2.75rem;
- + background: var(--header-back-color);
- + color: var(--header-fore-color);
- + border-bottom: 0.0714285714rem solid var(--header-border-color);
- + padding: calc(var(--universal-padding) / 4) 0;
- + white-space: nowrap;
- + overflow-x: auto;
- + overflow-y: hidden; }
- + header.row {
- + box-sizing: content-box; }
- + header .logo {
- + color: var(--header-fore-color);
- + font-size: 1.75rem;
- + padding: var(--universal-padding) calc(2 * var(--universal-padding));
- + text-decoration: none; }
- + header button, header [type="button"], header .button, header [role="button"] {
- + box-sizing: border-box;
- + position: relative;
- + top: calc(0rem - var(--universal-padding) / 4);
- + height: calc(3.1875rem + var(--universal-padding) / 2);
- + background: var(--header-back-color);
- + line-height: calc(3.1875rem - var(--universal-padding) * 1.5);
- + text-align: center;
- + color: var(--header-fore-color);
- + border: 0;
- + border-radius: 0;
- + margin: 0;
- + text-transform: uppercase; }
- + header button:hover, header button:focus, header [type="button"]:hover, header [type="button"]:focus, header .button:hover, header .button:focus, header [role="button"]:hover, header [role="button"]:focus {
- + background: var(--header-hover-back-color); }
- +
- +nav {
- + background: var(--nav-back-color);
- + color: var(--nav-fore-color);
- + border: 0.0714285714rem solid var(--nav-border-color);
- + border-radius: var(--universal-border-radius);
- + margin: var(--universal-margin); }
- + nav * {
- + padding: var(--universal-padding) calc(1.5 * var(--universal-padding)); }
- + nav a, nav a:visited {
- + display: block;
- + color: var(--nav-link-color);
- + border-radius: var(--universal-border-radius);
- + transition: background 0.3s; }
- + nav a:hover, nav a:focus, nav a:visited:hover, nav a:visited:focus {
- + text-decoration: none;
- + background: var(--nav-hover-back-color); }
- + nav .sublink-1 {
- + position: relative;
- + margin-left: calc(2 * var(--universal-padding)); }
- + nav .sublink-1:before {
- + position: absolute;
- + left: calc(var(--universal-padding) - 1 * var(--universal-padding));
- + top: -0.0714285714rem;
- + content: '';
- + height: 100%;
- + border: 0.0714285714rem solid var(--nav-border-color);
- + border-left: 0; }
- + nav .sublink-2 {
- + position: relative;
- + margin-left: calc(4 * var(--universal-padding)); }
- + nav .sublink-2:before {
- + position: absolute;
- + left: calc(var(--universal-padding) - 3 * var(--universal-padding));
- + top: -0.0714285714rem;
- + content: '';
- + height: 100%;
- + border: 0.0714285714rem solid var(--nav-border-color);
- + border-left: 0; }
- +
- +footer {
- + background: var(--footer-back-color);
- + color: var(--footer-fore-color);
- + border-top: 0.0714285714rem solid var(--footer-border-color);
- + padding: calc(2 * var(--universal-padding)) var(--universal-padding);
- + font-size: 0.875rem; }
- + footer a, footer a:visited {
- + color: var(--footer-link-color); }
- +
- +header.sticky {
- + position: -webkit-sticky;
- + position: sticky;
- + z-index: 1101;
- + top: 0; }
- +
- +footer.sticky {
- + position: -webkit-sticky;
- + position: sticky;
- + z-index: 1101;
- + bottom: 0; }
- +
- +.drawer-toggle:before {
- + display: inline-block;
- + position: relative;
- + vertical-align: bottom;
- + content: '\00a0\2261\00a0';
- + font-family: sans-serif;
- + font-size: 1.5em; }
- +@media screen and (min-width: 500px) {
- + .drawer-toggle:not(.persistent) {
- + display: none; } }
- +
- +[type="checkbox"].drawer {
- + height: 1px;
- + width: 1px;
- + margin: -1px;
- + overflow: hidden;
- + position: absolute;
- + clip: rect(0 0 0 0);
- + -webkit-clip-path: inset(100%);
- + clip-path: inset(100%); }
- + [type="checkbox"].drawer + * {
- + display: block;
- + box-sizing: border-box;
- + position: fixed;
- + top: 0;
- + width: 320px;
- + height: 100vh;
- + overflow-y: auto;
- + background: var(--drawer-back-color);
- + border: 0.0714285714rem solid var(--drawer-border-color);
- + border-radius: 0;
- + margin: 0;
- + z-index: 1110;
- + right: -320px;
- + transition: right 0.3s; }
- + [type="checkbox"].drawer + * .drawer-close {
- + position: absolute;
- + top: var(--universal-margin);
- + right: var(--universal-margin);
- + z-index: 1111;
- + width: 2rem;
- + height: 2rem;
- + border-radius: var(--universal-border-radius);
- + padding: var(--universal-padding);
- + margin: 0;
- + cursor: pointer;
- + transition: background 0.3s; }
- + [type="checkbox"].drawer + * .drawer-close:before {
- + display: block;
- + content: '\00D7';
- + color: var(--drawer-close-color);
- + position: relative;
- + font-family: sans-serif;
- + font-size: 2rem;
- + line-height: 1;
- + text-align: center; }
- + [type="checkbox"].drawer + * .drawer-close:hover, [type="checkbox"].drawer + * .drawer-close:focus {
- + background: var(--drawer-hover-back-color); }
- + @media screen and (max-width: 320px) {
- + [type="checkbox"].drawer + * {
- + width: 100%; } }
- + [type="checkbox"].drawer:checked + * {
- + right: 0; }
- + @media screen and (min-width: 500px) {
- + [type="checkbox"].drawer:not(.persistent) + * {
- + position: static;
- + height: 100%;
- + z-index: 1100; }
- + [type="checkbox"].drawer:not(.persistent) + * .drawer-close {
- + display: none; } }
- +
- +/*
- + Definitions for the responsive table component.
- +*/
- +/* Table module CSS variable definitions. */
- +:root {
- + --table-border-color: #03234b;
- + --table-border-separator-color: #03234b;
- + --table-head-back-color: #03234b;
- + --table-head-fore-color: #ffffff;
- + --table-body-back-color: #ffffff;
- + --table-body-fore-color: #03234b;
- + --table-body-alt-back-color: #f4f4f4; }
- +
- +table {
- + border-collapse: separate;
- + border-spacing: 0;
- + margin: 0;
- + display: flex;
- + flex: 0 1 auto;
- + flex-flow: row wrap;
- + padding: var(--universal-padding);
- + padding-top: 0; }
- + table caption {
- + font-size: 1rem;
- + margin: calc(2 * var(--universal-margin)) 0;
- + max-width: 100%;
- + flex: 0 0 100%; }
- + table thead, table tbody {
- + display: flex;
- + flex-flow: row wrap;
- + border: 0.0714285714rem solid var(--table-border-color); }
- + table thead {
- + z-index: 999;
- + border-radius: var(--universal-border-radius) var(--universal-border-radius) 0 0;
- + border-bottom: 0.0714285714rem solid var(--table-border-separator-color); }
- + table tbody {
- + border-top: 0;
- + margin-top: calc(0 - var(--universal-margin));
- + border-radius: 0 0 var(--universal-border-radius) var(--universal-border-radius); }
- + table tr {
- + display: flex;
- + padding: 0; }
- + table th, table td {
- + padding: calc(0.5 * var(--universal-padding));
- + font-size: 0.9rem; }
- + table th {
- + text-align: left;
- + background: var(--table-head-back-color);
- + color: var(--table-head-fore-color); }
- + table td {
- + background: var(--table-body-back-color);
- + color: var(--table-body-fore-color);
- + border-top: 0.0714285714rem solid var(--table-border-color); }
- +
- +table:not(.horizontal) {
- + overflow: auto;
- + max-height: 100%; }
- + table:not(.horizontal) thead, table:not(.horizontal) tbody {
- + max-width: 100%;
- + flex: 0 0 100%; }
- + table:not(.horizontal) tr {
- + flex-flow: row wrap;
- + flex: 0 0 100%; }
- + table:not(.horizontal) th, table:not(.horizontal) td {
- + flex: 1 0 0%;
- + overflow: hidden;
- + text-overflow: ellipsis; }
- + table:not(.horizontal) thead {
- + position: sticky;
- + top: 0; }
- + table:not(.horizontal) tbody tr:first-child td {
- + border-top: 0; }
- +
- +table.horizontal {
- + border: 0; }
- + table.horizontal thead, table.horizontal tbody {
- + border: 0;
- + flex: .2 0 0;
- + flex-flow: row nowrap; }
- + table.horizontal tbody {
- + overflow: auto;
- + justify-content: space-between;
- + flex: .8 0 0;
- + margin-left: 0;
- + padding-bottom: calc(var(--universal-padding) / 4); }
- + table.horizontal tr {
- + flex-direction: column;
- + flex: 1 0 auto; }
- + table.horizontal th, table.horizontal td {
- + width: auto;
- + border: 0;
- + border-bottom: 0.0714285714rem solid var(--table-border-color); }
- + table.horizontal th:not(:first-child), table.horizontal td:not(:first-child) {
- + border-top: 0; }
- + table.horizontal th {
- + text-align: right;
- + border-left: 0.0714285714rem solid var(--table-border-color);
- + border-right: 0.0714285714rem solid var(--table-border-separator-color); }
- + table.horizontal thead tr:first-child {
- + padding-left: 0; }
- + table.horizontal th:first-child, table.horizontal td:first-child {
- + border-top: 0.0714285714rem solid var(--table-border-color); }
- + table.horizontal tbody tr:last-child td {
- + border-right: 0.0714285714rem solid var(--table-border-color); }
- + table.horizontal tbody tr:last-child td:first-child {
- + border-top-right-radius: 0.25rem; }
- + table.horizontal tbody tr:last-child td:last-child {
- + border-bottom-right-radius: 0.25rem; }
- + table.horizontal thead tr:first-child th:first-child {
- + border-top-left-radius: 0.25rem; }
- + table.horizontal thead tr:first-child th:last-child {
- + border-bottom-left-radius: 0.25rem; }
- +
- +@media screen and (max-width: 499px) {
- + table, table.horizontal {
- + border-collapse: collapse;
- + border: 0;
- + width: 100%;
- + display: table; }
- + table thead, table th, table.horizontal thead, table.horizontal th {
- + border: 0;
- + height: 1px;
- + width: 1px;
- + margin: -1px;
- + overflow: hidden;
- + padding: 0;
- + position: absolute;
- + clip: rect(0 0 0 0);
- + -webkit-clip-path: inset(100%);
- + clip-path: inset(100%); }
- + table tbody, table.horizontal tbody {
- + border: 0;
- + display: table-row-group; }
- + table tr, table.horizontal tr {
- + display: block;
- + border: 0.0714285714rem solid var(--table-border-color);
- + border-radius: var(--universal-border-radius);
- + background: #ffffff;
- + padding: var(--universal-padding);
- + margin: var(--universal-margin);
- + margin-bottom: calc(1 * var(--universal-margin)); }
- + table th, table td, table.horizontal th, table.horizontal td {
- + width: auto; }
- + table td, table.horizontal td {
- + display: block;
- + border: 0;
- + text-align: right; }
- + table td:before, table.horizontal td:before {
- + content: attr(data-label);
- + float: left;
- + font-weight: 600; }
- + table th:first-child, table td:first-child, table.horizontal th:first-child, table.horizontal td:first-child {
- + border-top: 0; }
- + table tbody tr:last-child td, table.horizontal tbody tr:last-child td {
- + border-right: 0; } }
- +table tr:nth-of-type(2n) > td {
- + background: var(--table-body-alt-back-color); }
- +
- +@media screen and (max-width: 500px) {
- + table tr:nth-of-type(2n) {
- + background: var(--table-body-alt-back-color); } }
- +:root {
- + --table-body-hover-back-color: #90caf9; }
- +
- +table.hoverable tr:hover, table.hoverable tr:hover > td, table.hoverable tr:focus, table.hoverable tr:focus > td {
- + background: var(--table-body-hover-back-color); }
- +
- +@media screen and (max-width: 500px) {
- + table.hoverable tr:hover, table.hoverable tr:hover > td, table.hoverable tr:focus, table.hoverable tr:focus > td {
- + background: var(--table-body-hover-back-color); } }
- +/*
- + Definitions for contextual background elements, toasts and tooltips.
- +*/
- +/* Contextual module CSS variable definitions */
- +:root {
- + --mark-back-color: #3cb4e6;
- + --mark-fore-color: #ffffff; }
- +
- +mark {
- + background: var(--mark-back-color);
- + color: var(--mark-fore-color);
- + font-size: 0.95em;
- + line-height: 1em;
- + border-radius: var(--universal-border-radius);
- + padding: calc(var(--universal-padding) / 4) var(--universal-padding); }
- + mark.inline-block {
- + display: inline-block;
- + font-size: 1em;
- + line-height: 1.4;
- + padding: calc(var(--universal-padding) / 2) var(--universal-padding); }
- +
- +:root {
- + --toast-back-color: #424242;
- + --toast-fore-color: #fafafa; }
- +
- +.toast {
- + position: fixed;
- + bottom: calc(var(--universal-margin) * 3);
- + left: 50%;
- + transform: translate(-50%, -50%);
- + z-index: 1111;
- + color: var(--toast-fore-color);
- + background: var(--toast-back-color);
- + border-radius: calc(var(--universal-border-radius) * 16);
- + padding: var(--universal-padding) calc(var(--universal-padding) * 3); }
- +
- +:root {
- + --tooltip-back-color: #212121;
- + --tooltip-fore-color: #fafafa; }
- +
- +.tooltip {
- + position: relative;
- + display: inline-block; }
- + .tooltip:before, .tooltip:after {
- + position: absolute;
- + opacity: 0;
- + clip: rect(0 0 0 0);
- + -webkit-clip-path: inset(100%);
- + clip-path: inset(100%);
- + transition: all 0.3s;
- + z-index: 1010;
- + left: 50%; }
- + .tooltip:not(.bottom):before, .tooltip:not(.bottom):after {
- + bottom: 75%; }
- + .tooltip.bottom:before, .tooltip.bottom:after {
- + top: 75%; }
- + .tooltip:hover:before, .tooltip:hover:after, .tooltip:focus:before, .tooltip:focus:after {
- + opacity: 1;
- + clip: auto;
- + -webkit-clip-path: inset(0%);
- + clip-path: inset(0%); }
- + .tooltip:before {
- + content: '';
- + background: transparent;
- + border: var(--universal-margin) solid transparent;
- + left: calc(50% - var(--universal-margin)); }
- + .tooltip:not(.bottom):before {
- + border-top-color: #212121; }
- + .tooltip.bottom:before {
- + border-bottom-color: #212121; }
- + .tooltip:after {
- + content: attr(aria-label);
- + color: var(--tooltip-fore-color);
- + background: var(--tooltip-back-color);
- + border-radius: var(--universal-border-radius);
- + padding: var(--universal-padding);
- + white-space: nowrap;
- + transform: translateX(-50%); }
- + .tooltip:not(.bottom):after {
- + margin-bottom: calc(2 * var(--universal-margin)); }
- + .tooltip.bottom:after {
- + margin-top: calc(2 * var(--universal-margin)); }
- +
- +:root {
- + --modal-overlay-color: rgba(0, 0, 0, 0.45);
- + --modal-close-color: #e6007e;
- + --modal-close-hover-color: #ffe97f; }
- +
- +[type="checkbox"].modal {
- + height: 1px;
- + width: 1px;
- + margin: -1px;
- + overflow: hidden;
- + position: absolute;
- + clip: rect(0 0 0 0);
- + -webkit-clip-path: inset(100%);
- + clip-path: inset(100%); }
- + [type="checkbox"].modal + div {
- + position: fixed;
- + top: 0;
- + left: 0;
- + display: none;
- + width: 100vw;
- + height: 100vh;
- + background: var(--modal-overlay-color); }
- + [type="checkbox"].modal + div .card {
- + margin: 0 auto;
- + max-height: 50vh;
- + overflow: auto; }
- + [type="checkbox"].modal + div .card .modal-close {
- + position: absolute;
- + top: 0;
- + right: 0;
- + width: 1.75rem;
- + height: 1.75rem;
- + border-radius: var(--universal-border-radius);
- + padding: var(--universal-padding);
- + margin: 0;
- + cursor: pointer;
- + transition: background 0.3s; }
- + [type="checkbox"].modal + div .card .modal-close:before {
- + display: block;
- + content: '\00D7';
- + color: var(--modal-close-color);
- + position: relative;
- + font-family: sans-serif;
- + font-size: 1.75rem;
- + line-height: 1;
- + text-align: center; }
- + [type="checkbox"].modal + div .card .modal-close:hover, [type="checkbox"].modal + div .card .modal-close:focus {
- + background: var(--modal-close-hover-color); }
- + [type="checkbox"].modal:checked + div {
- + display: flex;
- + flex: 0 1 auto;
- + z-index: 1200; }
- + [type="checkbox"].modal:checked + div .card .modal-close {
- + z-index: 1211; }
- +
- +:root {
- + --collapse-label-back-color: #03234b;
- + --collapse-label-fore-color: #ffffff;
- + --collapse-label-hover-back-color: #3cb4e6;
- + --collapse-selected-label-back-color: #3cb4e6;
- + --collapse-border-color: var(--collapse-label-back-color);
- + --collapse-selected-border-color: #ceecf8;
- + --collapse-content-back-color: #ffffff;
- + --collapse-selected-label-border-color: #3cb4e6; }
- +
- +.collapse {
- + width: calc(100% - 2 * var(--universal-margin));
- + opacity: 1;
- + display: flex;
- + flex-direction: column;
- + margin: var(--universal-margin);
- + border-radius: var(--universal-border-radius); }
- + .collapse > [type="radio"], .collapse > [type="checkbox"] {
- + height: 1px;
- + width: 1px;
- + margin: -1px;
- + overflow: hidden;
- + position: absolute;
- + clip: rect(0 0 0 0);
- + -webkit-clip-path: inset(100%);
- + clip-path: inset(100%); }
- + .collapse > label {
- + flex-grow: 1;
- + display: inline-block;
- + height: 1.25rem;
- + cursor: pointer;
- + transition: background 0.2s;
- + color: var(--collapse-label-fore-color);
- + background: var(--collapse-label-back-color);
- + border: 0.0714285714rem solid var(--collapse-selected-border-color);
- + padding: calc(1.25 * var(--universal-padding)); }
- + .collapse > label:hover, .collapse > label:focus {
- + background: var(--collapse-label-hover-back-color); }
- + .collapse > label + div {
- + flex-basis: auto;
- + height: 1px;
- + width: 1px;
- + margin: -1px;
- + overflow: hidden;
- + position: absolute;
- + clip: rect(0 0 0 0);
- + -webkit-clip-path: inset(100%);
- + clip-path: inset(100%);
- + transition: max-height 0.3s;
- + max-height: 1px; }
- + .collapse > :checked + label {
- + background: var(--collapse-selected-label-back-color);
- + border-color: var(--collapse-selected-label-border-color); }
- + .collapse > :checked + label + div {
- + box-sizing: border-box;
- + position: relative;
- + width: 100%;
- + height: auto;
- + overflow: auto;
- + margin: 0;
- + background: var(--collapse-content-back-color);
- + border: 0.0714285714rem solid var(--collapse-selected-border-color);
- + border-top: 0;
- + padding: var(--universal-padding);
- + clip: auto;
- + -webkit-clip-path: inset(0%);
- + clip-path: inset(0%);
- + max-height: 100%; }
- + .collapse > label:not(:first-of-type) {
- + border-top: 0; }
- + .collapse > label:first-of-type {
- + border-radius: var(--universal-border-radius) var(--universal-border-radius) 0 0; }
- + .collapse > label:last-of-type:not(:first-of-type) {
- + border-radius: 0 0 var(--universal-border-radius) var(--universal-border-radius); }
- + .collapse > label:last-of-type:first-of-type {
- + border-radius: var(--universal-border-radius); }
- + .collapse > :checked:last-of-type:not(:first-of-type) + label {
- + border-radius: 0; }
- + .collapse > :checked:last-of-type + label + div {
- + border-radius: 0 0 var(--universal-border-radius) var(--universal-border-radius); }
- +
- +/*
- + Custom elements for contextual background elements, toasts and tooltips.
- +*/
- +mark.tertiary {
- + --mark-back-color: #3cb4e6; }
- +
- +mark.tag {
- + padding: calc(var(--universal-padding)/2) var(--universal-padding);
- + border-radius: 1em; }
- +
- +/*
- + Definitions for progress elements and spinners.
- +*/
- +/* Progress module CSS variable definitions */
- +:root {
- + --progress-back-color: #3cb4e6;
- + --progress-fore-color: #555; }
- +
- +progress {
- + display: block;
- + vertical-align: baseline;
- + -webkit-appearance: none;
- + -moz-appearance: none;
- + appearance: none;
- + height: 0.75rem;
- + width: calc(100% - 2 * var(--universal-margin));
- + margin: var(--universal-margin);
- + border: 0;
- + border-radius: calc(2 * var(--universal-border-radius));
- + background: var(--progress-back-color);
- + color: var(--progress-fore-color); }
- + progress::-webkit-progress-value {
- + background: var(--progress-fore-color);
- + border-top-left-radius: calc(2 * var(--universal-border-radius));
- + border-bottom-left-radius: calc(2 * var(--universal-border-radius)); }
- + progress::-webkit-progress-bar {
- + background: var(--progress-back-color); }
- + progress::-moz-progress-bar {
- + background: var(--progress-fore-color);
- + border-top-left-radius: calc(2 * var(--universal-border-radius));
- + border-bottom-left-radius: calc(2 * var(--universal-border-radius)); }
- + progress[value="1000"]::-webkit-progress-value {
- + border-radius: calc(2 * var(--universal-border-radius)); }
- + progress[value="1000"]::-moz-progress-bar {
- + border-radius: calc(2 * var(--universal-border-radius)); }
- + progress.inline {
- + display: inline-block;
- + vertical-align: middle;
- + width: 60%; }
- +
- +:root {
- + --spinner-back-color: #ddd;
- + --spinner-fore-color: #555; }
- +
- +@keyframes spinner-donut-anim {
- + 0% {
- + transform: rotate(0deg); }
- + 100% {
- + transform: rotate(360deg); } }
- +.spinner {
- + display: inline-block;
- + margin: var(--universal-margin);
- + border: 0.25rem solid var(--spinner-back-color);
- + border-left: 0.25rem solid var(--spinner-fore-color);
- + border-radius: 50%;
- + width: 1.25rem;
- + height: 1.25rem;
- + animation: spinner-donut-anim 1.2s linear infinite; }
- +
- +/*
- + Custom elements for progress bars and spinners.
- +*/
- +progress.primary {
- + --progress-fore-color: #1976d2; }
- +
- +progress.secondary {
- + --progress-fore-color: #d32f2f; }
- +
- +progress.tertiary {
- + --progress-fore-color: #308732; }
- +
- +.spinner.primary {
- + --spinner-fore-color: #1976d2; }
- +
- +.spinner.secondary {
- + --spinner-fore-color: #d32f2f; }
- +
- +.spinner.tertiary {
- + --spinner-fore-color: #308732; }
- +
- +/*
- + Definitions for icons - powered by Feather (https://feathericons.com/).
- +*/
- +span[class^='icon-'] {
- + display: inline-block;
- + height: 1em;
- + width: 1em;
- + vertical-align: -0.125em;
- + background-size: contain;
- + margin: 0 calc(var(--universal-margin) / 4); }
- + span[class^='icon-'].secondary {
- + -webkit-filter: invert(25%);
- + filter: invert(25%); }
- + span[class^='icon-'].inverse {
- + -webkit-filter: invert(100%);
- + filter: invert(100%); }
- +
- +span.icon-alert {
- + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12' y2='16'%3E%3C/line%3E%3C/svg%3E"); }
- +span.icon-bookmark {
- + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z'%3E%3C/path%3E%3C/svg%3E"); }
- +span.icon-calendar {
- + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E"); }
- +span.icon-credit {
- + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='1' y='4' width='22' height='16' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='1' y1='10' x2='23' y2='10'%3E%3C/line%3E%3C/svg%3E"); }
- +span.icon-edit {
- + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 14.66V20a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h5.34'%3E%3C/path%3E%3Cpolygon points='18 2 22 6 12 16 8 16 8 12 18 2'%3E%3C/polygon%3E%3C/svg%3E"); }
- +span.icon-link {
- + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'%3E%3C/path%3E%3Cpolyline points='15 3 21 3 21 9'%3E%3C/polyline%3E%3Cline x1='10' y1='14' x2='21' y2='3'%3E%3C/line%3E%3C/svg%3E"); }
- +span.icon-help {
- + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3'%3E%3C/path%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='17' x2='12' y2='17'%3E%3C/line%3E%3C/svg%3E"); }
- +span.icon-home {
- + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'%3E%3C/path%3E%3Cpolyline points='9 22 9 12 15 12 15 22'%3E%3C/polyline%3E%3C/svg%3E"); }
- +span.icon-info {
- + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='16' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='8' x2='12' y2='8'%3E%3C/line%3E%3C/svg%3E"); }
- +span.icon-lock {
- + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'%3E%3C/path%3E%3C/svg%3E"); }
- +span.icon-mail {
- + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'%3E%3C/path%3E%3Cpolyline points='22,6 12,13 2,6'%3E%3C/polyline%3E%3C/svg%3E"); }
- +span.icon-location {
- + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'%3E%3C/path%3E%3Ccircle cx='12' cy='10' r='3'%3E%3C/circle%3E%3C/svg%3E"); }
- +span.icon-phone {
- + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'%3E%3C/path%3E%3C/svg%3E"); }
- +span.icon-rss {
- + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 11a9 9 0 0 1 9 9'%3E%3C/path%3E%3Cpath d='M4 4a16 16 0 0 1 16 16'%3E%3C/path%3E%3Ccircle cx='5' cy='19' r='1'%3E%3C/circle%3E%3C/svg%3E"); }
- +span.icon-search {
- + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E"); }
- +span.icon-settings {
- + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'%3E%3C/circle%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z'%3E%3C/path%3E%3C/svg%3E"); }
- +span.icon-share {
- + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='18' cy='5' r='3'%3E%3C/circle%3E%3Ccircle cx='6' cy='12' r='3'%3E%3C/circle%3E%3Ccircle cx='18' cy='19' r='3'%3E%3C/circle%3E%3Cline x1='8.59' y1='13.51' x2='15.42' y2='17.49'%3E%3C/line%3E%3Cline x1='15.41' y1='6.51' x2='8.59' y2='10.49'%3E%3C/line%3E%3C/svg%3E"); }
- +span.icon-cart {
- + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'%3E%3C/circle%3E%3Ccircle cx='20' cy='21' r='1'%3E%3C/circle%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'%3E%3C/path%3E%3C/svg%3E"); }
- +span.icon-upload {
- + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'%3E%3C/path%3E%3Cpolyline points='17 8 12 3 7 8'%3E%3C/polyline%3E%3Cline x1='12' y1='3' x2='12' y2='15'%3E%3C/line%3E%3C/svg%3E"); }
- +span.icon-user {
- + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'%3E%3C/path%3E%3Ccircle cx='12' cy='7' r='4'%3E%3C/circle%3E%3C/svg%3E"); }
- +
- +/*
- + Definitions for STMicroelectronics icons (https://brandportal.st.com/document/26).
- +*/
- +span.icon-st-update {
- + background-image: url("Update.svg"); }
- +span.icon-st-add {
- + background-image: url("Add button.svg"); }
- +
- +/*
- + Definitions for utilities and helper classes.
- +*/
- +/* Utility module CSS variable definitions */
- +:root {
- + --generic-border-color: rgba(0, 0, 0, 0.3);
- + --generic-box-shadow: 0 0.2857142857rem 0.2857142857rem 0 rgba(0, 0, 0, 0.125), 0 0.1428571429rem 0.1428571429rem -0.1428571429rem rgba(0, 0, 0, 0.125); }
- +
- +.hidden {
- + display: none !important; }
- +
- +.visually-hidden {
- + position: absolute !important;
- + width: 1px !important;
- + height: 1px !important;
- + margin: -1px !important;
- + border: 0 !important;
- + padding: 0 !important;
- + clip: rect(0 0 0 0) !important;
- + -webkit-clip-path: inset(100%) !important;
- + clip-path: inset(100%) !important;
- + overflow: hidden !important; }
- +
- +.bordered {
- + border: 0.0714285714rem solid var(--generic-border-color) !important; }
- +
- +.rounded {
- + border-radius: var(--universal-border-radius) !important; }
- +
- +.circular {
- + border-radius: 50% !important; }
- +
- +.shadowed {
- + box-shadow: var(--generic-box-shadow) !important; }
- +
- +.responsive-margin {
- + margin: calc(var(--universal-margin) / 4) !important; }
- + @media screen and (min-width: 500px) {
- + .responsive-margin {
- + margin: calc(var(--universal-margin) / 2) !important; } }
- + @media screen and (min-width: 1280px) {
- + .responsive-margin {
- + margin: var(--universal-margin) !important; } }
- +
- +.responsive-padding {
- + padding: calc(var(--universal-padding) / 4) !important; }
- + @media screen and (min-width: 500px) {
- + .responsive-padding {
- + padding: calc(var(--universal-padding) / 2) !important; } }
- + @media screen and (min-width: 1280px) {
- + .responsive-padding {
- + padding: var(--universal-padding) !important; } }
- +
- +@media screen and (max-width: 499px) {
- + .hidden-sm {
- + display: none !important; } }
- +@media screen and (min-width: 500px) and (max-width: 1279px) {
- + .hidden-md {
- + display: none !important; } }
- +@media screen and (min-width: 1280px) {
- + .hidden-lg {
- + display: none !important; } }
- +@media screen and (max-width: 499px) {
- + .visually-hidden-sm {
- + position: absolute !important;
- + width: 1px !important;
- + height: 1px !important;
- + margin: -1px !important;
- + border: 0 !important;
- + padding: 0 !important;
- + clip: rect(0 0 0 0) !important;
- + -webkit-clip-path: inset(100%) !important;
- + clip-path: inset(100%) !important;
- + overflow: hidden !important; } }
- +@media screen and (min-width: 500px) and (max-width: 1279px) {
- + .visually-hidden-md {
- + position: absolute !important;
- + width: 1px !important;
- + height: 1px !important;
- + margin: -1px !important;
- + border: 0 !important;
- + padding: 0 !important;
- + clip: rect(0 0 0 0) !important;
- + -webkit-clip-path: inset(100%) !important;
- + clip-path: inset(100%) !important;
- + overflow: hidden !important; } }
- +@media screen and (min-width: 1280px) {
- + .visually-hidden-lg {
- + position: absolute !important;
- + width: 1px !important;
- + height: 1px !important;
- + margin: -1px !important;
- + border: 0 !important;
- + padding: 0 !important;
- + clip: rect(0 0 0 0) !important;
- + -webkit-clip-path: inset(100%) !important;
- + clip-path: inset(100%) !important;
- + overflow: hidden !important; } }
- +
- +/*# sourceMappingURL=mini-custom.css.map */
- +
- +img[alt="ST logo"] { display: block; margin: auto; width: 75%; max-width: 250px; min-width: 71px; }
- +img[alt="Cube logo"] { float: right; width: 30%; max-width: 10rem; min-width: 8rem; padding-right: 1rem;}
- +
- +.figure {
- + display: block;
- + margin-left: auto;
- + margin-right: auto;
- + text-align: center;
- +}
- \ No newline at end of file
- diff --git a/_htmresc/st_logo_2020.png b/_htmresc/st_logo_2020.png
- new file mode 100644
- index 000000000..d6cebb5ac
- Binary files /dev/null and b/_htmresc/st_logo_2020.png differ
- diff --git a/lsm6dso.c b/lsm6dso.c
- index f7ab817b1..739d67afd 100644
- --- a/lsm6dso.c
- +++ b/lsm6dso.c
- @@ -1,40 +1,39 @@
- /**
- - ******************************************************************************
- - * @file lsm6dso.c
- - * @author MEMS Software Solutions Team
- - * @brief LSM6DSO driver file
- - ******************************************************************************
- - * @attention
- - *
- - * <h2><center>© Copyright (c) 2019 STMicroelectronics.
- - * All rights reserved.</center></h2>
- - *
- - * This software component is licensed by ST under BSD 3-Clause license,
- - * the "License"; You may not use this file except in compliance with the
- - * License. You may obtain a copy of the License at:
- - * opensource.org/licenses/BSD-3-Clause
- - *
- - ******************************************************************************
- - */
- + ******************************************************************************
- + * @file lsm6dso.c
- + * @author MEMS Software Solutions Team
- + * @brief LSM6DSO driver file
- + ******************************************************************************
- + * @attention
- + *
- + * Copyright (c) 2019 STMicroelectronics.
- + * All rights reserved.
- + *
- + * This software is licensed under terms that can be found in the LICENSE file
- + * in the root directory of this software component.
- + * If no LICENSE file comes with this software, it is provided AS-IS.
- + *
- + ******************************************************************************
- + */
-
- /* Includes ------------------------------------------------------------------*/
- #include "lsm6dso.h"
-
- /** @addtogroup BSP BSP
- - * @{
- - */
- + * @{
- + */
-
- /** @addtogroup Component Component
- - * @{
- - */
- + * @{
- + */
-
- /** @defgroup LSM6DSO LSM6DSO
- - * @{
- - */
- + * @{
- + */
-
- /** @defgroup LSM6DSO_Exported_Variables LSM6DSO Exported Variables
- - * @{
- - */
- + * @{
- + */
-
- LSM6DSO_CommonDrv_t LSM6DSO_COMMON_Driver =
- {
- @@ -71,12 +70,12 @@ LSM6DSO_GYRO_Drv_t LSM6DSO_GYRO_Driver =
- };
-
- /**
- - * @}
- - */
- + * @}
- + */
-
- /** @defgroup LSM6DSO_Private_Function_Prototypes LSM6DSO Private Function Prototypes
- - * @{
- - */
- + * @{
- + */
-
- static int32_t LSM6DSO_ACC_SetOutputDataRate_When_Enabled(LSM6DSO_Object_t *pObj, float_t Odr);
- static int32_t LSM6DSO_ACC_SetOutputDataRate_When_Disabled(LSM6DSO_Object_t *pObj, float_t Odr);
- @@ -87,18 +86,18 @@ static int32_t ReadRegWrap(void *Handle, uint8_t Reg, uint8_t *pData, uint16_t L
- static int32_t WriteRegWrap(void *Handle, uint8_t Reg, uint8_t *pData, uint16_t Length);
-
- /**
- - * @}
- - */
- + * @}
- + */
-
- /** @defgroup LSM6DSO_Exported_Functions LSM6DSO Exported Functions
- - * @{
- - */
- + * @{
- + */
-
- /**
- - * @brief Register Component Bus IO operations
- - * @param pObj the device pObj
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Register Component Bus IO operations
- + * @param pObj the device pObj
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_RegisterBusIO(LSM6DSO_Object_t *pObj, LSM6DSO_IO_t *pIO)
- {
- int32_t ret = LSM6DSO_OK;
- @@ -119,6 +118,7 @@ int32_t LSM6DSO_RegisterBusIO(LSM6DSO_Object_t *pObj, LSM6DSO_IO_t *pIO)
-
- pObj->Ctx.read_reg = ReadRegWrap;
- pObj->Ctx.write_reg = WriteRegWrap;
- + pObj->Ctx.mdelay = pIO->Delay;
- pObj->Ctx.handle = pObj;
-
- if (pObj->IO.Init == NULL)
- @@ -152,10 +152,10 @@ int32_t LSM6DSO_RegisterBusIO(LSM6DSO_Object_t *pObj, LSM6DSO_IO_t *pIO)
- }
-
- /**
- - * @brief Initialize the LSM6DSO sensor
- - * @param pObj the device pObj
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Initialize the LSM6DSO sensor
- + * @param pObj the device pObj
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_Init(LSM6DSO_Object_t *pObj)
- {
- /* Disable I3C */
- @@ -219,10 +219,10 @@ int32_t LSM6DSO_Init(LSM6DSO_Object_t *pObj)
- }
-
- /**
- - * @brief Deinitialize the LSM6DSO sensor
- - * @param pObj the device pObj
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Deinitialize the LSM6DSO sensor
- + * @param pObj the device pObj
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_DeInit(LSM6DSO_Object_t *pObj)
- {
- /* Disable the component */
- @@ -246,11 +246,11 @@ int32_t LSM6DSO_DeInit(LSM6DSO_Object_t *pObj)
- }
-
- /**
- - * @brief Read component ID
- - * @param pObj the device pObj
- - * @param Id the WHO_AM_I value
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Read component ID
- + * @param pObj the device pObj
- + * @param Id the WHO_AM_I value
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ReadID(LSM6DSO_Object_t *pObj, uint8_t *Id)
- {
- if (lsm6dso_device_id_get(&(pObj->Ctx), Id) != LSM6DSO_OK)
- @@ -262,11 +262,11 @@ int32_t LSM6DSO_ReadID(LSM6DSO_Object_t *pObj, uint8_t *Id)
- }
-
- /**
- - * @brief Get LSM6DSO sensor capabilities
- - * @param pObj Component object pointer
- - * @param Capabilities pointer to LSM6DSO sensor capabilities
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Get LSM6DSO sensor capabilities
- + * @param pObj Component object pointer
- + * @param Capabilities pointer to LSM6DSO sensor capabilities
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_GetCapabilities(LSM6DSO_Object_t *pObj, LSM6DSO_Capabilities_t *Capabilities)
- {
- /* Prevent unused argument(s) compilation warning */
- @@ -286,10 +286,10 @@ int32_t LSM6DSO_GetCapabilities(LSM6DSO_Object_t *pObj, LSM6DSO_Capabilities_t *
- }
-
- /**
- - * @brief Enable the LSM6DSO accelerometer sensor
- - * @param pObj the device pObj
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Enable the LSM6DSO accelerometer sensor
- + * @param pObj the device pObj
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Enable(LSM6DSO_Object_t *pObj)
- {
- /* Check if the component is already enabled */
- @@ -310,10 +310,10 @@ int32_t LSM6DSO_ACC_Enable(LSM6DSO_Object_t *pObj)
- }
-
- /**
- - * @brief Disable the LSM6DSO accelerometer sensor
- - * @param pObj the device pObj
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Disable the LSM6DSO accelerometer sensor
- + * @param pObj the device pObj
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Disable(LSM6DSO_Object_t *pObj)
- {
- /* Check if the component is already disabled */
- @@ -340,11 +340,11 @@ int32_t LSM6DSO_ACC_Disable(LSM6DSO_Object_t *pObj)
- }
-
- /**
- - * @brief Get the LSM6DSO accelerometer sensor sensitivity
- - * @param pObj the device pObj
- - * @param Sensitivity pointer
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Get the LSM6DSO accelerometer sensor sensitivity
- + * @param pObj the device pObj
- + * @param Sensitivity pointer
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_GetSensitivity(LSM6DSO_Object_t *pObj, float_t *Sensitivity)
- {
- int32_t ret = LSM6DSO_OK;
- @@ -384,11 +384,11 @@ int32_t LSM6DSO_ACC_GetSensitivity(LSM6DSO_Object_t *pObj, float_t *Sensitivity)
- }
-
- /**
- - * @brief Get the LSM6DSO accelerometer sensor output data rate
- - * @param pObj the device pObj
- - * @param Odr pointer where the output data rate is written
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Get the LSM6DSO accelerometer sensor output data rate
- + * @param pObj the device pObj
- + * @param Odr pointer where the output data rate is written
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_GetOutputDataRate(LSM6DSO_Object_t *pObj, float_t *Odr)
- {
- int32_t ret = LSM6DSO_OK;
- @@ -459,29 +459,29 @@ int32_t LSM6DSO_ACC_GetOutputDataRate(LSM6DSO_Object_t *pObj, float_t *Odr)
- }
-
- /**
- - * @brief Set the LSM6DSO accelerometer sensor output data rate
- - * @param pObj the device pObj
- - * @param Odr the output data rate value to be set
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set the LSM6DSO accelerometer sensor output data rate
- + * @param pObj the device pObj
- + * @param Odr the output data rate value to be set
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_SetOutputDataRate(LSM6DSO_Object_t *pObj, float_t Odr)
- {
- return LSM6DSO_ACC_SetOutputDataRate_With_Mode(pObj, Odr, LSM6DSO_ACC_HIGH_PERFORMANCE_MODE);
- }
-
- /**
- - * @brief Set the LSM6DSO accelerometer sensor output data rate with operating mode
- - * @param pObj the device pObj
- - * @param Odr the output data rate value to be set
- - * @param Mode the accelerometer operating mode
- - * @note This function switches off the gyroscope if Ultra Low Power Mode is set
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set the LSM6DSO accelerometer sensor output data rate with operating mode
- + * @param pObj the device pObj
- + * @param Odr the output data rate value to be set
- + * @param Mode the accelerometer operating mode
- + * @note This function switches off the gyroscope if Ultra Low Power Mode is set
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_SetOutputDataRate_With_Mode(LSM6DSO_Object_t *pObj, float_t Odr, LSM6DSO_ACC_Operating_Mode_t Mode)
- {
- int32_t ret = LSM6DSO_OK;
- float_t newOdr = Odr;
- -
- +
- switch (Mode)
- {
- case LSM6DSO_ACC_HIGH_PERFORMANCE_MODE:
- @@ -651,7 +651,7 @@ int32_t LSM6DSO_ACC_SetOutputDataRate_With_Mode(LSM6DSO_Object_t *pObj, float_t
- break;
- }
-
- - if(ret == LSM6DSO_ERROR)
- + if (ret == LSM6DSO_ERROR)
- {
- return LSM6DSO_ERROR;
- }
- @@ -669,11 +669,11 @@ int32_t LSM6DSO_ACC_SetOutputDataRate_With_Mode(LSM6DSO_Object_t *pObj, float_t
- }
-
- /**
- - * @brief Get the LSM6DSO accelerometer sensor full scale
- - * @param pObj the device pObj
- - * @param FullScale pointer where the full scale is written
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Get the LSM6DSO accelerometer sensor full scale
- + * @param pObj the device pObj
- + * @param FullScale pointer where the full scale is written
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_GetFullScale(LSM6DSO_Object_t *pObj, int32_t *FullScale)
- {
- int32_t ret = LSM6DSO_OK;
- @@ -712,11 +712,11 @@ int32_t LSM6DSO_ACC_GetFullScale(LSM6DSO_Object_t *pObj, int32_t *FullScale)
- }
-
- /**
- - * @brief Set the LSM6DSO accelerometer sensor full scale
- - * @param pObj the device pObj
- - * @param FullScale the functional full scale to be set
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set the LSM6DSO accelerometer sensor full scale
- + * @param pObj the device pObj
- + * @param FullScale the functional full scale to be set
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_SetFullScale(LSM6DSO_Object_t *pObj, int32_t FullScale)
- {
- lsm6dso_fs_xl_t new_fs;
- @@ -737,11 +737,11 @@ int32_t LSM6DSO_ACC_SetFullScale(LSM6DSO_Object_t *pObj, int32_t FullScale)
- }
-
- /**
- - * @brief Get the LSM6DSO accelerometer sensor raw axes
- - * @param pObj the device pObj
- - * @param Value pointer where the raw values of the axes are written
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Get the LSM6DSO accelerometer sensor raw axes
- + * @param pObj the device pObj
- + * @param Value pointer where the raw values of the axes are written
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_GetAxesRaw(LSM6DSO_Object_t *pObj, LSM6DSO_AxesRaw_t *Value)
- {
- lsm6dso_axis3bit16_t data_raw;
- @@ -761,11 +761,11 @@ int32_t LSM6DSO_ACC_GetAxesRaw(LSM6DSO_Object_t *pObj, LSM6DSO_AxesRaw_t *Value)
- }
-
- /**
- - * @brief Get the LSM6DSO accelerometer sensor axes
- - * @param pObj the device pObj
- - * @param Acceleration pointer where the values of the axes are written
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Get the LSM6DSO accelerometer sensor axes
- + * @param pObj the device pObj
- + * @param Acceleration pointer where the values of the axes are written
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_GetAxes(LSM6DSO_Object_t *pObj, LSM6DSO_Axes_t *Acceleration)
- {
- lsm6dso_axis3bit16_t data_raw;
- @@ -792,10 +792,10 @@ int32_t LSM6DSO_ACC_GetAxes(LSM6DSO_Object_t *pObj, LSM6DSO_Axes_t *Acceleration
- }
-
- /**
- - * @brief Enable the LSM6DSO gyroscope sensor
- - * @param pObj the device pObj
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Enable the LSM6DSO gyroscope sensor
- + * @param pObj the device pObj
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_GYRO_Enable(LSM6DSO_Object_t *pObj)
- {
- /* Check if the component is already enabled */
- @@ -816,10 +816,10 @@ int32_t LSM6DSO_GYRO_Enable(LSM6DSO_Object_t *pObj)
- }
-
- /**
- - * @brief Disable the LSM6DSO gyroscope sensor
- - * @param pObj the device pObj
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Disable the LSM6DSO gyroscope sensor
- + * @param pObj the device pObj
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_GYRO_Disable(LSM6DSO_Object_t *pObj)
- {
- /* Check if the component is already disabled */
- @@ -846,11 +846,11 @@ int32_t LSM6DSO_GYRO_Disable(LSM6DSO_Object_t *pObj)
- }
-
- /**
- - * @brief Get the LSM6DSO gyroscope sensor sensitivity
- - * @param pObj the device pObj
- - * @param Sensitivity pointer
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Get the LSM6DSO gyroscope sensor sensitivity
- + * @param pObj the device pObj
- + * @param Sensitivity pointer
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_GYRO_GetSensitivity(LSM6DSO_Object_t *pObj, float_t *Sensitivity)
- {
- int32_t ret = LSM6DSO_OK;
- @@ -894,11 +894,11 @@ int32_t LSM6DSO_GYRO_GetSensitivity(LSM6DSO_Object_t *pObj, float_t *Sensitivity
- }
-
- /**
- - * @brief Get the LSM6DSO gyroscope sensor output data rate
- - * @param pObj the device pObj
- - * @param Odr pointer where the output data rate is written
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Get the LSM6DSO gyroscope sensor output data rate
- + * @param pObj the device pObj
- + * @param Odr pointer where the output data rate is written
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_GYRO_GetOutputDataRate(LSM6DSO_Object_t *pObj, float_t *Odr)
- {
- int32_t ret = LSM6DSO_OK;
- @@ -965,24 +965,25 @@ int32_t LSM6DSO_GYRO_GetOutputDataRate(LSM6DSO_Object_t *pObj, float_t *Odr)
- }
-
- /**
- - * @brief Set the LSM6DSO gyroscope sensor output data rate
- - * @param pObj the device pObj
- - * @param Odr the output data rate value to be set
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set the LSM6DSO gyroscope sensor output data rate
- + * @param pObj the device pObj
- + * @param Odr the output data rate value to be set
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_GYRO_SetOutputDataRate(LSM6DSO_Object_t *pObj, float_t Odr)
- {
- return LSM6DSO_GYRO_SetOutputDataRate_With_Mode(pObj, Odr, LSM6DSO_GYRO_HIGH_PERFORMANCE_MODE);
- }
-
- /**
- - * @brief Set the LSM6DSO gyroscope sensor output data rate with operating mode
- - * @param pObj the device pObj
- - * @param Odr the output data rate value to be set
- - * @param Mode the gyroscope operating mode
- - * @retval 0 in case of success, an error code otherwise
- - */
- -int32_t LSM6DSO_GYRO_SetOutputDataRate_With_Mode(LSM6DSO_Object_t *pObj, float_t Odr, LSM6DSO_GYRO_Operating_Mode_t Mode)
- + * @brief Set the LSM6DSO gyroscope sensor output data rate with operating mode
- + * @param pObj the device pObj
- + * @param Odr the output data rate value to be set
- + * @param Mode the gyroscope operating mode
- + * @retval 0 in case of success, an error code otherwise
- + */
- +int32_t LSM6DSO_GYRO_SetOutputDataRate_With_Mode(LSM6DSO_Object_t *pObj, float_t Odr,
- + LSM6DSO_GYRO_Operating_Mode_t Mode)
- {
- int32_t ret = LSM6DSO_OK;
- float_t newOdr = Odr;
- @@ -1058,11 +1059,11 @@ int32_t LSM6DSO_GYRO_SetOutputDataRate_With_Mode(LSM6DSO_Object_t *pObj, float_t
- }
-
- /**
- - * @brief Get the LSM6DSO gyroscope sensor full scale
- - * @param pObj the device pObj
- - * @param FullScale pointer where the full scale is written
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Get the LSM6DSO gyroscope sensor full scale
- + * @param pObj the device pObj
- + * @param FullScale pointer where the full scale is written
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_GYRO_GetFullScale(LSM6DSO_Object_t *pObj, int32_t *FullScale)
- {
- int32_t ret = LSM6DSO_OK;
- @@ -1105,11 +1106,11 @@ int32_t LSM6DSO_GYRO_GetFullScale(LSM6DSO_Object_t *pObj, int32_t *FullScale)
- }
-
- /**
- - * @brief Set the LSM6DSO gyroscope sensor full scale
- - * @param pObj the device pObj
- - * @param FullScale the functional full scale to be set
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set the LSM6DSO gyroscope sensor full scale
- + * @param pObj the device pObj
- + * @param FullScale the functional full scale to be set
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_GYRO_SetFullScale(LSM6DSO_Object_t *pObj, int32_t FullScale)
- {
- lsm6dso_fs_g_t new_fs;
- @@ -1129,11 +1130,11 @@ int32_t LSM6DSO_GYRO_SetFullScale(LSM6DSO_Object_t *pObj, int32_t FullScale)
- }
-
- /**
- - * @brief Get the LSM6DSO gyroscope sensor raw axes
- - * @param pObj the device pObj
- - * @param Value pointer where the raw values of the axes are written
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Get the LSM6DSO gyroscope sensor raw axes
- + * @param pObj the device pObj
- + * @param Value pointer where the raw values of the axes are written
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_GYRO_GetAxesRaw(LSM6DSO_Object_t *pObj, LSM6DSO_AxesRaw_t *Value)
- {
- lsm6dso_axis3bit16_t data_raw;
- @@ -1153,11 +1154,11 @@ int32_t LSM6DSO_GYRO_GetAxesRaw(LSM6DSO_Object_t *pObj, LSM6DSO_AxesRaw_t *Value
- }
-
- /**
- - * @brief Get the LSM6DSO gyroscope sensor axes
- - * @param pObj the device pObj
- - * @param AngularRate pointer where the values of the axes are written
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Get the LSM6DSO gyroscope sensor axes
- + * @param pObj the device pObj
- + * @param AngularRate pointer where the values of the axes are written
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_GYRO_GetAxes(LSM6DSO_Object_t *pObj, LSM6DSO_Axes_t *AngularRate)
- {
- lsm6dso_axis3bit16_t data_raw;
- @@ -1184,12 +1185,12 @@ int32_t LSM6DSO_GYRO_GetAxes(LSM6DSO_Object_t *pObj, LSM6DSO_Axes_t *AngularRate
- }
-
- /**
- - * @brief Get the LSM6DSO register value
- - * @param pObj the device pObj
- - * @param Reg address to be read
- - * @param Data pointer where the value is written
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Get the LSM6DSO register value
- + * @param pObj the device pObj
- + * @param Reg address to be read
- + * @param Data pointer where the value is written
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_Read_Reg(LSM6DSO_Object_t *pObj, uint8_t Reg, uint8_t *Data)
- {
- if (lsm6dso_read_reg(&(pObj->Ctx), Reg, Data, 1) != LSM6DSO_OK)
- @@ -1201,12 +1202,12 @@ int32_t LSM6DSO_Read_Reg(LSM6DSO_Object_t *pObj, uint8_t Reg, uint8_t *Data)
- }
-
- /**
- - * @brief Set the LSM6DSO register value
- - * @param pObj the device pObj
- - * @param Reg address to be written
- - * @param Data value to be written
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set the LSM6DSO register value
- + * @param pObj the device pObj
- + * @param Reg address to be written
- + * @param Data value to be written
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_Write_Reg(LSM6DSO_Object_t *pObj, uint8_t Reg, uint8_t Data)
- {
- if (lsm6dso_write_reg(&(pObj->Ctx), Reg, &Data, 1) != LSM6DSO_OK)
- @@ -1218,11 +1219,11 @@ int32_t LSM6DSO_Write_Reg(LSM6DSO_Object_t *pObj, uint8_t Reg, uint8_t Data)
- }
-
- /**
- - * @brief Set the interrupt latch
- - * @param pObj the device pObj
- - * @param Status value to be written
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set the interrupt latch
- + * @param pObj the device pObj
- + * @param Status value to be written
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_Set_Interrupt_Latch(LSM6DSO_Object_t *pObj, uint8_t Status)
- {
- int32_t ret = LSM6DSO_OK;
- @@ -1266,11 +1267,11 @@ int32_t LSM6DSO_Set_Interrupt_Latch(LSM6DSO_Object_t *pObj, uint8_t Status)
- }
-
- /**
- - * @brief Enable free fall detection
- - * @param pObj the device pObj
- - * @param IntPin interrupt pin line to be used
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Enable free fall detection
- + * @param pObj the device pObj
- + * @param IntPin interrupt pin line to be used
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Enable_Free_Fall_Detection(LSM6DSO_Object_t *pObj, LSM6DSO_SensorIntPin_t IntPin)
- {
- int32_t ret = LSM6DSO_OK;
- @@ -1353,10 +1354,10 @@ int32_t LSM6DSO_ACC_Enable_Free_Fall_Detection(LSM6DSO_Object_t *pObj, LSM6DSO_S
- }
-
- /**
- - * @brief Disable free fall detection
- - * @param pObj the device pObj
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Disable free fall detection
- + * @param pObj the device pObj
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Disable_Free_Fall_Detection(LSM6DSO_Object_t *pObj)
- {
- lsm6dso_pin_int1_route_t val1;
- @@ -1403,11 +1404,11 @@ int32_t LSM6DSO_ACC_Disable_Free_Fall_Detection(LSM6DSO_Object_t *pObj)
- }
-
- /**
- - * @brief Set free fall threshold
- - * @param pObj the device pObj
- - * @param Threshold free fall detection threshold
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set free fall threshold
- + * @param pObj the device pObj
- + * @param Threshold free fall detection threshold
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Set_Free_Fall_Threshold(LSM6DSO_Object_t *pObj, uint8_t Threshold)
- {
- int32_t ret = LSM6DSO_OK;
- @@ -1458,11 +1459,11 @@ int32_t LSM6DSO_ACC_Set_Free_Fall_Threshold(LSM6DSO_Object_t *pObj, uint8_t Thre
- }
-
- /**
- - * @brief Set free fall duration
- - * @param pObj the device pObj
- - * @param Duration free fall detection duration
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set free fall duration
- + * @param pObj the device pObj
- + * @param Duration free fall detection duration
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Set_Free_Fall_Duration(LSM6DSO_Object_t *pObj, uint8_t Duration)
- {
- if (lsm6dso_ff_dur_set(&(pObj->Ctx), Duration) != LSM6DSO_OK)
- @@ -1474,10 +1475,10 @@ int32_t LSM6DSO_ACC_Set_Free_Fall_Duration(LSM6DSO_Object_t *pObj, uint8_t Durat
- }
-
- /**
- - * @brief Enable pedometer
- - * @param pObj the device pObj
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Enable pedometer
- + * @param pObj the device pObj
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Enable_Pedometer(LSM6DSO_Object_t *pObj)
- {
- lsm6dso_pin_int1_route_t val;
- @@ -1541,10 +1542,10 @@ int32_t LSM6DSO_ACC_Enable_Pedometer(LSM6DSO_Object_t *pObj)
- }
-
- /**
- - * @brief Disable pedometer
- - * @param pObj the device pObj
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Disable pedometer
- + * @param pObj the device pObj
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Disable_Pedometer(LSM6DSO_Object_t *pObj)
- {
- lsm6dso_pin_int1_route_t val1;
- @@ -1581,11 +1582,11 @@ int32_t LSM6DSO_ACC_Disable_Pedometer(LSM6DSO_Object_t *pObj)
- }
-
- /**
- - * @brief Get step count
- - * @param pObj the device pObj
- - * @param StepCount step counter
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Get step count
- + * @param pObj the device pObj
- + * @param StepCount step counter
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Get_Step_Count(LSM6DSO_Object_t *pObj, uint16_t *StepCount)
- {
- if (lsm6dso_number_of_steps_get(&(pObj->Ctx), StepCount) != LSM6DSO_OK)
- @@ -1597,10 +1598,10 @@ int32_t LSM6DSO_ACC_Get_Step_Count(LSM6DSO_Object_t *pObj, uint16_t *StepCount)
- }
-
- /**
- - * @brief Enable step counter reset
- - * @param pObj the device pObj
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Enable step counter reset
- + * @param pObj the device pObj
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Step_Counter_Reset(LSM6DSO_Object_t *pObj)
- {
- if (lsm6dso_steps_reset(&(pObj->Ctx)) != LSM6DSO_OK)
- @@ -1612,11 +1613,11 @@ int32_t LSM6DSO_ACC_Step_Counter_Reset(LSM6DSO_Object_t *pObj)
- }
-
- /**
- - * @brief Enable tilt detection
- - * @param pObj the device pObj
- - * @param IntPin interrupt pin line to be used
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Enable tilt detection
- + * @param pObj the device pObj
- + * @param IntPin interrupt pin line to be used
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Enable_Tilt_Detection(LSM6DSO_Object_t *pObj, LSM6DSO_SensorIntPin_t IntPin)
- {
- int32_t ret = LSM6DSO_OK;
- @@ -1700,10 +1701,10 @@ int32_t LSM6DSO_ACC_Enable_Tilt_Detection(LSM6DSO_Object_t *pObj, LSM6DSO_Sensor
- }
-
- /**
- - * @brief Disable tilt detection
- - * @param pObj the device pObj
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Disable tilt detection
- + * @param pObj the device pObj
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Disable_Tilt_Detection(LSM6DSO_Object_t *pObj)
- {
- lsm6dso_pin_int1_route_t val1;
- @@ -1753,11 +1754,11 @@ int32_t LSM6DSO_ACC_Disable_Tilt_Detection(LSM6DSO_Object_t *pObj)
- }
-
- /**
- - * @brief Enable wake up detection
- - * @param pObj the device pObj
- - * @param IntPin interrupt pin line to be used
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Enable wake up detection
- + * @param pObj the device pObj
- + * @param IntPin interrupt pin line to be used
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Enable_Wake_Up_Detection(LSM6DSO_Object_t *pObj, LSM6DSO_SensorIntPin_t IntPin)
- {
- int32_t ret = LSM6DSO_OK;
- @@ -1828,10 +1829,10 @@ int32_t LSM6DSO_ACC_Enable_Wake_Up_Detection(LSM6DSO_Object_t *pObj, LSM6DSO_Sen
- }
-
- /**
- - * @brief Disable wake up detection
- - * @param pObj the device pObj
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Disable wake up detection
- + * @param pObj the device pObj
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Disable_Wake_Up_Detection(LSM6DSO_Object_t *pObj)
- {
- lsm6dso_pin_int1_route_t val1;
- @@ -1878,11 +1879,11 @@ int32_t LSM6DSO_ACC_Disable_Wake_Up_Detection(LSM6DSO_Object_t *pObj)
- }
-
- /**
- - * @brief Set wake up threshold
- - * @param pObj the device pObj
- - * @param Threshold wake up detection threshold
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set wake up threshold
- + * @param pObj the device pObj
- + * @param Threshold wake up detection threshold
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Set_Wake_Up_Threshold(LSM6DSO_Object_t *pObj, uint8_t Threshold)
- {
- /* Set wake up threshold. */
- @@ -1895,11 +1896,11 @@ int32_t LSM6DSO_ACC_Set_Wake_Up_Threshold(LSM6DSO_Object_t *pObj, uint8_t Thresh
- }
-
- /**
- - * @brief Set wake up duration
- - * @param pObj the device pObj
- - * @param Duration wake up detection duration
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set wake up duration
- + * @param pObj the device pObj
- + * @param Duration wake up detection duration
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Set_Wake_Up_Duration(LSM6DSO_Object_t *pObj, uint8_t Duration)
- {
- /* Set wake up duration. */
- @@ -1912,11 +1913,11 @@ int32_t LSM6DSO_ACC_Set_Wake_Up_Duration(LSM6DSO_Object_t *pObj, uint8_t Duratio
- }
-
- /**
- - * @brief Enable single tap detection
- - * @param pObj the device pObj
- - * @param IntPin interrupt pin line to be used
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Enable single tap detection
- + * @param pObj the device pObj
- + * @param IntPin interrupt pin line to be used
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Enable_Single_Tap_Detection(LSM6DSO_Object_t *pObj, LSM6DSO_SensorIntPin_t IntPin)
- {
- int32_t ret = LSM6DSO_OK;
- @@ -2015,10 +2016,10 @@ int32_t LSM6DSO_ACC_Enable_Single_Tap_Detection(LSM6DSO_Object_t *pObj, LSM6DSO_
- }
-
- /**
- - * @brief Disable single tap detection
- - * @param pObj the device pObj
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Disable single tap detection
- + * @param pObj the device pObj
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Disable_Single_Tap_Detection(LSM6DSO_Object_t *pObj)
- {
- lsm6dso_pin_int1_route_t val1;
- @@ -2089,11 +2090,11 @@ int32_t LSM6DSO_ACC_Disable_Single_Tap_Detection(LSM6DSO_Object_t *pObj)
- }
-
- /**
- - * @brief Enable double tap detection
- - * @param pObj the device pObj
- - * @param IntPin interrupt pin line to be used
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Enable double tap detection
- + * @param pObj the device pObj
- + * @param IntPin interrupt pin line to be used
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Enable_Double_Tap_Detection(LSM6DSO_Object_t *pObj, LSM6DSO_SensorIntPin_t IntPin)
- {
- int32_t ret = LSM6DSO_OK;
- @@ -2200,10 +2201,10 @@ int32_t LSM6DSO_ACC_Enable_Double_Tap_Detection(LSM6DSO_Object_t *pObj, LSM6DSO_
- }
-
- /**
- - * @brief Disable double tap detection
- - * @param pObj the device pObj
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Disable double tap detection
- + * @param pObj the device pObj
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Disable_Double_Tap_Detection(LSM6DSO_Object_t *pObj)
- {
- lsm6dso_pin_int1_route_t val1;
- @@ -2286,11 +2287,11 @@ int32_t LSM6DSO_ACC_Disable_Double_Tap_Detection(LSM6DSO_Object_t *pObj)
- }
-
- /**
- - * @brief Set tap threshold
- - * @param pObj the device pObj
- - * @param Threshold tap threshold
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set tap threshold
- + * @param pObj the device pObj
- + * @param Threshold tap threshold
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Set_Tap_Threshold(LSM6DSO_Object_t *pObj, uint8_t Threshold)
- {
- /* Set tap threshold. */
- @@ -2303,11 +2304,11 @@ int32_t LSM6DSO_ACC_Set_Tap_Threshold(LSM6DSO_Object_t *pObj, uint8_t Threshold)
- }
-
- /**
- - * @brief Set tap shock time
- - * @param pObj the device pObj
- - * @param Time tap shock time
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set tap shock time
- + * @param pObj the device pObj
- + * @param Time tap shock time
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Set_Tap_Shock_Time(LSM6DSO_Object_t *pObj, uint8_t Time)
- {
- /* Set tap shock time window. */
- @@ -2320,11 +2321,11 @@ int32_t LSM6DSO_ACC_Set_Tap_Shock_Time(LSM6DSO_Object_t *pObj, uint8_t Time)
- }
-
- /**
- - * @brief Set tap quiet time
- - * @param pObj the device pObj
- - * @param Time tap quiet time
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set tap quiet time
- + * @param pObj the device pObj
- + * @param Time tap quiet time
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Set_Tap_Quiet_Time(LSM6DSO_Object_t *pObj, uint8_t Time)
- {
- /* Set tap quiet time window. */
- @@ -2337,11 +2338,11 @@ int32_t LSM6DSO_ACC_Set_Tap_Quiet_Time(LSM6DSO_Object_t *pObj, uint8_t Time)
- }
-
- /**
- - * @brief Set tap duration time
- - * @param pObj the device pObj
- - * @param Time tap duration time
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set tap duration time
- + * @param pObj the device pObj
- + * @param Time tap duration time
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Set_Tap_Duration_Time(LSM6DSO_Object_t *pObj, uint8_t Time)
- {
- /* Set tap duration time window. */
- @@ -2354,11 +2355,11 @@ int32_t LSM6DSO_ACC_Set_Tap_Duration_Time(LSM6DSO_Object_t *pObj, uint8_t Time)
- }
-
- /**
- - * @brief Enable 6D orientation detection
- - * @param pObj the device pObj
- - * @param IntPin interrupt pin line to be used
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Enable 6D orientation detection
- + * @param pObj the device pObj
- + * @param IntPin interrupt pin line to be used
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Enable_6D_Orientation(LSM6DSO_Object_t *pObj, LSM6DSO_SensorIntPin_t IntPin)
- {
- int32_t ret = LSM6DSO_OK;
- @@ -2423,10 +2424,10 @@ int32_t LSM6DSO_ACC_Enable_6D_Orientation(LSM6DSO_Object_t *pObj, LSM6DSO_Sensor
- }
-
- /**
- - * @brief Disable 6D orientation detection
- - * @param pObj the device pObj
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Disable 6D orientation detection
- + * @param pObj the device pObj
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Disable_6D_Orientation(LSM6DSO_Object_t *pObj)
- {
- lsm6dso_pin_int1_route_t val1;
- @@ -2467,11 +2468,11 @@ int32_t LSM6DSO_ACC_Disable_6D_Orientation(LSM6DSO_Object_t *pObj)
- }
-
- /**
- - * @brief Set 6D orientation threshold
- - * @param pObj the device pObj
- - * @param Threshold 6D Orientation detection threshold
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set 6D orientation threshold
- + * @param pObj the device pObj
- + * @param Threshold 6D Orientation detection threshold
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Set_6D_Orientation_Threshold(LSM6DSO_Object_t *pObj, uint8_t Threshold)
- {
- int32_t ret = LSM6DSO_OK;
- @@ -2496,11 +2497,11 @@ int32_t LSM6DSO_ACC_Set_6D_Orientation_Threshold(LSM6DSO_Object_t *pObj, uint8_t
- break;
- }
-
- - if(ret == LSM6DSO_ERROR)
- + if (ret == LSM6DSO_ERROR)
- {
- return LSM6DSO_ERROR;
- }
- -
- +
- if (lsm6dso_6d_threshold_set(&(pObj->Ctx), newThreshold) != LSM6DSO_OK)
- {
- return LSM6DSO_ERROR;
- @@ -2510,11 +2511,11 @@ int32_t LSM6DSO_ACC_Set_6D_Orientation_Threshold(LSM6DSO_Object_t *pObj, uint8_t
- }
-
- /**
- - * @brief Get the status of XLow orientation
- - * @param pObj the device pObj
- - * @param XLow the status of XLow orientation
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Get the status of XLow orientation
- + * @param pObj the device pObj
- + * @param XLow the status of XLow orientation
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Get_6D_Orientation_XL(LSM6DSO_Object_t *pObj, uint8_t *XLow)
- {
- lsm6dso_d6d_src_t data;
- @@ -2530,11 +2531,11 @@ int32_t LSM6DSO_ACC_Get_6D_Orientation_XL(LSM6DSO_Object_t *pObj, uint8_t *XLow)
- }
-
- /**
- - * @brief Get the status of XHigh orientation
- - * @param pObj the device pObj
- - * @param XHigh the status of XHigh orientation
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Get the status of XHigh orientation
- + * @param pObj the device pObj
- + * @param XHigh the status of XHigh orientation
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Get_6D_Orientation_XH(LSM6DSO_Object_t *pObj, uint8_t *XHigh)
- {
- lsm6dso_d6d_src_t data;
- @@ -2550,11 +2551,11 @@ int32_t LSM6DSO_ACC_Get_6D_Orientation_XH(LSM6DSO_Object_t *pObj, uint8_t *XHigh
- }
-
- /**
- - * @brief Get the status of YLow orientation
- - * @param pObj the device pObj
- - * @param YLow the status of YLow orientation
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Get the status of YLow orientation
- + * @param pObj the device pObj
- + * @param YLow the status of YLow orientation
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Get_6D_Orientation_YL(LSM6DSO_Object_t *pObj, uint8_t *YLow)
- {
- lsm6dso_d6d_src_t data;
- @@ -2570,11 +2571,11 @@ int32_t LSM6DSO_ACC_Get_6D_Orientation_YL(LSM6DSO_Object_t *pObj, uint8_t *YLow)
- }
-
- /**
- - * @brief Get the status of YHigh orientation
- - * @param pObj the device pObj
- - * @param YHigh the status of YHigh orientation
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Get the status of YHigh orientation
- + * @param pObj the device pObj
- + * @param YHigh the status of YHigh orientation
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Get_6D_Orientation_YH(LSM6DSO_Object_t *pObj, uint8_t *YHigh)
- {
- lsm6dso_d6d_src_t data;
- @@ -2590,11 +2591,11 @@ int32_t LSM6DSO_ACC_Get_6D_Orientation_YH(LSM6DSO_Object_t *pObj, uint8_t *YHigh
- }
-
- /**
- - * @brief Get the status of ZLow orientation
- - * @param pObj the device pObj
- - * @param ZLow the status of ZLow orientation
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Get the status of ZLow orientation
- + * @param pObj the device pObj
- + * @param ZLow the status of ZLow orientation
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Get_6D_Orientation_ZL(LSM6DSO_Object_t *pObj, uint8_t *ZLow)
- {
- lsm6dso_d6d_src_t data;
- @@ -2610,11 +2611,11 @@ int32_t LSM6DSO_ACC_Get_6D_Orientation_ZL(LSM6DSO_Object_t *pObj, uint8_t *ZLow)
- }
-
- /**
- - * @brief Get the status of ZHigh orientation
- - * @param pObj the device pObj
- - * @param ZHigh the status of ZHigh orientation
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Get the status of ZHigh orientation
- + * @param pObj the device pObj
- + * @param ZHigh the status of ZHigh orientation
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Get_6D_Orientation_ZH(LSM6DSO_Object_t *pObj, uint8_t *ZHigh)
- {
- lsm6dso_d6d_src_t data;
- @@ -2630,11 +2631,11 @@ int32_t LSM6DSO_ACC_Get_6D_Orientation_ZH(LSM6DSO_Object_t *pObj, uint8_t *ZHigh
- }
-
- /**
- - * @brief Get the LSM6DSO ACC data ready bit value
- - * @param pObj the device pObj
- - * @param Status the status of data ready bit
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Get the LSM6DSO ACC data ready bit value
- + * @param pObj the device pObj
- + * @param Status the status of data ready bit
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Get_DRDY_Status(LSM6DSO_Object_t *pObj, uint8_t *Status)
- {
- if (lsm6dso_xl_flag_data_ready_get(&(pObj->Ctx), Status) != LSM6DSO_OK)
- @@ -2646,11 +2647,11 @@ int32_t LSM6DSO_ACC_Get_DRDY_Status(LSM6DSO_Object_t *pObj, uint8_t *Status)
- }
-
- /**
- - * @brief Get the status of all hardware events
- - * @param pObj the device pObj
- - * @param Status the status of all hardware events
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Get the status of all hardware events
- + * @param pObj the device pObj
- + * @param Status the status of all hardware events
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Get_Event_Status(LSM6DSO_Object_t *pObj, LSM6DSO_Event_Status_t *Status)
- {
- uint8_t tilt_ia;
- @@ -2780,11 +2781,11 @@ int32_t LSM6DSO_ACC_Get_Event_Status(LSM6DSO_Object_t *pObj, LSM6DSO_Event_Statu
- }
-
- /**
- - * @brief Set self test
- - * @param pObj the device pObj
- - * @param val the value of st_xl in reg CTRL5_C
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set self test
- + * @param pObj the device pObj
- + * @param val the value of st_xl in reg CTRL5_C
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Set_SelfTest(LSM6DSO_Object_t *pObj, uint8_t val)
- {
- lsm6dso_st_xl_t reg;
- @@ -2803,11 +2804,11 @@ int32_t LSM6DSO_ACC_Set_SelfTest(LSM6DSO_Object_t *pObj, uint8_t val)
- }
-
- /**
- - * @brief Get the LSM6DSO GYRO data ready bit value
- - * @param pObj the device pObj
- - * @param Status the status of data ready bit
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Get the LSM6DSO GYRO data ready bit value
- + * @param pObj the device pObj
- + * @param Status the status of data ready bit
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_GYRO_Get_DRDY_Status(LSM6DSO_Object_t *pObj, uint8_t *Status)
- {
- if (lsm6dso_gy_flag_data_ready_get(&(pObj->Ctx), Status) != LSM6DSO_OK)
- @@ -2819,11 +2820,11 @@ int32_t LSM6DSO_GYRO_Get_DRDY_Status(LSM6DSO_Object_t *pObj, uint8_t *Status)
- }
-
- /**
- - * @brief Set self test
- - * @param pObj the device pObj
- - * @param val the value of st_xl in reg CTRL5_C
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set self test
- + * @param pObj the device pObj
- + * @param val the value of st_xl in reg CTRL5_C
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_GYRO_Set_SelfTest(LSM6DSO_Object_t *pObj, uint8_t val)
- {
- lsm6dso_st_g_t reg;
- @@ -2843,11 +2844,11 @@ int32_t LSM6DSO_GYRO_Set_SelfTest(LSM6DSO_Object_t *pObj, uint8_t val)
- }
-
- /**
- - * @brief Get the LSM6DSO FIFO number of samples
- - * @param pObj the device pObj
- - * @param NumSamples number of samples
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Get the LSM6DSO FIFO number of samples
- + * @param pObj the device pObj
- + * @param NumSamples number of samples
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_FIFO_Get_Num_Samples(LSM6DSO_Object_t *pObj, uint16_t *NumSamples)
- {
- if (lsm6dso_fifo_data_level_get(&(pObj->Ctx), NumSamples) != LSM6DSO_OK)
- @@ -2859,11 +2860,11 @@ int32_t LSM6DSO_FIFO_Get_Num_Samples(LSM6DSO_Object_t *pObj, uint16_t *NumSample
- }
-
- /**
- - * @brief Get the LSM6DSO FIFO full status
- - * @param pObj the device pObj
- - * @param Status FIFO full status
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Get the LSM6DSO FIFO full status
- + * @param pObj the device pObj
- + * @param Status FIFO full status
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_FIFO_Get_Full_Status(LSM6DSO_Object_t *pObj, uint8_t *Status)
- {
- lsm6dso_reg_t reg;
- @@ -2879,11 +2880,11 @@ int32_t LSM6DSO_FIFO_Get_Full_Status(LSM6DSO_Object_t *pObj, uint8_t *Status)
- }
-
- /**
- - * @brief Set the LSM6DSO FIFO full interrupt on INT1 pin
- - * @param pObj the device pObj
- - * @param Status FIFO full interrupt on INT1 pin status
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set the LSM6DSO FIFO full interrupt on INT1 pin
- + * @param pObj the device pObj
- + * @param Status FIFO full interrupt on INT1 pin status
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_FIFO_Set_INT1_FIFO_Full(LSM6DSO_Object_t *pObj, uint8_t Status)
- {
- lsm6dso_reg_t reg;
- @@ -2904,11 +2905,11 @@ int32_t LSM6DSO_FIFO_Set_INT1_FIFO_Full(LSM6DSO_Object_t *pObj, uint8_t Status)
- }
-
- /**
- - * @brief Set the LSM6DSO FIFO watermark level
- - * @param pObj the device pObj
- - * @param Watermark FIFO watermark level
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set the LSM6DSO FIFO watermark level
- + * @param pObj the device pObj
- + * @param Watermark FIFO watermark level
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_FIFO_Set_Watermark_Level(LSM6DSO_Object_t *pObj, uint16_t Watermark)
- {
- if (lsm6dso_fifo_watermark_set(&(pObj->Ctx), Watermark) != LSM6DSO_OK)
- @@ -2920,11 +2921,11 @@ int32_t LSM6DSO_FIFO_Set_Watermark_Level(LSM6DSO_Object_t *pObj, uint16_t Waterm
- }
-
- /**
- - * @brief Set the LSM6DSO FIFO stop on watermark
- - * @param pObj the device pObj
- - * @param Status FIFO stop on watermark status
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set the LSM6DSO FIFO stop on watermark
- + * @param pObj the device pObj
- + * @param Status FIFO stop on watermark status
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_FIFO_Set_Stop_On_Fth(LSM6DSO_Object_t *pObj, uint8_t Status)
- {
- if (lsm6dso_fifo_stop_on_wtm_set(&(pObj->Ctx), Status) != LSM6DSO_OK)
- @@ -2936,11 +2937,11 @@ int32_t LSM6DSO_FIFO_Set_Stop_On_Fth(LSM6DSO_Object_t *pObj, uint8_t Status)
- }
-
- /**
- - * @brief Set the LSM6DSO FIFO mode
- - * @param pObj the device pObj
- - * @param Mode FIFO mode
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set the LSM6DSO FIFO mode
- + * @param pObj the device pObj
- + * @param Mode FIFO mode
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_FIFO_Set_Mode(LSM6DSO_Object_t *pObj, uint8_t Mode)
- {
- int32_t ret = LSM6DSO_OK;
- @@ -2985,31 +2986,31 @@ int32_t LSM6DSO_FIFO_Set_Mode(LSM6DSO_Object_t *pObj, uint8_t Mode)
- }
-
- /**
- - * @brief Get the LSM6DSO FIFO tag
- - * @param pObj the device pObj
- - * @param Tag FIFO tag
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Get the LSM6DSO FIFO tag
- + * @param pObj the device pObj
- + * @param Tag FIFO tag
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_FIFO_Get_Tag(LSM6DSO_Object_t *pObj, uint8_t *Tag)
- {
- lsm6dso_fifo_tag_t tag_local;
-
- - if (lsm6dso_fifo_sensor_tag_get(&(pObj->Ctx), &tag_local) != LSM6DSO_OK)
- + if (lsm6dso_fifo_sensor_tag_get(&(pObj->Ctx), &tag_local) != LSM6DSO_OK)
- {
- return LSM6DSO_ERROR;
- }
-
- - *Tag = (uint8_t)tag_local;
- + *Tag = (uint8_t)tag_local;
-
- return LSM6DSO_OK;
- }
-
- /**
- - * @brief Get the LSM6DSO FIFO raw data
- - * @param pObj the device pObj
- - * @param Data FIFO raw data array [6]
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Get the LSM6DSO FIFO raw data
- + * @param pObj the device pObj
- + * @param Data FIFO raw data array [6]
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_FIFO_Get_Data(LSM6DSO_Object_t *pObj, uint8_t *Data)
- {
- if (lsm6dso_read_reg(&(pObj->Ctx), LSM6DSO_FIFO_DATA_OUT_X_L, Data, 6) != LSM6DSO_OK)
- @@ -3021,11 +3022,11 @@ int32_t LSM6DSO_FIFO_Get_Data(LSM6DSO_Object_t *pObj, uint8_t *Data)
- }
-
- /**
- - * @brief Get the LSM6DSO FIFO accelero single sample (16-bit data per 3 axes) and calculate acceleration [mg]
- - * @param pObj the device pObj
- - * @param Acceleration FIFO accelero axes [mg]
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Get the LSM6DSO FIFO accelero single sample (16-bit data per 3 axes) and calculate acceleration [mg]
- + * @param pObj the device pObj
- + * @param Acceleration FIFO accelero axes [mg]
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_FIFO_ACC_Get_Axes(LSM6DSO_Object_t *pObj, LSM6DSO_Axes_t *Acceleration)
- {
- lsm6dso_axis3bit16_t data_raw;
- @@ -3054,26 +3055,26 @@ int32_t LSM6DSO_FIFO_ACC_Get_Axes(LSM6DSO_Object_t *pObj, LSM6DSO_Axes_t *Accele
- }
-
- /**
- - * @brief Set the LSM6DSO FIFO accelero BDR value
- - * @param pObj the device pObj
- - * @param Bdr FIFO accelero BDR value
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set the LSM6DSO FIFO accelero BDR value
- + * @param pObj the device pObj
- + * @param Bdr FIFO accelero BDR value
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_FIFO_ACC_Set_BDR(LSM6DSO_Object_t *pObj, float_t Bdr)
- {
- lsm6dso_bdr_xl_t new_bdr;
-
- new_bdr = (Bdr <= 0.0f) ? LSM6DSO_XL_NOT_BATCHED
- - : (Bdr <= 12.5f) ? LSM6DSO_XL_BATCHED_AT_12Hz5
- - : (Bdr <= 26.0f) ? LSM6DSO_XL_BATCHED_AT_26Hz
- - : (Bdr <= 52.0f) ? LSM6DSO_XL_BATCHED_AT_52Hz
- - : (Bdr <= 104.0f) ? LSM6DSO_XL_BATCHED_AT_104Hz
- - : (Bdr <= 208.0f) ? LSM6DSO_XL_BATCHED_AT_208Hz
- - : (Bdr <= 417.0f) ? LSM6DSO_XL_BATCHED_AT_417Hz
- - : (Bdr <= 833.0f) ? LSM6DSO_XL_BATCHED_AT_833Hz
- - : (Bdr <= 1667.0f) ? LSM6DSO_XL_BATCHED_AT_1667Hz
- - : (Bdr <= 3333.0f) ? LSM6DSO_XL_BATCHED_AT_3333Hz
- - : LSM6DSO_XL_BATCHED_AT_6667Hz;
- + : (Bdr <= 12.5f) ? LSM6DSO_XL_BATCHED_AT_12Hz5
- + : (Bdr <= 26.0f) ? LSM6DSO_XL_BATCHED_AT_26Hz
- + : (Bdr <= 52.0f) ? LSM6DSO_XL_BATCHED_AT_52Hz
- + : (Bdr <= 104.0f) ? LSM6DSO_XL_BATCHED_AT_104Hz
- + : (Bdr <= 208.0f) ? LSM6DSO_XL_BATCHED_AT_208Hz
- + : (Bdr <= 417.0f) ? LSM6DSO_XL_BATCHED_AT_417Hz
- + : (Bdr <= 833.0f) ? LSM6DSO_XL_BATCHED_AT_833Hz
- + : (Bdr <= 1667.0f) ? LSM6DSO_XL_BATCHED_AT_1667Hz
- + : (Bdr <= 3333.0f) ? LSM6DSO_XL_BATCHED_AT_3333Hz
- + : LSM6DSO_XL_BATCHED_AT_6667Hz;
-
- if (lsm6dso_fifo_xl_batch_set(&(pObj->Ctx), new_bdr) != LSM6DSO_OK)
- {
- @@ -3084,11 +3085,11 @@ int32_t LSM6DSO_FIFO_ACC_Set_BDR(LSM6DSO_Object_t *pObj, float_t Bdr)
- }
-
- /**
- - * @brief Get the LSM6DSO FIFO gyro single sample (16-bit data per 3 axes) and calculate angular velocity [mDPS]
- - * @param pObj the device pObj
- - * @param AngularVelocity FIFO gyro axes [mDPS]
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Get the LSM6DSO FIFO gyro single sample (16-bit data per 3 axes) and calculate angular velocity [mDPS]
- + * @param pObj the device pObj
- + * @param AngularVelocity FIFO gyro axes [mDPS]
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_FIFO_GYRO_Get_Axes(LSM6DSO_Object_t *pObj, LSM6DSO_Axes_t *AngularVelocity)
- {
- lsm6dso_axis3bit16_t data_raw;
- @@ -3117,26 +3118,26 @@ int32_t LSM6DSO_FIFO_GYRO_Get_Axes(LSM6DSO_Object_t *pObj, LSM6DSO_Axes_t *Angul
- }
-
- /**
- - * @brief Set the LSM6DSO FIFO gyro BDR value
- - * @param pObj the device pObj
- - * @param Bdr FIFO gyro BDR value
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set the LSM6DSO FIFO gyro BDR value
- + * @param pObj the device pObj
- + * @param Bdr FIFO gyro BDR value
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_FIFO_GYRO_Set_BDR(LSM6DSO_Object_t *pObj, float_t Bdr)
- {
- lsm6dso_bdr_gy_t new_bdr;
-
- new_bdr = (Bdr <= 0.0f) ? LSM6DSO_GY_NOT_BATCHED
- - : (Bdr <= 12.5f) ? LSM6DSO_GY_BATCHED_AT_12Hz5
- - : (Bdr <= 26.0f) ? LSM6DSO_GY_BATCHED_AT_26Hz
- - : (Bdr <= 52.0f) ? LSM6DSO_GY_BATCHED_AT_52Hz
- - : (Bdr <= 104.0f) ? LSM6DSO_GY_BATCHED_AT_104Hz
- - : (Bdr <= 208.0f) ? LSM6DSO_GY_BATCHED_AT_208Hz
- - : (Bdr <= 417.0f) ? LSM6DSO_GY_BATCHED_AT_417Hz
- - : (Bdr <= 833.0f) ? LSM6DSO_GY_BATCHED_AT_833Hz
- - : (Bdr <= 1667.0f) ? LSM6DSO_GY_BATCHED_AT_1667Hz
- - : (Bdr <= 3333.0f) ? LSM6DSO_GY_BATCHED_AT_3333Hz
- - : LSM6DSO_GY_BATCHED_AT_6667Hz;
- + : (Bdr <= 12.5f) ? LSM6DSO_GY_BATCHED_AT_12Hz5
- + : (Bdr <= 26.0f) ? LSM6DSO_GY_BATCHED_AT_26Hz
- + : (Bdr <= 52.0f) ? LSM6DSO_GY_BATCHED_AT_52Hz
- + : (Bdr <= 104.0f) ? LSM6DSO_GY_BATCHED_AT_104Hz
- + : (Bdr <= 208.0f) ? LSM6DSO_GY_BATCHED_AT_208Hz
- + : (Bdr <= 417.0f) ? LSM6DSO_GY_BATCHED_AT_417Hz
- + : (Bdr <= 833.0f) ? LSM6DSO_GY_BATCHED_AT_833Hz
- + : (Bdr <= 1667.0f) ? LSM6DSO_GY_BATCHED_AT_1667Hz
- + : (Bdr <= 3333.0f) ? LSM6DSO_GY_BATCHED_AT_3333Hz
- + : LSM6DSO_GY_BATCHED_AT_6667Hz;
-
- if (lsm6dso_fifo_gy_batch_set(&(pObj->Ctx), new_bdr) != LSM6DSO_OK)
- {
- @@ -3147,10 +3148,10 @@ int32_t LSM6DSO_FIFO_GYRO_Set_BDR(LSM6DSO_Object_t *pObj, float_t Bdr)
- }
-
- /**
- - * @brief Enable LSM6DSO accelerometer DRDY interrupt on INT1
- - * @param pObj the device pObj
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Enable LSM6DSO accelerometer DRDY interrupt on INT1
- + * @param pObj the device pObj
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Enable_DRDY_On_INT1(LSM6DSO_Object_t *pObj)
- {
- lsm6dso_pin_int1_route_t pin_int1_route;
- @@ -3171,10 +3172,10 @@ int32_t LSM6DSO_ACC_Enable_DRDY_On_INT1(LSM6DSO_Object_t *pObj)
- }
-
- /**
- - * @brief Disable LSM6DSO accelerometer DRDY interrupt on INT1
- - * @param pObj the device pObj
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Disable LSM6DSO accelerometer DRDY interrupt on INT1
- + * @param pObj the device pObj
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Disable_DRDY_On_INT1(LSM6DSO_Object_t *pObj)
- {
- lsm6dso_pin_int1_route_t pin_int1_route;
- @@ -3194,11 +3195,11 @@ int32_t LSM6DSO_ACC_Disable_DRDY_On_INT1(LSM6DSO_Object_t *pObj)
- }
-
- /**
- - * @brief Set the LSM6DSO accelerometer power mode
- - * @param pObj the device pObj
- - * @param PowerMode Value of the powerMode
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set the LSM6DSO accelerometer power mode
- + * @param pObj the device pObj
- + * @param PowerMode Value of the powerMode
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Set_Power_Mode(LSM6DSO_Object_t *pObj, uint8_t PowerMode)
- {
- int32_t ret = LSM6DSO_OK;
- @@ -3234,12 +3235,12 @@ int32_t LSM6DSO_ACC_Set_Power_Mode(LSM6DSO_Object_t *pObj, uint8_t PowerMode)
- }
-
- /**
- - * @brief Set the LSM6DSO accelerometer filter mode
- - * @param pObj the device pObj
- - * @param LowHighPassFlag 0/1 for setting low-pass/high-pass filter mode
- - * @param FilterMode Value of the filter Mode
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set the LSM6DSO accelerometer filter mode
- + * @param pObj the device pObj
- + * @param LowHighPassFlag 0/1 for setting low-pass/high-pass filter mode
- + * @param FilterMode Value of the filter Mode
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Set_Filter_Mode(LSM6DSO_Object_t *pObj, uint8_t LowHighPassFlag, uint8_t FilterMode)
- {
- int32_t ret = LSM6DSO_OK;
- @@ -3352,13 +3353,14 @@ int32_t LSM6DSO_ACC_Set_Filter_Mode(LSM6DSO_Object_t *pObj, uint8_t LowHighPassF
- }
-
- /**
- - * @brief Enable LSM6DSO accelerometer inactivity detection
- - * @param pObj the device pObj
- - * @param InactMode inactivity detection mode
- - * @param IntPin interrupt pin line to be used
- - * @retval 0 in case of success, an error code otherwise
- - */
- -int32_t LSM6DSO_ACC_Enable_Inactivity_Detection(LSM6DSO_Object_t *pObj, lsm6dso_inact_en_t InactMode, LSM6DSO_SensorIntPin_t IntPin)
- + * @brief Enable LSM6DSO accelerometer inactivity detection
- + * @param pObj the device pObj
- + * @param InactMode inactivity detection mode
- + * @param IntPin interrupt pin line to be used
- + * @retval 0 in case of success, an error code otherwise
- + */
- +int32_t LSM6DSO_ACC_Enable_Inactivity_Detection(LSM6DSO_Object_t *pObj, lsm6dso_inact_en_t InactMode,
- + LSM6DSO_SensorIntPin_t IntPin)
- {
- lsm6dso_pin_int1_route_t val1;
- lsm6dso_pin_int2_route_t val2;
- @@ -3381,7 +3383,7 @@ int32_t LSM6DSO_ACC_Enable_Inactivity_Detection(LSM6DSO_Object_t *pObj, lsm6dso_
- }
-
- /* Enable inactivity detection. */
- - switch(InactMode)
- + switch (InactMode)
- {
- case LSM6DSO_XL_AND_GY_NOT_AFFECTED:
- {
- @@ -3419,7 +3421,7 @@ int32_t LSM6DSO_ACC_Enable_Inactivity_Detection(LSM6DSO_Object_t *pObj, lsm6dso_
- ret = LSM6DSO_ERROR;
- break;
- }
- -
- +
- if (ret == LSM6DSO_ERROR)
- {
- return LSM6DSO_ERROR;
- @@ -3465,10 +3467,10 @@ int32_t LSM6DSO_ACC_Enable_Inactivity_Detection(LSM6DSO_Object_t *pObj, lsm6dso_
- }
-
- /**
- - * @brief Disable LSM6DSO accelerometer inactivity detection
- - * @param pObj the device pObj
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Disable LSM6DSO accelerometer inactivity detection
- + * @param pObj the device pObj
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Disable_Inactivity_Detection(LSM6DSO_Object_t *pObj)
- {
- lsm6dso_pin_int1_route_t val1;
- @@ -3514,11 +3516,11 @@ int32_t LSM6DSO_ACC_Disable_Inactivity_Detection(LSM6DSO_Object_t *pObj)
- }
-
- /**
- - * @brief Set LSM6DSO accelerometer sleep duration
- - * @param pObj the device pObj
- - * @param Duration wake up detection duration
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set LSM6DSO accelerometer sleep duration
- + * @param pObj the device pObj
- + * @param Duration wake up detection duration
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_ACC_Set_Sleep_Duration(LSM6DSO_Object_t *pObj, uint8_t Duration)
- {
- /* Set wake up duration. */
- @@ -3531,10 +3533,10 @@ int32_t LSM6DSO_ACC_Set_Sleep_Duration(LSM6DSO_Object_t *pObj, uint8_t Duration)
- }
-
- /**
- - * @brief Enable LSM6DSO gyroscope DRDY interrupt on INT2
- - * @param pObj the device pObj
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Enable LSM6DSO gyroscope DRDY interrupt on INT2
- + * @param pObj the device pObj
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_GYRO_Enable_DRDY_On_INT2(LSM6DSO_Object_t *pObj)
- {
- lsm6dso_pin_int2_route_t pin_int2_route;
- @@ -3555,11 +3557,11 @@ int32_t LSM6DSO_GYRO_Enable_DRDY_On_INT2(LSM6DSO_Object_t *pObj)
- }
-
- /**
- - * @brief Set the LSM6DSO gyroscope power mode
- - * @param pObj the device pObj
- - * @param PowerMode Value of the powerMode
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set the LSM6DSO gyroscope power mode
- + * @param pObj the device pObj
- + * @param PowerMode Value of the powerMode
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_GYRO_Set_Power_Mode(LSM6DSO_Object_t *pObj, uint8_t PowerMode)
- {
- int32_t ret = LSM6DSO_OK;
- @@ -3592,12 +3594,12 @@ int32_t LSM6DSO_GYRO_Set_Power_Mode(LSM6DSO_Object_t *pObj, uint8_t PowerMode)
- }
-
- /**
- - * @brief Set the LSM6DSO gyroscope filter mode
- - * @param pObj the device pObj
- - * @param LowHighPassFlag 0/1 for setting low-pass/high-pass filter mode
- - * @param FilterMode Value of the filter Mode
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set the LSM6DSO gyroscope filter mode
- + * @param pObj the device pObj
- + * @param LowHighPassFlag 0/1 for setting low-pass/high-pass filter mode
- + * @param FilterMode Value of the filter Mode
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_GYRO_Set_Filter_Mode(LSM6DSO_Object_t *pObj, uint8_t LowHighPassFlag, uint8_t FilterMode)
- {
- int32_t ret = LSM6DSO_OK;
- @@ -3694,11 +3696,11 @@ int32_t LSM6DSO_GYRO_Set_Filter_Mode(LSM6DSO_Object_t *pObj, uint8_t LowHighPass
- }
-
- /**
- - * @brief Set LSM6DSO DRDY mode
- - * @param pObj the device pObj
- - * @param Mode DRDY mode
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set LSM6DSO DRDY mode
- + * @param pObj the device pObj
- + * @param Mode DRDY mode
- + * @retval 0 in case of success, an error code otherwise
- + */
- int32_t LSM6DSO_DRDY_Set_Mode(LSM6DSO_Object_t *pObj, uint8_t Mode)
- {
- int32_t ret = LSM6DSO_OK;
- @@ -3732,34 +3734,34 @@ int32_t LSM6DSO_DRDY_Set_Mode(LSM6DSO_Object_t *pObj, uint8_t Mode)
- }
-
- /**
- - * @}
- - */
- + * @}
- + */
-
- /** @defgroup LSM6DSO_Private_Functions LSM6DSO Private Functions
- - * @{
- - */
- + * @{
- + */
-
- /**
- - * @brief Set the LSM6DSO accelerometer sensor output data rate when enabled
- - * @param pObj the device pObj
- - * @param Odr the functional output data rate to be set
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set the LSM6DSO accelerometer sensor output data rate when enabled
- + * @param pObj the device pObj
- + * @param Odr the functional output data rate to be set
- + * @retval 0 in case of success, an error code otherwise
- + */
- static int32_t LSM6DSO_ACC_SetOutputDataRate_When_Enabled(LSM6DSO_Object_t *pObj, float_t Odr)
- {
- lsm6dso_odr_xl_t new_odr;
-
- new_odr = (Odr <= 1.6f) ? LSM6DSO_XL_ODR_1Hz6
- - : (Odr <= 12.5f) ? LSM6DSO_XL_ODR_12Hz5
- - : (Odr <= 26.0f) ? LSM6DSO_XL_ODR_26Hz
- - : (Odr <= 52.0f) ? LSM6DSO_XL_ODR_52Hz
- - : (Odr <= 104.0f) ? LSM6DSO_XL_ODR_104Hz
- - : (Odr <= 208.0f) ? LSM6DSO_XL_ODR_208Hz
- - : (Odr <= 417.0f) ? LSM6DSO_XL_ODR_417Hz
- - : (Odr <= 833.0f) ? LSM6DSO_XL_ODR_833Hz
- - : (Odr <= 1667.0f) ? LSM6DSO_XL_ODR_1667Hz
- - : (Odr <= 3333.0f) ? LSM6DSO_XL_ODR_3333Hz
- - : LSM6DSO_XL_ODR_6667Hz;
- + : (Odr <= 12.5f) ? LSM6DSO_XL_ODR_12Hz5
- + : (Odr <= 26.0f) ? LSM6DSO_XL_ODR_26Hz
- + : (Odr <= 52.0f) ? LSM6DSO_XL_ODR_52Hz
- + : (Odr <= 104.0f) ? LSM6DSO_XL_ODR_104Hz
- + : (Odr <= 208.0f) ? LSM6DSO_XL_ODR_208Hz
- + : (Odr <= 417.0f) ? LSM6DSO_XL_ODR_417Hz
- + : (Odr <= 833.0f) ? LSM6DSO_XL_ODR_833Hz
- + : (Odr <= 1667.0f) ? LSM6DSO_XL_ODR_1667Hz
- + : (Odr <= 3333.0f) ? LSM6DSO_XL_ODR_3333Hz
- + : LSM6DSO_XL_ODR_6667Hz;
-
- /* Output data rate selection. */
- if (lsm6dso_xl_data_rate_set(&(pObj->Ctx), new_odr) != LSM6DSO_OK)
- @@ -3771,48 +3773,48 @@ static int32_t LSM6DSO_ACC_SetOutputDataRate_When_Enabled(LSM6DSO_Object_t *pObj
- }
-
- /**
- - * @brief Set the LSM6DSO accelerometer sensor output data rate when disabled
- - * @param pObj the device pObj
- - * @param Odr the functional output data rate to be set
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set the LSM6DSO accelerometer sensor output data rate when disabled
- + * @param pObj the device pObj
- + * @param Odr the functional output data rate to be set
- + * @retval 0 in case of success, an error code otherwise
- + */
- static int32_t LSM6DSO_ACC_SetOutputDataRate_When_Disabled(LSM6DSO_Object_t *pObj, float_t Odr)
- {
- pObj->acc_odr = (Odr <= 1.6f) ? LSM6DSO_XL_ODR_1Hz6
- - : (Odr <= 12.5f) ? LSM6DSO_XL_ODR_12Hz5
- - : (Odr <= 26.0f) ? LSM6DSO_XL_ODR_26Hz
- - : (Odr <= 52.0f) ? LSM6DSO_XL_ODR_52Hz
- - : (Odr <= 104.0f) ? LSM6DSO_XL_ODR_104Hz
- - : (Odr <= 208.0f) ? LSM6DSO_XL_ODR_208Hz
- - : (Odr <= 417.0f) ? LSM6DSO_XL_ODR_417Hz
- - : (Odr <= 833.0f) ? LSM6DSO_XL_ODR_833Hz
- - : (Odr <= 1667.0f) ? LSM6DSO_XL_ODR_1667Hz
- - : (Odr <= 3333.0f) ? LSM6DSO_XL_ODR_3333Hz
- - : LSM6DSO_XL_ODR_6667Hz;
- + : (Odr <= 12.5f) ? LSM6DSO_XL_ODR_12Hz5
- + : (Odr <= 26.0f) ? LSM6DSO_XL_ODR_26Hz
- + : (Odr <= 52.0f) ? LSM6DSO_XL_ODR_52Hz
- + : (Odr <= 104.0f) ? LSM6DSO_XL_ODR_104Hz
- + : (Odr <= 208.0f) ? LSM6DSO_XL_ODR_208Hz
- + : (Odr <= 417.0f) ? LSM6DSO_XL_ODR_417Hz
- + : (Odr <= 833.0f) ? LSM6DSO_XL_ODR_833Hz
- + : (Odr <= 1667.0f) ? LSM6DSO_XL_ODR_1667Hz
- + : (Odr <= 3333.0f) ? LSM6DSO_XL_ODR_3333Hz
- + : LSM6DSO_XL_ODR_6667Hz;
-
- return LSM6DSO_OK;
- }
-
- /**
- - * @brief Set the LSM6DSO gyroscope sensor output data rate when enabled
- - * @param pObj the device pObj
- - * @param Odr the functional output data rate to be set
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set the LSM6DSO gyroscope sensor output data rate when enabled
- + * @param pObj the device pObj
- + * @param Odr the functional output data rate to be set
- + * @retval 0 in case of success, an error code otherwise
- + */
- static int32_t LSM6DSO_GYRO_SetOutputDataRate_When_Enabled(LSM6DSO_Object_t *pObj, float_t Odr)
- {
- lsm6dso_odr_g_t new_odr;
-
- new_odr = (Odr <= 12.5f) ? LSM6DSO_GY_ODR_12Hz5
- - : (Odr <= 26.0f) ? LSM6DSO_GY_ODR_26Hz
- - : (Odr <= 52.0f) ? LSM6DSO_GY_ODR_52Hz
- - : (Odr <= 104.0f) ? LSM6DSO_GY_ODR_104Hz
- - : (Odr <= 208.0f) ? LSM6DSO_GY_ODR_208Hz
- - : (Odr <= 417.0f) ? LSM6DSO_GY_ODR_417Hz
- - : (Odr <= 833.0f) ? LSM6DSO_GY_ODR_833Hz
- - : (Odr <= 1667.0f) ? LSM6DSO_GY_ODR_1667Hz
- - : (Odr <= 3333.0f) ? LSM6DSO_GY_ODR_3333Hz
- - : LSM6DSO_GY_ODR_6667Hz;
- + : (Odr <= 26.0f) ? LSM6DSO_GY_ODR_26Hz
- + : (Odr <= 52.0f) ? LSM6DSO_GY_ODR_52Hz
- + : (Odr <= 104.0f) ? LSM6DSO_GY_ODR_104Hz
- + : (Odr <= 208.0f) ? LSM6DSO_GY_ODR_208Hz
- + : (Odr <= 417.0f) ? LSM6DSO_GY_ODR_417Hz
- + : (Odr <= 833.0f) ? LSM6DSO_GY_ODR_833Hz
- + : (Odr <= 1667.0f) ? LSM6DSO_GY_ODR_1667Hz
- + : (Odr <= 3333.0f) ? LSM6DSO_GY_ODR_3333Hz
- + : LSM6DSO_GY_ODR_6667Hz;
-
- /* Output data rate selection. */
- if (lsm6dso_gy_data_rate_set(&(pObj->Ctx), new_odr) != LSM6DSO_OK)
- @@ -3824,50 +3826,50 @@ static int32_t LSM6DSO_GYRO_SetOutputDataRate_When_Enabled(LSM6DSO_Object_t *pOb
- }
-
- /**
- - * @brief Set the LSM6DSO gyroscope sensor output data rate when disabled
- - * @param pObj the device pObj
- - * @param Odr the functional output data rate to be set
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Set the LSM6DSO gyroscope sensor output data rate when disabled
- + * @param pObj the device pObj
- + * @param Odr the functional output data rate to be set
- + * @retval 0 in case of success, an error code otherwise
- + */
- static int32_t LSM6DSO_GYRO_SetOutputDataRate_When_Disabled(LSM6DSO_Object_t *pObj, float_t Odr)
- {
- pObj->gyro_odr = (Odr <= 12.5f) ? LSM6DSO_GY_ODR_12Hz5
- - : (Odr <= 26.0f) ? LSM6DSO_GY_ODR_26Hz
- - : (Odr <= 52.0f) ? LSM6DSO_GY_ODR_52Hz
- - : (Odr <= 104.0f) ? LSM6DSO_GY_ODR_104Hz
- - : (Odr <= 208.0f) ? LSM6DSO_GY_ODR_208Hz
- - : (Odr <= 417.0f) ? LSM6DSO_GY_ODR_417Hz
- - : (Odr <= 833.0f) ? LSM6DSO_GY_ODR_833Hz
- - : (Odr <= 1667.0f) ? LSM6DSO_GY_ODR_1667Hz
- - : (Odr <= 3333.0f) ? LSM6DSO_GY_ODR_3333Hz
- - : LSM6DSO_GY_ODR_6667Hz;
- + : (Odr <= 26.0f) ? LSM6DSO_GY_ODR_26Hz
- + : (Odr <= 52.0f) ? LSM6DSO_GY_ODR_52Hz
- + : (Odr <= 104.0f) ? LSM6DSO_GY_ODR_104Hz
- + : (Odr <= 208.0f) ? LSM6DSO_GY_ODR_208Hz
- + : (Odr <= 417.0f) ? LSM6DSO_GY_ODR_417Hz
- + : (Odr <= 833.0f) ? LSM6DSO_GY_ODR_833Hz
- + : (Odr <= 1667.0f) ? LSM6DSO_GY_ODR_1667Hz
- + : (Odr <= 3333.0f) ? LSM6DSO_GY_ODR_3333Hz
- + : LSM6DSO_GY_ODR_6667Hz;
-
- return LSM6DSO_OK;
- }
-
- /**
- - * @brief This function provides a minimum delay based on Tick counter
- - * @param pObj the device pObj
- - * @param msDelay delay expressed in ms
- - * @retval None
- - */
- + * @brief This function provides a minimum delay based on Tick counter
- + * @param pObj the device pObj
- + * @param msDelay delay expressed in ms
- + * @retval None
- + */
- static void LSM6DSO_Delay(LSM6DSO_Object_t *pObj, uint32_t msDelay)
- {
- uint32_t tickstart = pObj->IO.GetTick();
-
- - while((pObj->IO.GetTick() - tickstart) < msDelay)
- + while ((pObj->IO.GetTick() - tickstart) < msDelay)
- {
- }
- }
-
- /**
- - * @brief Wrap Read register component function to Bus IO function
- - * @param Handle the device handler
- - * @param Reg the register address
- - * @param pData the stored data pointer
- - * @param Length the length
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Wrap Read register component function to Bus IO function
- + * @param Handle the device handler
- + * @param Reg the register address
- + * @param pData the stored data pointer
- + * @param Length the length
- + * @retval 0 in case of success, an error code otherwise
- + */
- static int32_t ReadRegWrap(void *Handle, uint8_t Reg, uint8_t *pData, uint16_t Length)
- {
- LSM6DSO_Object_t *pObj = (LSM6DSO_Object_t *)Handle;
- @@ -3876,13 +3878,13 @@ static int32_t ReadRegWrap(void *Handle, uint8_t Reg, uint8_t *pData, uint16_t L
- }
-
- /**
- - * @brief Wrap Write register component function to Bus IO function
- - * @param Handle the device handler
- - * @param Reg the register address
- - * @param pData the stored data pointer
- - * @param Length the length
- - * @retval 0 in case of success, an error code otherwise
- - */
- + * @brief Wrap Write register component function to Bus IO function
- + * @param Handle the device handler
- + * @param Reg the register address
- + * @param pData the stored data pointer
- + * @param Length the length
- + * @retval 0 in case of success, an error code otherwise
- + */
- static int32_t WriteRegWrap(void *Handle, uint8_t Reg, uint8_t *pData, uint16_t Length)
- {
- LSM6DSO_Object_t *pObj = (LSM6DSO_Object_t *)Handle;
- @@ -3905,5 +3907,3 @@ static int32_t WriteRegWrap(void *Handle, uint8_t Reg, uint8_t *pData, uint16_t
- /**
- * @}
- */
- -
- -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
- diff --git a/lsm6dso.h b/lsm6dso.h
- index 420265701..1843df0ac 100644
- --- a/lsm6dso.h
- +++ b/lsm6dso.h
- @@ -1,21 +1,20 @@
- /**
- - ******************************************************************************
- - * @file lsm6dso.h
- - * @author MEMS Software Solutions Team
- - * @brief LSM6DSO header driver file
- - ******************************************************************************
- - * @attention
- - *
- - * <h2><center>© Copyright (c) 2019 STMicroelectronics.
- - * All rights reserved.</center></h2>
- - *
- - * This software component is licensed by ST under BSD 3-Clause license,
- - * the "License"; You may not use this file except in compliance with the
- - * License. You may obtain a copy of the License at:
- - * opensource.org/licenses/BSD-3-Clause
- - *
- - ******************************************************************************
- - */
- + ******************************************************************************
- + * @file lsm6dso.h
- + * @author MEMS Software Solutions Team
- + * @brief LSM6DSO header driver file
- + ******************************************************************************
- + * @attention
- + *
- + * Copyright (c) 2019 STMicroelectronics.
- + * All rights reserved.
- + *
- + * This software is licensed under terms that can be found in the LICENSE file
- + * in the root directory of this software component.
- + * If no LICENSE file comes with this software, it is provided AS-IS.
- + *
- + ******************************************************************************
- + */
-
- /* Define to prevent recursive inclusion -------------------------------------*/
- #ifndef LSM6DSO_H
- @@ -31,24 +30,25 @@ extern "C"
- #include <string.h>
-
- /** @addtogroup BSP BSP
- - * @{
- - */
- + * @{
- + */
-
- /** @addtogroup Component Component
- - * @{
- - */
- + * @{
- + */
-
- /** @addtogroup LSM6DSO LSM6DSO
- - * @{
- - */
- + * @{
- + */
-
- /** @defgroup LSM6DSO_Exported_Types LSM6DSO Exported Types
- - * @{
- - */
- + * @{
- + */
-
- typedef int32_t (*LSM6DSO_Init_Func)(void);
- typedef int32_t (*LSM6DSO_DeInit_Func)(void);
- typedef int32_t (*LSM6DSO_GetTick_Func)(void);
- +typedef void (*LSM6DSO_Delay_Func)(uint32_t);
- typedef int32_t (*LSM6DSO_WriteReg_Func)(uint16_t, uint16_t, uint8_t *, uint16_t);
- typedef int32_t (*LSM6DSO_ReadReg_Func)(uint16_t, uint16_t, uint8_t *, uint16_t);
-
- @@ -80,6 +80,7 @@ typedef struct
- LSM6DSO_WriteReg_Func WriteReg;
- LSM6DSO_ReadReg_Func ReadReg;
- LSM6DSO_GetTick_Func GetTick;
- + LSM6DSO_Delay_Func Delay;
- } LSM6DSO_IO_t;
-
-
- @@ -168,33 +169,37 @@ typedef struct
- int32_t (*GetAxesRaw)(LSM6DSO_Object_t *, LSM6DSO_AxesRaw_t *);
- } LSM6DSO_GYRO_Drv_t;
-
- -typedef union{
- +typedef union
- +{
- int16_t i16bit[3];
- uint8_t u8bit[6];
- } lsm6dso_axis3bit16_t;
-
- -typedef union{
- +typedef union
- +{
- int16_t i16bit;
- uint8_t u8bit[2];
- } lsm6dso_axis1bit16_t;
-
- -typedef union{
- +typedef union
- +{
- int32_t i32bit[3];
- uint8_t u8bit[12];
- } lsm6dso_axis3bit32_t;
-
- -typedef union{
- +typedef union
- +{
- int32_t i32bit;
- uint8_t u8bit[4];
- } lsm6dso_axis1bit32_t;
-
- /**
- - * @}
- - */
- + * @}
- + */
-
- /** @defgroup LSM6DSO_Exported_Constants LSM6DSO Exported Constants
- - * @{
- - */
- + * @{
- + */
-
- #define LSM6DSO_OK 0
- #define LSM6DSO_ERROR -1
- @@ -215,12 +220,12 @@ typedef union{
- #define LSM6DSO_GYRO_SENSITIVITY_FS_2000DPS 70.000f
-
- /**
- - * @}
- - */
- + * @}
- + */
-
- /** @addtogroup LSM6DSO_Exported_Functions LSM6DSO Exported Functions
- - * @{
- - */
- + * @{
- + */
-
- int32_t LSM6DSO_RegisterBusIO(LSM6DSO_Object_t *pObj, LSM6DSO_IO_t *pIO);
- int32_t LSM6DSO_Init(LSM6DSO_Object_t *pObj);
- @@ -244,7 +249,8 @@ int32_t LSM6DSO_GYRO_Disable(LSM6DSO_Object_t *pObj);
- int32_t LSM6DSO_GYRO_GetSensitivity(LSM6DSO_Object_t *pObj, float_t *Sensitivity);
- int32_t LSM6DSO_GYRO_GetOutputDataRate(LSM6DSO_Object_t *pObj, float_t *Odr);
- int32_t LSM6DSO_GYRO_SetOutputDataRate(LSM6DSO_Object_t *pObj, float_t Odr);
- -int32_t LSM6DSO_GYRO_SetOutputDataRate_With_Mode(LSM6DSO_Object_t *pObj, float_t Odr, LSM6DSO_GYRO_Operating_Mode_t Mode);
- +int32_t LSM6DSO_GYRO_SetOutputDataRate_With_Mode(LSM6DSO_Object_t *pObj, float_t Odr,
- + LSM6DSO_GYRO_Operating_Mode_t Mode);
- int32_t LSM6DSO_GYRO_GetFullScale(LSM6DSO_Object_t *pObj, int32_t *FullScale);
- int32_t LSM6DSO_GYRO_SetFullScale(LSM6DSO_Object_t *pObj, int32_t FullScale);
- int32_t LSM6DSO_GYRO_GetAxesRaw(LSM6DSO_Object_t *pObj, LSM6DSO_AxesRaw_t *Value);
- @@ -317,7 +323,8 @@ int32_t LSM6DSO_ACC_Enable_DRDY_On_INT1(LSM6DSO_Object_t *pObj);
- int32_t LSM6DSO_ACC_Disable_DRDY_On_INT1(LSM6DSO_Object_t *pObj);
- int32_t LSM6DSO_ACC_Set_Power_Mode(LSM6DSO_Object_t *pObj, uint8_t PowerMode);
- int32_t LSM6DSO_ACC_Set_Filter_Mode(LSM6DSO_Object_t *pObj, uint8_t LowHighPassFlag, uint8_t FilterMode);
- -int32_t LSM6DSO_ACC_Enable_Inactivity_Detection(LSM6DSO_Object_t *pObj, lsm6dso_inact_en_t InactMode, LSM6DSO_SensorIntPin_t IntPin);
- +int32_t LSM6DSO_ACC_Enable_Inactivity_Detection(LSM6DSO_Object_t *pObj, lsm6dso_inact_en_t InactMode,
- + LSM6DSO_SensorIntPin_t IntPin);
- int32_t LSM6DSO_ACC_Disable_Inactivity_Detection(LSM6DSO_Object_t *pObj);
- int32_t LSM6DSO_ACC_Set_Sleep_Duration(LSM6DSO_Object_t *pObj, uint8_t Duration);
-
- @@ -328,20 +335,20 @@ int32_t LSM6DSO_GYRO_Set_Filter_Mode(LSM6DSO_Object_t *pObj, uint8_t LowHighPass
- int32_t LSM6DSO_DRDY_Set_Mode(LSM6DSO_Object_t *pObj, uint8_t Mode);
-
- /**
- - * @}
- - */
- + * @}
- + */
-
- /** @addtogroup LSM6DSO_Exported_Variables LSM6DSO Exported Variables
- - * @{
- - */
- + * @{
- + */
-
- extern LSM6DSO_CommonDrv_t LSM6DSO_COMMON_Driver;
- extern LSM6DSO_ACC_Drv_t LSM6DSO_ACC_Driver;
- extern LSM6DSO_GYRO_Drv_t LSM6DSO_GYRO_Driver;
-
- /**
- - * @}
- - */
- + * @}
- + */
-
- #ifdef __cplusplus
- }
- @@ -350,15 +357,13 @@ extern LSM6DSO_GYRO_Drv_t LSM6DSO_GYRO_Driver;
- #endif
-
- /**
- - * @}
- - */
- + * @}
- + */
-
- /**
- - * @}
- - */
- + * @}
- + */
-
- /**
- - * @}
- - */
- -
- -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
- + * @}
- + */
- diff --git a/lsm6dso_reg.c b/lsm6dso_reg.c
- index b045cc260..9eb6542ee 100644
- --- a/lsm6dso_reg.c
- +++ b/lsm6dso_reg.c
- @@ -1,21 +1,20 @@
- -/*
- - ******************************************************************************
- - * @file lsm6dso_reg.c
- - * @author Sensors Software Solution Team
- - * @brief LSM6DSO driver file
- - ******************************************************************************
- - * @attention
- - *
- - * <h2><center>© Copyright (c) 2021 STMicroelectronics.
- - * All rights reserved.</center></h2>
- - *
- - * This software component is licensed by ST under BSD 3-Clause license,
- - * the "License"; You may not use this file except in compliance with the
- - * License. You may obtain a copy of the License at:
- - * opensource.org/licenses/BSD-3-Clause
- - *
- - ******************************************************************************
- - */
- +/**
- + ******************************************************************************
- + * @file lsm6dso_reg.c
- + * @author Sensors Software Solution Team
- + * @brief LSM6DSO driver file
- + ******************************************************************************
- + * @attention
- + *
- + * Copyright (c) 2019 STMicroelectronics.
- + * All rights reserved.
- + *
- + * This software is licensed under terms that can be found in the LICENSE file
- + * in the root directory of this software component.
- + * If no LICENSE file comes with this software, it is provided AS-IS.
- + *
- + ******************************************************************************
- + */
-
- #include "lsm6dso_reg.h"
- #include <stddef.h>
- @@ -26,7 +25,7 @@
- * lsm6dso enhanced inertial module.
- * @{
- *
- -*/
- + */
-
- /**
- * @defgroup LSM6DSO_Interfaces_Functions
- @@ -35,7 +34,7 @@
- * MANDATORY: return 0 -> no Error.
- * @{
- *
- -*/
- + */
-
- /**
- * @brief Read generic device register
- @@ -47,12 +46,14 @@
- * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- -int32_t lsm6dso_read_reg(stmdev_ctx_t *ctx, uint8_t reg,
- - uint8_t *data,
- - uint16_t len)
- +int32_t __weak lsm6dso_read_reg(stmdev_ctx_t *ctx, uint8_t reg,
- + uint8_t *data,
- + uint16_t len)
- {
- int32_t ret;
- +
- ret = ctx->read_reg(ctx->handle, reg, data, len);
- +
- return ret;
- }
-
- @@ -66,19 +67,21 @@ int32_t lsm6dso_read_reg(stmdev_ctx_t *ctx, uint8_t reg,
- * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- -int32_t lsm6dso_write_reg(stmdev_ctx_t *ctx, uint8_t reg,
- - uint8_t *data,
- - uint16_t len)
- +int32_t __weak lsm6dso_write_reg(stmdev_ctx_t *ctx, uint8_t reg,
- + uint8_t *data,
- + uint16_t len)
- {
- int32_t ret;
- +
- ret = ctx->write_reg(ctx->handle, reg, data, len);
- +
- return ret;
- }
-
- /**
- * @}
- *
- -*/
- + */
-
- /**
- * @defgroup LSM6DSOX_Private_functions
- @@ -89,7 +92,8 @@ int32_t lsm6dso_write_reg(stmdev_ctx_t *ctx, uint8_t reg,
-
- static void bytecpy(uint8_t *target, uint8_t *source)
- {
- - if ( (target != NULL) && (source != NULL) ) {
- + if ((target != NULL) && (source != NULL))
- + {
- *target = *source;
- }
- }
- @@ -99,7 +103,7 @@ static void bytecpy(uint8_t *target, uint8_t *source)
- * @brief These functions convert raw-data into engineering units.
- * @{
- *
- -*/
- + */
- float_t lsm6dso_from_fs2_to_mg(int16_t lsb)
- {
- return ((float_t)lsb) * 0.061f;
- @@ -158,20 +162,21 @@ float_t lsm6dso_from_lsb_to_nsec(int16_t lsb)
- /**
- * @}
- *
- -*/
- + */
-
- /**
- * @defgroup LSM6DSO_Data_Generation
- * @brief This section groups all the functions concerning
- * data generation.
- *
- -*/
- + */
-
- /**
- * @brief Accelerometer full-scale selection.[set]
- *
- * @param ctx read / write interface definitions
- * @param val change the values of fs_xl in reg CTRL1_XL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_full_scale_set(stmdev_ctx_t *ctx,
- @@ -179,9 +184,11 @@ int32_t lsm6dso_xl_full_scale_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl1_xl_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL1_XL, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.fs_xl = (uint8_t) val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL1_XL, (uint8_t *)®, 1);
- }
- @@ -194,6 +201,7 @@ int32_t lsm6dso_xl_full_scale_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of fs_xl in reg CTRL1_XL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_full_scale_get(stmdev_ctx_t *ctx,
- @@ -201,9 +209,11 @@ int32_t lsm6dso_xl_full_scale_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl1_xl_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL1_XL, (uint8_t *)®, 1);
-
- - switch (reg.fs_xl) {
- + switch (reg.fs_xl)
- + {
- case LSM6DSO_2g:
- *val = LSM6DSO_2g;
- break;
- @@ -233,6 +243,7 @@ int32_t lsm6dso_xl_full_scale_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of odr_xl in reg CTRL1_XL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_data_rate_set(stmdev_ctx_t *ctx,
- @@ -243,93 +254,112 @@ int32_t lsm6dso_xl_data_rate_set(stmdev_ctx_t *ctx,
- lsm6dso_fsm_odr_t fsm_odr;
- lsm6dso_ctrl1_xl_t reg;
- int32_t ret;
- +
- /* Check the Finite State Machine data rate constraints */
- ret = lsm6dso_fsm_enable_get(ctx, &fsm_enable);
-
- - if (ret == 0) {
- - if ( (fsm_enable.fsm_enable_a.fsm1_en |
- - fsm_enable.fsm_enable_a.fsm2_en |
- - fsm_enable.fsm_enable_a.fsm3_en |
- - fsm_enable.fsm_enable_a.fsm4_en |
- - fsm_enable.fsm_enable_a.fsm5_en |
- - fsm_enable.fsm_enable_a.fsm6_en |
- - fsm_enable.fsm_enable_a.fsm7_en |
- - fsm_enable.fsm_enable_a.fsm8_en |
- - fsm_enable.fsm_enable_b.fsm9_en |
- - fsm_enable.fsm_enable_b.fsm10_en |
- - fsm_enable.fsm_enable_b.fsm11_en |
- - fsm_enable.fsm_enable_b.fsm12_en |
- - fsm_enable.fsm_enable_b.fsm13_en |
- - fsm_enable.fsm_enable_b.fsm14_en |
- - fsm_enable.fsm_enable_b.fsm15_en |
- - fsm_enable.fsm_enable_b.fsm16_en ) == PROPERTY_ENABLE ) {
- + if (ret == 0)
- + {
- + if ((fsm_enable.fsm_enable_a.fsm1_en |
- + fsm_enable.fsm_enable_a.fsm2_en |
- + fsm_enable.fsm_enable_a.fsm3_en |
- + fsm_enable.fsm_enable_a.fsm4_en |
- + fsm_enable.fsm_enable_a.fsm5_en |
- + fsm_enable.fsm_enable_a.fsm6_en |
- + fsm_enable.fsm_enable_a.fsm7_en |
- + fsm_enable.fsm_enable_a.fsm8_en |
- + fsm_enable.fsm_enable_b.fsm9_en |
- + fsm_enable.fsm_enable_b.fsm10_en |
- + fsm_enable.fsm_enable_b.fsm11_en |
- + fsm_enable.fsm_enable_b.fsm12_en |
- + fsm_enable.fsm_enable_b.fsm13_en |
- + fsm_enable.fsm_enable_b.fsm14_en |
- + fsm_enable.fsm_enable_b.fsm15_en |
- + fsm_enable.fsm_enable_b.fsm16_en) == PROPERTY_ENABLE)
- + {
- ret = lsm6dso_fsm_data_rate_get(ctx, &fsm_odr);
-
- - if (ret == 0) {
- - switch (fsm_odr) {
- + if (ret == 0)
- + {
- + switch (fsm_odr)
- + {
- case LSM6DSO_ODR_FSM_12Hz5:
- - if (val == LSM6DSO_XL_ODR_OFF) {
- + if (val == LSM6DSO_XL_ODR_OFF)
- + {
- odr_xl = LSM6DSO_XL_ODR_12Hz5;
- }
-
- - else {
- + else
- + {
- odr_xl = val;
- }
-
- break;
-
- case LSM6DSO_ODR_FSM_26Hz:
- - if (val == LSM6DSO_XL_ODR_OFF) {
- + if (val == LSM6DSO_XL_ODR_OFF)
- + {
- odr_xl = LSM6DSO_XL_ODR_26Hz;
- }
-
- - else if (val == LSM6DSO_XL_ODR_12Hz5) {
- + else if (val == LSM6DSO_XL_ODR_12Hz5)
- + {
- odr_xl = LSM6DSO_XL_ODR_26Hz;
- }
-
- - else {
- + else
- + {
- odr_xl = val;
- }
-
- break;
-
- case LSM6DSO_ODR_FSM_52Hz:
- - if (val == LSM6DSO_XL_ODR_OFF) {
- + if (val == LSM6DSO_XL_ODR_OFF)
- + {
- odr_xl = LSM6DSO_XL_ODR_52Hz;
- }
-
- - else if (val == LSM6DSO_XL_ODR_12Hz5) {
- + else if (val == LSM6DSO_XL_ODR_12Hz5)
- + {
- odr_xl = LSM6DSO_XL_ODR_52Hz;
- }
-
- - else if (val == LSM6DSO_XL_ODR_26Hz) {
- + else if (val == LSM6DSO_XL_ODR_26Hz)
- + {
- odr_xl = LSM6DSO_XL_ODR_52Hz;
- }
-
- - else {
- + else
- + {
- odr_xl = val;
- }
-
- break;
-
- case LSM6DSO_ODR_FSM_104Hz:
- - if (val == LSM6DSO_XL_ODR_OFF) {
- + if (val == LSM6DSO_XL_ODR_OFF)
- + {
- odr_xl = LSM6DSO_XL_ODR_104Hz;
- }
-
- - else if (val == LSM6DSO_XL_ODR_12Hz5) {
- + else if (val == LSM6DSO_XL_ODR_12Hz5)
- + {
- odr_xl = LSM6DSO_XL_ODR_104Hz;
- }
-
- - else if (val == LSM6DSO_XL_ODR_26Hz) {
- + else if (val == LSM6DSO_XL_ODR_26Hz)
- + {
- odr_xl = LSM6DSO_XL_ODR_104Hz;
- }
-
- - else if (val == LSM6DSO_XL_ODR_52Hz) {
- + else if (val == LSM6DSO_XL_ODR_52Hz)
- + {
- odr_xl = LSM6DSO_XL_ODR_104Hz;
- }
-
- - else {
- + else
- + {
- odr_xl = val;
- }
-
- @@ -343,11 +373,13 @@ int32_t lsm6dso_xl_data_rate_set(stmdev_ctx_t *ctx,
- }
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL1_XL, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.odr_xl = (uint8_t) odr_xl;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL1_XL, (uint8_t *)®, 1);
- }
- @@ -360,6 +392,7 @@ int32_t lsm6dso_xl_data_rate_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of odr_xl in reg CTRL1_XL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_data_rate_get(stmdev_ctx_t *ctx,
- @@ -367,9 +400,11 @@ int32_t lsm6dso_xl_data_rate_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl1_xl_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL1_XL, (uint8_t *)®, 1);
-
- - switch (reg.odr_xl) {
- + switch (reg.odr_xl)
- + {
- case LSM6DSO_XL_ODR_OFF:
- *val = LSM6DSO_XL_ODR_OFF;
- break;
- @@ -431,6 +466,7 @@ int32_t lsm6dso_xl_data_rate_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of fs_g in reg CTRL2_G
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_gy_full_scale_set(stmdev_ctx_t *ctx,
- @@ -438,9 +474,11 @@ int32_t lsm6dso_gy_full_scale_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl2_g_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL2_G, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.fs_g = (uint8_t) val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL2_G, (uint8_t *)®, 1);
- }
- @@ -453,6 +491,7 @@ int32_t lsm6dso_gy_full_scale_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of fs_g in reg CTRL2_G
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_gy_full_scale_get(stmdev_ctx_t *ctx,
- @@ -460,9 +499,11 @@ int32_t lsm6dso_gy_full_scale_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl2_g_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL2_G, (uint8_t *)®, 1);
-
- - switch (reg.fs_g) {
- + switch (reg.fs_g)
- + {
- case LSM6DSO_250dps:
- *val = LSM6DSO_250dps;
- break;
- @@ -496,6 +537,7 @@ int32_t lsm6dso_gy_full_scale_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of odr_g in reg CTRL2_G
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_gy_data_rate_set(stmdev_ctx_t *ctx,
- @@ -506,93 +548,112 @@ int32_t lsm6dso_gy_data_rate_set(stmdev_ctx_t *ctx,
- lsm6dso_fsm_odr_t fsm_odr;
- lsm6dso_ctrl2_g_t reg;
- int32_t ret;
- +
- /* Check the Finite State Machine data rate constraints */
- ret = lsm6dso_fsm_enable_get(ctx, &fsm_enable);
-
- - if (ret == 0) {
- - if ( (fsm_enable.fsm_enable_a.fsm1_en |
- - fsm_enable.fsm_enable_a.fsm2_en |
- - fsm_enable.fsm_enable_a.fsm3_en |
- - fsm_enable.fsm_enable_a.fsm4_en |
- - fsm_enable.fsm_enable_a.fsm5_en |
- - fsm_enable.fsm_enable_a.fsm6_en |
- - fsm_enable.fsm_enable_a.fsm7_en |
- - fsm_enable.fsm_enable_a.fsm8_en |
- - fsm_enable.fsm_enable_b.fsm9_en |
- - fsm_enable.fsm_enable_b.fsm10_en |
- - fsm_enable.fsm_enable_b.fsm11_en |
- - fsm_enable.fsm_enable_b.fsm12_en |
- - fsm_enable.fsm_enable_b.fsm13_en |
- - fsm_enable.fsm_enable_b.fsm14_en |
- - fsm_enable.fsm_enable_b.fsm15_en |
- - fsm_enable.fsm_enable_b.fsm16_en ) == PROPERTY_ENABLE ) {
- + if (ret == 0)
- + {
- + if ((fsm_enable.fsm_enable_a.fsm1_en |
- + fsm_enable.fsm_enable_a.fsm2_en |
- + fsm_enable.fsm_enable_a.fsm3_en |
- + fsm_enable.fsm_enable_a.fsm4_en |
- + fsm_enable.fsm_enable_a.fsm5_en |
- + fsm_enable.fsm_enable_a.fsm6_en |
- + fsm_enable.fsm_enable_a.fsm7_en |
- + fsm_enable.fsm_enable_a.fsm8_en |
- + fsm_enable.fsm_enable_b.fsm9_en |
- + fsm_enable.fsm_enable_b.fsm10_en |
- + fsm_enable.fsm_enable_b.fsm11_en |
- + fsm_enable.fsm_enable_b.fsm12_en |
- + fsm_enable.fsm_enable_b.fsm13_en |
- + fsm_enable.fsm_enable_b.fsm14_en |
- + fsm_enable.fsm_enable_b.fsm15_en |
- + fsm_enable.fsm_enable_b.fsm16_en) == PROPERTY_ENABLE)
- + {
- ret = lsm6dso_fsm_data_rate_get(ctx, &fsm_odr);
-
- - if (ret == 0) {
- - switch (fsm_odr) {
- + if (ret == 0)
- + {
- + switch (fsm_odr)
- + {
- case LSM6DSO_ODR_FSM_12Hz5:
- - if (val == LSM6DSO_GY_ODR_OFF) {
- + if (val == LSM6DSO_GY_ODR_OFF)
- + {
- odr_gy = LSM6DSO_GY_ODR_12Hz5;
- }
-
- - else {
- + else
- + {
- odr_gy = val;
- }
-
- break;
-
- case LSM6DSO_ODR_FSM_26Hz:
- - if (val == LSM6DSO_GY_ODR_OFF) {
- + if (val == LSM6DSO_GY_ODR_OFF)
- + {
- odr_gy = LSM6DSO_GY_ODR_26Hz;
- }
-
- - else if (val == LSM6DSO_GY_ODR_12Hz5) {
- + else if (val == LSM6DSO_GY_ODR_12Hz5)
- + {
- odr_gy = LSM6DSO_GY_ODR_26Hz;
- }
-
- - else {
- + else
- + {
- odr_gy = val;
- }
-
- break;
-
- case LSM6DSO_ODR_FSM_52Hz:
- - if (val == LSM6DSO_GY_ODR_OFF) {
- + if (val == LSM6DSO_GY_ODR_OFF)
- + {
- odr_gy = LSM6DSO_GY_ODR_52Hz;
- }
-
- - else if (val == LSM6DSO_GY_ODR_12Hz5) {
- + else if (val == LSM6DSO_GY_ODR_12Hz5)
- + {
- odr_gy = LSM6DSO_GY_ODR_52Hz;
- }
-
- - else if (val == LSM6DSO_GY_ODR_26Hz) {
- + else if (val == LSM6DSO_GY_ODR_26Hz)
- + {
- odr_gy = LSM6DSO_GY_ODR_52Hz;
- }
-
- - else {
- + else
- + {
- odr_gy = val;
- }
-
- break;
-
- case LSM6DSO_ODR_FSM_104Hz:
- - if (val == LSM6DSO_GY_ODR_OFF) {
- + if (val == LSM6DSO_GY_ODR_OFF)
- + {
- odr_gy = LSM6DSO_GY_ODR_104Hz;
- }
-
- - else if (val == LSM6DSO_GY_ODR_12Hz5) {
- + else if (val == LSM6DSO_GY_ODR_12Hz5)
- + {
- odr_gy = LSM6DSO_GY_ODR_104Hz;
- }
-
- - else if (val == LSM6DSO_GY_ODR_26Hz) {
- + else if (val == LSM6DSO_GY_ODR_26Hz)
- + {
- odr_gy = LSM6DSO_GY_ODR_104Hz;
- }
-
- - else if (val == LSM6DSO_GY_ODR_52Hz) {
- + else if (val == LSM6DSO_GY_ODR_52Hz)
- + {
- odr_gy = LSM6DSO_GY_ODR_104Hz;
- }
-
- - else {
- + else
- + {
- odr_gy = val;
- }
-
- @@ -606,11 +667,13 @@ int32_t lsm6dso_gy_data_rate_set(stmdev_ctx_t *ctx,
- }
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL2_G, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.odr_g = (uint8_t) odr_gy;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL2_G, (uint8_t *)®, 1);
- }
- @@ -623,6 +686,7 @@ int32_t lsm6dso_gy_data_rate_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of odr_g in reg CTRL2_G
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_gy_data_rate_get(stmdev_ctx_t *ctx,
- @@ -630,9 +694,11 @@ int32_t lsm6dso_gy_data_rate_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl2_g_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL2_G, (uint8_t *)®, 1);
-
- - switch (reg.odr_g) {
- + switch (reg.odr_g)
- + {
- case LSM6DSO_GY_ODR_OFF:
- *val = LSM6DSO_GY_ODR_OFF;
- break;
- @@ -690,15 +756,18 @@ int32_t lsm6dso_gy_data_rate_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of bdu in reg CTRL3_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_block_data_update_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_ctrl3_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.bdu = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)®, 1);
- }
- @@ -711,14 +780,17 @@ int32_t lsm6dso_block_data_update_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of bdu in reg CTRL3_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_block_data_update_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_ctrl3_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)®, 1);
- *val = reg.bdu;
- +
- return ret;
- }
-
- @@ -728,6 +800,7 @@ int32_t lsm6dso_block_data_update_get(stmdev_ctx_t *ctx, uint8_t *val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of usr_off_w in reg CTRL6_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_offset_weight_set(stmdev_ctx_t *ctx,
- @@ -735,9 +808,11 @@ int32_t lsm6dso_xl_offset_weight_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl6_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL6_C, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.usr_off_w = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL6_C, (uint8_t *)®, 1);
- }
- @@ -751,6 +826,7 @@ int32_t lsm6dso_xl_offset_weight_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of usr_off_w in reg CTRL6_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_offset_weight_get(stmdev_ctx_t *ctx,
- @@ -758,9 +834,11 @@ int32_t lsm6dso_xl_offset_weight_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl6_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL6_C, (uint8_t *)®, 1);
-
- - switch (reg.usr_off_w) {
- + switch (reg.usr_off_w)
- + {
- case LSM6DSO_LSb_1mg:
- *val = LSM6DSO_LSb_1mg;
- break;
- @@ -783,6 +861,7 @@ int32_t lsm6dso_xl_offset_weight_get(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val change the values of xl_hm_mode in
- * reg CTRL6_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_power_mode_set(stmdev_ctx_t *ctx,
- @@ -791,22 +870,24 @@ int32_t lsm6dso_xl_power_mode_set(stmdev_ctx_t *ctx,
- lsm6dso_ctrl5_c_t ctrl5_c;
- lsm6dso_ctrl6_c_t ctrl6_c;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL5_C, (uint8_t *) &ctrl5_c, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ctrl5_c.xl_ulp_en = ((uint8_t)val & 0x02U) >> 1;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL5_C, (uint8_t *) &ctrl5_c,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL5_C, (uint8_t *) &ctrl5_c, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL6_C, (uint8_t *) &ctrl6_c, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ctrl6_c.xl_hm_mode = (uint8_t)val & 0x01U;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL6_C, (uint8_t *) &ctrl6_c,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL6_C, (uint8_t *) &ctrl6_c, 1);
- }
-
- return ret;
- @@ -817,6 +898,7 @@ int32_t lsm6dso_xl_power_mode_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of xl_hm_mode in reg CTRL6_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_power_mode_get(stmdev_ctx_t *ctx,
- @@ -825,12 +907,15 @@ int32_t lsm6dso_xl_power_mode_get(stmdev_ctx_t *ctx,
- lsm6dso_ctrl5_c_t ctrl5_c;
- lsm6dso_ctrl6_c_t ctrl6_c;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL5_C, (uint8_t *) &ctrl5_c, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL6_C, (uint8_t *) &ctrl6_c, 1);
-
- - switch ( (ctrl5_c.xl_ulp_en << 1) | ctrl6_c.xl_hm_mode) {
- + switch ((ctrl5_c.xl_ulp_en << 1) | ctrl6_c.xl_hm_mode)
- + {
- case LSM6DSO_HIGH_PERFORMANCE_MD:
- *val = LSM6DSO_HIGH_PERFORMANCE_MD;
- break;
- @@ -857,6 +942,7 @@ int32_t lsm6dso_xl_power_mode_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of g_hm_mode in reg CTRL7_G
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_gy_power_mode_set(stmdev_ctx_t *ctx,
- @@ -864,9 +950,11 @@ int32_t lsm6dso_gy_power_mode_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl7_g_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL7_G, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.g_hm_mode = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL7_G, (uint8_t *)®, 1);
- }
- @@ -879,6 +967,7 @@ int32_t lsm6dso_gy_power_mode_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of g_hm_mode in reg CTRL7_G
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_gy_power_mode_get(stmdev_ctx_t *ctx,
- @@ -886,9 +975,11 @@ int32_t lsm6dso_gy_power_mode_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl7_g_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL7_G, (uint8_t *)®, 1);
-
- - switch (reg.g_hm_mode) {
- + switch (reg.g_hm_mode)
- + {
- case LSM6DSO_GY_HIGH_PERFORMANCE:
- *val = LSM6DSO_GY_HIGH_PERFORMANCE;
- break;
- @@ -910,13 +1001,16 @@ int32_t lsm6dso_gy_power_mode_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val register STATUS_REG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_status_reg_get(stmdev_ctx_t *ctx,
- lsm6dso_status_reg_t *val)
- {
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_STATUS_REG, (uint8_t *) val, 1);
- +
- return ret;
- }
-
- @@ -925,6 +1019,7 @@ int32_t lsm6dso_status_reg_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of xlda in reg STATUS_REG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_flag_data_ready_get(stmdev_ctx_t *ctx,
- @@ -932,8 +1027,10 @@ int32_t lsm6dso_xl_flag_data_ready_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_status_reg_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_STATUS_REG, (uint8_t *)®, 1);
- *val = reg.xlda;
- +
- return ret;
- }
-
- @@ -942,6 +1039,7 @@ int32_t lsm6dso_xl_flag_data_ready_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of gda in reg STATUS_REG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_gy_flag_data_ready_get(stmdev_ctx_t *ctx,
- @@ -949,8 +1047,10 @@ int32_t lsm6dso_gy_flag_data_ready_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_status_reg_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_STATUS_REG, (uint8_t *)®, 1);
- *val = reg.gda;
- +
- return ret;
- }
-
- @@ -959,6 +1059,7 @@ int32_t lsm6dso_gy_flag_data_ready_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of tda in reg STATUS_REG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_temp_flag_data_ready_get(stmdev_ctx_t *ctx,
- @@ -966,104 +1067,124 @@ int32_t lsm6dso_temp_flag_data_ready_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_status_reg_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_STATUS_REG, (uint8_t *)®, 1);
- *val = reg.tda;
- +
- return ret;
- }
-
- /**
- * @brief Accelerometer X-axis user offset correction expressed in
- - * two’s complement, weight depends on USR_OFF_W in CTRL6_C (15h).
- + * two's complement, weight depends on USR_OFF_W in CTRL6_C (15h).
- * The value must be in the range [-127 127].[set]
- *
- * @param ctx read / write interface definitions
- * @param buff buffer that contains data to write
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_usr_offset_x_set(stmdev_ctx_t *ctx, uint8_t *buff)
- {
- int32_t ret;
- +
- ret = lsm6dso_write_reg(ctx, LSM6DSO_X_OFS_USR, buff, 1);
- +
- return ret;
- }
-
- /**
- - * @brief Accelerometer X-axis user offset correction expressed in two’s
- + * @brief Accelerometer X-axis user offset correction expressed in two's
- * complement, weight depends on USR_OFF_W in CTRL6_C (15h).
- * The value must be in the range [-127 127].[get]
- *
- * @param ctx read / write interface definitions
- * @param buff buffer that stores data read
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_usr_offset_x_get(stmdev_ctx_t *ctx, uint8_t *buff)
- {
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_X_OFS_USR, buff, 1);
- +
- return ret;
- }
-
- /**
- - * @brief Accelerometer Y-axis user offset correction expressed in two’s
- + * @brief Accelerometer Y-axis user offset correction expressed in two's
- * complement, weight depends on USR_OFF_W in CTRL6_C (15h).
- * The value must be in the range [-127 127].[set]
- *
- * @param ctx read / write interface definitions
- * @param buff buffer that contains data to write
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_usr_offset_y_set(stmdev_ctx_t *ctx, uint8_t *buff)
- {
- int32_t ret;
- +
- ret = lsm6dso_write_reg(ctx, LSM6DSO_Y_OFS_USR, buff, 1);
- +
- return ret;
- }
-
- /**
- - * @brief Accelerometer Y-axis user offset correction expressed in two’s
- + * @brief Accelerometer Y-axis user offset correction expressed in two's
- * complement, weight depends on USR_OFF_W in CTRL6_C (15h).
- * The value must be in the range [-127 127].[get]
- *
- * @param ctx read / write interface definitions
- * @param buff buffer that stores data read
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_usr_offset_y_get(stmdev_ctx_t *ctx, uint8_t *buff)
- {
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_Y_OFS_USR, buff, 1);
- +
- return ret;
- }
-
- /**
- - * @brief Accelerometer Z-axis user offset correction expressed in two’s
- + * @brief Accelerometer Z-axis user offset correction expressed in two's
- * complement, weight depends on USR_OFF_W in CTRL6_C (15h).
- * The value must be in the range [-127 127].[set]
- *
- * @param ctx read / write interface definitions
- * @param buff buffer that contains data to write
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_usr_offset_z_set(stmdev_ctx_t *ctx, uint8_t *buff)
- {
- int32_t ret;
- +
- ret = lsm6dso_write_reg(ctx, LSM6DSO_Z_OFS_USR, buff, 1);
- +
- return ret;
- }
-
- /**
- - * @brief Accelerometer Z-axis user offset correction expressed in two’s
- + * @brief Accelerometer Z-axis user offset correction expressed in two's
- * complement, weight depends on USR_OFF_W in CTRL6_C (15h).
- * The value must be in the range [-127 127].[get]
- *
- * @param ctx read / write interface definitions
- * @param buff buffer that stores data read
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_usr_offset_z_get(stmdev_ctx_t *ctx, uint8_t *buff)
- {
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_Z_OFS_USR, buff, 1);
- +
- return ret;
- }
-
- @@ -1072,15 +1193,18 @@ int32_t lsm6dso_xl_usr_offset_z_get(stmdev_ctx_t *ctx, uint8_t *buff)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of usr_off_on_out in reg CTRL7_G
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_usr_offset_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_ctrl7_g_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL7_G, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.usr_off_on_out = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL7_G, (uint8_t *)®, 1);
- }
- @@ -1093,14 +1217,17 @@ int32_t lsm6dso_xl_usr_offset_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val values of usr_off_on_out in reg CTRL7_G
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_usr_offset_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_ctrl7_g_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL7_G, (uint8_t *)®, 1);
- *val = reg.usr_off_on_out;
- +
- return ret;
- }
-
- @@ -1121,7 +1248,7 @@ int32_t lsm6dso_xl_usr_offset_get(stmdev_ctx_t *ctx, uint8_t *val)
- * @brief Reset timestamp counter.[set]
- *
- * @param ctx Read / write interface definitions.(ptr)
- - * @retval Interface status (MANDATORY: return 0 -> no Error).
- + * @retval Interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_timestamp_rst(stmdev_ctx_t *ctx)
- @@ -1135,15 +1262,18 @@ int32_t lsm6dso_timestamp_rst(stmdev_ctx_t *ctx)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of timestamp_en in reg CTRL10_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_timestamp_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_ctrl10_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL10_C, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.timestamp_en = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL10_C, (uint8_t *)®, 1);
- }
- @@ -1156,35 +1286,41 @@ int32_t lsm6dso_timestamp_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of timestamp_en in reg CTRL10_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_timestamp_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_ctrl10_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL10_C, (uint8_t *)®, 1);
- *val = reg.timestamp_en;
- +
- return ret;
- }
-
- /**
- * @brief Timestamp first data output register (r).
- * The value is expressed as a 32-bit word and the bit
- - * resolution is 25 μs.[get]
- + * resolution is 25 us.[get]
- *
- * @param ctx read / write interface definitions
- * @param buff buffer that stores data read
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_timestamp_raw_get(stmdev_ctx_t *ctx, uint32_t *val)
- {
- uint8_t buff[4];
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_TIMESTAMP0, buff, 4);
- *val = buff[3];
- *val = (*val * 256U) + buff[2];
- *val = (*val * 256U) + buff[1];
- *val = (*val * 256U) + buff[0];
- +
- return ret;
- }
-
- @@ -1198,7 +1334,7 @@ int32_t lsm6dso_timestamp_raw_get(stmdev_ctx_t *ctx, uint32_t *val)
- * @brief This section groups all the data output functions.
- * @{
- *
- -*/
- + */
-
- /**
- * @brief Circular burst-mode (rounding) read of the output
- @@ -1206,6 +1342,7 @@ int32_t lsm6dso_timestamp_raw_get(stmdev_ctx_t *ctx, uint32_t *val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of rounding in reg CTRL5_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_rounding_mode_set(stmdev_ctx_t *ctx,
- @@ -1213,9 +1350,11 @@ int32_t lsm6dso_rounding_mode_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl5_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL5_C, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.rounding = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL5_C, (uint8_t *)®, 1);
- }
- @@ -1228,6 +1367,7 @@ int32_t lsm6dso_rounding_mode_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of rounding in reg CTRL5_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_rounding_mode_get(stmdev_ctx_t *ctx,
- @@ -1235,9 +1375,11 @@ int32_t lsm6dso_rounding_mode_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl5_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL5_C, (uint8_t *)®, 1);
-
- - switch (reg.rounding) {
- + switch (reg.rounding)
- + {
- case LSM6DSO_NO_ROUND:
- *val = LSM6DSO_NO_ROUND;
- break;
- @@ -1264,35 +1406,40 @@ int32_t lsm6dso_rounding_mode_get(stmdev_ctx_t *ctx,
-
- /**
- * @brief Temperature data output register (r).
- - * L and H registers together express a 16-bit word in two’s
- + * L and H registers together express a 16-bit word in two's
- * complement.[get]
- *
- * @param ctx read / write interface definitions
- * @param buff buffer that stores data read
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_temperature_raw_get(stmdev_ctx_t *ctx, int16_t *val)
- {
- uint8_t buff[2];
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_OUT_TEMP_L, buff, 2);
- val[0] = (int16_t)buff[1];
- val[0] = (val[0] * 256) + (int16_t)buff[0];
- +
- return ret;
- }
-
- /**
- * @brief Angular rate sensor. The value is expressed as a 16-bit
- - * word in two’s complement.[get]
- + * word in two's complement.[get]
- *
- * @param ctx read / write interface definitions
- * @param buff buffer that stores data read
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_angular_rate_raw_get(stmdev_ctx_t *ctx, int16_t *val)
- {
- uint8_t buff[6];
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_OUTX_L_G, buff, 6);
- val[0] = (int16_t)buff[1];
- val[0] = (val[0] * 256) + (int16_t)buff[0];
- @@ -1300,21 +1447,24 @@ int32_t lsm6dso_angular_rate_raw_get(stmdev_ctx_t *ctx, int16_t *val)
- val[1] = (val[1] * 256) + (int16_t)buff[2];
- val[2] = (int16_t)buff[5];
- val[2] = (val[2] * 256) + (int16_t)buff[4];
- +
- return ret;
- }
-
- /**
- * @brief Linear acceleration output register.
- - * The value is expressed as a 16-bit word in two’s complement.[get]
- + * The value is expressed as a 16-bit word in two's complement.[get]
- *
- * @param ctx read / write interface definitions
- * @param buff buffer that stores data read
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_acceleration_raw_get(stmdev_ctx_t *ctx, int16_t *val)
- {
- uint8_t buff[6];
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_OUTX_L_A, buff, 6);
- val[0] = (int16_t)buff[1];
- val[0] = (val[0] * 256) + (int16_t)buff[0];
- @@ -1322,6 +1472,7 @@ int32_t lsm6dso_acceleration_raw_get(stmdev_ctx_t *ctx, int16_t *val)
- val[1] = (val[1] * 256) + (int16_t)buff[2];
- val[2] = (int16_t)buff[5];
- val[2] = (val[2] * 256) + (int16_t)buff[4];
- +
- return ret;
- }
-
- @@ -1330,12 +1481,15 @@ int32_t lsm6dso_acceleration_raw_get(stmdev_ctx_t *ctx, int16_t *val)
- *
- * @param ctx read / write interface definitions
- * @param buff buffer that stores data read
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fifo_out_raw_get(stmdev_ctx_t *ctx, uint8_t *buff)
- {
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_DATA_OUT_X_L, buff, 6);
- +
- return ret;
- }
-
- @@ -1344,19 +1498,23 @@ int32_t lsm6dso_fifo_out_raw_get(stmdev_ctx_t *ctx, uint8_t *buff)
- *
- * @param ctx read / write interface definitions
- * @param buff buffer that stores data read
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_number_of_steps_get(stmdev_ctx_t *ctx, uint16_t *val)
- {
- uint8_t buff[2];
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_STEP_COUNTER_L, buff, 2);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- *val = buff[1];
- *val = (*val * 256U) + buff[0];
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- @@ -1369,25 +1527,29 @@ int32_t lsm6dso_number_of_steps_get(stmdev_ctx_t *ctx, uint16_t *val)
- * @brief Reset step counter register.[get]
- *
- * @param ctx read / write interface definitions
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_steps_reset(stmdev_ctx_t *ctx)
- {
- lsm6dso_emb_func_src_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_SRC, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.pedo_rst_step = PROPERTY_ENABLE;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_EMB_FUNC_SRC, (uint8_t *)®,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_EMB_FUNC_SRC, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -1404,7 +1566,7 @@ int32_t lsm6dso_steps_reset(stmdev_ctx_t *ctx)
- * @brief This section groups common useful functions.
- * @{
- *
- -*/
- + */
-
- /**
- * @brief Difference in percentage of the effective ODR(and timestamp rate)
- @@ -1414,16 +1576,19 @@ int32_t lsm6dso_steps_reset(stmdev_ctx_t *ctx)
- * @param ctx read / write interface definitions
- * @param val change the values of freq_fine in reg
- * INTERNAL_FREQ_FINE
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_odr_cal_reg_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_internal_freq_fine_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_INTERNAL_FREQ_FINE,
- (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.freq_fine = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_INTERNAL_FREQ_FINE,
- (uint8_t *)®, 1);
- @@ -1439,15 +1604,18 @@ int32_t lsm6dso_odr_cal_reg_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of freq_fine in reg INTERNAL_FREQ_FINE
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_odr_cal_reg_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_internal_freq_fine_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_INTERNAL_FREQ_FINE,
- (uint8_t *)®, 1);
- *val = reg.freq_fine;
- +
- return ret;
- }
-
- @@ -1459,6 +1627,7 @@ int32_t lsm6dso_odr_cal_reg_get(stmdev_ctx_t *ctx, uint8_t *val)
- * @param ctx read / write interface definitions
- * @param val change the values of reg_access in
- * reg FUNC_CFG_ACCESS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_mem_bank_set(stmdev_ctx_t *ctx,
- @@ -1466,13 +1635,13 @@ int32_t lsm6dso_mem_bank_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_func_cfg_access_t reg;
- int32_t ret;
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_FUNC_CFG_ACCESS, (uint8_t *)®,
- - 1);
-
- - if (ret == 0) {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_FUNC_CFG_ACCESS, (uint8_t *)®, 1);
- +
- + if (ret == 0)
- + {
- reg.reg_access = (uint8_t)val;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_FUNC_CFG_ACCESS, (uint8_t *)®,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_FUNC_CFG_ACCESS, (uint8_t *)®, 1);
- }
-
- return ret;
- @@ -1485,6 +1654,7 @@ int32_t lsm6dso_mem_bank_set(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val Get the values of reg_access in
- * reg FUNC_CFG_ACCESS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_mem_bank_get(stmdev_ctx_t *ctx,
- @@ -1492,10 +1662,11 @@ int32_t lsm6dso_mem_bank_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_func_cfg_access_t reg;
- int32_t ret;
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_FUNC_CFG_ACCESS, (uint8_t *)®,
- - 1);
-
- - switch (reg.reg_access) {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_FUNC_CFG_ACCESS, (uint8_t *)®, 1);
- +
- + switch (reg.reg_access)
- + {
- case LSM6DSO_USER_BANK:
- *val = LSM6DSO_USER_BANK;
- break;
- @@ -1522,6 +1693,7 @@ int32_t lsm6dso_mem_bank_get(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param uint8_t address: page line address
- * @param val value to write
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_ln_pg_write_byte(stmdev_ctx_t *ctx, uint16_t address,
- @@ -1531,51 +1703,57 @@ int32_t lsm6dso_ln_pg_write_byte(stmdev_ctx_t *ctx, uint16_t address,
- lsm6dso_page_sel_t page_sel;
- lsm6dso_page_address_t page_address;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_PAGE_RW, (uint8_t *) &page_rw, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- page_rw.page_rw = 0x02; /* page_write enable */
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_RW, (uint8_t *) &page_rw,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_RW, (uint8_t *) &page_rw, 1);
- }
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_PAGE_SEL, (uint8_t *) &page_sel,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_PAGE_SEL, (uint8_t *) &page_sel, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- page_sel.page_sel = ((uint8_t)(address >> 8) & 0x0FU);
- page_sel.not_used_01 = 1;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_SEL, (uint8_t *) &page_sel,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_SEL, (uint8_t *) &page_sel, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- page_address.page_addr = (uint8_t)address & 0xFFU;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_ADDRESS,
- (uint8_t *)&page_address, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_VALUE, val, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_PAGE_RW, (uint8_t *) &page_rw, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- page_rw.page_rw = 0x00; /* page_write disable */
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_RW, (uint8_t *) &page_rw,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_RW, (uint8_t *) &page_rw, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -1589,6 +1767,7 @@ int32_t lsm6dso_ln_pg_write_byte(stmdev_ctx_t *ctx, uint16_t address,
- * @param uint8_t address: page line address
- * @param uint8_t *buf: buffer to write
- * @param uint8_t len: buffer len
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_ln_pg_write(stmdev_ctx_t *ctx, uint16_t address,
- @@ -1599,49 +1778,55 @@ int32_t lsm6dso_ln_pg_write(stmdev_ctx_t *ctx, uint16_t address,
- lsm6dso_page_address_t page_address;
- uint16_t addr_pointed;
- int32_t ret;
- +
- uint8_t i ;
- addr_pointed = address;
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_PAGE_RW, (uint8_t *) &page_rw, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- page_rw.page_rw = 0x02; /* page_write enable*/
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_RW, (uint8_t *) &page_rw,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_RW, (uint8_t *) &page_rw, 1);
- }
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_PAGE_SEL, (uint8_t *) &page_sel,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_PAGE_SEL, (uint8_t *) &page_sel, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- page_sel.page_sel = ((uint8_t)(addr_pointed >> 8) & 0x0FU);
- page_sel.not_used_01 = 1;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_SEL, (uint8_t *) &page_sel,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_SEL, (uint8_t *) &page_sel, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- page_address.page_addr = (uint8_t)(addr_pointed & 0x00FFU);
- ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_ADDRESS,
- (uint8_t *)&page_address, 1);
- }
-
- - if (ret == 0) {
- - for (i = 0; ( (i < len) && (ret == 0) ); i++) {
- + if (ret == 0)
- + {
- + for (i = 0; ((i < len) && (ret == 0)); i++)
- + {
- ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_VALUE, &buf[i], 1);
- addr_pointed++;
-
- /* Check if page wrap */
- - if ( ( (addr_pointed % 0x0100U) == 0x00U ) && (ret == 0) ) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_PAGE_SEL, (uint8_t *)&page_sel,
- - 1);
- + if (((addr_pointed % 0x0100U) == 0x00U) && (ret == 0))
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_PAGE_SEL, (uint8_t *)&page_sel, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- page_sel.page_sel = ((uint8_t)(addr_pointed >> 8) & 0x0FU);
- page_sel.not_used_01 = 1;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_SEL,
- @@ -1652,21 +1837,22 @@ int32_t lsm6dso_ln_pg_write(stmdev_ctx_t *ctx, uint16_t address,
-
- page_sel.page_sel = 0;
- page_sel.not_used_01 = 1;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_SEL, (uint8_t *) &page_sel,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_SEL, (uint8_t *) &page_sel, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_PAGE_RW, (uint8_t *) &page_rw, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- page_rw.page_rw = 0x00; /* page_write disable */
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_RW, (uint8_t *) &page_rw,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_RW, (uint8_t *) &page_rw, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -1679,6 +1865,7 @@ int32_t lsm6dso_ln_pg_write(stmdev_ctx_t *ctx, uint16_t address,
- * @param ctx read / write interface definitions
- * @param uint8_t address: page line address
- * @param val read value
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_ln_pg_read_byte(stmdev_ctx_t *ctx, uint16_t address,
- @@ -1688,51 +1875,57 @@ int32_t lsm6dso_ln_pg_read_byte(stmdev_ctx_t *ctx, uint16_t address,
- lsm6dso_page_sel_t page_sel;
- lsm6dso_page_address_t page_address;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_PAGE_RW, (uint8_t *) &page_rw, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- page_rw.page_rw = 0x01; /* page_read enable*/
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_RW, (uint8_t *) &page_rw,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_RW, (uint8_t *) &page_rw, 1);
- }
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_PAGE_SEL, (uint8_t *) &page_sel,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_PAGE_SEL, (uint8_t *) &page_sel, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- page_sel.page_sel = ((uint8_t)(address >> 8) & 0x0FU);
- page_sel.not_used_01 = 1;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_SEL, (uint8_t *) &page_sel,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_SEL, (uint8_t *) &page_sel, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- page_address.page_addr = (uint8_t)address & 0x00FFU;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_ADDRESS,
- (uint8_t *)&page_address, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_PAGE_VALUE, val, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_PAGE_RW, (uint8_t *) &page_rw, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- page_rw.page_rw = 0x00; /* page_read disable */
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_RW, (uint8_t *) &page_rw,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_RW, (uint8_t *) &page_rw, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -1746,6 +1939,7 @@ int32_t lsm6dso_ln_pg_read_byte(stmdev_ctx_t *ctx, uint16_t address,
- * @param val change the values of
- * dataready_pulsed in
- * reg COUNTER_BDR_REG1
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_data_ready_mode_set(stmdev_ctx_t *ctx,
- @@ -1753,10 +1947,11 @@ int32_t lsm6dso_data_ready_mode_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_counter_bdr_reg1_t reg;
- int32_t ret;
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_COUNTER_BDR_REG1, (uint8_t *)®,
- - 1);
-
- - if (ret == 0) {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_COUNTER_BDR_REG1, (uint8_t *)®, 1);
- +
- + if (ret == 0)
- + {
- reg.dataready_pulsed = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_COUNTER_BDR_REG1,
- (uint8_t *)®, 1);
- @@ -1772,6 +1967,7 @@ int32_t lsm6dso_data_ready_mode_set(stmdev_ctx_t *ctx,
- * @param val Get the values of
- * dataready_pulsed in
- * reg COUNTER_BDR_REG1
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_data_ready_mode_get(stmdev_ctx_t *ctx,
- @@ -1779,10 +1975,11 @@ int32_t lsm6dso_data_ready_mode_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_counter_bdr_reg1_t reg;
- int32_t ret;
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_COUNTER_BDR_REG1, (uint8_t *)®,
- - 1);
-
- - switch (reg.dataready_pulsed) {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_COUNTER_BDR_REG1, (uint8_t *)®, 1);
- +
- + switch (reg.dataready_pulsed)
- + {
- case LSM6DSO_DRDY_LATCHED:
- *val = LSM6DSO_DRDY_LATCHED;
- break;
- @@ -1804,12 +2001,15 @@ int32_t lsm6dso_data_ready_mode_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param buff buffer that stores data read
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_device_id_get(stmdev_ctx_t *ctx, uint8_t *buff)
- {
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_WHO_AM_I, buff, 1);
- +
- return ret;
- }
-
- @@ -1819,15 +2019,18 @@ int32_t lsm6dso_device_id_get(stmdev_ctx_t *ctx, uint8_t *buff)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of sw_reset in reg CTRL3_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_reset_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_ctrl3_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.sw_reset = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)®, 1);
- }
- @@ -1840,14 +2043,17 @@ int32_t lsm6dso_reset_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of sw_reset in reg CTRL3_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_reset_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_ctrl3_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)®, 1);
- *val = reg.sw_reset;
- +
- return ret;
- }
-
- @@ -1857,15 +2063,18 @@ int32_t lsm6dso_reset_get(stmdev_ctx_t *ctx, uint8_t *val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of if_inc in reg CTRL3_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_auto_increment_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_ctrl3_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.if_inc = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)®, 1);
- }
- @@ -1879,14 +2088,17 @@ int32_t lsm6dso_auto_increment_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of if_inc in reg CTRL3_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_auto_increment_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_ctrl3_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)®, 1);
- *val = reg.if_inc;
- +
- return ret;
- }
-
- @@ -1895,15 +2107,18 @@ int32_t lsm6dso_auto_increment_get(stmdev_ctx_t *ctx, uint8_t *val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of boot in reg CTRL3_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_boot_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_ctrl3_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.boot = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)®, 1);
- }
- @@ -1916,14 +2131,17 @@ int32_t lsm6dso_boot_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of boot in reg CTRL3_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_boot_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_ctrl3_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)®, 1);
- *val = reg.boot;
- +
- return ret;
- }
-
- @@ -1932,6 +2150,7 @@ int32_t lsm6dso_boot_get(stmdev_ctx_t *ctx, uint8_t *val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of st_xl in reg CTRL5_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_self_test_set(stmdev_ctx_t *ctx,
- @@ -1939,9 +2158,11 @@ int32_t lsm6dso_xl_self_test_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl5_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL5_C, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.st_xl = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL5_C, (uint8_t *)®, 1);
- }
- @@ -1954,6 +2175,7 @@ int32_t lsm6dso_xl_self_test_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of st_xl in reg CTRL5_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_self_test_get(stmdev_ctx_t *ctx,
- @@ -1961,9 +2183,11 @@ int32_t lsm6dso_xl_self_test_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl5_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL5_C, (uint8_t *)®, 1);
-
- - switch (reg.st_xl) {
- + switch (reg.st_xl)
- + {
- case LSM6DSO_XL_ST_DISABLE:
- *val = LSM6DSO_XL_ST_DISABLE;
- break;
- @@ -1989,6 +2213,7 @@ int32_t lsm6dso_xl_self_test_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of st_g in reg CTRL5_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_gy_self_test_set(stmdev_ctx_t *ctx,
- @@ -1996,9 +2221,11 @@ int32_t lsm6dso_gy_self_test_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl5_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL5_C, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.st_g = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL5_C, (uint8_t *)®, 1);
- }
- @@ -2011,6 +2238,7 @@ int32_t lsm6dso_gy_self_test_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of st_g in reg CTRL5_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_gy_self_test_get(stmdev_ctx_t *ctx,
- @@ -2018,9 +2246,11 @@ int32_t lsm6dso_gy_self_test_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl5_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL5_C, (uint8_t *)®, 1);
-
- - switch (reg.st_g) {
- + switch (reg.st_g)
- + {
- case LSM6DSO_GY_ST_DISABLE:
- *val = LSM6DSO_GY_ST_DISABLE;
- break;
- @@ -2052,22 +2282,25 @@ int32_t lsm6dso_gy_self_test_get(stmdev_ctx_t *ctx,
- * filters configuration
- * @{
- *
- -*/
- + */
-
- /**
- * @brief Accelerometer output from LPF2 filtering stage selection.[set]
- *
- * @param ctx read / write interface definitions
- * @param val change the values of lpf2_xl_en in reg CTRL1_XL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_filter_lp2_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_ctrl1_xl_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL1_XL, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.lpf2_xl_en = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL1_XL, (uint8_t *)®, 1);
- }
- @@ -2080,14 +2313,17 @@ int32_t lsm6dso_xl_filter_lp2_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of lpf2_xl_en in reg CTRL1_XL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_filter_lp2_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_ctrl1_xl_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL1_XL, (uint8_t *)®, 1);
- *val = reg.lpf2_xl_en;
- +
- return ret;
- }
-
- @@ -2098,15 +2334,18 @@ int32_t lsm6dso_xl_filter_lp2_get(stmdev_ctx_t *ctx, uint8_t *val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of lpf1_sel_g in reg CTRL4_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_gy_filter_lp1_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_ctrl4_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL4_C, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.lpf1_sel_g = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL4_C, (uint8_t *)®, 1);
- }
- @@ -2121,14 +2360,17 @@ int32_t lsm6dso_gy_filter_lp1_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of lpf1_sel_g in reg CTRL4_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_gy_filter_lp1_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_ctrl4_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL4_C, (uint8_t *)®, 1);
- *val = reg.lpf1_sel_g;
- +
- return ret;
- }
-
- @@ -2138,6 +2380,7 @@ int32_t lsm6dso_gy_filter_lp1_get(stmdev_ctx_t *ctx, uint8_t *val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of drdy_mask in reg CTRL4_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_filter_settling_mask_set(stmdev_ctx_t *ctx,
- @@ -2145,9 +2388,11 @@ int32_t lsm6dso_filter_settling_mask_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl4_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL4_C, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.drdy_mask = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL4_C, (uint8_t *)®, 1);
- }
- @@ -2161,6 +2406,7 @@ int32_t lsm6dso_filter_settling_mask_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of drdy_mask in reg CTRL4_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_filter_settling_mask_get(stmdev_ctx_t *ctx,
- @@ -2168,8 +2414,10 @@ int32_t lsm6dso_filter_settling_mask_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl4_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL4_C, (uint8_t *)®, 1);
- *val = reg.drdy_mask;
- +
- return ret;
- }
-
- @@ -2178,6 +2426,7 @@ int32_t lsm6dso_filter_settling_mask_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of ftype in reg CTRL6_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_gy_lp1_bandwidth_set(stmdev_ctx_t *ctx,
- @@ -2185,9 +2434,11 @@ int32_t lsm6dso_gy_lp1_bandwidth_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl6_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL6_C, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.ftype = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL6_C, (uint8_t *)®, 1);
- }
- @@ -2200,6 +2451,7 @@ int32_t lsm6dso_gy_lp1_bandwidth_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of ftype in reg CTRL6_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_gy_lp1_bandwidth_get(stmdev_ctx_t *ctx,
- @@ -2207,9 +2459,11 @@ int32_t lsm6dso_gy_lp1_bandwidth_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl6_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL6_C, (uint8_t *)®, 1);
-
- - switch (reg.ftype) {
- + switch (reg.ftype)
- + {
- case LSM6DSO_ULTRA_LIGHT:
- *val = LSM6DSO_ULTRA_LIGHT;
- break;
- @@ -2255,15 +2509,18 @@ int32_t lsm6dso_gy_lp1_bandwidth_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of low_pass_on_6d in reg CTRL8_XL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_lp2_on_6d_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_ctrl8_xl_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL8_XL, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.low_pass_on_6d = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL8_XL, (uint8_t *)®, 1);
- }
- @@ -2276,14 +2533,17 @@ int32_t lsm6dso_xl_lp2_on_6d_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of low_pass_on_6d in reg CTRL8_XL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_lp2_on_6d_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_ctrl8_xl_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL8_XL, (uint8_t *)®, 1);
- *val = reg.low_pass_on_6d;
- +
- return ret;
- }
-
- @@ -2294,6 +2554,7 @@ int32_t lsm6dso_xl_lp2_on_6d_get(stmdev_ctx_t *ctx, uint8_t *val)
- * @param ctx read / write interface definitions
- * @param val change the values of hp_slope_xl_en
- * in reg CTRL8_XL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_hp_path_on_out_set(stmdev_ctx_t *ctx,
- @@ -2301,9 +2562,11 @@ int32_t lsm6dso_xl_hp_path_on_out_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl8_xl_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL8_XL, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.hp_slope_xl_en = ((uint8_t)val & 0x10U) >> 4;
- reg.hp_ref_mode_xl = ((uint8_t)val & 0x20U) >> 5;
- reg.hpcf_xl = (uint8_t)val & 0x07U;
- @@ -2320,6 +2583,7 @@ int32_t lsm6dso_xl_hp_path_on_out_set(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val Get the values of hp_slope_xl_en
- * in reg CTRL8_XL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_hp_path_on_out_get(stmdev_ctx_t *ctx,
- @@ -2327,10 +2591,12 @@ int32_t lsm6dso_xl_hp_path_on_out_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl8_xl_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL8_XL, (uint8_t *)®, 1);
-
- switch ((reg.hp_ref_mode_xl << 5) | (reg.hp_slope_xl_en << 4) |
- - reg.hpcf_xl) {
- + reg.hpcf_xl)
- + {
- case LSM6DSO_HP_PATH_DISABLE_ON_OUT:
- *val = LSM6DSO_HP_PATH_DISABLE_ON_OUT;
- break;
- @@ -2439,15 +2705,18 @@ int32_t lsm6dso_xl_hp_path_on_out_get(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val change the values of fastsettl_mode_xl in
- * reg CTRL8_XL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_fast_settling_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_ctrl8_xl_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL8_XL, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.fastsettl_mode_xl = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL8_XL, (uint8_t *)®, 1);
- }
- @@ -2462,14 +2731,17 @@ int32_t lsm6dso_xl_fast_settling_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of fastsettl_mode_xl in reg CTRL8_XL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_fast_settling_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_ctrl8_xl_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL8_XL, (uint8_t *)®, 1);
- *val = reg.fastsettl_mode_xl;
- +
- return ret;
- }
-
- @@ -2479,6 +2751,7 @@ int32_t lsm6dso_xl_fast_settling_get(stmdev_ctx_t *ctx, uint8_t *val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of slope_fds in reg TAP_CFG0
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_hp_path_internal_set(stmdev_ctx_t *ctx,
- @@ -2486,9 +2759,11 @@ int32_t lsm6dso_xl_hp_path_internal_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_tap_cfg0_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG0, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.slope_fds = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_TAP_CFG0, (uint8_t *)®, 1);
- }
- @@ -2502,6 +2777,7 @@ int32_t lsm6dso_xl_hp_path_internal_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of slope_fds in reg TAP_CFG0
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_hp_path_internal_get(stmdev_ctx_t *ctx,
- @@ -2509,9 +2785,11 @@ int32_t lsm6dso_xl_hp_path_internal_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_tap_cfg0_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG0, (uint8_t *)®, 1);
-
- - switch (reg.slope_fds) {
- + switch (reg.slope_fds)
- + {
- case LSM6DSO_USE_SLOPE:
- *val = LSM6DSO_USE_SLOPE;
- break;
- @@ -2535,6 +2813,7 @@ int32_t lsm6dso_xl_hp_path_internal_get(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val Get the values of hp_en_g and hp_en_g
- * in reg CTRL7_G
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_gy_hp_path_internal_set(stmdev_ctx_t *ctx,
- @@ -2542,9 +2821,11 @@ int32_t lsm6dso_gy_hp_path_internal_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl7_g_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL7_G, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.hp_en_g = ((uint8_t)val & 0x80U) >> 7;
- reg.hpm_g = (uint8_t)val & 0x03U;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL7_G, (uint8_t *)®, 1);
- @@ -2560,6 +2841,7 @@ int32_t lsm6dso_gy_hp_path_internal_set(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val Get the values of hp_en_g and hp_en_g
- * in reg CTRL7_G
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_gy_hp_path_internal_get(stmdev_ctx_t *ctx,
- @@ -2567,9 +2849,11 @@ int32_t lsm6dso_gy_hp_path_internal_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl7_g_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL7_G, (uint8_t *)®, 1);
-
- - switch ((reg.hp_en_g << 7) + reg.hpm_g) {
- + switch ((reg.hp_en_g << 7) + reg.hpm_g)
- + {
- case LSM6DSO_HP_FILTER_NONE:
- *val = LSM6DSO_HP_FILTER_NONE;
- break;
- @@ -2609,7 +2893,7 @@ int32_t lsm6dso_gy_hp_path_internal_get(stmdev_ctx_t *ctx,
- * auxiliary interface.
- * @{
- *
- -*/
- + */
-
- /**
- * @brief aOn auxiliary interface connect/disconnect SDO and OCS
- @@ -2618,6 +2902,7 @@ int32_t lsm6dso_gy_hp_path_internal_get(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val change the values of ois_pu_dis in
- * reg PIN_CTRL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_sdo_ocs_mode_set(stmdev_ctx_t *ctx,
- @@ -2625,9 +2910,11 @@ int32_t lsm6dso_aux_sdo_ocs_mode_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_pin_ctrl_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_PIN_CTRL, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.ois_pu_dis = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_PIN_CTRL, (uint8_t *)®, 1);
- }
- @@ -2641,6 +2928,7 @@ int32_t lsm6dso_aux_sdo_ocs_mode_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of ois_pu_dis in reg PIN_CTRL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_sdo_ocs_mode_get(stmdev_ctx_t *ctx,
- @@ -2648,9 +2936,11 @@ int32_t lsm6dso_aux_sdo_ocs_mode_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_pin_ctrl_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_PIN_CTRL, (uint8_t *)®, 1);
-
- - switch (reg.ois_pu_dis) {
- + switch (reg.ois_pu_dis)
- + {
- case LSM6DSO_AUX_PULL_UP_DISC:
- *val = LSM6DSO_AUX_PULL_UP_DISC;
- break;
- @@ -2672,6 +2962,7 @@ int32_t lsm6dso_aux_sdo_ocs_mode_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of ois_on in reg CTRL7_G
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_pw_on_ctrl_set(stmdev_ctx_t *ctx,
- @@ -2679,9 +2970,11 @@ int32_t lsm6dso_aux_pw_on_ctrl_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl7_g_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL7_G, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.ois_on_en = (uint8_t)val & 0x01U;
- reg.ois_on = (uint8_t)val & 0x01U;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL7_G, (uint8_t *)®, 1);
- @@ -2695,6 +2988,7 @@ int32_t lsm6dso_aux_pw_on_ctrl_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of ois_on in reg CTRL7_G
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_pw_on_ctrl_get(stmdev_ctx_t *ctx,
- @@ -2702,9 +2996,11 @@ int32_t lsm6dso_aux_pw_on_ctrl_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl7_g_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL7_G, (uint8_t *)®, 1);
-
- - switch (reg.ois_on) {
- + switch (reg.ois_on)
- + {
- case LSM6DSO_AUX_ON:
- *val = LSM6DSO_AUX_ON;
- break;
- @@ -2732,6 +3028,7 @@ int32_t lsm6dso_aux_pw_on_ctrl_get(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val change the values of xl_fs_mode in
- * reg CTRL8_XL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_xl_fs_mode_set(stmdev_ctx_t *ctx,
- @@ -2739,9 +3036,11 @@ int32_t lsm6dso_aux_xl_fs_mode_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl8_xl_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL8_XL, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.xl_fs_mode = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL8_XL, (uint8_t *)®, 1);
- }
- @@ -2759,6 +3058,7 @@ int32_t lsm6dso_aux_xl_fs_mode_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of xl_fs_mode in reg CTRL8_XL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_xl_fs_mode_get(stmdev_ctx_t *ctx,
- @@ -2766,9 +3066,11 @@ int32_t lsm6dso_aux_xl_fs_mode_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl8_xl_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL8_XL, (uint8_t *)®, 1);
-
- - switch (reg.xl_fs_mode) {
- + switch (reg.xl_fs_mode)
- + {
- case LSM6DSO_USE_SAME_XL_FS:
- *val = LSM6DSO_USE_SAME_XL_FS;
- break;
- @@ -2790,14 +3092,16 @@ int32_t lsm6dso_aux_xl_fs_mode_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param lsm6dso_status_spiaux_t: registers STATUS_SPIAUX
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_status_reg_get(stmdev_ctx_t *ctx,
- lsm6dso_status_spiaux_t *val)
- {
- int32_t ret;
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_STATUS_SPIAUX, (uint8_t *) val,
- - 1);
- +
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_STATUS_SPIAUX, (uint8_t *) val, 1);
- +
- return ret;
- }
-
- @@ -2806,6 +3110,7 @@ int32_t lsm6dso_aux_status_reg_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of xlda in reg STATUS_SPIAUX
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_xl_flag_data_ready_get(stmdev_ctx_t *ctx,
- @@ -2813,9 +3118,10 @@ int32_t lsm6dso_aux_xl_flag_data_ready_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_status_spiaux_t reg;
- int32_t ret;
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_STATUS_SPIAUX, (uint8_t *)®,
- - 1);
- +
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_STATUS_SPIAUX, (uint8_t *)®, 1);
- *val = reg.xlda;
- +
- return ret;
- }
-
- @@ -2824,6 +3130,7 @@ int32_t lsm6dso_aux_xl_flag_data_ready_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of gda in reg STATUS_SPIAUX
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_gy_flag_data_ready_get(stmdev_ctx_t *ctx,
- @@ -2831,9 +3138,10 @@ int32_t lsm6dso_aux_gy_flag_data_ready_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_status_spiaux_t reg;
- int32_t ret;
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_STATUS_SPIAUX, (uint8_t *)®,
- - 1);
- +
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_STATUS_SPIAUX, (uint8_t *)®, 1);
- *val = reg.gda;
- +
- return ret;
- }
-
- @@ -2842,6 +3150,7 @@ int32_t lsm6dso_aux_gy_flag_data_ready_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of gyro_settling in reg STATUS_SPIAUX
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_gy_flag_settling_get(stmdev_ctx_t *ctx,
- @@ -2849,9 +3158,10 @@ int32_t lsm6dso_aux_gy_flag_settling_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_status_spiaux_t reg;
- int32_t ret;
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_STATUS_SPIAUX, (uint8_t *)®,
- - 1);
- +
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_STATUS_SPIAUX, (uint8_t *)®, 1);
- *val = reg.gyro_settling;
- +
- return ret;
- }
-
- @@ -2861,6 +3171,7 @@ int32_t lsm6dso_aux_gy_flag_settling_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of st_xl_ois in reg INT_OIS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_xl_self_test_set(stmdev_ctx_t *ctx,
- @@ -2868,9 +3179,11 @@ int32_t lsm6dso_aux_xl_self_test_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_int_ois_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_INT_OIS, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.st_xl_ois = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_INT_OIS, (uint8_t *)®, 1);
- }
- @@ -2884,6 +3197,7 @@ int32_t lsm6dso_aux_xl_self_test_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of st_xl_ois in reg INT_OIS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_xl_self_test_get(stmdev_ctx_t *ctx,
- @@ -2891,9 +3205,11 @@ int32_t lsm6dso_aux_xl_self_test_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_int_ois_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_INT_OIS, (uint8_t *)®, 1);
-
- - switch (reg.st_xl_ois) {
- + switch (reg.st_xl_ois)
- + {
- case LSM6DSO_AUX_XL_DISABLE:
- *val = LSM6DSO_AUX_XL_DISABLE;
- break;
- @@ -2920,6 +3236,7 @@ int32_t lsm6dso_aux_xl_self_test_get(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val change the values of den_lh_ois in
- * reg INT_OIS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_den_polarity_set(stmdev_ctx_t *ctx,
- @@ -2927,9 +3244,11 @@ int32_t lsm6dso_aux_den_polarity_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_int_ois_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_INT_OIS, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.den_lh_ois = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_INT_OIS, (uint8_t *)®, 1);
- }
- @@ -2942,6 +3261,7 @@ int32_t lsm6dso_aux_den_polarity_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of den_lh_ois in reg INT_OIS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_den_polarity_get(stmdev_ctx_t *ctx,
- @@ -2949,9 +3269,11 @@ int32_t lsm6dso_aux_den_polarity_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_int_ois_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_INT_OIS, (uint8_t *)®, 1);
-
- - switch (reg.den_lh_ois) {
- + switch (reg.den_lh_ois)
- + {
- case LSM6DSO_AUX_DEN_ACTIVE_LOW:
- *val = LSM6DSO_AUX_DEN_ACTIVE_LOW;
- break;
- @@ -2973,6 +3295,7 @@ int32_t lsm6dso_aux_den_polarity_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of lvl2_ois in reg INT_OIS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_den_mode_set(stmdev_ctx_t *ctx,
- @@ -2981,20 +3304,22 @@ int32_t lsm6dso_aux_den_mode_set(stmdev_ctx_t *ctx,
- lsm6dso_ctrl1_ois_t ctrl1_ois;
- lsm6dso_int_ois_t int_ois;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_INT_OIS, (uint8_t *) &int_ois, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- int_ois.lvl2_ois = (uint8_t)val & 0x01U;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_INT_OIS, (uint8_t *) &int_ois,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_INT_OIS, (uint8_t *) &int_ois, 1);
- }
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL1_OIS, (uint8_t *) &ctrl1_ois,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL1_OIS, (uint8_t *) &ctrl1_ois, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ctrl1_ois.lvl1_ois = ((uint8_t)val & 0x02U) >> 1;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL1_OIS,
- (uint8_t *) &ctrl1_ois, 1);
- @@ -3008,6 +3333,7 @@ int32_t lsm6dso_aux_den_mode_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of lvl2_ois in reg INT_OIS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_den_mode_get(stmdev_ctx_t *ctx,
- @@ -3016,13 +3342,15 @@ int32_t lsm6dso_aux_den_mode_get(stmdev_ctx_t *ctx,
- lsm6dso_ctrl1_ois_t ctrl1_ois;
- lsm6dso_int_ois_t int_ois;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_INT_OIS, (uint8_t *) &int_ois, 1);
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL1_OIS, (uint8_t *) &ctrl1_ois,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL1_OIS, (uint8_t *) &ctrl1_ois, 1);
-
- - switch ((ctrl1_ois.lvl1_ois << 1) + int_ois.lvl2_ois) {
- + switch ((ctrl1_ois.lvl1_ois << 1) + int_ois.lvl2_ois)
- + {
- case LSM6DSO_AUX_DEN_DISABLE:
- *val = LSM6DSO_AUX_DEN_DISABLE;
- break;
- @@ -3050,15 +3378,18 @@ int32_t lsm6dso_aux_den_mode_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of int2_drdy_ois in reg INT_OIS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_drdy_on_int2_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_int_ois_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_INT_OIS, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.int2_drdy_ois = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_INT_OIS, (uint8_t *)®, 1);
- }
- @@ -3072,14 +3403,17 @@ int32_t lsm6dso_aux_drdy_on_int2_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of int2_drdy_ois in reg INT_OIS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_drdy_on_int2_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_int_ois_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_INT_OIS, (uint8_t *)®, 1);
- *val = reg.int2_drdy_ois;
- +
- return ret;
- }
-
- @@ -3094,6 +3428,7 @@ int32_t lsm6dso_aux_drdy_on_int2_get(stmdev_ctx_t *ctx, uint8_t *val)
- * @param ctx read / write interface definitions
- * @param val change the values of ois_en_spi2 in
- * reg CTRL1_OIS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_mode_set(stmdev_ctx_t *ctx,
- @@ -3101,9 +3436,11 @@ int32_t lsm6dso_aux_mode_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl1_ois_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL1_OIS, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.ois_en_spi2 = (uint8_t)val & 0x01U;
- reg.mode4_en = ((uint8_t)val & 0x02U) >> 1;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL1_OIS, (uint8_t *)®, 1);
- @@ -3123,6 +3460,7 @@ int32_t lsm6dso_aux_mode_set(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val Get the values of ois_en_spi2 in
- * reg CTRL1_OIS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_mode_get(stmdev_ctx_t *ctx,
- @@ -3130,9 +3468,11 @@ int32_t lsm6dso_aux_mode_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl1_ois_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL1_OIS, (uint8_t *)®, 1);
-
- - switch ((reg.mode4_en << 1) | reg.ois_en_spi2) {
- + switch ((reg.mode4_en << 1) | reg.ois_en_spi2)
- + {
- case LSM6DSO_AUX_DISABLE:
- *val = LSM6DSO_AUX_DISABLE;
- break;
- @@ -3158,6 +3498,7 @@ int32_t lsm6dso_aux_mode_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of fs_g_ois in reg CTRL1_OIS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_gy_full_scale_set(stmdev_ctx_t *ctx,
- @@ -3165,9 +3506,11 @@ int32_t lsm6dso_aux_gy_full_scale_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl1_ois_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL1_OIS, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.fs_g_ois = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL1_OIS, (uint8_t *)®, 1);
- }
- @@ -3180,6 +3523,7 @@ int32_t lsm6dso_aux_gy_full_scale_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of fs_g_ois in reg CTRL1_OIS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_gy_full_scale_get(stmdev_ctx_t *ctx,
- @@ -3187,9 +3531,11 @@ int32_t lsm6dso_aux_gy_full_scale_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl1_ois_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL1_OIS, (uint8_t *)®, 1);
-
- - switch (reg.fs_g_ois) {
- + switch (reg.fs_g_ois)
- + {
- case LSM6DSO_250dps_AUX:
- *val = LSM6DSO_250dps_AUX;
- break;
- @@ -3223,6 +3569,7 @@ int32_t lsm6dso_aux_gy_full_scale_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of sim_ois in reg CTRL1_OIS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_spi_mode_set(stmdev_ctx_t *ctx,
- @@ -3230,9 +3577,11 @@ int32_t lsm6dso_aux_spi_mode_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl1_ois_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL1_OIS, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.sim_ois = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL1_OIS, (uint8_t *)®, 1);
- }
- @@ -3245,6 +3594,7 @@ int32_t lsm6dso_aux_spi_mode_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of sim_ois in reg CTRL1_OIS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_spi_mode_get(stmdev_ctx_t *ctx,
- @@ -3252,9 +3602,11 @@ int32_t lsm6dso_aux_spi_mode_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl1_ois_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL1_OIS, (uint8_t *)®, 1);
-
- - switch (reg.sim_ois) {
- + switch (reg.sim_ois)
- + {
- case LSM6DSO_AUX_SPI_4_WIRE:
- *val = LSM6DSO_AUX_SPI_4_WIRE;
- break;
- @@ -3277,6 +3629,7 @@ int32_t lsm6dso_aux_spi_mode_get(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val change the values of ftype_ois in
- * reg CTRL2_OIS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_gy_lp1_bandwidth_set(stmdev_ctx_t *ctx,
- @@ -3284,9 +3637,11 @@ int32_t lsm6dso_aux_gy_lp1_bandwidth_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl2_ois_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL2_OIS, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.ftype_ois = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL2_OIS, (uint8_t *)®, 1);
- }
- @@ -3299,6 +3654,7 @@ int32_t lsm6dso_aux_gy_lp1_bandwidth_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of ftype_ois in reg CTRL2_OIS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_gy_lp1_bandwidth_get(stmdev_ctx_t *ctx,
- @@ -3306,9 +3662,11 @@ int32_t lsm6dso_aux_gy_lp1_bandwidth_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl2_ois_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL2_OIS, (uint8_t *)®, 1);
-
- - switch (reg.ftype_ois) {
- + switch (reg.ftype_ois)
- + {
- case LSM6DSO_351Hz39:
- *val = LSM6DSO_351Hz39;
- break;
- @@ -3338,6 +3696,7 @@ int32_t lsm6dso_aux_gy_lp1_bandwidth_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of hpm_ois in reg CTRL2_OIS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_gy_hp_bandwidth_set(stmdev_ctx_t *ctx,
- @@ -3345,9 +3704,11 @@ int32_t lsm6dso_aux_gy_hp_bandwidth_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl2_ois_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL2_OIS, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.hpm_ois = (uint8_t)val & 0x03U;
- reg.hp_en_ois = ((uint8_t)val & 0x10U) >> 4;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL2_OIS, (uint8_t *)®, 1);
- @@ -3361,6 +3722,7 @@ int32_t lsm6dso_aux_gy_hp_bandwidth_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of hpm_ois in reg CTRL2_OIS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_gy_hp_bandwidth_get(stmdev_ctx_t *ctx,
- @@ -3368,9 +3730,11 @@ int32_t lsm6dso_aux_gy_hp_bandwidth_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl2_ois_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL2_OIS, (uint8_t *)®, 1);
-
- - switch ((reg.hp_en_ois << 4) | reg.hpm_ois) {
- + switch ((reg.hp_en_ois << 4) | reg.hpm_ois)
- + {
- case LSM6DSO_AUX_HP_DISABLE:
- *val = LSM6DSO_AUX_HP_DISABLE;
- break;
- @@ -3409,6 +3773,7 @@ int32_t lsm6dso_aux_gy_hp_bandwidth_get(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val change the values of st_ois_clampdis in
- * reg CTRL3_OIS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_gy_clamp_set(stmdev_ctx_t *ctx,
- @@ -3416,9 +3781,11 @@ int32_t lsm6dso_aux_gy_clamp_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl3_ois_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_OIS, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.st_ois_clampdis = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL3_OIS, (uint8_t *)®, 1);
- }
- @@ -3436,6 +3803,7 @@ int32_t lsm6dso_aux_gy_clamp_set(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val Get the values of st_ois_clampdis in
- * reg CTRL3_OIS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_gy_clamp_get(stmdev_ctx_t *ctx,
- @@ -3443,9 +3811,11 @@ int32_t lsm6dso_aux_gy_clamp_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl3_ois_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_OIS, (uint8_t *)®, 1);
-
- - switch (reg.st_ois_clampdis) {
- + switch (reg.st_ois_clampdis)
- + {
- case LSM6DSO_ENABLE_CLAMP:
- *val = LSM6DSO_ENABLE_CLAMP;
- break;
- @@ -3467,6 +3837,7 @@ int32_t lsm6dso_aux_gy_clamp_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of st_ois in reg CTRL3_OIS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_gy_self_test_set(stmdev_ctx_t *ctx,
- @@ -3474,9 +3845,11 @@ int32_t lsm6dso_aux_gy_self_test_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl3_ois_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_OIS, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.st_ois = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL3_OIS, (uint8_t *)®, 1);
- }
- @@ -3489,6 +3862,7 @@ int32_t lsm6dso_aux_gy_self_test_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of st_ois in reg CTRL3_OIS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_gy_self_test_get(stmdev_ctx_t *ctx,
- @@ -3496,9 +3870,11 @@ int32_t lsm6dso_aux_gy_self_test_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl3_ois_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_OIS, (uint8_t *)®, 1);
-
- - switch (reg.st_ois) {
- + switch (reg.st_ois)
- + {
- case LSM6DSO_AUX_GY_DISABLE:
- *val = LSM6DSO_AUX_GY_DISABLE;
- break;
- @@ -3525,6 +3901,7 @@ int32_t lsm6dso_aux_gy_self_test_get(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val change the values of
- * filter_xl_conf_ois in reg CTRL3_OIS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_xl_bandwidth_set(stmdev_ctx_t *ctx,
- @@ -3532,9 +3909,11 @@ int32_t lsm6dso_aux_xl_bandwidth_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl3_ois_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_OIS, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.filter_xl_conf_ois = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL3_OIS, (uint8_t *)®, 1);
- }
- @@ -3548,6 +3927,7 @@ int32_t lsm6dso_aux_xl_bandwidth_set(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val Get the values of
- * filter_xl_conf_ois in reg CTRL3_OIS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_xl_bandwidth_get(stmdev_ctx_t *ctx,
- @@ -3555,9 +3935,11 @@ int32_t lsm6dso_aux_xl_bandwidth_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl3_ois_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_OIS, (uint8_t *)®, 1);
-
- - switch (reg.filter_xl_conf_ois) {
- + switch (reg.filter_xl_conf_ois)
- + {
- case LSM6DSO_289Hz:
- *val = LSM6DSO_289Hz;
- break;
- @@ -3604,6 +3986,7 @@ int32_t lsm6dso_aux_xl_bandwidth_get(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val change the values of fs_xl_ois in
- * reg CTRL3_OIS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_xl_full_scale_set(stmdev_ctx_t *ctx,
- @@ -3611,9 +3994,11 @@ int32_t lsm6dso_aux_xl_full_scale_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl3_ois_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_OIS, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.fs_xl_ois = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL3_OIS, (uint8_t *)®, 1);
- }
- @@ -3626,6 +4011,7 @@ int32_t lsm6dso_aux_xl_full_scale_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of fs_xl_ois in reg CTRL3_OIS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_aux_xl_full_scale_get(stmdev_ctx_t *ctx,
- @@ -3633,9 +4019,11 @@ int32_t lsm6dso_aux_xl_full_scale_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl3_ois_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_OIS, (uint8_t *)®, 1);
-
- - switch (reg.fs_xl_ois) {
- + switch (reg.fs_xl_ois)
- + {
- case LSM6DSO_AUX_2g:
- *val = LSM6DSO_AUX_2g;
- break;
- @@ -3671,7 +4059,7 @@ int32_t lsm6dso_aux_xl_full_scale_get(stmdev_ctx_t *ctx,
- * serial interface management (not auxiliary)
- * @{
- *
- -*/
- + */
-
- /**
- * @brief Connect/Disconnect SDO/SA0 internal pull-up.[set]
- @@ -3679,6 +4067,7 @@ int32_t lsm6dso_aux_xl_full_scale_get(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val change the values of sdo_pu_en in
- * reg PIN_CTRL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sdo_sa0_mode_set(stmdev_ctx_t *ctx,
- @@ -3686,9 +4075,11 @@ int32_t lsm6dso_sdo_sa0_mode_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_pin_ctrl_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_PIN_CTRL, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.sdo_pu_en = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_PIN_CTRL, (uint8_t *)®, 1);
- }
- @@ -3701,6 +4092,7 @@ int32_t lsm6dso_sdo_sa0_mode_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of sdo_pu_en in reg PIN_CTRL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sdo_sa0_mode_get(stmdev_ctx_t *ctx,
- @@ -3708,9 +4100,11 @@ int32_t lsm6dso_sdo_sa0_mode_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_pin_ctrl_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_PIN_CTRL, (uint8_t *)®, 1);
-
- - switch (reg.sdo_pu_en) {
- + switch (reg.sdo_pu_en)
- + {
- case LSM6DSO_PULL_UP_DISC:
- *val = LSM6DSO_PULL_UP_DISC;
- break;
- @@ -3732,15 +4126,18 @@ int32_t lsm6dso_sdo_sa0_mode_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of sim in reg CTRL3_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_spi_mode_set(stmdev_ctx_t *ctx, lsm6dso_sim_t val)
- {
- lsm6dso_ctrl3_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.sim = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)®, 1);
- }
- @@ -3753,15 +4150,18 @@ int32_t lsm6dso_spi_mode_set(stmdev_ctx_t *ctx, lsm6dso_sim_t val)
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of sim in reg CTRL3_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_spi_mode_get(stmdev_ctx_t *ctx, lsm6dso_sim_t *val)
- {
- lsm6dso_ctrl3_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)®, 1);
-
- - switch (reg.sim) {
- + switch (reg.sim)
- + {
- case LSM6DSO_SPI_4_WIRE:
- *val = LSM6DSO_SPI_4_WIRE;
- break;
- @@ -3784,6 +4184,7 @@ int32_t lsm6dso_spi_mode_get(stmdev_ctx_t *ctx, lsm6dso_sim_t *val)
- * @param ctx read / write interface definitions
- * @param val change the values of i2c_disable in
- * reg CTRL4_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_i2c_interface_set(stmdev_ctx_t *ctx,
- @@ -3791,9 +4192,11 @@ int32_t lsm6dso_i2c_interface_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl4_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL4_C, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.i2c_disable = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL4_C, (uint8_t *)®, 1);
- }
- @@ -3807,6 +4210,7 @@ int32_t lsm6dso_i2c_interface_set(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val Get the values of i2c_disable in
- * reg CTRL4_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_i2c_interface_get(stmdev_ctx_t *ctx,
- @@ -3814,9 +4218,11 @@ int32_t lsm6dso_i2c_interface_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl4_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL4_C, (uint8_t *)®, 1);
-
- - switch (reg.i2c_disable) {
- + switch (reg.i2c_disable)
- + {
- case LSM6DSO_I2C_ENABLE:
- *val = LSM6DSO_I2C_ENABLE;
- break;
- @@ -3839,6 +4245,7 @@ int32_t lsm6dso_i2c_interface_get(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val change the values of i3c_disable
- * in reg CTRL9_XL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_i3c_disable_set(stmdev_ctx_t *ctx,
- @@ -3847,21 +4254,23 @@ int32_t lsm6dso_i3c_disable_set(stmdev_ctx_t *ctx,
- lsm6dso_i3c_bus_avb_t i3c_bus_avb;
- lsm6dso_ctrl9_xl_t ctrl9_xl;
- int32_t ret;
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL9_XL, (uint8_t *)&ctrl9_xl,
- - 1);
-
- - if (ret == 0) {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL9_XL, (uint8_t *)&ctrl9_xl, 1);
- +
- + if (ret == 0)
- + {
- ctrl9_xl.i3c_disable = ((uint8_t)val & 0x80U) >> 7;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL9_XL, (uint8_t *)&ctrl9_xl,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL9_XL, (uint8_t *)&ctrl9_xl, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_I3C_BUS_AVB,
- (uint8_t *)&i3c_bus_avb, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- i3c_bus_avb.i3c_bus_avb_sel = (uint8_t)val & 0x03U;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_I3C_BUS_AVB,
- (uint8_t *)&i3c_bus_avb, 1);
- @@ -3876,6 +4285,7 @@ int32_t lsm6dso_i3c_disable_set(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val change the values of i3c_disable in
- * reg CTRL9_XL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_i3c_disable_get(stmdev_ctx_t *ctx,
- @@ -3884,14 +4294,16 @@ int32_t lsm6dso_i3c_disable_get(stmdev_ctx_t *ctx,
- lsm6dso_ctrl9_xl_t ctrl9_xl;
- lsm6dso_i3c_bus_avb_t i3c_bus_avb;
- int32_t ret;
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL9_XL, (uint8_t *)&ctrl9_xl,
- - 1);
-
- - if (ret == 0) {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL9_XL, (uint8_t *)&ctrl9_xl, 1);
- +
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_I3C_BUS_AVB,
- (uint8_t *)&i3c_bus_avb, 1);
-
- - switch ((ctrl9_xl.i3c_disable << 7) | i3c_bus_avb.i3c_bus_avb_sel) {
- + switch ((ctrl9_xl.i3c_disable << 7) | i3c_bus_avb.i3c_bus_avb_sel)
- + {
- case LSM6DSO_I3C_DISABLE:
- *val = LSM6DSO_I3C_DISABLE;
- break;
- @@ -3938,6 +4350,7 @@ int32_t lsm6dso_i3c_disable_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of pd_dis_int1 in reg I3C_BUS_AVB
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_int1_mode_set(stmdev_ctx_t *ctx,
- @@ -3945,9 +4358,11 @@ int32_t lsm6dso_int1_mode_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_i3c_bus_avb_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_I3C_BUS_AVB, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.pd_dis_int1 = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_I3C_BUS_AVB, (uint8_t *)®, 1);
- }
- @@ -3960,6 +4375,7 @@ int32_t lsm6dso_int1_mode_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of pd_dis_int1 in reg I3C_BUS_AVB
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_int1_mode_get(stmdev_ctx_t *ctx,
- @@ -3967,9 +4383,11 @@ int32_t lsm6dso_int1_mode_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_i3c_bus_avb_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_I3C_BUS_AVB, (uint8_t *)®, 1);
-
- - switch (reg.pd_dis_int1) {
- + switch (reg.pd_dis_int1)
- + {
- case LSM6DSO_PULL_DOWN_DISC:
- *val = LSM6DSO_PULL_DOWN_DISC;
- break;
- @@ -3991,15 +4409,18 @@ int32_t lsm6dso_int1_mode_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of pp_od in reg CTRL3_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_pin_mode_set(stmdev_ctx_t *ctx, lsm6dso_pp_od_t val)
- {
- lsm6dso_ctrl3_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.pp_od = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)®, 1);
- }
- @@ -4012,15 +4433,18 @@ int32_t lsm6dso_pin_mode_set(stmdev_ctx_t *ctx, lsm6dso_pp_od_t val)
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of pp_od in reg CTRL3_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_pin_mode_get(stmdev_ctx_t *ctx, lsm6dso_pp_od_t *val)
- {
- lsm6dso_ctrl3_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)®, 1);
-
- - switch (reg.pp_od) {
- + switch (reg.pp_od)
- + {
- case LSM6DSO_PUSH_PULL:
- *val = LSM6DSO_PUSH_PULL;
- break;
- @@ -4042,6 +4466,7 @@ int32_t lsm6dso_pin_mode_get(stmdev_ctx_t *ctx, lsm6dso_pp_od_t *val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of h_lactive in reg CTRL3_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_pin_polarity_set(stmdev_ctx_t *ctx,
- @@ -4049,9 +4474,11 @@ int32_t lsm6dso_pin_polarity_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl3_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.h_lactive = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)®, 1);
- }
- @@ -4064,6 +4491,7 @@ int32_t lsm6dso_pin_polarity_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of h_lactive in reg CTRL3_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_pin_polarity_get(stmdev_ctx_t *ctx,
- @@ -4071,9 +4499,11 @@ int32_t lsm6dso_pin_polarity_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl3_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)®, 1);
-
- - switch (reg.h_lactive) {
- + switch (reg.h_lactive)
- + {
- case LSM6DSO_ACTIVE_HIGH:
- *val = LSM6DSO_ACTIVE_HIGH;
- break;
- @@ -4095,15 +4525,18 @@ int32_t lsm6dso_pin_polarity_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of int2_on_int1 in reg CTRL4_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_all_on_int1_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_ctrl4_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL4_C, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.int2_on_int1 = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL4_C, (uint8_t *)®, 1);
- }
- @@ -4116,14 +4549,17 @@ int32_t lsm6dso_all_on_int1_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of int2_on_int1 in reg CTRL4_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_all_on_int1_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_ctrl4_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL4_C, (uint8_t *)®, 1);
- *val = reg.int2_on_int1;
- +
- return ret;
- }
-
- @@ -4132,6 +4568,7 @@ int32_t lsm6dso_all_on_int1_get(stmdev_ctx_t *ctx, uint8_t *val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of lir in reg TAP_CFG0
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_int_notification_set(stmdev_ctx_t *ctx,
- @@ -4140,31 +4577,34 @@ int32_t lsm6dso_int_notification_set(stmdev_ctx_t *ctx,
- lsm6dso_tap_cfg0_t tap_cfg0;
- lsm6dso_page_rw_t page_rw;
- int32_t ret;
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG0, (uint8_t *) &tap_cfg0,
- - 1);
-
- - if (ret == 0) {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG0, (uint8_t *) &tap_cfg0, 1);
- +
- + if (ret == 0)
- + {
- tap_cfg0.lir = (uint8_t)val & 0x01U;
- tap_cfg0.int_clr_on_read = (uint8_t)val & 0x01U;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_TAP_CFG0, (uint8_t *) &tap_cfg0,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_TAP_CFG0, (uint8_t *) &tap_cfg0, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_PAGE_RW, (uint8_t *) &page_rw, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- page_rw.emb_func_lir = ((uint8_t)val & 0x02U) >> 1;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_RW, (uint8_t *) &page_rw,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_RW, (uint8_t *) &page_rw, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -4176,6 +4616,7 @@ int32_t lsm6dso_int_notification_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of lir in reg TAP_CFG0
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_int_notification_get(stmdev_ctx_t *ctx,
- @@ -4184,23 +4625,28 @@ int32_t lsm6dso_int_notification_get(stmdev_ctx_t *ctx,
- lsm6dso_tap_cfg0_t tap_cfg0;
- lsm6dso_page_rw_t page_rw;
- int32_t ret;
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG0, (uint8_t *) &tap_cfg0,
- - 1);
-
- - if (ret == 0) {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG0, (uint8_t *) &tap_cfg0, 1);
- +
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_PAGE_RW, (uint8_t *) &page_rw, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- - if (ret == 0) {
- - switch ((page_rw.emb_func_lir << 1) | tap_cfg0.lir) {
- + if (ret == 0)
- + {
- + switch ((page_rw.emb_func_lir << 1) | tap_cfg0.lir)
- + {
- case LSM6DSO_ALL_INT_PULSED:
- *val = LSM6DSO_ALL_INT_PULSED;
- break;
- @@ -4225,11 +4671,13 @@ int32_t lsm6dso_int_notification_get(stmdev_ctx_t *ctx,
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_PAGE_RW, (uint8_t *) &page_rw, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -4247,7 +4695,7 @@ int32_t lsm6dso_int_notification_get(stmdev_ctx_t *ctx,
- * event generation.
- * @{
- *
- -*/
- + */
-
- /**
- * @brief Weight of 1 LSB of wakeup threshold.[set]
- @@ -4257,6 +4705,7 @@ int32_t lsm6dso_int_notification_get(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val change the values of wake_ths_w in
- * reg WAKE_UP_DUR
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_wkup_ths_weight_set(stmdev_ctx_t *ctx,
- @@ -4264,9 +4713,11 @@ int32_t lsm6dso_wkup_ths_weight_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_wake_up_dur_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_WAKE_UP_DUR, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.wake_ths_w = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_WAKE_UP_DUR, (uint8_t *)®, 1);
- }
- @@ -4282,6 +4733,7 @@ int32_t lsm6dso_wkup_ths_weight_set(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val Get the values of wake_ths_w in
- * reg WAKE_UP_DUR
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_wkup_ths_weight_get(stmdev_ctx_t *ctx,
- @@ -4289,9 +4741,11 @@ int32_t lsm6dso_wkup_ths_weight_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_wake_up_dur_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_WAKE_UP_DUR, (uint8_t *)®, 1);
-
- - switch (reg.wake_ths_w) {
- + switch (reg.wake_ths_w)
- + {
- case LSM6DSO_LSb_FS_DIV_64:
- *val = LSM6DSO_LSb_FS_DIV_64;
- break;
- @@ -4314,15 +4768,18 @@ int32_t lsm6dso_wkup_ths_weight_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of wk_ths in reg WAKE_UP_THS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_wkup_threshold_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_wake_up_ths_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_WAKE_UP_THS, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.wk_ths = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_WAKE_UP_THS, (uint8_t *)®, 1);
- }
- @@ -4336,14 +4793,17 @@ int32_t lsm6dso_wkup_threshold_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of wk_ths in reg WAKE_UP_THS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_wkup_threshold_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_wake_up_ths_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_WAKE_UP_THS, (uint8_t *)®, 1);
- *val = reg.wk_ths;
- +
- return ret;
- }
-
- @@ -4353,6 +4813,7 @@ int32_t lsm6dso_wkup_threshold_get(stmdev_ctx_t *ctx, uint8_t *val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of usr_off_on_wu in reg WAKE_UP_THS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_usr_offset_on_wkup_set(stmdev_ctx_t *ctx,
- @@ -4360,9 +4821,11 @@ int32_t lsm6dso_xl_usr_offset_on_wkup_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_wake_up_ths_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_WAKE_UP_THS, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.usr_off_on_wu = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_WAKE_UP_THS, (uint8_t *)®, 1);
- }
- @@ -4376,6 +4839,7 @@ int32_t lsm6dso_xl_usr_offset_on_wkup_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of usr_off_on_wu in reg WAKE_UP_THS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_xl_usr_offset_on_wkup_get(stmdev_ctx_t *ctx,
- @@ -4383,8 +4847,10 @@ int32_t lsm6dso_xl_usr_offset_on_wkup_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_wake_up_ths_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_WAKE_UP_THS, (uint8_t *)®, 1);
- *val = reg.usr_off_on_wu;
- +
- return ret;
- }
-
- @@ -4394,15 +4860,18 @@ int32_t lsm6dso_xl_usr_offset_on_wkup_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of wake_dur in reg WAKE_UP_DUR
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_wkup_dur_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_wake_up_dur_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_WAKE_UP_DUR, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.wake_dur = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_WAKE_UP_DUR, (uint8_t *)®, 1);
- }
- @@ -4416,14 +4885,17 @@ int32_t lsm6dso_wkup_dur_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of wake_dur in reg WAKE_UP_DUR
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_wkup_dur_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_wake_up_dur_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_WAKE_UP_DUR, (uint8_t *)®, 1);
- *val = reg.wake_dur;
- +
- return ret;
- }
-
- @@ -4438,22 +4910,25 @@ int32_t lsm6dso_wkup_dur_get(stmdev_ctx_t *ctx, uint8_t *val)
- * activity/inactivity detection.
- * @{
- *
- -*/
- + */
-
- /**
- * @brief Enables gyroscope Sleep mode.[set]
- *
- * @param ctx read / write interface definitions
- * @param val change the values of sleep_g in reg CTRL4_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_gy_sleep_mode_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_ctrl4_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL4_C, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.sleep_g = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL4_C, (uint8_t *)®, 1);
- }
- @@ -4466,14 +4941,17 @@ int32_t lsm6dso_gy_sleep_mode_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of sleep_g in reg CTRL4_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_gy_sleep_mode_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_ctrl4_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL4_C, (uint8_t *)®, 1);
- *val = reg.sleep_g;
- +
- return ret;
- }
-
- @@ -4485,6 +4963,7 @@ int32_t lsm6dso_gy_sleep_mode_get(stmdev_ctx_t *ctx, uint8_t *val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of sleep_status_on_int in reg TAP_CFG0
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_act_pin_notification_set(stmdev_ctx_t *ctx,
- @@ -4492,9 +4971,11 @@ int32_t lsm6dso_act_pin_notification_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_tap_cfg0_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG0, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.sleep_status_on_int = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_TAP_CFG0, (uint8_t *)®, 1);
- }
- @@ -4510,6 +4991,7 @@ int32_t lsm6dso_act_pin_notification_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of sleep_status_on_int in reg TAP_CFG0
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_act_pin_notification_get(stmdev_ctx_t *ctx,
- @@ -4517,9 +4999,11 @@ int32_t lsm6dso_act_pin_notification_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_tap_cfg0_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG0, (uint8_t *)®, 1);
-
- - switch (reg.sleep_status_on_int) {
- + switch (reg.sleep_status_on_int)
- + {
- case LSM6DSO_DRIVE_SLEEP_CHG_EVENT:
- *val = LSM6DSO_DRIVE_SLEEP_CHG_EVENT;
- break;
- @@ -4541,6 +5025,7 @@ int32_t lsm6dso_act_pin_notification_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of inact_en in reg TAP_CFG2
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_act_mode_set(stmdev_ctx_t *ctx,
- @@ -4548,9 +5033,11 @@ int32_t lsm6dso_act_mode_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_tap_cfg2_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG2, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.inact_en = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_TAP_CFG2, (uint8_t *)®, 1);
- }
- @@ -4563,6 +5050,7 @@ int32_t lsm6dso_act_mode_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of inact_en in reg TAP_CFG2
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_act_mode_get(stmdev_ctx_t *ctx,
- @@ -4570,9 +5058,11 @@ int32_t lsm6dso_act_mode_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_tap_cfg2_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG2, (uint8_t *)®, 1);
-
- - switch (reg.inact_en) {
- + switch (reg.inact_en)
- + {
- case LSM6DSO_XL_AND_GY_NOT_AFFECTED:
- *val = LSM6DSO_XL_AND_GY_NOT_AFFECTED;
- break;
- @@ -4603,15 +5093,18 @@ int32_t lsm6dso_act_mode_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of sleep_dur in reg WAKE_UP_DUR
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_act_sleep_dur_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_wake_up_dur_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_WAKE_UP_DUR, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.sleep_dur = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_WAKE_UP_DUR, (uint8_t *)®, 1);
- }
- @@ -4625,14 +5118,17 @@ int32_t lsm6dso_act_sleep_dur_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of sleep_dur in reg WAKE_UP_DUR
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_act_sleep_dur_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_wake_up_dur_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_WAKE_UP_DUR, (uint8_t *)®, 1);
- *val = reg.sleep_dur;
- +
- return ret;
- }
-
- @@ -4647,22 +5143,25 @@ int32_t lsm6dso_act_sleep_dur_get(stmdev_ctx_t *ctx, uint8_t *val)
- * tap and double tap event generation.
- * @{
- *
- -*/
- + */
-
- /**
- * @brief Enable Z direction in tap recognition.[set]
- *
- * @param ctx read / write interface definitions
- * @param val change the values of tap_z_en in reg TAP_CFG0
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_tap_detection_on_z_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_tap_cfg0_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG0, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.tap_z_en = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_TAP_CFG0, (uint8_t *)®, 1);
- }
- @@ -4675,6 +5174,7 @@ int32_t lsm6dso_tap_detection_on_z_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of tap_z_en in reg TAP_CFG0
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_tap_detection_on_z_get(stmdev_ctx_t *ctx,
- @@ -4682,8 +5182,10 @@ int32_t lsm6dso_tap_detection_on_z_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_tap_cfg0_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG0, (uint8_t *)®, 1);
- *val = reg.tap_z_en;
- +
- return ret;
- }
-
- @@ -4692,15 +5194,18 @@ int32_t lsm6dso_tap_detection_on_z_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of tap_y_en in reg TAP_CFG0
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_tap_detection_on_y_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_tap_cfg0_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG0, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.tap_y_en = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_TAP_CFG0, (uint8_t *)®, 1);
- }
- @@ -4713,6 +5218,7 @@ int32_t lsm6dso_tap_detection_on_y_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of tap_y_en in reg TAP_CFG0
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_tap_detection_on_y_get(stmdev_ctx_t *ctx,
- @@ -4720,8 +5226,10 @@ int32_t lsm6dso_tap_detection_on_y_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_tap_cfg0_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG0, (uint8_t *)®, 1);
- *val = reg.tap_y_en;
- +
- return ret;
- }
-
- @@ -4730,15 +5238,18 @@ int32_t lsm6dso_tap_detection_on_y_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of tap_x_en in reg TAP_CFG0
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_tap_detection_on_x_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_tap_cfg0_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG0, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.tap_x_en = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_TAP_CFG0, (uint8_t *)®, 1);
- }
- @@ -4751,6 +5262,7 @@ int32_t lsm6dso_tap_detection_on_x_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of tap_x_en in reg TAP_CFG0
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_tap_detection_on_x_get(stmdev_ctx_t *ctx,
- @@ -4758,8 +5270,10 @@ int32_t lsm6dso_tap_detection_on_x_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_tap_cfg0_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG0, (uint8_t *)®, 1);
- *val = reg.tap_x_en;
- +
- return ret;
- }
-
- @@ -4768,15 +5282,18 @@ int32_t lsm6dso_tap_detection_on_x_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of tap_ths_x in reg TAP_CFG1
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_tap_threshold_x_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_tap_cfg1_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG1, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.tap_ths_x = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_TAP_CFG1, (uint8_t *)®, 1);
- }
- @@ -4789,14 +5306,17 @@ int32_t lsm6dso_tap_threshold_x_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of tap_ths_x in reg TAP_CFG1
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_tap_threshold_x_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_tap_cfg1_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG1, (uint8_t *)®, 1);
- *val = reg.tap_ths_x;
- +
- return ret;
- }
-
- @@ -4806,6 +5326,7 @@ int32_t lsm6dso_tap_threshold_x_get(stmdev_ctx_t *ctx, uint8_t *val)
- * @param ctx read / write interface definitions
- * @param val change the values of tap_priority in
- * reg TAP_CFG1
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_tap_axis_priority_set(stmdev_ctx_t *ctx,
- @@ -4813,9 +5334,11 @@ int32_t lsm6dso_tap_axis_priority_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_tap_cfg1_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG1, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.tap_priority = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_TAP_CFG1, (uint8_t *)®, 1);
- }
- @@ -4829,6 +5352,7 @@ int32_t lsm6dso_tap_axis_priority_set(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val Get the values of tap_priority in
- * reg TAP_CFG1
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_tap_axis_priority_get(stmdev_ctx_t *ctx,
- @@ -4836,9 +5360,11 @@ int32_t lsm6dso_tap_axis_priority_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_tap_cfg1_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG1, (uint8_t *)®, 1);
-
- - switch (reg.tap_priority) {
- + switch (reg.tap_priority)
- + {
- case LSM6DSO_XYZ:
- *val = LSM6DSO_XYZ;
- break;
- @@ -4876,15 +5402,18 @@ int32_t lsm6dso_tap_axis_priority_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of tap_ths_y in reg TAP_CFG2
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_tap_threshold_y_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_tap_cfg2_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG2, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.tap_ths_y = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_TAP_CFG2, (uint8_t *)®, 1);
- }
- @@ -4897,14 +5426,17 @@ int32_t lsm6dso_tap_threshold_y_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of tap_ths_y in reg TAP_CFG2
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_tap_threshold_y_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_tap_cfg2_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG2, (uint8_t *)®, 1);
- *val = reg.tap_ths_y;
- +
- return ret;
- }
-
- @@ -4913,15 +5445,18 @@ int32_t lsm6dso_tap_threshold_y_get(stmdev_ctx_t *ctx, uint8_t *val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of tap_ths_z in reg TAP_THS_6D
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_tap_threshold_z_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_tap_ths_6d_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_THS_6D, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.tap_ths_z = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_TAP_THS_6D, (uint8_t *)®, 1);
- }
- @@ -4934,14 +5469,17 @@ int32_t lsm6dso_tap_threshold_z_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of tap_ths_z in reg TAP_THS_6D
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_tap_threshold_z_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_tap_ths_6d_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_THS_6D, (uint8_t *)®, 1);
- *val = reg.tap_ths_z;
- +
- return ret;
- }
-
- @@ -4955,15 +5493,18 @@ int32_t lsm6dso_tap_threshold_z_get(stmdev_ctx_t *ctx, uint8_t *val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of shock in reg INT_DUR2
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_tap_shock_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_int_dur2_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_INT_DUR2, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.shock = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_INT_DUR2, (uint8_t *)®, 1);
- }
- @@ -4981,14 +5522,17 @@ int32_t lsm6dso_tap_shock_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of shock in reg INT_DUR2
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_tap_shock_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_int_dur2_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_INT_DUR2, (uint8_t *)®, 1);
- *val = reg.shock;
- +
- return ret;
- }
-
- @@ -5003,15 +5547,18 @@ int32_t lsm6dso_tap_shock_get(stmdev_ctx_t *ctx, uint8_t *val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of quiet in reg INT_DUR2
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_tap_quiet_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_int_dur2_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_INT_DUR2, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.quiet = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_INT_DUR2, (uint8_t *)®, 1);
- }
- @@ -5030,14 +5577,17 @@ int32_t lsm6dso_tap_quiet_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of quiet in reg INT_DUR2
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_tap_quiet_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_int_dur2_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_INT_DUR2, (uint8_t *)®, 1);
- *val = reg.quiet;
- +
- return ret;
- }
-
- @@ -5053,15 +5603,18 @@ int32_t lsm6dso_tap_quiet_get(stmdev_ctx_t *ctx, uint8_t *val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of dur in reg INT_DUR2
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_tap_dur_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_int_dur2_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_INT_DUR2, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.dur = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_INT_DUR2, (uint8_t *)®, 1);
- }
- @@ -5081,14 +5634,17 @@ int32_t lsm6dso_tap_dur_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of dur in reg INT_DUR2
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_tap_dur_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_int_dur2_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_INT_DUR2, (uint8_t *)®, 1);
- *val = reg.dur;
- +
- return ret;
- }
-
- @@ -5097,6 +5653,7 @@ int32_t lsm6dso_tap_dur_get(stmdev_ctx_t *ctx, uint8_t *val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of single_double_tap in reg WAKE_UP_THS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_tap_mode_set(stmdev_ctx_t *ctx,
- @@ -5104,9 +5661,11 @@ int32_t lsm6dso_tap_mode_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_wake_up_ths_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_WAKE_UP_THS, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.single_double_tap = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_WAKE_UP_THS, (uint8_t *)®, 1);
- }
- @@ -5119,6 +5678,7 @@ int32_t lsm6dso_tap_mode_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of single_double_tap in reg WAKE_UP_THS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_tap_mode_get(stmdev_ctx_t *ctx,
- @@ -5126,9 +5686,11 @@ int32_t lsm6dso_tap_mode_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_wake_up_ths_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_WAKE_UP_THS, (uint8_t *)®, 1);
-
- - switch (reg.single_double_tap) {
- + switch (reg.single_double_tap)
- + {
- case LSM6DSO_ONLY_SINGLE:
- *val = LSM6DSO_ONLY_SINGLE;
- break;
- @@ -5156,13 +5718,14 @@ int32_t lsm6dso_tap_mode_get(stmdev_ctx_t *ctx,
- * detection (6D).
- * @{
- *
- -*/
- + */
-
- /**
- * @brief Threshold for 4D/6D function.[set]
- *
- * @param ctx read / write interface definitions
- * @param val change the values of sixd_ths in reg TAP_THS_6D
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_6d_threshold_set(stmdev_ctx_t *ctx,
- @@ -5170,9 +5733,11 @@ int32_t lsm6dso_6d_threshold_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_tap_ths_6d_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_THS_6D, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.sixd_ths = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_TAP_THS_6D, (uint8_t *)®, 1);
- }
- @@ -5185,6 +5750,7 @@ int32_t lsm6dso_6d_threshold_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of sixd_ths in reg TAP_THS_6D
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_6d_threshold_get(stmdev_ctx_t *ctx,
- @@ -5192,9 +5758,11 @@ int32_t lsm6dso_6d_threshold_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_tap_ths_6d_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_THS_6D, (uint8_t *)®, 1);
-
- - switch (reg.sixd_ths) {
- + switch (reg.sixd_ths)
- + {
- case LSM6DSO_DEG_80:
- *val = LSM6DSO_DEG_80;
- break;
- @@ -5224,15 +5792,18 @@ int32_t lsm6dso_6d_threshold_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of d4d_en in reg TAP_THS_6D
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_4d_mode_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_tap_ths_6d_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_THS_6D, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.d4d_en = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_TAP_THS_6D, (uint8_t *)®, 1);
- }
- @@ -5245,14 +5816,17 @@ int32_t lsm6dso_4d_mode_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of d4d_en in reg TAP_THS_6D
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_4d_mode_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_tap_ths_6d_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_THS_6D, (uint8_t *)®, 1);
- *val = reg.d4d_en;
- +
- return ret;
- }
-
- @@ -5267,12 +5841,13 @@ int32_t lsm6dso_4d_mode_get(stmdev_ctx_t *ctx, uint8_t *val)
- * fall detection.
- * @{
- *
- -*/
- + */
- /**
- * @brief Free fall threshold setting.[set]
- *
- * @param ctx read / write interface definitions
- * @param val change the values of ff_ths in reg FREE_FALL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_ff_threshold_set(stmdev_ctx_t *ctx,
- @@ -5280,9 +5855,11 @@ int32_t lsm6dso_ff_threshold_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_free_fall_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FREE_FALL, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.ff_ths = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_FREE_FALL, (uint8_t *)®, 1);
- }
- @@ -5295,6 +5872,7 @@ int32_t lsm6dso_ff_threshold_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of ff_ths in reg FREE_FALL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_ff_threshold_get(stmdev_ctx_t *ctx,
- @@ -5302,9 +5880,11 @@ int32_t lsm6dso_ff_threshold_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_free_fall_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FREE_FALL, (uint8_t *)®, 1);
-
- - switch (reg.ff_ths) {
- + switch (reg.ff_ths)
- + {
- case LSM6DSO_FF_TSH_156mg:
- *val = LSM6DSO_FF_TSH_156mg;
- break;
- @@ -5351,6 +5931,7 @@ int32_t lsm6dso_ff_threshold_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of ff_dur in reg FREE_FALL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_ff_dur_set(stmdev_ctx_t *ctx, uint8_t val)
- @@ -5358,24 +5939,26 @@ int32_t lsm6dso_ff_dur_set(stmdev_ctx_t *ctx, uint8_t val)
- lsm6dso_wake_up_dur_t wake_up_dur;
- lsm6dso_free_fall_t free_fall;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_WAKE_UP_DUR,
- (uint8_t *)&wake_up_dur, 1);
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_FREE_FALL, (uint8_t *)&free_fall,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_FREE_FALL, (uint8_t *)&free_fall, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- wake_up_dur.ff_dur = ((uint8_t)val & 0x20U) >> 5;
- free_fall.ff_dur = (uint8_t)val & 0x1FU;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_WAKE_UP_DUR,
- (uint8_t *)&wake_up_dur, 1);
- }
-
- - if (ret == 0) {
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_FREE_FALL, (uint8_t *)&free_fall,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_FREE_FALL, (uint8_t *)&free_fall, 1);
- }
-
- return ret;
- @@ -5387,6 +5970,7 @@ int32_t lsm6dso_ff_dur_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of ff_dur in reg FREE_FALL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_ff_dur_get(stmdev_ctx_t *ctx, uint8_t *val)
- @@ -5394,12 +5978,13 @@ int32_t lsm6dso_ff_dur_get(stmdev_ctx_t *ctx, uint8_t *val)
- lsm6dso_wake_up_dur_t wake_up_dur;
- lsm6dso_free_fall_t free_fall;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_WAKE_UP_DUR,
- (uint8_t *)&wake_up_dur, 1);
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_FREE_FALL, (uint8_t *)&free_fall,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_FREE_FALL, (uint8_t *)&free_fall, 1);
- *val = (wake_up_dur.ff_dur << 5) + free_fall.ff_dur;
- }
-
- @@ -5416,13 +6001,14 @@ int32_t lsm6dso_ff_dur_get(stmdev_ctx_t *ctx, uint8_t *val)
- * @brief This section group all the functions concerning the fifo usage
- * @{
- *
- -*/
- + */
-
- /**
- * @brief FIFO watermark level selection.[set]
- *
- * @param ctx read / write interface definitions
- * @param val change the values of wtm in reg FIFO_CTRL1
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fifo_watermark_set(stmdev_ctx_t *ctx, uint16_t val)
- @@ -5430,17 +6016,20 @@ int32_t lsm6dso_fifo_watermark_set(stmdev_ctx_t *ctx, uint16_t val)
- lsm6dso_fifo_ctrl1_t fifo_ctrl1;
- lsm6dso_fifo_ctrl2_t fifo_ctrl2;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_CTRL2,
- (uint8_t *)&fifo_ctrl2, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- fifo_ctrl1.wtm = 0x00FFU & (uint8_t)val;
- - fifo_ctrl2.wtm = (uint8_t)(( 0x0100U & val ) >> 8);
- + fifo_ctrl2.wtm = (uint8_t)((0x0100U & val) >> 8);
- ret = lsm6dso_write_reg(ctx, LSM6DSO_FIFO_CTRL1,
- (uint8_t *)&fifo_ctrl1, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_write_reg(ctx, LSM6DSO_FIFO_CTRL2,
- (uint8_t *)&fifo_ctrl2, 1);
- }
- @@ -5453,6 +6042,7 @@ int32_t lsm6dso_fifo_watermark_set(stmdev_ctx_t *ctx, uint16_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of wtm in reg FIFO_CTRL1
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fifo_watermark_get(stmdev_ctx_t *ctx, uint16_t *val)
- @@ -5460,10 +6050,12 @@ int32_t lsm6dso_fifo_watermark_get(stmdev_ctx_t *ctx, uint16_t *val)
- lsm6dso_fifo_ctrl1_t fifo_ctrl1;
- lsm6dso_fifo_ctrl2_t fifo_ctrl2;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_CTRL1,
- (uint8_t *)&fifo_ctrl1, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_CTRL2,
- (uint8_t *)&fifo_ctrl2, 1);
- *val = ((uint16_t)fifo_ctrl2.wtm << 8) + (uint16_t)fifo_ctrl1.wtm;
- @@ -5478,6 +6070,7 @@ int32_t lsm6dso_fifo_watermark_get(stmdev_ctx_t *ctx, uint16_t *val)
- * @param ctx read / write interface definitions
- * @param val change the values of FIFO_COMPR_INIT in
- * reg EMB_FUNC_INIT_B
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_compression_algo_init_set(stmdev_ctx_t *ctx,
- @@ -5485,20 +6078,22 @@ int32_t lsm6dso_compression_algo_init_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_emb_func_init_b_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_INIT_B, (uint8_t *)®,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_INIT_B, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.fifo_compr_init = val;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_EMB_FUNC_INIT_B, (uint8_t *)®,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_EMB_FUNC_INIT_B, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -5511,6 +6106,7 @@ int32_t lsm6dso_compression_algo_init_set(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val change the values of FIFO_COMPR_INIT in
- * reg EMB_FUNC_INIT_B
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_compression_algo_init_get(stmdev_ctx_t *ctx,
- @@ -5518,14 +6114,16 @@ int32_t lsm6dso_compression_algo_init_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_emb_func_init_b_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_INIT_B, (uint8_t *)®,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_INIT_B, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- *val = reg.fifo_compr_init;
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
- @@ -5539,6 +6137,7 @@ int32_t lsm6dso_compression_algo_init_get(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val change the values of uncoptr_rate in
- * reg FIFO_CTRL2
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_compression_algo_set(stmdev_ctx_t *ctx,
- @@ -5546,10 +6145,12 @@ int32_t lsm6dso_compression_algo_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_fifo_ctrl2_t fifo_ctrl2;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_CTRL2,
- (uint8_t *)&fifo_ctrl2, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- fifo_ctrl2.fifo_compr_rt_en = ((uint8_t)val & 0x04U) >> 2;
- fifo_ctrl2.uncoptr_rate = (uint8_t)val & 0x03U;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_FIFO_CTRL2,
- @@ -5565,6 +6166,7 @@ int32_t lsm6dso_compression_algo_set(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val Get the values of uncoptr_rate in
- * reg FIFO_CTRL2
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_compression_algo_get(stmdev_ctx_t *ctx,
- @@ -5572,9 +6174,11 @@ int32_t lsm6dso_compression_algo_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_fifo_ctrl2_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_CTRL2, (uint8_t *)®, 1);
-
- - switch ((reg.fifo_compr_rt_en << 2) | reg.uncoptr_rate) {
- + switch ((reg.fifo_compr_rt_en << 2) | reg.uncoptr_rate)
- + {
- case LSM6DSO_CMP_DISABLE:
- *val = LSM6DSO_CMP_DISABLE;
- break;
- @@ -5608,6 +6212,7 @@ int32_t lsm6dso_compression_algo_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of odrchg_en in reg FIFO_CTRL2
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fifo_virtual_sens_odr_chg_set(stmdev_ctx_t *ctx,
- @@ -5615,9 +6220,11 @@ int32_t lsm6dso_fifo_virtual_sens_odr_chg_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_fifo_ctrl2_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_CTRL2, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.odrchg_en = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_FIFO_CTRL2, (uint8_t *)®, 1);
- }
- @@ -5630,6 +6237,7 @@ int32_t lsm6dso_fifo_virtual_sens_odr_chg_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of odrchg_en in reg FIFO_CTRL2
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fifo_virtual_sens_odr_chg_get(stmdev_ctx_t *ctx,
- @@ -5637,8 +6245,10 @@ int32_t lsm6dso_fifo_virtual_sens_odr_chg_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_fifo_ctrl2_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_CTRL2, (uint8_t *)®, 1);
- *val = reg.odrchg_en;
- +
- return ret;
- }
-
- @@ -5648,6 +6258,7 @@ int32_t lsm6dso_fifo_virtual_sens_odr_chg_get(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val change the values of fifo_compr_rt_en in
- * reg FIFO_CTRL2
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_compression_algo_real_time_set(stmdev_ctx_t *ctx,
- @@ -5655,9 +6266,11 @@ int32_t lsm6dso_compression_algo_real_time_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_fifo_ctrl2_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_CTRL2, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.fifo_compr_rt_en = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_FIFO_CTRL2, (uint8_t *)®, 1);
- }
- @@ -5670,6 +6283,7 @@ int32_t lsm6dso_compression_algo_real_time_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of fifo_compr_rt_en in reg FIFO_CTRL2
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_compression_algo_real_time_get(stmdev_ctx_t *ctx,
- @@ -5677,8 +6291,10 @@ int32_t lsm6dso_compression_algo_real_time_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_fifo_ctrl2_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_CTRL2, (uint8_t *)®, 1);
- *val = reg.fifo_compr_rt_en;
- +
- return ret;
- }
-
- @@ -5688,15 +6304,18 @@ int32_t lsm6dso_compression_algo_real_time_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of stop_on_wtm in reg FIFO_CTRL2
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fifo_stop_on_wtm_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_fifo_ctrl2_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_CTRL2, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.stop_on_wtm = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_FIFO_CTRL2, (uint8_t *)®, 1);
- }
- @@ -5710,14 +6329,17 @@ int32_t lsm6dso_fifo_stop_on_wtm_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of stop_on_wtm in reg FIFO_CTRL2
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fifo_stop_on_wtm_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_fifo_ctrl2_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_CTRL2, (uint8_t *)®, 1);
- *val = reg.stop_on_wtm;
- +
- return ret;
- }
-
- @@ -5727,6 +6349,7 @@ int32_t lsm6dso_fifo_stop_on_wtm_get(stmdev_ctx_t *ctx, uint8_t *val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of bdr_xl in reg FIFO_CTRL3
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fifo_xl_batch_set(stmdev_ctx_t *ctx,
- @@ -5734,9 +6357,11 @@ int32_t lsm6dso_fifo_xl_batch_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_fifo_ctrl3_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_CTRL3, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.bdr_xl = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_FIFO_CTRL3, (uint8_t *)®, 1);
- }
- @@ -5750,6 +6375,7 @@ int32_t lsm6dso_fifo_xl_batch_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of bdr_xl in reg FIFO_CTRL3
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fifo_xl_batch_get(stmdev_ctx_t *ctx,
- @@ -5757,9 +6383,11 @@ int32_t lsm6dso_fifo_xl_batch_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_fifo_ctrl3_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_CTRL3, (uint8_t *)®, 1);
-
- - switch (reg.bdr_xl) {
- + switch (reg.bdr_xl)
- + {
- case LSM6DSO_XL_NOT_BATCHED:
- *val = LSM6DSO_XL_NOT_BATCHED;
- break;
- @@ -5822,6 +6450,7 @@ int32_t lsm6dso_fifo_xl_batch_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of bdr_gy in reg FIFO_CTRL3
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fifo_gy_batch_set(stmdev_ctx_t *ctx,
- @@ -5829,9 +6458,11 @@ int32_t lsm6dso_fifo_gy_batch_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_fifo_ctrl3_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_CTRL3, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.bdr_gy = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_FIFO_CTRL3, (uint8_t *)®, 1);
- }
- @@ -5845,6 +6476,7 @@ int32_t lsm6dso_fifo_gy_batch_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of bdr_gy in reg FIFO_CTRL3
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fifo_gy_batch_get(stmdev_ctx_t *ctx,
- @@ -5852,9 +6484,11 @@ int32_t lsm6dso_fifo_gy_batch_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_fifo_ctrl3_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_CTRL3, (uint8_t *)®, 1);
-
- - switch (reg.bdr_gy) {
- + switch (reg.bdr_gy)
- + {
- case LSM6DSO_GY_NOT_BATCHED:
- *val = LSM6DSO_GY_NOT_BATCHED;
- break;
- @@ -5916,6 +6550,7 @@ int32_t lsm6dso_fifo_gy_batch_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of fifo_mode in reg FIFO_CTRL4
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fifo_mode_set(stmdev_ctx_t *ctx,
- @@ -5923,9 +6558,11 @@ int32_t lsm6dso_fifo_mode_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_fifo_ctrl4_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_CTRL4, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.fifo_mode = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_FIFO_CTRL4, (uint8_t *)®, 1);
- }
- @@ -5938,6 +6575,7 @@ int32_t lsm6dso_fifo_mode_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of fifo_mode in reg FIFO_CTRL4
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fifo_mode_get(stmdev_ctx_t *ctx,
- @@ -5945,9 +6583,11 @@ int32_t lsm6dso_fifo_mode_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_fifo_ctrl4_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_CTRL4, (uint8_t *)®, 1);
-
- - switch (reg.fifo_mode) {
- + switch (reg.fifo_mode)
- + {
- case LSM6DSO_BYPASS_MODE:
- *val = LSM6DSO_BYPASS_MODE;
- break;
- @@ -5986,6 +6626,7 @@ int32_t lsm6dso_fifo_mode_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of odr_t_batch in reg FIFO_CTRL4
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fifo_temp_batch_set(stmdev_ctx_t *ctx,
- @@ -5993,9 +6634,11 @@ int32_t lsm6dso_fifo_temp_batch_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_fifo_ctrl4_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_CTRL4, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.odr_t_batch = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_FIFO_CTRL4, (uint8_t *)®, 1);
- }
- @@ -6009,6 +6652,7 @@ int32_t lsm6dso_fifo_temp_batch_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of odr_t_batch in reg FIFO_CTRL4
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fifo_temp_batch_get(stmdev_ctx_t *ctx,
- @@ -6016,9 +6660,11 @@ int32_t lsm6dso_fifo_temp_batch_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_fifo_ctrl4_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_CTRL4, (uint8_t *)®, 1);
-
- - switch (reg.odr_t_batch) {
- + switch (reg.odr_t_batch)
- + {
- case LSM6DSO_TEMP_NOT_BATCHED:
- *val = LSM6DSO_TEMP_NOT_BATCHED;
- break;
- @@ -6050,6 +6696,7 @@ int32_t lsm6dso_fifo_temp_batch_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of odr_ts_batch in reg FIFO_CTRL4
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fifo_timestamp_decimation_set(stmdev_ctx_t *ctx,
- @@ -6057,9 +6704,11 @@ int32_t lsm6dso_fifo_timestamp_decimation_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_fifo_ctrl4_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_CTRL4, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.odr_ts_batch = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_FIFO_CTRL4, (uint8_t *)®, 1);
- }
- @@ -6074,6 +6723,7 @@ int32_t lsm6dso_fifo_timestamp_decimation_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of odr_ts_batch in reg FIFO_CTRL4
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fifo_timestamp_decimation_get(stmdev_ctx_t *ctx,
- @@ -6081,9 +6731,11 @@ int32_t lsm6dso_fifo_timestamp_decimation_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_fifo_ctrl4_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_CTRL4, (uint8_t *)®, 1);
-
- - switch (reg.odr_ts_batch) {
- + switch (reg.odr_ts_batch)
- + {
- case LSM6DSO_NO_DECIMATION:
- *val = LSM6DSO_NO_DECIMATION;
- break;
- @@ -6115,6 +6767,7 @@ int32_t lsm6dso_fifo_timestamp_decimation_get(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val change the values of trig_counter_bdr
- * in reg COUNTER_BDR_REG1
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fifo_cnt_event_batch_set(stmdev_ctx_t *ctx,
- @@ -6122,10 +6775,11 @@ int32_t lsm6dso_fifo_cnt_event_batch_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_counter_bdr_reg1_t reg;
- int32_t ret;
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_COUNTER_BDR_REG1, (uint8_t *)®,
- - 1);
-
- - if (ret == 0) {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_COUNTER_BDR_REG1, (uint8_t *)®, 1);
- +
- + if (ret == 0)
- + {
- reg.trig_counter_bdr = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_COUNTER_BDR_REG1,
- (uint8_t *)®, 1);
- @@ -6141,6 +6795,7 @@ int32_t lsm6dso_fifo_cnt_event_batch_set(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val Get the values of trig_counter_bdr
- * in reg COUNTER_BDR_REG1
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fifo_cnt_event_batch_get(stmdev_ctx_t *ctx,
- @@ -6148,10 +6803,11 @@ int32_t lsm6dso_fifo_cnt_event_batch_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_counter_bdr_reg1_t reg;
- int32_t ret;
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_COUNTER_BDR_REG1, (uint8_t *)®,
- - 1);
-
- - switch (reg.trig_counter_bdr) {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_COUNTER_BDR_REG1, (uint8_t *)®, 1);
- +
- + switch (reg.trig_counter_bdr)
- + {
- case LSM6DSO_XL_BATCH_EVENT:
- *val = LSM6DSO_XL_BATCH_EVENT;
- break;
- @@ -6170,21 +6826,23 @@ int32_t lsm6dso_fifo_cnt_event_batch_get(stmdev_ctx_t *ctx,
-
- /**
- * @brief Resets the internal counter of batching vents for a single sensor.
- - * This bit is automatically reset to zero if it was set to ‘1’.[set]
- + * This bit is automatically reset to zero if it was set to '1'.[set]
- *
- * @param ctx read / write interface definitions
- * @param val change the values of rst_counter_bdr in
- * reg COUNTER_BDR_REG1
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_rst_batch_counter_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_counter_bdr_reg1_t reg;
- int32_t ret;
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_COUNTER_BDR_REG1, (uint8_t *)®,
- - 1);
-
- - if (ret == 0) {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_COUNTER_BDR_REG1, (uint8_t *)®, 1);
- +
- + if (ret == 0)
- + {
- reg.rst_counter_bdr = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_COUNTER_BDR_REG1,
- (uint8_t *)®, 1);
- @@ -6195,20 +6853,22 @@ int32_t lsm6dso_rst_batch_counter_set(stmdev_ctx_t *ctx, uint8_t val)
-
- /**
- * @brief Resets the internal counter of batching events for a single sensor.
- - * This bit is automatically reset to zero if it was set to ‘1’.[get]
- + * This bit is automatically reset to zero if it was set to '1'.[get]
- *
- * @param ctx read / write interface definitions
- * @param val change the values of rst_counter_bdr in
- * reg COUNTER_BDR_REG1
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_rst_batch_counter_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_counter_bdr_reg1_t reg;
- int32_t ret;
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_COUNTER_BDR_REG1, (uint8_t *)®,
- - 1);
- +
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_COUNTER_BDR_REG1, (uint8_t *)®, 1);
- *val = reg.rst_counter_bdr;
- +
- return ret;
- }
-
- @@ -6218,6 +6878,7 @@ int32_t lsm6dso_rst_batch_counter_get(stmdev_ctx_t *ctx, uint8_t *val)
- * @param ctx read / write interface definitions
- * @param val change the values of cnt_bdr_th in
- * reg COUNTER_BDR_REG2 and COUNTER_BDR_REG1.
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_batch_counter_threshold_set(stmdev_ctx_t *ctx,
- @@ -6226,17 +6887,20 @@ int32_t lsm6dso_batch_counter_threshold_set(stmdev_ctx_t *ctx,
- lsm6dso_counter_bdr_reg1_t counter_bdr_reg1;
- lsm6dso_counter_bdr_reg2_t counter_bdr_reg2;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_COUNTER_BDR_REG1,
- (uint8_t *)&counter_bdr_reg1, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- counter_bdr_reg2.cnt_bdr_th = 0x00FFU & (uint8_t)val;
- counter_bdr_reg1.cnt_bdr_th = (uint8_t)(0x0700U & val) >> 8;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_COUNTER_BDR_REG1,
- (uint8_t *)&counter_bdr_reg1, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_write_reg(ctx, LSM6DSO_COUNTER_BDR_REG2,
- (uint8_t *)&counter_bdr_reg2, 1);
- }
- @@ -6250,6 +6914,7 @@ int32_t lsm6dso_batch_counter_threshold_set(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val change the values of cnt_bdr_th in
- * reg COUNTER_BDR_REG2 and COUNTER_BDR_REG1.
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_batch_counter_threshold_get(stmdev_ctx_t *ctx,
- @@ -6258,10 +6923,12 @@ int32_t lsm6dso_batch_counter_threshold_get(stmdev_ctx_t *ctx,
- lsm6dso_counter_bdr_reg1_t counter_bdr_reg1;
- lsm6dso_counter_bdr_reg2_t counter_bdr_reg2;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_COUNTER_BDR_REG1,
- (uint8_t *)&counter_bdr_reg1, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_COUNTER_BDR_REG2,
- (uint8_t *)&counter_bdr_reg2, 1);
- *val = ((uint16_t)counter_bdr_reg1.cnt_bdr_th << 8)
- @@ -6276,6 +6943,7 @@ int32_t lsm6dso_batch_counter_threshold_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of diff_fifo in reg FIFO_STATUS1
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fifo_data_level_get(stmdev_ctx_t *ctx, uint16_t *val)
- @@ -6283,10 +6951,12 @@ int32_t lsm6dso_fifo_data_level_get(stmdev_ctx_t *ctx, uint16_t *val)
- lsm6dso_fifo_status1_t fifo_status1;
- lsm6dso_fifo_status2_t fifo_status2;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_STATUS1,
- (uint8_t *)&fifo_status1, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_STATUS2,
- (uint8_t *)&fifo_status2, 1);
- *val = ((uint16_t)fifo_status2.diff_fifo << 8) +
- @@ -6301,13 +6971,16 @@ int32_t lsm6dso_fifo_data_level_get(stmdev_ctx_t *ctx, uint16_t *val)
- *
- * @param ctx read / write interface definitions
- * @param val registers FIFO_STATUS2
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fifo_status_get(stmdev_ctx_t *ctx,
- lsm6dso_fifo_status2_t *val)
- {
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_STATUS2, (uint8_t *) val, 1);
- +
- return ret;
- }
-
- @@ -6316,14 +6989,17 @@ int32_t lsm6dso_fifo_status_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of fifo_full_ia in reg FIFO_STATUS2
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fifo_full_flag_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_fifo_status2_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_STATUS2, (uint8_t *)®, 1);
- *val = reg.fifo_full_ia;
- +
- return ret;
- }
-
- @@ -6333,14 +7009,17 @@ int32_t lsm6dso_fifo_full_flag_get(stmdev_ctx_t *ctx, uint8_t *val)
- * @param ctx read / write interface definitions
- * @param val change the values of fifo_over_run_latched in
- * reg FIFO_STATUS2
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fifo_ovr_flag_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_fifo_status2_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_STATUS2, (uint8_t *)®, 1);
- *val = reg.fifo_ovr_ia;
- +
- return ret;
- }
-
- @@ -6349,14 +7028,17 @@ int32_t lsm6dso_fifo_ovr_flag_get(stmdev_ctx_t *ctx, uint8_t *val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of fifo_wtm_ia in reg FIFO_STATUS2
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fifo_wtm_flag_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_fifo_status2_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_STATUS2, (uint8_t *)®, 1);
- *val = reg.fifo_wtm_ia;
- +
- return ret;
- }
-
- @@ -6365,6 +7047,7 @@ int32_t lsm6dso_fifo_wtm_flag_get(stmdev_ctx_t *ctx, uint8_t *val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of tag_sensor in reg FIFO_DATA_OUT_TAG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fifo_sensor_tag_get(stmdev_ctx_t *ctx,
- @@ -6372,10 +7055,12 @@ int32_t lsm6dso_fifo_sensor_tag_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_fifo_data_out_tag_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_DATA_OUT_TAG,
- (uint8_t *)®, 1);
-
- - switch (reg.tag_sensor) {
- + switch (reg.tag_sensor)
- + {
- case LSM6DSO_GYRO_NC_TAG:
- *val = LSM6DSO_GYRO_NC_TAG;
- break;
- @@ -6475,26 +7160,31 @@ int32_t lsm6dso_fifo_sensor_tag_get(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val change the values of gbias_fifo_en in
- * reg LSM6DSO_EMB_FUNC_FIFO_CFG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fifo_pedo_batch_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_emb_func_fifo_cfg_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_FIFO_CFG,
- (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.pedo_fifo_en = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_EMB_FUNC_FIFO_CFG,
- (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -6507,20 +7197,24 @@ int32_t lsm6dso_fifo_pedo_batch_set(stmdev_ctx_t *ctx, uint8_t val)
- * @param ctx read / write interface definitions
- * @param val change the values of pedo_fifo_en in
- * reg LSM6DSO_EMB_FUNC_FIFO_CFG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fifo_pedo_batch_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_emb_func_fifo_cfg_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_FIFO_CFG,
- (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- *val = reg.pedo_fifo_en;
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
- @@ -6534,24 +7228,29 @@ int32_t lsm6dso_fifo_pedo_batch_get(stmdev_ctx_t *ctx, uint8_t *val)
- * @param ctx read / write interface definitions
- * @param val change the values of batch_ext_sens_0_en in
- * reg SLV0_CONFIG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_batch_slave_0_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_slv0_config_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_SLV0_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.batch_ext_sens_0_en = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_SLV0_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -6564,19 +7263,23 @@ int32_t lsm6dso_sh_batch_slave_0_set(stmdev_ctx_t *ctx, uint8_t val)
- * @param ctx read / write interface definitions
- * @param val change the values of batch_ext_sens_0_en in
- * reg SLV0_CONFIG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_batch_slave_0_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_slv0_config_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_SLV0_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- *val = reg.batch_ext_sens_0_en;
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
- @@ -6590,24 +7293,29 @@ int32_t lsm6dso_sh_batch_slave_0_get(stmdev_ctx_t *ctx, uint8_t *val)
- * @param ctx read / write interface definitions
- * @param val change the values of batch_ext_sens_1_en in
- * reg SLV1_CONFIG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_batch_slave_1_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_slv1_config_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_SLV1_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.batch_ext_sens_1_en = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_SLV1_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -6620,20 +7328,24 @@ int32_t lsm6dso_sh_batch_slave_1_set(stmdev_ctx_t *ctx, uint8_t val)
- * @param ctx read / write interface definitions
- * @param val change the values of batch_ext_sens_1_en in
- * reg SLV1_CONFIG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_batch_slave_1_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_slv1_config_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_SLV1_CONFIG, (uint8_t *)®, 1);
- *val = reg.batch_ext_sens_1_en;
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -6646,24 +7358,29 @@ int32_t lsm6dso_sh_batch_slave_1_get(stmdev_ctx_t *ctx, uint8_t *val)
- * @param ctx read / write interface definitions
- * @param val change the values of batch_ext_sens_2_en in
- * reg SLV2_CONFIG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_batch_slave_2_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_slv2_config_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_SLV2_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.batch_ext_sens_2_en = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_SLV2_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -6676,19 +7393,23 @@ int32_t lsm6dso_sh_batch_slave_2_set(stmdev_ctx_t *ctx, uint8_t val)
- * @param ctx read / write interface definitions
- * @param val change the values of batch_ext_sens_2_en in
- * reg SLV2_CONFIG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_batch_slave_2_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_slv2_config_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_SLV2_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- *val = reg.batch_ext_sens_2_en;
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
- @@ -6702,24 +7423,29 @@ int32_t lsm6dso_sh_batch_slave_2_get(stmdev_ctx_t *ctx, uint8_t *val)
- * @param ctx read / write interface definitions
- * @param val change the values of batch_ext_sens_3_en
- * in reg SLV3_CONFIG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_batch_slave_3_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_slv3_config_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_SLV3_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.batch_ext_sens_3_en = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_SLV3_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -6732,19 +7458,23 @@ int32_t lsm6dso_sh_batch_slave_3_set(stmdev_ctx_t *ctx, uint8_t val)
- * @param ctx read / write interface definitions
- * @param val change the values of batch_ext_sens_3_en in
- * reg SLV3_CONFIG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_batch_slave_3_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_slv3_config_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_SLV3_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- *val = reg.batch_ext_sens_3_en;
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
- @@ -6763,13 +7493,14 @@ int32_t lsm6dso_sh_batch_slave_3_get(stmdev_ctx_t *ctx, uint8_t *val)
- * DEN functionality.
- * @{
- *
- -*/
- + */
-
- /**
- * @brief DEN functionality marking mode.[set]
- *
- * @param ctx read / write interface definitions
- * @param val change the values of den_mode in reg CTRL6_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_den_mode_set(stmdev_ctx_t *ctx,
- @@ -6777,9 +7508,11 @@ int32_t lsm6dso_den_mode_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl6_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL6_C, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.den_mode = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL6_C, (uint8_t *)®, 1);
- }
- @@ -6792,6 +7525,7 @@ int32_t lsm6dso_den_mode_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of den_mode in reg CTRL6_C
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_den_mode_get(stmdev_ctx_t *ctx,
- @@ -6799,9 +7533,11 @@ int32_t lsm6dso_den_mode_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl6_c_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL6_C, (uint8_t *)®, 1);
-
- - switch (reg.den_mode) {
- + switch (reg.den_mode)
- + {
- case LSM6DSO_DEN_DISABLE:
- *val = LSM6DSO_DEN_DISABLE;
- break;
- @@ -6835,6 +7571,7 @@ int32_t lsm6dso_den_mode_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of den_lh in reg CTRL9_XL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_den_polarity_set(stmdev_ctx_t *ctx,
- @@ -6842,9 +7579,11 @@ int32_t lsm6dso_den_polarity_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl9_xl_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL9_XL, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.den_lh = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL9_XL, (uint8_t *)®, 1);
- }
- @@ -6857,6 +7596,7 @@ int32_t lsm6dso_den_polarity_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of den_lh in reg CTRL9_XL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_den_polarity_get(stmdev_ctx_t *ctx,
- @@ -6864,9 +7604,11 @@ int32_t lsm6dso_den_polarity_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl9_xl_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL9_XL, (uint8_t *)®, 1);
-
- - switch (reg.den_lh) {
- + switch (reg.den_lh)
- + {
- case LSM6DSO_DEN_ACT_LOW:
- *val = LSM6DSO_DEN_ACT_LOW;
- break;
- @@ -6888,6 +7630,7 @@ int32_t lsm6dso_den_polarity_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of den_xl_g in reg CTRL9_XL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_den_enable_set(stmdev_ctx_t *ctx,
- @@ -6895,9 +7638,11 @@ int32_t lsm6dso_den_enable_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl9_xl_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL9_XL, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.den_xl_g = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL9_XL, (uint8_t *)®, 1);
- }
- @@ -6910,6 +7655,7 @@ int32_t lsm6dso_den_enable_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of den_xl_g in reg CTRL9_XL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_den_enable_get(stmdev_ctx_t *ctx,
- @@ -6917,9 +7663,11 @@ int32_t lsm6dso_den_enable_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_ctrl9_xl_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL9_XL, (uint8_t *)®, 1);
-
- - switch (reg.den_xl_g) {
- + switch (reg.den_xl_g)
- + {
- case LSM6DSO_STAMP_IN_GY_DATA:
- *val = LSM6DSO_STAMP_IN_GY_DATA;
- break;
- @@ -6945,15 +7693,18 @@ int32_t lsm6dso_den_enable_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of den_z in reg CTRL9_XL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_den_mark_axis_x_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_ctrl9_xl_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL9_XL, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.den_z = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL9_XL, (uint8_t *)®, 1);
- }
- @@ -6966,14 +7717,17 @@ int32_t lsm6dso_den_mark_axis_x_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of den_z in reg CTRL9_XL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_den_mark_axis_x_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_ctrl9_xl_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL9_XL, (uint8_t *)®, 1);
- *val = reg.den_z;
- +
- return ret;
- }
-
- @@ -6982,15 +7736,18 @@ int32_t lsm6dso_den_mark_axis_x_get(stmdev_ctx_t *ctx, uint8_t *val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of den_y in reg CTRL9_XL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_den_mark_axis_y_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_ctrl9_xl_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL9_XL, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.den_y = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL9_XL, (uint8_t *)®, 1);
- }
- @@ -7003,14 +7760,17 @@ int32_t lsm6dso_den_mark_axis_y_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of den_y in reg CTRL9_XL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_den_mark_axis_y_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_ctrl9_xl_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL9_XL, (uint8_t *)®, 1);
- *val = reg.den_y;
- +
- return ret;
- }
-
- @@ -7019,15 +7779,18 @@ int32_t lsm6dso_den_mark_axis_y_get(stmdev_ctx_t *ctx, uint8_t *val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of den_x in reg CTRL9_XL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_den_mark_axis_z_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_ctrl9_xl_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL9_XL, (uint8_t *)®, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.den_x = val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL9_XL, (uint8_t *)®, 1);
- }
- @@ -7040,14 +7803,17 @@ int32_t lsm6dso_den_mark_axis_z_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of den_x in reg CTRL9_XL
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_den_mark_axis_z_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_ctrl9_xl_t reg;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL9_XL, (uint8_t *)®, 1);
- *val = reg.den_x;
- +
- return ret;
- }
-
- @@ -7061,13 +7827,14 @@ int32_t lsm6dso_den_mark_axis_z_get(stmdev_ctx_t *ctx, uint8_t *val)
- * @brief This section groups all the functions that manage pedometer.
- * @{
- *
- -*/
- + */
-
- /**
- * @brief Enable pedometer algorithm.[set]
- *
- * @param ctx read / write interface definitions
- * @param val turn on and configure pedometer
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_pedo_sens_set(stmdev_ctx_t *ctx,
- @@ -7075,10 +7842,12 @@ int32_t lsm6dso_pedo_sens_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_pedo_cmd_reg_t pedo_cmd_reg;
- int32_t ret;
- +
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_PEDO_CMD_REG,
- (uint8_t *)&pedo_cmd_reg);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- pedo_cmd_reg.fp_rejection_en = ((uint8_t)val & 0x10U) >> 4;
- pedo_cmd_reg.ad_det_en = ((uint8_t)val & 0x20U) >> 5;
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_PEDO_CMD_REG,
- @@ -7093,6 +7862,7 @@ int32_t lsm6dso_pedo_sens_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val turn on and configure pedometer
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_pedo_sens_get(stmdev_ctx_t *ctx,
- @@ -7100,11 +7870,13 @@ int32_t lsm6dso_pedo_sens_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_pedo_cmd_reg_t pedo_cmd_reg;
- int32_t ret;
- +
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_PEDO_CMD_REG,
- (uint8_t *)&pedo_cmd_reg);
-
- - switch ( (pedo_cmd_reg.ad_det_en << 5) | (pedo_cmd_reg.fp_rejection_en
- - << 4) ) {
- + switch ((pedo_cmd_reg.ad_det_en << 5) | (pedo_cmd_reg.fp_rejection_en
- + << 4))
- + {
- case LSM6DSO_PEDO_BASE_MODE:
- *val = LSM6DSO_PEDO_BASE_MODE;
- break;
- @@ -7130,20 +7902,23 @@ int32_t lsm6dso_pedo_sens_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of is_step_det in reg EMB_FUNC_STATUS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_pedo_step_detect_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_emb_func_status_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_STATUS, (uint8_t *)®,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_STATUS, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- *val = reg.is_step_det;
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
- @@ -7156,14 +7931,17 @@ int32_t lsm6dso_pedo_step_detect_get(stmdev_ctx_t *ctx, uint8_t *val)
- *
- * @param ctx read / write interface definitions
- * @param buff buffer that contains data to write
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_pedo_debounce_steps_set(stmdev_ctx_t *ctx,
- uint8_t *buff)
- {
- int32_t ret;
- +
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_PEDO_DEB_STEPS_CONF,
- buff);
- +
- return ret;
- }
-
- @@ -7172,13 +7950,16 @@ int32_t lsm6dso_pedo_debounce_steps_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param buff buffer that stores data read
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_pedo_debounce_steps_get(stmdev_ctx_t *ctx,
- uint8_t *buff)
- {
- int32_t ret;
- +
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_PEDO_DEB_STEPS_CONF, buff);
- +
- return ret;
- }
-
- @@ -7187,18 +7968,21 @@ int32_t lsm6dso_pedo_debounce_steps_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param buff buffer that contains data to write
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_pedo_steps_period_set(stmdev_ctx_t *ctx, uint16_t val)
- {
- uint8_t buff[2];
- int32_t ret;
- - buff[1] = (uint8_t) (val / 256U);
- - buff[0] = (uint8_t) (val - (buff[1] * 256U));
- +
- + buff[1] = (uint8_t)(val / 256U);
- + buff[0] = (uint8_t)(val - (buff[1] * 256U));
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_PEDO_SC_DELTAT_L,
- &buff[0]);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_PEDO_SC_DELTAT_H,
- &buff[1]);
- }
- @@ -7211,6 +7995,7 @@ int32_t lsm6dso_pedo_steps_period_set(stmdev_ctx_t *ctx, uint16_t val)
- *
- * @param ctx read / write interface definitions
- * @param buff buffer that stores data read
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_pedo_steps_period_get(stmdev_ctx_t *ctx,
- @@ -7218,10 +8003,12 @@ int32_t lsm6dso_pedo_steps_period_get(stmdev_ctx_t *ctx,
- {
- uint8_t buff[2];
- int32_t ret;
- +
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_PEDO_SC_DELTAT_L,
- &buff[0]);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_PEDO_SC_DELTAT_H,
- &buff[1]);
- *val = buff[1];
- @@ -7237,6 +8024,7 @@ int32_t lsm6dso_pedo_steps_period_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of carry_count_en in reg PEDO_CMD_REG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_pedo_int_mode_set(stmdev_ctx_t *ctx,
- @@ -7244,10 +8032,12 @@ int32_t lsm6dso_pedo_int_mode_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_pedo_cmd_reg_t reg;
- int32_t ret;
- +
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_PEDO_CMD_REG,
- (uint8_t *)®);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.carry_count_en = (uint8_t)val;
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_PEDO_CMD_REG,
- (uint8_t *)®);
- @@ -7262,6 +8052,7 @@ int32_t lsm6dso_pedo_int_mode_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of carry_count_en in reg PEDO_CMD_REG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_pedo_int_mode_get(stmdev_ctx_t *ctx,
- @@ -7269,10 +8060,12 @@ int32_t lsm6dso_pedo_int_mode_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_pedo_cmd_reg_t reg;
- int32_t ret;
- +
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_PEDO_CMD_REG,
- (uint8_t *)®);
-
- - switch (reg.carry_count_en) {
- + switch (reg.carry_count_en)
- + {
- case LSM6DSO_EVERY_STEP:
- *val = LSM6DSO_EVERY_STEP;
- break;
- @@ -7300,13 +8093,14 @@ int32_t lsm6dso_pedo_int_mode_get(stmdev_ctx_t *ctx,
- * significant motion detection.
- * @{
- *
- -*/
- + */
-
- /**
- * @brief Interrupt status bit for significant motion detection.[get]
- *
- * @param ctx read / write interface definitions
- * @param val change the values of is_sigmot in reg EMB_FUNC_STATUS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_motion_flag_data_ready_get(stmdev_ctx_t *ctx,
- @@ -7314,14 +8108,16 @@ int32_t lsm6dso_motion_flag_data_ready_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_emb_func_status_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_STATUS, (uint8_t *)®,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_STATUS, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- *val = reg.is_sigmot;
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
- @@ -7340,13 +8136,14 @@ int32_t lsm6dso_motion_flag_data_ready_get(stmdev_ctx_t *ctx,
- * event detection.
- * @{
- *
- -*/
- + */
-
- /**
- * @brief Interrupt status bit for tilt detection.[get]
- *
- * @param ctx read / write interface definitions
- * @param val change the values of is_tilt in reg EMB_FUNC_STATUS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_tilt_flag_data_ready_get(stmdev_ctx_t *ctx,
- @@ -7354,14 +8151,16 @@ int32_t lsm6dso_tilt_flag_data_ready_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_emb_func_status_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_STATUS, (uint8_t *)®,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_STATUS, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- *val = reg.is_tilt;
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
- @@ -7380,25 +8179,28 @@ int32_t lsm6dso_tilt_flag_data_ready_get(stmdev_ctx_t *ctx,
- * magnetometer sensor.
- * @{
- *
- -*/
- + */
-
- /**
- * @brief External magnetometer sensitivity value register.[set]
- *
- * @param ctx read / write interface definitions
- * @param buff buffer that contains data to write
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_mag_sensitivity_set(stmdev_ctx_t *ctx, uint16_t val)
- {
- uint8_t buff[2];
- int32_t ret;
- - buff[1] = (uint8_t) (val / 256U);
- - buff[0] = (uint8_t) (val - (buff[1] * 256U));
- +
- + buff[1] = (uint8_t)(val / 256U);
- + buff[0] = (uint8_t)(val - (buff[1] * 256U));
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_MAG_SENSITIVITY_L,
- &buff[0]);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_MAG_SENSITIVITY_H,
- &buff[1]);
- }
- @@ -7411,16 +8213,19 @@ int32_t lsm6dso_mag_sensitivity_set(stmdev_ctx_t *ctx, uint16_t val)
- *
- * @param ctx read / write interface definitions
- * @param buff buffer that stores data read
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_mag_sensitivity_get(stmdev_ctx_t *ctx, uint16_t *val)
- {
- uint8_t buff[2];
- int32_t ret;
- +
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_MAG_SENSITIVITY_L,
- &buff[0]);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_MAG_SENSITIVITY_H,
- &buff[1]);
- *val = buff[1];
- @@ -7435,37 +8240,44 @@ int32_t lsm6dso_mag_sensitivity_get(stmdev_ctx_t *ctx, uint16_t *val)
- *
- * @param ctx read / write interface definitions
- * @param buff buffer that contains data to write
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_mag_offset_set(stmdev_ctx_t *ctx, int16_t *val)
- {
- uint8_t buff[6];
- int32_t ret;
- - buff[1] = (uint8_t) ((uint16_t)val[0] / 256U);
- - buff[0] = (uint8_t) ((uint16_t)val[0] - (buff[1] * 256U));
- - buff[3] = (uint8_t) ((uint16_t)val[1] / 256U);
- - buff[2] = (uint8_t) ((uint16_t)val[1] - (buff[3] * 256U));
- - buff[5] = (uint8_t) ((uint16_t)val[2] / 256U);
- - buff[4] = (uint8_t) ((uint16_t)val[2] - (buff[5] * 256U));
- +
- + buff[1] = (uint8_t)((uint16_t)val[0] / 256U);
- + buff[0] = (uint8_t)((uint16_t)val[0] - (buff[1] * 256U));
- + buff[3] = (uint8_t)((uint16_t)val[1] / 256U);
- + buff[2] = (uint8_t)((uint16_t)val[1] - (buff[3] * 256U));
- + buff[5] = (uint8_t)((uint16_t)val[2] / 256U);
- + buff[4] = (uint8_t)((uint16_t)val[2] - (buff[5] * 256U));
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_MAG_OFFX_L, &buff[0]);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_MAG_OFFX_H, &buff[1]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_MAG_OFFY_L, &buff[2]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_MAG_OFFY_H, &buff[3]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_MAG_OFFZ_L, &buff[4]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_MAG_OFFZ_H, &buff[5]);
- }
-
- @@ -7477,31 +8289,38 @@ int32_t lsm6dso_mag_offset_set(stmdev_ctx_t *ctx, int16_t *val)
- *
- * @param ctx read / write interface definitions
- * @param buff buffer that stores data read
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_mag_offset_get(stmdev_ctx_t *ctx, int16_t *val)
- {
- uint8_t buff[6];
- int32_t ret;
- +
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_MAG_OFFX_L, &buff[0]);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_MAG_OFFX_H, &buff[1]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_MAG_OFFY_L, &buff[2]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_MAG_OFFY_H, &buff[3]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_MAG_OFFZ_L, &buff[4]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_MAG_OFFZ_H, &buff[5]);
- val[0] = (int16_t)buff[1];
- val[0] = (val[0] * 256) + (int16_t)buff[0];
- @@ -7525,90 +8344,103 @@ int32_t lsm6dso_mag_offset_get(stmdev_ctx_t *ctx, int16_t *val)
- *
- * @param ctx read / write interface definitions
- * @param buff buffer that contains data to write
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_mag_soft_iron_set(stmdev_ctx_t *ctx, int16_t *val)
- {
- uint8_t buff[12];
- int32_t ret;
- +
- uint8_t index;
- - buff[1] = (uint8_t) ((uint16_t)val[0] / 256U);
- - buff[0] = (uint8_t) ((uint16_t)val[0] - (buff[1] * 256U));
- - buff[3] = (uint8_t) ((uint16_t)val[1] / 256U);
- - buff[2] = (uint8_t) ((uint16_t)val[1] - (buff[3] * 256U));
- - buff[5] = (uint8_t) ((uint16_t)val[2] / 256U);
- - buff[4] = (uint8_t) ((uint16_t)val[2] - (buff[5] * 256U));
- - buff[7] = (uint8_t) ((uint16_t)val[3] / 256U);
- - buff[6] = (uint8_t) ((uint16_t)val[3] - (buff[7] * 256U));
- - buff[9] = (uint8_t) ((uint16_t)val[4] / 256U);
- - buff[8] = (uint8_t) ((uint16_t)val[4] - (buff[9] * 256U));
- - buff[11] = (uint8_t) ((uint16_t)val[5] / 256U);
- - buff[10] = (uint8_t) ((uint16_t)val[5] - (buff[11] * 256U));
- + buff[1] = (uint8_t)((uint16_t)val[0] / 256U);
- + buff[0] = (uint8_t)((uint16_t)val[0] - (buff[1] * 256U));
- + buff[3] = (uint8_t)((uint16_t)val[1] / 256U);
- + buff[2] = (uint8_t)((uint16_t)val[1] - (buff[3] * 256U));
- + buff[5] = (uint8_t)((uint16_t)val[2] / 256U);
- + buff[4] = (uint8_t)((uint16_t)val[2] - (buff[5] * 256U));
- + buff[7] = (uint8_t)((uint16_t)val[3] / 256U);
- + buff[6] = (uint8_t)((uint16_t)val[3] - (buff[7] * 256U));
- + buff[9] = (uint8_t)((uint16_t)val[4] / 256U);
- + buff[8] = (uint8_t)((uint16_t)val[4] - (buff[9] * 256U));
- + buff[11] = (uint8_t)((uint16_t)val[5] / 256U);
- + buff[10] = (uint8_t)((uint16_t)val[5] - (buff[11] * 256U));
- index = 0x00U;
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_MAG_SI_XX_L,
- &buff[index]);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- index++;
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_MAG_SI_XX_H,
- &buff[index]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- index++;
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_MAG_SI_XY_L,
- &buff[index]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- index++;
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_MAG_SI_XY_H,
- &buff[index]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- index++;
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_MAG_SI_XZ_L,
- &buff[index]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- index++;
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_MAG_SI_XZ_H,
- &buff[index]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- index++;
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_MAG_SI_YY_L,
- &buff[index]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- index++;
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_MAG_SI_YY_H,
- &buff[index]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- index++;
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_MAG_SI_YZ_L,
- &buff[index]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- index++;
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_MAG_SI_YZ_H,
- &buff[index]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- index++;
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_MAG_SI_ZZ_L,
- &buff[index]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- index++;
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_MAG_SI_ZZ_H,
- &buff[index]);
- @@ -7629,67 +8461,80 @@ int32_t lsm6dso_mag_soft_iron_set(stmdev_ctx_t *ctx, int16_t *val)
- *
- * @param ctx read / write interface definitions
- * @param buff buffer that stores data read
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_mag_soft_iron_get(stmdev_ctx_t *ctx, int16_t *val)
- {
- uint8_t buff[12];
- int32_t ret;
- +
- uint8_t index;
- index = 0x00U;
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_MAG_SI_XX_L, &buff[index]);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- index++;
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_MAG_SI_XX_H, &buff[index]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- index++;
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_MAG_SI_XY_L, &buff[index]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- index++;
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_MAG_SI_XY_H, &buff[index]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- index++;
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_MAG_SI_XZ_L, &buff[index]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- index++;
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_MAG_SI_XZ_H, &buff[index]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- index++;
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_MAG_SI_YY_L, &buff[index]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- index++;
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_MAG_SI_YY_H, &buff[index]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- index++;
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_MAG_SI_YZ_L, &buff[index]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- index++;
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_MAG_SI_YZ_H, &buff[index]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- index++;
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_MAG_SI_ZZ_L, &buff[index]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- index++;
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_MAG_SI_ZZ_H, &buff[index]);
- }
- @@ -7706,6 +8551,7 @@ int32_t lsm6dso_mag_soft_iron_get(stmdev_ctx_t *ctx, int16_t *val)
- val[4] = (val[4] * 256) + (int16_t)buff[8];
- val[5] = (int16_t)buff[11];
- val[5] = (val[5] * 256) + (int16_t)buff[10];
- +
- return ret;
- }
-
- @@ -7717,6 +8563,7 @@ int32_t lsm6dso_mag_soft_iron_get(stmdev_ctx_t *ctx, int16_t *val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of mag_z_axis in reg MAG_CFG_A
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_mag_z_orient_set(stmdev_ctx_t *ctx,
- @@ -7724,10 +8571,12 @@ int32_t lsm6dso_mag_z_orient_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_mag_cfg_a_t reg;
- int32_t ret;
- +
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_MAG_CFG_A,
- (uint8_t *)®);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.mag_z_axis = (uint8_t) val;
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_MAG_CFG_A,
- (uint8_t *)®);
- @@ -7744,6 +8593,7 @@ int32_t lsm6dso_mag_z_orient_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of mag_z_axis in reg MAG_CFG_A
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_mag_z_orient_get(stmdev_ctx_t *ctx,
- @@ -7751,10 +8601,12 @@ int32_t lsm6dso_mag_z_orient_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_mag_cfg_a_t reg;
- int32_t ret;
- +
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_MAG_CFG_A,
- (uint8_t *)®);
-
- - switch (reg.mag_z_axis) {
- + switch (reg.mag_z_axis)
- + {
- case LSM6DSO_Z_EQ_Y:
- *val = LSM6DSO_Z_EQ_Y;
- break;
- @@ -7795,6 +8647,7 @@ int32_t lsm6dso_mag_z_orient_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of mag_y_axis in reg MAG_CFG_A
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_mag_y_orient_set(stmdev_ctx_t *ctx,
- @@ -7802,10 +8655,12 @@ int32_t lsm6dso_mag_y_orient_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_mag_cfg_a_t reg;
- int32_t ret;
- +
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_MAG_CFG_A,
- (uint8_t *)®);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.mag_y_axis = (uint8_t)val;
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_MAG_CFG_A,
- (uint8_t *) ®);
- @@ -7822,6 +8677,7 @@ int32_t lsm6dso_mag_y_orient_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of mag_y_axis in reg MAG_CFG_A
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_mag_y_orient_get(stmdev_ctx_t *ctx,
- @@ -7829,10 +8685,12 @@ int32_t lsm6dso_mag_y_orient_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_mag_cfg_a_t reg;
- int32_t ret;
- +
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_MAG_CFG_A,
- (uint8_t *)®);
-
- - switch (reg.mag_y_axis) {
- + switch (reg.mag_y_axis)
- + {
- case LSM6DSO_Y_EQ_Y:
- *val = LSM6DSO_Y_EQ_Y;
- break;
- @@ -7873,6 +8731,7 @@ int32_t lsm6dso_mag_y_orient_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of mag_x_axis in reg MAG_CFG_B
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_mag_x_orient_set(stmdev_ctx_t *ctx,
- @@ -7880,10 +8739,12 @@ int32_t lsm6dso_mag_x_orient_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_mag_cfg_b_t reg;
- int32_t ret;
- +
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_MAG_CFG_B,
- (uint8_t *)®);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.mag_x_axis = (uint8_t)val;
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_MAG_CFG_B,
- (uint8_t *)®);
- @@ -7900,6 +8761,7 @@ int32_t lsm6dso_mag_x_orient_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of mag_x_axis in reg MAG_CFG_B
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_mag_x_orient_get(stmdev_ctx_t *ctx,
- @@ -7907,10 +8769,12 @@ int32_t lsm6dso_mag_x_orient_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_mag_cfg_b_t reg;
- int32_t ret;
- +
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_MAG_CFG_B,
- (uint8_t *)®);
-
- - switch (reg.mag_x_axis) {
- + switch (reg.mag_x_axis)
- + {
- case LSM6DSO_X_EQ_Y:
- *val = LSM6DSO_X_EQ_Y;
- break;
- @@ -7954,7 +8818,7 @@ int32_t lsm6dso_mag_x_orient_get(stmdev_ctx_t *ctx,
- * state_machine.
- * @{
- *
- -*/
- + */
-
- /**
- * @brief Interrupt status bit for FSM long counter
- @@ -7962,6 +8826,7 @@ int32_t lsm6dso_mag_x_orient_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of is_fsm_lc in reg EMB_FUNC_STATUS
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_long_cnt_flag_data_ready_get(stmdev_ctx_t *ctx,
- @@ -7969,14 +8834,16 @@ int32_t lsm6dso_long_cnt_flag_data_ready_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_emb_func_status_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_STATUS, (uint8_t *)®,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_STATUS, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- *val = reg.is_fsm_lc;
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
- @@ -7989,25 +8856,30 @@ int32_t lsm6dso_long_cnt_flag_data_ready_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val union of registers from FSM_ENABLE_A to FSM_ENABLE_B
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fsm_enable_set(stmdev_ctx_t *ctx,
- lsm6dso_emb_fsm_enable_t *val)
- {
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_write_reg(ctx, LSM6DSO_FSM_ENABLE_A,
- (uint8_t *)&val->fsm_enable_a, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_write_reg(ctx, LSM6DSO_FSM_ENABLE_B,
- (uint8_t *)&val->fsm_enable_b, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -8019,19 +8891,23 @@ int32_t lsm6dso_fsm_enable_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val union of registers from FSM_ENABLE_A to FSM_ENABLE_B
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fsm_enable_get(stmdev_ctx_t *ctx,
- lsm6dso_emb_fsm_enable_t *val)
- {
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FSM_ENABLE_A, (uint8_t *) val, 2);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -8044,21 +8920,25 @@ int32_t lsm6dso_fsm_enable_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param buff buffer that contains data to write
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_long_cnt_set(stmdev_ctx_t *ctx, uint16_t val)
- {
- uint8_t buff[2];
- int32_t ret;
- - buff[1] = (uint8_t) (val / 256U);
- - buff[0] = (uint8_t) (val - (buff[1] * 256U));
- +
- + buff[1] = (uint8_t)(val / 256U);
- + buff[0] = (uint8_t)(val - (buff[1] * 256U));
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_write_reg(ctx, LSM6DSO_FSM_LONG_COUNTER_L, buff, 2);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -8071,19 +8951,23 @@ int32_t lsm6dso_long_cnt_set(stmdev_ctx_t *ctx, uint16_t val)
- *
- * @param ctx read / write interface definitions
- * @param buff buffer that stores data read
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_long_cnt_get(stmdev_ctx_t *ctx, uint16_t *val)
- {
- uint8_t buff[2];
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FSM_LONG_COUNTER_L, buff, 2);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- *val = buff[1];
- *val = (*val * 256U) + buff[0];
- @@ -8098,6 +8982,7 @@ int32_t lsm6dso_long_cnt_get(stmdev_ctx_t *ctx, uint16_t *val)
- * @param ctx read / write interface definitions
- * @param val change the values of fsm_lc_clr in
- * reg FSM_LONG_COUNTER_CLEAR
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_long_clr_set(stmdev_ctx_t *ctx,
- @@ -8105,20 +8990,24 @@ int32_t lsm6dso_long_clr_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_fsm_long_counter_clear_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FSM_LONG_COUNTER_CLEAR,
- (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg. fsm_lc_clr = (uint8_t)val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_FSM_LONG_COUNTER_CLEAR,
- (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -8131,6 +9020,7 @@ int32_t lsm6dso_long_clr_set(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val Get the values of fsm_lc_clr in
- * reg FSM_LONG_COUNTER_CLEAR
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_long_clr_get(stmdev_ctx_t *ctx,
- @@ -8138,15 +9028,19 @@ int32_t lsm6dso_long_clr_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_fsm_long_counter_clear_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FSM_LONG_COUNTER_CLEAR,
- (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- - switch (reg.fsm_lc_clr) {
- + if (ret == 0)
- + {
- + switch (reg.fsm_lc_clr)
- + {
- case LSM6DSO_LC_NORMAL:
- *val = LSM6DSO_LC_NORMAL;
- break;
- @@ -8165,7 +9059,8 @@ int32_t lsm6dso_long_clr_get(stmdev_ctx_t *ctx,
- }
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -8177,18 +9072,22 @@ int32_t lsm6dso_long_clr_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val struct of registers from FSM_OUTS1 to FSM_OUTS16
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fsm_out_get(stmdev_ctx_t *ctx, lsm6dso_fsm_out_t *val)
- {
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FSM_OUTS1, (uint8_t *)val, 16);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -8200,6 +9099,7 @@ int32_t lsm6dso_fsm_out_get(stmdev_ctx_t *ctx, lsm6dso_fsm_out_t *val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of fsm_odr in reg EMB_FUNC_ODR_CFG_B
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fsm_data_rate_set(stmdev_ctx_t *ctx,
- @@ -8207,14 +9107,17 @@ int32_t lsm6dso_fsm_data_rate_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_emb_func_odr_cfg_b_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_ODR_CFG_B,
- (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.not_used_01 = 3; /* set default values */
- reg.not_used_02 = 2; /* set default values */
- reg.fsm_odr = (uint8_t)val;
- @@ -8222,7 +9125,8 @@ int32_t lsm6dso_fsm_data_rate_set(stmdev_ctx_t *ctx,
- (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -8234,6 +9138,7 @@ int32_t lsm6dso_fsm_data_rate_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of fsm_odr in reg EMB_FUNC_ODR_CFG_B
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fsm_data_rate_get(stmdev_ctx_t *ctx,
- @@ -8241,15 +9146,19 @@ int32_t lsm6dso_fsm_data_rate_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_emb_func_odr_cfg_b_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_ODR_CFG_B,
- (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- - switch (reg.fsm_odr) {
- + if (ret == 0)
- + {
- + switch (reg.fsm_odr)
- + {
- case LSM6DSO_ODR_FSM_12Hz5:
- *val = LSM6DSO_ODR_FSM_12Hz5;
- break;
- @@ -8282,26 +9191,29 @@ int32_t lsm6dso_fsm_data_rate_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of fsm_init in reg FSM_INIT
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fsm_init_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_emb_func_init_b_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_INIT_B, (uint8_t *)®,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_INIT_B, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.fsm_init = val;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_EMB_FUNC_INIT_B, (uint8_t *)®,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_EMB_FUNC_INIT_B, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -8313,20 +9225,23 @@ int32_t lsm6dso_fsm_init_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of fsm_init in reg FSM_INIT
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fsm_init_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_emb_func_init_b_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_INIT_B, (uint8_t *)®,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_INIT_B, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- *val = reg.fsm_init;
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
- @@ -8342,6 +9257,7 @@ int32_t lsm6dso_fsm_init_get(stmdev_ctx_t *ctx, uint8_t *val)
- *
- * @param ctx read / write interface definitions
- * @param val the value of long counter
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_long_cnt_int_value_set(stmdev_ctx_t *ctx,
- @@ -8349,12 +9265,14 @@ int32_t lsm6dso_long_cnt_int_value_set(stmdev_ctx_t *ctx,
- {
- uint8_t buff[2];
- int32_t ret;
- - buff[1] = (uint8_t) (val / 256U);
- - buff[0] = (uint8_t) (val - (buff[1] * 256U));
- +
- + buff[1] = (uint8_t)(val / 256U);
- + buff[0] = (uint8_t)(val - (buff[1] * 256U));
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_FSM_LC_TIMEOUT_L,
- &buff[0]);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_FSM_LC_TIMEOUT_H,
- &buff[1]);
- }
- @@ -8370,6 +9288,7 @@ int32_t lsm6dso_long_cnt_int_value_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val buffer that stores the value of long counter
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_long_cnt_int_value_get(stmdev_ctx_t *ctx,
- @@ -8377,10 +9296,12 @@ int32_t lsm6dso_long_cnt_int_value_get(stmdev_ctx_t *ctx,
- {
- uint8_t buff[2];
- int32_t ret;
- +
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_FSM_LC_TIMEOUT_L,
- &buff[0]);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_FSM_LC_TIMEOUT_H,
- &buff[1]);
- *val = buff[1];
- @@ -8395,13 +9316,16 @@ int32_t lsm6dso_long_cnt_int_value_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val value to write
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fsm_number_of_programs_set(stmdev_ctx_t *ctx,
- uint8_t val)
- {
- int32_t ret;
- +
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_FSM_PROGRAMS, &val);
- +
- return ret;
- }
-
- @@ -8410,13 +9334,16 @@ int32_t lsm6dso_fsm_number_of_programs_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val buffer that stores data read.
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fsm_number_of_programs_get(stmdev_ctx_t *ctx,
- uint8_t *val)
- {
- int32_t ret;
- +
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_FSM_PROGRAMS, val);
- +
- return ret;
- }
-
- @@ -8426,18 +9353,21 @@ int32_t lsm6dso_fsm_number_of_programs_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val the value of start address
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fsm_start_address_set(stmdev_ctx_t *ctx, uint16_t val)
- {
- uint8_t buff[2];
- int32_t ret;
- - buff[1] = (uint8_t) (val / 256U);
- - buff[0] = (uint8_t) (val - (buff[1] * 256U));
- +
- + buff[1] = (uint8_t)(val / 256U);
- + buff[0] = (uint8_t)(val - (buff[1] * 256U));
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_FSM_START_ADD_L,
- &buff[0]);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_FSM_START_ADD_H,
- &buff[1]);
- }
- @@ -8451,6 +9381,7 @@ int32_t lsm6dso_fsm_start_address_set(stmdev_ctx_t *ctx, uint16_t val)
- *
- * @param ctx read / write interface definitions
- * @param val buffer the value of start address.
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_fsm_start_address_get(stmdev_ctx_t *ctx,
- @@ -8458,9 +9389,11 @@ int32_t lsm6dso_fsm_start_address_get(stmdev_ctx_t *ctx,
- {
- uint8_t buff[2];
- int32_t ret;
- +
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_FSM_START_ADD_L, &buff[0]);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_ln_pg_read_byte(ctx, LSM6DSO_FSM_START_ADD_H, &buff[1]);
- *val = buff[1];
- *val = (*val * 256U) + buff[0];
- @@ -8480,7 +9413,7 @@ int32_t lsm6dso_fsm_start_address_get(stmdev_ctx_t *ctx,
- * sensor hub.
- * @{
- *
- -*/
- + */
-
- /**
- * @brief Sensor hub output registers.[get]
- @@ -8488,20 +9421,24 @@ int32_t lsm6dso_fsm_start_address_get(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val values read from registers SENSOR_HUB_1 to SENSOR_HUB_18
- * @param len number of consecutive register to read (max 18)
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_read_data_raw_get(stmdev_ctx_t *ctx, uint8_t *val,
- uint8_t len)
- {
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_SENSOR_HUB_1, (uint8_t *) val,
- len);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -8513,6 +9450,7 @@ int32_t lsm6dso_sh_read_data_raw_get(stmdev_ctx_t *ctx, uint8_t *val,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of aux_sens_on in reg MASTER_CONFIG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_slave_connected_set(stmdev_ctx_t *ctx,
- @@ -8520,20 +9458,22 @@ int32_t lsm6dso_sh_slave_connected_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_master_config_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.aux_sens_on = (uint8_t)val;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -8545,6 +9485,7 @@ int32_t lsm6dso_sh_slave_connected_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of aux_sens_on in reg MASTER_CONFIG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_slave_connected_get(stmdev_ctx_t *ctx,
- @@ -8552,15 +9493,18 @@ int32_t lsm6dso_sh_slave_connected_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_master_config_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- - switch (reg.aux_sens_on) {
- + if (ret == 0)
- + {
- + switch (reg.aux_sens_on)
- + {
- case LSM6DSO_SLV_0:
- *val = LSM6DSO_SLV_0;
- break;
- @@ -8593,26 +9537,29 @@ int32_t lsm6dso_sh_slave_connected_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of master_on in reg MASTER_CONFIG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_master_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_master_config_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.master_on = val;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -8624,20 +9571,23 @@ int32_t lsm6dso_sh_master_set(stmdev_ctx_t *ctx, uint8_t val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of master_on in reg MASTER_CONFIG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_master_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_master_config_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- *val = reg.master_on;
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
- @@ -8650,6 +9600,7 @@ int32_t lsm6dso_sh_master_get(stmdev_ctx_t *ctx, uint8_t *val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of shub_pu_en in reg MASTER_CONFIG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_pin_mode_set(stmdev_ctx_t *ctx,
- @@ -8657,20 +9608,22 @@ int32_t lsm6dso_sh_pin_mode_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_master_config_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.shub_pu_en = (uint8_t)val;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -8682,6 +9635,7 @@ int32_t lsm6dso_sh_pin_mode_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of shub_pu_en in reg MASTER_CONFIG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_pin_mode_get(stmdev_ctx_t *ctx,
- @@ -8689,15 +9643,18 @@ int32_t lsm6dso_sh_pin_mode_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_master_config_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- - switch (reg.shub_pu_en) {
- + if (ret == 0)
- + {
- + switch (reg.shub_pu_en)
- + {
- case LSM6DSO_EXT_PULL_UP:
- *val = LSM6DSO_EXT_PULL_UP;
- break;
- @@ -8723,26 +9680,29 @@ int32_t lsm6dso_sh_pin_mode_get(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val change the values of pass_through_mode in
- * reg MASTER_CONFIG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_pass_through_set(stmdev_ctx_t *ctx, uint8_t val)
- {
- lsm6dso_master_config_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.pass_through_mode = val;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -8755,20 +9715,23 @@ int32_t lsm6dso_sh_pass_through_set(stmdev_ctx_t *ctx, uint8_t val)
- * @param ctx read / write interface definitions
- * @param val change the values of pass_through_mode in
- * reg MASTER_CONFIG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_pass_through_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_master_config_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- *val = reg.pass_through_mode;
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
- @@ -8781,6 +9744,7 @@ int32_t lsm6dso_sh_pass_through_get(stmdev_ctx_t *ctx, uint8_t *val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of start_config in reg MASTER_CONFIG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_syncro_mode_set(stmdev_ctx_t *ctx,
- @@ -8788,20 +9752,22 @@ int32_t lsm6dso_sh_syncro_mode_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_master_config_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.start_config = (uint8_t)val;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -8813,6 +9779,7 @@ int32_t lsm6dso_sh_syncro_mode_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of start_config in reg MASTER_CONFIG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_syncro_mode_get(stmdev_ctx_t *ctx,
- @@ -8820,15 +9787,18 @@ int32_t lsm6dso_sh_syncro_mode_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_master_config_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- - switch (reg.start_config) {
- + if (ret == 0)
- + {
- + switch (reg.start_config)
- + {
- case LSM6DSO_EXT_ON_INT2_PIN:
- *val = LSM6DSO_EXT_ON_INT2_PIN;
- break;
- @@ -8854,6 +9824,7 @@ int32_t lsm6dso_sh_syncro_mode_get(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val change the values of write_once in reg MASTER_CONFIG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_write_mode_set(stmdev_ctx_t *ctx,
- @@ -8861,20 +9832,22 @@ int32_t lsm6dso_sh_write_mode_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_master_config_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.write_once = (uint8_t)val;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -8887,6 +9860,7 @@ int32_t lsm6dso_sh_write_mode_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of write_once in reg MASTER_CONFIG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_write_mode_get(stmdev_ctx_t *ctx,
- @@ -8894,15 +9868,18 @@ int32_t lsm6dso_sh_write_mode_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_master_config_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- - switch (reg.write_once) {
- + if (ret == 0)
- + {
- + switch (reg.write_once)
- + {
- case LSM6DSO_EACH_SH_CYCLE:
- *val = LSM6DSO_EACH_SH_CYCLE;
- break;
- @@ -8926,32 +9903,35 @@ int32_t lsm6dso_sh_write_mode_get(stmdev_ctx_t *ctx,
- * @brief Reset Master logic and output registers.[set]
- *
- * @param ctx read / write interface definitions
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_reset_set(stmdev_ctx_t *ctx)
- {
- lsm6dso_master_config_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.rst_master_regs = PROPERTY_ENABLE;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.rst_master_regs = PROPERTY_DISABLE;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -8963,20 +9943,23 @@ int32_t lsm6dso_sh_reset_set(stmdev_ctx_t *ctx)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of rst_master_regs in reg MASTER_CONFIG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_reset_get(stmdev_ctx_t *ctx, uint8_t *val)
- {
- lsm6dso_master_config_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_MASTER_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- *val = reg.rst_master_regs;
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
- @@ -8989,6 +9972,7 @@ int32_t lsm6dso_sh_reset_get(stmdev_ctx_t *ctx, uint8_t *val)
- *
- * @param ctx read / write interface definitions
- * @param val change the values of shub_odr in reg slv1_CONFIG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_data_rate_set(stmdev_ctx_t *ctx,
- @@ -8996,18 +9980,22 @@ int32_t lsm6dso_sh_data_rate_set(stmdev_ctx_t *ctx,
- {
- lsm6dso_slv0_config_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_SLV1_CONFIG, (uint8_t *)®, 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_SLV0_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.shub_odr = (uint8_t)val;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_SLV1_CONFIG, (uint8_t *)®, 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_SLV0_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -9019,6 +10007,7 @@ int32_t lsm6dso_sh_data_rate_set(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val Get the values of shub_odr in reg slv1_CONFIG
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_data_rate_get(stmdev_ctx_t *ctx,
- @@ -9026,14 +10015,18 @@ int32_t lsm6dso_sh_data_rate_get(stmdev_ctx_t *ctx,
- {
- lsm6dso_slv0_config_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_SLV1_CONFIG, (uint8_t *)®, 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_SLV0_CONFIG, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- - switch (reg.shub_odr) {
- + if (ret == 0)
- + {
- + switch (reg.shub_odr)
- + {
- case LSM6DSO_SH_ODR_104Hz:
- *val = LSM6DSO_SH_ODR_104Hz;
- break;
- @@ -9069,6 +10062,7 @@ int32_t lsm6dso_sh_data_rate_get(stmdev_ctx_t *ctx,
- * - uint8_t slv1_add; 8 bit i2c device address
- * - uint8_t slv1_subadd; 8 bit register device address
- * - uint8_t slv1_data; 8 bit data to write
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_cfg_write(stmdev_ctx_t *ctx,
- @@ -9076,25 +10070,30 @@ int32_t lsm6dso_sh_cfg_write(stmdev_ctx_t *ctx,
- {
- lsm6dso_slv0_add_t reg;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- reg.slave0 = val->slv0_add;
- reg.rw_0 = 0;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_SLV0_ADD, (uint8_t *)®, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_write_reg(ctx, LSM6DSO_SLV0_SUBADD,
- &(val->slv0_subadd), 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_write_reg(ctx, LSM6DSO_DATAWRITE_SLV0,
- &(val->slv0_data), 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -9109,6 +10108,7 @@ int32_t lsm6dso_sh_cfg_write(stmdev_ctx_t *ctx,
- * - uint8_t slv1_add; 8 bit i2c device address
- * - uint8_t slv1_subadd; 8 bit register device address
- * - uint8_t slv1_len; num of bit to read
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_slv0_cfg_read(stmdev_ctx_t *ctx,
- @@ -9117,32 +10117,37 @@ int32_t lsm6dso_sh_slv0_cfg_read(stmdev_ctx_t *ctx,
- lsm6dso_slv0_add_t slv0_add;
- lsm6dso_slv0_config_t slv0_config;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- slv0_add.slave0 = val->slv_add;
- slv0_add.rw_0 = 1;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_SLV0_ADD, (uint8_t *)&slv0_add,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_SLV0_ADD, (uint8_t *)&slv0_add, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_write_reg(ctx, LSM6DSO_SLV0_SUBADD,
- &(val->slv_subadd), 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_SLV0_CONFIG,
- (uint8_t *)&slv0_config, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- slv0_config.slave0_numop = val->slv_len;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_SLV0_CONFIG,
- (uint8_t *)&slv0_config, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -9157,6 +10162,7 @@ int32_t lsm6dso_sh_slv0_cfg_read(stmdev_ctx_t *ctx,
- * - uint8_t slv1_add; 8 bit i2c device address
- * - uint8_t slv1_subadd; 8 bit register device address
- * - uint8_t slv1_len; num of bit to read
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_slv1_cfg_read(stmdev_ctx_t *ctx,
- @@ -9165,32 +10171,37 @@ int32_t lsm6dso_sh_slv1_cfg_read(stmdev_ctx_t *ctx,
- lsm6dso_slv1_add_t slv1_add;
- lsm6dso_slv1_config_t slv1_config;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- slv1_add.slave1_add = val->slv_add;
- slv1_add.r_1 = 1;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_SLV1_ADD, (uint8_t *)&slv1_add,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_SLV1_ADD, (uint8_t *)&slv1_add, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_write_reg(ctx, LSM6DSO_SLV1_SUBADD,
- &(val->slv_subadd), 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_SLV1_CONFIG,
- (uint8_t *)&slv1_config, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- slv1_config.slave1_numop = val->slv_len;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_SLV1_CONFIG,
- (uint8_t *)&slv1_config, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -9205,6 +10216,7 @@ int32_t lsm6dso_sh_slv1_cfg_read(stmdev_ctx_t *ctx,
- * - uint8_t slv2_add; 8 bit i2c device address
- * - uint8_t slv2_subadd; 8 bit register device address
- * - uint8_t slv2_len; num of bit to read
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_slv2_cfg_read(stmdev_ctx_t *ctx,
- @@ -9213,32 +10225,37 @@ int32_t lsm6dso_sh_slv2_cfg_read(stmdev_ctx_t *ctx,
- lsm6dso_slv2_add_t slv2_add;
- lsm6dso_slv2_config_t slv2_config;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- slv2_add.slave2_add = val->slv_add;
- slv2_add.r_2 = 1;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_SLV2_ADD, (uint8_t *)&slv2_add,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_SLV2_ADD, (uint8_t *)&slv2_add, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_write_reg(ctx, LSM6DSO_SLV2_SUBADD,
- &(val->slv_subadd), 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_SLV2_CONFIG,
- (uint8_t *)&slv2_config, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- slv2_config.slave2_numop = val->slv_len;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_SLV2_CONFIG,
- (uint8_t *)&slv2_config, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -9253,6 +10270,7 @@ int32_t lsm6dso_sh_slv2_cfg_read(stmdev_ctx_t *ctx,
- * - uint8_t slv3_add; 8 bit i2c device address
- * - uint8_t slv3_subadd; 8 bit register device address
- * - uint8_t slv3_len; num of bit to read
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_slv3_cfg_read(stmdev_ctx_t *ctx,
- @@ -9261,32 +10279,37 @@ int32_t lsm6dso_sh_slv3_cfg_read(stmdev_ctx_t *ctx,
- lsm6dso_slv3_add_t slv3_add;
- lsm6dso_slv3_config_t slv3_config;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- slv3_add.slave3_add = val->slv_add;
- slv3_add.r_3 = 1;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_SLV3_ADD, (uint8_t *)&slv3_add,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_SLV3_ADD, (uint8_t *)&slv3_add, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_write_reg(ctx, LSM6DSO_SLV3_SUBADD,
- &(val->slv_subadd), 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_SLV3_CONFIG,
- (uint8_t *)&slv3_config, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- slv3_config.slave3_numop = val->slv_len;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_SLV3_CONFIG,
- (uint8_t *)&slv3_config, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -9298,20 +10321,23 @@ int32_t lsm6dso_sh_slv3_cfg_read(stmdev_ctx_t *ctx,
- *
- * @param ctx read / write interface definitions
- * @param val union of registers from STATUS_MASTER to
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_sh_status_get(stmdev_ctx_t *ctx,
- lsm6dso_status_master_t *val)
- {
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_SENSOR_HUB_BANK);
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_STATUS_MASTER, (uint8_t *) val,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_STATUS_MASTER, (uint8_t *) val, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -9340,6 +10366,7 @@ int32_t lsm6dso_sh_status_get(stmdev_ctx_t *ctx,
- * to ignore this interface.(ptr)
- * @param val ID values read from the two interfaces. ID values
- * will be the same.(ptr)
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_id_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- @@ -9347,13 +10374,16 @@ int32_t lsm6dso_id_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- {
- int32_t ret = 0;
-
- - if (ctx != NULL) {
- + if (ctx != NULL)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_WHO_AM_I,
- (uint8_t *) & (val->ui), 1);
- }
-
- - if (aux_ctx != NULL) {
- - if (ret == 0) {
- + if (aux_ctx != NULL)
- + {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(aux_ctx, LSM6DSO_WHO_AM_I,
- (uint8_t *) & (val->aux), 1);
- }
- @@ -9370,6 +10400,7 @@ int32_t lsm6dso_id_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- * and application note for more information
- * about differencies between boot and sw_reset
- * procedure.
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_init_set(stmdev_ctx_t *ctx, lsm6dso_init_t val)
- @@ -9378,56 +10409,65 @@ int32_t lsm6dso_init_set(stmdev_ctx_t *ctx, lsm6dso_init_t val)
- lsm6dso_emb_func_init_b_t emb_func_init_b;
- lsm6dso_ctrl3_c_t ctrl3_c;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_INIT_B,
- (uint8_t *)&emb_func_init_b, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- emb_func_init_b.fifo_compr_init = (uint8_t)val
- - & ( (uint8_t)LSM6DSO_FIFO_COMP >> 2 );
- + & ((uint8_t)LSM6DSO_FIFO_COMP >> 2);
- emb_func_init_b.fsm_init = (uint8_t)val
- - & ( (uint8_t)LSM6DSO_FSM >> 3 );
- + & ((uint8_t)LSM6DSO_FSM >> 3);
- ret = lsm6dso_write_reg(ctx, LSM6DSO_EMB_FUNC_INIT_B,
- (uint8_t *)&emb_func_init_b, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_INIT_A,
- (uint8_t *)&emb_func_init_a, 1);
- }
-
- - if (ret == 0) {
- - emb_func_init_a.step_det_init = ( (uint8_t)val
- - & (uint8_t)LSM6DSO_PEDO ) >> 5;
- - emb_func_init_a.tilt_init = ( (uint8_t)val
- - & (uint8_t)LSM6DSO_TILT ) >> 6;
- - emb_func_init_a.sig_mot_init = ( (uint8_t)val
- - & (uint8_t)LSM6DSO_SMOTION ) >> 7;
- + if (ret == 0)
- + {
- + emb_func_init_a.step_det_init = ((uint8_t)val
- + & (uint8_t)LSM6DSO_PEDO) >> 5;
- + emb_func_init_a.tilt_init = ((uint8_t)val
- + & (uint8_t)LSM6DSO_TILT) >> 6;
- + emb_func_init_a.sig_mot_init = ((uint8_t)val
- + & (uint8_t)LSM6DSO_SMOTION) >> 7;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_EMB_FUNC_INIT_A,
- (uint8_t *)&emb_func_init_a, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)&ctrl3_c, 1);
- }
-
- - if ( ( (val == LSM6DSO_BOOT) || (val == LSM6DSO_RESET) ) &&
- - (ret == 0) ) {
- + if (((val == LSM6DSO_BOOT) || (val == LSM6DSO_RESET)) &&
- + (ret == 0))
- + {
- ctrl3_c.boot = (uint8_t)val & (uint8_t)LSM6DSO_BOOT;
- - ctrl3_c.sw_reset = ( (uint8_t)val & (uint8_t)LSM6DSO_RESET) >> 1;
- + ctrl3_c.sw_reset = ((uint8_t)val & (uint8_t)LSM6DSO_RESET) >> 1;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)&ctrl3_c, 1);
- }
-
- - if ( ( val == LSM6DSO_DRV_RDY )
- - && ( (ctrl3_c.bdu == PROPERTY_DISABLE)
- - || (ctrl3_c.if_inc == PROPERTY_DISABLE) ) && (ret == 0) ) {
- + if ((val == LSM6DSO_DRV_RDY)
- + && ((ctrl3_c.bdu == PROPERTY_DISABLE)
- + || (ctrl3_c.if_inc == PROPERTY_DISABLE)) && (ret == 0))
- + {
- ctrl3_c.bdu = PROPERTY_ENABLE;
- ctrl3_c.if_inc = PROPERTY_ENABLE;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)&ctrl3_c, 1);
- @@ -9445,6 +10485,7 @@ int32_t lsm6dso_init_set(stmdev_ctx_t *ctx, lsm6dso_init_t val)
- * to ignore this interface.(ptr)
- * @param val configures the bus operating mode for both the
- * main and the auxiliary interface.
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_bus_mode_set(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- @@ -9457,68 +10498,80 @@ int32_t lsm6dso_bus_mode_set(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- lsm6dso_ctrl4_c_t ctrl4_c;
- uint8_t bit_val;
- int32_t ret;
- +
- ret = 0;
-
- - if (aux_ctx != NULL) {
- + if (aux_ctx != NULL)
- + {
- ret = lsm6dso_read_reg(aux_ctx, LSM6DSO_CTRL1_OIS,
- (uint8_t *)&ctrl1_ois, 1);
- - bit_val = ( (uint8_t)val.aux_bus_md & 0x04U ) >> 2;
- + bit_val = ((uint8_t)val.aux_bus_md & 0x04U) >> 2;
-
- - if ( ( ret == 0 ) && ( ctrl1_ois.sim_ois != bit_val ) ) {
- + if ((ret == 0) && (ctrl1_ois.sim_ois != bit_val))
- + {
- ctrl1_ois.sim_ois = bit_val;
- ret = lsm6dso_write_reg(aux_ctx, LSM6DSO_CTRL1_OIS,
- (uint8_t *)&ctrl1_ois, 1);
- }
- }
-
- - if (ctx != NULL) {
- - if (ret == 0) {
- + if (ctx != NULL)
- + {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL9_XL,
- (uint8_t *)&ctrl9_xl, 1);
- }
-
- bit_val = ((uint8_t)val.ui_bus_md & 0x04U) >> 2;
-
- - if ( ( ret == 0 ) && ( ctrl9_xl.i3c_disable != bit_val ) ) {
- + if ((ret == 0) && (ctrl9_xl.i3c_disable != bit_val))
- + {
- ctrl9_xl.i3c_disable = bit_val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL9_XL,
- (uint8_t *)&ctrl9_xl, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_I3C_BUS_AVB,
- (uint8_t *)&i3c_bus_avb, 1);
- }
-
- bit_val = ((uint8_t)val.ui_bus_md & 0x30U) >> 4;
-
- - if ( ( ret == 0 ) && ( i3c_bus_avb.i3c_bus_avb_sel != bit_val ) ) {
- + if ((ret == 0) && (i3c_bus_avb.i3c_bus_avb_sel != bit_val))
- + {
- i3c_bus_avb.i3c_bus_avb_sel = bit_val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_I3C_BUS_AVB,
- (uint8_t *)&i3c_bus_avb, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL4_C,
- (uint8_t *)&ctrl4_c, 1);
- }
-
- - bit_val = ( (uint8_t)val.ui_bus_md & 0x02U ) >> 1;
- + bit_val = ((uint8_t)val.ui_bus_md & 0x02U) >> 1;
-
- - if ( ( ret == 0 ) && ( ctrl4_c.i2c_disable != bit_val ) ) {
- + if ((ret == 0) && (ctrl4_c.i2c_disable != bit_val))
- + {
- ctrl4_c.i2c_disable = bit_val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL4_C,
- (uint8_t *)&ctrl4_c, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_C,
- (uint8_t *)&ctrl3_c, 1);
- }
-
- bit_val = (uint8_t)val.ui_bus_md & 0x01U;
-
- - if ( ( ret == 0 ) && ( ctrl3_c.sim != bit_val ) ) {
- + if ((ret == 0) && (ctrl3_c.sim != bit_val))
- + {
- ctrl3_c.sim = bit_val;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL3_C,
- (uint8_t *)&ctrl3_c, 1);
- @@ -9537,6 +10590,7 @@ int32_t lsm6dso_bus_mode_set(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- * to ignore this interface.(ptr)
- * @param val retrieves the bus operating mode for both the main
- * and the auxiliary interface.(ptr)
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_bus_mode_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- @@ -9549,11 +10603,13 @@ int32_t lsm6dso_bus_mode_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- lsm6dso_ctrl4_c_t ctrl4_c;
- int32_t ret = 0;
-
- - if (aux_ctx != NULL) {
- + if (aux_ctx != NULL)
- + {
- ret = lsm6dso_read_reg(aux_ctx, LSM6DSO_CTRL1_OIS,
- (uint8_t *)&ctrl1_ois, 1);
-
- - switch ( ctrl1_ois.sim_ois ) {
- + switch (ctrl1_ois.sim_ois)
- + {
- case LSM6DSO_SPI_4W_AUX:
- val->aux_bus_md = LSM6DSO_SPI_4W_AUX;
- break;
- @@ -9568,29 +10624,35 @@ int32_t lsm6dso_bus_mode_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- }
- }
-
- - if (ctx != NULL) {
- - if (ret == 0) {
- + if (ctx != NULL)
- + {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL9_XL,
- (uint8_t *)&ctrl9_xl, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_I3C_BUS_AVB,
- (uint8_t *)&i3c_bus_avb, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL4_C,
- (uint8_t *)&ctrl4_c, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_C,
- (uint8_t *)&ctrl3_c, 1);
-
- - switch ( ( i3c_bus_avb.i3c_bus_avb_sel << 4 ) &
- - ( ctrl9_xl.i3c_disable << 2 ) &
- - ( ctrl4_c.i2c_disable << 1) & ctrl3_c.sim ) {
- + switch ((i3c_bus_avb.i3c_bus_avb_sel << 4) &
- + (ctrl9_xl.i3c_disable << 2) &
- + (ctrl4_c.i2c_disable << 1) & ctrl3_c.sim)
- + {
- case LSM6DSO_SEL_BY_HW:
- val->ui_bus_md = LSM6DSO_SEL_BY_HW;
- break;
- @@ -9641,6 +10703,7 @@ int32_t lsm6dso_bus_mode_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- * @param aux_ctx auxiliary communication interface handler. Use NULL
- * to ignore this interface.(ptr)
- * @param val the status of the device.(ptr)
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_status_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- @@ -9652,7 +10715,8 @@ int32_t lsm6dso_status_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- int32_t ret;
- ret = 0;
-
- - if (aux_ctx != NULL) {
- + if (aux_ctx != NULL)
- + {
- ret = lsm6dso_read_reg(aux_ctx, LSM6DSO_STATUS_SPIAUX,
- (uint8_t *)&status_spiaux, 1);
- val->ois_drdy_xl = status_spiaux.xlda;
- @@ -9660,13 +10724,15 @@ int32_t lsm6dso_status_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- val->ois_gyro_settling = status_spiaux.gyro_settling;
- }
-
- - if (ctx != NULL) {
- + if (ctx != NULL)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)&ctrl3_c, 1);
- val->sw_reset = ctrl3_c.sw_reset;
- val->boot = ctrl3_c.boot;
-
- - if ( (ret == 0) && ( ctrl3_c.sw_reset == PROPERTY_DISABLE ) &&
- - ( ctrl3_c.boot == PROPERTY_DISABLE ) ) {
- + if ((ret == 0) && (ctrl3_c.sw_reset == PROPERTY_DISABLE) &&
- + (ctrl3_c.boot == PROPERTY_DISABLE))
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_STATUS_REG,
- (uint8_t *)&status_reg, 1);
- val->drdy_xl = status_reg.xlda;
- @@ -9684,6 +10750,7 @@ int32_t lsm6dso_status_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- * @param ctx communication interface handler.(ptr)
- * @param val the electrical settings for the configurable
- * pins.
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_pin_conf_set(stmdev_ctx_t *ctx,
- @@ -9693,31 +10760,35 @@ int32_t lsm6dso_pin_conf_set(stmdev_ctx_t *ctx,
- lsm6dso_pin_ctrl_t pin_ctrl;
- lsm6dso_ctrl3_c_t ctrl3_c;
- int32_t ret;
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_PIN_CTRL, (uint8_t *)&pin_ctrl,
- - 1);
-
- - if (ret == 0) {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_PIN_CTRL, (uint8_t *)&pin_ctrl, 1);
- +
- + if (ret == 0)
- + {
- pin_ctrl.ois_pu_dis = ~val.aux_sdo_ocs_pull_up;
- pin_ctrl.sdo_pu_en = val.sdo_sa0_pull_up;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_PIN_CTRL, (uint8_t *)&pin_ctrl,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_PIN_CTRL, (uint8_t *)&pin_ctrl, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)&ctrl3_c, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ctrl3_c.pp_od = ~val.int1_int2_push_pull;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)&ctrl3_c, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_I3C_BUS_AVB,
- (uint8_t *)&i3c_bus_avb, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- i3c_bus_avb.pd_dis_int1 = ~val.int1_pull_down;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_I3C_BUS_AVB,
- (uint8_t *)&i3c_bus_avb, 1);
- @@ -9732,6 +10803,7 @@ int32_t lsm6dso_pin_conf_set(stmdev_ctx_t *ctx,
- * @param ctx communication interface handler.(ptr)
- * @param val the electrical settings for the configurable
- * pins.(ptr)
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_pin_conf_get(stmdev_ctx_t *ctx,
- @@ -9741,22 +10813,25 @@ int32_t lsm6dso_pin_conf_get(stmdev_ctx_t *ctx,
- lsm6dso_pin_ctrl_t pin_ctrl;
- lsm6dso_ctrl3_c_t ctrl3_c;
- int32_t ret;
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_PIN_CTRL, (uint8_t *)&pin_ctrl,
- - 1);
-
- - if (ret == 0) {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_PIN_CTRL, (uint8_t *)&pin_ctrl, 1);
- +
- + if (ret == 0)
- + {
- val->aux_sdo_ocs_pull_up = ~pin_ctrl.ois_pu_dis;
- val->aux_sdo_ocs_pull_up = pin_ctrl.sdo_pu_en;
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)&ctrl3_c, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- val->int1_int2_push_pull = ~ctrl3_c.pp_od;
- ret = lsm6dso_read_reg(ctx, LSM6DSO_I3C_BUS_AVB,
- (uint8_t *)&i3c_bus_avb, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- val->int1_pull_down = ~i3c_bus_avb.pd_dis_int1;
- }
-
- @@ -9768,6 +10843,7 @@ int32_t lsm6dso_pin_conf_get(stmdev_ctx_t *ctx,
- *
- * @param ctx communication interface handler.(ptr)
- * @param val the pins hardware signal settings.
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_interrupt_mode_set(stmdev_ctx_t *ctx,
- @@ -9777,40 +10853,45 @@ int32_t lsm6dso_interrupt_mode_set(stmdev_ctx_t *ctx,
- lsm6dso_page_rw_t page_rw;
- lsm6dso_ctrl3_c_t ctrl3_c;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)&ctrl3_c, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ctrl3_c.h_lactive = val.active_low;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)&ctrl3_c, 1);
- }
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG0, (uint8_t *) &tap_cfg0,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG0, (uint8_t *) &tap_cfg0, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- tap_cfg0.lir = val.base_latched;
- tap_cfg0.int_clr_on_read = val.base_latched | val.emb_latched;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_TAP_CFG0, (uint8_t *) &tap_cfg0,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_TAP_CFG0, (uint8_t *) &tap_cfg0, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_PAGE_RW, (uint8_t *) &page_rw, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- page_rw.emb_func_lir = val.emb_latched;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_RW, (uint8_t *) &page_rw,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_RW, (uint8_t *) &page_rw, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -9822,6 +10903,7 @@ int32_t lsm6dso_interrupt_mode_set(stmdev_ctx_t *ctx,
- *
- * @param ctx communication interface handler.(ptr)
- * @param val the pins hardware signal settings.(ptr)
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_interrupt_mode_get(stmdev_ctx_t *ctx,
- @@ -9831,31 +10913,35 @@ int32_t lsm6dso_interrupt_mode_get(stmdev_ctx_t *ctx,
- lsm6dso_page_rw_t page_rw;
- lsm6dso_ctrl3_c_t ctrl3_c;
- int32_t ret;
- +
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)&ctrl3_c, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ctrl3_c.h_lactive = val->active_low;
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG0, (uint8_t *) &tap_cfg0,
- - 1);
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG0, (uint8_t *) &tap_cfg0, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- tap_cfg0.lir = val->base_latched;
- tap_cfg0.int_clr_on_read = val->base_latched | val->emb_latched;
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_PAGE_RW, (uint8_t *) &page_rw, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- page_rw.emb_func_lir = val->emb_latched;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_RW, (uint8_t *) &page_rw,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_PAGE_RW, (uint8_t *) &page_rw, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -9867,6 +10953,7 @@ int32_t lsm6dso_interrupt_mode_get(stmdev_ctx_t *ctx,
- *
- * @param ctx communication interface handler.(ptr)
- * @param val the signals to route on int1 pin.
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_pin_int1_route_set(stmdev_ctx_t *ctx,
- @@ -9898,9 +10985,11 @@ int32_t lsm6dso_pin_int1_route_set(stmdev_ctx_t *ctx,
- md1_cfg.int1_wu = val.wake_up;
- md1_cfg.int1_single_tap = val.single_tap;
- md1_cfg.int1_sleep_change = val.sleep_change;
- + emb_func_int1.not_used_01 = 0;
- emb_func_int1.int1_step_detector = val.step_detector;
- emb_func_int1.int1_tilt = val.tilt;
- emb_func_int1.int1_sig_mot = val.sig_mot;
- + emb_func_int1.not_used_02 = 0;
- emb_func_int1.int1_fsm_lc = val.fsm_lc;
- fsm_int1_a.int1_fsm1 = val.fsm1;
- fsm_int1_a.int1_fsm2 = val.fsm2;
- @@ -9920,66 +11009,77 @@ int32_t lsm6dso_pin_int1_route_set(stmdev_ctx_t *ctx,
- fsm_int1_b.int1_fsm16 = val.fsm16;
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL4_C, (uint8_t *)&ctrl4_c, 1);
-
- - if (ret == 0) {
- - if ( ( val.drdy_temp | val.timestamp ) != PROPERTY_DISABLE) {
- + if (ret == 0)
- + {
- + if ((val.drdy_temp | val.timestamp) != PROPERTY_DISABLE)
- + {
- ctrl4_c.int2_on_int1 = PROPERTY_ENABLE;
- }
-
- - else {
- + else
- + {
- ctrl4_c.int2_on_int1 = PROPERTY_DISABLE;
- }
-
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL4_C, (uint8_t *)&ctrl4_c, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_write_reg(ctx, LSM6DSO_EMB_FUNC_INT1,
- (uint8_t *)&emb_func_int1, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_write_reg(ctx, LSM6DSO_FSM_INT1_A,
- (uint8_t *)&fsm_int1_a, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_write_reg(ctx, LSM6DSO_FSM_INT1_B,
- (uint8_t *)&fsm_int1_b, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- - if (ret == 0) {
- - if ( ( emb_func_int1.int1_fsm_lc
- - | emb_func_int1.int1_sig_mot
- - | emb_func_int1.int1_step_detector
- - | emb_func_int1.int1_tilt
- - | fsm_int1_a.int1_fsm1
- - | fsm_int1_a.int1_fsm2
- - | fsm_int1_a.int1_fsm3
- - | fsm_int1_a.int1_fsm4
- - | fsm_int1_a.int1_fsm5
- - | fsm_int1_a.int1_fsm6
- - | fsm_int1_a.int1_fsm7
- - | fsm_int1_a.int1_fsm8
- - | fsm_int1_b.int1_fsm9
- - | fsm_int1_b.int1_fsm10
- - | fsm_int1_b.int1_fsm11
- - | fsm_int1_b.int1_fsm12
- - | fsm_int1_b.int1_fsm13
- - | fsm_int1_b.int1_fsm14
- - | fsm_int1_b.int1_fsm15
- - | fsm_int1_b.int1_fsm16) != PROPERTY_DISABLE) {
- + if (ret == 0)
- + {
- + if ((emb_func_int1.int1_fsm_lc
- + | emb_func_int1.int1_sig_mot
- + | emb_func_int1.int1_step_detector
- + | emb_func_int1.int1_tilt
- + | fsm_int1_a.int1_fsm1
- + | fsm_int1_a.int1_fsm2
- + | fsm_int1_a.int1_fsm3
- + | fsm_int1_a.int1_fsm4
- + | fsm_int1_a.int1_fsm5
- + | fsm_int1_a.int1_fsm6
- + | fsm_int1_a.int1_fsm7
- + | fsm_int1_a.int1_fsm8
- + | fsm_int1_b.int1_fsm9
- + | fsm_int1_b.int1_fsm10
- + | fsm_int1_b.int1_fsm11
- + | fsm_int1_b.int1_fsm12
- + | fsm_int1_b.int1_fsm13
- + | fsm_int1_b.int1_fsm14
- + | fsm_int1_b.int1_fsm15
- + | fsm_int1_b.int1_fsm16) != PROPERTY_DISABLE)
- + {
- md1_cfg.int1_emb_func = PROPERTY_ENABLE;
- }
-
- - else {
- + else
- + {
- md1_cfg.int1_emb_func = PROPERTY_DISABLE;
- }
-
- @@ -9987,77 +11087,83 @@ int32_t lsm6dso_pin_int1_route_set(stmdev_ctx_t *ctx,
- (uint8_t *)&int1_ctrl, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_write_reg(ctx, LSM6DSO_MD1_CFG, (uint8_t *)&md1_cfg, 1);
- }
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_INT2_CTRL, (uint8_t *)&int2_ctrl,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_INT2_CTRL, (uint8_t *)&int2_ctrl, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- int2_ctrl.int2_drdy_temp = val.drdy_temp;
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_INT2_CTRL, (uint8_t *)&int2_ctrl,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_INT2_CTRL, (uint8_t *)&int2_ctrl, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_MD2_CFG, (uint8_t *)&md2_cfg, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- md2_cfg.int2_timestamp = val.timestamp;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_MD2_CFG, (uint8_t *)&md2_cfg, 1);
- }
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG2, (uint8_t *) &tap_cfg2,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG2, (uint8_t *) &tap_cfg2, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_pin_int2_route_get(ctx, NULL, &pin_int2_route);
- }
-
- - if (ret == 0) {
- - if ( ( pin_int2_route.fifo_bdr
- - | pin_int2_route.drdy_g
- - | pin_int2_route.drdy_temp
- - | pin_int2_route.drdy_xl
- - | pin_int2_route.fifo_full
- - | pin_int2_route.fifo_ovr
- - | pin_int2_route.fifo_th
- - | pin_int2_route.six_d
- - | pin_int2_route.double_tap
- - | pin_int2_route.free_fall
- - | pin_int2_route.wake_up
- - | pin_int2_route.single_tap
- - | pin_int2_route.sleep_change
- - | int1_ctrl.den_drdy_flag
- - | int1_ctrl.int1_boot
- - | int1_ctrl.int1_cnt_bdr
- - | int1_ctrl.int1_drdy_g
- - | int1_ctrl.int1_drdy_xl
- - | int1_ctrl.int1_fifo_full
- - | int1_ctrl.int1_fifo_ovr
- - | int1_ctrl.int1_fifo_th
- - | md1_cfg.int1_shub
- - | md1_cfg.int1_6d
- - | md1_cfg.int1_double_tap
- - | md1_cfg.int1_ff
- - | md1_cfg.int1_wu
- - | md1_cfg.int1_single_tap
- - | md1_cfg.int1_sleep_change) != PROPERTY_DISABLE) {
- + if (ret == 0)
- + {
- + if ((pin_int2_route.fifo_bdr
- + | pin_int2_route.drdy_g
- + | pin_int2_route.drdy_temp
- + | pin_int2_route.drdy_xl
- + | pin_int2_route.fifo_full
- + | pin_int2_route.fifo_ovr
- + | pin_int2_route.fifo_th
- + | pin_int2_route.six_d
- + | pin_int2_route.double_tap
- + | pin_int2_route.free_fall
- + | pin_int2_route.wake_up
- + | pin_int2_route.single_tap
- + | pin_int2_route.sleep_change
- + | int1_ctrl.den_drdy_flag
- + | int1_ctrl.int1_boot
- + | int1_ctrl.int1_cnt_bdr
- + | int1_ctrl.int1_drdy_g
- + | int1_ctrl.int1_drdy_xl
- + | int1_ctrl.int1_fifo_full
- + | int1_ctrl.int1_fifo_ovr
- + | int1_ctrl.int1_fifo_th
- + | md1_cfg.int1_shub
- + | md1_cfg.int1_6d
- + | md1_cfg.int1_double_tap
- + | md1_cfg.int1_ff
- + | md1_cfg.int1_wu
- + | md1_cfg.int1_single_tap
- + | md1_cfg.int1_sleep_change) != PROPERTY_DISABLE)
- + {
- tap_cfg2.interrupts_enable = PROPERTY_ENABLE;
- }
-
- - else {
- + else
- + {
- tap_cfg2.interrupts_enable = PROPERTY_DISABLE;
- }
-
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_TAP_CFG2, (uint8_t *) &tap_cfg2,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_TAP_CFG2, (uint8_t *) &tap_cfg2, 1);
- }
-
- return ret;
- @@ -10068,6 +11174,7 @@ int32_t lsm6dso_pin_int1_route_set(stmdev_ctx_t *ctx,
- *
- * @param ctx communication interface handler.(ptr)
- * @param val the signals that are routed on int1 pin.(ptr)
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_pin_int1_route_get(stmdev_ctx_t *ctx,
- @@ -10084,52 +11191,62 @@ int32_t lsm6dso_pin_int1_route_get(stmdev_ctx_t *ctx,
- int32_t ret;
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_INT1,
- (uint8_t *)&emb_func_int1, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FSM_INT1_A,
- (uint8_t *)&fsm_int1_a, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FSM_INT1_B,
- (uint8_t *)&fsm_int1_b, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_INT1_CTRL,
- (uint8_t *)&int1_ctrl, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_MD1_CFG, (uint8_t *)&md1_cfg, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL4_C, (uint8_t *)&ctrl4_c, 1);
- }
-
- - if (ctrl4_c.int2_on_int1 == PROPERTY_ENABLE) {
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_INT2_CTRL, (uint8_t *)&int2_ctrl,
- - 1);
- + if (ctrl4_c.int2_on_int1 == PROPERTY_ENABLE)
- + {
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_INT2_CTRL, (uint8_t *)&int2_ctrl, 1);
- val->drdy_temp = int2_ctrl.int2_drdy_temp;
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_MD2_CFG, (uint8_t *)&md2_cfg, 1);
- val->timestamp = md2_cfg.int2_timestamp;
- }
- }
-
- - else {
- + else
- + {
- val->drdy_temp = PROPERTY_DISABLE;
- val->timestamp = PROPERTY_DISABLE;
- }
- @@ -10169,6 +11286,7 @@ int32_t lsm6dso_pin_int1_route_get(stmdev_ctx_t *ctx,
- val->fsm14 = fsm_int1_b.int1_fsm14;
- val->fsm15 = fsm_int1_b.int1_fsm15;
- val->fsm16 = fsm_int1_b.int1_fsm16;
- +
- return ret;
- }
-
- @@ -10180,6 +11298,7 @@ int32_t lsm6dso_pin_int1_route_get(stmdev_ctx_t *ctx,
- * @param aux_ctx auxiliary communication interface handler. Use NULL
- * to ignore this interface.(ptr)
- * @param val the signals to route on int2 pin.
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_pin_int2_route_set(stmdev_ctx_t *ctx,
- @@ -10198,18 +11317,21 @@ int32_t lsm6dso_pin_int2_route_set(stmdev_ctx_t *ctx,
- int32_t ret;
- ret = 0;
-
- - if ( aux_ctx != NULL ) {
- + if (aux_ctx != NULL)
- + {
- ret = lsm6dso_read_reg(aux_ctx, LSM6DSO_INT_OIS,
- (uint8_t *)&int_ois, 1);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- int_ois.int2_drdy_ois = val.drdy_ois;
- ret = lsm6dso_write_reg(aux_ctx, LSM6DSO_INT_OIS,
- (uint8_t *)&int_ois, 1);
- }
- }
-
- - if ( ctx != NULL ) {
- + if (ctx != NULL)
- + {
- int2_ctrl.int2_drdy_xl = val.drdy_xl;
- int2_ctrl.int2_drdy_g = val.drdy_g;
- int2_ctrl.int2_drdy_temp = val.drdy_temp;
- @@ -10217,6 +11339,7 @@ int32_t lsm6dso_pin_int2_route_set(stmdev_ctx_t *ctx,
- int2_ctrl.int2_fifo_ovr = val.fifo_ovr;
- int2_ctrl.int2_fifo_full = val.fifo_full;
- int2_ctrl.int2_cnt_bdr = val.fifo_bdr;
- + int2_ctrl.not_used_01 = 0;
- md2_cfg.int2_timestamp = val.timestamp;
- md2_cfg.int2_6d = val.six_d;
- md2_cfg.int2_double_tap = val.double_tap;
- @@ -10224,8 +11347,11 @@ int32_t lsm6dso_pin_int2_route_set(stmdev_ctx_t *ctx,
- md2_cfg.int2_wu = val.wake_up;
- md2_cfg.int2_single_tap = val.single_tap;
- md2_cfg.int2_sleep_change = val.sleep_change;
- + emb_func_int2.not_used_01 = 0;
- emb_func_int2. int2_step_detector = val.step_detector;
- emb_func_int2.int2_tilt = val.tilt;
- + emb_func_int2.int2_sig_mot = val.sig_mot;
- + emb_func_int2.not_used_02 = 0;
- emb_func_int2.int2_fsm_lc = val.fsm_lc;
- fsm_int2_a.int2_fsm1 = val.fsm1;
- fsm_int2_a.int2_fsm2 = val.fsm2;
- @@ -10244,70 +11370,77 @@ int32_t lsm6dso_pin_int2_route_set(stmdev_ctx_t *ctx,
- fsm_int2_b.int2_fsm15 = val.fsm15;
- fsm_int2_b.int2_fsm16 = val.fsm16;
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL4_C, (uint8_t *)&ctrl4_c, 1);
-
- - if (ret == 0) {
- - if ( ( val.drdy_temp | val.timestamp ) != PROPERTY_DISABLE ) {
- + if (ret == 0)
- + {
- + if ((val.drdy_temp | val.timestamp) != PROPERTY_DISABLE)
- + {
- ctrl4_c.int2_on_int1 = PROPERTY_DISABLE;
- }
-
- - else {
- - ctrl4_c.int2_on_int1 = PROPERTY_ENABLE;
- - }
- -
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL4_C, (uint8_t *)&ctrl4_c, 1);
- }
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_write_reg(ctx, LSM6DSO_EMB_FUNC_INT2,
- (uint8_t *)&emb_func_int2, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_write_reg(ctx, LSM6DSO_FSM_INT2_A,
- (uint8_t *)&fsm_int2_a, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_write_reg(ctx, LSM6DSO_FSM_INT2_B,
- (uint8_t *)&fsm_int2_b, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- - if (ret == 0) {
- - if (( emb_func_int2.int2_fsm_lc
- - | emb_func_int2.int2_sig_mot
- - | emb_func_int2.int2_step_detector
- - | emb_func_int2.int2_tilt
- - | fsm_int2_a.int2_fsm1
- - | fsm_int2_a.int2_fsm2
- - | fsm_int2_a.int2_fsm3
- - | fsm_int2_a.int2_fsm4
- - | fsm_int2_a.int2_fsm5
- - | fsm_int2_a.int2_fsm6
- - | fsm_int2_a.int2_fsm7
- - | fsm_int2_a.int2_fsm8
- - | fsm_int2_b.int2_fsm9
- - | fsm_int2_b.int2_fsm10
- - | fsm_int2_b.int2_fsm11
- - | fsm_int2_b.int2_fsm12
- - | fsm_int2_b.int2_fsm13
- - | fsm_int2_b.int2_fsm14
- - | fsm_int2_b.int2_fsm15
- - | fsm_int2_b.int2_fsm16) != PROPERTY_DISABLE ) {
- + if (ret == 0)
- + {
- + if ((emb_func_int2.int2_fsm_lc
- + | emb_func_int2.int2_sig_mot
- + | emb_func_int2.int2_step_detector
- + | emb_func_int2.int2_tilt
- + | fsm_int2_a.int2_fsm1
- + | fsm_int2_a.int2_fsm2
- + | fsm_int2_a.int2_fsm3
- + | fsm_int2_a.int2_fsm4
- + | fsm_int2_a.int2_fsm5
- + | fsm_int2_a.int2_fsm6
- + | fsm_int2_a.int2_fsm7
- + | fsm_int2_a.int2_fsm8
- + | fsm_int2_b.int2_fsm9
- + | fsm_int2_b.int2_fsm10
- + | fsm_int2_b.int2_fsm11
- + | fsm_int2_b.int2_fsm12
- + | fsm_int2_b.int2_fsm13
- + | fsm_int2_b.int2_fsm14
- + | fsm_int2_b.int2_fsm15
- + | fsm_int2_b.int2_fsm16) != PROPERTY_DISABLE)
- + {
- md2_cfg.int2_emb_func = PROPERTY_ENABLE;
- }
-
- - else {
- + else
- + {
- md2_cfg.int2_emb_func = PROPERTY_DISABLE;
- }
-
- @@ -10315,56 +11448,60 @@ int32_t lsm6dso_pin_int2_route_set(stmdev_ctx_t *ctx,
- (uint8_t *)&int2_ctrl, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_write_reg(ctx, LSM6DSO_MD2_CFG, (uint8_t *)&md2_cfg, 1);
- }
-
- - if (ret == 0) {
- - ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG2, (uint8_t *) &tap_cfg2,
- - 1);
- + if (ret == 0)
- + {
- + ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG2, (uint8_t *) &tap_cfg2, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_pin_int1_route_get(ctx, &pin_int1_route);
- }
-
- - if (ret == 0) {
- - if ( ( val.fifo_bdr
- - | val.drdy_g
- - | val.drdy_temp
- - | val.drdy_xl
- - | val.fifo_full
- - | val.fifo_ovr
- - | val.fifo_th
- - | val.six_d
- - | val.double_tap
- - | val.free_fall
- - | val.wake_up
- - | val.single_tap
- - | val.sleep_change
- - | pin_int1_route.den_flag
- - | pin_int1_route.boot
- - | pin_int1_route.fifo_bdr
- - | pin_int1_route.drdy_g
- - | pin_int1_route.drdy_xl
- - | pin_int1_route.fifo_full
- - | pin_int1_route.fifo_ovr
- - | pin_int1_route.fifo_th
- - | pin_int1_route.six_d
- - | pin_int1_route.double_tap
- - | pin_int1_route.free_fall
- - | pin_int1_route.wake_up
- - | pin_int1_route.single_tap
- - | pin_int1_route.sleep_change ) != PROPERTY_DISABLE) {
- + if (ret == 0)
- + {
- + if ((val.fifo_bdr
- + | val.drdy_g
- + | val.drdy_temp
- + | val.drdy_xl
- + | val.fifo_full
- + | val.fifo_ovr
- + | val.fifo_th
- + | val.six_d
- + | val.double_tap
- + | val.free_fall
- + | val.wake_up
- + | val.single_tap
- + | val.sleep_change
- + | pin_int1_route.den_flag
- + | pin_int1_route.boot
- + | pin_int1_route.fifo_bdr
- + | pin_int1_route.drdy_g
- + | pin_int1_route.drdy_xl
- + | pin_int1_route.fifo_full
- + | pin_int1_route.fifo_ovr
- + | pin_int1_route.fifo_th
- + | pin_int1_route.six_d
- + | pin_int1_route.double_tap
- + | pin_int1_route.free_fall
- + | pin_int1_route.wake_up
- + | pin_int1_route.single_tap
- + | pin_int1_route.sleep_change) != PROPERTY_DISABLE)
- + {
- tap_cfg2.interrupts_enable = PROPERTY_ENABLE;
- }
-
- - else {
- + else
- + {
- tap_cfg2.interrupts_enable = PROPERTY_DISABLE;
- }
-
- - ret = lsm6dso_write_reg(ctx, LSM6DSO_TAP_CFG2, (uint8_t *) &tap_cfg2,
- - 1);
- + ret = lsm6dso_write_reg(ctx, LSM6DSO_TAP_CFG2, (uint8_t *) &tap_cfg2, 1);
- }
- }
-
- @@ -10379,6 +11516,7 @@ int32_t lsm6dso_pin_int2_route_set(stmdev_ctx_t *ctx,
- * @param aux_ctx auxiliary communication interface handler. Use NULL
- * to ignore this interface.(ptr)
- * @param val the signals that are routed on int2 pin.(ptr)
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_pin_int2_route_get(stmdev_ctx_t *ctx,
- @@ -10395,64 +11533,78 @@ int32_t lsm6dso_pin_int2_route_get(stmdev_ctx_t *ctx,
- int32_t ret;
- ret = 0;
-
- - if ( aux_ctx != NULL ) {
- + if (aux_ctx != NULL)
- + {
- ret = lsm6dso_read_reg(aux_ctx, LSM6DSO_INT_OIS,
- (uint8_t *)&int_ois, 1);
- val->drdy_ois = int_ois.int2_drdy_ois;
- }
-
- - if ( ctx != NULL ) {
- - if (ret == 0) {
- + if (ctx != NULL)
- + {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_INT2,
- (uint8_t *)&emb_func_int2, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FSM_INT2_A,
- (uint8_t *)&fsm_int2_a, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FSM_INT2_B,
- (uint8_t *)&fsm_int2_b, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_INT2_CTRL,
- (uint8_t *)&int2_ctrl, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_MD2_CFG,
- (uint8_t *)&md2_cfg, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL4_C, (uint8_t *)&ctrl4_c, 1);
- }
-
- - if (ctrl4_c.int2_on_int1 == PROPERTY_DISABLE) {
- - if (ret == 0) {
- + if (ctrl4_c.int2_on_int1 == PROPERTY_DISABLE)
- + {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_INT2_CTRL,
- (uint8_t *)&int2_ctrl, 1);
- val->drdy_temp = int2_ctrl.int2_drdy_temp;
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_MD2_CFG, (uint8_t *)&md2_cfg, 1);
- val->timestamp = md2_cfg.int2_timestamp;
- }
- }
-
- - else {
- + else
- + {
- val->drdy_temp = PROPERTY_DISABLE;
- val->timestamp = PROPERTY_DISABLE;
- }
- @@ -10500,6 +11652,7 @@ int32_t lsm6dso_pin_int2_route_get(stmdev_ctx_t *ctx,
- *
- * @param ctx communication interface handler.(ptr)
- * @param val the status of all the interrupt sources.(ptr)
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_all_sources_get(stmdev_ctx_t *ctx,
- @@ -10520,7 +11673,8 @@ int32_t lsm6dso_all_sources_get(stmdev_ctx_t *ctx,
- int32_t ret;
- ret = lsm6dso_read_reg(ctx, LSM6DSO_ALL_INT_SRC, reg, 5);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- bytecpy((uint8_t *)&all_int_src, ®[0]);
- bytecpy((uint8_t *)&wake_up_src, ®[1]);
- bytecpy((uint8_t *)&tap_src, ®[2]);
- @@ -10553,11 +11707,13 @@ int32_t lsm6dso_all_sources_get(stmdev_ctx_t *ctx,
- val->drdy_temp = status_reg.tda;
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_STATUS_MAINPAGE, reg, 3);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- bytecpy((uint8_t *)&emb_func_status_mainpage, ®[0]);
- bytecpy((uint8_t *)&fsm_status_a_mainpage, ®[1]);
- bytecpy((uint8_t *)&fsm_status_b_mainpage, ®[2]);
- @@ -10583,11 +11739,13 @@ int32_t lsm6dso_all_sources_get(stmdev_ctx_t *ctx,
- val->fsm16 = fsm_status_b_mainpage.is_fsm16;
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_STATUS_MASTER_MAINPAGE, reg, 3);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- bytecpy((uint8_t *)&status_master_mainpage, ®[0]);
- bytecpy((uint8_t *)&fifo_status1, ®[1]);
- bytecpy((uint8_t *)&fifo_status2, ®[2]);
- @@ -10618,6 +11776,7 @@ int32_t lsm6dso_all_sources_get(stmdev_ctx_t *ctx,
- * to ignore this interface.(ptr)
- * @param val set the sensor conversion parameters by checking
- * the constraints of the device.(ptr)
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_mode_set(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- @@ -10642,49 +11801,56 @@ int32_t lsm6dso_mode_set(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- uint8_t odr_xl;
- uint8_t reg[8];
- int32_t ret;
- +
- ret = 0;
- /* FIXME: Remove warnings with STM32CubeIDE */
- ctrl3_c.not_used_01 = 0;
- ctrl4_c.not_used_01 = 0;
- + ctrl5_c.xl_ulp_en = 0;
- /* reading input configuration */
- - xl_hm_mode = ( (uint8_t)val->ui.xl.odr & 0x10U ) >> 4;
- - xl_ulp_en = ( (uint8_t)val->ui.xl.odr & 0x20U ) >> 5;
- + xl_hm_mode = ((uint8_t)val->ui.xl.odr & 0x10U) >> 4;
- + xl_ulp_en = ((uint8_t)val->ui.xl.odr & 0x20U) >> 5;
- odr_xl = (uint8_t)val->ui.xl.odr & 0x0FU;
-
- /* if enable xl ultra low power mode disable gy and OIS chain */
- - if (xl_ulp_en == PROPERTY_ENABLE) {
- + if (xl_ulp_en == PROPERTY_ENABLE)
- + {
- val->ois.xl.odr = LSM6DSO_XL_OIS_OFF;
- val->ois.gy.odr = LSM6DSO_GY_OIS_OFF;
- val->ui.gy.odr = LSM6DSO_GY_UI_OFF;
- }
-
- /* if OIS xl is enabled also gyro OIS is enabled */
- - if (val->ois.xl.odr == LSM6DSO_XL_OIS_6667Hz_HP) {
- + if (val->ois.xl.odr == LSM6DSO_XL_OIS_6667Hz_HP)
- + {
- val->ois.gy.odr = LSM6DSO_GY_OIS_6667Hz_HP;
- }
-
- - g_hm_mode = ( (uint8_t)val->ui.gy.odr & 0x10U ) >> 4;
- + g_hm_mode = ((uint8_t)val->ui.gy.odr & 0x10U) >> 4;
- odr_gy = (uint8_t)val->ui.gy.odr & 0x0FU;
-
- /* reading registers to be configured */
- - if ( ctx != NULL ) {
- + if (ctx != NULL)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL1_XL, reg, 8);
- - bytecpy(( uint8_t *)&ctrl1_xl, ®[0]);
- - bytecpy(( uint8_t *)&ctrl2_g, ®[1]);
- - bytecpy(( uint8_t *)&ctrl3_c, ®[2]);
- - bytecpy(( uint8_t *)&ctrl4_c, ®[3]);
- - bytecpy(( uint8_t *)&ctrl5_c, ®[4]);
- - bytecpy(( uint8_t *)&ctrl6_c, ®[5]);
- - bytecpy(( uint8_t *)&ctrl7_g, ®[6]);
- - bytecpy(( uint8_t *)&ctrl8_xl, ®[7]);
- -
- - if ( ret == 0 ) {
- + bytecpy((uint8_t *)&ctrl1_xl, ®[0]);
- + bytecpy((uint8_t *)&ctrl2_g, ®[1]);
- + bytecpy((uint8_t *)&ctrl3_c, ®[2]);
- + bytecpy((uint8_t *)&ctrl4_c, ®[3]);
- + bytecpy((uint8_t *)&ctrl5_c, ®[4]);
- + bytecpy((uint8_t *)&ctrl6_c, ®[5]);
- + bytecpy((uint8_t *)&ctrl7_g, ®[6]);
- + bytecpy((uint8_t *)&ctrl8_xl, ®[7]);
- +
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FUNC_CFG_ACCESS,
- (uint8_t *)&func_cfg_access, 1);
- }
-
- /* if toggle xl ultra low power mode, turn off xl before reconfigure */
- - if (ctrl5_c.xl_ulp_en != xl_ulp_en) {
- + if (ctrl5_c.xl_ulp_en != xl_ulp_en)
- + {
- ctrl1_xl.odr_xl = (uint8_t) 0x00U;
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL1_XL,
- (uint8_t *)&ctrl1_xl, 1);
- @@ -10692,37 +11858,46 @@ int32_t lsm6dso_mode_set(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- }
-
- /* reading OIS registers to be configured */
- - if ( aux_ctx != NULL ) {
- - if (ret == 0) {
- + if (aux_ctx != NULL)
- + {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(aux_ctx, LSM6DSO_CTRL1_OIS, reg, 3);
- }
-
- - bytecpy(( uint8_t *)&ctrl1_ois, ®[0]);
- - bytecpy(( uint8_t *)&ctrl2_ois, ®[1]);
- - bytecpy(( uint8_t *)&ctrl3_ois, ®[2]);
- + bytecpy((uint8_t *)&ctrl1_ois, ®[0]);
- + bytecpy((uint8_t *)&ctrl2_ois, ®[1]);
- + bytecpy((uint8_t *)&ctrl3_ois, ®[2]);
- }
-
- - else {
- - if ( ctx != NULL ) {
- - if (ret == 0) {
- + else
- + {
- + if (ctx != NULL)
- + {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL1_OIS, reg, 3);
- }
-
- - bytecpy(( uint8_t *)&ctrl1_ois, ®[0]);
- - bytecpy(( uint8_t *)&ctrl2_ois, ®[1]);
- - bytecpy(( uint8_t *)&ctrl3_ois, ®[2]);
- + bytecpy((uint8_t *)&ctrl1_ois, ®[0]);
- + bytecpy((uint8_t *)&ctrl2_ois, ®[1]);
- + bytecpy((uint8_t *)&ctrl3_ois, ®[2]);
- }
- }
-
- /* Check the Finite State Machine data rate constraints */
- - if (val->fsm.sens != LSM6DSO_FSM_DISABLE) {
- - switch (val->fsm.odr) {
- + if (val->fsm.sens != LSM6DSO_FSM_DISABLE)
- + {
- + switch (val->fsm.odr)
- + {
- case LSM6DSO_FSM_12Hz5:
- - if ( (val->fsm.sens != LSM6DSO_FSM_GY) && (odr_xl == 0x00U) ) {
- + if ((val->fsm.sens != LSM6DSO_FSM_GY) && (odr_xl == 0x00U))
- + {
- odr_xl = 0x01U;
- }
-
- - if ( (val->fsm.sens != LSM6DSO_FSM_XL) && (odr_gy == 0x00U) ) {
- + if ((val->fsm.sens != LSM6DSO_FSM_XL) && (odr_gy == 0x00U))
- + {
- xl_ulp_en = PROPERTY_DISABLE;
- odr_gy = 0x01U;
- }
- @@ -10730,11 +11905,13 @@ int32_t lsm6dso_mode_set(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- break;
-
- case LSM6DSO_FSM_26Hz:
- - if ( (val->fsm.sens != LSM6DSO_FSM_GY) && (odr_xl < 0x02U) ) {
- + if ((val->fsm.sens != LSM6DSO_FSM_GY) && (odr_xl < 0x02U))
- + {
- odr_xl = 0x02U;
- }
-
- - if ( (val->fsm.sens != LSM6DSO_FSM_XL) && (odr_gy < 0x02U) ) {
- + if ((val->fsm.sens != LSM6DSO_FSM_XL) && (odr_gy < 0x02U))
- + {
- xl_ulp_en = PROPERTY_DISABLE;
- odr_gy = 0x02U;
- }
- @@ -10742,11 +11919,13 @@ int32_t lsm6dso_mode_set(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- break;
-
- case LSM6DSO_FSM_52Hz:
- - if ( (val->fsm.sens != LSM6DSO_FSM_GY) && (odr_xl < 0x03U) ) {
- + if ((val->fsm.sens != LSM6DSO_FSM_GY) && (odr_xl < 0x03U))
- + {
- odr_xl = 0x03U;
- }
-
- - if ( (val->fsm.sens != LSM6DSO_FSM_XL) && (odr_gy < 0x03U) ) {
- + if ((val->fsm.sens != LSM6DSO_FSM_XL) && (odr_gy < 0x03U))
- + {
- xl_ulp_en = PROPERTY_DISABLE;
- odr_gy = 0x03U;
- }
- @@ -10754,11 +11933,13 @@ int32_t lsm6dso_mode_set(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- break;
-
- case LSM6DSO_FSM_104Hz:
- - if ( (val->fsm.sens != LSM6DSO_FSM_GY) && (odr_xl < 0x04U) ) {
- + if ((val->fsm.sens != LSM6DSO_FSM_GY) && (odr_xl < 0x04U))
- + {
- odr_xl = 0x04U;
- }
-
- - if ( (val->fsm.sens != LSM6DSO_FSM_XL) && (odr_gy < 0x04U) ) {
- + if ((val->fsm.sens != LSM6DSO_FSM_XL) && (odr_gy < 0x04U))
- + {
- xl_ulp_en = PROPERTY_DISABLE;
- odr_gy = 0x04U;
- }
- @@ -10773,8 +11954,9 @@ int32_t lsm6dso_mode_set(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- }
-
- /* Updating the accelerometer data rate configuration */
- - switch ( ( ctrl5_c.xl_ulp_en << 5 ) | ( ctrl6_c.xl_hm_mode << 4 ) |
- - ctrl1_xl.odr_xl ) {
- + switch ((ctrl5_c.xl_ulp_en << 5) | (ctrl6_c.xl_hm_mode << 4) |
- + ctrl1_xl.odr_xl)
- + {
- case LSM6DSO_XL_UI_OFF:
- val->ui.xl.odr = LSM6DSO_XL_UI_OFF;
- break;
- @@ -10873,7 +12055,8 @@ int32_t lsm6dso_mode_set(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- }
-
- /* Updating the accelerometer data rate configuration */
- - switch ( (ctrl7_g.g_hm_mode << 4) | ctrl2_g.odr_g) {
- + switch ((ctrl7_g.g_hm_mode << 4) | ctrl2_g.odr_g)
- + {
- case LSM6DSO_GY_UI_OFF:
- val->ui.gy.odr = LSM6DSO_GY_UI_OFF;
- break;
- @@ -10945,8 +12128,9 @@ int32_t lsm6dso_mode_set(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
-
- /* Check accelerometer full scale constraints */
- /* Full scale of 16g must be the same for UI and OIS */
- - if ( (val->ui.xl.fs == LSM6DSO_XL_UI_16g) ||
- - (val->ois.xl.fs == LSM6DSO_XL_OIS_16g) ) {
- + if ((val->ui.xl.fs == LSM6DSO_XL_UI_16g) ||
- + (val->ois.xl.fs == LSM6DSO_XL_OIS_16g))
- + {
- val->ui.xl.fs = LSM6DSO_XL_UI_16g;
- val->ois.xl.fs = LSM6DSO_XL_OIS_16g;
- }
- @@ -10954,18 +12138,21 @@ int32_t lsm6dso_mode_set(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- /* prapare new configuration */
-
- /* Full scale of 16g must be the same for UI and OIS */
- - if (val->ui.xl.fs == LSM6DSO_XL_UI_16g) {
- + if (val->ui.xl.fs == LSM6DSO_XL_UI_16g)
- + {
- ctrl8_xl.xl_fs_mode = PROPERTY_DISABLE;
- }
-
- - else {
- + else
- + {
- ctrl8_xl.xl_fs_mode = PROPERTY_ENABLE;
- }
-
- /* OIS new configuration */
- ctrl7_g.ois_on_en = val->ois.ctrl_md & 0x01U;
-
- - switch (val->ois.ctrl_md) {
- + switch (val->ois.ctrl_md)
- + {
- case LSM6DSO_OIS_ONLY_AUX:
- ctrl1_ois.fs_g_ois = (uint8_t)val->ois.gy.fs;
- ctrl1_ois.ois_en_spi2 = (uint8_t)val->ois.gy.odr |
- @@ -11000,33 +12187,38 @@ int32_t lsm6dso_mode_set(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- ctrl2_g.fs_g = (uint8_t) val->ui.gy.fs;
-
- /* writing checked configuration */
- - if ( ctx != NULL ) {
- - bytecpy(®[0], ( uint8_t *)&ctrl1_xl);
- - bytecpy(®[1], ( uint8_t *)&ctrl2_g);
- - bytecpy(®[2], ( uint8_t *)&ctrl3_c);
- - bytecpy(®[3], ( uint8_t *)&ctrl4_c);
- - bytecpy(®[4], ( uint8_t *)&ctrl5_c);
- - bytecpy(®[5], ( uint8_t *)&ctrl6_c);
- - bytecpy(®[6], ( uint8_t *)&ctrl7_g);
- - bytecpy(®[7], ( uint8_t *)&ctrl8_xl);
- -
- - if ( ret == 0 ) {
- + if (ctx != NULL)
- + {
- + bytecpy(®[0], (uint8_t *)&ctrl1_xl);
- + bytecpy(®[1], (uint8_t *)&ctrl2_g);
- + bytecpy(®[2], (uint8_t *)&ctrl3_c);
- + bytecpy(®[3], (uint8_t *)&ctrl4_c);
- + bytecpy(®[4], (uint8_t *)&ctrl5_c);
- + bytecpy(®[5], (uint8_t *)&ctrl6_c);
- + bytecpy(®[6], (uint8_t *)&ctrl7_g);
- + bytecpy(®[7], (uint8_t *)&ctrl8_xl);
- +
- + if (ret == 0)
- + {
- ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL1_XL, (uint8_t *)®, 8);
- }
-
- - if ( ret == 0 ) {
- + if (ret == 0)
- + {
- ret = lsm6dso_write_reg(ctx, LSM6DSO_FUNC_CFG_ACCESS,
- (uint8_t *)&func_cfg_access, 1);
- }
- }
-
- /* writing OIS checked configuration */
- - if ( aux_ctx != NULL ) {
- - bytecpy(®[0], ( uint8_t *)&ctrl1_ois);
- - bytecpy(®[1], ( uint8_t *)&ctrl2_ois);
- - bytecpy(®[2], ( uint8_t *)&ctrl3_ois);
- -
- - if (ret == 0) {
- + if (aux_ctx != NULL)
- + {
- + bytecpy(®[0], (uint8_t *)&ctrl1_ois);
- + bytecpy(®[1], (uint8_t *)&ctrl2_ois);
- + bytecpy(®[2], (uint8_t *)&ctrl3_ois);
- +
- + if (ret == 0)
- + {
- ret = lsm6dso_write_reg(aux_ctx, LSM6DSO_CTRL1_OIS, reg, 3);
- }
- }
- @@ -11042,6 +12234,7 @@ int32_t lsm6dso_mode_set(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- * @param aux_ctx auxiliary communication interface handler. Use NULL
- * to ignore this interface.(ptr)
- * @param val get the sensor conversion parameters.(ptr)
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_mode_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- @@ -11064,76 +12257,90 @@ int32_t lsm6dso_mode_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- lsm6dso_ctrl7_g_t ctrl7_g;
- uint8_t reg[8];
- int32_t ret;
- +
- ret = 0;
-
- /* reading the registers of the device */
- - if ( ctx != NULL ) {
- + if (ctx != NULL)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL1_XL, reg, 7);
- - bytecpy(( uint8_t *)&ctrl1_xl, ®[0]);
- - bytecpy(( uint8_t *)&ctrl2_g, ®[1]);
- - bytecpy(( uint8_t *)&ctrl3_c, ®[2]);
- - bytecpy(( uint8_t *)&ctrl4_c, ®[3]);
- - bytecpy(( uint8_t *)&ctrl5_c, ®[4]);
- - bytecpy(( uint8_t *)&ctrl6_c, ®[5]);
- - bytecpy(( uint8_t *)&ctrl7_g, ®[6]);
- -
- - if ( ret == 0 ) {
- + bytecpy((uint8_t *)&ctrl1_xl, ®[0]);
- + bytecpy((uint8_t *)&ctrl2_g, ®[1]);
- + bytecpy((uint8_t *)&ctrl3_c, ®[2]);
- + bytecpy((uint8_t *)&ctrl4_c, ®[3]);
- + bytecpy((uint8_t *)&ctrl5_c, ®[4]);
- + bytecpy((uint8_t *)&ctrl6_c, ®[5]);
- + bytecpy((uint8_t *)&ctrl7_g, ®[6]);
- +
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FUNC_CFG_ACCESS,
- (uint8_t *)&func_cfg_access, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_ODR_CFG_B, reg, 1);
- - bytecpy(( uint8_t *)&emb_func_odr_cfg_b, ®[0]);
- + bytecpy((uint8_t *)&emb_func_odr_cfg_b, ®[0]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_EN_B,
- (uint8_t *)&emb_func_en_b, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_FSM_ENABLE_A, reg, 2);
- - bytecpy(( uint8_t *)&fsm_enable_a, ®[0]);
- - bytecpy(( uint8_t *)&fsm_enable_b, ®[1]);
- + bytecpy((uint8_t *)&fsm_enable_a, ®[0]);
- + bytecpy((uint8_t *)&fsm_enable_b, ®[1]);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
- }
-
- - if ( aux_ctx != NULL ) {
- - if (ret == 0) {
- + if (aux_ctx != NULL)
- + {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(aux_ctx, LSM6DSO_CTRL1_OIS, reg, 3);
- }
-
- - bytecpy(( uint8_t *)&ctrl1_ois, ®[0]);
- - bytecpy(( uint8_t *)&ctrl2_ois, ®[1]);
- - bytecpy(( uint8_t *)&ctrl3_ois, ®[2]);
- + bytecpy((uint8_t *)&ctrl1_ois, ®[0]);
- + bytecpy((uint8_t *)&ctrl2_ois, ®[1]);
- + bytecpy((uint8_t *)&ctrl3_ois, ®[2]);
- }
-
- - else {
- - if ( ctx != NULL ) {
- - if (ret == 0) {
- + else
- + {
- + if (ctx != NULL)
- + {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL1_OIS, reg, 3);
- }
-
- - bytecpy(( uint8_t *)&ctrl1_ois, ®[0]);
- - bytecpy(( uint8_t *)&ctrl2_ois, ®[1]);
- - bytecpy(( uint8_t *)&ctrl3_ois, ®[2]);
- + bytecpy((uint8_t *)&ctrl1_ois, ®[0]);
- + bytecpy((uint8_t *)&ctrl2_ois, ®[1]);
- + bytecpy((uint8_t *)&ctrl3_ois, ®[2]);
- }
- }
-
- /* fill the input structure */
-
- /* get accelerometer configuration */
- - switch ( (ctrl5_c.xl_ulp_en << 5) | (ctrl6_c.xl_hm_mode << 4) |
- - ctrl1_xl.odr_xl ) {
- + switch ((ctrl5_c.xl_ulp_en << 5) | (ctrl6_c.xl_hm_mode << 4) |
- + ctrl1_xl.odr_xl)
- + {
- case LSM6DSO_XL_UI_OFF:
- val->ui.xl.odr = LSM6DSO_XL_UI_OFF;
- break;
- @@ -11231,7 +12438,8 @@ int32_t lsm6dso_mode_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- break;
- }
-
- - switch ( ctrl1_xl.fs_xl ) {
- + switch (ctrl1_xl.fs_xl)
- + {
- case LSM6DSO_XL_UI_2g:
- val->ui.xl.fs = LSM6DSO_XL_UI_2g;
- break;
- @@ -11254,7 +12462,8 @@ int32_t lsm6dso_mode_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- }
-
- /* get gyroscope configuration */
- - switch ( (ctrl7_g.g_hm_mode << 4) | ctrl2_g.odr_g) {
- + switch ((ctrl7_g.g_hm_mode << 4) | ctrl2_g.odr_g)
- + {
- case LSM6DSO_GY_UI_OFF:
- val->ui.gy.odr = LSM6DSO_GY_UI_OFF;
- break;
- @@ -11324,7 +12533,8 @@ int32_t lsm6dso_mode_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- break;
- }
-
- - switch (ctrl2_g.fs_g) {
- + switch (ctrl2_g.fs_g)
- + {
- case LSM6DSO_GY_UI_125dps:
- val->ui.gy.fs = LSM6DSO_GY_UI_125dps;
- break;
- @@ -11351,15 +12561,17 @@ int32_t lsm6dso_mode_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- }
-
- /* get finite state machine configuration */
- - if ( (fsm_enable_a.fsm1_en | fsm_enable_a.fsm2_en |
- - fsm_enable_a.fsm3_en |
- - fsm_enable_a.fsm4_en | fsm_enable_a.fsm5_en | fsm_enable_a.fsm6_en |
- - fsm_enable_a.fsm7_en | fsm_enable_a.fsm8_en | fsm_enable_b.fsm9_en |
- - fsm_enable_b.fsm10_en | fsm_enable_b.fsm11_en |
- - fsm_enable_b.fsm12_en | fsm_enable_b.fsm13_en |
- - fsm_enable_b.fsm14_en | fsm_enable_b.fsm15_en |
- - fsm_enable_b.fsm16_en) == PROPERTY_ENABLE ) {
- - switch (emb_func_odr_cfg_b.fsm_odr) {
- + if ((fsm_enable_a.fsm1_en | fsm_enable_a.fsm2_en |
- + fsm_enable_a.fsm3_en |
- + fsm_enable_a.fsm4_en | fsm_enable_a.fsm5_en | fsm_enable_a.fsm6_en |
- + fsm_enable_a.fsm7_en | fsm_enable_a.fsm8_en | fsm_enable_b.fsm9_en |
- + fsm_enable_b.fsm10_en | fsm_enable_b.fsm11_en |
- + fsm_enable_b.fsm12_en | fsm_enable_b.fsm13_en |
- + fsm_enable_b.fsm14_en | fsm_enable_b.fsm15_en |
- + fsm_enable_b.fsm16_en) == PROPERTY_ENABLE)
- + {
- + switch (emb_func_odr_cfg_b.fsm_odr)
- + {
- case LSM6DSO_FSM_12Hz5:
- val->fsm.odr = LSM6DSO_FSM_12Hz5;
- break;
- @@ -11383,25 +12595,30 @@ int32_t lsm6dso_mode_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
-
- val->fsm.sens = LSM6DSO_FSM_XL_GY;
-
- - if (val->ui.gy.odr == LSM6DSO_GY_UI_OFF) {
- + if (val->ui.gy.odr == LSM6DSO_GY_UI_OFF)
- + {
- val->fsm.sens = LSM6DSO_FSM_XL;
- }
-
- - if (val->ui.xl.odr == LSM6DSO_XL_UI_OFF) {
- + if (val->ui.xl.odr == LSM6DSO_XL_UI_OFF)
- + {
- val->fsm.sens = LSM6DSO_FSM_GY;
- }
- }
-
- - else {
- + else
- + {
- val->fsm.sens = LSM6DSO_FSM_DISABLE;
- }
-
- /* get ois configuration */
-
- /* OIS configuration mode */
- - switch ( ctrl7_g.ois_on_en ) {
- + switch (ctrl7_g.ois_on_en)
- + {
- case LSM6DSO_OIS_ONLY_AUX:
- - switch ( ctrl3_ois.fs_xl_ois ) {
- + switch (ctrl3_ois.fs_xl_ois)
- + {
- case LSM6DSO_XL_OIS_2g:
- val->ois.xl.fs = LSM6DSO_XL_OIS_2g;
- break;
- @@ -11423,7 +12640,8 @@ int32_t lsm6dso_mode_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- break;
- }
-
- - switch ( ctrl1_ois.mode4_en ) {
- + switch (ctrl1_ois.mode4_en)
- + {
- case LSM6DSO_XL_OIS_OFF:
- val->ois.xl.odr = LSM6DSO_XL_OIS_OFF;
- break;
- @@ -11437,7 +12655,8 @@ int32_t lsm6dso_mode_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- break;
- }
-
- - switch ( ctrl1_ois.fs_g_ois ) {
- + switch (ctrl1_ois.fs_g_ois)
- + {
- case LSM6DSO_GY_OIS_250dps:
- val->ois.gy.fs = LSM6DSO_GY_OIS_250dps;
- break;
- @@ -11459,7 +12678,8 @@ int32_t lsm6dso_mode_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- break;
- }
-
- - switch ( ctrl1_ois.ois_en_spi2 ) {
- + switch (ctrl1_ois.ois_en_spi2)
- + {
- case LSM6DSO_GY_OIS_OFF:
- val->ois.gy.odr = LSM6DSO_GY_OIS_OFF;
- break;
- @@ -11477,7 +12697,8 @@ int32_t lsm6dso_mode_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- break;
-
- case LSM6DSO_OIS_MIXED:
- - switch ( ctrl3_ois.fs_xl_ois ) {
- + switch (ctrl3_ois.fs_xl_ois)
- + {
- case LSM6DSO_XL_OIS_2g:
- val->ois.xl.fs = LSM6DSO_XL_OIS_2g;
- break;
- @@ -11499,7 +12720,8 @@ int32_t lsm6dso_mode_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- break;
- }
-
- - switch ( ctrl1_ois.mode4_en ) {
- + switch (ctrl1_ois.mode4_en)
- + {
- case LSM6DSO_XL_OIS_OFF:
- val->ois.xl.odr = LSM6DSO_XL_OIS_OFF;
- break;
- @@ -11513,7 +12735,8 @@ int32_t lsm6dso_mode_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- break;
- }
-
- - switch ( ctrl1_ois.fs_g_ois ) {
- + switch (ctrl1_ois.fs_g_ois)
- + {
- case LSM6DSO_GY_OIS_250dps:
- val->ois.gy.fs = LSM6DSO_GY_OIS_250dps;
- break;
- @@ -11535,7 +12758,8 @@ int32_t lsm6dso_mode_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- break;
- }
-
- - switch ( ctrl1_ois.ois_en_spi2 ) {
- + switch (ctrl1_ois.ois_en_spi2)
- + {
- case LSM6DSO_GY_OIS_OFF:
- val->ois.gy.odr = LSM6DSO_GY_OIS_OFF;
- break;
- @@ -11570,6 +12794,7 @@ int32_t lsm6dso_mode_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- *
- * @param ctx communication interface handler.(ptr)
- * @param md the sensor conversion parameters.(ptr)
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_data_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- @@ -11577,31 +12802,35 @@ int32_t lsm6dso_data_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- {
- uint8_t buff[14];
- int32_t ret;
- +
- uint8_t i;
- uint8_t j;
- ret = 0;
-
- /* read data */
- - if ( ctx != NULL ) {
- + if (ctx != NULL)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_OUT_TEMP_L, buff, 14);
- }
-
- j = 0;
- /* temperature conversion */
- data->ui.heat.raw = (int16_t)buff[j + 1U];
- - data->ui.heat.raw = ( ((int16_t)data->ui.heat.raw * (int16_t)256) +
- - (int16_t)buff[j] );
- + data->ui.heat.raw = (((int16_t)data->ui.heat.raw * (int16_t)256) +
- + (int16_t)buff[j]);
- j += 2U;
- data->ui.heat.deg_c = lsm6dso_from_lsb_to_celsius((
- int16_t)data->ui.heat.raw);
-
- /* angular rate conversion */
- - for (i = 0U; i < 3U; i++) {
- + for (i = 0U; i < 3U; i++)
- + {
- data->ui.gy.raw[i] = (int16_t)buff[j + 1U];
- data->ui.gy.raw[i] = (data->ui.gy.raw[i] * 256) + (int16_t) buff[j];
- j += 2U;
-
- - switch ( md->ui.gy.fs ) {
- + switch (md->ui.gy.fs)
- + {
- case LSM6DSO_GY_UI_250dps:
- data->ui.gy.mdps[i] = lsm6dso_from_fs250_to_mdps(data->ui.gy.raw[i]);
- break;
- @@ -11629,12 +12858,14 @@ int32_t lsm6dso_data_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- }
-
- /* acceleration conversion */
- - for (i = 0U; i < 3U; i++) {
- + for (i = 0U; i < 3U; i++)
- + {
- data->ui.xl.raw[i] = (int16_t)buff[j + 1U];
- data->ui.xl.raw[i] = (data->ui.xl.raw[i] * 256) + (int16_t) buff[j];
- j += 2U;
-
- - switch ( md->ui.xl.fs ) {
- + switch (md->ui.xl.fs)
- + {
- case LSM6DSO_XL_UI_2g:
- data->ui.xl.mg[i] = lsm6dso_from_fs2_to_mg(data->ui.xl.raw[i]);
- break;
- @@ -11658,8 +12889,10 @@ int32_t lsm6dso_data_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- }
-
- /* read data from ois chain */
- - if (aux_ctx != NULL) {
- - if (ret == 0) {
- + if (aux_ctx != NULL)
- + {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(aux_ctx, LSM6DSO_OUTX_L_G, buff, 12);
- }
- }
- @@ -11667,12 +12900,14 @@ int32_t lsm6dso_data_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- j = 0;
-
- /* ois angular rate conversion */
- - for (i = 0U; i < 3U; i++) {
- + for (i = 0U; i < 3U; i++)
- + {
- data->ois.gy.raw[i] = (int16_t) buff[j + 1U];
- data->ois.gy.raw[i] = (data->ois.gy.raw[i] * 256) + (int16_t) buff[j];
- j += 2U;
-
- - switch ( md->ois.gy.fs ) {
- + switch (md->ois.gy.fs)
- + {
- case LSM6DSO_GY_UI_250dps:
- data->ois.gy.mdps[i] = lsm6dso_from_fs250_to_mdps(
- data->ois.gy.raw[i]);
- @@ -11705,12 +12940,14 @@ int32_t lsm6dso_data_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- }
-
- /* ois acceleration conversion */
- - for (i = 0U; i < 3U; i++) {
- + for (i = 0U; i < 3U; i++)
- + {
- data->ois.xl.raw[i] = (int16_t) buff[j + 1U];
- data->ois.xl.raw[i] = (data->ois.xl.raw[i] * 256) + (int16_t) buff[j];
- j += 2U;
-
- - switch ( md->ois.xl.fs ) {
- + switch (md->ois.xl.fs)
- + {
- case LSM6DSO_XL_UI_2g:
- data->ois.xl.mg[i] = lsm6dso_from_fs2_to_mg(data->ois.xl.raw[i]);
- break;
- @@ -11742,6 +12979,7 @@ int32_t lsm6dso_data_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- * @param ctx read / write interface definitions
- * @param val change the values of registers
- * EMB_FUNC_EN_A e EMB_FUNC_EN_B.
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_embedded_sens_set(stmdev_ctx_t *ctx,
- @@ -11750,14 +12988,17 @@ int32_t lsm6dso_embedded_sens_set(stmdev_ctx_t *ctx,
- lsm6dso_emb_func_en_a_t emb_func_en_a;
- lsm6dso_emb_func_en_b_t emb_func_en_b;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_EN_A,
- (uint8_t *)&emb_func_en_a, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_EN_B,
- (uint8_t *)&emb_func_en_b, 1);
- emb_func_en_b.fsm_en = val->fsm;
- @@ -11768,17 +13009,20 @@ int32_t lsm6dso_embedded_sens_set(stmdev_ctx_t *ctx,
- emb_func_en_b.fifo_compr_en = val->fifo_compr;
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_write_reg(ctx, LSM6DSO_EMB_FUNC_EN_A,
- (uint8_t *)&emb_func_en_a, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_write_reg(ctx, LSM6DSO_EMB_FUNC_EN_B,
- (uint8_t *)&emb_func_en_b, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -11791,6 +13035,7 @@ int32_t lsm6dso_embedded_sens_set(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val get the values of registers
- * EMB_FUNC_EN_A e EMB_FUNC_EN_B.
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_embedded_sens_get(stmdev_ctx_t *ctx,
- @@ -11799,14 +13044,17 @@ int32_t lsm6dso_embedded_sens_get(stmdev_ctx_t *ctx,
- lsm6dso_emb_func_en_a_t emb_func_en_a;
- lsm6dso_emb_func_en_b_t emb_func_en_b;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_EN_A,
- (uint8_t *)&emb_func_en_a, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_EN_B,
- (uint8_t *)&emb_func_en_b, 1);
- emb_sens->fsm = emb_func_en_b.fsm_en;
- @@ -11817,7 +13065,8 @@ int32_t lsm6dso_embedded_sens_get(stmdev_ctx_t *ctx,
- emb_sens->fifo_compr = emb_func_en_b.fifo_compr_en;
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -11830,6 +13079,7 @@ int32_t lsm6dso_embedded_sens_get(stmdev_ctx_t *ctx,
- * @param ctx read / write interface definitions
- * @param val get the values of registers
- * EMB_FUNC_EN_A e EMB_FUNC_EN_B.
- + * @retval interface status (MANDATORY: return 0 -> no Error)
- *
- */
- int32_t lsm6dso_embedded_sens_off(stmdev_ctx_t *ctx)
- @@ -11837,14 +13087,17 @@ int32_t lsm6dso_embedded_sens_off(stmdev_ctx_t *ctx)
- lsm6dso_emb_func_en_a_t emb_func_en_a;
- lsm6dso_emb_func_en_b_t emb_func_en_b;
- int32_t ret;
- +
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK);
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_EN_A,
- (uint8_t *)&emb_func_en_a, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_EN_B,
- (uint8_t *)&emb_func_en_b, 1);
- emb_func_en_b.fsm_en = PROPERTY_DISABLE;
- @@ -11855,17 +13108,20 @@ int32_t lsm6dso_embedded_sens_off(stmdev_ctx_t *ctx)
- emb_func_en_b.fifo_compr_en = PROPERTY_DISABLE;
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_write_reg(ctx, LSM6DSO_EMB_FUNC_EN_A,
- (uint8_t *)&emb_func_en_a, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_write_reg(ctx, LSM6DSO_EMB_FUNC_EN_B,
- (uint8_t *)&emb_func_en_b, 1);
- }
-
- - if (ret == 0) {
- + if (ret == 0)
- + {
- ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK);
- }
-
- @@ -11881,5 +13137,3 @@ int32_t lsm6dso_embedded_sens_off(stmdev_ctx_t *ctx)
- * @}
- *
- */
- -
- -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
- diff --git a/lsm6dso_reg.h b/lsm6dso_reg.h
- index d13f05d6b..b72f62327 100644
- --- a/lsm6dso_reg.h
- +++ b/lsm6dso_reg.h
- @@ -1,22 +1,21 @@
- -/*
- - ******************************************************************************
- - * @file lsm6dso_reg.h
- - * @author Sensors Software Solution Team
- - * @brief This file contains all the functions prototypes for the
- - * lsm6dso_reg.c driver.
- - ******************************************************************************
- - * @attention
- - *
- - * <h2><center>© Copyright (c) 2020 STMicroelectronics.
- - * All rights reserved.</center></h2>
- - *
- - * This software component is licensed by ST under BSD 3-Clause license,
- - * the "License"; You may not use this file except in compliance with the
- - * License. You may obtain a copy of the License at:
- - * opensource.org/licenses/BSD-3-Clause
- - *
- - ******************************************************************************
- - */
- +/**
- + ******************************************************************************
- + * @file lsm6dso_reg.h
- + * @author Sensors Software Solution Team
- + * @brief This file contains all the functions prototypes for the
- + * lsm6dso_reg.c driver.
- + ******************************************************************************
- + * @attention
- + *
- + * Copyright (c) 2019 STMicroelectronics.
- + * All rights reserved.
- + *
- + * This software is licensed under terms that can be found in the LICENSE file
- + * in the root directory of this software component.
- + * If no LICENSE file comes with this software, it is provided AS-IS.
- + *
- + ******************************************************************************
- + */
-
- /* Define to prevent recursive inclusion -------------------------------------*/
- #ifndef LSM6DSO_REGS_H
- @@ -28,6 +27,7 @@ extern "C" {
-
- /* Includes ------------------------------------------------------------------*/
- #include <stdint.h>
- +#include <stddef.h>
- #include <math.h>
-
- /** @addtogroup LSM6DSO
- @@ -74,7 +74,8 @@ extern "C" {
- #ifndef MEMS_SHARED_TYPES
- #define MEMS_SHARED_TYPES
-
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t bit0 : 1;
- uint8_t bit1 : 1;
- @@ -107,19 +108,40 @@ typedef struct {
- *
- */
-
- -typedef int32_t (*stmdev_write_ptr)(void *, uint8_t, uint8_t *,
- - uint16_t);
- -typedef int32_t (*stmdev_read_ptr) (void *, uint8_t, uint8_t *,
- - uint16_t);
- +typedef int32_t (*stmdev_write_ptr)(void *, uint8_t, uint8_t *, uint16_t);
- +typedef int32_t (*stmdev_read_ptr)(void *, uint8_t, uint8_t *, uint16_t);
- +typedef void (*stmdev_mdelay_ptr)(uint32_t millisec);
-
- -typedef struct {
- +typedef struct
- +{
- /** Component mandatory fields **/
- stmdev_write_ptr write_reg;
- stmdev_read_ptr read_reg;
- + /** Component optional fields **/
- + stmdev_mdelay_ptr mdelay;
- /** Customizable optional pointer **/
- void *handle;
- } stmdev_ctx_t;
-
- +#ifndef __weak
- +#define __weak __attribute__((weak))
- +#endif /* __weak */
- +
- +/*
- + * These are the basic platform dependent I/O routines to read
- + * and write device registers connected on a standard bus.
- + * The driver keeps offering a default implementation based on function
- + * pointers to read/write routines for backward compatibility.
- + * The __weak directive allows the final application to overwrite
- + * them with a custom implementation.
- + */
- +int32_t lsm6dso_read_reg(stmdev_ctx_t *ctx, uint8_t reg,
- + uint8_t *data,
- + uint16_t len);
- +int32_t lsm6dso_write_reg(stmdev_ctx_t *ctx, uint8_t reg,
- + uint8_t *data,
- + uint16_t len);
- +
- /**
- * @}
- *
- @@ -141,7 +163,8 @@ typedef struct {
- *
- */
-
- -typedef struct {
- +typedef struct
- +{
- uint8_t address;
- uint8_t data;
- } ucf_line_t;
- @@ -176,7 +199,8 @@ typedef struct {
- */
-
- #define LSM6DSO_FUNC_CFG_ACCESS 0x01U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t not_used_01 : 6;
- uint8_t reg_access :
- @@ -189,7 +213,8 @@ uint8_t reg_access :
- } lsm6dso_func_cfg_access_t;
-
- #define LSM6DSO_PIN_CTRL 0x02U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t not_used_01 : 6;
- uint8_t sdo_pu_en : 1;
- @@ -202,12 +227,14 @@ typedef struct {
- } lsm6dso_pin_ctrl_t;
-
- #define LSM6DSO_FIFO_CTRL1 0x07U
- -typedef struct {
- +typedef struct
- +{
- uint8_t wtm : 8;
- } lsm6dso_fifo_ctrl1_t;
-
- #define LSM6DSO_FIFO_CTRL2 0x08U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t wtm : 1;
- uint8_t uncoptr_rate : 2;
- @@ -228,7 +255,8 @@ typedef struct {
- } lsm6dso_fifo_ctrl2_t;
-
- #define LSM6DSO_FIFO_CTRL3 0x09U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t bdr_xl : 4;
- uint8_t bdr_gy : 4;
- @@ -239,7 +267,8 @@ typedef struct {
- } lsm6dso_fifo_ctrl3_t;
-
- #define LSM6DSO_FIFO_CTRL4 0x0AU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t fifo_mode : 3;
- uint8_t not_used_01 : 1;
- @@ -254,7 +283,8 @@ typedef struct {
- } lsm6dso_fifo_ctrl4_t;
-
- #define LSM6DSO_COUNTER_BDR_REG1 0x0BU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t cnt_bdr_th : 3;
- uint8_t not_used_01 : 2;
- @@ -271,12 +301,14 @@ typedef struct {
- } lsm6dso_counter_bdr_reg1_t;
-
- #define LSM6DSO_COUNTER_BDR_REG2 0x0CU
- -typedef struct {
- +typedef struct
- +{
- uint8_t cnt_bdr_th : 8;
- } lsm6dso_counter_bdr_reg2_t;
-
- #define LSM6DSO_INT1_CTRL 0x0D
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t int1_drdy_xl : 1;
- uint8_t int1_drdy_g : 1;
- @@ -299,7 +331,8 @@ typedef struct {
- } lsm6dso_int1_ctrl_t;
-
- #define LSM6DSO_INT2_CTRL 0x0EU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t int2_drdy_xl : 1;
- uint8_t int2_drdy_g : 1;
- @@ -323,7 +356,8 @@ typedef struct {
-
- #define LSM6DSO_WHO_AM_I 0x0FU
- #define LSM6DSO_CTRL1_XL 0x10U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t not_used_01 : 1;
- uint8_t lpf2_xl_en : 1;
- @@ -338,7 +372,8 @@ typedef struct {
- } lsm6dso_ctrl1_xl_t;
-
- #define LSM6DSO_CTRL2_G 0x11U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t not_used_01 : 1;
- uint8_t fs_g : 3; /* fs_125 + fs_g */
- @@ -351,7 +386,8 @@ typedef struct {
- } lsm6dso_ctrl2_g_t;
-
- #define LSM6DSO_CTRL3_C 0x12U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t sw_reset : 1;
- uint8_t not_used_01 : 1;
- @@ -374,7 +410,8 @@ typedef struct {
- } lsm6dso_ctrl3_c_t;
-
- #define LSM6DSO_CTRL4_C 0x13U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t not_used_01 : 1;
- uint8_t lpf1_sel_g : 1;
- @@ -397,7 +434,8 @@ typedef struct {
- } lsm6dso_ctrl4_c_t;
-
- #define LSM6DSO_CTRL5_C 0x14U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t st_xl : 2;
- uint8_t st_g : 2;
- @@ -414,7 +452,8 @@ typedef struct {
- } lsm6dso_ctrl5_c_t;
-
- #define LSM6DSO_CTRL6_C 0x15U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t ftype : 3;
- uint8_t usr_off_w : 1;
- @@ -431,7 +470,8 @@ uint8_t den_mode :
- } lsm6dso_ctrl6_c_t;
-
- #define LSM6DSO_CTRL7_G 0x16U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t ois_on : 1;
- uint8_t usr_off_on_out : 1;
- @@ -452,7 +492,8 @@ typedef struct {
- } lsm6dso_ctrl7_g_t;
-
- #define LSM6DSO_CTRL8_XL 0x17U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t low_pass_on_6d : 1;
- uint8_t xl_fs_mode : 1;
- @@ -471,7 +512,8 @@ typedef struct {
- } lsm6dso_ctrl8_xl_t;
-
- #define LSM6DSO_CTRL9_XL 0x18U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t not_used_01 : 1;
- uint8_t i3c_disable : 1;
- @@ -492,7 +534,8 @@ typedef struct {
- } lsm6dso_ctrl9_xl_t;
-
- #define LSM6DSO_CTRL10_C 0x19U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t not_used_01 : 5;
- uint8_t timestamp_en : 1;
- @@ -505,7 +548,8 @@ typedef struct {
- } lsm6dso_ctrl10_c_t;
-
- #define LSM6DSO_ALL_INT_SRC 0x1AU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t ff_ia : 1;
- uint8_t wu_ia : 1;
- @@ -528,7 +572,8 @@ typedef struct {
- } lsm6dso_all_int_src_t;
-
- #define LSM6DSO_WAKE_UP_SRC 0x1BU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t z_wu : 1;
- uint8_t y_wu : 1;
- @@ -551,7 +596,8 @@ typedef struct {
- } lsm6dso_wake_up_src_t;
-
- #define LSM6DSO_TAP_SRC 0x1CU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t z_tap : 1;
- uint8_t y_tap : 1;
- @@ -574,7 +620,8 @@ typedef struct {
- } lsm6dso_tap_src_t;
-
- #define LSM6DSO_D6D_SRC 0x1DU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t xl : 1;
- uint8_t xh : 1;
- @@ -597,7 +644,8 @@ typedef struct {
- } lsm6dso_d6d_src_t;
-
- #define LSM6DSO_STATUS_REG 0x1EU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t xlda : 1;
- uint8_t gda : 1;
- @@ -612,7 +660,8 @@ typedef struct {
- } lsm6dso_status_reg_t;
-
- #define LSM6DSO_STATUS_SPIAUX 0x1EU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t xlda : 1;
- uint8_t gda : 1;
- @@ -641,7 +690,8 @@ typedef struct {
- #define LSM6DSO_OUTZ_L_A 0x2CU
- #define LSM6DSO_OUTZ_H_A 0x2DU
- #define LSM6DSO_EMB_FUNC_STATUS_MAINPAGE 0x35U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t not_used_01 : 3;
- uint8_t is_step_det : 1;
- @@ -660,7 +710,8 @@ typedef struct {
- } lsm6dso_emb_func_status_mainpage_t;
-
- #define LSM6DSO_FSM_STATUS_A_MAINPAGE 0x36U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t is_fsm1 : 1;
- uint8_t is_fsm2 : 1;
- @@ -683,7 +734,8 @@ typedef struct {
- } lsm6dso_fsm_status_a_mainpage_t;
-
- #define LSM6DSO_FSM_STATUS_B_MAINPAGE 0x37U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t is_fsm9 : 1;
- uint8_t is_fsm10 : 1;
- @@ -706,7 +758,8 @@ typedef struct {
- } lsm6dso_fsm_status_b_mainpage_t;
-
- #define LSM6DSO_STATUS_MASTER_MAINPAGE 0x39U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t sens_hub_endop : 1;
- uint8_t not_used_01 : 2;
- @@ -727,12 +780,14 @@ typedef struct {
- } lsm6dso_status_master_mainpage_t;
-
- #define LSM6DSO_FIFO_STATUS1 0x3AU
- -typedef struct {
- +typedef struct
- +{
- uint8_t diff_fifo : 8;
- } lsm6dso_fifo_status1_t;
-
- #define LSM6DSO_FIFO_STATUS2 0x3B
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t diff_fifo : 2;
- uint8_t not_used_01 : 1;
- @@ -757,7 +812,8 @@ typedef struct {
- #define LSM6DSO_TIMESTAMP2 0x42U
- #define LSM6DSO_TIMESTAMP3 0x43U
- #define LSM6DSO_TAP_CFG0 0x56U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t lir : 1;
- uint8_t tap_z_en : 1;
- @@ -780,7 +836,8 @@ typedef struct {
- } lsm6dso_tap_cfg0_t;
-
- #define LSM6DSO_TAP_CFG1 0x57U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t tap_ths_x : 5;
- uint8_t tap_priority : 3;
- @@ -791,7 +848,8 @@ typedef struct {
- } lsm6dso_tap_cfg1_t;
-
- #define LSM6DSO_TAP_CFG2 0x58U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t tap_ths_y : 5;
- uint8_t inact_en : 2;
- @@ -804,7 +862,8 @@ typedef struct {
- } lsm6dso_tap_cfg2_t;
-
- #define LSM6DSO_TAP_THS_6D 0x59U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t tap_ths_z : 5;
- uint8_t sixd_ths : 2;
- @@ -817,7 +876,8 @@ typedef struct {
- } lsm6dso_tap_ths_6d_t;
-
- #define LSM6DSO_INT_DUR2 0x5AU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t shock : 2;
- uint8_t quiet : 2;
- @@ -830,7 +890,8 @@ typedef struct {
- } lsm6dso_int_dur2_t;
-
- #define LSM6DSO_WAKE_UP_THS 0x5BU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t wk_ths : 6;
- uint8_t usr_off_on_wu : 1;
- @@ -843,7 +904,8 @@ typedef struct {
- } lsm6dso_wake_up_ths_t;
-
- #define LSM6DSO_WAKE_UP_DUR 0x5CU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t sleep_dur : 4;
- uint8_t wake_ths_w : 1;
- @@ -858,7 +920,8 @@ typedef struct {
- } lsm6dso_wake_up_dur_t;
-
- #define LSM6DSO_FREE_FALL 0x5DU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t ff_ths : 3;
- uint8_t ff_dur : 5;
- @@ -869,7 +932,8 @@ typedef struct {
- } lsm6dso_free_fall_t;
-
- #define LSM6DSO_MD1_CFG 0x5EU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t int1_shub : 1;
- uint8_t int1_emb_func : 1;
- @@ -892,7 +956,8 @@ typedef struct {
- } lsm6dso_md1_cfg_t;
-
- #define LSM6DSO_MD2_CFG 0x5FU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t int2_timestamp : 1;
- uint8_t int2_emb_func : 1;
- @@ -915,7 +980,8 @@ typedef struct {
- } lsm6dso_md2_cfg_t;
-
- #define LSM6DSO_I3C_BUS_AVB 0x62U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t pd_dis_int1 : 1;
- uint8_t not_used_01 : 2;
- @@ -930,12 +996,14 @@ typedef struct {
- } lsm6dso_i3c_bus_avb_t;
-
- #define LSM6DSO_INTERNAL_FREQ_FINE 0x63U
- -typedef struct {
- +typedef struct
- +{
- uint8_t freq_fine : 8;
- } lsm6dso_internal_freq_fine_t;
-
- #define LSM6DSO_INT_OIS 0x6FU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t st_xl_ois : 2;
- uint8_t not_used_01 : 3;
- @@ -952,7 +1020,8 @@ typedef struct {
- } lsm6dso_int_ois_t;
-
- #define LSM6DSO_CTRL1_OIS 0x70U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t ois_en_spi2 : 1;
- uint8_t fs_g_ois : 3; /* fs_125_ois + fs[1:0]_g_ois */
- @@ -971,7 +1040,8 @@ typedef struct {
- } lsm6dso_ctrl1_ois_t;
-
- #define LSM6DSO_CTRL2_OIS 0x71U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t hp_en_ois : 1;
- uint8_t ftype_ois : 2;
- @@ -988,7 +1058,8 @@ typedef struct {
- } lsm6dso_ctrl2_ois_t;
-
- #define LSM6DSO_CTRL3_OIS 0x72U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t st_ois_clampdis : 1;
- uint8_t st_ois : 2;
- @@ -1006,7 +1077,8 @@ typedef struct {
- #define LSM6DSO_Y_OFS_USR 0x74U
- #define LSM6DSO_Z_OFS_USR 0x75U
- #define LSM6DSO_FIFO_DATA_OUT_TAG 0x78U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t tag_parity : 1;
- uint8_t tag_cnt : 2;
- @@ -1025,7 +1097,8 @@ typedef struct {
- #define LSM6DSO_FIFO_DATA_OUT_Z_L 0x7DU
- #define LSM6DSO_FIFO_DATA_OUT_Z_H 0x7EU
- #define LSM6DSO_PAGE_SEL 0x02U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t not_used_01 : 4;
- uint8_t page_sel : 4;
- @@ -1036,7 +1109,8 @@ typedef struct {
- } lsm6dso_page_sel_t;
-
- #define LSM6DSO_EMB_FUNC_EN_A 0x04U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t not_used_01 : 3;
- uint8_t pedo_en : 1;
- @@ -1053,7 +1127,8 @@ typedef struct {
- } lsm6dso_emb_func_en_a_t;
-
- #define LSM6DSO_EMB_FUNC_EN_B 0x05U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t fsm_en : 1;
- uint8_t not_used_01 : 2;
- @@ -1070,17 +1145,20 @@ typedef struct {
- } lsm6dso_emb_func_en_b_t;
-
- #define LSM6DSO_PAGE_ADDRESS 0x08U
- -typedef struct {
- +typedef struct
- +{
- uint8_t page_addr : 8;
- } lsm6dso_page_address_t;
-
- #define LSM6DSO_PAGE_VALUE 0x09U
- -typedef struct {
- +typedef struct
- +{
- uint8_t page_value : 8;
- } lsm6dso_page_value_t;
-
- #define LSM6DSO_EMB_FUNC_INT1 0x0AU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t not_used_01 : 3;
- uint8_t int1_step_detector : 1;
- @@ -1099,7 +1177,8 @@ typedef struct {
- } lsm6dso_emb_func_int1_t;
-
- #define LSM6DSO_FSM_INT1_A 0x0BU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t int1_fsm1 : 1;
- uint8_t int1_fsm2 : 1;
- @@ -1122,7 +1201,8 @@ typedef struct {
- } lsm6dso_fsm_int1_a_t;
-
- #define LSM6DSO_FSM_INT1_B 0x0CU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t int1_fsm9 : 1;
- uint8_t int1_fsm10 : 1;
- @@ -1145,7 +1225,8 @@ typedef struct {
- } lsm6dso_fsm_int1_b_t;
-
- #define LSM6DSO_EMB_FUNC_INT2 0x0EU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t not_used_01 : 3;
- uint8_t int2_step_detector : 1;
- @@ -1164,7 +1245,8 @@ typedef struct {
- } lsm6dso_emb_func_int2_t;
-
- #define LSM6DSO_FSM_INT2_A 0x0FU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t int2_fsm1 : 1;
- uint8_t int2_fsm2 : 1;
- @@ -1187,7 +1269,8 @@ typedef struct {
- } lsm6dso_fsm_int2_a_t;
-
- #define LSM6DSO_FSM_INT2_B 0x10U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t int2_fsm9 : 1;
- uint8_t int2_fsm10 : 1;
- @@ -1210,7 +1293,8 @@ typedef struct {
- } lsm6dso_fsm_int2_b_t;
-
- #define LSM6DSO_EMB_FUNC_STATUS 0x12U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t not_used_01 : 3;
- uint8_t is_step_det : 1;
- @@ -1229,7 +1313,8 @@ typedef struct {
- } lsm6dso_emb_func_status_t;
-
- #define LSM6DSO_FSM_STATUS_A 0x13U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t is_fsm1 : 1;
- uint8_t is_fsm2 : 1;
- @@ -1252,7 +1337,8 @@ typedef struct {
- } lsm6dso_fsm_status_a_t;
-
- #define LSM6DSO_FSM_STATUS_B 0x14U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t is_fsm9 : 1;
- uint8_t is_fsm10 : 1;
- @@ -1275,7 +1361,8 @@ typedef struct {
- } lsm6dso_fsm_status_b_t;
-
- #define LSM6DSO_PAGE_RW 0x17U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t not_used_01 : 5;
- uint8_t page_rw : 2; /* page_write + page_read */
- @@ -1288,7 +1375,8 @@ typedef struct {
- } lsm6dso_page_rw_t;
-
- #define LSM6DSO_EMB_FUNC_FIFO_CFG 0x44U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t not_used_00 : 6;
- uint8_t pedo_fifo_en : 1;
- @@ -1301,7 +1389,8 @@ typedef struct {
- } lsm6dso_emb_func_fifo_cfg_t;
-
- #define LSM6DSO_FSM_ENABLE_A 0x46U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t fsm1_en : 1;
- uint8_t fsm2_en : 1;
- @@ -1324,7 +1413,8 @@ typedef struct {
- } lsm6dso_fsm_enable_a_t;
-
- #define LSM6DSO_FSM_ENABLE_B 0x47U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t fsm9_en : 1;
- uint8_t fsm10_en : 1;
- @@ -1349,7 +1439,8 @@ typedef struct {
- #define LSM6DSO_FSM_LONG_COUNTER_L 0x48U
- #define LSM6DSO_FSM_LONG_COUNTER_H 0x49U
- #define LSM6DSO_FSM_LONG_COUNTER_CLEAR 0x4AU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t fsm_lc_clr :
- 2; /* fsm_lc_cleared + fsm_lc_clear */
- @@ -1362,7 +1453,8 @@ uint8_t fsm_lc_clr :
- } lsm6dso_fsm_long_counter_clear_t;
-
- #define LSM6DSO_FSM_OUTS1 0x4CU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t n_v : 1;
- uint8_t p_v : 1;
- @@ -1385,7 +1477,8 @@ typedef struct {
- } lsm6dso_fsm_outs1_t;
-
- #define LSM6DSO_FSM_OUTS2 0x4DU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t n_v : 1;
- uint8_t p_v : 1;
- @@ -1408,7 +1501,8 @@ typedef struct {
- } lsm6dso_fsm_outs2_t;
-
- #define LSM6DSO_FSM_OUTS3 0x4EU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t n_v : 1;
- uint8_t p_v : 1;
- @@ -1431,7 +1525,8 @@ typedef struct {
- } lsm6dso_fsm_outs3_t;
-
- #define LSM6DSO_FSM_OUTS4 0x4FU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t n_v : 1;
- uint8_t p_v : 1;
- @@ -1454,7 +1549,8 @@ typedef struct {
- } lsm6dso_fsm_outs4_t;
-
- #define LSM6DSO_FSM_OUTS5 0x50U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t n_v : 1;
- uint8_t p_v : 1;
- @@ -1477,7 +1573,8 @@ typedef struct {
- } lsm6dso_fsm_outs5_t;
-
- #define LSM6DSO_FSM_OUTS6 0x51U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t n_v : 1;
- uint8_t p_v : 1;
- @@ -1500,7 +1597,8 @@ typedef struct {
- } lsm6dso_fsm_outs6_t;
-
- #define LSM6DSO_FSM_OUTS7 0x52U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t n_v : 1;
- uint8_t p_v : 1;
- @@ -1523,7 +1621,8 @@ typedef struct {
- } lsm6dso_fsm_outs7_t;
-
- #define LSM6DSO_FSM_OUTS8 0x53U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t n_v : 1;
- uint8_t p_v : 1;
- @@ -1546,7 +1645,8 @@ typedef struct {
- } lsm6dso_fsm_outs8_t;
-
- #define LSM6DSO_FSM_OUTS9 0x54U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t n_v : 1;
- uint8_t p_v : 1;
- @@ -1569,7 +1669,8 @@ typedef struct {
- } lsm6dso_fsm_outs9_t;
-
- #define LSM6DSO_FSM_OUTS10 0x55U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t n_v : 1;
- uint8_t p_v : 1;
- @@ -1592,7 +1693,8 @@ typedef struct {
- } lsm6dso_fsm_outs10_t;
-
- #define LSM6DSO_FSM_OUTS11 0x56U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t n_v : 1;
- uint8_t p_v : 1;
- @@ -1615,7 +1717,8 @@ typedef struct {
- } lsm6dso_fsm_outs11_t;
-
- #define LSM6DSO_FSM_OUTS12 0x57U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t n_v : 1;
- uint8_t p_v : 1;
- @@ -1638,7 +1741,8 @@ typedef struct {
- } lsm6dso_fsm_outs12_t;
-
- #define LSM6DSO_FSM_OUTS13 0x58U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t n_v : 1;
- uint8_t p_v : 1;
- @@ -1661,7 +1765,8 @@ typedef struct {
- } lsm6dso_fsm_outs13_t;
-
- #define LSM6DSO_FSM_OUTS14 0x59U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t n_v : 1;
- uint8_t p_v : 1;
- @@ -1684,7 +1789,8 @@ typedef struct {
- } lsm6dso_fsm_outs14_t;
-
- #define LSM6DSO_FSM_OUTS15 0x5AU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t n_v : 1;
- uint8_t p_v : 1;
- @@ -1707,7 +1813,8 @@ typedef struct {
- } lsm6dso_fsm_outs15_t;
-
- #define LSM6DSO_FSM_OUTS16 0x5BU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t n_v : 1;
- uint8_t p_v : 1;
- @@ -1730,7 +1837,8 @@ typedef struct {
- } lsm6dso_fsm_outs16_t;
-
- #define LSM6DSO_EMB_FUNC_ODR_CFG_B 0x5FU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t not_used_01 : 3;
- uint8_t fsm_odr : 2;
- @@ -1745,7 +1853,8 @@ typedef struct {
- #define LSM6DSO_STEP_COUNTER_L 0x62U
- #define LSM6DSO_STEP_COUNTER_H 0x63U
- #define LSM6DSO_EMB_FUNC_SRC 0x64U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t not_used_01 : 2;
- uint8_t stepcounter_bit_set : 1;
- @@ -1766,7 +1875,8 @@ typedef struct {
- } lsm6dso_emb_func_src_t;
-
- #define LSM6DSO_EMB_FUNC_INIT_A 0x66U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t not_used_01 : 3;
- uint8_t step_det_init : 1;
- @@ -1783,7 +1893,8 @@ typedef struct {
- } lsm6dso_emb_func_init_a_t;
-
- #define LSM6DSO_EMB_FUNC_INIT_B 0x67U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t fsm_init : 1;
- uint8_t not_used_01 : 2;
- @@ -1818,7 +1929,8 @@ typedef struct {
- #define LSM6DSO_MAG_SI_ZZ_L 0xD0U
- #define LSM6DSO_MAG_SI_ZZ_H 0xD1U
- #define LSM6DSO_MAG_CFG_A 0xD4U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t mag_z_axis : 3;
- uint8_t not_used_01 : 1;
- @@ -1833,7 +1945,8 @@ typedef struct {
- } lsm6dso_mag_cfg_a_t;
-
- #define LSM6DSO_MAG_CFG_B 0xD5U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t mag_x_axis : 3;
- uint8_t not_used_01 : 5;
- @@ -1849,7 +1962,8 @@ typedef struct {
- #define LSM6DSO_FSM_START_ADD_L 0x17EU
- #define LSM6DSO_FSM_START_ADD_H 0x17FU
- #define LSM6DSO_PEDO_CMD_REG 0x183U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t ad_det_en : 1;
- uint8_t not_used_01 : 1;
- @@ -1869,7 +1983,8 @@ typedef struct {
- #define LSM6DSO_PEDO_SC_DELTAT_L 0x1D0U
- #define LSM6DSO_PEDO_SC_DELTAT_H 0x1D1U
- #define LSM6DSO_SENSOR_HUB_1 0x02U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t bit0 : 1;
- uint8_t bit1 : 1;
- @@ -1892,7 +2007,8 @@ typedef struct {
- } lsm6dso_sensor_hub_1_t;
-
- #define LSM6DSO_SENSOR_HUB_2 0x03U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t bit0 : 1;
- uint8_t bit1 : 1;
- @@ -1915,7 +2031,8 @@ typedef struct {
- } lsm6dso_sensor_hub_2_t;
-
- #define LSM6DSO_SENSOR_HUB_3 0x04U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t bit0 : 1;
- uint8_t bit1 : 1;
- @@ -1938,7 +2055,8 @@ typedef struct {
- } lsm6dso_sensor_hub_3_t;
-
- #define LSM6DSO_SENSOR_HUB_4 0x05U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t bit0 : 1;
- uint8_t bit1 : 1;
- @@ -1961,7 +2079,8 @@ typedef struct {
- } lsm6dso_sensor_hub_4_t;
-
- #define LSM6DSO_SENSOR_HUB_5 0x06U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t bit0 : 1;
- uint8_t bit1 : 1;
- @@ -1984,7 +2103,8 @@ typedef struct {
- } lsm6dso_sensor_hub_5_t;
-
- #define LSM6DSO_SENSOR_HUB_6 0x07U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t bit0 : 1;
- uint8_t bit1 : 1;
- @@ -2007,7 +2127,8 @@ typedef struct {
- } lsm6dso_sensor_hub_6_t;
-
- #define LSM6DSO_SENSOR_HUB_7 0x08U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t bit0 : 1;
- uint8_t bit1 : 1;
- @@ -2030,7 +2151,8 @@ typedef struct {
- } lsm6dso_sensor_hub_7_t;
-
- #define LSM6DSO_SENSOR_HUB_8 0x09U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t bit0 : 1;
- uint8_t bit1 : 1;
- @@ -2053,7 +2175,8 @@ typedef struct {
- } lsm6dso_sensor_hub_8_t;
-
- #define LSM6DSO_SENSOR_HUB_9 0x0AU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t bit0 : 1;
- uint8_t bit1 : 1;
- @@ -2076,7 +2199,8 @@ typedef struct {
- } lsm6dso_sensor_hub_9_t;
-
- #define LSM6DSO_SENSOR_HUB_10 0x0BU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t bit0 : 1;
- uint8_t bit1 : 1;
- @@ -2099,7 +2223,8 @@ typedef struct {
- } lsm6dso_sensor_hub_10_t;
-
- #define LSM6DSO_SENSOR_HUB_11 0x0CU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t bit0 : 1;
- uint8_t bit1 : 1;
- @@ -2122,7 +2247,8 @@ typedef struct {
- } lsm6dso_sensor_hub_11_t;
-
- #define LSM6DSO_SENSOR_HUB_12 0x0DU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t bit0 : 1;
- uint8_t bit1 : 1;
- @@ -2145,7 +2271,8 @@ typedef struct {
- } lsm6dso_sensor_hub_12_t;
-
- #define LSM6DSO_SENSOR_HUB_13 0x0EU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t bit0 : 1;
- uint8_t bit1 : 1;
- @@ -2168,7 +2295,8 @@ typedef struct {
- } lsm6dso_sensor_hub_13_t;
-
- #define LSM6DSO_SENSOR_HUB_14 0x0FU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t bit0 : 1;
- uint8_t bit1 : 1;
- @@ -2191,7 +2319,8 @@ typedef struct {
- } lsm6dso_sensor_hub_14_t;
-
- #define LSM6DSO_SENSOR_HUB_15 0x10U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t bit0 : 1;
- uint8_t bit1 : 1;
- @@ -2214,7 +2343,8 @@ typedef struct {
- } lsm6dso_sensor_hub_15_t;
-
- #define LSM6DSO_SENSOR_HUB_16 0x11U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t bit0 : 1;
- uint8_t bit1 : 1;
- @@ -2237,7 +2367,8 @@ typedef struct {
- } lsm6dso_sensor_hub_16_t;
-
- #define LSM6DSO_SENSOR_HUB_17 0x12U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t bit0 : 1;
- uint8_t bit1 : 1;
- @@ -2260,7 +2391,8 @@ typedef struct {
- } lsm6dso_sensor_hub_17_t;
-
- #define LSM6DSO_SENSOR_HUB_18 0x13U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t bit0 : 1;
- uint8_t bit1 : 1;
- @@ -2283,7 +2415,8 @@ typedef struct {
- } lsm6dso_sensor_hub_18_t;
-
- #define LSM6DSO_MASTER_CONFIG 0x14U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t aux_sens_on : 2;
- uint8_t master_on : 1;
- @@ -2304,7 +2437,8 @@ typedef struct {
- } lsm6dso_master_config_t;
-
- #define LSM6DSO_SLV0_ADD 0x15U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t rw_0 : 1;
- uint8_t slave0 : 7;
- @@ -2315,12 +2449,14 @@ typedef struct {
- } lsm6dso_slv0_add_t;
-
- #define LSM6DSO_SLV0_SUBADD 0x16U
- -typedef struct {
- +typedef struct
- +{
- uint8_t slave0_reg : 8;
- } lsm6dso_slv0_subadd_t;
-
- #define LSM6DSO_SLV0_CONFIG 0x17U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t slave0_numop : 3;
- uint8_t batch_ext_sens_0_en : 1;
- @@ -2335,7 +2471,8 @@ typedef struct {
- } lsm6dso_slv0_config_t;
-
- #define LSM6DSO_SLV1_ADD 0x18U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t r_1 : 1;
- uint8_t slave1_add : 7;
- @@ -2346,12 +2483,14 @@ typedef struct {
- } lsm6dso_slv1_add_t;
-
- #define LSM6DSO_SLV1_SUBADD 0x19U
- -typedef struct {
- +typedef struct
- +{
- uint8_t slave1_reg : 8;
- } lsm6dso_slv1_subadd_t;
-
- #define LSM6DSO_SLV1_CONFIG 0x1AU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t slave1_numop : 3;
- uint8_t batch_ext_sens_1_en : 1;
- @@ -2364,7 +2503,8 @@ typedef struct {
- } lsm6dso_slv1_config_t;
-
- #define LSM6DSO_SLV2_ADD 0x1BU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t r_2 : 1;
- uint8_t slave2_add : 7;
- @@ -2375,12 +2515,14 @@ typedef struct {
- } lsm6dso_slv2_add_t;
-
- #define LSM6DSO_SLV2_SUBADD 0x1CU
- -typedef struct {
- +typedef struct
- +{
- uint8_t slave2_reg : 8;
- } lsm6dso_slv2_subadd_t;
-
- #define LSM6DSO_SLV2_CONFIG 0x1DU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t slave2_numop : 3;
- uint8_t batch_ext_sens_2_en : 1;
- @@ -2393,7 +2535,8 @@ typedef struct {
- } lsm6dso_slv2_config_t;
-
- #define LSM6DSO_SLV3_ADD 0x1EU
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t r_3 : 1;
- uint8_t slave3_add : 7;
- @@ -2404,12 +2547,14 @@ typedef struct {
- } lsm6dso_slv3_add_t;
-
- #define LSM6DSO_SLV3_SUBADD 0x1FU
- -typedef struct {
- +typedef struct
- +{
- uint8_t slave3_reg : 8;
- } lsm6dso_slv3_subadd_t;
-
- #define LSM6DSO_SLV3_CONFIG 0x20U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t slave3_numop : 3;
- uint8_t batch_ext_sens_3_en : 1;
- @@ -2422,12 +2567,14 @@ typedef struct {
- } lsm6dso_slv3_config_t;
-
- #define LSM6DSO_DATAWRITE_SLV0 0x21U
- -typedef struct {
- +typedef struct
- +{
- uint8_t slave0_dataw : 8;
- } lsm6dso_datawrite_src_mode_sub_slv0_t;
-
- #define LSM6DSO_STATUS_MASTER 0x22U
- -typedef struct {
- +typedef struct
- +{
- #if DRV_BYTE_ORDER == DRV_LITTLE_ENDIAN
- uint8_t sens_hub_endop : 1;
- uint8_t not_used_01 : 2;
- @@ -2451,9 +2598,9 @@ typedef struct {
-
- /**
- * @defgroup LSM6DSO_Register_Union
- - * @brief This union group all the registers that has a bitfield
- + * @brief This union group all the registers having a bit-field
- * description.
- - * This union is useful but not need by the driver.
- + * This union is useful but it's not needed by the driver.
- *
- * REMOVING this union you are compliant with:
- * MISRA-C 2012 [Rule 19.2] -> " Union are not allowed "
- @@ -2461,7 +2608,8 @@ typedef struct {
- * @{
- *
- */
- -typedef union {
- +typedef union
- +{
- lsm6dso_func_cfg_access_t func_cfg_access;
- lsm6dso_pin_ctrl_t pin_ctrl;
- lsm6dso_fifo_ctrl1_t fifo_ctrl1;
- @@ -2591,28 +2739,25 @@ typedef union {
- *
- */
-
- -int32_t lsm6dso_read_reg(stmdev_ctx_t *ctx, uint8_t reg,
- - uint8_t *data,
- - uint16_t len);
- -int32_t lsm6dso_write_reg(stmdev_ctx_t *ctx, uint8_t reg,
- - uint8_t *data,
- - uint16_t len);
- -
- float_t lsm6dso_from_fs2_to_mg(int16_t lsb);
- float_t lsm6dso_from_fs4_to_mg(int16_t lsb);
- float_t lsm6dso_from_fs8_to_mg(int16_t lsb);
- float_t lsm6dso_from_fs16_to_mg(int16_t lsb);
- +
- float_t lsm6dso_from_fs125_to_mdps(int16_t lsb);
- float_t lsm6dso_from_fs500_to_mdps(int16_t lsb);
- float_t lsm6dso_from_fs250_to_mdps(int16_t lsb);
- float_t lsm6dso_from_fs1000_to_mdps(int16_t lsb);
- float_t lsm6dso_from_fs2000_to_mdps(int16_t lsb);
- +
- float_t lsm6dso_from_lsb_to_celsius(int16_t lsb);
- +
- float_t lsm6dso_from_lsb_to_nsec(int16_t lsb);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_2g = 0,
- - LSM6DSO_16g = 1, /* if XL_FS_MODE = ‘1’ -> LSM6DSO_2g */
- + LSM6DSO_16g = 1, /* if XL_FS_MODE = '1' -> LSM6DSO_2g */
- LSM6DSO_4g = 2,
- LSM6DSO_8g = 3,
- } lsm6dso_fs_xl_t;
- @@ -2621,7 +2766,8 @@ int32_t lsm6dso_xl_full_scale_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_xl_full_scale_get(stmdev_ctx_t *ctx,
- lsm6dso_fs_xl_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_XL_ODR_OFF = 0,
- LSM6DSO_XL_ODR_12Hz5 = 1,
- LSM6DSO_XL_ODR_26Hz = 2,
- @@ -2640,7 +2786,8 @@ int32_t lsm6dso_xl_data_rate_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_xl_data_rate_get(stmdev_ctx_t *ctx,
- lsm6dso_odr_xl_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_250dps = 0,
- LSM6DSO_125dps = 1,
- LSM6DSO_500dps = 2,
- @@ -2652,7 +2799,8 @@ int32_t lsm6dso_gy_full_scale_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_gy_full_scale_get(stmdev_ctx_t *ctx,
- lsm6dso_fs_g_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_GY_ODR_OFF = 0,
- LSM6DSO_GY_ODR_12Hz5 = 1,
- LSM6DSO_GY_ODR_26Hz = 2,
- @@ -2674,7 +2822,8 @@ int32_t lsm6dso_block_data_update_set(stmdev_ctx_t *ctx, uint8_t val);
- int32_t lsm6dso_block_data_update_get(stmdev_ctx_t *ctx,
- uint8_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_LSb_1mg = 0,
- LSM6DSO_LSb_16mg = 1,
- } lsm6dso_usr_off_w_t;
- @@ -2683,7 +2832,8 @@ int32_t lsm6dso_xl_offset_weight_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_xl_offset_weight_get(stmdev_ctx_t *ctx,
- lsm6dso_usr_off_w_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_HIGH_PERFORMANCE_MD = 0,
- LSM6DSO_LOW_NORMAL_POWER_MD = 1,
- LSM6DSO_ULTRA_LOW_POWER_MD = 2,
- @@ -2693,7 +2843,8 @@ int32_t lsm6dso_xl_power_mode_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_xl_power_mode_get(stmdev_ctx_t *ctx,
- lsm6dso_xl_hm_mode_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_GY_HIGH_PERFORMANCE = 0,
- LSM6DSO_GY_NORMAL = 1,
- } lsm6dso_g_hm_mode_t;
- @@ -2733,7 +2884,8 @@ int32_t lsm6dso_timestamp_get(stmdev_ctx_t *ctx, uint8_t *val);
-
- int32_t lsm6dso_timestamp_raw_get(stmdev_ctx_t *ctx, uint32_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_NO_ROUND = 0,
- LSM6DSO_ROUND_XL = 1,
- LSM6DSO_ROUND_GY = 2,
- @@ -2761,7 +2913,8 @@ int32_t lsm6dso_steps_reset(stmdev_ctx_t *ctx);
- int32_t lsm6dso_odr_cal_reg_set(stmdev_ctx_t *ctx, uint8_t val);
- int32_t lsm6dso_odr_cal_reg_get(stmdev_ctx_t *ctx, uint8_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_USER_BANK = 0,
- LSM6DSO_SENSOR_HUB_BANK = 1,
- LSM6DSO_EMBEDDED_FUNC_BANK = 2,
- @@ -2780,7 +2933,8 @@ int32_t lsm6dso_ln_pg_write(stmdev_ctx_t *ctx, uint16_t address,
- int32_t lsm6dso_ln_pg_read(stmdev_ctx_t *ctx, uint16_t address,
- uint8_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_DRDY_LATCHED = 0,
- LSM6DSO_DRDY_PULSED = 1,
- } lsm6dso_dataready_pulsed_t;
- @@ -2800,7 +2954,8 @@ int32_t lsm6dso_auto_increment_get(stmdev_ctx_t *ctx, uint8_t *val);
- int32_t lsm6dso_boot_set(stmdev_ctx_t *ctx, uint8_t val);
- int32_t lsm6dso_boot_get(stmdev_ctx_t *ctx, uint8_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_XL_ST_DISABLE = 0,
- LSM6DSO_XL_ST_POSITIVE = 1,
- LSM6DSO_XL_ST_NEGATIVE = 2,
- @@ -2810,7 +2965,8 @@ int32_t lsm6dso_xl_self_test_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_xl_self_test_get(stmdev_ctx_t *ctx,
- lsm6dso_st_xl_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_GY_ST_DISABLE = 0,
- LSM6DSO_GY_ST_POSITIVE = 1,
- LSM6DSO_GY_ST_NEGATIVE = 3,
- @@ -2831,7 +2987,8 @@ int32_t lsm6dso_filter_settling_mask_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_filter_settling_mask_get(stmdev_ctx_t *ctx,
- uint8_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_ULTRA_LIGHT = 0,
- LSM6DSO_VERY_LIGHT = 1,
- LSM6DSO_LIGHT = 2,
- @@ -2849,7 +3006,8 @@ int32_t lsm6dso_gy_lp1_bandwidth_get(stmdev_ctx_t *ctx,
- int32_t lsm6dso_xl_lp2_on_6d_set(stmdev_ctx_t *ctx, uint8_t val);
- int32_t lsm6dso_xl_lp2_on_6d_get(stmdev_ctx_t *ctx, uint8_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_HP_PATH_DISABLE_ON_OUT = 0x00,
- LSM6DSO_SLOPE_ODR_DIV_4 = 0x10,
- LSM6DSO_HP_ODR_DIV_10 = 0x11,
- @@ -2882,7 +3040,8 @@ int32_t lsm6dso_xl_hp_path_on_out_get(stmdev_ctx_t *ctx,
- int32_t lsm6dso_xl_fast_settling_set(stmdev_ctx_t *ctx, uint8_t val);
- int32_t lsm6dso_xl_fast_settling_get(stmdev_ctx_t *ctx, uint8_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_USE_SLOPE = 0,
- LSM6DSO_USE_HPF = 1,
- } lsm6dso_slope_fds_t;
- @@ -2891,7 +3050,8 @@ int32_t lsm6dso_xl_hp_path_internal_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_xl_hp_path_internal_get(stmdev_ctx_t *ctx,
- lsm6dso_slope_fds_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_HP_FILTER_NONE = 0x00,
- LSM6DSO_HP_FILTER_16mHz = 0x80,
- LSM6DSO_HP_FILTER_65mHz = 0x81,
- @@ -2903,7 +3063,8 @@ int32_t lsm6dso_gy_hp_path_internal_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_gy_hp_path_internal_get(stmdev_ctx_t *ctx,
- lsm6dso_hpm_g_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_AUX_PULL_UP_DISC = 0,
- LSM6DSO_AUX_PULL_UP_CONNECT = 1,
- } lsm6dso_ois_pu_dis_t;
- @@ -2912,7 +3073,8 @@ int32_t lsm6dso_aux_sdo_ocs_mode_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_aux_sdo_ocs_mode_get(stmdev_ctx_t *ctx,
- lsm6dso_ois_pu_dis_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_AUX_ON = 1,
- LSM6DSO_AUX_ON_BY_AUX_INTERFACE = 0,
- } lsm6dso_ois_on_t;
- @@ -2921,7 +3083,8 @@ int32_t lsm6dso_aux_pw_on_ctrl_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_aux_pw_on_ctrl_get(stmdev_ctx_t *ctx,
- lsm6dso_ois_on_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_USE_SAME_XL_FS = 0,
- LSM6DSO_USE_DIFFERENT_XL_FS = 1,
- } lsm6dso_xl_fs_mode_t;
- @@ -2942,7 +3105,8 @@ int32_t lsm6dso_aux_gy_flag_data_ready_get(stmdev_ctx_t *ctx,
- int32_t lsm6dso_aux_gy_flag_settling_get(stmdev_ctx_t *ctx,
- uint8_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_AUX_XL_DISABLE = 0,
- LSM6DSO_AUX_XL_POS = 1,
- LSM6DSO_AUX_XL_NEG = 2,
- @@ -2952,7 +3116,8 @@ int32_t lsm6dso_aux_xl_self_test_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_aux_xl_self_test_get(stmdev_ctx_t *ctx,
- lsm6dso_st_xl_ois_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_AUX_DEN_ACTIVE_LOW = 0,
- LSM6DSO_AUX_DEN_ACTIVE_HIGH = 1,
- } lsm6dso_den_lh_ois_t;
- @@ -2961,7 +3126,8 @@ int32_t lsm6dso_aux_den_polarity_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_aux_den_polarity_get(stmdev_ctx_t *ctx,
- lsm6dso_den_lh_ois_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_AUX_DEN_DISABLE = 0,
- LSM6DSO_AUX_DEN_LEVEL_LATCH = 3,
- LSM6DSO_AUX_DEN_LEVEL_TRIG = 2,
- @@ -2974,7 +3140,8 @@ int32_t lsm6dso_aux_den_mode_get(stmdev_ctx_t *ctx,
- int32_t lsm6dso_aux_drdy_on_int2_set(stmdev_ctx_t *ctx, uint8_t val);
- int32_t lsm6dso_aux_drdy_on_int2_get(stmdev_ctx_t *ctx, uint8_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_AUX_DISABLE = 0,
- LSM6DSO_MODE_3_GY = 1,
- LSM6DSO_MODE_4_GY_XL = 3,
- @@ -2984,7 +3151,8 @@ int32_t lsm6dso_aux_mode_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_aux_mode_get(stmdev_ctx_t *ctx,
- lsm6dso_ois_en_spi2_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_250dps_AUX = 0,
- LSM6DSO_125dps_AUX = 1,
- LSM6DSO_500dps_AUX = 2,
- @@ -2996,7 +3164,8 @@ int32_t lsm6dso_aux_gy_full_scale_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_aux_gy_full_scale_get(stmdev_ctx_t *ctx,
- lsm6dso_fs_g_ois_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_AUX_SPI_4_WIRE = 0,
- LSM6DSO_AUX_SPI_3_WIRE = 1,
- } lsm6dso_sim_ois_t;
- @@ -3005,7 +3174,8 @@ int32_t lsm6dso_aux_spi_mode_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_aux_spi_mode_get(stmdev_ctx_t *ctx,
- lsm6dso_sim_ois_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_351Hz39 = 0,
- LSM6DSO_236Hz63 = 1,
- LSM6DSO_172Hz70 = 2,
- @@ -3016,7 +3186,8 @@ int32_t lsm6dso_aux_gy_lp1_bandwidth_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_aux_gy_lp1_bandwidth_get(stmdev_ctx_t *ctx,
- lsm6dso_ftype_ois_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_AUX_HP_DISABLE = 0x00,
- LSM6DSO_AUX_HP_Hz016 = 0x10,
- LSM6DSO_AUX_HP_Hz065 = 0x11,
- @@ -3028,7 +3199,8 @@ int32_t lsm6dso_aux_gy_hp_bandwidth_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_aux_gy_hp_bandwidth_get(stmdev_ctx_t *ctx,
- lsm6dso_hpm_ois_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_ENABLE_CLAMP = 0,
- LSM6DSO_DISABLE_CLAMP = 1,
- } lsm6dso_st_ois_clampdis_t;
- @@ -3037,7 +3209,8 @@ int32_t lsm6dso_aux_gy_clamp_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_aux_gy_clamp_get(stmdev_ctx_t *ctx,
- lsm6dso_st_ois_clampdis_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_AUX_GY_DISABLE = 0,
- LSM6DSO_AUX_GY_POS = 1,
- LSM6DSO_AUX_GY_NEG = 3,
- @@ -3047,7 +3220,8 @@ int32_t lsm6dso_aux_gy_self_test_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_aux_gy_self_test_get(stmdev_ctx_t *ctx,
- lsm6dso_st_ois_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_289Hz = 0,
- LSM6DSO_258Hz = 1,
- LSM6DSO_120Hz = 2,
- @@ -3062,7 +3236,8 @@ int32_t lsm6dso_aux_xl_bandwidth_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_aux_xl_bandwidth_get(stmdev_ctx_t *ctx,
- lsm6dso_filter_xl_conf_ois_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_AUX_2g = 0,
- LSM6DSO_AUX_16g = 1,
- LSM6DSO_AUX_4g = 2,
- @@ -3073,7 +3248,8 @@ int32_t lsm6dso_aux_xl_full_scale_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_aux_xl_full_scale_get(stmdev_ctx_t *ctx,
- lsm6dso_fs_xl_ois_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_PULL_UP_DISC = 0,
- LSM6DSO_PULL_UP_CONNECT = 1,
- } lsm6dso_sdo_pu_en_t;
- @@ -3082,14 +3258,16 @@ int32_t lsm6dso_sdo_sa0_mode_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_sdo_sa0_mode_get(stmdev_ctx_t *ctx,
- lsm6dso_sdo_pu_en_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_SPI_4_WIRE = 0,
- LSM6DSO_SPI_3_WIRE = 1,
- } lsm6dso_sim_t;
- int32_t lsm6dso_spi_mode_set(stmdev_ctx_t *ctx, lsm6dso_sim_t val);
- int32_t lsm6dso_spi_mode_get(stmdev_ctx_t *ctx, lsm6dso_sim_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_I2C_ENABLE = 0,
- LSM6DSO_I2C_DISABLE = 1,
- } lsm6dso_i2c_disable_t;
- @@ -3098,7 +3276,8 @@ int32_t lsm6dso_i2c_interface_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_i2c_interface_get(stmdev_ctx_t *ctx,
- lsm6dso_i2c_disable_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_I3C_DISABLE = 0x80,
- LSM6DSO_I3C_ENABLE_T_50us = 0x00,
- LSM6DSO_I3C_ENABLE_T_2us = 0x01,
- @@ -3110,7 +3289,8 @@ int32_t lsm6dso_i3c_disable_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_i3c_disable_get(stmdev_ctx_t *ctx,
- lsm6dso_i3c_disable_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_PULL_DOWN_DISC = 0,
- LSM6DSO_PULL_DOWN_CONNECT = 1,
- } lsm6dso_int1_pd_en_t;
- @@ -3119,14 +3299,16 @@ int32_t lsm6dso_int1_mode_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_int1_mode_get(stmdev_ctx_t *ctx,
- lsm6dso_int1_pd_en_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_PUSH_PULL = 0,
- LSM6DSO_OPEN_DRAIN = 1,
- } lsm6dso_pp_od_t;
- int32_t lsm6dso_pin_mode_set(stmdev_ctx_t *ctx, lsm6dso_pp_od_t val);
- int32_t lsm6dso_pin_mode_get(stmdev_ctx_t *ctx, lsm6dso_pp_od_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_ACTIVE_HIGH = 0,
- LSM6DSO_ACTIVE_LOW = 1,
- } lsm6dso_h_lactive_t;
- @@ -3138,7 +3320,8 @@ int32_t lsm6dso_pin_polarity_get(stmdev_ctx_t *ctx,
- int32_t lsm6dso_all_on_int1_set(stmdev_ctx_t *ctx, uint8_t val);
- int32_t lsm6dso_all_on_int1_get(stmdev_ctx_t *ctx, uint8_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_ALL_INT_PULSED = 0,
- LSM6DSO_BASE_LATCHED_EMB_PULSED = 1,
- LSM6DSO_BASE_PULSED_EMB_LATCHED = 2,
- @@ -3149,7 +3332,8 @@ int32_t lsm6dso_int_notification_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_int_notification_get(stmdev_ctx_t *ctx,
- lsm6dso_lir_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_LSb_FS_DIV_64 = 0,
- LSM6DSO_LSb_FS_DIV_256 = 1,
- } lsm6dso_wake_ths_w_t;
- @@ -3172,7 +3356,8 @@ int32_t lsm6dso_wkup_dur_get(stmdev_ctx_t *ctx, uint8_t *val);
- int32_t lsm6dso_gy_sleep_mode_set(stmdev_ctx_t *ctx, uint8_t val);
- int32_t lsm6dso_gy_sleep_mode_get(stmdev_ctx_t *ctx, uint8_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_DRIVE_SLEEP_CHG_EVENT = 0,
- LSM6DSO_DRIVE_SLEEP_STATUS = 1,
- } lsm6dso_sleep_status_on_int_t;
- @@ -3181,7 +3366,8 @@ int32_t lsm6dso_act_pin_notification_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_act_pin_notification_get(stmdev_ctx_t *ctx,
- lsm6dso_sleep_status_on_int_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_XL_AND_GY_NOT_AFFECTED = 0,
- LSM6DSO_XL_12Hz5_GY_NOT_AFFECTED = 1,
- LSM6DSO_XL_12Hz5_GY_SLEEP = 2,
- @@ -3213,7 +3399,8 @@ int32_t lsm6dso_tap_detection_on_x_get(stmdev_ctx_t *ctx,
- int32_t lsm6dso_tap_threshold_x_set(stmdev_ctx_t *ctx, uint8_t val);
- int32_t lsm6dso_tap_threshold_x_get(stmdev_ctx_t *ctx, uint8_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_XYZ = 0,
- LSM6DSO_YXZ = 1,
- LSM6DSO_XZY = 2,
- @@ -3241,7 +3428,8 @@ int32_t lsm6dso_tap_quiet_get(stmdev_ctx_t *ctx, uint8_t *val);
- int32_t lsm6dso_tap_dur_set(stmdev_ctx_t *ctx, uint8_t val);
- int32_t lsm6dso_tap_dur_get(stmdev_ctx_t *ctx, uint8_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_ONLY_SINGLE = 0,
- LSM6DSO_BOTH_SINGLE_DOUBLE = 1,
- } lsm6dso_single_double_tap_t;
- @@ -3250,7 +3438,8 @@ int32_t lsm6dso_tap_mode_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_tap_mode_get(stmdev_ctx_t *ctx,
- lsm6dso_single_double_tap_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_DEG_80 = 0,
- LSM6DSO_DEG_70 = 1,
- LSM6DSO_DEG_60 = 2,
- @@ -3264,7 +3453,8 @@ int32_t lsm6dso_6d_threshold_get(stmdev_ctx_t *ctx,
- int32_t lsm6dso_4d_mode_set(stmdev_ctx_t *ctx, uint8_t val);
- int32_t lsm6dso_4d_mode_get(stmdev_ctx_t *ctx, uint8_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_FF_TSH_156mg = 0,
- LSM6DSO_FF_TSH_219mg = 1,
- LSM6DSO_FF_TSH_250mg = 2,
- @@ -3290,7 +3480,8 @@ int32_t lsm6dso_compression_algo_init_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_compression_algo_init_get(stmdev_ctx_t *ctx,
- uint8_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_CMP_DISABLE = 0x00,
- LSM6DSO_CMP_ALWAYS = 0x04,
- LSM6DSO_CMP_8_TO_1 = 0x05,
- @@ -3315,7 +3506,8 @@ int32_t lsm6dso_compression_algo_real_time_get(stmdev_ctx_t *ctx,
- int32_t lsm6dso_fifo_stop_on_wtm_set(stmdev_ctx_t *ctx, uint8_t val);
- int32_t lsm6dso_fifo_stop_on_wtm_get(stmdev_ctx_t *ctx, uint8_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_XL_NOT_BATCHED = 0,
- LSM6DSO_XL_BATCHED_AT_12Hz5 = 1,
- LSM6DSO_XL_BATCHED_AT_26Hz = 2,
- @@ -3334,7 +3526,8 @@ int32_t lsm6dso_fifo_xl_batch_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_fifo_xl_batch_get(stmdev_ctx_t *ctx,
- lsm6dso_bdr_xl_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_GY_NOT_BATCHED = 0,
- LSM6DSO_GY_BATCHED_AT_12Hz5 = 1,
- LSM6DSO_GY_BATCHED_AT_26Hz = 2,
- @@ -3353,7 +3546,8 @@ int32_t lsm6dso_fifo_gy_batch_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_fifo_gy_batch_get(stmdev_ctx_t *ctx,
- lsm6dso_bdr_gy_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_BYPASS_MODE = 0,
- LSM6DSO_FIFO_MODE = 1,
- LSM6DSO_STREAM_TO_FIFO_MODE = 3,
- @@ -3366,7 +3560,8 @@ int32_t lsm6dso_fifo_mode_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_fifo_mode_get(stmdev_ctx_t *ctx,
- lsm6dso_fifo_mode_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_TEMP_NOT_BATCHED = 0,
- LSM6DSO_TEMP_BATCHED_AT_1Hz6 = 1,
- LSM6DSO_TEMP_BATCHED_AT_12Hz5 = 2,
- @@ -3377,7 +3572,8 @@ int32_t lsm6dso_fifo_temp_batch_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_fifo_temp_batch_get(stmdev_ctx_t *ctx,
- lsm6dso_odr_t_batch_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_NO_DECIMATION = 0,
- LSM6DSO_DEC_1 = 1,
- LSM6DSO_DEC_8 = 2,
- @@ -3388,12 +3584,14 @@ int32_t lsm6dso_fifo_timestamp_decimation_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_fifo_timestamp_decimation_get(stmdev_ctx_t *ctx,
- lsm6dso_odr_ts_batch_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_XL_BATCH_EVENT = 0,
- LSM6DSO_GYRO_BATCH_EVENT = 1,
- } lsm6dso_trig_counter_bdr_t;
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_GYRO_NC_TAG = 1,
- LSM6DSO_XL_NC_TAG,
- LSM6DSO_TEMPERATURE_TAG,
- @@ -3460,7 +3658,8 @@ int32_t lsm6dso_sh_batch_slave_2_get(stmdev_ctx_t *ctx, uint8_t *val);
- int32_t lsm6dso_sh_batch_slave_3_set(stmdev_ctx_t *ctx, uint8_t val);
- int32_t lsm6dso_sh_batch_slave_3_get(stmdev_ctx_t *ctx, uint8_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_DEN_DISABLE = 0,
- LSM6DSO_LEVEL_FIFO = 6,
- LSM6DSO_LEVEL_LETCHED = 3,
- @@ -3472,7 +3671,8 @@ int32_t lsm6dso_den_mode_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_den_mode_get(stmdev_ctx_t *ctx,
- lsm6dso_den_mode_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_DEN_ACT_LOW = 0,
- LSM6DSO_DEN_ACT_HIGH = 1,
- } lsm6dso_den_lh_t;
- @@ -3481,7 +3681,8 @@ int32_t lsm6dso_den_polarity_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_den_polarity_get(stmdev_ctx_t *ctx,
- lsm6dso_den_lh_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_STAMP_IN_GY_DATA = 0,
- LSM6DSO_STAMP_IN_XL_DATA = 1,
- LSM6DSO_STAMP_IN_GY_XL_DATA = 2,
- @@ -3500,7 +3701,8 @@ int32_t lsm6dso_den_mark_axis_y_get(stmdev_ctx_t *ctx, uint8_t *val);
- int32_t lsm6dso_den_mark_axis_z_set(stmdev_ctx_t *ctx, uint8_t val);
- int32_t lsm6dso_den_mark_axis_z_get(stmdev_ctx_t *ctx, uint8_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_PEDO_BASE_MODE = 0x00,
- LSM6DSO_FALSE_STEP_REJ = 0x10,
- LSM6DSO_FALSE_STEP_REJ_ADV_MODE = 0x30,
- @@ -3522,7 +3724,8 @@ int32_t lsm6dso_pedo_steps_period_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_pedo_steps_period_get(stmdev_ctx_t *ctx,
- uint16_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_EVERY_STEP = 0,
- LSM6DSO_COUNT_OVERFLOW = 1,
- } lsm6dso_carry_count_en_t;
- @@ -3546,7 +3749,8 @@ int32_t lsm6dso_mag_offset_get(stmdev_ctx_t *ctx, int16_t *val);
- int32_t lsm6dso_mag_soft_iron_set(stmdev_ctx_t *ctx, int16_t *val);
- int32_t lsm6dso_mag_soft_iron_get(stmdev_ctx_t *ctx, int16_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_Z_EQ_Y = 0,
- LSM6DSO_Z_EQ_MIN_Y = 1,
- LSM6DSO_Z_EQ_X = 2,
- @@ -3559,7 +3763,8 @@ int32_t lsm6dso_mag_z_orient_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_mag_z_orient_get(stmdev_ctx_t *ctx,
- lsm6dso_mag_z_axis_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_Y_EQ_Y = 0,
- LSM6DSO_Y_EQ_MIN_Y = 1,
- LSM6DSO_Y_EQ_X = 2,
- @@ -3572,7 +3777,8 @@ int32_t lsm6dso_mag_y_orient_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_mag_y_orient_get(stmdev_ctx_t *ctx,
- lsm6dso_mag_y_axis_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_X_EQ_Y = 0,
- LSM6DSO_X_EQ_MIN_Y = 1,
- LSM6DSO_X_EQ_X = 2,
- @@ -3588,7 +3794,8 @@ int32_t lsm6dso_mag_x_orient_get(stmdev_ctx_t *ctx,
- int32_t lsm6dso_long_cnt_flag_data_ready_get(stmdev_ctx_t *ctx,
- uint8_t *val);
-
- -typedef struct {
- +typedef struct
- +{
- lsm6dso_fsm_enable_a_t fsm_enable_a;
- lsm6dso_fsm_enable_b_t fsm_enable_b;
- } lsm6dso_emb_fsm_enable_t;
- @@ -3600,7 +3807,8 @@ int32_t lsm6dso_fsm_enable_get(stmdev_ctx_t *ctx,
- int32_t lsm6dso_long_cnt_set(stmdev_ctx_t *ctx, uint16_t val);
- int32_t lsm6dso_long_cnt_get(stmdev_ctx_t *ctx, uint16_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_LC_NORMAL = 0,
- LSM6DSO_LC_CLEAR = 1,
- LSM6DSO_LC_CLEAR_DONE = 2,
- @@ -3610,7 +3818,8 @@ int32_t lsm6dso_long_clr_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_long_clr_get(stmdev_ctx_t *ctx,
- lsm6dso_fsm_lc_clr_t *val);
-
- -typedef struct {
- +typedef struct
- +{
- lsm6dso_fsm_outs1_t fsm_outs1;
- lsm6dso_fsm_outs2_t fsm_outs2;
- lsm6dso_fsm_outs3_t fsm_outs3;
- @@ -3631,7 +3840,8 @@ typedef struct {
- int32_t lsm6dso_fsm_out_get(stmdev_ctx_t *ctx,
- lsm6dso_fsm_out_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_ODR_FSM_12Hz5 = 0,
- LSM6DSO_ODR_FSM_26Hz = 1,
- LSM6DSO_ODR_FSM_52Hz = 2,
- @@ -3663,7 +3873,8 @@ int32_t lsm6dso_fsm_start_address_get(stmdev_ctx_t *ctx,
- int32_t lsm6dso_sh_read_data_raw_get(stmdev_ctx_t *ctx, uint8_t *val,
- uint8_t len);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_SLV_0 = 0,
- LSM6DSO_SLV_0_1 = 1,
- LSM6DSO_SLV_0_1_2 = 2,
- @@ -3677,7 +3888,8 @@ int32_t lsm6dso_sh_slave_connected_get(stmdev_ctx_t *ctx,
- int32_t lsm6dso_sh_master_set(stmdev_ctx_t *ctx, uint8_t val);
- int32_t lsm6dso_sh_master_get(stmdev_ctx_t *ctx, uint8_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_EXT_PULL_UP = 0,
- LSM6DSO_INTERNAL_PULL_UP = 1,
- } lsm6dso_shub_pu_en_t;
- @@ -3689,7 +3901,8 @@ int32_t lsm6dso_sh_pin_mode_get(stmdev_ctx_t *ctx,
- int32_t lsm6dso_sh_pass_through_set(stmdev_ctx_t *ctx, uint8_t val);
- int32_t lsm6dso_sh_pass_through_get(stmdev_ctx_t *ctx, uint8_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_EXT_ON_INT2_PIN = 1,
- LSM6DSO_XL_GY_DRDY = 0,
- } lsm6dso_start_config_t;
- @@ -3698,7 +3911,8 @@ int32_t lsm6dso_sh_syncro_mode_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_sh_syncro_mode_get(stmdev_ctx_t *ctx,
- lsm6dso_start_config_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_EACH_SH_CYCLE = 0,
- LSM6DSO_ONLY_FIRST_CYCLE = 1,
- } lsm6dso_write_once_t;
- @@ -3710,7 +3924,8 @@ int32_t lsm6dso_sh_write_mode_get(stmdev_ctx_t *ctx,
- int32_t lsm6dso_sh_reset_set(stmdev_ctx_t *ctx);
- int32_t lsm6dso_sh_reset_get(stmdev_ctx_t *ctx, uint8_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_SH_ODR_104Hz = 0,
- LSM6DSO_SH_ODR_52Hz = 1,
- LSM6DSO_SH_ODR_26Hz = 2,
- @@ -3721,7 +3936,8 @@ int32_t lsm6dso_sh_data_rate_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_sh_data_rate_get(stmdev_ctx_t *ctx,
- lsm6dso_shub_odr_t *val);
-
- -typedef struct {
- +typedef struct
- +{
- uint8_t slv0_add;
- uint8_t slv0_subadd;
- uint8_t slv0_data;
- @@ -3729,7 +3945,8 @@ typedef struct {
- int32_t lsm6dso_sh_cfg_write(stmdev_ctx_t *ctx,
- lsm6dso_sh_cfg_write_t *val);
-
- -typedef struct {
- +typedef struct
- +{
- uint8_t slv_add;
- uint8_t slv_subadd;
- uint8_t slv_len;
- @@ -3747,35 +3964,44 @@ int32_t lsm6dso_sh_status_get(stmdev_ctx_t *ctx,
- lsm6dso_status_master_t *val);
-
-
- -typedef struct {
- +typedef struct
- +{
- uint8_t ui;
- uint8_t aux;
- } lsm6dso_id_t;
- int32_t lsm6dso_id_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- lsm6dso_id_t *val);
-
- -typedef struct {
- - enum {
- - LSM6DSO_SEL_BY_HW = 0x00, /* bus mode select by HW (SPI 3W disable) */
- - LSM6DSO_SPI_4W = 0x06, /* Only SPI: SDO / SDI separated pins */
- - LSM6DSO_SPI_3W = 0x07, /* Only SPI: SDO / SDI share the same pin */
- - LSM6DSO_I2C = 0x04, /* Only I2C */
- - LSM6DSO_I3C_T_50us = 0x02, /* I3C: available time equal to 50 μs */
- - LSM6DSO_I3C_T_2us = 0x12, /* I3C: available time equal to 2 μs */
- - LSM6DSO_I3C_T_1ms = 0x22, /* I3C: available time equal to 1 ms */
- - LSM6DSO_I3C_T_25ms = 0x32, /* I3C: available time equal to 25 ms */
- - } ui_bus_md;
- - enum {
- - LSM6DSO_SPI_4W_AUX = 0x00,
- - LSM6DSO_SPI_3W_AUX = 0x01,
- - } aux_bus_md;
- +typedef enum
- +{
- + LSM6DSO_SEL_BY_HW = 0x00, /* bus mode select by HW (SPI 3W disable) */
- + LSM6DSO_SPI_4W = 0x06, /* Only SPI: SDO / SDI separated pins */
- + LSM6DSO_SPI_3W = 0x07, /* Only SPI: SDO / SDI share the same pin */
- + LSM6DSO_I2C = 0x04, /* Only I2C */
- + LSM6DSO_I3C_T_50us = 0x02, /* I3C: available time equal to 50 us */
- + LSM6DSO_I3C_T_2us = 0x12, /* I3C: available time equal to 2 us */
- + LSM6DSO_I3C_T_1ms = 0x22, /* I3C: available time equal to 1 ms */
- + LSM6DSO_I3C_T_25ms = 0x32, /* I3C: available time equal to 25 ms */
- +} lsm6dso_ui_bus_md_t;
- +
- +typedef enum
- +{
- + LSM6DSO_SPI_4W_AUX = 0x00,
- + LSM6DSO_SPI_3W_AUX = 0x01,
- +} lsm6dso_aux_bus_md_t;
- +
- +typedef struct
- +{
- + lsm6dso_ui_bus_md_t ui_bus_md;
- + lsm6dso_aux_bus_md_t aux_bus_md;
- } lsm6dso_bus_mode_t;
- int32_t lsm6dso_bus_mode_set(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- lsm6dso_bus_mode_t val);
- int32_t lsm6dso_bus_mode_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- lsm6dso_bus_mode_t *val);
-
- -typedef enum {
- +typedef enum
- +{
- LSM6DSO_DRV_RDY = 0x00, /* Initialize the device for driver usage */
- LSM6DSO_BOOT = 0x01, /* Restore calib. param. ( it takes 10ms ) */
- LSM6DSO_RESET = 0x02, /* Reset configuration registers */
- @@ -3787,7 +4013,8 @@ typedef enum {
- } lsm6dso_init_t;
- int32_t lsm6dso_init_set(stmdev_ctx_t *ctx, lsm6dso_init_t val);
-
- -typedef struct {
- +typedef struct
- +{
- uint8_t sw_reset :
- 1; /* Restoring configuration registers */
- uint8_t boot : 1; /* Restoring calibration parameters */
- @@ -3802,7 +4029,8 @@ uint8_t ois_gyro_settling :
- int32_t lsm6dso_status_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- lsm6dso_status_t *val);
-
- -typedef struct {
- +typedef struct
- +{
- uint8_t sdo_sa0_pull_up : 1; /* 1 = pull-up on SDO/SA0 pin */
- uint8_t aux_sdo_ocs_pull_up :
- 1; /* 1 = pull-up on OCS_Aux/SDO_Aux pins */
- @@ -3815,7 +4043,8 @@ int32_t lsm6dso_pin_conf_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_pin_conf_get(stmdev_ctx_t *ctx,
- lsm6dso_pin_conf_t *val);
-
- -typedef struct {
- +typedef struct
- +{
- uint8_t active_low : 1; /* 1 = active low / 0 = active high */
- uint8_t base_latched :
- 1; /* base functions are: FF, WU, 6D, Tap, Act/Inac */
- @@ -3827,7 +4056,8 @@ int32_t lsm6dso_interrupt_mode_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_interrupt_mode_get(stmdev_ctx_t *ctx,
- lsm6dso_int_mode_t *val);
-
- -typedef struct {
- +typedef struct
- +{
- uint8_t drdy_xl : 1; /* Accelerometer data ready */
- uint8_t drdy_g : 1; /* Gyroscope data ready */
- uint8_t drdy_temp :
- @@ -3885,7 +4115,8 @@ int32_t lsm6dso_pin_int1_route_set(stmdev_ctx_t *ctx,
- int32_t lsm6dso_pin_int1_route_get(stmdev_ctx_t *ctx,
- lsm6dso_pin_int1_route_t *val);
-
- -typedef struct {
- +typedef struct
- +{
- uint8_t drdy_ois : 1; /* OIS chain data ready */
- uint8_t drdy_xl : 1; /* Accelerometer data ready */
- uint8_t drdy_g : 1; /* Gyroscope data ready */
- @@ -3940,7 +4171,8 @@ int32_t lsm6dso_pin_int2_route_get(stmdev_ctx_t *ctx,
- stmdev_ctx_t *aux_ctx,
- lsm6dso_pin_int2_route_t *val);
-
- -typedef struct {
- +typedef struct
- +{
- uint8_t drdy_xl : 1; /* Accelerometer data ready */
- uint8_t drdy_g : 1; /* Gyroscope data ready */
- uint8_t drdy_temp : 1; /* Temperature data ready */
- @@ -4030,146 +4262,196 @@ uint8_t fifo_bdr :
- int32_t lsm6dso_all_sources_get(stmdev_ctx_t *ctx,
- lsm6dso_all_sources_t *val);
-
- -typedef struct {
- +typedef struct
- +{
- uint8_t odr_fine_tune;
- } dev_cal_t;
- int32_t lsm6dso_calibration_get(stmdev_ctx_t *ctx, dev_cal_t *val);
-
- -typedef struct {
- - struct {
- - struct {
- - enum {
- - LSM6DSO_XL_UI_OFF = 0x00, /* in power down */
- - LSM6DSO_XL_UI_1Hz6_LP = 0x1B, /* @1Hz6 (low power) */
- - LSM6DSO_XL_UI_1Hz6_ULP = 0x2B, /* @1Hz6 (ultra low/Gy, OIS imu off) */
- - LSM6DSO_XL_UI_12Hz5_HP = 0x01, /* @12Hz5 (high performance) */
- - LSM6DSO_XL_UI_12Hz5_LP = 0x11, /* @12Hz5 (low power) */
- - LSM6DSO_XL_UI_12Hz5_ULP = 0x21, /* @12Hz5 (ultra low/Gy, OIS imu off) */
- - LSM6DSO_XL_UI_26Hz_HP = 0x02, /* @26Hz (high performance) */
- - LSM6DSO_XL_UI_26Hz_LP = 0x12, /* @26Hz (low power) */
- - LSM6DSO_XL_UI_26Hz_ULP = 0x22, /* @26Hz (ultra low/Gy, OIS imu off) */
- - LSM6DSO_XL_UI_52Hz_HP = 0x03, /* @52Hz (high performance) */
- - LSM6DSO_XL_UI_52Hz_LP = 0x13, /* @52Hz (low power) */
- - LSM6DSO_XL_UI_52Hz_ULP = 0x23, /* @52Hz (ultra low/Gy, OIS imu off) */
- - LSM6DSO_XL_UI_104Hz_HP = 0x04, /* @104Hz (high performance) */
- - LSM6DSO_XL_UI_104Hz_NM = 0x14, /* @104Hz (normal mode) */
- - LSM6DSO_XL_UI_104Hz_ULP = 0x24, /* @104Hz (ultra low/Gy, OIS imu off) */
- - LSM6DSO_XL_UI_208Hz_HP = 0x05, /* @208Hz (high performance) */
- - LSM6DSO_XL_UI_208Hz_NM = 0x15, /* @208Hz (normal mode) */
- - LSM6DSO_XL_UI_208Hz_ULP = 0x25, /* @208Hz (ultra low/Gy, OIS imu off) */
- - LSM6DSO_XL_UI_416Hz_HP = 0x06, /* @416Hz (high performance) */
- - LSM6DSO_XL_UI_833Hz_HP = 0x07, /* @833Hz (high performance) */
- - LSM6DSO_XL_UI_1667Hz_HP = 0x08, /* @1kHz66 (high performance) */
- - LSM6DSO_XL_UI_3333Hz_HP = 0x09, /* @3kHz33 (high performance) */
- - LSM6DSO_XL_UI_6667Hz_HP = 0x0A, /* @6kHz66 (high performance) */
- - } odr;
- - enum {
- - LSM6DSO_XL_UI_2g = 0,
- - LSM6DSO_XL_UI_4g = 2,
- - LSM6DSO_XL_UI_8g = 3,
- - LSM6DSO_XL_UI_16g = 1, /* OIS full scale is also forced to be 16g */
- - } fs;
- +typedef enum
- +{
- + LSM6DSO_XL_UI_OFF = 0x00, /* in power down */
- + LSM6DSO_XL_UI_1Hz6_LP = 0x1B, /* @1Hz6 (low power) */
- + LSM6DSO_XL_UI_1Hz6_ULP = 0x2B, /* @1Hz6 (ultra low/Gy, OIS imu off) */
- + LSM6DSO_XL_UI_12Hz5_HP = 0x01, /* @12Hz5 (high performance) */
- + LSM6DSO_XL_UI_12Hz5_LP = 0x11, /* @12Hz5 (low power) */
- + LSM6DSO_XL_UI_12Hz5_ULP = 0x21, /* @12Hz5 (ultra low/Gy, OIS imu off) */
- + LSM6DSO_XL_UI_26Hz_HP = 0x02, /* @26Hz (high performance) */
- + LSM6DSO_XL_UI_26Hz_LP = 0x12, /* @26Hz (low power) */
- + LSM6DSO_XL_UI_26Hz_ULP = 0x22, /* @26Hz (ultra low/Gy, OIS imu off) */
- + LSM6DSO_XL_UI_52Hz_HP = 0x03, /* @52Hz (high performance) */
- + LSM6DSO_XL_UI_52Hz_LP = 0x13, /* @52Hz (low power) */
- + LSM6DSO_XL_UI_52Hz_ULP = 0x23, /* @52Hz (ultra low/Gy, OIS imu off) */
- + LSM6DSO_XL_UI_104Hz_HP = 0x04, /* @104Hz (high performance) */
- + LSM6DSO_XL_UI_104Hz_NM = 0x14, /* @104Hz (normal mode) */
- + LSM6DSO_XL_UI_104Hz_ULP = 0x24, /* @104Hz (ultra low/Gy, OIS imu off) */
- + LSM6DSO_XL_UI_208Hz_HP = 0x05, /* @208Hz (high performance) */
- + LSM6DSO_XL_UI_208Hz_NM = 0x15, /* @208Hz (normal mode) */
- + LSM6DSO_XL_UI_208Hz_ULP = 0x25, /* @208Hz (ultra low/Gy, OIS imu off) */
- + LSM6DSO_XL_UI_416Hz_HP = 0x06, /* @416Hz (high performance) */
- + LSM6DSO_XL_UI_833Hz_HP = 0x07, /* @833Hz (high performance) */
- + LSM6DSO_XL_UI_1667Hz_HP = 0x08, /* @1kHz66 (high performance) */
- + LSM6DSO_XL_UI_3333Hz_HP = 0x09, /* @3kHz33 (high performance) */
- + LSM6DSO_XL_UI_6667Hz_HP = 0x0A, /* @6kHz66 (high performance) */
- +} lsm6dso_odr_xl_ui_t;
- +
- +typedef enum
- +{
- + LSM6DSO_XL_UI_2g = 0,
- + LSM6DSO_XL_UI_4g = 2,
- + LSM6DSO_XL_UI_8g = 3,
- + LSM6DSO_XL_UI_16g = 1, /* OIS full scale is also forced to be 16g */
- +} lsm6dso_fs_xl_ui_t;
- +
- +typedef enum
- +{
- + LSM6DSO_GY_UI_OFF = 0x00, /* gy in power down */
- + LSM6DSO_GY_UI_12Hz5_LP = 0x11, /* gy @12Hz5 (low power) */
- + LSM6DSO_GY_UI_12Hz5_HP = 0x01, /* gy @12Hz5 (high performance) */
- + LSM6DSO_GY_UI_26Hz_LP = 0x12, /* gy @26Hz (low power) */
- + LSM6DSO_GY_UI_26Hz_HP = 0x02, /* gy @26Hz (high performance) */
- + LSM6DSO_GY_UI_52Hz_LP = 0x13, /* gy @52Hz (low power) */
- + LSM6DSO_GY_UI_52Hz_HP = 0x03, /* gy @52Hz (high performance) */
- + LSM6DSO_GY_UI_104Hz_NM = 0x14, /* gy @104Hz (low power) */
- + LSM6DSO_GY_UI_104Hz_HP = 0x04, /* gy @104Hz (high performance) */
- + LSM6DSO_GY_UI_208Hz_NM = 0x15, /* gy @208Hz (low power) */
- + LSM6DSO_GY_UI_208Hz_HP = 0x05, /* gy @208Hz (high performance) */
- + LSM6DSO_GY_UI_416Hz_HP = 0x06, /* gy @416Hz (high performance) */
- + LSM6DSO_GY_UI_833Hz_HP = 0x07, /* gy @833Hz (high performance) */
- + LSM6DSO_GY_UI_1667Hz_HP = 0x08, /* gy @1kHz66 (high performance) */
- + LSM6DSO_GY_UI_3333Hz_HP = 0x09, /* gy @3kHz33 (high performance) */
- + LSM6DSO_GY_UI_6667Hz_HP = 0x0A, /* gy @6kHz66 (high performance) */
- +} lsm6dso_odr_g_ui_t;
- +
- +typedef enum
- +{
- + LSM6DSO_GY_UI_250dps = 0,
- + LSM6DSO_GY_UI_125dps = 1,
- + LSM6DSO_GY_UI_500dps = 2,
- + LSM6DSO_GY_UI_1000dps = 4,
- + LSM6DSO_GY_UI_2000dps = 6,
- +} lsm6dso_fs_g_ui_t;
- +
- +typedef enum
- +{
- + LSM6DSO_OIS_ONLY_AUX = 0x00, /* Auxiliary SPI full control */
- + LSM6DSO_OIS_MIXED = 0x01, /* Enabling by UI / read-config by AUX */
- +} lsm6dso_ctrl_md_t;
- +
- +typedef enum
- +{
- + LSM6DSO_XL_OIS_OFF = 0x00, /* in power down */
- + LSM6DSO_XL_OIS_6667Hz_HP = 0x01, /* @6kHz OIS imu active/NO ULP on UI */
- +} lsm6dso_odr_xl_ois_noaux_t;
- +
- +typedef enum
- +{
- + LSM6DSO_XL_OIS_2g = 0,
- + LSM6DSO_XL_OIS_4g = 2,
- + LSM6DSO_XL_OIS_8g = 3,
- + LSM6DSO_XL_OIS_16g = 1, /* UI full scale is also forced to be 16g */
- +} lsm6dso_fs_xl_ois_noaux_t;
- +
- +typedef enum
- +{
- + LSM6DSO_GY_OIS_OFF = 0x00, /* in power down */
- + LSM6DSO_GY_OIS_6667Hz_HP = 0x01, /* @6kHz No Ultra Low Power*/
- +} lsm6dso_odr_g_ois_noaux_t;
- +
- +typedef enum
- +{
- + LSM6DSO_GY_OIS_250dps = 0,
- + LSM6DSO_GY_OIS_125dps = 1,
- + LSM6DSO_GY_OIS_500dps = 2,
- + LSM6DSO_GY_OIS_1000dps = 4,
- + LSM6DSO_GY_OIS_2000dps = 6,
- +} lsm6dso_fs_g_ois_noaux_t;
- +
- +typedef enum
- +{
- + LSM6DSO_FSM_DISABLE = 0x00,
- + LSM6DSO_FSM_XL = 0x01,
- + LSM6DSO_FSM_GY = 0x02,
- + LSM6DSO_FSM_XL_GY = 0x03,
- +} lsm6dso_sens_fsm_t;
- +
- +typedef enum
- +{
- + LSM6DSO_FSM_12Hz5 = 0x00,
- + LSM6DSO_FSM_26Hz = 0x01,
- + LSM6DSO_FSM_52Hz = 0x02,
- + LSM6DSO_FSM_104Hz = 0x03,
- +} lsm6dso_odr_fsm_t;
- +
- +typedef struct
- +{
- + struct
- + {
- + struct
- + {
- + lsm6dso_odr_xl_ui_t odr;
- + lsm6dso_fs_xl_ui_t fs;
- } xl;
- - struct {
- - enum {
- - LSM6DSO_GY_UI_OFF = 0x00, /* gy in power down */
- - LSM6DSO_GY_UI_12Hz5_LP = 0x11, /* gy @12Hz5 (low power) */
- - LSM6DSO_GY_UI_12Hz5_HP = 0x01, /* gy @12Hz5 (high performance) */
- - LSM6DSO_GY_UI_26Hz_LP = 0x12, /* gy @26Hz (low power) */
- - LSM6DSO_GY_UI_26Hz_HP = 0x02, /* gy @26Hz (high performance) */
- - LSM6DSO_GY_UI_52Hz_LP = 0x13, /* gy @52Hz (low power) */
- - LSM6DSO_GY_UI_52Hz_HP = 0x03, /* gy @52Hz (high performance) */
- - LSM6DSO_GY_UI_104Hz_NM = 0x14, /* gy @104Hz (low power) */
- - LSM6DSO_GY_UI_104Hz_HP = 0x04, /* gy @104Hz (high performance) */
- - LSM6DSO_GY_UI_208Hz_NM = 0x15, /* gy @208Hz (low power) */
- - LSM6DSO_GY_UI_208Hz_HP = 0x05, /* gy @208Hz (high performance) */
- - LSM6DSO_GY_UI_416Hz_HP = 0x06, /* gy @416Hz (high performance) */
- - LSM6DSO_GY_UI_833Hz_HP = 0x07, /* gy @833Hz (high performance) */
- - LSM6DSO_GY_UI_1667Hz_HP = 0x08, /* gy @1kHz66 (high performance) */
- - LSM6DSO_GY_UI_3333Hz_HP = 0x09, /* gy @3kHz33 (high performance) */
- - LSM6DSO_GY_UI_6667Hz_HP = 0x0A, /* gy @6kHz66 (high performance) */
- - } odr;
- - enum {
- - LSM6DSO_GY_UI_250dps = 0,
- - LSM6DSO_GY_UI_125dps = 1,
- - LSM6DSO_GY_UI_500dps = 2,
- - LSM6DSO_GY_UI_1000dps = 4,
- - LSM6DSO_GY_UI_2000dps = 6,
- - } fs;
- + struct
- + {
- + lsm6dso_odr_g_ui_t odr;
- + lsm6dso_fs_g_ui_t fs;
- } gy;
- } ui;
- - struct {
- - enum {
- - LSM6DSO_OIS_ONLY_AUX = 0x00, /* Auxiliary SPI full control */
- - LSM6DSO_OIS_MIXED = 0x01, /* Enabling by UI / read-config by AUX */
- - } ctrl_md;
- - struct {
- - enum {
- - LSM6DSO_XL_OIS_OFF = 0x00, /* in power down */
- - LSM6DSO_XL_OIS_6667Hz_HP = 0x01, /* @6kHz OIS imu active/NO ULP on UI */
- - } odr;
- - enum {
- - LSM6DSO_XL_OIS_2g = 0,
- - LSM6DSO_XL_OIS_4g = 2,
- - LSM6DSO_XL_OIS_8g = 3,
- - LSM6DSO_XL_OIS_16g = 1, /* UI full scale is also forced to be 16g */
- - } fs;
- + struct
- + {
- + lsm6dso_ctrl_md_t ctrl_md;
- + struct
- + {
- + lsm6dso_odr_xl_ois_noaux_t odr;
- + lsm6dso_fs_xl_ois_noaux_t fs;
- } xl;
- - struct {
- - enum {
- - LSM6DSO_GY_OIS_OFF = 0x00, /* in power down */
- - LSM6DSO_GY_OIS_6667Hz_HP = 0x01, /* @6kHz No Ultra Low Power*/
- - } odr;
- - enum {
- - LSM6DSO_GY_OIS_250dps = 0,
- - LSM6DSO_GY_OIS_125dps = 1,
- - LSM6DSO_GY_OIS_500dps = 2,
- - LSM6DSO_GY_OIS_1000dps = 4,
- - LSM6DSO_GY_OIS_2000dps = 6,
- - } fs;
- + struct
- + {
- + lsm6dso_odr_g_ois_noaux_t odr;
- + lsm6dso_fs_g_ois_noaux_t fs;
- } gy;
- } ois;
- - struct {
- - enum {
- - LSM6DSO_FSM_DISABLE = 0x00,
- - LSM6DSO_FSM_XL = 0x01,
- - LSM6DSO_FSM_GY = 0x02,
- - LSM6DSO_FSM_XL_GY = 0x03,
- - } sens;
- - enum {
- - LSM6DSO_FSM_12Hz5 = 0x00,
- - LSM6DSO_FSM_26Hz = 0x01,
- - LSM6DSO_FSM_52Hz = 0x02,
- - LSM6DSO_FSM_104Hz = 0x03,
- - } odr;
- + struct
- + {
- + lsm6dso_sens_fsm_t sens;
- + lsm6dso_odr_fsm_t odr;
- } fsm;
- } lsm6dso_md_t;
- int32_t lsm6dso_mode_set(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- lsm6dso_md_t *val);
- int32_t lsm6dso_mode_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- lsm6dso_md_t *val);
- -typedef struct {
- - struct {
- - struct {
- - float mg[3];
- +typedef struct
- +{
- + struct
- + {
- + struct
- + {
- + float_t mg[3];
- int16_t raw[3];
- } xl;
- - struct {
- - float mdps[3];
- + struct
- + {
- + float_t mdps[3];
- int16_t raw[3];
- } gy;
- - struct {
- - float deg_c;
- + struct
- + {
- + float_t deg_c;
- int16_t raw;
- } heat;
- } ui;
- - struct {
- - struct {
- - float mg[3];
- + struct
- + {
- + struct
- + {
- + float_t mg[3];
- int16_t raw[3];
- } xl;
- - struct {
- - float mdps[3];
- + struct
- + {
- + float_t mdps[3];
- int16_t raw[3];
- } gy;
- } ois;
- @@ -4177,7 +4459,8 @@ typedef struct {
- int32_t lsm6dso_data_get(stmdev_ctx_t *ctx, stmdev_ctx_t *aux_ctx,
- lsm6dso_md_t *md, lsm6dso_data_t *data);
-
- -typedef struct {
- +typedef struct
- +{
- uint8_t sig_mot : 1; /* significant motion */
- uint8_t tilt : 1; /* tilt detection */
- uint8_t step : 1; /* step counter/detector */
- @@ -4201,5 +4484,3 @@ int32_t lsm6dso_embedded_sens_off(stmdev_ctx_t *ctx);
- #endif
-
- #endif /*LSM6DSO_DRIVER_H */
- -
- -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|