ooktx 2.1.0.0
main.c File Reference

OOK TX Click Example. More...

#include "board.h"
#include "log.h"
#include "ooktx.h"

Macros

#define OOKTX_PREAMBLE   0x5AA5
 
#define OOKTX_MESSAGE   "MIKROE"
 

Functions

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

Detailed Description

OOK TX Click Example.

Description

This example demonstrates the use of OOK TX click board by sending a predefined message to the receiver.

The demo application is composed of two sections :

Application Init

Initializes the driver and logger.

Application Task

Sends a predefined message every 3 seconds and displays it on the USB UART.

Note
The OOK RX click board is a compatible receiver for the OOK TX 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 OOKTX_MAN_BIT_LEN_US value accordingly.
Author
Stefan Filipovic

Macro Definition Documentation

◆ OOKTX_MESSAGE

#define OOKTX_MESSAGE   "MIKROE"

Text message to send.

◆ OOKTX_PREAMBLE

#define OOKTX_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 )