wps.h

SPARK Wireless Protocol Stack.

Copyright

Copyright (C) 2021 SPARK Microsystems International Inc. All rights reserved.

License

This source code is proprietary and subject to the SPARK Microsystems Software EULA found in this package in file EULA.txt.

Author

SPARK FW Team.

Defines

BIT_AUTO_REPLY_TIMESLOT (1 << 7)

Bit mask to identify Auto reply timeslot (Prime timeslot)

MAIN_TIMESLOT(x) ((x) & 0x7F)

User MACRO to identify primary timeslot

AUTO_TIMESLOT(x) ((x) | BIT_AUTO_REPLY_TIMESLOT)

User MACRO to identify data in auto-reply timeslot (Prime timeslot)

Typedefs

typedef enum wps_input_signal wps_input_signal_t

Wireless Protocol Stack input signals.

typedef enum wps_state wps_status_t

Wireless Protocol Stack status.

typedef struct wps_connection_config wps_connection_cfg_t

Wireless Protocol Stack connection configuration.

typedef struct node_config wps_node_cfg_t

Wireless Protocol Stack node configuration.

typedef struct wps_l7 wps_l7_t

Wireless Protocol Stack layer 7.

typedef struct wps wps_t

Wireless Protocol Stack structure.

typedef struct wps_critical wps_critical_cfg_t

Critical section callback.

typedef struct wps_phase_interface wps_phase_interface_t

WPS Ranging function pointer interface structure.

Enums

enum wps_input_signal

Wireless Protocol Stack input signals.

Values:

enumerator WPS_NONE

WPS no signal

enumerator WPS_RADIO_IRQ

WPS radio IRQ signal

enumerator WPS_TRANSFER_COMPLETE

WPS transfer complete signal

enumerator WPS_CONNECT

WPS complete signal

enumerator WPS_DISCONNECT

WPS disconnect signal

enumerator WPS_HALT

WPS halt signal

enumerator WPS_RESUME

WPS resume signal

enumerator WPS_YIELD

WPS yield signal

enumerator WPS_PROCESS_PHY

WPS process PHY signal

enumerator WPS_PROCESS_MAC

WPS process MAC signal

enumerator WPS_PROCESS_L7

WPS process L7 signal

enum wps_state

Wireless Protocol Stack status.

Values:

enumerator WPS_IDLE

WPS IDLE state

enumerator WPS_PROCESSING

WPS processing state

Functions

uint32_t wps_us_to_pll_cycle(uint32_t time_us, chip_rate_cfg_t chip_rate)

Convert time in us to PLL cycles.

Parameters
  • time_us – [in] Time in us.

  • chip_rate – [in] Chip rate.

Returns

Number of PLL cycles.

void wps_init_critical_section(wps_critical_cfg_t *critical_cfg)

Wireless Protocol Stack critical section initialization.

Assign function to enter and exit critical section which disables the interrupts.

Parameters

critical_cfg – [in] User function to enter & exit critical section.

void wps_init_phase_interface(wps_t *wps, wps_phase_interface_t *phase_itf)

Set the WPS Phase interface.

Parameters
  • wps – WPS instance.

  • phase_itf – Phase interface.

void wps_radio_init(wps_radio_t *wps_radio, wps_error_t *error)

Wireless Protocol Stack radio initialization.

Read and save NVM. radio_hal_t and spi buffer must be already be assigned in wps_radio_t.

Parameters
  • wps_radio – WPS radio instance.

  • error – [out] Error code.

void wps_set_vref_tune_offset_enabled_flag(wps_radio_t *node, bool vref_tune_offset_enabled)

Set vref_tune_offset_enabled flag.

The vref_tune_offset_enabled flag is used to fine-tune the output voltage of the main transceiver’s reference buffer. This may be used to compensate for frequency, gain and overall performance variations between individual units.

Parameters
  • node – [in] WPS node instance..

  • vref_tune_offset_enabled – [in] Enable/disable vref tune offset.

void wps_init_callback_queue(wps_t *wps, wps_callback_inst_t *callback_buffer, size_t size, void (*context_switch)(void))

Initialize the callback queue.

The callback queue is used to store event actions waiting to be executed by the application.

The size of the callback buffer should be equal to the size of the biggest Xlayer queue.

Parameters
  • wps – [in] Wireless Protocol Stack instance.

  • callback_buffer – [in] Array of callback function pointer.

  • size – [in] Array size.

  • context_switch – [in] Function that trigger the context switch to the callback process

void wps_init_request_queue(wps_t *wps, wps_request_info_t *request_buffer, size_t size)

Initialize the queue for the application request.

Parameters
  • wps – [in] Wireless Protocol Stack instance.

  • request_buffer – [in] Array of request pointer.

  • size – [in] Size fo the request array.

void wps_init(wps_t *wps, wps_node_t *node, wps_error_t *err)

Wireless Protocol Stack initialization.

Initialize the WPS and all the layers inside the WPS.

Parameters
  • wps – [in] Wireless Protocol Stack instance.

  • node – [in] Node instance.

  • err – [out] Pointer to the error code.

void wps_set_syncing_address(wps_t *wps, uint16_t address, wps_error_t *err)

Set network syncing address.

Parameters
  • wps – [in] Wireless Protocol Stack instance.

  • address – [in] Syncing address.

  • err – [out] Pointer to the error code.

void wps_config_node(wps_node_t *node, wps_radio_t *radio, wps_node_cfg_t *cfg, wps_error_t *err)

Node configuration.

Configure the SPARK radio for proper communication. This goes through all of the packet configurations, the interrupt event, the sleep level and the internal radio timer source.

Parameters
  • node – [in] Node instance.

  • radio – [in] Radio instance.

  • cfg – [in] Node configuration.

  • err – [out] Pointer to the error code.

void wps_config_network_schedule(wps_t *wps, uint32_t *timeslot_duration_pll_cycles, timeslot_t *timeslot, uint32_t schedule_size, wps_error_t *err)

Configure network schedule.

Initialize the schedule object and convert the given duration to the time base of the SPARK radio.

Parameters
  • wps – [in] Wireless Protocol Stack instance.

  • timeslot_duration_pll_cycles – [in] Timeslot duration array in pll cycles.

  • timeslot – [in] Timeslot array used by schedule.

  • schedule_size – [in] Schedule size. Timeslot’s array size must match.

  • err – [out] Pointer to the error code.

void wps_reset_schedule(wps_t *wps, wps_error_t *err)

Reset schedule.

Parameters
  • wps – [in] Wireless Protocol Stack instance.

  • err – [out] Pointer to the error code.

void wps_config_network_channel_sequence(wps_t *wps, uint32_t *channel_sequence, uint32_t sequence_size, wps_error_t *err)

Configure network channel sequence.

Initialize the channel sequence for the Channel Hopping module inside the Layer 2 of the WPS.

Parameters
  • wps – [in] Wireless Protocol Stack instance.

  • channel_sequence – [in] Channel sequence.

  • sequence_size – [in] Channel sequence size.

  • err – [out] Pointer to the error code.

void wps_enable_concurrency(wps_t *wps, uint16_t syncing_address, uint8_t network_msbits_count, wps_error_t *err)

Enable concurrency.

When enabling concurrency, the number of most significant bits reserved to indicate the network ID out of the 16 address bits needs to be provided. This value needs to be consistent across all nodes in all concurrent networks.

There is a possibility of 2^network_msbits_count concurrent networks with (16-network_msbits_count)^2 nodes within each of them.

For example, if network_msbits_count == 5:

This means there is a possibility of 32 concurrent networks with 2048 nodes within each of them. Any node address 0b 0000 0xxx xxxx xxxx is in the network 0. Any node address 0b 0000 1xxx xxxx xxxx is in the network 1. … Any node address 0b 1111 1xxx xxxx xxxx is in the network 31.

Each of these concurrent networks will have 1 chosen coordinator address within that address space as well as 2047 possible node addresses.

Parameters
  • wps – [in] Wireless Protocol Stack instance.

  • syncing_address – [in] Syncing address.

  • network_msbits_count – [in] Number of significant bits used for the network ID.

  • err – [out] Pointer to the error code.

void wps_disable_concurrency(wps_t *wps, wps_error_t *err)

Disable concurrency.

Parameters
  • wps – [in] Wireless Protocol Stack instance.

  • err – [out] Pointer to the error code.

void wps_enable_fast_sync(wps_t *wps, wps_error_t *err)

Enable fast sync.

Enable the WPS to synchronize the link using a specific timeslot. This allows the link to get synchronized faster when connections are not set to auto_sync.

The radio listens for 15.92 us + preamble_len (set in wps_node_cfg_t) * 48.828125 ns every syncing_period_us.

Parameters
  • wps – [in] Wireless Protocol Stack instance.

  • err – [out] Pointer to the error code.

void wps_disable_fast_sync(wps_t *wps, wps_error_t *err)

Disable fast sync.

Parameters
  • wps – [in] Wireless Protocol Stack instance.

  • err – [out] Pointer to the error code.

void wps_enable_internal_connection(wps_connection_t *connection, wps_internal_connection_cfg_t *internal_conn_cfg, wps_error_t *err)

Enable the WPS internal connection.

Note

Here are the available protocol as of right now in the connection :

  • Random datarate offset (2 bytes)

Parameters
  • connection – [in] Connection instance.

  • internal_conn_cfg – [in] Internal connection configuration.

  • err – [out] Pointer to the error code.

void wps_disable_internal_connection(wps_connection_t *connection, wps_error_t *err)

Disable the WPS internal connection.

Note

This disable every protocol inside the internal connection.

Parameters
  • connection – [in] Connection instance.

  • err – [out] Pointer to the error code.

void wps_create_connection(wps_connection_t *connection, wps_node_t *node, wps_connection_cfg_t *config, wps_error_t *err)

Create a connection between two nodes.

A connection is a unidirectional link between two nodes. The direction of the data will be determined by the relation between the source address of the connection and the current node address. For example, if source address is equal to this node address, the node will transmit during this connection.

Parameters
  • connection – [in] Connection instance.

  • node – [in] Node instance.

  • config – [in] Connection configuration.

  • err – [out] Pointer to the error code.

void wps_connection_set_timeslot(wps_connection_t *connection, wps_t *wps, int32_t *timeslot_id, uint32_t nb_timeslots, wps_error_t *err)

Set connection’s timeslot.

A connection may send its payload via the MAIN_TIMESLOT or AUTO_TIMESLOT. It can’t use both on the same timeslot. Feature like retransmission are not available when using AUTO_TIMESLOT.

Parameters
  • connection – [in] Connection instance.

  • wps – [in] Wireless Protocol Stack instance.

  • timeslot_id – [in] Timeslot id used by the connection.

  • nb_timeslots – [in] Number of timeslot used by the connection. Must match timeslot_id array size.

  • err – [out] Pointer to the error code.

void wps_connection_config_channel(wps_connection_t *connection, wps_node_t *node, uint8_t channel_x, channel_cfg_t *config, wps_error_t *err)

Configure connection’s RF channel.

Configure the receiver’s filter, transmission power and power amplifier.

Parameters
  • connection – [in] Connection instance.

  • node – [in] Node instance.

  • channel_x – [in] Channel number.

  • config – [in] Channel configuration.

  • err – [out] Pointer to the error code.

void wps_connection_preset_config_channel(wps_connection_t *connection, wps_node_t *node, uint16_t frequency, tx_power_t tx_power, uint8_t channel_x, wps_error_t *err)

Configure connection’s RF channel in a more convenient way.

Configure the receiver’s filter, transmission power and power amplifier.

Parameters
  • connection – [in] Connection instance.

  • node – [in] Node instance.

  • frequency – [in] Frequency to configure.

  • tx_power – [in] Channel’s desired tranmission power level.

  • channel_x – [in] Channel number.

  • err – [out] Pointer to the error code.

void wps_connection_config_frame(wps_connection_t *connection, modulation_t modulation, fec_level_t fec, wps_error_t *err)

Configure connection’s frame modulation and FEC level.

Parameters
  • connection – [in] Connection instance.

  • modulation – [in] Modulation.

  • fec – [in] FEC level.

  • err – [out] Pointer to the error code.

void wps_connection_enable_ack(wps_connection_t *connection, wps_error_t *err)

Enable acknowledgment for connection’s packet.

Parameters
  • connection – [in] Connection instance.

  • err – [out] Pointer to the error code.

void wps_connection_disable_ack(wps_connection_t *connection, wps_error_t *err)

Disable acknowledgment for connection’s packet.

Parameters
  • connection – [in] Connection instance.

  • err – [out] Pointer to the error code.

void wps_connection_enable_phases_aquisition(wps_connection_t *connection, wps_error_t *err)

Enable phases fetching in the radio.

Parameters
  • connection – [in] Connection instance.

  • err – [out] Pointer to the error code.

void wps_connection_disable_phases_aquisition(wps_connection_t *connection, wps_error_t *err)

Disable phases fetching in the radio.

Parameters
  • connection – [in] Connection instance.

  • err – [out] Pointer to the error code.

void wps_connection_enable_stop_and_wait_arq(wps_connection_t *connection, uint16_t local_address, uint32_t retry, uint32_t deadline_quarter_ms, wps_error_t *err)

Enable Stop and Wait (SaW) and Automatic Repeat Request (ARQ) for connection’s packet.

Note

This function must be called after wps_connection_enable_ack.

Parameters
  • connection – [in] Connection instance.

  • local_address – [in] Current node address.

  • retry – [in] Maximum number of retry.

  • deadline_quarter_ms – [in] Deadline in 1/4 ms. Packet is dropped when deadline is reached.

  • err – [out] Pointer to the error code.

void wps_connection_disable_stop_and_wait_arq(wps_connection_t *connection, wps_error_t *err)

Disable Stop and Wait (SaW) and Automatic Repeat Request (ARQ) for connection’s packet.

Retransmission are disabled when disabling the SaW ARQ. Incomplete transmission will be notified to user every time a packet is NACK.

Parameters
  • connection – [in] Connection instance.

  • err – [out] Pointer to the error code.

void wps_connection_enable_auto_sync(wps_connection_t *connection, wps_error_t *err)

Enable auto-sync mode.

If this mode is enabled, when the cross-layer queue is empty, a small frame containing the L2 header will be sent over the air for the current time slot. This can be useful to keep synchronization when no application data is being sent.

Warning: When the auto-sync is disabled, the user should provide a consistent data rate output on the coordinator in order to keep synchronization in the network.

Parameters
  • connection – [in] Connection instance.

  • err – [out] Pointer to the error code.

void wps_connection_disable_auto_sync(wps_connection_t *connection, wps_error_t *err)

Disable auto-sync mode.

If this mode is disabled, when the cross-layer queue is empty, no data will be sent over the air, the radio will simply wake up and the WPS will prepare the next time slot.

Warning: When the auto-sync is disabled, the user should provide a consistent data rate output on the coordinator in order to keep synchronization in the network.

Parameters
  • connection – [in] Connection instance.

  • err – [out] Pointer to the error code.

void wps_connection_remove_connection(wps_connection_t *connection, wps_t *wps, wps_error_t *err)

Remove connection from network.

Parameters
  • connection – [in] Connection instance.

  • wps – [in] Wireless Protocol Stack instance.

  • err – [out] Pointer to the error code.

void wps_connection_enable_fixed_payload_size(wps_connection_t *connection, uint8_t fixed_payload_size, wps_error_t *err)

Enable connection fixed payload size mode.

Warning: The use of auto replies to send user payload is not supported when this mode is enabled.

Parameters
  • connection – [in] Connection instance.

  • fixed_payload_size – [in] Payload size.

  • err – [out] Pointer to the error code.

void wps_connection_disable_fixed_payload_size(wps_connection_t *connection, wps_error_t *err)

Disable connection fixed payload size mode.

Note

Warning: The use of auto replies to send user payload is not supported when this mode is enabled.

Parameters
  • connection – [in] Connection instance.

  • err – [out] Pointer to the error code.

void wps_connection_enable_cca(wps_connection_t *connection, uint8_t threshold, uint16_t retry_time_pll_cycles, uint8_t try_count, cca_fail_action_t fail_action, wps_error_t *err)

Enable a connection’s Clear Channel Assessment (CCA).

Parameters
  • connection – [in] Connection instance.

  • threshold – [in] CCA threshold.

  • retry_time_pll_cycles – [in] CCA retry time.

  • try_count – [in] CCA try count.

  • fail_action – [in] CCA fail action.

  • err – [out] Pointer to the error code.

void wps_connection_disable_cca(wps_connection_t *connection, wps_error_t *err)

Disable connection Clear Channel Assessment (CCA).

Note

To properly disable CCA, the CCA module needs to be disabled with a threshold of 0xff.

Parameters
  • connection – [in] Connection instance.

  • err – [out] Pointer to the error code.

void wps_connection_enable_fixed_gain(wps_connection_t *connection, uint8_t rx_gain, wps_error_t *err)

Enable connection’s fixed gain (SR1120 feature only).

Parameters
  • connection – [in] Connection instance.

  • rx_gain – [in] RX gain.

  • err – [out] Pointer to the error code.

void wps_connection_disable_fixed_gain(wps_connection_t *connection, wps_error_t *err)

Disable connection’s fixed gain.

Parameters
  • connection – [in] Connection instance.

  • err – [out] Pointer to the error code.

void wps_connect(wps_t *wps, wps_error_t *err)

Connect node to network.

Setup the radio internal timer and reset every layer in the WPS.

Parameters
  • wps – [in] Wireless Protocol Stack instance.

  • err – [out] Pointer to the error code.

void wps_disconnect(wps_t *wps, wps_error_t *err)

Disconnect node from network.

Put radio to sleep and disable internal radio timer to disconnect the radio from the network.

Parameters
  • wps – [in] Wireless Protocol Stack instance.

  • err – [out] Pointer to the error code.

void wps_reset(wps_t *wps, wps_error_t *err)

Reset the WPS when a crash occurs.

When a crash occurs the WPS is disconnected and then reconnected.

Parameters
  • wps – [in] Wireless Protocol Stack instance.

  • err – [out] Pointer to the error code.

void wps_halt(wps_t *wps, wps_error_t *err)

Halt connection to network.

The node stays synchronized but doesn’t send / receive application payload.

Parameters
  • wps – [in] Wireless Protocol Stack instance.

  • err – [out] Pointer to the error code.

void wps_resume(wps_t *wps, wps_error_t *err)

Resume connection to network.

Parameters
  • wps – [in] Wireless Protocol Stack instance.

  • err – [out] Pointer to the error code.

void wps_get_free_slot(wps_connection_t *connection, uint8_t **payload, wps_error_t *err)

Get buffer from the wps queue to hold the payload.

The usage of this function is optional. If you don’t want to use the WPS queue to hold the tx payload, when wps_create_connection is called, set the config.frame_length value to WPS_RADIO_HEADER_SIZE.

Parameters
  • connection – [in] Connection instance.

  • payload – [in] Pointer to the empty payload memory.

  • err – [out] Pointer to the error code.

void wps_send(wps_connection_t *connection, uint8_t *payload, uint8_t size, wps_error_t *err)

Send payload over the air.

Enqueue a node in the connection Xlayer and WPS will send at next available timeslot.

Parameters
  • connection – [in] Connection instance.

  • payload – [in] Application payload to send over the air.

  • size – [in] Payload size in bytes.

  • err – [out] Pointer to the error code.

wps_rx_frame wps_read(wps_connection_t *connection, wps_error_t *err)

Read last received frame.

Parameters
  • connection – [in] Connection instance.

  • err – [out] Pointer to the error code.

Returns

WPS Received frame structure, including payload and size.

void wps_read_done(wps_connection_t *connection, wps_error_t *err)

Remove the frame from the receiver FIFO.

Parameters
  • connection – [in] Connection instance.

  • err – [out] Pointer to the error code.

uint32_t wps_get_fifo_size(wps_connection_t *connection)

Return the used space of the connection Xlayer queue.

Parameters

connection – [in] Connection instance.

Returns

Xlayer queue’s used space.

uint32_t wps_get_fifo_free_space(wps_connection_t *connection)

Return the free space of the connection Xlayer queue.

Parameters

connection – [in] Connection instance.

Returns

Xlayer queues’s free space.

wps_error_t wps_get_error(wps_connection_t *connection)

Get the current WPS error.

Note

This function should only be called from the error_callback_t that should be implemented in the application. The output error is of type wps_error_t.

Parameters

connection – [in] Current connection with an error.

Returns

Current WPS error.

void wps_init_connection_throttle(wps_connection_t *connection, wps_error_t *err)

Initialize the connection throttle feature.

Note

The pattern member of the connection struct need to be allocated to at least WPS_CONNECTION_THROTTLE_GRANULARITY * sizeof(bool).

Parameters
  • connection – [in] Current connection with an error.

  • err – [out] Pointer to the error code.

void wps_set_active_ratio(wps_t *wps, wps_connection_t *connection, uint8_t ratio_percent, wps_error_t *err)

Set the active timeslot ratio of the given connection.

Note

Connection pattern member should been initialized and allocated before calling this method.

Parameters
  • wps – [in] Wireless Protocol Stack instance.

  • connection – [in] Current connection with an error.

  • ratio_percent – [in] Active timeslot ratio, in percent.

  • err – [out] Pointer to the error code.

void wps_request_write_register(wps_t *wps, uint8_t starting_reg, uint8_t data, wps_error_t *err)

Issue a write register request to the WPS.

Note

Next time WPS is ready, it will write to the requested register(s).

Parameters
  • wps – [in] Wireless Protocol Stack instance.

  • starting_reg – [in] Starting register.

  • data – [in] Byte to send.

  • err – [out] Pointer to the error code.

void wps_request_read_register(wps_t *wps, uint8_t target_register, uint8_t *rx_buffer, bool *xfer_cmplt, wps_error_t *err)

Issue a read register request to the WPS.

Parameters
  • wps – [in] Wireless Protocol Stack instance.

  • target_register – [in] Radio Target register.

  • rx_buffer – [in] Buffer containing radio register data.

  • xfer_cmplt – [in] Bool to notify application that the transfer is complete.

  • err – [in] WPS Error.

void wps_process(wps_t *wps)

Process the Wireless Protocol Stack.

Process the WPS state machine in order to send or receive a packet inside the network.

Parameters

wps – [in] Wireless Protocol Stack instance.

void wps_process_callback(wps_t *wps)

Process the wps callback.

This function should be called in a context with higher priority than the application, but lower priority than the radio IRQs. You can run it in a really high priority RTOS task or something like pendsv.

Parameters

wps – [in] Wireless Protocol Stack instance.

static inline void wps_radio_irq(wps_t *wps)

Radio IRQ signal.

Notify the WPS of a context switch.

Parameters

wps – [in] Wireless Protocol Stack instance.

static inline void wps_transfer_complete(wps_t *wps)

SPI transfer complete.

Notify the WPS of a DMA transfer complete interrupt.

Parameters

wps – [in] Wireless Protocol Stack instance.

struct wps_connection_config
#include <wps.h>

Wireless Protocol Stack connection configuration.

Public Members

uint16_t source_address

Current connection source address (Transmitting node address)

uint16_t destination_address

Current connection destination address (Receiving node address)

xlayer_t *fifo_buffer

Queue buffer

uint32_t fifo_buffer_size

Queue size

uint8_t *frame_buffer

Frame buffer use for send/receive payload, depending on the nature of the connection

uint16_t header_length

Length of the WPS header in the current configuration

uint32_t frame_length

Frame length to send/receive. Set to header + max payload size.

void (*send_ack_callback_t)(wps_connection_t *conn)

Function called by the wps to indicate the frame has been acknowledged

void (*send_nack_callback_t)(wps_connection_t *conn)

Function called by the wps to indicate the frame has NOT been acknowledged

void (*receive_callback_t)(wps_connection_t *conn)

Function called by the wps to indicate the frame has been received

void (*error_callback_t)(wps_connection_t *conn)

Function called by the wps to indicate that an error has occurs

uint64_t (*get_tick_quarter_ms)(void)

Get free running timer tick in quarter ms

struct node_config
#include <wps.h>

Wireless Protocol Stack node configuration.

Public Members

wps_role_t role

Current node role : Coordinator or node

uint32_t preamble_len

Length of the preamble, in bits

sleep_lvl_t sleep_lvl

Radio sleep level

uint32_t crc_polynomial

Radio CRC polynomial

uint16_t local_address

Node current address

uint32_t syncword

Radio syncword

syncword_length_t syncword_len

Sync word length

isi_mitig_t isi_mitig

ISI mitigation level

bool phase_offset_stats_enable

Phase offset monitoring enable flag

chip_rate_cfg_t chip_rate

Chip rate (SR1120 only)

uint8_t rx_gain

Default radio RX gain

uint8_t preamble_detection

Radio preamble detection register settings

struct wps_l7
#include <wps.h>

Wireless Protocol Stack layer 7.

Public Members

circular_queue_t callback_queue

Circular queue instance to save the callbacks

circular_queue_t request_queue

Circular queue to forward application request to WPS

struct wps
#include <wps.h>

Wireless Protocol Stack structure.

Public Members

wps_node_t *node

WPS node instance

schedule_t schedule

WPS link schedule (TDMA)

channel_sequence_t channel_sequence

WPS channel sequence for channel hopping

bool concurrency_enabled

WPS concurrency enable flag

uint8_t network_id

WPS concurrent network ID

wps_l7_t l7

WPS Layer 7 instance

wps_mac_t mac

WPS MAC Layer instance

wps_phy_t phy[WPS_RADIO_COUNT]

WPS Layer 1 instance

wps_schedule_ratio_cfg_t throttle_cfg

WPS throttle feature configuration structure

circular_queue_t *write_request_queue

WPS write register request queue

circular_queue_t *read_request_queue

WPS write register request queue

wps_input_signal_t signal

WPS current signal

wps_status_t status

WPS status : Idle or processing

void (*callback_context_switch)(void)

function pointer to trig a context switch to the callback process

struct wps_critical
#include <wps.h>

Critical section callback.

Public Members

void (*enter_critical)(void)

Critical enter callback

void (*exit_critical)(void)

Critical exit callback

struct wps_phase_interface
#include <wps.h>

WPS Ranging function pointer interface structure.

Public Members

void (*supply)(phase_info_t *local_info, phase_info_t *remote_info)

Supply phases data to a module external

bool (*is_busy)(void)

Poll if external module is busy