nanoFramework.Iot.Device.At24cxx
1.0.50
Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package nanoFramework.Iot.Device.At24cxx --version 1.0.50
NuGet\Install-Package nanoFramework.Iot.Device.At24cxx -Version 1.0.50
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="nanoFramework.Iot.Device.At24cxx" Version="1.0.50" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add nanoFramework.Iot.Device.At24cxx --version 1.0.50
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: nanoFramework.Iot.Device.At24cxx, 1.0.50"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install nanoFramework.Iot.Device.At24cxx as a Cake Addin #addin nuget:?package=nanoFramework.Iot.Device.At24cxx&version=1.0.50 // Install nanoFramework.Iot.Device.At24cxx as a Cake Tool #tool nuget:?package=nanoFramework.Iot.Device.At24cxx&version=1.0.50
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
At24cxx family of I2C EEPROM
The At24cxx is a family of Serial EEPROM utilizing an I2C (2-wire) serial interface.
Documentation
This implementation supports the following devices:
Usage
Important: I2C pins for the ESP32 must be properly setup the before creating the I2cDevice
. For this, make sure you install the nanoFramework.Hardware.Esp32
NuGet and use the Configuration
class to configure the pins:
// When connecting with an ESP32 device you will need to configure the I2C GPIOs used for the bus.
Configuration.SetPinFunction(Gpio.IO21, DeviceFunction.I2C1_DATA);
Configuration.SetPinFunction(Gpio.IO22, DeviceFunction.I2C1_CLOCK);
For other devices like STM32, please make sure you're using the preset pins for the I2C bus you want to use.
using Iot.Device.At24cxx;
using nanoFramework.Hardware.Esp32;
using System.Device.I2c;
using System.Diagnostics;
using System.Text;
using System.Threading;
// Setup ESP32 I2C port.
Configuration.SetPinFunction(Gpio.IO21, DeviceFunction.I2C1_DATA);
Configuration.SetPinFunction(Gpio.IO22, DeviceFunction.I2C1_CLOCK);
// Setup At24c32c device.
I2cConnectionSettings settings = new I2cConnectionSettings(1, At24c32.DefaultI2cAddress);
I2cDevice i2cDevice = new I2cDevice(settings);
At24c32 eeprom = new At24c32(i2cDevice);
// Write string to device.
string message = "Hello from nanoFramework!";
byte[] encodedMessage = Encoding.UTF8.GetBytes(message);
int messageAddress = 0x0;
uint writeResult = eeprom.Write(messageAddress, encodedMessage);
Debug.WriteLine($"\"{message}\" written to EEPROM at 0x{messageAddress:X} ({writeResult} bytes)");
Thread.Sleep(100);
// Read back message from device.
byte[] receivedData = eeprom.Read(messageAddress, message.Length);
string decodedMessage = Encoding.UTF8.GetString(receivedData, 0, receivedData.Length);
Debug.WriteLine($"\"{decodedMessage}\" read from EEPROM at 0x{messageAddress:X}");
Thread.Sleep(100);
// Write byte to end of available device memory.
byte value = 0xA9;
int byteAddress = eeprom.Size - 1;
uint writeByteResult = eeprom.WriteByte(byteAddress, value);
Debug.WriteLine($"0x{value:X} written to EEPROM at 0x{byteAddress:X} ({writeByteResult} byte)");
Thread.Sleep(100);
// Read back byte from end of available device memory.
byte receivedByte = eeprom.ReadByte(byteAddress);
Debug.WriteLine($"0x{receivedByte:X} read from EEPROM at 0x{byteAddress:X}");
Thread.Sleep(100);
// Sequentially read back message from device byte-by-byte using the devices internal address counter.
// Since our last read from the device was at its last available byte, the internal address counter has now rolled over to point at the first byte.
byte[] receivedCharacter = new byte[1];
for (int i = 0; i < message.Length; i++)
{
receivedCharacter[0] = eeprom.ReadByte();
char[] character = Encoding.UTF8.GetChars(receivedCharacter, 0, 1);
Debug.WriteLine($"'{character[0]}' read from EEPROM");
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
- nanoFramework.CoreLibrary (>= 1.14.2)
- nanoFramework.System.Device.I2c (>= 1.1.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.552 | 83 | 2/4/2025 |
1.0.549 | 73 | 2/4/2025 |
1.0.532 | 85 | 1/31/2025 |
1.0.514 | 71 | 1/13/2025 |
1.0.495 | 82 | 12/30/2024 |
1.0.473 | 95 | 12/16/2024 |
1.0.462 | 93 | 12/4/2024 |
1.0.450 | 99 | 10/23/2024 |
1.0.408 | 103 | 8/28/2024 |
1.0.372 | 105 | 7/24/2024 |
1.0.347 | 124 | 6/14/2024 |
1.0.337 | 121 | 5/29/2024 |
1.0.329 | 121 | 5/17/2024 |
1.0.325 | 107 | 5/15/2024 |
1.0.313 | 120 | 4/15/2024 |
1.0.291 | 132 | 3/22/2024 |
1.0.213 | 224 | 11/10/2023 |
1.0.161 | 155 | 9/6/2023 |
1.0.106 | 149 | 5/26/2023 |
1.0.93 | 141 | 5/16/2023 |
1.0.90 | 141 | 5/12/2023 |
1.0.85 | 149 | 5/11/2023 |
1.0.79 | 152 | 5/10/2023 |
1.0.74 | 150 | 5/3/2023 |
1.0.50 | 229 | 3/17/2023 |
1.0.30 | 250 | 2/22/2023 |
1.0.1 | 271 | 1/13/2023 |