{
    "properties": {
        "version": "3.0.0",
        "versions": [
            "3.0.0"
        ]
    },
    "init": [
        {
            "action": "validateI2CDevices",
            "message": "Validate I2C",
            "comment": "Check to make sure the main I2C devices are present before using any of them.  The audio codec at 0x4c is deliberately absent from this list, and should not be added: it is powered from the 5V rail, which the board regulates separately down to a clean 3.3V for the analog section, and the OLED port this board is programmed through does not carry 5V.  The codec is simply unpowered during programming, so probing for it would fail every board rather than catch a fault.",
            "devices": [
                {
                    "address": "0x51",
                    "message": "RTC"
                },
                {
                    "address": "0x48",
                    "message": "Temperature Sensor"
                },
                {
                    "address": "0x50",
                    "message": "EEPROM"
                }
            ]
        }
    ],
    "steps": [
        {
            "comment": "Set the RTC to the current time.  Note: if no battery is present, the RTC will not keep the time.",
            "action": "setRTC",
            "device": "pcf85363",
            "message": "Set RTC Time",
            "skip": false
        },
        {
            "comment": "Invokes the set_cape_sn_in_eeprom script to create the EEPROM with the current cape serial number.",
            "message": "Generate EEPROM",
            "action": "generateEEPROM",
            "source": "%BASE%/Pi-OLED/PiOLED-%version%-eeprom.bin",
            "target": "/tmp/eeprom.bin"
        },
        {
            "action": "flashEEPROM",
            "eeprom": "/tmp/eeprom.bin",
            "message": "Flash EEPROM"
        },
        {
            "message": "Validate EEPROM",
            "comment": "Make sure the EEPROM is valid after flashing",
            "action": "validateEEPROM",
            "eeprom": "/tmp/eeprom.bin"
        }
    ],
    "cleanup": [        
        {
            "action": "removeFile",
            "file": "/tmp/eeprom.bin",
            "message": "Remove EEPROM"
        }
    ]
}
