Nordic Semiconductor nRF5 AirFuel SDK  version 2.2.0
main.c File Reference
#include <stdio.h>
#include <stdint.h>
#include "nrf_assert.h"
#include "nrf_gzll.h"
#include "app_print.h"
#include "simple_uart.h"
#include "wireless_debug_config.h"
#include "nrf_gpio.h"
#include "boards.h"

Go to the source code of this file.

Macros

#define DEBUG_POLL   0
 Packed type used for polling opnly.
 
#define DEBUG_PKT   1
 Packed type used for packet with payload.
 
#define DEBUG_STR   2
 Packed type used for packet with string.
 
#define PIPE_NUMBER   0
 Use pipe 0 for the wireless debug interface (WDI)
 
#define ACK_PAYLOAD_LENGTH   1
 We use 1 byte payload length when transmitting.
 
#define DEBUG_PAYLOAD_LENGTH   32
 Debug payload length.
 
#define DEBUG_LINE_LENGTH   80
 Debug string length.
 
#define DEAD_BEEF   0xDEADBEEF
 Error code for assert.
 

Functions

static void uart_config (uint32_t baudrate, uint8_t rts_pin_number, uint8_t txd_pin_number, uint8_t cts_pin_number, uint8_t rxd_pin_number, bool hwfc)
 Local version of uart configure that take baud rate.
 
static bool m_uart_chars_available (void)
 Checks if there are any characters available in the UART.
 
static void line_print (void)
 Print a dashed line to the UART.
 
static char * state_string_get (uint8_t state)
 Convert state to string.
 
static void debug_output_print (uint8_t *debug_data)
 Print debug output. More...
 
void app_error_handler (uint32_t error_code, uint32_t line_num, const uint8_t *p_file_name)
 Error handler function, which is called when an error has occurred.
 
void assert_nrf_callback (uint16_t line_num, const uint8_t *p_file_name)
 Assert macro callback function.
 
int main ()
 Dongle application.
 
void nrf_gzll_host_rx_data_ready (uint32_t pipe, nrf_gzll_host_rx_info_t rx_info)
 GZLL data packet received callback.
 
void nrf_gzll_device_tx_success (uint32_t pipe, nrf_gzll_device_tx_info_t tx_info)
 GZLL ACK received callback.
 
void nrf_gzll_device_tx_failed (uint32_t pipe, nrf_gzll_device_tx_info_t tx_info)
 GZLL Transmission failed callback.
 
void nrf_gzll_disabled ()
 GZLL Disabled callback.
 

Variables

static uint8_t data_payload [NRF_GZLL_CONST_MAX_PAYLOAD_LENGTH]
 GZLL data payload.
 
static uint8_t ack_payload [ACK_PAYLOAD_LENGTH]
 GZLL ack payload.
 
static bool pkt_received
 True when a packet with first byte = DEBUG_POLL received.