enocan3  2.0.0.0
Functions

Functions

void enocan3_cfg_setup (enocan3_cfg_t *cfg)
 Config Object Initialization function. More...
 
ENOCEAN3_RETVAL enocan3_init (enocan3_t *ctx, enocan3_cfg_t *cfg)
 Initialization function. More...
 
void enocan3_set_rst_pin (enocan3_t *ctx, uint8_t state)
 Set RST ( reset ) pin state. More...
 
void enocan3_generic_write (enocan3_t *ctx, char *data_buf, uint16_t len)
 Generic write function. More...
 
uint16_t enocan3_generic_read (enocan3_t *ctx, char *data_buf, uint16_t max_len)
 Generic read function. More...
 
enocan3_error_t enocan3_generic_parser (char *rsp, uint8_t command, uint8_t element, char *parser_buf)
 Generic parser function. More...
 
void enocean3_response_handler_set (enocan3_t *ctx, enocean3_hdl_t handler)
 Handler Set function. More...
 
uint8_t enocean3_send_packet (enocan3_t *ctx, enocean3_packet_t *packet)
 Packet Send function. More...
 
uint8_t enocean3_response_ready (enocan3_t *ctx)
 Response Ready function. More...
 
void enocean3_uart_isr (enocan3_t *ctx)
 UART Interrupt Routine function. More...
 
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

◆ enocan3_cfg_setup()

void enocan3_cfg_setup ( enocan3_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.

◆ enocan3_generic_parser()

enocan3_error_t enocan3_generic_parser ( char *  rsp,
uint8_t  command,
uint8_t  element,
char *  parser_buf 
)

Generic parser function.

Parameters
enocan3Click object.
commandNEMA ( GPS/GNSS ) command.
elementElement position in command.
parser_bufParser buffer for data storage.
Returns
error data

◆ enocan3_generic_read()

uint16_t enocan3_generic_read ( enocan3_t ctx,
char *  data_buf,
uint16_t  max_len 
)

Generic read function.

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

◆ enocan3_generic_write()

void enocan3_generic_write ( enocan3_t ctx,
char *  data_buf,
uint16_t  len 
)

Generic write function.

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

◆ enocan3_init()

ENOCEAN3_RETVAL enocan3_init ( enocan3_t ctx,
enocan3_cfg_t cfg 
)

Initialization function.

Parameters
enocan3Click object.
cfgClick configuration structure.

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

◆ enocan3_set_rst_pin()

void enocan3_set_rst_pin ( enocan3_t ctx,
uint8_t  state 
)

Set RST ( reset ) pin state.

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

◆ 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() [1/2]

void enocean3_response_handler_set ( enocan3_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_handler_set() [2/2]

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() [1/2]

uint8_t enocean3_response_ready ( enocan3_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_response_ready() [2/2]

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() [1/2]

uint8_t enocean3_send_packet ( enocan3_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_send_packet() [2/2]

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() [1/2]

void enocean3_uart_isr ( enocan3_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.

◆ enocean3_uart_isr() [2/2]

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.