Open Sint  3.4-2
Data Structures | Macros | Enumerations | Functions | Variables
anemometer.h File Reference
#include "davis.h"
#include "lacrosse.h"
Include dependency graph for anemometer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  complex
 
struct  wind_array
 

Macros

#define ANE_DAVIS   1
 
#define ANE_LACROSSE   2
 
#define ANE_AUTO   99
 
#define MEDIA_NEXT_CYCLE
 

Enumerations

enum  wind_dir {
  NORTH, NORTH_EAST, EAST, SOUTH_EAST,
  SOUTH, SOUTH_WEST, WEST, NORTH_WEST
}
 
enum  wind_tendency { INCREASE, DECREASE, STABLE }
 

Functions

uint8_t anemometer_adjust (struct wind_array *wind)
 apply correction to wind value if needed. More...
 
void anemometer_init (void)
 initialize the anemometer. allocate the memory for the wind struct, read from eeprom which wind sensor to use and, in case of auto wind sensor, try to locate which one. More...
 
enum wind_dir get_wind_direction (int direction)
 return standard direction from encoder. More...
 
void anemometer_start (struct wind_array *wind)
 enable the anemometer and start storing value.
 
void anemometer_stop (struct wind_array *wind)
 disable the anemometer.
 
uint8_t anemometer_eeread (void)
 Read which wind sensor is stored into the EEPROM.
 
void anemometer_eesave (uint8_t sensor)
 

Variables

struct wind_arraywind
 

Macro Definition Documentation

◆ ANE_DAVIS

#define ANE_DAVIS   1

type of anemometer used

Function Documentation

◆ anemometer_adjust()

uint8_t anemometer_adjust ( struct wind_array wind)

apply correction to wind value if needed.

Returns
1 - data is valid, 0 - wrong data.

◆ anemometer_init()

void anemometer_init ( void  )

initialize the anemometer. allocate the memory for the wind struct, read from eeprom which wind sensor to use and, in case of auto wind sensor, try to locate which one.

Returns
allocated wind structure.
Note
the wind struct is global, no need to pass it.

◆ get_wind_direction()

enum wind_dir get_wind_direction ( int  direction)

return standard direction from encoder.

Parameters
directiondegrees wind direction to convert (0-359).
Returns
converted value.

Variable Documentation

◆ wind

struct wind_array* wind

global wind array struct used into ISR.