OneWay  3.0-3-ge9d4fa4
Data Structures | Macros | Functions
htv.h File Reference

Main struct of the project and eventually defaults. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  htv_t
 

Macros

#define MAX_CMD_LENGHT   20
 
#define MAX_SUBSTR_LENGHT   10
 
#define AU_PORT   PORTA
 
#define AU_DDR   DDRA
 
#define AU_ENABLE   PA5
 
#define AU_TXRX   PA6
 

Functions

void htv_store_address (struct htv_t *htv)
 store the address of the unit in EEPROM.
 
struct htv_thtv_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...
 
uint8_t htv_check_cmd (struct htv_t *htv)
 check the validity of the x10str command string. More...
 

Detailed Description

Main struct of the project and eventually defaults.

Macro Definition Documentation

◆ AU_DDR

#define AU_DDR   DDRA

data direction register

◆ AU_ENABLE

#define AU_ENABLE   PA5

enable tx pin connected to.

◆ AU_PORT

#define AU_PORT   PORTA

port where the rtx modules is connected

◆ AU_TXRX

#define AU_TXRX   PA6

switch tx/rx pin connected to.

◆ MAX_CMD_LENGHT

#define MAX_CMD_LENGHT   20

command's number of char

◆ MAX_SUBSTR_LENGHT

#define MAX_SUBSTR_LENGHT   10

helpfull substring max number of char

Function Documentation

◆ crc8_str()

uint8_t crc8_str ( const char *  str)

return the crc8 of the string.

Parameters
strthe string

◆ htv_check_cmd()

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.

Returns
true: string OK, false: error
Todo:
should return errno code.

◆ htv_free()

void htv_free ( struct htv_t htv)

free the htv struct.

Note
this should be never used.