enocean4 2.0.0.0
Public function

Functions

void enocean4_cfg_setup (enocean4_cfg_t *cfg)
 Config Object Initialization function.
 
ENOCEAN4_RETVAL enocean4_init (enocean4_t *ctx, enocean4_cfg_t *cfg)
 Initialization function.
 
void enocean4_set_rst_pin (enocean4_t *ctx, uint8_t state)
 Set RST ( reset ) pin state.
 
void enocean4_generic_write (enocean4_t *ctx, char *data_buf, uint16_t len)
 Generic write function.
 
int32_t enocean4_generic_read (enocean4_t *ctx, char *data_buf, uint16_t max_len)
 Generic read function.
 
void enocean4_response_handler_set (enocean4_t *ctx, void(*handler)(enocean4_packet_t *, uint8_t *))
 Handler Set function.
 
void enocean4_uart_isr (enocean4_t *ctx)
 UART Interrupt Routine function.
 
uint8_t enocean4_process (enocean4_t *ctx)
 Response Proccesing function.
 
uint8_t enocean4_response_ready (enocean4_t *ctx)
 Response Ready Check function.
 
void enocean4_reset (enocean4_t *ctx)
 Reset function.
 
uint8_t enocean4_send_packet (enocean4_t *ctx, enocean4_packet_t *packet)
 Packet Send function.
 

Detailed Description

Function Documentation

◆ enocean4_cfg_setup()

void enocean4_cfg_setup ( enocean4_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ enocean4_generic_read()

int32_t enocean4_generic_read ( enocean4_t * ctx,
char * data_buf,
uint16_t max_len )

Generic read function.

Parameters
ctxClick object.
enocean4Click object.
data_bufData buffer for read data.
max_lenThe maximum length of data that can be read.
Returns
Number of reads data.

◆ enocean4_generic_write()

void enocean4_generic_write ( enocean4_t * ctx,
char * data_buf,
uint16_t len )

Generic write function.

Parameters
ctxClick object.
enocean4Click object.
data_bufData buffer for sends.
lenNumber of bytes for sends.

◆ enocean4_init()

ENOCEAN4_RETVAL enocean4_init ( enocean4_t * ctx,
enocean4_cfg_t * cfg )

Initialization function.

Parameters
enocean4Click object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ enocean4_process()

uint8_t enocean4_process ( enocean4_t * ctx)

Response Proccesing function.

Parameters
ctxClick object.
Returns
0 - OK, or determined error code

@description This function performs a response proccesing and calls handler function if response is valid.

◆ enocean4_reset()

void enocean4_reset ( enocean4_t * ctx)

Reset function.

Parameters
ctxClick object.

@description This function performs a module reset.

◆ enocean4_response_handler_set()

void enocean4_response_handler_set ( enocean4_t * ctx,
void(*)(enocean4_packet_t *, uint8_t *) handler )

Handler Set function.

Parameters
ctxClick object.
handlerPointer to the function that should be performed

@description This function sets handler on the function that should be performed, for example function for the results logging.

◆ enocean4_response_ready()

uint8_t enocean4_response_ready ( enocean4_t * ctx)

Response Ready Check function.

Parameters
ctxClick object.
Returns
0 - Response is not ready, 1 - Response is ready

@description This function checks the response ready flag and if flag is set, clears a flag.

◆ enocean4_send_packet()

uint8_t enocean4_send_packet ( enocean4_t * ctx,
enocean4_packet_t * packet )

Packet Send function.

Parameters
ctxClick object.
packetPacket data to be sent
Returns
0x00 - OK, 0xFC - Invalid packet size

@description This function allows user to send a valid packet data to the module by using UART interface.

Note
Packet data can be desired command, or telegram, sub telegram, message, configurations...

◆ enocean4_set_rst_pin()

void enocean4_set_rst_pin ( enocean4_t * ctx,
uint8_t state )

Set RST ( reset ) pin state.

Parameters
ctxClick object.
enocean4Click object.
stattePin state ( 1 or 0 ).

◆ enocean4_uart_isr()

void enocean4_uart_isr ( enocean4_t * ctx)

UART Interrupt Routine function.

Parameters
ctxClick object.

@description This function reads response bytes from the module and sets a flag when response is ready.