Open Garden  0.10.1-21
Functions
ogstruct.c File Reference

Utility to handle struct parameters. More...

#include <stdlib.h>
#include "ogstruct.h"
Include dependency graph for ogstruct.c:

Functions

void flag_set (struct programs_t *progs, const uint8_t bit, const uint8_t val)
 
uint8_t flag_get (struct programs_t *progs, const uint8_t bit)
 
void flag_sunsite (struct programs_t *progs, const char c)
 
void flag_valve (struct programs_t *progs, const char c)
 

Detailed Description

Utility to handle struct parameters.

Function Documentation

◆ flag_get()

uint8_t flag_get ( struct programs_t progs,
const uint8_t  bit 
)

Get flag value.

This function will get the correspondent bit in the flags byte.

ex. check the led flag value is if (flag_get(progs, FL_LEDS)) ...

Parameters
*progsthe ogstruct.
bitthe bit of the flag's byte.
Returns
TRUE or FALSE

◆ flag_set()

void flag_set ( struct programs_t progs,
const uint8_t  bit,
const uint8_t  val 
)

Set flag value.

This function will set or clear the correspondent bit in the flags byte.

ex. set the led flag is

flag_set(progs, FL_LEDS, TRUE);

ex. clear the led flag value is

flag_set(progs, FL_LEDS, FALSE);
Parameters
*progsthe ogstruct.
bitthe bit of the flag's byte.
valTRUE or FALSE.

◆ flag_sunsite()

void flag_sunsite ( struct programs_t progs,
const char  c 
)

set or get the sunsite flag.

◆ flag_valve()

void flag_valve ( struct programs_t progs,
const char  c 
)

set or get the valve type flag.