sdsads
rohm-sensor-hal/I2CCommon.h@10:37b8f497b698, 2021-07-01 (annotated)
- Committer:
- pavledjo
- Date:
- Thu Jul 01 15:47:18 2021 +0000
- Revision:
- 10:37b8f497b698
- Parent:
- 0:38c206f19bb7
promena za dva senzora;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MikkoZ | 0:38c206f19bb7 | 1 | /* Copyright 2016 Rohm Semiconductor |
MikkoZ | 0:38c206f19bb7 | 2 | |
MikkoZ | 0:38c206f19bb7 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); |
MikkoZ | 0:38c206f19bb7 | 4 | you may not use this file except in compliance with the License. |
MikkoZ | 0:38c206f19bb7 | 5 | You may obtain a copy of the License at |
MikkoZ | 0:38c206f19bb7 | 6 | |
MikkoZ | 0:38c206f19bb7 | 7 | http://www.apache.org/licenses/LICENSE-2.0 |
MikkoZ | 0:38c206f19bb7 | 8 | |
MikkoZ | 0:38c206f19bb7 | 9 | Unless required by applicable law or agreed to in writing, software |
MikkoZ | 0:38c206f19bb7 | 10 | distributed under the License is distributed on an "AS IS" BASIS, |
MikkoZ | 0:38c206f19bb7 | 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
MikkoZ | 0:38c206f19bb7 | 12 | See the License for the specific language governing permissions and |
MikkoZ | 0:38c206f19bb7 | 13 | limitations under the License. |
MikkoZ | 0:38c206f19bb7 | 14 | */ |
MikkoZ | 0:38c206f19bb7 | 15 | #ifndef i2c_common_h |
MikkoZ | 0:38c206f19bb7 | 16 | #define i2c_common_h |
MikkoZ | 0:38c206f19bb7 | 17 | /* i2c common functions |
MikkoZ | 0:38c206f19bb7 | 18 | This interface is the same for Arduino hardware i2c lib Wire, Arduino software i2c lib SoftI2CMaster and mbed hardware lib I2C. |
MikkoZ | 0:38c206f19bb7 | 19 | Choosing between them is done by compile time using flags, for mbed use USE_MBED_HARDWARE_I2C -flag. |
MikkoZ | 0:38c206f19bb7 | 20 | Note: This method doesn't allow multiple i2c busses to be used at same time. |
MikkoZ | 0:38c206f19bb7 | 21 | */ |
MikkoZ | 0:38c206f19bb7 | 22 | #include "rohm_hal.h" //types, DEBUG_print*, USE_*_HARDWARE_I2C |
MikkoZ | 0:38c206f19bb7 | 23 | |
MikkoZ | 0:38c206f19bb7 | 24 | bool I2CCommonBegin(); |
pavledjo | 10:37b8f497b698 | 25 | uint8_t read_register(uint8_t sad, uint8_t reg, uint8_t* buf, uint8_t buf_len,int n); |
pavledjo | 10:37b8f497b698 | 26 | void write_registers(uint8_t sad, uint8_t reg, uint8_t* data, uint8_t data_len,int n); |
pavledjo | 10:37b8f497b698 | 27 | void write_register(uint8_t sad, uint8_t reg, uint8_t data,int n); |
pavledjo | 10:37b8f497b698 | 28 | bool change_bits(uint8_t sad, uint8_t reg, uint8_t mask, uint8_t bits,int n); |
MikkoZ | 0:38c206f19bb7 | 29 | |
MikkoZ | 0:38c206f19bb7 | 30 | #endif |
MikkoZ | 0:38c206f19bb7 | 31 | |
MikkoZ | 0:38c206f19bb7 | 32 |