Creating a project about IKS10A2 for TT_Mxx

Committer:
ThunderSoft
Date:
Fri Apr 26 09:51:19 2019 +0000
Revision:
1:28de8dff2317
Parent:
0:69ddd5bce0a0
"Update the mbed-os code to support TT_M4G9"

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ThunderSoft 0:69ddd5bce0a0 1 #ifndef IKS01A2_H
ThunderSoft 0:69ddd5bce0a0 2 #define IKS01A2_H
ThunderSoft 0:69ddd5bce0a0 3
ThunderSoft 0:69ddd5bce0a0 4 #include "mbed.h"
ThunderSoft 0:69ddd5bce0a0 5 #include "LSM6DSLSensor.h"
ThunderSoft 0:69ddd5bce0a0 6 #include "LSM303AGR_ACC_Sensor.h"
ThunderSoft 0:69ddd5bce0a0 7 #include "LSM303AGR_MAG_Sensor.h"
ThunderSoft 0:69ddd5bce0a0 8 #include "HTS221Sensor.h"
ThunderSoft 0:69ddd5bce0a0 9 #include "LPS22HBSensor.h"
ThunderSoft 0:69ddd5bce0a0 10
ThunderSoft 0:69ddd5bce0a0 11 #define CONNECT 0
ThunderSoft 0:69ddd5bce0a0 12 #define LSM6D_NOT_CONNECT (0x1 << 0)
ThunderSoft 0:69ddd5bce0a0 13 #define LSM303_ACC_NOT_CONNECT (0x1 << 1)
ThunderSoft 0:69ddd5bce0a0 14 #define LSM303_MAG_NOT_CONNECT (0x1 << 2)
ThunderSoft 0:69ddd5bce0a0 15 #define HTS221_NOT_CONNECT (0x1 << 3)
ThunderSoft 0:69ddd5bce0a0 16 #define LPS22_NOT_CONNECT (0x1 << 4)
ThunderSoft 0:69ddd5bce0a0 17
ThunderSoft 0:69ddd5bce0a0 18 class IKS01A2 {
ThunderSoft 0:69ddd5bce0a0 19
ThunderSoft 0:69ddd5bce0a0 20 public:
ThunderSoft 0:69ddd5bce0a0 21 /**
ThunderSoft 0:69ddd5bce0a0 22 * @brief Construct .
ThunderSoft 0:69ddd5bce0a0 23 */
ThunderSoft 0:69ddd5bce0a0 24 IKS01A2(I2C *i2c);
ThunderSoft 0:69ddd5bce0a0 25
ThunderSoft 0:69ddd5bce0a0 26 /**
ThunderSoft 0:69ddd5bce0a0 27 * @brief Test the sensor is connectd.
ThunderSoft 0:69ddd5bce0a0 28 * @return 0 success.
ThunderSoft 0:69ddd5bce0a0 29 */
ThunderSoft 0:69ddd5bce0a0 30 uint32_t isConnect();
ThunderSoft 0:69ddd5bce0a0 31
ThunderSoft 0:69ddd5bce0a0 32
ThunderSoft 0:69ddd5bce0a0 33 /**
ThunderSoft 0:69ddd5bce0a0 34 * @brief Get ACC data from LSM6DSL.
ThunderSoft 0:69ddd5bce0a0 35 * @param arg [out]
ThunderSoft 0:69ddd5bce0a0 36 */
ThunderSoft 0:69ddd5bce0a0 37 void getXAxesLSM6DSL(int32_t *arg);
ThunderSoft 0:69ddd5bce0a0 38
ThunderSoft 0:69ddd5bce0a0 39 /**
ThunderSoft 0:69ddd5bce0a0 40 * @brief Get MAG data from LSM6DSL.
ThunderSoft 0:69ddd5bce0a0 41 * @param arg [out]
ThunderSoft 0:69ddd5bce0a0 42 */
ThunderSoft 0:69ddd5bce0a0 43 void getGAxesLSM6DSL(int32_t *arg);
ThunderSoft 0:69ddd5bce0a0 44
ThunderSoft 0:69ddd5bce0a0 45 /**
ThunderSoft 0:69ddd5bce0a0 46 * @brief Get data from LSM303AGR.
ThunderSoft 0:69ddd5bce0a0 47 * @param arg[out]
ThunderSoft 0:69ddd5bce0a0 48 */
ThunderSoft 0:69ddd5bce0a0 49 void getDataLSM303AGR(int32_t *arg);
ThunderSoft 0:69ddd5bce0a0 50
ThunderSoft 0:69ddd5bce0a0 51 /**
ThunderSoft 0:69ddd5bce0a0 52 * @brief Get data from LSM303MAG.
ThunderSoft 0:69ddd5bce0a0 53 * @param arg [description]
ThunderSoft 0:69ddd5bce0a0 54 */
ThunderSoft 0:69ddd5bce0a0 55 void getDataLSM303MAG(int32_t *arg);
ThunderSoft 0:69ddd5bce0a0 56
ThunderSoft 0:69ddd5bce0a0 57 /**
ThunderSoft 0:69ddd5bce0a0 58 * @brief Get Humidity from HTS221.
ThunderSoft 0:69ddd5bce0a0 59 * @param arg [out]
ThunderSoft 0:69ddd5bce0a0 60 */
ThunderSoft 0:69ddd5bce0a0 61 void GetHumidity(float *arg);
ThunderSoft 0:69ddd5bce0a0 62
ThunderSoft 0:69ddd5bce0a0 63 /**
ThunderSoft 0:69ddd5bce0a0 64 * @brief Get Temperature from HTS221.
ThunderSoft 0:69ddd5bce0a0 65 * @param arg [description]
ThunderSoft 0:69ddd5bce0a0 66 */
ThunderSoft 0:69ddd5bce0a0 67 void GetTemperatureHTS221(float *arg);
ThunderSoft 0:69ddd5bce0a0 68
ThunderSoft 0:69ddd5bce0a0 69 /**
ThunderSoft 0:69ddd5bce0a0 70 * @brief Get press data from LPS22HB.
ThunderSoft 0:69ddd5bce0a0 71 * @param arg [out]
ThunderSoft 0:69ddd5bce0a0 72 */
ThunderSoft 0:69ddd5bce0a0 73 void GetPressure(float *arg);
ThunderSoft 0:69ddd5bce0a0 74
ThunderSoft 0:69ddd5bce0a0 75 /**
ThunderSoft 0:69ddd5bce0a0 76 * @brief Get Temperature data from LPS22HB.
ThunderSoft 0:69ddd5bce0a0 77 * @param arg [description]
ThunderSoft 0:69ddd5bce0a0 78 */
ThunderSoft 0:69ddd5bce0a0 79 void GetTemperatureLPS22HB(float *arg);
ThunderSoft 0:69ddd5bce0a0 80
ThunderSoft 0:69ddd5bce0a0 81 /**
ThunderSoft 0:69ddd5bce0a0 82 * @brief Get LSM6DSL Id.
ThunderSoft 0:69ddd5bce0a0 83 * @return [id
ThunderSoft 0:69ddd5bce0a0 84 * 3]
ThunderSoft 0:69ddd5bce0a0 85 */
ThunderSoft 0:69ddd5bce0a0 86 char getIdLSM6DSL();
ThunderSoft 0:69ddd5bce0a0 87
ThunderSoft 0:69ddd5bce0a0 88 /**
ThunderSoft 0:69ddd5bce0a0 89 * @brief Get LSM303AGR Id.
ThunderSoft 0:69ddd5bce0a0 90 * @return [id]
ThunderSoft 0:69ddd5bce0a0 91 */
ThunderSoft 0:69ddd5bce0a0 92 char getIdLSM303AGR();
ThunderSoft 0:69ddd5bce0a0 93
ThunderSoft 0:69ddd5bce0a0 94 /**
ThunderSoft 0:69ddd5bce0a0 95 * @brief Get LSM303MAG Id.
ThunderSoft 0:69ddd5bce0a0 96 * @return [id]
ThunderSoft 0:69ddd5bce0a0 97 */
ThunderSoft 0:69ddd5bce0a0 98 char getIdLSM303MAG();
ThunderSoft 0:69ddd5bce0a0 99
ThunderSoft 0:69ddd5bce0a0 100 /**
ThunderSoft 0:69ddd5bce0a0 101 * @brief Get HTS221 id.
ThunderSoft 0:69ddd5bce0a0 102 */
ThunderSoft 0:69ddd5bce0a0 103 char getIdHTS221();
ThunderSoft 0:69ddd5bce0a0 104
ThunderSoft 0:69ddd5bce0a0 105 /**
ThunderSoft 0:69ddd5bce0a0 106 * @brief Get LPS22HB id.
ThunderSoft 0:69ddd5bce0a0 107 * @return [description]
ThunderSoft 0:69ddd5bce0a0 108 */
ThunderSoft 0:69ddd5bce0a0 109 char getIdLPS22HB();
ThunderSoft 0:69ddd5bce0a0 110 private:
ThunderSoft 0:69ddd5bce0a0 111 /**
ThunderSoft 0:69ddd5bce0a0 112 * @brief Init all of sensor.
ThunderSoft 0:69ddd5bce0a0 113 */
ThunderSoft 0:69ddd5bce0a0 114 void init();
ThunderSoft 0:69ddd5bce0a0 115
ThunderSoft 0:69ddd5bce0a0 116 LSM6DSLSensor *lsm ;
ThunderSoft 0:69ddd5bce0a0 117 LSM303AGR_ACC_Sensor *Acc ;
ThunderSoft 0:69ddd5bce0a0 118 LSM303AGR_MAG_Sensor *Mag ;
ThunderSoft 0:69ddd5bce0a0 119 HTS221Sensor *HumTemp ;
ThunderSoft 0:69ddd5bce0a0 120 LPS22HBSensor *PressTemp ;
ThunderSoft 0:69ddd5bce0a0 121 };
ThunderSoft 0:69ddd5bce0a0 122
ThunderSoft 0:69ddd5bce0a0 123
ThunderSoft 0:69ddd5bce0a0 124 #endif