nRF51 SDK
|
Macros | |
#define | MAX_MENU_OPTIONS (11UL) |
#define | MAX_CHARACTERS_PER_LINE (16UL) |
#define | MAX_CHARECTER_IN_MENU_OPTION (60UL) |
#define | MAX_CURSOR_POS_IN_STRING |
#define | ERROR_PIN (8) |
Enumerations | |
enum | radio_tests_t { RADIO_TEST_NOP, RADIO_TEST_TXCC, RADIO_TEST_TXMC, RADIO_TEST_TXSWEEP, RADIO_TEST_RXC, RADIO_TEST_RXSWEEP, RADIO_TEST_NOP, RADIO_TEST_TXCC, RADIO_TEST_TXMC, RADIO_TEST_TXSWEEP, RADIO_TEST_RXC, RADIO_TEST_RXSWEEP, RADIO_TEST_NOP, RADIO_TEST_TXCC, RADIO_TEST_TXMC, RADIO_TEST_TXSWEEP, RADIO_TEST_RXC, RADIO_TEST_RXSWEEP, RADIO_TEST_NOP, RADIO_TEST_TXCC, RADIO_TEST_TXMC, RADIO_TEST_TXSWEEP, RADIO_TEST_RXC, RADIO_TEST_RXSWEEP } |
enum | change_direction_t { decrement =0, increment, decrement =0, increment } |
Functions | |
static void | radio_test (void) |
static void | gpio_config (void) |
Function for configuring ERROR_PIN as output for showing errors. | |
static void | radio_init (void) |
Function for starting up the needed peripherals. | |
static void | show_error (void) |
Function for setting ERROR_PIN to one and enter an infinite loop. This function is called if any of the nRF6350 functions fail. | |
static void | wait_for_joystick_movement (void) |
Function for waiting until the joystick status has changed. Performs radio_test while joystick state has not changed. | |
static void | change_selected_variable (change_direction_t cd) |
Function for identifying the change in menu position. | |
static void | joystick_wait_change_update_pos_variables (void) |
Function that waits for joystick movement, then updates cursor and menu list position. | |
static void | display_text (void) |
Function for displaying text of the correct section with correct offset on the display. | |
static void | menu_help_testrun_when_idle (void) |
Function for the output menu to the display port. More... | |
static void | timer0_init (uint8_t delayms) |
Function for initializing timer0 in 24 bit timer mode and 1 us resolution. | |
static void | radio_disable (void) |
Function for disabling the radio. | |
static void | radio_sweep_end (void) |
Function for stopping Timer0 and disabling the radio to end radio sweep. | |
static void | radio_tx_carrier (uint8_t txpower, uint8_t mode, uint8_t channel) |
Function for turning on TX carrier test mode. | |
static uint32_t | rnd8 (void) |
Function for generating an 8 bit random number using the internal random generator. | |
static uint32_t | rnd32 (void) |
Function for generating a 32 bit random number using the internal random generator. | |
static void | generate_modulated_rf_packet (void) |
Function for configuring the radio to use a random address and a 254 bytes random payload. The S0 and S1 fields are not used. | |
static void | radio_modulated_tx_carrier (uint8_t txpower, uint8_t mode, uint8_t channel) |
Function for starting modulated TX carrier. This is done by repeatedly sending a packet with a random address and payload. | |
static void | radio_rx_carrier (uint8_t channel) |
Function for turning on the RX carrier. | |
static void | radio_tx_sweep_start (uint8_t channel_start, uint8_t delayms) |
Function for turning on a TX carrier sweep. This test uses Timer 0 to restart the TX carrier above at different channels. | |
static void | radio_rx_sweep_start (uint8_t channel_start, uint8_t delayms) |
Function for turning on an RX carrier sweep. This test uses Timer 0 to restart the RX carrier above at different channels. | |
void | TIMER0_IRQHandler (void) |
Function for handling the Timer 0 interrupt used for TX/RX sweep. The carrier is started with the new channel, and the channel is incremented for next interrupt. | |
int | main (void) |
Function for application main entry. | |
Variables | |
static uint8_t | packet [256] |
static bool | sweep = false |
static uint8_t | mode_ = RADIO_MODE_MODE_Nrf_2Mbit |
static uint8_t | data_rate_ = 0 |
static uint8_t | txpower_menu_ = RADIO_TXPOWER_TXPOWER_0dBm |
static uint8_t | channel_ = 0 |
static uint8_t | channel_start_ = 0 |
static uint8_t | channel_end_ = 80 |
static uint8_t | delayms_ = 10 |
static uint8_t | js_state_last = JS_BUTTON_NONE |
static uint8_t | js_state = JS_BUTTON_NONE |
static bool | sweep_tx_ = false |
static bool | in_menu = true |
static uint8_t | current_menu_pos = 0 |
static uint8_t | current_scroll_pos = 0 |
static uint8_t | txpower_ = RADIO_TXPOWER_TXPOWER_0dBm |
static uint32_t * | p_variables [MAX_MENU_OPTIONS] |
static const char * | help_menu [MAX_MENU_OPTIONS] |
This file contains the source code for a sample application using nRF6350.
#define MAX_MENU_OPTIONS (11UL) |
Number of options in the main menu of the test
#define MAX_CHARACTERS_PER_LINE (16UL) |
Maximum characters that are visible in one line on nRF6350 display
#define MAX_CHARECTER_IN_MENU_OPTION (60UL) |
Maximum string length of display options text
#define MAX_CURSOR_POS_IN_STRING |
Maximum cursor position(string position that points to first letter in first line of display) on display
#define ERROR_PIN (8) |
Pin that is active high when there is an error in this example
enum radio_tests_t |
|
static |
< Continuous radio tests to run.
< Current selection of test.
|
static |
The display can only show one line at a time, scroll right or left to see more text. Also displays value of the variables to be changed in editing mode.
|
static |
Data packet.
|
static |
Sweep enabled.
|
static |
Transfer mode.
|
static |
Transfer data rate.
|
static |
TX power in dBm.
|
static |
This is used in sweep and varies from channel_start_ to channel_end_.
|
static |
Starting channel number.
|
static |
End channel number.
|
static |
Delay in ms (0ms - 99ms).
|
static |
Previous Joystick state.
|
static |
Current Joystick state.
|
static |
Boolean for TX Sweep.
|
static |
Browsing menu if true and false while editing some value (defaults to true at power up).
|
static |
Current menu option selected (defaults to first one in the list).
|
static |
Current scroll position in the selection text (defaults to first character).
|
static |
|
static |