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:
MACRUM
Date:
Wed Feb 27 04:43:21 2019 +0000
Revision:
15:726c671efcce
Parent:
13:3d4508874121
Fix debug print

Who changed what in which revision?

UserRevisionLine numberNew contents of line
MikkoZ 13:3d4508874121 1 /*
MikkoZ 13:3d4508874121 2 The MIT License (MIT)
MikkoZ 13:3d4508874121 3 Copyright (c) 2017 Rohm Semiconductor
MikkoZ 8:dea50f607a45 4
MikkoZ 13:3d4508874121 5 Permission is hereby granted, free of charge, to any person obtaining a
MikkoZ 13:3d4508874121 6 copy of this software and associated documentation files (the
MikkoZ 13:3d4508874121 7 "Software"), to deal in the Software without restriction, including
MikkoZ 13:3d4508874121 8 without limitation the rights to use, copy, modify, merge, publish,
MikkoZ 13:3d4508874121 9 distribute, sublicense, and/or sell copies of the Software, and to
MikkoZ 13:3d4508874121 10 permit persons to whom the Software is furnished to do so, subject to
MikkoZ 13:3d4508874121 11 the following conditions:
MikkoZ 8:dea50f607a45 12
MikkoZ 13:3d4508874121 13 The above copyright notice and this permission notice shall be included
MikkoZ 13:3d4508874121 14 in all copies or substantial portions of the Software.
MikkoZ 8:dea50f607a45 15
MikkoZ 13:3d4508874121 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
MikkoZ 13:3d4508874121 17 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MikkoZ 13:3d4508874121 18 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
MikkoZ 13:3d4508874121 19 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
MikkoZ 13:3d4508874121 20 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
MikkoZ 13:3d4508874121 21 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
MikkoZ 13:3d4508874121 22 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
MikkoZ 8:dea50f607a45 23 */
MikkoZ 13:3d4508874121 24
MikkoZ 8:dea50f607a45 25 #ifndef ROHM_HAL_H
MikkoZ 8:dea50f607a45 26 #define ROHM_HAL_H
MikkoZ 8:dea50f607a45 27
MikkoZ 8:dea50f607a45 28 /* This file is meant for making same code work on many platforms easier. */
MikkoZ 8:dea50f607a45 29 #ifdef __MBED__
MikkoZ 8:dea50f607a45 30 /* Mbed Classic */
MikkoZ 8:dea50f607a45 31 #include "mbed.h" //types
MikkoZ 8:dea50f607a45 32 #include "I2C.h" //I2C
MikkoZ 8:dea50f607a45 33
MikkoZ 8:dea50f607a45 34 #define USE_MBED_HARDWARE_I2C
MACRUM 15:726c671efcce 35 #ifdef _DEBUG
MACRUM 15:726c671efcce 36 #define DEBUG_print(...) printf(__VA_ARGS__)
MACRUM 15:726c671efcce 37 #define DEBUG_printf(...) printf(__VA_ARGS__)
MACRUM 15:726c671efcce 38 #define DEBUG_println(...) printf(__VA_ARGS__);printf("\r\n")
MACRUM 15:726c671efcce 39 #else
MACRUM 15:726c671efcce 40 #define DEBUG_print(...)
MACRUM 15:726c671efcce 41 #define DEBUG_printf(...)
MACRUM 15:726c671efcce 42 #define DEBUG_println(...)
MikkoZ 8:dea50f607a45 43 #endif
MikkoZ 8:dea50f607a45 44 #endif
MikkoZ 8:dea50f607a45 45
MikkoZ 8:dea50f607a45 46 #endif /* ROHM_HAL_H */