mbusrf4 2.0.0.0
main.c File Reference

MBusRf4 Click example. More...

#include "board.h"
#include "log.h"
#include "mbusrf4.h"
#include "string.h"
#include "generic_pointer.h"

Macros

#define PROCESS_COUNTER   10
 
#define PROCESS_RX_BUFFER_SIZE   256
 
#define PROCESS_PARSER_BUFFER_SIZE   256
 
#define LOG_HEX   0
 
#define LOG_STR   1
 
#define LOG_DEC   2
 
#define DEMO_APP_RECEIVER
 

Functions

void application_init (void)
 
void application_task (void)
 
int main (void)
 

Variables

uint8_t msg [] = "MikroE - FW team"
 

Detailed Description

MBusRf4 Click example.

Description

This example reads and processes data from M-BUS RF 4 clicks.

The demo application is composed of two sections :

Application Init

Initializes driver init, reads basic information and checks communication

Application Task

In the RX mode it is waiting to receive data from another module... In the TX mode sends the data packet....

Additional Function

  • mbusrf4_process ( ) - The general process of collecting data and adding it to application buffer;
  • mbrusrf4_clear_buff ( void ) - Clear application buffer data;
  • mbusrf4_parser_tx ( void ) - Transmit data status parser;
  • mbusrf4_parser_rx ( uint8_t logg_type ) - Receiver data parser;
  • mbusrf4_log_data ( uint8_t log_type, uint8_t *log_buf, int32_t log_len ) - Log application buffer;

Note: You can't send less then 10 data byte!

Author
MikroE Team

Macro Definition Documentation

◆ DEMO_APP_RECEIVER

#define DEMO_APP_RECEIVER

◆ LOG_DEC

#define LOG_DEC   2

◆ LOG_HEX

#define LOG_HEX   0

◆ LOG_STR

#define LOG_STR   1

◆ PROCESS_COUNTER

#define PROCESS_COUNTER   10

◆ PROCESS_PARSER_BUFFER_SIZE

#define PROCESS_PARSER_BUFFER_SIZE   256

◆ PROCESS_RX_BUFFER_SIZE

#define PROCESS_RX_BUFFER_SIZE   256

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 )

◆ main()

int main ( void )

Variable Documentation

◆ msg

uint8_t msg[] = "MikroE - FW team"