Class McpEeprom

java.lang.Object
com.diozero.devices.McpEeprom
All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable

public class McpEeprom
extends java.lang.Object
implements java.io.Closeable
See the Microchip website. Datasheet. Connections:
 GND  A0 1  8 Vcc 3v3
 GND  A1 2  7 WP (Write Protect Input, Vss=write enabled, Vcc=write disabled)
 GND  A2 3  6 SCL
 GND Vss 4  5 SDA
 
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  McpEeprom.Type  
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static int DEFAULT_ADDRESS  
  • Constructor Summary

    Constructors 
    Constructor Description
    McpEeprom​(int controller, int address, McpEeprom.Type type)  
    McpEeprom​(int controller, McpEeprom.Type type)  
  • Method Summary

    Modifier and Type Method Description
    void close()  
    byte readByte​(int address)  
    byte[] readBytes​(int address, int length)  
    byte readCurrentAddress()  
    void writeByte​(int address, byte data)  
    void writeByte​(int address, int data)  
    void writeBytes​(int address, byte[] data)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • readCurrentAddress

      public byte readCurrentAddress()
    • readByte

      public byte readByte​(int address)
    • readBytes

      public byte[] readBytes​(int address, int length)
    • writeByte

      public void writeByte​(int address, int data)
    • writeByte

      public void writeByte​(int address, byte data)
    • writeBytes

      public void writeBytes​(int address, byte[] data)
    • close

      public void close()
      Specified by:
      close in interface java.lang.AutoCloseable
      Specified by:
      close in interface java.io.Closeable