ookrx 2.1.0.0
main.c File Reference

OOK RX Click Example. More...

#include "board.h"
#include "log.h"
#include "ookrx.h"

Macros

#define OOKRX_PREAMBLE   0x5AA5
 

Functions

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

Detailed Description

OOK RX Click Example.

Description

This example demonstrates the use of OOK RX click board by reading and parsing packet messages received from the transmitter.

The demo application is composed of two sections :

Application Init

Initializes the driver and enables the device and squelch mode.

Application Task

Waits for a data ready indication, then reads all packet data, verifies the CRC bytes in a packet, and displays its data as well as the RSSI value on the USB UART.

Note
The OOK TX click board is a compatible transmitter for the OOK RX click. Here are a few steps for troubleshooting if you are experiencing issues running this example:
  • Check the MCU clock configuration, use an external oscillator instead of the MCU's internal one for better accuracy on manchester data rate delay.
  • Measure the actual data rate on the data line and adjust the OOKRX_MAN_BIT_LEN_US value accordingly.
Author
Stefan Filipovic

Macro Definition Documentation

◆ OOKRX_PREAMBLE

#define OOKRX_PREAMBLE   0x5AA5

Packet preamble word.

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 )