OneWay
3.0-3-ge9d4fa4
|
Main struct of the project and eventually defaults. More...
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <util/crc16.h>
#include <avr/io.h>
#include <avr/eeprom.h>
#include "htv.h"
Functions | |
void | htv_store_address (struct htv_t *htv) |
store the address of the unit in EEPROM. | |
struct htv_t * | htv_init (struct htv_t *htv) |
initialize the htv struct | |
void | htv_free (struct htv_t *htv) |
free the htv struct. More... | |
uint8_t | crc8_str (const char *str) |
return the crc8 of the string. More... | |
void | aaaa_to_htv (struct htv_t *htv) |
convert a pre-formatted string to the struct htv. More... | |
void | s5_to_htv (struct htv_t *htv) |
AAAAC to htv_t. More... | |
void | s7_to_htv (struct htv_t *htv) |
AAAAPPC to htv_t. More... | |
void | s8_to_htv (struct htv_t *htv) |
AAAAC:RR to htv_t. More... | |
void | s10_to_htv (struct htv_t *htv) |
AAAAPPC:RR to htv_t. More... | |
uint8_t | htv_check_cmd (struct htv_t *htv) |
check the validity of the x10str command string. More... | |
Variables | |
uint16_t EEMEM | EE_address |
uint16_t EEMEM | EE_naddress |
Main struct of the project and eventually defaults.
void aaaa_to_htv | ( | struct htv_t * | htv | ) |
convert a pre-formatted string to the struct htv.
This convert the AAAA part to htv_t->address.
uint8_t crc8_str | ( | const char * | str | ) |
return the crc8 of the string.
str | the string |
uint8_t htv_check_cmd | ( | struct htv_t * | htv | ) |
check the validity of the x10str command string.
Based on the string lenght, choose which protocol to check. If cmd is not correct clear the cmd string and return FALSE else if cmd is ok, modify cmd and keep only AAAAPPC.
void htv_free | ( | struct htv_t * | htv | ) |
free the htv struct.
void s10_to_htv | ( | struct htv_t * | htv | ) |
AAAAPPC:RR to htv_t.
void s5_to_htv | ( | struct htv_t * | htv | ) |
AAAAC to htv_t.
void s7_to_htv | ( | struct htv_t * | htv | ) |
AAAAPPC to htv_t.
void s8_to_htv | ( | struct htv_t * | htv | ) |
AAAAC:RR to htv_t.
uint16_t EEMEM EE_address |
The HTV network address
uint16_t EEMEM EE_naddress |
The ~EE_address to check the correct value of the address