enocean2 2.0.0.0
Public function

Functions

void enocean2_cfg_setup (enocean2_cfg_t *cfg)
 Config Object Initialization function.
 
ENOCEAN2_RETVAL enocean2_init (enocean2_t *ctx, enocean2_cfg_t *cfg)
 Initialization function.
 
void enocean2_default_cfg (enocean2_t *ctx)
 Click Default Configuration function.
 
void enocean2_generic_write (enocean2_t *ctx, char *data_buf, uint16_t len)
 Generic write function.
 
int32_t enocean2_generic_read (enocean2_t *ctx, char *data_buf, uint16_t max_len)
 Generic read function.
 
void enocean2_init_rx_buff (enocean2_t *ctx, enocean2_ring_buffer_t *rb, enocean2_rx_data_t *rx_str)
 Module initialization.
 
void enocean2_set_callback_handler (enocean2_t *ctx, enocean2_callback_t recieve)
 Functions for sets callback handler

 
uint8_t enocean2_send (enocean2_t *ctx, enocean2_packet_t *packet)
 Send ESP3 packet.
 
uint8_t enocean2_rx (enocean2_ring_buffer_t *rb, uint8_t rx_data)
 Recieve character.
 
uint8_t enocean2_packet_recieve (enocean2_t *ctx, enocean2_ring_buffer_t *rb)
 Process.
 

Detailed Description

Function Documentation

◆ enocean2_cfg_setup()

void enocean2_cfg_setup ( enocean2_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.

◆ enocean2_default_cfg()

void enocean2_default_cfg ( enocean2_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for EnOcean2 click.

◆ enocean2_generic_read()

int32_t enocean2_generic_read ( enocean2_t * ctx,
char * data_buf,
uint16_t max_len )

Generic read function.

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

@description This function read maximum length of data.

◆ enocean2_generic_write()

void enocean2_generic_write ( enocean2_t * ctx,
char * data_buf,
uint16_t len )

Generic write function.

Parameters
ctxClick object.
data_bufData buffer for sending.
lenNumber of bytes to be send.

@description This function write certian number of bytes

◆ enocean2_init()

ENOCEAN2_RETVAL enocean2_init ( enocean2_t * ctx,
enocean2_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ enocean2_init_rx_buff()

void enocean2_init_rx_buff ( enocean2_t * ctx,
enocean2_ring_buffer_t * rb,
enocean2_rx_data_t * rx_str )

Module initialization.

Parameters
ctxClick object.
rbRing buffer object.
rx_strRx buffer object.
Structure arguments:
- rx_buffer   - Ring buffer for recieving characters.
- rx_size     - Ring buffer size.
- data_buffer - Buffer for storing packet data.
- data_size   - Data buffer size.

@description EnOcean Serial Protocol ( ESP3 ) module initialization.

Note
This function must be called first.

◆ enocean2_packet_recieve()

uint8_t enocean2_packet_recieve ( enocean2_t * ctx,
enocean2_ring_buffer_t * rb )

Process.

Parameters
ctxClick object.
rbRing buffer object.
Returns
ENOCEAN2_ERR_OK or ENOCEAN2_ERR_NO_MEMORY - No enough memory to recieve packet.

@description Implements state machine for recieving packets. It should be called in loop.

◆ enocean2_rx()

uint8_t enocean2_rx ( enocean2_ring_buffer_t * rb,
uint8_t rx_data )

Recieve character.

Parameters
rbRing buffer object.
rx_dataRecieved byte.
Returns
ENOCEAN2_ERR_OK or ENOCEAN2_ERR_BUFFER_FULL - If the ring buffer is full.

@description The function push recieved character to ring buffer.

Note
Call this function inside UART interrupt routine.

◆ enocean2_send()

uint8_t enocean2_send ( enocean2_t * ctx,
enocean2_packet_t * packet )

Send ESP3 packet.

Parameters
ctxClick object.
packetSending packet.
Returns
ENOCEAN2_ERR_OK - Packet is send; ENOCEAN2_ERR_INVALID_SIZE - Invalid packet size.

@description Sends the ESP3 packet to an EnOcean module.

◆ enocean2_set_callback_handler()

void enocean2_set_callback_handler ( enocean2_t * ctx,
enocean2_callback_t recieve )

Functions for sets callback handler

Parameters
ctxClick object.
recieveRecieve callback.

@description This function sets callback handler