91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 79KB
    文件類型: .zip
    金幣: 2
    下載: 2 次
    發(fā)布日期: 2021-04-06
  • 語言: 其他
  • 標(biāo)簽: nrf51822??

資源簡(jiǎn)介

nrf_51822_mpu6050_DMP移植好的,驗(yàn)證可用,使用官方庫,更改量小

資源截圖

代碼片段和文件信息

/*?Copyright?(c)?2009?Nordic?Semiconductor.?All?Rights?Reserved.
?*
?*?The?information?contained?herein?is?property?of?Nordic?Semiconductor?ASA.
?*?Terms?and?conditions?of?usage?are?described?in?detail?in?NORDIC
?*?SEMICONDUCTOR?STANDARD?SOFTWARE?LICENSE?AGREEMENT.
?*
?*?Licensees?are?granted?free?non-transferable?use?of?the?information.?NO
?*?WARRANTY?of?ANY?KIND?is?provided.?This?heading?must?NOT?be?removed?from
?*?the?file.
?*
?*/

#include?
#include?

#include?“twi_master.h“
#include?“mpu6050.h“

/*lint?++flb?“Enter?library?region“?*/

#define?ADDRESS_WHO_AM_I??????????(0x75U)?//?!#define?ADDRESS_SIGNAL_PATH_RESET?(0x68U)?//?!<
static?uint8_t???????m_device_address=0xD0;?

bool?mpu6050_write(uint8_t?device_address?uint8_t?register_address?uint8_t?len?uint8_t?*data)
{
????uint8_t?w2_data[len+1];
for(int?i=0;i {
if(i==0)
w2_data[0]?=register_address;
else
w2_data[i]?=?*(data+i-1);
}
???
????return?twi_master_transfer((device_address<<1)|TWI_WRITE_BIT?w2_data?len+1?TWI_ISSUE_STOP);
}

bool?mpu6050_read(uint8_t?device_address?uint8_t?register_address?uint8_t?number_of_bytes?uint8_t?*destination)
{
??bool?transfer_succeeded;
????transfer_succeeded?=?twi_master_transfer((device_address<<1)|TWI_WRITE_BIT?®ister_address?1?TWI_DONT_ISSUE_STOP);
????transfer_succeeded?&=?twi_master_transfer((device_address<<1)|TWI_READ_BIT?destination?number_of_bytes?TWI_ISSUE_STOP);
????return?transfer_succeeded;
}

/*lint?--flb?“Leave?library?region“?*/

?????????//?!
bool?mpu6050_init(uint8_t?device_address)
{
????bool?transfer_succeeded?=?true;

????m_device_address?=?(uint8_t)(device_address?<
????//?Do?a?reset?on?signal?paths
????uint8_t?reset_value?=?0x04U?|?0x02U?|?0x01U;?//?Resets?gyro?accelerometer?and?temperature?sensor?signal?paths.
????transfer_succeeded?&=?mpu6050_write(0xd0ADDRESS_SIGNAL_PATH_RESET1&reset_value);

????//?Read?and?verify?product?ID
????transfer_succeeded?&=?mpu6050_verify_product_id();

????return?transfer_succeeded;
}

bool?mpu6050_verify_product_id(void)
{
????uint8_t?who_am_i;

????if?(?mpu6050_read(0x68ADDRESS_WHO_AM_I1?&who_am_i))
????{
????????if?(who_am_i?!=?0x68u)
????????{
????????????return?false;
????????}
????????else
????????{
????????????return?true;
????????}
????}
????else
????{
????????return?false;
????}
}

bool?mpu6050_register_write(uint8_t?register_address?uint8_t?value)
{
????uint8_t?w2_data[2];

????w2_data[0]?=?register_address;
????w2_data[1]?=?value;
????return?twi_master_transfer(m_device_address?w2_data?2?TWI_ISSUE_STOP);
}
bool?mpu6050_register_read(uint8_t?register_address?uint8_t?*?destination?uint8_t?number_of_bytes)
{
????bool?transfer_succeeded;
????transfer_succeeded??=?twi_master_transfer(m_device_address?®ister_address?

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-03-16?18:30??DMP\
?????目錄???????????0??2018-03-16?18:31??DMP\已移植好的\
?????目錄???????????0??2018-03-16?18:30??DMP\已移植好的\DMP\
?????文件???????19342??2012-12-14?11:16??DMP\已移植好的\DMP\dmpKey.h
?????文件????????6765??2012-12-14?11:16??DMP\已移植好的\DMP\dmpmap.h
?????文件???????89661??2018-03-16?17:45??DMP\已移植好的\DMP\inv_mpu.c
?????文件????????4900??2018-03-16?12:52??DMP\已移植好的\DMP\inv_mpu.h
?????文件???????58371??2018-03-16?12:54??DMP\已移植好的\DMP\inv_mpu_dmp_motion_driver.c
?????文件????????3538??2012-12-14?11:16??DMP\已移植好的\DMP\inv_mpu_dmp_motion_driver.h
?????文件????????3186??2018-03-16?17:36??DMP\已移植好的\mpu6050.c
?????文件????????2373??2018-03-15?21:55??DMP\已移植好的\mpu6050.h
?????目錄???????????0??2018-03-16?18:16??DMP\正點(diǎn)原子的(移植前)\
?????文件???????19342??2012-12-14?11:16??DMP\正點(diǎn)原子的(移植前)\dmpKey.h
?????文件????????6765??2012-12-14?11:16??DMP\正點(diǎn)原子的(移植前)\dmpmap.h
?????文件???????89576??2017-07-30?14:09??DMP\正點(diǎn)原子的(移植前)\inv_mpu.c
?????文件????????4891??2017-07-30?13:18??DMP\正點(diǎn)原子的(移植前)\inv_mpu.h
?????文件???????58387??2014-05-09?12:20??DMP\正點(diǎn)原子的(移植前)\inv_mpu_dmp_motion_driver.c
?????文件????????3538??2012-12-14?11:16??DMP\正點(diǎn)原子的(移植前)\inv_mpu_dmp_motion_driver.h

評(píng)論

共有 條評(píng)論