Skip to content
  • Alessandro Rubini's avatar
    w1: complete eeprom low-level support · d44ace7e
    Alessandro Rubini authored
    This completes w1-eeproom.c with the complete API. The provided test
    commands allow to read and write any size at any offset (the low-level
    code manages cross-page reads and writes. The following examples
    modify a pre-written eeprom, which I host in an external socket of
    my SPEC card:
    
       wrc# w1r 0 4
       read(0x0, 4): result = 4
       offset    0 (0x000): 240 (0xf0)
       offset    1 (0x001): 241 (0xf1)
       offset    2 (0x002): 242 (0xf2)
       offset    3 (0x003): 243 (0xf3)
    
       wrc# w1w 0 40 41 42
       offset    0 (0x000):  40 (0x28)
       offset    1 (0x001):  41 (0x29)
       offset    2 (0x002):  42 (0x2a)
       write(0x0, 3): result = 3
    
       wrc# w1r 0 4
       read(0x0, 4): result = 4
       offset    0 (0x000):  40 (0x28)
       offset    1 (0x001):  41 (0x29)
       offset    2 (0x002):  42 (0x2a)
       offset    3 (0x003): 243 (0xf3)
    
       wrc# w1r 30 4
       read(0x1e, 4): result = 4
       offset   30 (0x01e):  69 (0x45)
       offset   31 (0x01f):  70 (0x46)
       offset   32 (0x020):  71 (0x47)
       offset   33 (...
    d44ace7e