(2) 从陀螺仪中获取原始数据并处理; (3) 更新数据并输出。 2. 代码分析 官方的驱动主要是了 MPL软件库(Motion Processing Library),要移植该软件库我们需 要为它提供 I2C 读写接口、定时服务以及 MPU6050 的数据更新标志。若需要输出调试信 息到上位机,还需要提供串口接口。 I2C 读写接口 MPL库的内部对 I2C 读写时都使用 i2c_write 及 i2c_read 函数,在文件“inv_mpu.c” 中给出了它们的接口格式,见代码清单 43-1。 代码清单 43-9 I2C 读写接口(inv_mpu.c 文件) 1 /* The following functions must be defined for this platform: 2 * i2c_write(unsigned char slave_addr, unsigned char reg_addr, 3 * unsigned char length, unsigned char const *data) 4 * i2c_read(unsigned char slave_addr, unsigned char reg_addr, 5 * unsigned char length, unsigned char *data) 6 */ 7 8 #define i2c_write Sensors_I2C_WriteRegister 9 #define i2c_read Sensors_I2C_ReadRegister 这些接口的格式与我们上一小节写的 I2C 读写函数 Sensors_I2C_ReadRegister 及 Sensors_I2C_WriteRegister 一致,所以可直接使用宏替换。 提供定时服务 MPL软件库中使用到了延时及时间戳功能,要求需要提供 delay_ms 函数实现毫秒级延 时,提供 get_ms 获取毫秒级的时间戳,它们的接口格式也在“inv_mpu.c”文件中给出, 见代码清单 43-2。 代码清单 43-10 定时服务接口(inv_mpu.c 文件) 1 /* 2 * delay_ms(unsigned long num_ms) 3 * get_ms(unsigned long *count) 4 */ 5 6 #define delay_ms Delay_ms 7 #define get_ms get_tick_count 我们为接口提供的 Delay_ms 及 get_tick_count 函数定义在 bsp_SysTick.c 文件,我们使 用 SysTick 每毫秒产生一次中断,进行计时,见代码清单 43-11。 代码清单 43-11 使用 Systick 进行定时(bsp_SysTick.c) 1 2 static __IO u32 TimingDelay; 3 static __IO uint32_t g_ul_ms_ticks=0; 4 /** 5 * @brief us 延时程序,1ms 为一个单位 6 * @param 7 * @arg nTime: Delay_ms( 1 ) 则实现的延时为 1 ms 8 * @retval 无 9 */ 10 void Delay_ms(__IO u32 nTime)
2023-02-17 11:43:35 33.8MB STM32F429 M4核
1
一本有关多抽样率信号处理和应用有关的好书。 多速率数字信号处理的经典书籍。
2022-05-05 11:39:50 20.33MB Multirate Filter DSP MATLAB
1
Multirate Systems and Filter Banks
2022-01-17 19:23:16 29.6MB Multirate Systems and Filter
1
This new, fully revised edition covers all the major topics of digital signal processing (DSP) design and analysis in a single, all-inclusive volume, interweaving theory with real-world examples and design trade-offs.
2021-09-09 10:04:08 6.06MB 离散变换 频谱估计 multirate sy
1
Multirate fFiltering For Digital Signal Processing Matlab Application示例代码
2021-06-26 22:29:38 66KB Multirate   fFiltering  Digital  Matlab
1
multirate digital signal processing 多采样率 数字信号处理, N.J Fliege 经典之作,John Wiley& Sons出版
1
Multirate Filtering for Digital Signal Processing-MATLAB Applications
2021-05-19 14:19:34 16.11MB Multirate Filtering Digital Signal
1
通信系统中的多采样率信号处理(Multirate Signal Processing for Communication Systems);多速率dsp经典之作
2021-05-08 21:02:06 73.21MB dsp multirate
1
Multirate signal processing techniques are widely used in many areas of modern engineering such as communications, digital audio, measurements, image and signal processing, speech processing, and multimedia. Multirate Filtering for Digital Signal Processing: MATLAB Applications covers basic and advanced approaches in the design and implementation of multirate filtering. This authoritative volume considers the role of filters in multirate systems, provides efficient solutions of finite and infinite impulse response filters for sampling rate conversion, and discusses examples of multirate multilevel filter banks, offering a must-have book for practitioners and scholars in multirate signal processing.
2019-12-21 21:59:31 6.56MB Multirate Filter Digital Signal
1
大牛写的多速率信号处理书,面向通信领域,内容详实,深入浅出。
2019-12-21 21:23:42 10.52MB 多速率信号
1