Skip to content

Commit

Permalink
Add Arduino UNO R4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
xreef committed Jul 11, 2023
1 parent 5b1a7ee commit f3d3022
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions PCF8591.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ PCF8591::PCF8591(uint8_t address){
_address = address;
};

#if !defined(__AVR) && !defined(ARDUINO_ARCH_SAMD) && !defined(TEENSYDUINO)
#if !defined(__AVR) && !defined(ARDUINO_ARCH_SAMD) && !defined(TEENSYDUINO) && !defined(ARDUINO_ARCH_RENESAS)
/**
* Constructor
* @param address: i2c address
Expand All @@ -56,7 +56,7 @@ PCF8591::PCF8591(uint8_t address, int sda, int scl){

#endif

#if defined(ESP32) || defined(ARDUINO_ARCH_SAMD)|| defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_ARCH_STM32)
#if defined(ESP32) || defined(ARDUINO_ARCH_SAMD)|| defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_RENESAS)
/**
* Constructor
* @param address: i2c address
Expand Down Expand Up @@ -144,7 +144,7 @@ PCF8591::PCF8591(uint8_t address, int sda, int scl){
* wake up i2c controller
*/
void PCF8591::begin(){
#if !defined(__AVR) && !defined(ARDUINO_ARCH_SAMD) && !defined(TEENSYDUINO)
#if !defined(__AVR) && !defined(ARDUINO_ARCH_SAMD) && !defined(TEENSYDUINO) && !defined(ARDUINO_ARCH_RENESAS)
DEBUG_PRINT(F("begin(sda, scl) -> "));DEBUG_PRINT(_sda);DEBUG_PRINT(F(" "));DEBUG_PRINTLN(_scl);
// _wire->begin(_sda, _scl);
#ifdef ARDUINO_ARCH_STM32
Expand Down
4 changes: 2 additions & 2 deletions PCF8591.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ class PCF8591 {

PCF8591(uint8_t address);

#if !defined(__AVR) && !defined(ARDUINO_ARCH_SAMD) && !defined(TEENSYDUINO)
#if !defined(__AVR) && !defined(ARDUINO_ARCH_SAMD) && !defined(TEENSYDUINO) && !defined(ARDUINO_ARCH_RENESAS)
PCF8591(uint8_t address, int sda, int scl);
#endif

#if defined(ESP32) || defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_ARCH_STM32)
#if defined(ESP32) || defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_RENESAS)
///// changes for second i2c bus
PCF8591(TwoWire *pWire, uint8_t address);
#endif
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ You can find updated version of documentation on my site​ [PCF8591](https://ww

Library to use i2c analog IC with arduino and esp8266. Can read analog value and write analog value with only 2 wire (perfect for ESP-01).

- 10/07/2023: v1.1.1 Add support for Arduino UNO R4
- 16/02/2023: v1.1.0
- Fix STM32 support and add support for Raspberry Pi Pico and other rp2040 boards
- Add support for custom SERCOM interface of Arduino SAMD devices. Force SDA SCL to use GPIO numeration for STM32 bug (https://www.mischianti.org/forums/topic/compatible-with-stm32duino/).
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": "PCF8591 library",
"version": "1.1.0",
"version": "1.1.1",
"keywords": "analog, digital, i2c, encoder, expander, pcf8591, pcf8591a, esp32, esp8266, stm32, SAMD, Arduino, wire, Raspberry, rp2040",
"description": "PCF8591 library. i2c digital expander for i2c digital expander for Arduino, Raspberry Pi Pico and rp2040 boards, esp32, SMT32 and ESP8266. Can read write digital values with only 2 wire. Very simple to use and encoder support.",
"homepage": "https://www.mischianti.org/2019/01/03/pcf8591-i2c-analog-i-o-expander/",
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=PCF8591 library
version=1.1.0
version=1.1.1
author=Renzo Mischianti <[email protected]>
maintainer=Renzo Mischianti <[email protected]>
sentence=PCF8591, library for Arduino, Raspberry Pi Pico and rp2040 boards, esp32, SMT32 and ESP8266.
Expand Down

0 comments on commit f3d3022

Please sign in to comment.