2019-10-16 21:14:34 +02:00
|
|
|
#ifndef _I2C_H
|
|
|
|
#define _I2C_H
|
2019-09-02 16:53:39 +02:00
|
|
|
|
|
|
|
#include <Arduino.h>
|
2022-08-19 16:35:02 +02:00
|
|
|
#include <Wire.h>
|
2020-10-14 10:29:13 +02:00
|
|
|
#include <BitBang_I2C.h>
|
2022-08-07 12:44:25 +02:00
|
|
|
#include <Wire.h>
|
|
|
|
|
|
|
|
#ifndef MY_DISPLAY_SDA
|
|
|
|
#define MY_DISPLAY_SDA SDA
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef MY_DISPLAY_SCL
|
|
|
|
#define MY_DISPLAY_SCL SCL
|
|
|
|
#endif
|
2019-09-07 19:52:25 +02:00
|
|
|
|
|
|
|
#define SSD1306_PRIMARY_ADDRESS (0x3D)
|
|
|
|
#define SSD1306_SECONDARY_ADDRESS (0x3C)
|
|
|
|
#define BME_PRIMARY_ADDRESS (0x77)
|
|
|
|
#define BME_SECONDARY_ADDRESS (0x76)
|
|
|
|
#define AXP192_PRIMARY_ADDRESS (0x34)
|
2020-05-01 12:23:46 +02:00
|
|
|
#define IP5306_PRIMARY_ADDRESS (0x75)
|
2019-09-07 19:52:25 +02:00
|
|
|
#define MCP_24AA02E64_PRIMARY_ADDRESS (0x50)
|
|
|
|
#define QUECTEL_GPS_PRIMARY_ADDRESS (0x10)
|
2019-09-02 16:53:39 +02:00
|
|
|
|
2021-03-31 21:43:51 +02:00
|
|
|
extern SemaphoreHandle_t I2Caccess;
|
|
|
|
|
2019-10-16 21:14:34 +02:00
|
|
|
void i2c_init(void);
|
|
|
|
void i2c_deinit(void);
|
2020-10-14 10:29:13 +02:00
|
|
|
void i2c_scan(void);
|
2021-01-30 17:54:34 +01:00
|
|
|
int i2c_readBytes(uint8_t addr, uint8_t reg, uint8_t *data, uint8_t len);
|
|
|
|
int i2c_writeBytes(uint8_t addr, uint8_t reg, uint8_t *data, uint8_t len);
|
2019-09-02 16:53:39 +02:00
|
|
|
|
|
|
|
#endif
|