From a82ccdc2cd5fb328273016b0ae477b8aeada3231 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Sun, 25 Oct 2020 15:19:38 +0100 Subject: [PATCH] merge conflicts... --- .../AT24C256_512/Eeprom24C128_256.cpp | 0 .../AT24C256_512/Eeprom24C128_256.h | 0 .../AT24C256_512/Eeprom24C512.cpp | 0 .../AT24C256_512/Eeprom24C512.h | 0 .../AT24C256_512/library.properties | 0 lib_div/AT24C256/Eeprom24C128_256.cpp | 334 ------------------ lib_div/AT24C256/Eeprom24C128_256.h | 212 ----------- lib_div/AT24C256/library.properties | 9 - 8 files changed, 555 deletions(-) rename {lib => lib_basic}/AT24C256_512/Eeprom24C128_256.cpp (100%) rename {lib => lib_basic}/AT24C256_512/Eeprom24C128_256.h (100%) rename {lib => lib_basic}/AT24C256_512/Eeprom24C512.cpp (100%) rename {lib => lib_basic}/AT24C256_512/Eeprom24C512.h (100%) rename {lib => lib_basic}/AT24C256_512/library.properties (100%) delete mode 100644 lib_div/AT24C256/Eeprom24C128_256.cpp delete mode 100644 lib_div/AT24C256/Eeprom24C128_256.h delete mode 100644 lib_div/AT24C256/library.properties diff --git a/lib/AT24C256_512/Eeprom24C128_256.cpp b/lib_basic/AT24C256_512/Eeprom24C128_256.cpp similarity index 100% rename from lib/AT24C256_512/Eeprom24C128_256.cpp rename to lib_basic/AT24C256_512/Eeprom24C128_256.cpp diff --git a/lib/AT24C256_512/Eeprom24C128_256.h b/lib_basic/AT24C256_512/Eeprom24C128_256.h similarity index 100% rename from lib/AT24C256_512/Eeprom24C128_256.h rename to lib_basic/AT24C256_512/Eeprom24C128_256.h diff --git a/lib/AT24C256_512/Eeprom24C512.cpp b/lib_basic/AT24C256_512/Eeprom24C512.cpp similarity index 100% rename from lib/AT24C256_512/Eeprom24C512.cpp rename to lib_basic/AT24C256_512/Eeprom24C512.cpp diff --git a/lib/AT24C256_512/Eeprom24C512.h b/lib_basic/AT24C256_512/Eeprom24C512.h similarity index 100% rename from lib/AT24C256_512/Eeprom24C512.h rename to lib_basic/AT24C256_512/Eeprom24C512.h diff --git a/lib/AT24C256_512/library.properties b/lib_basic/AT24C256_512/library.properties similarity index 100% rename from lib/AT24C256_512/library.properties rename to lib_basic/AT24C256_512/library.properties diff --git a/lib_div/AT24C256/Eeprom24C128_256.cpp b/lib_div/AT24C256/Eeprom24C128_256.cpp deleted file mode 100644 index f7b66afba..000000000 --- a/lib_div/AT24C256/Eeprom24C128_256.cpp +++ /dev/null @@ -1,334 +0,0 @@ -/**************************************************************************//** - * \brief EEPROM 24C128 / 24C256 library for Arduino - * \author Copyright (C) 2012 Julien Le Sech - www.idreammicro.com - * \version 1.0 - * \date 20120203 - * - * This file is part of the EEPROM 24C128 / 24C256 library for Arduino. - * - * This library is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) any - * later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ - ******************************************************************************/ - -/**************************************************************************//** - * \file Eeprom24C128_256.cpp - ******************************************************************************/ - -/****************************************************************************** - * Header file inclusions. - ******************************************************************************/ - -#include -#include - -#include - -/****************************************************************************** - * Private macro definitions. - ******************************************************************************/ - -/**************************************************************************//** - * \def EEPROM__PAGE_SIZE - * \brief Size of a page in EEPROM memory. - * This size is given by EEPROM memory datasheet. - ******************************************************************************/ -#define EEPROM__PAGE_SIZE 64 - -/**************************************************************************//** - * \def EEPROM__RD_BUFFER_SIZE - * \brief Size of input TWI buffer. - * This size is equal to BUFFER_LENGTH defined in Wire library (32 bytes). - ******************************************************************************/ - #define xBUFFER_LENGTH 24 -#define EEPROM__RD_BUFFER_SIZE xBUFFER_LENGTH - -/**************************************************************************//** - * \def EEPROM__WR_BUFFER_SIZE - * \brief Size of output TWI buffer. - * This size is equal to BUFFER_LENGTH - 2 bytes reserved for address. - ******************************************************************************/ -#define EEPROM__WR_BUFFER_SIZE (xBUFFER_LENGTH - 2) - -/****************************************************************************** - * Public method definitions. - ******************************************************************************/ - -/**************************************************************************//** - * \fn Eeprom24C128_256::Eeprom24C128_256(byte deviceAddress) - * - * \brief Constructor. - * - * \param deviceAddress EEPROM address on TWI bus. - ******************************************************************************/ -Eeprom24C128_256::Eeprom24C128_256 -( - byte deviceAddress -){ - m_deviceAddress = deviceAddress; -} - -/**************************************************************************//** - * \fn void Eeprom24C128_256::initialize() - * - * \brief Initialize library and TWI bus. - * - * If several devices are connected to TWI bus, this method mustn't be - * called. TWI bus must be initialized out of this library using - * Wire.begin() method. - ******************************************************************************/ -void -Eeprom24C128_256::initialize() -{ - Wire.begin(); -} - -/**************************************************************************//** - * \fn void Eeprom24C128_256::writeByte( - * word address, - * byte data) - * - * \brief Write a byte in EEPROM memory. - * - * \remarks A delay of 10 ms is required after write cycle. - * - * \param address Address. - * \param data Byte to write. - ******************************************************************************/ -void -Eeprom24C128_256::writeByte -( - word address, - byte data -){ - Wire.beginTransmission(m_deviceAddress); - Wire.write(address >> 8); - Wire.write(address & 0xFF); - Wire.write(data); - Wire.endTransmission(); -} - -/**************************************************************************//** - * \fn void Eeprom24C128_256::writeBytes( - * word address, - * word length, - * byte* p_data) - * - * \brief Write bytes in EEPROM memory. - * - * \param address Start address. - * \param length Number of bytes to write. - * \param[in] p_data Bytes to write. - ******************************************************************************/ -void -Eeprom24C128_256::writeBytes -( - word address, - word length, - byte* p_data -){ - // Write first page if not aligned. - byte notAlignedLength = 0; - byte pageOffset = address % EEPROM__PAGE_SIZE; - if (pageOffset > 0) - { - notAlignedLength = EEPROM__PAGE_SIZE - pageOffset; - if (length < notAlignedLength) - { - notAlignedLength = length; - } - writePage(address, notAlignedLength, p_data); - length -= notAlignedLength; - } - - if (length > 0) - { - address += notAlignedLength; - p_data += notAlignedLength; - - // Write complete and aligned pages. - word pageCount = length / EEPROM__PAGE_SIZE; - for (word i = 0; i < pageCount; i++) - { - writePage(address, EEPROM__PAGE_SIZE, p_data); - address += EEPROM__PAGE_SIZE; - p_data += EEPROM__PAGE_SIZE; - length -= EEPROM__PAGE_SIZE; - } - - if (length > 0) - { - // Write remaining uncomplete page. - writePage(address, length, p_data); - } - } -} - -/**************************************************************************//** - * \fn byte Eeprom24C128_256::readByte(word address) - * - * \brief Read a byte in EEPROM memory. - * - * \param address Address. - * - * \return Read byte. - ******************************************************************************/ -byte -Eeprom24C128_256::readByte -( - word address -){ - Wire.beginTransmission(m_deviceAddress); - Wire.write(address >> 8); - Wire.write(address & 0xFF); - Wire.endTransmission(); - Wire.requestFrom(m_deviceAddress, (byte)1); - byte data = 0; - if (Wire.available()) - { - data = Wire.read(); - } - return data; -} - -/**************************************************************************//** - * \fn void Eeprom24C128_256::readBytes( - * word address, - * word length, - * byte* p_data) - * - * \brief Read bytes in EEPROM memory. - * - * \param address Start address. - * \param length Number of bytes to read. - * \patam[in] p_data Byte array to fill with read bytes. - ******************************************************************************/ -void -Eeprom24C128_256::readBytes -( - word address, - word length, - byte* p_data -){ - byte bufferCount = length / EEPROM__RD_BUFFER_SIZE; - for (byte i = 0; i < bufferCount; i++) - { - word offset = i * EEPROM__RD_BUFFER_SIZE; - readBuffer(address + offset, EEPROM__RD_BUFFER_SIZE, p_data + offset); - } - - byte remainingBytes = length % EEPROM__RD_BUFFER_SIZE; - word offset = length - remainingBytes; - readBuffer(address + offset, remainingBytes, p_data + offset); -} - -/****************************************************************************** - * Private method definitions. - ******************************************************************************/ - -/**************************************************************************//** - * \fn void Eeprom24C128_256::writePage( - * word address, - * byte length, - * byte* p_data) - * - * \brief Write page in EEPROM memory. - * - * \param address Start address. - * \param length Number of bytes (EEPROM__PAGE_SIZE bytes max). - * \param[in] p_data Data. - ******************************************************************************/ -void -Eeprom24C128_256::writePage -( - word address, - byte length, - byte* p_data -){ - // Write complete buffers. - byte bufferCount = length / EEPROM__WR_BUFFER_SIZE; - for (byte i = 0; i < bufferCount; i++) - { - byte offset = i * EEPROM__WR_BUFFER_SIZE; - writeBuffer(address + offset, EEPROM__WR_BUFFER_SIZE, p_data + offset); - } - - // Write remaining bytes. - byte remainingBytes = length % EEPROM__WR_BUFFER_SIZE; - byte offset = length - remainingBytes; - writeBuffer(address + offset, remainingBytes, p_data + offset); -} - -/**************************************************************************//** - * \fn void Eeprom24C128_256::writeBuffer( - * word address, - * byte length, - * byte* p_data) - * - * \brief Write bytes into memory. - * - * \param address Start address. - * \param length Number of bytes (EEPROM__WR_BUFFER_SIZE bytes max). - * \param[in] p_data Data. - ******************************************************************************/ -void -Eeprom24C128_256::writeBuffer -( - word address, - byte length, - byte* p_data -){ - Wire.beginTransmission(m_deviceAddress); - Wire.write(address >> 8); - Wire.write(address & 0xFF); - for (byte i = 0; i < length; i++) - { - Wire.write(p_data[i]); - } - Wire.endTransmission(); - - // Write cycle time (tWR). See EEPROM memory datasheet for more details. - delay(10); -} - -/**************************************************************************//** - * \fn void Eeprom24C128_256::readBuffer( - * word address, - * byte length, - * byte* p_data) - * - * \brief Read bytes in memory. - * - * \param address Start address. - * \param length Number of bytes (EEPROM__RD_BUFFER_SIZE bytes max). - * \param[in] p_data Buffer to fill with read bytes. - ******************************************************************************/ -void -Eeprom24C128_256::readBuffer -( - word address, - byte length, - byte* p_data -){ - Wire.beginTransmission(m_deviceAddress); - Wire.write(address >> 8); - Wire.write(address & 0xFF); - Wire.endTransmission(); - Wire.requestFrom(m_deviceAddress, length); - for (byte i = 0; i < length; i++) - { - if (Wire.available()) - { - p_data[i] = Wire.read(); - } - } -} diff --git a/lib_div/AT24C256/Eeprom24C128_256.h b/lib_div/AT24C256/Eeprom24C128_256.h deleted file mode 100644 index 865c76226..000000000 --- a/lib_div/AT24C256/Eeprom24C128_256.h +++ /dev/null @@ -1,212 +0,0 @@ -/**************************************************************************//** - * \brief EEPROM 24C128 / 24C256 library for Arduino - * \author Copyright (C) 2012 Julien Le Sech - www.idreammicro.com - * \version 1.0 - * \date 20120203 - * - * This file is part of the EEPROM 24C128 / 24C256 library for Arduino. - * - * This library is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) any - * later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ - ******************************************************************************/ - -/**************************************************************************//** - * \headerfile Eeprom24C128_256.h - ******************************************************************************/ - -#ifndef Eeprom24C128_256_h -#define Eeprom24C128_256_h - -/****************************************************************************** - * Header file inclusion. - ******************************************************************************/ - -#include - -/**************************************************************************//** - * \class Eeprom24C128_256 - * - * \brief EEPROM 24C128 / 24C256 memory driver. - * - * This driver is mainly designed for 24C128 and 24C256 EEPROM memories. It's - * also suitable for 24C512 memories. - ******************************************************************************/ -class Eeprom24C128_256 -{ - public: - - /******************************************************************//** - * \fn Eeprom24C128_256(byte deviceAddress) - * - * \brief Constructor. - * - * \param deviceAddress EEPROM address on TWI bus. - **********************************************************************/ - Eeprom24C128_256 - ( - byte deviceAddress - ); - - /******************************************************************//** - * \fn void initialize() - * - * \brief Initialize library abnd TWI bus. - * - * If several devices are connected to TWI bus, this method mustn't be - * called. TWI bus must be initialized out of this library using - * Wire.begin() method. - **********************************************************************/ - void - initialize(); - - /******************************************************************//** - * \fn void writeByte( - * word address, - * byte data) - * - * \brief Write a byte in EEPROM memory. - * - * \remarks A delay of 10 ms is required after write cycle. - * - * \param address Address. - * \param data Byte to write. - **********************************************************************/ - void - writeByte - ( - word address, - byte data - ); - - /******************************************************************//** - * \fn void writeBytes( - * word address, - * word length, - * byte* p_data) - * - * \brief Write bytes in EEPROM memory. - * - * \param address Start address. - * \param length Number of bytes to write. - * \param[in] p_data Bytes to write. - **********************************************************************/ - void - writeBytes - ( - word address, - word length, - byte* p_data - ); - - /******************************************************************//** - * \fn byte readByte(word address) - * - * \brief Read a byte in EEPROM memory. - * - * \param address Address. - * - * \return Read byte. - **********************************************************************/ - byte - readByte - ( - word address - ); - - /******************************************************************//** - * \fn void readBytes( - * word address, - * word length, - * byte* p_data) - * - * \brief Read bytes in EEPROM memory. - * - * \param address Start address. - * \param length Number of bytes to read. - * \patam[in] p_data Byte array to fill with read bytes. - **********************************************************************/ - void - readBytes - ( - word address, - word length, - byte* p_buffer - ); - - private: - - byte m_deviceAddress; - - /******************************************************************//** - * \fn void writePage( - * word address, - * byte length, - * byte* p_data) - * - * \brief Write page in EEPROM memory. - * - * \param address Start address. - * \param length Number of bytes (64 bytes max). - * \param[in] p_data Data. - **********************************************************************/ - void - writePage - ( - word address, - byte length, - byte* p_data - ); - - /******************************************************************//** - * \fn void writeBuffer( - * word address, - * byte length, - * byte* p_data) - * - * \brief Write bytes into memory. - * - * \param address Start address. - * \param length Number of bytes (30 bytes max). - * \param[in] p_date Data. - **********************************************************************/ - void - writeBuffer - ( - word address, - byte length, - byte* p_data - ); - - /******************************************************************//** - * \fn void readBuffer( - * word address, - * byte length, - * byte* p_data) - * - * \brief Read bytes in memory. - * - * \param address Start address. - * \param length Number of bytes to read (32 bytes max). - * \param[in] p_data Buffer to fill with read bytes. - **********************************************************************/ - void - readBuffer - ( - word address, - byte length, - byte* p_data - ); -}; - -#endif // Eeprom24C128_256_h - diff --git a/lib_div/AT24C256/library.properties b/lib_div/AT24C256/library.properties deleted file mode 100644 index 648e89096..000000000 --- a/lib_div/AT24C256/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=EEPROM 24C128 -version= -author=Julien Le Sech -maintainer=Julien Le Sech - www.idreammicro.com -sentence=EEPROM 24C128 / 24C256 memory driver. -paragraph=EEPROM 24C128 / 24C256 memory driver. -category= -url= -architectures=*