12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
-
-
- #ifndef _PLANTS_H_
- #define _PLANTS_H_
-
- #include "GPIOBank.h"
-
- class Plants {
- public:
- enum Waterlevel {
- empty,
- inbetween,
- full,
- invalid
- };
-
-
-
-
- Plants(int valve_count, int pump_count, int switch_count, int aux_count);
-
- void setValvePins(int pins[]);
- void setPumpPins(int pins[]);
- void setSwitchPins(int pins[], bool pullup);
- void setAuxPins(int pins[]);
- void setKickstartPins(int pins[]);
-
- void abort(void);
-
- Waterlevel getWaterlevel(void);
- void openWaterInlet(void);
- void closeWaterInlet(void);
-
- int countFertilizers(void);
- void startFertilizer(int id);
- void stopFertilizer(int id);
- void stopAllFertilizers(void);
-
- int countPlants(void);
- void startPlant(int id, bool do_kickstart);
- void stopPlant(int id);
- void stopAllPlants(void);
-
- int countAux(void);
- void startAux(int id);
- void stopAux(int id);
- void stopAllAux(void);
-
- GPIOBank *getValves(void);
- GPIOBank *getPumps(void);
- GPIOBank *getSwitches(void);
- GPIOBank *getAux(void);
- GPIOBank *getKickstart(void);
-
- private:
- GPIOBank valves;
- GPIOBank pumps;
- GPIOBank switches;
- GPIOBank aux;
- GPIOBank kickstart;
- };
-
- extern Plants plants;
-
- #endif
|