handlerqq部落24-2
qq部落24-2 时间:2021-01-25 阅读:(
)
IntroductionTheX-CUBE-MEMS1softwarepackageallowsyoutobuildapplicationsbasedonsensordatafromSTM32NucleodevelopmentplatformsmountingacompatibleX-NUCLEOexpansionboardwithseveralhighperformanceSTmotionMEMSandenvironmentalsensors.
Youcan,however,substituteindividualsensorsontheX-NUCLEOexpansionboardwithsinglesensorboardswithcompatiblepinsforthestandardDIL24socket.
HowtouseasensoronaDIL24socketinX-CUBE-MEMS1packageapplicationsAN5353ApplicationnoteAN5353-Rev1-June2019ForfurtherinformationcontactyourlocalSTMicroelectronicssalesoffice.
www.
st.
com1Stepbystepproceduretoreplaceanon-boardsensorwithaDIL24sensorInthisexample,wereplacetheLSM6DSLsensorontheX-NUCLEO-IKS01A2expansionboardwiththeLSM6DSOsensorconnectedtoaboardwithaDIL24socket.
WehavechosentheDataLogFusionapplication(usingMotionFXsensorfusionalgorithm)runningontheNUCLEO-L476RGdevelopmentboard.
Withminormodifications,youcanfollowthesameprocedureforothersensors,expansionboardsandSTM32Nucleoboardplatformsaswell.
Step1.
Addthesensorintheboardconfigurationheaderfile.
Intheinc/iks01a2_conf.
hfile,disabletheuseoftheLSM6DSLsensorbyinserting"0U"ashighlightedbelowinbold,andenabletheLSM6DSOsensorbyaddingthedefinestatementalsoshownbelowinbold.
#defineUSE_IKS01A2_ENV_SENSOR_HTS221_01U#defineUSE_IKS01A2_ENV_SENSOR_LPS22HB_01U#defineUSE_IKS01A2_MOTION_SENSOR_LSM6DSL_00U#defineUSE_IKS01A2_MOTION_SENSOR_LSM303AGR_ACC_01U#defineUSE_IKS01A2_MOTION_SENSOR_LSM303AGR_MAG_01U#defineUSE_IKS01A2_MOTION_SENSOR_LSM6DSO_01UStep2.
AddthesensordriversinaprojectforaspecificIDE(forexample,SW4STM32)andincludethepathtothesensordriversintotheprojectsettings.
Figure1.
AddLSM6DSOsensordriversinaprojectfortheSW4STM32IDEAN5353Stepbystepproceduretoreplaceanon-boardsensorwithaDIL24sensorAN5353-Rev1page2/10Figure2.
AddLSM6DSOsensorincludingpathtoaprojectfortheSW4STM32IDEStep3.
SubstitutethesensorontheX-NUCLEOexpansionboardwiththesinglesensorontheDIL24socketboardintheX-CUBE-MEMS1application.
Step3a.
SubstitutetheLSM6DSLsensorhandlerwiththeLSM6DSOsensorhandlerinthesrc/main.
cfile,main()function(inboldbelow).
/*AcquiredatafromenabledsensorsandfillMsgstream*/RTC_Handler(&msg_dat);Accelero_Sensor_Handler(&msg_dat,IKS01A2_LSM6DSO_0);Gyro_Sensor_Handler(&msg_dat,IKS01A2_LSM6DSO_0);Magneto_Sensor_Handler(&msg_dat,IKS01A2_LSM303AGR_MAG_0);Humidity_Sensor_Handler(&msg_dat,IKS01A2_HTS221_0);Temperature_Sensor_Handler(&msg_dat,IKS01A2_HTS221_0);Pressure_Sensor_Handler(&msg_dat,IKS01A2_LPS22HB_0);Step3b.
SubstitutetheLSM6DSLsensorinitializationwithLSM6DSOinitializationinthesrc/main.
cfile,Init_Sensors()function(inboldbelow).
/***@briefInitializeallsensors*@paramNone*@retvalNone*/staticvoidInit_Sensors(void){(void)IKS01A2_MOTION_SENSOR_Init(IKS01A2_LSM6DSO_0,MOTION_ACCELERO|MOTION_GYRO);(void)IKS01A2_MOTION_SENSOR_Init(IKS01A2_LSM303AGR_MAG_0,MOTION_MAGNETO);(void)IKS01A2_ENV_SENSOR_Init(IKS01A2_HTS221_0,ENV_TEMPERATURE|ENV_HUMIDITY);(void)IKS01A2_ENV_SENSOR_Init(IKS01A2_LPS22HB_0,ENV_PRESSURE);}AN5353Stepbystepproceduretoreplaceanon-boardsensorwithaDIL24sensorAN5353-Rev1page3/10Step3c.
AddtheLSM6DSOsensorUnicleoIDfromthetablebelowtothesrc/DemoSerial.
cfile(inboldbelowthetable).
Table1.
Unicleo-GUIsupportedsensorsandIDsAccelerometer/gyroscopeMagnetometerPressure/temperatureHumidity/temperatureNameIDNameIDNameIDNameIDLSM6DS01LIS3MDL1LPS25HB1HTS2211LSM6DS32LSM303AGR_MAG2LPS22HB3STTS7512LSM6DSL3LIS2MDL3LPS22HH4LIS2DH124H3LIS331DL5LSM303AGR6LSM6DSO7LIS2DW128LSM6DSR9LSM6DSOX10#defineLPS25HB_UNICLEO_ID_ONBOARD1#defineLPS25HB_UNICLEO_ID_DIL2#defineLPS22HB_UNICLEO_ID3#defineHTS221_UNICLEO_ID1#defineLSM6DS0_UNICLEO_ID1#defineLSM6DS3_UNICLEO_ID2#defineLSM6DSL_UNICLEO_ID3#defineLSM6DSO_UNICLEO_ID7#defineLIS3MDL_UNICLEO_ID1#defineLSM303AGR_UNICLEO_ID_MAG2Step3d.
SubstituteLSM6DSLsensordisablewithLSM6DSOdisableinthesrc/DemoSerial.
cfile,HandleMSG()function,CMD_ACCELERO_GYRO_Initcase(inboldbelow).
Serialize_s32(&Msg->Data[3],LSM6DSO_UNICLEO_ID,4);Step3e.
SubstituteLSM6DSLsensorenablewithLSM6DSOenableinthesrc/DemoSerial.
cfile,HandleMSG()function,CMD_Start_Data_Streamingcase(inboldbelow).
if((SensorsEnabled&ACCELEROMETER_SENSOR)==ACCELEROMETER_SENSOR){(void)IKS01A2_MOTION_SENSOR_Enable(IKS01A2_LSM6DSO_0,MOTION_ACCELERO);}if((SensorsEnabled&GYROSCOPE_SENSOR)==GYROSCOPE_SENSOR){(void)IKS01A2_MOTION_SENSOR_Enable(IKS01A2_LSM6DSO_0,MOTION_GYRO);}Step3f.
SubstituteLSM6DSLsensordisablewithLSM6DSOdisableinthesrc/DemoSerial.
cfile,HandleMSG()function,CMD_Stop_Data_Streamingcase(inboldbelow).
(void)IKS01A2_MOTION_SENSOR_Disable(IKS01A2_LSM6DSO_0,MOTION_ACCELERO);(void)IKS01A2_MOTION_SENSOR_Disable(IKS01A2_LSM6DSO_0,MOTION_GYRO);Step4.
Changesensororientation(optional).
AN5353Stepbystepproceduretoreplaceanon-boardsensorwithaDIL24sensorAN5353-Rev1page4/10IntheMotionFX_Manager.
cfileMotionFX_manager_init()function,checkaccelerometer,gyroscopeandmagnetometersensororientationsetupwithrealDIL24sensororientationandupdateifnecessary.
Inourcase,weneedtocheckaccelerometerandgyroscopesensororientationsetupwithLSM6DSO(DIL24module)orientation(inboldbelow).
/***@briefInitialisesMotionFXalgorithm*@paramNone*@retvalNone*/voidMotionFX_manager_init(void){characc_orientation[4];chargyro_orientation[4];charmag_orientation[4];acc_orientation[0]='n';acc_orientation[1]='w';acc_orientation[2]='u';gyro_orientation[0]='n';gyro_orientation[1]='w';gyro_orientation[2]='u';mag_orientation[0]='n';mag_orientation[1]='e';mag_orientation[2]='u';Note:Inthisexample,nochangeisneededastheLSM6DSLsensorontheX-NUCLEOexpansionboardandtheLSM6DSOsensorontheDIL24modulehavethesameorientation.
Step5.
BuildtheapplicationandruntheUnicleo-GUISWtocheckiftheLSM6DSOsensorisactiveandtheMotionSensorFusionalgorithmisworkingproperly.
Figure3.
RunningDataLogFusionapplicationwithLSM6DSOsensor(DIL24module)inUnicleo-GUISWRELATEDLINKSSTEVAL-MKI196V1evaluationboardLSM6DSOdatasheetfreelyavailableatwww.
st.
comAN5353Stepbystepproceduretoreplaceanon-boardsensorwithaDIL24sensorAN5353-Rev1page5/10LSM6DSOapplicationnote:AN5192,"LSM6DSO:always-on3Daccelerometerand3Dgyroscope",freelyavailableatwww.
st.
comRevisionhistoryTable2.
DocumentrevisionhistoryDateRevisionChanges11-Jun-20191InitialreleaseAN5353AN5353-Rev1page6/10Contents1Stepbystepproceduretoreplaceanon-boardsensorwithaDIL24sensor.
2Revisionhistory6AN5353ContentsAN5353-Rev1page7/10ListoffiguresFigure1.
AddLSM6DSOsensordriversinaprojectfortheSW4STM32IDE2Figure2.
AddLSM6DSOsensorincludingpathtoaprojectfortheSW4STM32IDE3Figure3.
RunningDataLogFusionapplicationwithLSM6DSOsensor(DIL24module)inUnicleo-GUISW5AN5353ListoffiguresAN5353-Rev1page8/10ListoftablesTable1.
Unicleo-GUIsupportedsensorsandIDs4Table2.
Documentrevisionhistory6AN5353ListoftablesAN5353-Rev1page9/10IMPORTANTNOTICE–PLEASEREADCAREFULLYSTMicroelectronicsNVanditssubsidiaries("ST")reservetherighttomakechanges,corrections,enhancements,modifications,andimprovementstoSTproductsand/ortothisdocumentatanytimewithoutnotice.
PurchasersshouldobtainthelatestrelevantinformationonSTproductsbeforeplacingorders.
STproductsaresoldpursuanttoST'stermsandconditionsofsaleinplaceatthetimeoforderacknowledgement.
Purchasersaresolelyresponsibleforthechoice,selection,anduseofSTproductsandSTassumesnoliabilityforapplicationassistanceorthedesignofPurchasers'products.
Nolicense,expressorimplied,toanyintellectualpropertyrightisgrantedbySTherein.
ResaleofSTproductswithprovisionsdifferentfromtheinformationsetforthhereinshallvoidanywarrantygrantedbySTforsuchproduct.
STandtheSTlogoaretrademarksofST.
ForadditionalinformationaboutSTtrademarks,pleaserefertowww.
st.
com/trademarks.
Allotherproductorservicenamesarethepropertyoftheirrespectiveowners.
Informationinthisdocumentsupersedesandreplacesinformationpreviouslysuppliedinanypriorversionsofthisdocument.
2019STMicroelectronics–AllrightsreservedAN5353AN5353-Rev1page10/10
捷锐数据官网商家介绍捷锐数据怎么样?捷锐数据好不好?捷锐数据是成立于2018年一家国人IDC商家,早期其主营虚拟主机CDN,现在主要有香港云服、国内物理机、腾讯轻量云代理、阿里轻量云代理,自营香港为CN2+BGP线路,采用KVM虚拟化而且单IP提供10G流量清洗并且免费配备天机盾可达到屏蔽UDP以及无视CC效果。这次捷锐数据给大家带来的活动是香港云促销,总共放量40台点击进入捷锐数据官网优惠活动内...
DMIT怎么样?DMIT是一家美国主机商,主要提供KVM VPS、独立服务器等,主要提供香港CN2、洛杉矶CN2 GIA等KVM VPS,稳定性、网络都很不错。支持中文客服,可Paypal、支付宝付款。2020年推出的香港国际线路的KVM VPS,大带宽,适合中转落地使用。现在有永久9折优惠码:July-4-Lite-10OFF,季付及以上还有折扣,非 中国路由优化;AS4134,AS4837 均...
官方网站:点击访问青云互联活动官网优惠码:终身88折扣优惠码:WN789-2021香港测试IP:154.196.254美国测试IP:243.164.1活动方案:用户购买任意全区域云服务器月付以上享受免费更换IP服务;限美国区域云服务器凡是购买均可以提交工单定制天机防火墙高防御保护端口以及保护模式;香港区域购买季度、半年付、年付周期均可免费申请额外1IP;使用优惠码购买后续费周期终身同活动价,价格不...
qq部落24-2为你推荐
金士顿1g内存条价格现在金士顿的内存条1G的多少钱一根郑州软银郑州有没有大一些的网络公司啊,售后服务好的,我想把公司推广这一块外包出去?软银收购wework软银联合 GungHo 注资控股芬兰游戏公司 Supercell意味着甚么?租车平台哪个好租车哪个平台好点,都要什么费用?音乐播放器哪个好最好的音乐播放器是什么绝地求生加速器哪个好绝地求生的加速器哪个好用?绝地求生加速器哪个好绝地求生哪个加速器好用一点,求推荐一个手机杀毒软件哪个好手机杀毒软件那个好用手机音乐播放器哪个好手机音乐播放器什么的好?尼康和佳能单反哪个好尼康和佳能哪个好
东莞虚拟主机 最便宜虚拟主机 万网域名管理 老域名全部失效请记好新域名 simcentric 天猫双十一抢红包 全站静态化 微软服务器操作系统 国外ip加速器 万网空间购买 789电视剧 联通网站 架设邮件服务器 免费的asp空间 lick 服务器防火墙 湖南铁通 qq空间打开很慢 低价 域名商城 更多