Open Sint
3.4-2
|
larosse tx20 interface. More...
#include <inttypes.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#include "lacrosse.h"
Functions | |
uint8_t | header_ok (void) |
check if header is 00100 More... | |
uint8_t | lacrosse_checksum (void) |
ISR (INT0_vect) | |
void | lacrosse_stop (void) |
stop the lacrosse reading. | |
void | lacrosse_start (void) |
void | lacrosse_init (void) |
void | lacrosse_shutdown (void) |
shutdown lacrosse operations. More... | |
uint8_t | lacrosse_is_connected (void) |
check if the lacrosse is connected. More... | |
uint8_t | lacrosse_adjust (void) |
correct the lacrosse readings. More... | |
larosse tx20 interface.
uint8_t header_ok | ( | void | ) |
check if header is 00100
The serial protocol is as follows- a.. Approx 1.2mS bit time >> 833 bps b.. inverted data - 0V = logic 1, +3.3V = logic 0 c.. one long (20 bit) stream with start frame and end checksum d.. issued every 2 seconds while /CE is true (held at 0V) e.. 00100bbbbvvvvvvvvvvvvcccc f.. 00100 start frame g.. hhhh bearing, lsb first, 0-15 cardinal points from North, clockwise rotation, 0=N, 1=NNE, etc h.. vvvvvvvvvvvv velocity, lsb first, 0-4096, turbine counts over previous 2 second period, non accumulating i.. velocity count appears somewhat nonlinear- the turbine is quite sensitive to small gusts below 5 knots that would not move a conventional cup anemometer, but less so at higher speeds j.. knots = velocity/8 seems to be a reasonable approximation across typical wind speed ranges k.. cccc checksum, appers to be simple XOR of the 4 bbbb, vvvv,vvvv,vvvv nibbles
ISR | ( | INT0_vect | ) |
The interrupt function to get the lacrosse string.
uint8_t lacrosse_adjust | ( | void | ) |
correct the lacrosse readings.
uint8_t lacrosse_checksum | ( | void | ) |
Check the checksum of the message.
uint8_t lacrosse_is_connected | ( | void | ) |
check if the lacrosse is connected.
This function should be used to try to autosetup which anemometer is present.
void lacrosse_shutdown | ( | void | ) |
shutdown lacrosse operations.