|
Open Garden
0.10.1-21
|
IO lines low level API. More...

Functions | |
| void | onoff_pulse (const uint8_t status) |
| void | valve_open (const uint8_t valvetype) |
| void | valve_close (const uint8_t valvetype) |
| void | io_suspend (void) |
| void | io_resume (void) |
| void | io_init (void) |
| void | io_shut (void) |
| Shutdown all I/O pin. More... | |
| void | io_set (const uint8_t oline, const uint8_t onoff, struct programs_t *progs) |
| uint8_t | io_get (struct programs_t *progs) |
| void | io_off (struct programs_t *progs) |
| uint8_t | io_alarm (struct programs_t *progs) |
| get alarm status. More... | |
IO lines low level API.
| uint8_t io_alarm | ( | struct programs_t * | progs | ) |
get alarm status.
Sets/clear and return the alarm flag in the flag register (FL_ALRM) if one or both the alarm line are set, based on the alarm level trigger (FL_LEVEL high or low).
| progs | the struct to look for the alarm level setup. |
| uint8_t io_get | ( | struct programs_t * | progs | ) |
Are there any IO out line in use?
| void io_init | ( | void | ) |
setup the I/O port.
| void io_off | ( | struct programs_t * | progs | ) |
Close all the output line.
| void io_set | ( | const uint8_t | oline, |
| const uint8_t | onoff, | ||
| struct programs_t * | progs | ||
| ) |
Set I/O oline.
open or close the I/O line, the OUT_PORT is supposed to represent the correct status of the I/O lines only if the valve type is MONOSTABLE. In the open case, we set the port to the corresponding oline, then we also set the oline into the progs structure in order to remember which ioline we are using, because this info will be lost during the stand-by period. Then, after opened the valve, if the valve is BISTABLE we can clear the oline from the port, no need to keep the line up; instead if the valve is MONOSTABLE then the PORT represent the ioline in use and it must not be cleared. In the close case and bistable valve, the port must be set to the correct ioline before the close operation or it will not affect any line.
Special case: GTP hardware. Monostable valve ignore the ON/OFF line. Bistable valve uses +/- and ON/OFF line in a different way, to open: set the ioline and the ON/OFF to 1, after 1msec clear the ioline and after PULSE_MSEC clear also the ON/OFF line. to close: set the ioline and the +/- to 1, after 1msec clear the ioline and after PULSE_MSEC clear also the +/- line.
| oline | the output line to be set. |
| onoff | set or clear. |
| progs | ptr to the parameters. |
| void io_shut | ( | void | ) |
Shutdown all I/O pin.
Not only make them 0, but also release the IO lines.
| void io_suspend | ( | void | ) |
release all the I/O lines before suspend
| void onoff_pulse | ( | const uint8_t | status | ) |
send an On, Off or a pulse of PULSE_MSEC msec. on the OUT_CMD_ONOFF pin.
| void valve_close | ( | const uint8_t | valvetype | ) |
Inverse of the valve_open().
| valvetype | MONOSTABLE or BISTABLE. |
| void valve_open | ( | const uint8_t | valvetype | ) |
Send the command to open the pre-selected valve.
| valvetype | MONOSTABLE or BISTABLE. |
1.8.13