Nordic Semiconductor nRF5 AirFuel SDK  version 2.2.0
PTU / PRU debug API

Macros

#define NRF_GZLL_CHANNEL_TABLE_SIZE   5
 

Enumerations

enum  wdi_pkt_t {
  DEBUG_POLL = 0, DEBUG_PKT = 1, DEBUG_STR = 2, DEBUG_PTU = 3,
  DEBUG_PRU0 = 0x80, DEBUG_PRU1 = 0x81, DEBUG_PRU2 = 0x82, DEBUG_PRU3 = 0x83,
  DEBUG_PRU4 = 0x84, DEBUG_PRU5 = 0x85, DEBUG_PRU6 = 0x86, DEBUG_PRU7 = 0x87
}
 WDI packet headers type. More...
 

Functions

void debug (void)
 Process debug commands.
 
void debug_add_string (const char *s)
 Add string to debug output. More...
 
uint32_t sd_radio_init (void)
 Initialize SD Radio API. More...
 
bool debug_cmd_available (void)
 Check if debug command received from dongle. More...
 
char get_debug_cmd (void)
 get debug command received from dongle More...
 

Detailed Description

Macro Definition Documentation

#define NRF_GZLL_CHANNEL_TABLE_SIZE   5

Channel table size.

Definition at line 20 of file wireless_debug_config.h.

Enumeration Type Documentation

enum wdi_pkt_t

WDI packet headers type.

Enumerator
DEBUG_POLL 

WDI Packet type for polling the dongle

DEBUG_PKT 

Regular WDI packet

DEBUG_STR 

String packet

DEBUG_PTU 

PTU common command

DEBUG_PRU0 

PRU 0 data from PTU

DEBUG_PRU1 

PRU 1 data from PTU

DEBUG_PRU2 

PRU 2 data from PTU

DEBUG_PRU3 

PRU 3 data from PTU

DEBUG_PRU4 

PRU 4 data from PTU

DEBUG_PRU5 

PRU 5 data from PTU

DEBUG_PRU6 

PRU 6 data from PTU

DEBUG_PRU7 

PRU 7 data from PTU

Definition at line 24 of file wireless_debug.h.

25 {
26  DEBUG_POLL = 0,
27  DEBUG_PKT = 1,
28  DEBUG_STR = 2,
29  DEBUG_PTU = 3,
30  DEBUG_PRU0 = 0x80,
31  DEBUG_PRU1 = 0x81,
32  DEBUG_PRU2 = 0x82,
33  DEBUG_PRU3 = 0x83,
34  DEBUG_PRU4 = 0x84,
35  DEBUG_PRU5 = 0x85,
36  DEBUG_PRU6 = 0x86,
37  DEBUG_PRU7 = 0x87
38 } wdi_pkt_t;
wdi_pkt_t
WDI packet headers type.

Function Documentation

void debug_add_string ( const char *  s)

Add string to debug output.

Parameters
[in]sis the string to be added to debug output.

Definition at line 578 of file pru_debug.c.

579 {
580  sprintf(m_evt_evt_string, "%s", s);
581 }
static char m_evt_evt_string[EVT_STRING_LENGTH_MAX]
Definition: pru_debug.c:61
uint32_t sd_radio_init ( void  )

Initialize SD Radio API.

Returns
Command status

Initialize SD Radio API.

Definition at line 190 of file wireless_debug.c.

191 {
192  uint32_t err_code;
193  err_code = softdevice_sys_evt_handler_set(sys_evt_dispatch);
194  APP_ERROR_CHECK(err_code);
195  err_code = sd_radio_session_open(m_radio_callback);
196  if (err_code != NRF_SUCCESS)
197  return err_code;
199  err_code = sd_radio_request(&m_timeslot_request);
200  if (err_code != NRF_SUCCESS)
201  {
202  (void)sd_radio_session_close();
203  return err_code;
204  }
205  return NRF_SUCCESS;
206 }
static void m_configure_next_event(void)
Fill in m_timeslot_request for next event.
nrf_radio_signal_callback_return_param_t * m_radio_callback(uint8_t signal_type)
Radio session callback.
void sys_evt_dispatch(uint32_t evt_id)
SOC events handler.
static nrf_radio_request_t m_timeslot_request
Passed to the sd_radio_request function.
bool debug_cmd_available ( void  )

Check if debug command received from dongle.

Returns
true New command is available
false No command is available

Check if debug command received from dongle.

Definition at line 248 of file wireless_debug.c.

249 {
250  return m_cmd_received;
251 }
static volatile bool m_cmd_received
Set to true when a command is received.
char get_debug_cmd ( void  )

get debug command received from dongle

Returns
Command from dongle

get debug command received from dongle

Definition at line 256 of file wireless_debug.c.

257 {
258  char cmd = ack_payload[0];
259  m_cmd_received = false;
260  return cmd;
261 }
static uint8_t ack_payload[ACK_PAYLOAD_LENGTH]
Buffer for the ACK payload.
static volatile bool m_cmd_received
Set to true when a command is received.