CoffeePi
Coffee machine control for Raspberry Pi
Functions | Variables
hal.cpp File Reference
#include <wiringPi.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <signal.h>
#include "lcd.h"
#include "hal.h"
#include "global.h"
#include "logger.h"

Functions

void halInit (void)
 Initializes HAL. More...
 
void halRelaisOn (int relais)
 Switches relais on. More...
 
void halRelaisOff (int relais)
 Switches relais off. More...
 
void halRelaisSet (int relais, int state)
 Switches relais to state. More...
 
int halGetRelaisState (int relais)
 Returns the state of the relais relais Returns HIGH when Relais is ON. More...
 
void halInt0 (void)
 
void halInt1 (void)
 
void halIntFlow (void)
 
void halIntPressure (void)
 Method to handle toggle of the pressure control. More...
 
void halIntProximity (void)
 Method to handle toggle of the proximity sensor. More...
 
float halGetFlow (void)
 Returns total flow trough sensor in ml. More...
 
void halResetFlow (void)
 Resets the Flow counter. More...
 
bool halIsHeating (void)
 Reads the status of the Pressure Control. More...
 
bool halProxSensorCovered (void)
 Returns status of the proximity switch. More...
 
int halGetInt0 (void)
 Returns the value of the top button Int0 (low active) More...
 
int halGetInt1 (void)
 Returns the value of the bottom button Int1 (low active) More...
 
void halSendSignal (int val)
 send Signal to coffee thread More...
 

Variables

int flowcnt = 0
 

Function Documentation

float halGetFlow ( void  )

Returns total flow trough sensor in ml.

int halGetInt0 ( void  )

Returns the value of the top button Int0 (low active)

Returns
LOW or HIGH
int halGetInt1 ( void  )

Returns the value of the bottom button Int1 (low active)

Returns
LOW or HIGH
int halGetRelaisState ( int  relais)

Returns the state of the relais relais Returns HIGH when Relais is ON.

Parameters
relaisRelais ID
void halInit ( void  )

Initializes HAL.

void halInt0 ( void  )
void halInt1 ( void  )
void halIntFlow ( void  )
void halIntPressure ( void  )

Method to handle toggle of the pressure control.

void halIntProximity ( void  )

Method to handle toggle of the proximity sensor.

bool halIsHeating ( void  )

Reads the status of the Pressure Control.

Returns
0 for closed Pressure Control(heating) and 1 for open
bool halProxSensorCovered ( void  )

Returns status of the proximity switch.

Returns
1 if the proximity switch is covered and 0 if uncovered
void halRelaisOff ( int  relais)

Switches relais off.

Parameters
relaisRelais ID
void halRelaisOn ( int  relais)

Switches relais on.

Parameters
relaisRelais ID
void halRelaisSet ( int  relais,
int  state 
)

Switches relais to state.

Parameters
relaisRelais ID
stateLOW(0) or HIGH(1)
void halResetFlow ( void  )

Resets the Flow counter.

void halSendSignal ( int  val)

send Signal to coffee thread

Parameters
valInteger value assigned to signal

Variable Documentation

int flowcnt = 0