Central Heating controller using the real time clock, PHY module for internet, 1-wire interface for temperature sensors, a system log and a configuration file

Dependencies:   net 1-wire lpc1768 crypto clock web fram log

/media/uploads/andrewboyson/heating.sch

/media/uploads/andrewboyson/heating.brd

/media/uploads/andrewboyson/eagle.epf

heating/hot-water.c

Committer:
andrewboyson
Date:
2021-04-23
Revision:
106:41ed3ea0bbba
Parent:
93:5ee0a1ef0279

File content as of revision 106:41ed3ea0bbba:

#include <stdint.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>

#include "ds18b20.h"
#include "fram.h"

static char*    hotWaterRom;         static int iHotWaterRom;

uint16_t HotWaterGetDS18B20Value(){ return DS18B20ValueFromRom(hotWaterRom); }

static void  setHotWaterRom          (char* value) { memcpy(hotWaterRom,  value, 8);        FramWrite(iHotWaterRom,          8,  hotWaterRom         ); }

int HotWaterInit()
{
    hotWaterRom = DS18B20Roms + 8 * DS18B20RomCount;
    DS18B20RomSetters[DS18B20RomCount] = setHotWaterRom;
    DS18B20RomNames[DS18B20RomCount] = "HotWater";
    DS18B20RomCount++;

    int  address;
    char    def1;
    int32_t def4;
               address = FramLoad( 8,  hotWaterRom,              0); if (address < 0) return -1; iHotWaterRom          = address;
    return 0;
}