enocean4 2.0.0.0
main.c File Reference

Enocean4 Click example. More...

#include "board.h"
#include "log.h"
#include "enocean4.h"
#include "string.h"

Macros

#define DEMO_APP_RECEIVER
 
#define DEMO_MESSAGE   "MikroE"
 
#define DEMO_ANSWER   "EnOcean 4"
 

Functions

void resp_message (uint8_t resp_byte)
 
void packet_type ()
 
void make_response (enocean4_packet_t *rsp, uint8_t *rsp_length_size)
 
void log_response ()
 
void send_telegram (char *telegram, uint8_t tel_type)
 
void check_response ()
 
void application_init (void)
 
void application_task (void)
 
int main (void)
 

Variables

enocean4_packet_t response
 
enocean4_packet_t message
 
uint8_t response_size_cnt
 
uint8_t rsp_check
 
uint8_t device_mode
 

Detailed Description

Enocean4 Click example.

Description

This example reads and processes data from EnOcean 4 clicks.

The demo application is composed of two sections :

Application Init

Initializes the driver and configures the click board.

Application Task

In the receiver mode, it waits for a telegram, then replies to it with the certain message. In the transmitter mode, first it sends the telegram with the certain message, then waits for a response.

Additional Function

  • resp_message - Displays the response message on the USB UART.
  • packet_type - Displays the packet type message on the USB UART.
  • make_response - Driver handler function which stores data in the response buffer.
  • log_response - Displays a response on the USB UART.
  • send_telegram - Allows user to send a telegram to the determined destination.
  • check_response - Waits until response is ready, then displays it on the USB UART.
Author
MikroE Team

Macro Definition Documentation

◆ DEMO_ANSWER

#define DEMO_ANSWER   "EnOcean 4"

◆ DEMO_APP_RECEIVER

#define DEMO_APP_RECEIVER

◆ DEMO_MESSAGE

#define DEMO_MESSAGE   "MikroE"

Function Documentation

◆ application_init()

void application_init ( void )

Logger initialization. Default baud rate: 115200 Default log level: LOG_LEVEL_DEBUG

Note
If USB_UART_RX and USB_UART_TX are defined as HAL_PIN_NC, you will need to define them manually for log to work. See LOG_MAP_USB_UART macro definition for detailed explanation.

◆ application_task()

void application_task ( void )

◆ check_response()

void check_response ( )

◆ log_response()

void log_response ( )

◆ main()

int main ( void )

◆ make_response()

void make_response ( enocean4_packet_t * rsp,
uint8_t * rsp_length_size )

◆ packet_type()

void packet_type ( )

◆ resp_message()

void resp_message ( uint8_t resp_byte)

◆ send_telegram()

void send_telegram ( char * telegram,
uint8_t tel_type )

Variable Documentation

◆ device_mode

uint8_t device_mode

◆ message

◆ response

◆ response_size_cnt

uint8_t response_size_cnt

◆ rsp_check

uint8_t rsp_check