ismrx3 2.0.0.0
main.c File Reference

ISMRX3 Click example. More...

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

Macros

#define MANCHESTER_BUF_LEN   1500/*<Manchester buffer size*/
 
#define PREAMBLE_WORD
 

Functions

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

Variables

uint8_t manchester_buf [MANCHESTER_BUF_LEN] = { 0 }
 

Detailed Description

ISMRX3 Click example.

Description

This example showcases ability of click board to configure and read incoming rf signal and parses data using data and clock line.

The demo application is composed of two sections :

Application Init

Initialization of communication modules (SPI, UART), and additional communication pins. Resets device, reads device ID, and sets default configuration that sets ASK modulation and 433.92MHz with 5bps data rate.

Application Task

Reads clock pin and gets samples of data pin state, converts it in manchester data that is stored in a buffer. When it fills out manchester buffer checks if expected preamble data is received. If it is, checks the next byte(it should be received data length). Then parses rest of data and if it's correct shows it on log.

Note
The expected data that is received is: PREAMBLE_WORD(2bytes), DATA_LENGTH(1byte), DATA(1..255bytes)

By default PREAMBLE_WORD is set to be 0xAAAA.

Author
Luka FIlipovic

Macro Definition Documentation

◆ MANCHESTER_BUF_LEN

#define MANCHESTER_BUF_LEN   1500/*<Manchester buffer size*/

◆ PREAMBLE_WORD

#define PREAMBLE_WORD
Value:
"01100110011001100110011001100110"/*<Preamble word,
by default: 0xAAAA*/

Function Documentation

◆ application_init()

void application_init ( void )

< Logger config object.

< Click config object.

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

◆ manchester_buf

uint8_t manchester_buf[MANCHESTER_BUF_LEN] = { 0 }