Class for making communication easier from code to i2c connected Rohm/Kionix sensors. Maybe could be used later also for abstracting Arduino/mbed os. Code ported from 'C'-library rohm-sensor-hal.

Dependents:   kionix-kx123-hello rohm-bh1790glc-hello simple-sensor-client rohm-SensorShield-example

Fork of rohm-sensor-hal by Rohm

Committer:
MikkoZ
Date:
Thu Sep 29 15:10:08 2016 +0000
Revision:
8:dea50f607a45
Child:
13:3d4508874121
Initial version of C++ RegisterWriter. Code ported from 'C'-library rohm-sensor-hal.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
MikkoZ 8:dea50f607a45 1 /* Copyright 2016 Rohm Semiconductor
MikkoZ 8:dea50f607a45 2
MikkoZ 8:dea50f607a45 3 Licensed under the Apache License, Version 2.0 (the "License");
MikkoZ 8:dea50f607a45 4 you may not use this file except in compliance with the License.
MikkoZ 8:dea50f607a45 5 You may obtain a copy of the License at
MikkoZ 8:dea50f607a45 6
MikkoZ 8:dea50f607a45 7 http://www.apache.org/licenses/LICENSE-2.0
MikkoZ 8:dea50f607a45 8
MikkoZ 8:dea50f607a45 9 Unless required by applicable law or agreed to in writing, software
MikkoZ 8:dea50f607a45 10 distributed under the License is distributed on an "AS IS" BASIS,
MikkoZ 8:dea50f607a45 11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
MikkoZ 8:dea50f607a45 12 See the License for the specific language governing permissions and
MikkoZ 8:dea50f607a45 13 limitations under the License.
MikkoZ 8:dea50f607a45 14 */
MikkoZ 8:dea50f607a45 15 #ifndef ROHM_HAL_H
MikkoZ 8:dea50f607a45 16 #define ROHM_HAL_H
MikkoZ 8:dea50f607a45 17
MikkoZ 8:dea50f607a45 18 /* This file is meant for making same code work on many platforms easier. */
MikkoZ 8:dea50f607a45 19 #ifdef __MBED__
MikkoZ 8:dea50f607a45 20 /* Mbed Classic */
MikkoZ 8:dea50f607a45 21 #include "mbed.h" //types
MikkoZ 8:dea50f607a45 22 #include "I2C.h" //I2C
MikkoZ 8:dea50f607a45 23
MikkoZ 8:dea50f607a45 24 #define USE_MBED_HARDWARE_I2C
MikkoZ 8:dea50f607a45 25 extern Serial pc;
MikkoZ 8:dea50f607a45 26 //Serial pc(USBTX, USBRX); done in main.cpp
MikkoZ 8:dea50f607a45 27 #define DEBUG_print(...) pc.printf(__VA_ARGS__)
MikkoZ 8:dea50f607a45 28 #define DEBUG_printf(...) pc.printf(__VA_ARGS__)
MikkoZ 8:dea50f607a45 29 #define DEBUG_println(...) pc.printf(__VA_ARGS__);pc.printf("\r\n")
MikkoZ 8:dea50f607a45 30 #endif
MikkoZ 8:dea50f607a45 31
MikkoZ 8:dea50f607a45 32 #if 0 //Enable/disable debug prints
MikkoZ 8:dea50f607a45 33 #define DEBUG_print()
MikkoZ 8:dea50f607a45 34 #define DEBUG_printf()
MikkoZ 8:dea50f607a45 35 #define DEBUG_println()
MikkoZ 8:dea50f607a45 36 #endif
MikkoZ 8:dea50f607a45 37
MikkoZ 8:dea50f607a45 38 #endif /* ROHM_HAL_H */