Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
MTi2.h
- Committer:
 - dikueiyen
 - Date:
 - 2021-11-15
 - Revision:
 - 0:6bee2baac968
 - Child:
 - 2:636bb157c386
 
File content as of revision 0:6bee2baac968:
/*
 * MTi2.h
 *
 *  Created on: 2021年7月8日
 *      Author: liwei
 */
#ifndef INC_MTI2_H_
#define INC_MTI2_H_
#include "mbed.h"
/*#include "main.h"*/
//define opcode
#define ProtInfo    0x01
#define ConfigProt  0x02
#define Control     0x03
#define PipeStat    0x04
#define NotiPipe    0x05
#define MeasPipe    0x06
int len;
int ctrl_len;
uint16_t notificationSize;
uint16_t measurementSize;
uint8_t buffer[40];
uint8_t ctrlBuf[20];
uint8_t FW[4];
float euler[3];
float accel[3];
float omega[3];
//float euler_[3];// after process
float accel_[3];// after process
//float omega_[3];// after process
void SendOpcode(uint8_t Opcode);
//uint8_t ReadProtInfo();
void ConfigureProt(_Bool M,_Bool N,_Bool O,_Bool P);
void PipeStatus();
//void NotificationPipe();
void MeasurementPipe();
void ControlPipe();
void ReadData();
void MTi2_Init();
float   lpf(float input, float output_old, float frequency);    //lpf discrete
#endif /* INC_MTI2_H_ */