Creating a project about A8491 for TT_Mxx

Committer:
ThunderSoft
Date:
Fri Apr 26 09:41:23 2019 +0000
Revision:
1:da8c10bb7386
Parent:
0:6fc4594bc1db
"Update the mbed-os code to support TT_M4G9"

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ThunderSoft 0:6fc4594bc1db 1 /*
ThunderSoft 0:6fc4594bc1db 2 * Copyright (c) 2015 - 2016, Freescale Semiconductor, Inc.
ThunderSoft 0:6fc4594bc1db 3 * Copyright 2016-2017 NXP
ThunderSoft 0:6fc4594bc1db 4 *
ThunderSoft 0:6fc4594bc1db 5 * Redistribution and use in source and binary forms, with or without modification,
ThunderSoft 0:6fc4594bc1db 6 * are permitted provided that the following conditions are met:
ThunderSoft 0:6fc4594bc1db 7 *
ThunderSoft 0:6fc4594bc1db 8 * o Redistributions of source code must retain the above copyright notice, this list
ThunderSoft 0:6fc4594bc1db 9 * of conditions and the following disclaimer.
ThunderSoft 0:6fc4594bc1db 10 *
ThunderSoft 0:6fc4594bc1db 11 * o Redistributions in binary form must reproduce the above copyright notice, this
ThunderSoft 0:6fc4594bc1db 12 * list of conditions and the following disclaimer in the documentation and/or
ThunderSoft 0:6fc4594bc1db 13 * other materials provided with the distribution.
ThunderSoft 0:6fc4594bc1db 14 *
ThunderSoft 0:6fc4594bc1db 15 * o Neither the name of the copyright holder nor the names of its
ThunderSoft 0:6fc4594bc1db 16 * contributors may be used to endorse or promote products derived from this
ThunderSoft 0:6fc4594bc1db 17 * software without specific prior written permission.
ThunderSoft 0:6fc4594bc1db 18 *
ThunderSoft 0:6fc4594bc1db 19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ThunderSoft 0:6fc4594bc1db 20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
ThunderSoft 0:6fc4594bc1db 21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
ThunderSoft 0:6fc4594bc1db 22 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ThunderSoft 0:6fc4594bc1db 23 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
ThunderSoft 0:6fc4594bc1db 24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
ThunderSoft 0:6fc4594bc1db 25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ThunderSoft 0:6fc4594bc1db 26 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
ThunderSoft 0:6fc4594bc1db 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
ThunderSoft 0:6fc4594bc1db 28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
ThunderSoft 0:6fc4594bc1db 29 */
ThunderSoft 0:6fc4594bc1db 30
ThunderSoft 0:6fc4594bc1db 31 #ifndef MMA8491_H
ThunderSoft 0:6fc4594bc1db 32 #define MMA8491_H
ThunderSoft 0:6fc4594bc1db 33 #include "mbed.h"
ThunderSoft 0:6fc4594bc1db 34
ThunderSoft 0:6fc4594bc1db 35 #define MMA8491_STATUS 0x00
ThunderSoft 0:6fc4594bc1db 36 #define MMA8491_I2C_ADDRESS (0x55<<1)
ThunderSoft 0:6fc4594bc1db 37
ThunderSoft 0:6fc4594bc1db 38 class MMA8491
ThunderSoft 0:6fc4594bc1db 39 {
ThunderSoft 0:6fc4594bc1db 40 public:
ThunderSoft 0:6fc4594bc1db 41
ThunderSoft 0:6fc4594bc1db 42 MMA8491(PinName sda, PinName scl, PinName en);
ThunderSoft 0:6fc4594bc1db 43
ThunderSoft 0:6fc4594bc1db 44 void MMA8491_config(void);
ThunderSoft 0:6fc4594bc1db 45
ThunderSoft 0:6fc4594bc1db 46 void acquire_MMA8491_data_g(float * du);
ThunderSoft 0:6fc4594bc1db 47
ThunderSoft 0:6fc4594bc1db 48 DigitalOut MMA8491_en;
ThunderSoft 0:6fc4594bc1db 49
ThunderSoft 0:6fc4594bc1db 50 private:
ThunderSoft 0:6fc4594bc1db 51 I2C MMA8491_i2c;
ThunderSoft 0:6fc4594bc1db 52
ThunderSoft 0:6fc4594bc1db 53
ThunderSoft 0:6fc4594bc1db 54 };
ThunderSoft 0:6fc4594bc1db 55
ThunderSoft 0:6fc4594bc1db 56 #endif