Nordic Semiconductor nRF5 AirFuel SDK
version 2.2.0
|
#include <string.h>
#include <stdio.h>
#include "simple_uart.h"
#include "app_print.h"
#include "wpt.h"
#include "pru_sm.h"
#include "pru_hw_config.h"
#include "pru_test_mux.h"
#include "debug.h"
#include "ble_wpts.h"
#include "pru.h"
#include "ble.h"
#include "nrf_soc.h"
#include "softdevice_handler.h"
#include "nrf_sdm.h"
#include "pru_sensors.h"
#include "bsp.h"
Go to the source code of this file.
Macros | |
#define | EVT_STRING_LENGTH_MAX 20 |
#define | DEBUG_LINE_LENGTH 80 |
#define | VRECT_INCREMENT 500 |
#define | IRECT_INCREMENT 100 |
#define | VOUT_INCREMENT 500 |
#define | IOUT_INCREMENT 100 |
#define | TEMPERATURE_INCREMENT 5 |
#define | DEBUG_CONN_HANDLE 0 |
#define | DEBUG_ALERT_VALUE_HANDLE 0x0f |
Functions | |
API implementation | |
void | debug (void) |
Process debug commands. | |
void | debug_add_string (const char *s) |
Add string to debug output. More... | |
Static functions and variables | |
static debug_output_t | m_debug_output |
static char | m_evt_evt_string [EVT_STRING_LENGTH_MAX] = "" |
static pru_tmux_override_t | override_values |
static pru_control_t | m_latest_control_data_received |
static bool | m_uart_initialized = false |
static bool | m_transmission_stopped = false |
static const ble_gap_addr_t | MODE_TRANS_ADDRESS |
void | wpts_test_evt_handle_cb (ble_wpts_t *p_wpts, ble_wpts_evt_t *p_evt) |
Override weak wpts_test_evt_handle_cb() More... | |
bool | pru_process_command_board (uint8_t cmd) |
Function for processing board specific test commands. More... | |
static bool | m_uart_chars_available (void) |
Check if there are any characters in the UART receive buffer. More... | |
static void | m_send_mode_transition_alert (uint8_t mode_trans_val, bool include_address) |
Send Mode Transition alert to PTU. More... | |
static bool | m_pru_process_command_common (uint8_t cmd) |
Function for processing common test commands. More... | |
static void | sm_uart_rx_poll (void) |
Get and process uart commands. | |
static void | line_print (void) |
Print a DEBUG_LINE_LENGTH character long "horizontal line" to UART. | |
static bool | debug_output_changed (void) |
Update m_debug_output variable. More... | |
static char * | m_state_string_get (pru_sm_state_t state) |
Convert state enum to string. More... | |
static void | debug_output_print (void) |
Print contents of m_debug_output to UART. More... | |
#define EVT_STRING_LENGTH_MAX 20 |
Max length of event message string
Definition at line 34 of file pru_debug.c.
#define DEBUG_LINE_LENGTH 80 |
Width of debug output table
Definition at line 35 of file pru_debug.c.
#define VRECT_INCREMENT 500 |
Value by which VRECT is incremented/decremented for each call to the simulated measurement function.
Definition at line 36 of file pru_debug.c.
#define IRECT_INCREMENT 100 |
Value by which IRECT is incremented/decremented for each call to the simulated measurement function.
Definition at line 37 of file pru_debug.c.
#define VOUT_INCREMENT 500 |
Value by which VOUT is incremented/decremented for each call to the simulated measurement function.
Definition at line 38 of file pru_debug.c.
#define IOUT_INCREMENT 100 |
Value by which IOUT is incremented/decremented for each call to the simulated measurement function.
Definition at line 39 of file pru_debug.c.
#define TEMPERATURE_INCREMENT 5 |
Value by which the Temperature is incremented/decremented for each call to the simulated measurement function.
Definition at line 40 of file pru_debug.c.
#define DEBUG_CONN_HANDLE 0 |
Assumed Connection handle during debug.
Definition at line 42 of file pru_debug.c.
#define DEBUG_ALERT_VALUE_HANDLE 0x0f |
Assumed handle of Alert characteristic value during debug.
Definition at line 43 of file pru_debug.c.
void wpts_test_evt_handle_cb | ( | ble_wpts_t * | p_wpts, |
ble_wpts_evt_t * | p_evt | ||
) |
Override weak wpts_test_evt_handle_cb()
p_wpts | WPT Service |
p_evt | WPT Service event |
Definition at line 77 of file pru_debug.c.
bool pru_process_command_board | ( | uint8_t | cmd | ) |
Function for processing board specific test commands.
[in] | cmd | Command code to process. |
true | Command code was processed by this function. |
false | Command code was not processed by this function. |
|
static |
Check if there are any characters in the UART receive buffer.
This function returns the true if there is a character available for reading in the UART receive buffer.
true | There is a character available for reading |
false | there is not a character available for reading |
Definition at line 104 of file pru_debug.c.
|
static |
Send Mode Transition alert to PTU.
include_address | Should the address be non-null? |
mode_trans_val | Value to use in Mode Transition Value field of PRU alert. |
Definition at line 114 of file pru_debug.c.
|
static |
Function for processing common test commands.
[in] | cmd | Command code to process. |
true | Command code was processed by this function. |
false | Command code was not processed by this function. |
Definition at line 159 of file pru_debug.c.
|
static |
Update m_debug_output variable.
Definition at line 433 of file pru_debug.c.
|
static |
Convert state enum to string.
state | The state enum to convert |
Definition at line 470 of file pru_debug.c.
|
static |
Print contents of m_debug_output to UART.
< Debug output collection
Definition at line 490 of file pru_debug.c.
|
static |
Debug output collection
Definition at line 60 of file pru_debug.c.
|
static |
Event message string
Definition at line 61 of file pru_debug.c.
|
static |
Local copy of override values
Definition at line 62 of file pru_debug.c.
|
static |
Local latest received control data
Definition at line 63 of file pru_debug.c.
|
static |
UART initalized flag. Used to initialize UART on first scharacter sent.
Definition at line 64 of file pru_debug.c.
|
static |
Is transmission stopped?
Definition at line 65 of file pru_debug.c.
|
static |
Address to use in Mode Transition if address is non-0
Definition at line 66 of file pru_debug.c.