wps_def.h

Wireless Protocol Stack definitions used by multiple modules.

Copyright

Copyright (C) 2020 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

WPS_RADIO_COUNT 1
WPS_RADIO_FIFO_SIZE 128
WPS_RADIO_HEADER_SIZE sizeof(wps_mac_frame_header_t)
WPS_PHASES_SYNC_HEADER 3
WPS_AUTO_REPLY_PHASES_HEADER 5
WPS_MAX_PAYLOAD_SIZE WPS_RADIO_FIFO_SIZE - WPS_RADIO_HEADER_SIZE - 1
WPS_NB_RF_CHANNEL 5
WPS_CONNECTION_THROTTLE_GRANULARITY 20
WPS_REQUEST_MEMORY_SIZE 5

Typedefs

typedef struct wps_connection wps_connection_t
typedef struct wps_stats wps_stats_t
typedef enum wps_role wps_role_t

WPS role.

typedef struct wps_radio wps_radio_t

Wireless Protocol Stack radio.

typedef struct node wps_node_t
typedef struct rx_frame wps_rx_frame

Received frame.

typedef struct wps_internal_connection_cfg wps_internal_connection_cfg_t

L2 internal connection config structure.

Note

As of right now, only one protocol (RDO) is activated in the internal connection. The buffer size should be set to at least 2.

typedef enum wps_request wps_request_t

WPS request type enumeration.

typedef struct wps_schedule_ratio_cfg wps_schedule_ratio_cfg_t

WPS schedule request configuration.

typedef struct wps_request_info wps_request_info_t

WPS request structure configuration.

Note

Available choice for configuration structure are

  • wps_schedule_ratio_cfg_t.

typedef void (*wps_callback_t)(wps_connection_t *connection)

Enums

enum wps_role

WPS role.

Values:

enumerator NETWORK_COORDINATOR = 0

Coordinator dictate the time to the whole network

enumerator NETWORK_NODE

Node re-adjust its timer to stay in sync

enum wps_request

WPS request type enumeration.

Values:

enumerator REQUEST_NONE = 0
enumerator REQUEST_MAC_CHANGE_SCHEDULE_RATIO

Request allowing application to change active timeslot ratio

struct wps_stats

Public Members

uint32_t tx_sent
uint32_t tx_byte_sent
uint32_t tx_dropped
uint32_t rx_received
uint32_t rx_byte_received
uint32_t rx_overrun
struct wps_connection
#include <wps_def.h>

WPS Connection.

Public Members

uint16_t source_address

Source address

uint16_t destination_address

Destination address

bool fixed_payload_size_enable

Fixed payload size enable flag (necessary for Frames lager than RX FIFO)

uint8_t fixed_payload_size

Frame size (only used if fixed frame size mode is enabled)

wps_error_t wps_error
bool phases_exchange

Send phases data in the header to other device

bool ack_enable

Ack received frame or expect ack when sending frame

bool auto_sync_enable

Auto sync mode enable flag

bool internal_connection

Enable/disable L2 internal connection.

uint8_t header_size

Header size in bytes

Internal connection protocol

Internal connection Random Datarate Offset (RDO) instances.

saw_arq_t stop_and_wait_arq

Stop and Wait (SaW) and Automatic Repeat Query (ARQ)

link_cca_t cca

Clear Channel Assessment

lqi_t lqi

Link quality indicator

lqi_t used_frame_lqi

WPS frames Link quality indicator (Excludes unused or sync timeslots)

lqi_t channel_lqi[WPS_NB_RF_CHANNEL]

Channel frames Link quality indicator

wps_stats_t wps_stats

Wireless protocol stack statistics

uint8_t pattern_count

Current pattern array index count

uint8_t active_ratio

Active timeslot ratio, in percent

uint8_t pattern_total_count

Total pattern array count based on reduced ratio fraction

bool *pattern

Pattern array pointer, need to be allocated by application and initialized to 1

gain_loop_t gain_loop[WPS_NB_RF_CHANNEL][WPS_RADIO_COUNT]

Gain loop

circular_queue_t xlayer_queue

Cross layer queue

frame_cfg_t frame_cfg

Connection frame config

sleep_lvl_t sleep_lvl

Connection sleep level

rf_channel_t channel[WPS_NB_RF_CHANNEL][WPS_RADIO_COUNT]

RF Channel information

packet_cfg_t packet_cfg

Packet configuration

void (*send_ack_callback_t)(wps_connection_t *connection)

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

void (*send_nack_callback_t)(wps_connection_t *connection)

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

void (*receive_callback_t)(wps_connection_t *connection)

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

void (*error_callback_t)(wps_connection_t *connection)

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 wps_radio
#include <wps_def.h>

Wireless Protocol Stack radio.

Public Members

radio_t radio

Radio instance

radio_hal_t radio_hal

Radio HAL instance

calib_vars_t *spectral_calib_vars

Calibration variables

nvm_t *nvm

NVM variables

uint8_t *spi_rx_buffer

SPI TX transfer buffer

uint8_t *spi_tx_buffer

SPI TX transfer buffer

uint8_t spi_buffer_size

Radio TX/RX SPI buffer size, for SPI transfer queue

struct node

Public Members

wps_radio_t *radio
wps_role_t role
uint16_t local_address
syncword_cfg_t syncword_cfg
uint32_t preamble_len
sleep_lvl_t sleep_lvl
uint16_t crc_polynomial
struct rx_frame
#include <wps_def.h>

Received frame.

Public Members

uint8_t *payload

Pointer to payload

uint8_t size

Size of payload

struct wps_internal_connection_cfg
#include <wps_def.h>

L2 internal connection config structure.

Note

As of right now, only one protocol (RDO) is activated in the internal connection. The buffer size should be set to at least 2.

Public Members

uint8_t *buffer

Internal connection RX/TX buffer

uint8_t buffer_size

Internal connection buffer size

link_rdo_t *rdo_inst

Internal connection link rdo instance

bool *rdo_enable

Enable random datarate offset

uint16_t *rdo_rollover_value

Random datarate offset rollover value, u16

uint8_t rdo_num
struct wps_schedule_ratio_cfg
#include <wps_def.h>

WPS schedule request configuration.

Public Members

uint8_t active_ratio

Target connection current active ratio

uint8_t pattern_total_count

Target connection total pattern array size

uint8_t pattern_current_count

Target connection pattern index count

wps_connection_t *target_conn

Connection to change active timeslot ratio

circular_queue_t *pattern_queue

Pattern buffer queue

struct wps_request_info
#include <wps_def.h>

WPS request structure configuration.

Note

Available choice for configuration structure are

  • wps_schedule_ratio_cfg_t.

Public Members

void *config

WPS request structure configuration.

wps_request_t type

WPS request type enumeration