Skip to content

Commit

Permalink
Add Wire1 support for ESP32
Browse files Browse the repository at this point in the history
  • Loading branch information
RobTillaart committed Sep 24, 2023
1 parent 98f53c5 commit 48fc7e2
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 20 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## [0.4.7] - 2023-09-24
- add Wire1 support for ESP32
- update readme.md
- minor edits


## [0.4.6] - 2023-05-24
- renaming #defines PCA963X... to prepare merge with PCA9634.
- old defines will work until next major release
- update keywords.txt


## [0.4.5] - 2023-04-26
- add **writeLedOut(reg, mask)** experimental
- add **readLedOut(reg)** experimental
Expand Down
9 changes: 4 additions & 5 deletions PCA9635.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// FILE: PCA9635.cpp
// AUTHOR: Rob Tillaart
// DATE: 23-apr-2016
// VERSION: 0.4.6
// PURPOSE: Arduino library for PCA9635 I2C LED driver
// VERSION: 0.4.7
// PURPOSE: Arduino library for PCA9635 I2C LED driver, 16 channel PWM, 8 bit
// URL: https://github.com/RobTillaart/PCA9635


Expand All @@ -12,7 +12,7 @@

//////////////////////////////////////////////////////////////
//
// Constructor
// CONSTRUCTOR
//
PCA9635::PCA9635(const uint8_t deviceAddress, TwoWire *wire)
{
Expand All @@ -27,7 +27,6 @@ PCA9635::PCA9635(const uint8_t deviceAddress, TwoWire *wire)
#if defined (ESP8266) || defined(ESP32)
bool PCA9635::begin(int sda, int scl, uint8_t mode1_mask, uint8_t mode2_mask)
{
_wire = &Wire;
if ((sda < 255) && (scl < 255))
{
_wire->begin(sda, scl);
Expand Down Expand Up @@ -509,7 +508,7 @@ uint8_t PCA9635::readLedOut(uint8_t reg)
}


// todo move to right section after testing.
// TODO move to right section after testing.
uint8_t PCA9635::setLedDriverMode(uint8_t mode)
{
if (mode > 3) return PCA963X_ERR_MODE;
Expand Down
14 changes: 7 additions & 7 deletions PCA9635.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
// FILE: PCA9635.h
// AUTHOR: Rob Tillaart
// DATE: 23-apr-2016
// VERSION: 0.4.6
// PURPOSE: Arduino library for PCA9635 I2C LED driver, 16 channel
// VERSION: 0.4.7
// PURPOSE: Arduino library for PCA9635 I2C LED driver, 16 channel PWM, 8 bit
// URL: https://github.com/RobTillaart/PCA9635


#include "Arduino.h"
#include "Wire.h"


#define PCA9635_LIB_VERSION (F("0.4.6"))
#define PCA9635_LIB_VERSION (F("0.4.7"))


// mode codes
// NEW
// NEW
#define PCA963X_MODE1 0x00
#define PCA963X_MODE2 0x01
// OLD
Expand Down Expand Up @@ -51,7 +51,7 @@
#define PCA9635_LEDGRPPWM 0x03

// Error codes
// NEW
// NEW
#define PCA963X_OK 0x00
#define PCA963X_ERROR 0xFF
#define PCA963X_ERR_WRITE 0xFE
Expand All @@ -70,7 +70,7 @@


// Configuration bits MODE1 register
// NEW
// NEW
#define PCA963X_MODE1_AUTOINCR2 0x80 // ReadOnly, 0 = disable 1 = enable
#define PCA963X_MODE1_AUTOINCR1 0x40 // ReadOnly, bit1
#define PCA963X_MODE1_AUTOINCR0 0x20 // ReadOnly, bit0
Expand All @@ -80,7 +80,7 @@
#define PCA963X_MODE1_SUB3 0x02 // 0 = disable 1 = enable
#define PCA963X_MODE1_ALLCALL 0x01 // 0 = disable 1 = enable
#define PCA963X_MODE1_NONE 0x00
// OLD
// OLD
#define PCA9635_MODE1_AUTOINCR2 0x80 // ReadOnly, 0 = disable 1 = enable
#define PCA9635_MODE1_AUTOINCR1 0x40 // ReadOnly, bit1
#define PCA9635_MODE1_AUTOINCR0 0x20 // ReadOnly, bit0
Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
[![Arduino CI](https://github.com/RobTillaart/PCA9635/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
[![Arduino-lint](https://github.com/RobTillaart/PCA9635/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/PCA9635/actions/workflows/arduino-lint.yml)
[![JSON check](https://github.com/RobTillaart/PCA9635/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/PCA9635/actions/workflows/jsoncheck.yml)
[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/PCA9635.svg)](https://github.com/RobTillaart/PCA9635/issues)

[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/PCA9635/blob/master/LICENSE)
[![GitHub release](https://img.shields.io/github/release/RobTillaart/PCA9635.svg?maxAge=3600)](https://github.com/RobTillaart/PCA9635/releases)
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/PCA9635.svg)](https://registry.platformio.org/libraries/robtillaart/PCA9635)


# PCA9635

Arduino library for PCA9635 I2C 8 bit PWM LED driver, 16 channel.
Arduino library for PCA9635 I2C LED driver, 16 channel PWM, 8 bit.


## Description
Expand Down Expand Up @@ -335,3 +338,12 @@ PCA.writeLedOut(1, mask);
- **setGroupPWM()**
- PWM also in %% ? (trivial for user)


## Support

If you appreciate my libraries, you can support the development and maintenance.
Improve the quality of the libraries by providing issues and Pull Requests, or
donate through PayPal or GitHub sponsors.

Thank you,

6 changes: 3 additions & 3 deletions library.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "PCA9635",
"keywords": "I2C,PCA9635,PWM",
"description": "Arduino library for PCA9635 I2C LED driver, 16 channel",
"description": "Arduino library for PCA9635 I2C LED driver, 16 channel PWM, 8 bit.",
"authors":
[
{
Expand All @@ -15,9 +15,9 @@
"type": "git",
"url": "https://github.com/RobTillaart/PCA9635.git"
},
"version": "0.4.6",
"version": "0.4.7",
"license": "MIT",
"frameworks": "arduino",
"frameworks": "*",
"platforms": "*",
"headers": "PCA9635.h"
}
6 changes: 3 additions & 3 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name=PCA9635
version=0.4.6
version=0.4.7
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Arduino library for PCA9635 I2C LED driver 16 channel
paragraph=PWM, 8 bit
sentence=Arduino library for PCA9635 I2C LED driver, 16 channel PWM, 8 bit.
paragraph=
category=Signal Input/Output
url=https://github.com/RobTillaart/PCA9635
architectures=*
Expand Down

0 comments on commit 48fc7e2

Please sign in to comment.