enocan3  2.0.0.0
Functions
Public function

Functions

void enocean3_cfg_setup (enocean3_cfg_t *cfg)
 Config Object Initialization function. More...
 
ENOCEAN3_RETVAL enocean3_init (enocean3_t *ctx, enocean3_cfg_t *cfg)
 Initialization function. More...
 
void enocean3_set_rst_pin (enocean3_t *ctx, uint8_t state)
 Set RST ( reset ) pin state. More...
 
void enocean3_generic_write (enocean3_t *ctx, char *data_buf, uint16_t len)
 Generic write function. More...
 
int32_t enocean3_generic_read (enocean3_t *ctx, char *data_buf, uint16_t max_len)
 Generic read function. More...
 
void enocean3_response_handler_set (enocean3_t *ctx, enocean3_hdl_t handler)
 Handler Set function. More...
 
uint8_t enocean3_send_packet (enocean3_t *ctx, enocean3_packet_t *packet)
 Packet Send function. More...
 
uint8_t enocean3_response_ready (enocean3_t *ctx)
 Response Ready function. More...
 
void enocean3_uart_isr (enocean3_t *ctx)
 UART Interrupt Routine function. More...
 

Detailed Description

Function Documentation

◆ enocean3_cfg_setup()

void enocean3_cfg_setup ( enocean3_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.

◆ enocean3_generic_read()

int32_t enocean3_generic_read ( enocean3_t ctx,
char *  data_buf,
uint16_t  max_len 
)

Generic read function.

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

◆ enocean3_generic_write()

void enocean3_generic_write ( enocean3_t ctx,
char *  data_buf,
uint16_t  len 
)

Generic write function.

Parameters
enocean3Click object.
data_bufData buffer for sends.
lenNumber of bytes for sends.

◆ enocean3_init()

ENOCEAN3_RETVAL enocean3_init ( enocean3_t ctx,
enocean3_cfg_t cfg 
)

Initialization function.

Parameters
enocean3Click object.
cfgClick configuration structure.

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

◆ enocean3_response_handler_set()

void enocean3_response_handler_set ( enocean3_t ctx,
enocean3_hdl_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.

◆ enocean3_response_ready()

uint8_t enocean3_response_ready ( enocean3_t ctx)

Response Ready function.

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

@description This function checks does response ready or not.

◆ enocean3_send_packet()

uint8_t enocean3_send_packet ( enocean3_t ctx,
enocean3_packet_t packet 
)

Packet Send function.

Parameters
ctxClick object.
packetPacket data to be sent
Returns
0 - OK, 1 - Packet size is invalid

@description This function sends a packet data to the device by using UART interface.

◆ enocean3_set_rst_pin()

void enocean3_set_rst_pin ( enocean3_t ctx,
uint8_t  state 
)

Set RST ( reset ) pin state.

Parameters
enocean3Click object.
stattePin state ( 1 or 0 ).

◆ enocean3_uart_isr()

void enocean3_uart_isr ( enocean3_t ctx)

UART Interrupt Routine function.

Parameters
ctxClick object.

@description This function reads every single byte from the device, performs a crc8 check for header and data packet and makes a received response.