Skip to content

Commit

Permalink
Merge pull request #12 from akkoyun/01.04.03
Browse files Browse the repository at this point in the history
01.04.03 - Initial update
  • Loading branch information
akkoyun authored Mar 7, 2022
2 parents 86ed05f + 6f82675 commit eb07409
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
![GitHub release (latest by date)](https://img.shields.io/github/v/release/akkoyun/I2C_Functions) ![arduino-library-badge](https://www.ardu-badge.com/badge/I2C_Functions.svg?) ![Visits Badge](https://badges.pufler.dev/visits/akkoyun/I2C_Functions) ![GitHub stars](https://img.shields.io/github/stars/akkoyun/I2C_Functions?style=flat&logo=github) ![Updated Badge](https://badges.pufler.dev/updated/akkoyun/I2C_Functions) ![PlatformIO Registry](https://badges.registry.platformio.org/packages/akkoyun/library/I2C_Functions.svg)
[![Check Arduino](https://github.com/akkoyun/I2C_Functions/actions/workflows/check-arduino.yml/badge.svg)](https://github.com/akkoyun/I2C_Functions/actions/workflows/check-arduino.yml) [![Compile Examples](https://github.com/akkoyun/I2C_Functions/actions/workflows/compile-examples.yml/badge.svg)](https://github.com/akkoyun/I2C_Functions/actions/workflows/compile-examples.yml) [![Spell Check](https://github.com/akkoyun/I2C_Functions/actions/workflows/spell-check.yml/badge.svg)](https://github.com/akkoyun/I2C_Functions/actions/workflows/spell-check.yml)

Build - 01.04.02
Build - 01.04.03

---

Expand Down
2 changes: 1 addition & 1 deletion examples/Device_Control/Device_Control.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void setup() {
void loop() {

// Sensor Detect
bool _Sensor_Control = I2C.Control_Device(__ADDR_HDC2010__);
bool _Sensor_Control = I2C.Control_Device(I2C.HDC2010.I2C_Address);

// Print Sensor Detect
Serial.print("Device Status : ");
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "I2C_Functions",
"version": "1.4.2",
"version": "1.4.3",
"keywords": "I2C, Sensor, Data, Communication, Multiplexer, Detect, Register, Functions, Converter, bit Functions ",
"description": "This is a helper library to abstract away I2C transactions and registers.",
"authors": {
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=I2C_Functions
version=1.4.2
version=1.4.3
author=Gunce Akkoyun <[email protected]>
maintainer=Gunce Akkoyun <[email protected]>
sentence=Generic I2C data communication standard functions.
Expand Down
15 changes: 12 additions & 3 deletions src/I2C_Functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ class _I2C_Functions {

public:

// Sensor Definations
I2C_Sensor TCA9548 {0x70, "TCA9548", "Texas", "I2C Multiplexer"};
I2C_Sensor RV3028C7 {0x52, "RV-3028-C7", "Seiko", "RTC"};
I2C_Sensor DS28C {0x50, "DS28C", "Maxim", "Serial ID"};
I2C_Sensor HDC2010 {0x40, "HDC2010", "Texas", "T/H Sensor"};
I2C_Sensor MAX17055 {0x36, "MAX17055", "Maxim", "Battery Gauge"};
I2C_Sensor BQ24298 {0x6B, "BQ24298", "Texas", "Charger IC"};
I2C_Sensor SHT21 {0x40, "SHT21", "Sensirion", "T/H Sensor"};

// Public Variables
uint8_t _Multiplexer_Current_Channel = 0;

// Register Functions
uint8_t Read_Register(uint8_t _Address, uint8_t _Register);
bool Read_Multiple_Register(uint8_t _Address, uint8_t _Register, uint8_t * _Data, uint8_t _Length, bool _Stop);
Expand All @@ -50,9 +62,6 @@ class _I2C_Functions {

private:

// Private Variables
uint8_t _Multiplexer_Current_Channel = 0;

};

extern _I2C_Functions I2C;
Expand Down
15 changes: 7 additions & 8 deletions src/I2C_Sensor_Library.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
#ifndef __I2C_SENSOR_LIBRARY__
#define __I2C_SENSOR_LIBRARY__

enum I2C_Address {
__ADDR_TCA9548__ = (uint8_t)0x70,
__ADDR_RV3028C7__ = (uint8_t)0x52,
__ADDR_DS28C__ = (uint8_t)0x50,
__ADDR_HDC2010__ = (uint8_t)0x40,
__ADDR_MAX17055__ = (uint8_t)0x36,
__ADDR_BQ24298__ = (uint8_t)0x6B,
__ADDR_SHT21__ = (uint8_t)0x40
// Sensor Defination Structure
struct I2C_Sensor {
uint8_t I2C_Address;
char Sensor_Name[12];
char Sensor_Vendor[12];
char Sensor_Type[16];
};

enum Multiplexer_Channels {
__OFF__ = (uint8_t)0,
__CH1__ = (uint8_t)1,
Expand Down

0 comments on commit eb07409

Please sign in to comment.