device/class/rfpacket.h header reference
[Devices support library module]

The source code of this header can be browsed online.

Description  

Members  

Types  

Functions  

Constants  

Macros  

Members detail  

STRUCT_DESCRIPTOR(struct dev_rfpacket_rf_cfg_s )  

Alternate declarations with same identifier: [1], [2].

STRUCT_DESCRIPTOR(struct dev_rfpacket_pk_cfg_s )  

Alternate declarations with same identifier: [1], [2].

#define DEV_RFPACKET_CANCEL(n)  

This macro is declared in device/class/rfpacket.h source file, line 687.

See also dev_rfpacket_request_t.

#define DEV_RFPACKET_REQUEST(n)  

This macro is declared in device/class/rfpacket.h source file, line 642.

See also dev_rfpacket_request_t.

#define DEV_RFPACKET_RX_ALLOC(n)  

This macro is declared in device/class/rfpacket.h source file, line 400.

See also dev_rfpacket_rx_alloc_t.

#define DEV_RFPACKET_STATS(n)  

This macro is declared in device/class/rfpacket.h source file, line 390.

See also dev_rfpacket_stats_t.

#define DRIVER_RFPACKET_METHODS(prefix)  

This macro is declared in device/class/rfpacket.h source file, line 715.

See also struct driver_rfpacket_s.

#define __DEVICE_RFPACKET_H__  

This macro is declared in device/class/rfpacket.h source file, line 33.

typedef error_t (dev_rfpacket_cancel_t)(const struct device_rfpacket_s *accessor, struct dev_rfpacket_rq_s *rq)   

This typedef is declared in device/class/rfpacket.h source file, line 704.

This declaration involves expansion of the DEV_RFPACKET_CANCEL macro.

struct dev_rfpacket_cfg_cache_s  

This struct is declared in device/class/rfpacket.h source file, line 80.

This tracks configuration cache entry status. This is used in struct dev_rfpacket_rf_cfg_s and struct dev_rfpacket_pk_cfg_s.

This allows reuse of a cached configuration when the id is known to the driver and matches the pointer to the config object. When configuration requires computation and caching, the application expects the driver to perform the cache hit test in this way:

struct cache_entry_s *e = &cache_array[cfg->cache.id % CACHE_SIZE];
if (e->cfg == cfg && !cfg->dirty)
{
// use cache entry
}
else
{
// update cache entry
if (e->dirty)
e->dirty = 0;
}

A configuration can not be modified while it is already in use by a request.

FieldDescription
uint8_t id:7;Configuration id provided by the application. It is used by the driver to track configuration changes and optionally store configuration derived values in a cache slot.
uint8_t dirty:1;The application must set the field when the content of the configuration structure is updated. The driver will set this field to 0 only if not already clear. This allows storing configurations as const data.

const char dev_rfpacket_encoding_e[]  

This variable is declared in ENUM_DESCRIPTOR function like macro expansion, line 1 in device/class/rfpacket.h source file, line 252.

Alternate declarations with same identifier: [1], [2].

enum dev_rfpacket_encoding_e  

This enum is declared in device/class/rfpacket.h source file, line 255.

Alternate declarations with same identifier: [1], [2].

IdentifierDescription
DEV_RFPACKET_CLEAR
DEV_RFPACKET_MANCHESTER
DEV_RFPACKET_LFSR8
DEV_RFPACKET_DSSS

enum dev_rfpacket_fairtx_e  

This enum is declared in device/class/rfpacket.h source file, line 153.

This enum specifies the policy of fair TX

IdentifierDescription
DEV_RFPACKET_NO_FAIRTX
DEV_RFPACKET_LBT

const char dev_rfpacket_format_e[]  

This variable is declared in ENUM_DESCRIPTOR function like macro expansion, line 1 in device/class/rfpacket.h source file, line 228.

Alternate declarations with same identifier: [1], [2].

enum dev_rfpacket_format_e  

This enum is declared in device/class/rfpacket.h source file, line 231.

Alternate declarations with same identifier: [1], [2].

IdentifierDescription
DEV_RFPACKET_FMT_SLPC
DEV_RFPACKET_FMT_IO
DEV_RFPACKET_FMT_LORA
DEV_RFPACKET_FMT_RAW

const char dev_rfpacket_lora_encoding_e[]  

This variable is declared in ENUM_DESCRIPTOR function like macro expansion, line 1 in device/class/rfpacket.h source file, line 342.

Alternate declarations with same identifier: [1], [2].

enum dev_rfpacket_lora_encoding_e  

This enum is declared in device/class/rfpacket.h source file, line 345.

Alternate declarations with same identifier: [1], [2].

IdentifierDescription
DEV_RFPACKET_LORA_CR_45
DEV_RFPACKET_LORA_CR_46
DEV_RFPACKET_LORA_CR_47
DEV_RFPACKET_LORA_CR_48

const char dev_rfpacket_modulation_e[]  

This variable is declared in ENUM_DESCRIPTOR function like macro expansion, line 1 in device/class/rfpacket.h source file, line 94.

Alternate declarations with same identifier: [1], [2].

enum dev_rfpacket_modulation_e  

This enum is declared in device/class/rfpacket.h source file, line 98.

This enum specifies the RF modulation type

Alternate declarations with same identifier: [1], [2].

IdentifierDescription
DEV_RFPACKET_FSKFrequency shift keying modulation
See also struct dev_rfpacket_rf_cfg_fsk_s.
DEV_RFPACKET_GFSKGaussian frequency shift keying modulation
See also struct dev_rfpacket_rf_cfg_fsk_s.
DEV_RFPACKET_ASKAmplitude shift keying modulation
See also struct dev_rfpacket_rf_cfg_ask_s.
DEV_RFPACKET_LORALora modulation
See also struct dev_rfpacket_rf_cfg_lora_s.

struct dev_rfpacket_pk_cfg_basic_s  

This struct is declared in device/class/rfpacket.h source file, line 281.

FieldDescription
struct dev_rfpacket_pk_cfg_s base;
uint32_t crc;Specifies the CRC polynomial when relevant. for instance IBM CRC16 has value 0x18005. Zero means that the CRC field is not checked. CRC is always transmitted Most significant bits first
uint32_t crc_seed;Specifies the CRC initialization value
uint32_t sw_value;Sync word value. Most significant bits are transmitted first
uint32_t pb_pattern;preamble pattern. Most significant bits are transmitted first
uint32_t sw_len:5;Size of sync word in bits minus one
uint32_t pb_pattern_len:5;preamble pattern len in bits minus one
uint16_t tx_pb_len;Size of transmitted preamble in bits. When the requested value is not supported, it must be rounded to a higher value.
uint8_t rx_pb_len;Size of expected RX preamble in bits. When the requested value is not supported, it must be rounded to a lower value.

struct dev_rfpacket_pk_cfg_s * dev_rfpacket_pk_cfg_basic_s_base(struct dev_rfpacket_pk_cfg_basic_s *x)  

struct dev_rfpacket_pk_cfg_basic_s * dev_rfpacket_pk_cfg_basic_s_cast(struct dev_rfpacket_pk_cfg_s *x)  

struct dev_rfpacket_pk_cfg_lora_s  

This struct is declared in device/class/rfpacket.h source file, line 353.

FieldDescription
struct dev_rfpacket_pk_cfg_s base;
bool_t header:1;Set when using explicit header
bool_t crc:1;Set when payload CRC is enabled.
enum dev_rfpacket_lora_encoding_e crate:3;Coding rate of the payload. Values must be specified as 4/crate.
uint8_t sw_value;Sync word value. Most significant bit are transmitted first
uint16_t pb_len;Size of preamble in symbols. When the requested value is not supported, it must be rounded to a higher value.

struct dev_rfpacket_pk_cfg_s * dev_rfpacket_pk_cfg_lora_s_base(struct dev_rfpacket_pk_cfg_lora_s *x)  

struct dev_rfpacket_pk_cfg_lora_s * dev_rfpacket_pk_cfg_lora_s_cast(struct dev_rfpacket_pk_cfg_s *x)  

struct dev_rfpacket_pk_cfg_raw_s  

This struct is declared in device/class/rfpacket.h source file, line 328.

FieldDescription
struct dev_rfpacket_pk_cfg_s base;
uint16_t mps;
struct dev_freq_s unit;
uint32_t timeout;
enum dev_rfpacket_sym_width_e sym_width;This specifies the type of integer used for symbols

struct dev_rfpacket_pk_cfg_s * dev_rfpacket_pk_cfg_raw_s_base(struct dev_rfpacket_pk_cfg_raw_s *x)  

struct dev_rfpacket_pk_cfg_raw_s * dev_rfpacket_pk_cfg_raw_s_cast(struct dev_rfpacket_pk_cfg_s *x)  

struct dev_rfpacket_pk_cfg_s  

This struct is declared in device/class/rfpacket.h source file, line 266.

This stores packet format configuration. This may be inherited depending on the value of the format field.

FieldDescription
enum dev_rfpacket_format_e format:8;Packet format
enum dev_rfpacket_encoding_e encoding:4;Data encoding and whitening
struct dev_rfpacket_cfg_cache_s cache;Configuration cache entry. the use flag must be reset when the configuration changes.

error_t dev_rfpacket_prepare_rx(struct dev_rfpacket_wait_ctx_s *ctx, uint8_t *buffer, size_t size)  

This function provides a buffer in advance to store the next incoming packet. The dev_rfpacket_wait_rx function must then be used with the same buffer. This helps being ready to catch a reply right after sending a packet.

Once this function has been called, it is not allowed to call the dev_rfpacket_stop_rx function without first calling the dev_rfpacket_wait_rx function.

This is available when CONFIG_DEVICE_RFPACKET and CONFIG_MUTEK_CONTEXT_SCHED are both defined.

typedef int16_t dev_rfpacket_pwr_t  

This typedef is declared in device/class/rfpacket.h source file, line 50.

RF power in 0.125 dBm steps

typedef void (dev_rfpacket_request_t)(const struct device_rfpacket_s *accessor, ...)   

This typedef is declared in device/class/rfpacket.h source file, line 684.

This function enqueues multiple struct dev_rfpacket_rq_s requests atomically. The argument list of the function must be NULL terminated.

Depending on the type of request and dev_rfpacket_rq_s::deadline, the request might not run immediately.

The configuration of the transceiver is updated according the request when the request actually runs. The configuration will not be updated if the dev_rfpacket_rq_s::rf_cfg and dev_rfpacket_rq_s::pk_cfg field are identical to the previously running request and the struct dev_rfpacket_cfg_cache_s fields allow caching.

The kroutine_exec function will be called on kr when the request ends. The err field indicates the error status of the request.

Some error codes are specific to a type of request. Other possible errors are:

  • -ECANCELED is used for contiguous requests in the queue with the same group as a canceled or failed request.

  • -ENOTSUP is used if the configuration is not supported by the driver.

  • -EIO is used when an hardware error or fifo underflow/overflow occurs.

The kroutine of the request may be executed from within this function. Please read Nested device request completion.

The driver of the transceiver may also implement the timer device class when an internal timer is available.

This declaration involves expansion of the DEV_RFPACKET_REQUEST macro.

struct dev_rfpacket_rf_cfg_ask_s  

This struct is declared in device/class/rfpacket.h source file, line 201.

This struct extends the struct dev_rfpacket_rf_cfg_s object when the DEV_RFPACKET_ASK modulation is in use.

FieldDescription
struct dev_rfpacket_rf_cfg_s base;
struct dev_rfpacket_rf_cfg_fairtx_s fairtx;
uint32_t symbols:8;number of symbols, 2 for OOK

struct dev_rfpacket_rf_cfg_s * dev_rfpacket_rf_cfg_ask_s_base(struct dev_rfpacket_rf_cfg_ask_s *x)  

struct dev_rfpacket_rf_cfg_ask_s * dev_rfpacket_rf_cfg_ask_s_cast(struct dev_rfpacket_rf_cfg_s *x)  

struct dev_rfpacket_rf_cfg_fairtx_s  

This struct is declared in device/class/rfpacket.h source file, line 161.

This struct store the configuration associated to the policy of fair TX. It may be used in some modulation configuration structures.

FieldDescription
union <anonymous> {
struct <anonymous> {
dev_timer_delay_t duration;Listening time in timer unit. Defined as the minimum time that the device must listen prior to determine whether the intended channel is available for use.*
dev_rfpacket_pwr_t rssi;RX RSSI threshold. During a TX listen before talk, signal below this level will allow start of transmission.
} lbt;
struct <anonymous> {
} csma;
};
enum dev_rfpacket_fairtx_e mode:8;

struct dev_rfpacket_rf_cfg_fsk_s  

This struct is declared in device/class/rfpacket.h source file, line 185.

This struct extends the struct dev_rfpacket_rf_cfg_s object when the DEV_RFPACKET_FSK or DEV_RFPACKET_GFSK modulations are in use.

FieldDescription
struct dev_rfpacket_rf_cfg_s base;
struct dev_rfpacket_rf_cfg_fairtx_s fairtx;
uint32_t deviation:24;frequency deviation in Hz
uint32_t symbols:8;number of symbols

struct dev_rfpacket_rf_cfg_s * dev_rfpacket_rf_cfg_fsk_s_base(struct dev_rfpacket_rf_cfg_fsk_s *x)  

struct dev_rfpacket_rf_cfg_fsk_s * dev_rfpacket_rf_cfg_fsk_s_cast(struct dev_rfpacket_rf_cfg_s *x)  

struct dev_rfpacket_rf_cfg_lora_s  

This struct is declared in device/class/rfpacket.h source file, line 214.

This struct extends the dev_rfpacket_cfg_s object when the DEV_RFPACKET_LORA modulation is in use.

FieldDescription
struct dev_rfpacket_rf_cfg_s base;
uint8_t spreading:4;spreading factor (in log2 basis).
bool_t iq_inverted:1;inverted I/Q signals

struct dev_rfpacket_rf_cfg_s * dev_rfpacket_rf_cfg_lora_s_base(struct dev_rfpacket_rf_cfg_lora_s *x)  

struct dev_rfpacket_rf_cfg_lora_s * dev_rfpacket_rf_cfg_lora_s_cast(struct dev_rfpacket_rf_cfg_s *x)  

struct dev_rfpacket_rf_cfg_s  

This struct is declared in device/class/rfpacket.h source file, line 116.

This stores RF and modulation configuration. This may be inherited depending on the value of the mod field.

FieldDescription
enum dev_rfpacket_modulation_e mod:8;Modulation type
struct dev_rfpacket_cfg_cache_s cache;Configuration cache entry. the use flag must be reset when the configuration changes.
dev_rfpacket_pwr_t jam_rssi;During a RX, a continuous signal above this level is considered jamming and will be reported as an error.
uint32_t drate:24;Datarate in bps
uint32_t frequency;RF frequency in Hz
uint32_t chan_spacing;RF frequency in Hz
uint32_t rx_bw;Receiver bandwidth in Hz. Computed automatically when 0.
uint32_t freq_err;Maximum expected frequency error of the remote transmitter. Expressed as abs(actual tx freq - expected freq).
The frequency error contribution on the receiver side due to the local oscilator (abs(actual rx freq - expected freq)) should be added by the driver and not included here.

void dev_rfpacket_rq_done(struct dev_rfpacket_rq_s *rq)  

This function is declared in device/class/rfpacket.h source file, line 640.

This function invokes or schedules execution of the rfpacket request callback associated to the request. For use in device drivers.

struct dev_rfpacket_rq_s * dev_rfpacket_rq_from_kr(struct kroutine_s *kr)  

This function is declared in device/class/rfpacket.h source file, line 640.

This function retrieves a pointer to the request when in the request completion callback routine.

struct dev_rfpacket_rq_s * dev_rfpacket_rq_head(dev_request_queue_root_t *q)  

This function is declared in device/class/rfpacket.h source file, line 640.

This function returns the oldest rfpacket request in the given queue. A NULL pointer is returned if the queue is empty. For use in device drivers.

void dev_rfpacket_rq_init(struct dev_rfpacket_rq_s *rq, kroutine_exec_t *exec)  

This function is declared in device/class/rfpacket.h source file, line 640.

This function initializes the given rfpacket request callback. This must be used before submitting the request to a driver.

This is available when CONFIG_MUTEK_KROUTINE_SCHED is defined.

void dev_rfpacket_rq_init_immediate(struct dev_rfpacket_rq_s *rq, kroutine_exec_t *exec)  

This function is declared in device/class/rfpacket.h source file, line 640.

This function initializes the given rfpacket request callback. This must be used before submitting the request to a driver.

void dev_rfpacket_rq_init_queue(struct dev_rfpacket_rq_s *rq, kroutine_exec_t *exec, struct kroutine_queue_s *queue)  

This function is declared in device/class/rfpacket.h source file, line 640.

This function initializes the given rfpacket request callback. This must be used before submitting the request to a driver.

This is available when CONFIG_MUTEK_KROUTINE_QUEUE is defined.

void dev_rfpacket_rq_init_seq(struct dev_rfpacket_rq_s *rq, kroutine_exec_t *exec, struct kroutine_sequence_s *seq)  

This function is declared in device/class/rfpacket.h source file, line 640.

This function initializes the given rfpacket request callback. This must be used before submitting the request to a driver.

This is available when CONFIG_MUTEK_KROUTINE_SCHED is defined.

struct dev_rfpacket_rq_s * dev_rfpacket_rq_pop(dev_request_queue_root_t *q)  

This function is declared in device/class/rfpacket.h source file, line 640.

This function removes and return the oldest rfpacket request in the queue. A NULL pointer is returned if the queue is empty. For use in device drivers.

void dev_rfpacket_rq_pushback(dev_request_queue_root_t *q, struct dev_rfpacket_rq_s *rq)  

This function is declared in device/class/rfpacket.h source file, line 640.

This function insert a new rfpacket request at the end of the given queue. For use in device drivers.

void dev_rfpacket_rq_remove(dev_request_queue_root_t *q, struct dev_rfpacket_rq_s *rq)  

This function is declared in device/class/rfpacket.h source file, line 640.

This function removes the specified rfpacket request from the queue. For use in device drivers.

enum dev_rfpacket_rq_rtype_e  

This enum is declared in device/class/rfpacket.h source file, line 471.

IdentifierDescription
DEV_RFPACKET_RQ_TXSchedule a packet transmit. This is pushed on the requests queue and will be processed in order. It will not run until the dev_rfpacket_rq_s::deadline has been reached.
This request can not be used with a deadline when a DEV_RFPACKET_RQ_RX_CONT request is running.
DEV_RFPACKET_RQ_TX_FAIRSchedule a packet transmit, monitoring the channel before transmit. This is pushed on the requests queue and will be processed in order. It will not run until the dev_rfpacket_rq_s::deadline has been reached. The request will terminate with the -ETIMEDOUT error if the channel does not become clear during the whole lifetime period. The mechanism used to determine if the transmission can start is defined in the configuration.
When the hardware support this, some packet may be received during the monitoring period if a DEV_RFPACKET_RQ_RX_CONT request is active and share the same configuration and channel as this TX request. In this case the packet should not be transmitted, terminating the request with the -EAGAIN error.
This request can not be used with a deadline when a DEV_RFPACKET_RQ_RX_CONT request is running.
DEV_RFPACKET_RQ_RXSchedule an RX period. This is pushed on the requests queue and will be processed in order. It will not run until the dev_rfpacket_rq_s::deadline has been reached. The request terminates successfully when the RX lifetime is reached.
Multiple packets can be received during the period, calling the dev_rfpacket_rq_s::rx_alloc function and the dev_rfpacket_rx_s::kr kroutine for each incoming packet. The request terminates successfully when its lifetime expires, receiving packets do not terminate the request.
The request will terminate with the -EBUSY error if the channel is jammed according to the value of the dev_rfpacket_rf_cfg_s::rssi_th field.
This request can not be used with a deadline when a DEV_RFPACKET_RQ_RX_CONT request is running.
DEV_RFPACKET_RQ_RX_CONTPut the transceiver in continuous RX state. This request is not pushed in the queue of scheduled requests. A single such request can be submitted at the same time. The request will terminate immediately with the -EBUSY error if an other continuous request is currently active.
Some scheduled requests with a null deadline can be used at the same time as a continuous RX. In this case, the continuous RX request stays in the background and will resume operation as soon as the scheduled requests end.
This request terminates with the -EAGAIN error if the channel is jammed according to the value of the dev_rfpacket_rf_cfg_s::rssi_th field. The dev_rfpacket_cancel_t function can be used to end this request.
DEV_RFPACKET_RQ_RX_TIMEOUTPut the transceiver in continuous RX state for a limited period of time. This is similar to a DEV_RFPACKET_RQ_RX_CONT request but the dev_rfpacket_rq_s::deadline and dev_rfpacket_rq_s::lifetime fields are not ignored. Instead they are used to specify the when the RX must end.
If the lifetime field is not zero, the deadline field will be computed automatically. In the other case, an absolute deadline timer value must be provided in this field.

struct dev_rfpacket_rq_s  

This struct is declared in device/class/rfpacket.h source file, line 557.

FieldDescription
union <anonymous> {
struct dev_request_s base;
typeof(struct dev_request_s::error) error;
typeof(struct dev_request_s::pvdata) pvdata;
};
const struct dev_rfpacket_rf_cfg_s * rf_cfg;This specifies the RF configuration to use during the request.
const struct dev_rfpacket_pk_cfg_s * pk_cfg;This specifies the packet format configuration to use during the request.
union <anonymous> {
dev_timer_value_t deadline;This specifies when a RX or TX operation must start. The request will be started immediately if the current timer value is greater than this value. This field is not used by DEV_RFPACKET_RQ_RX_CONT requests.
dev_timer_value_t tx_timestamp;This field is updated by the driver to the actual start of transmit time for DEV_RFPACKET_RQ_TX and DEV_RFPACKET_RQ_TX_FAIR requests.
};
dev_timer_delay_t lifetime;For DEV_RFPACKET_RQ_RX requests, this field defines the duration of the RX period. Multiple packets may be received during the request. For DEV_RFPACKET_RQ_TX_LBT requests, this field specifies how long to wait for the channel to become clear before aborting the transmit. In both cases the actual execution time of a request may be longer than the lifetime because an ongoing RX may start at the end of the period and will not be aborted. This field is not used by DEV_RFPACKET_RQ_RX_CONT and DEV_RFPACKET_RQ_TX requests.
int16_t channel;This specifies an frequency offset for this request according to the dev_rfpacket_rf_cfg_s::frequency and dev_rfpacket_rf_cfg_s::chan_spacing values.
bool_t err_group:1;When a request in the queue terminates with an error or get canceled, all subsequent requests with the same error groups are terminated along with the -ECANCELED error code.
enum dev_rfpacket_timestamp_anchor_e anchor:1;
enum dev_rfpacket_rq_rtype_e type:3;This specifies the type of the request.
union <anonymous> {
struct <anonymous> {
dev_rfpacket_rx_alloc_t * rx_alloc;This is used to allocate a RX buffers to store the payload of the incoming packet when the request is running. The received packet is discarded if the function return NULL.
uint32_t rx_chan_mask;This is a channel mask used in DEV_RFPACKET_RQ_RX_CONT operations to perform scanning on multiple channels. Least significant bit of this mask corresponds to channel and must always be set. When a packet is received, dev_rfpacket_rx_s::channel corresponds to the receiving channel.
};
struct <anonymous> {
const void * tx_buf;This contains the payload to transmit.
uint16_t tx_size;This specifies the size of the payload to transmit.
dev_rfpacket_pwr_t tx_pwr;This specifies the TX power.
};
};

struct dev_request_s * dev_rfpacket_rq_s_base(struct dev_rfpacket_rq_s *x)  

struct dev_rfpacket_rq_s * dev_rfpacket_rq_s_cast(struct dev_request_s *x)  

typedef struct dev_rfpacket_rx_s *(dev_rfpacket_rx_alloc_t)(struct dev_rfpacket_rq_s *rq, size_t size)   

This typedef is declared in device/class/rfpacket.h source file, line 419.

This is used in RX requests to allocate a struct dev_rfpacket_rx_s object along with a buffer for incoming packets.

The size parameter specifies the size of the allocated payload buffer pointed to by the dev_rfpacket_rx_s::buf field. It is also the initial value of the dev_rfpacket_rx_s::size field which might be lowered later. Partially received frames, frames with a bad CRC or other receiving errors must be reported with a null size.

The incoming packet is discarded when this function returns NULL. In the other case, the driver always execute the dev_rfpacket_rx_s::kr kroutine function at some point, even if the associated RX request has ended.

This declaration involves expansion of the DEV_RFPACKET_RX_ALLOC macro.

struct dev_rfpacket_rx_s  

This struct is declared in device/class/rfpacket.h source file, line 424.

RX buffer object, allocated by the dev_rfpacket_rx_alloc_t function.

FieldDescription
dev_timer_value_t timestamp;Time stamp of the start of received packet.
struct kroutine_s kr;This is executed by the driver when the RX operation is complete.
void * buf;Received payload buffer, allocated by the dev_rfpacket_rx_alloc_t function.
uint16_t size;Actual size of the received payload. This is initially set by the dev_rfpacket_rx_alloc_t function and updated by the driver if the packet is actually smaller.
dev_rfpacket_pwr_t rssi;RX signal level of radio environment.
dev_rfpacket_pwr_t carrier;RX signal level of the received packet.
dev_rfpacket_pwr_t snr;RX signal power over noise power ratio.
uint32_t frequency;Measured RX frequency
uint8_t channel;Channel of the received packet.
error_t error;When the opration completes and the packet is malformed, contains bit errors or has a bad CRC, this field is set to -EBADDATA by the driver. The -EIO error indicates that the driver was not able to receive and store the packet properly.
If no data is available due to the error, the size field is set to 0.

struct dev_rfpacket_rx_s * dev_rfpacket_rx_s_from_kr(void *x)  

error_t dev_rfpacket_start_rx(struct dev_rfpacket_wait_ctx_s *ctx, uint_fast16_t channel, dev_timer_delay_t timeout)  

This function can be used to put the transceiver in RX state. This function does not block. The dev_rfpacket_wait_rx must then be called in order to receive some packets.

If the timeout parameter is not 0, the RX will stop after the specified delay has elapsed. It can also be stopped by calling the dev_rfpacket_stop_rx function. The RX may as well end at any time in case of error (bad config, jamming, ...).

The function returns -EBUSY if the transceiver is already in RX state. The function returns 0 in order to acknowledge the request to start the RX.

The configuration objects passed to the dev_rfpacket_wait_init function are used. If the configuration objects need to be updated, the RX must be stopped and started again.

The ctx object storage must remain valid until the RX is stopped.

This is available when CONFIG_DEVICE_RFPACKET and CONFIG_MUTEK_CONTEXT_SCHED are both defined.

struct dev_rfpacket_stats_s  

This struct is declared in device/class/rfpacket.h source file, line 379.

See also dev_rfpacket_stats_t.

FieldDescription
uint32_t rx_count;Number of rx packet
uint32_t tx_count;Number of tx packet
uint32_t rx_err_count;Number of rx packet error: CRC, Overflow
uint32_t tx_err_count;Number of tx packet error: Underflow, timeout

typedef error_t (dev_rfpacket_stats_t)(const struct device_rfpacket_s *accessor, struct dev_rfpacket_stats_s *stats)   

This typedef is declared in device/class/rfpacket.h source file, line 395.

This typedef return some stat counters.

This declaration involves expansion of the DEV_RFPACKET_STATS macro.

error_t dev_rfpacket_stop_rx(struct dev_rfpacket_wait_ctx_s *ctx)  

This function can be used to remove the transceiver from RX state.

The current scheduler context is stopped until the transceiver RX has stopped.

This is available when CONFIG_DEVICE_RFPACKET and CONFIG_MUTEK_CONTEXT_SCHED are both defined.

See also dev_rfpacket_start_rx.

enum dev_rfpacket_sym_width_e  

This enum is declared in device/class/rfpacket.h source file, line 318.

This enum specifies the integer type used to store symbols for a raw request.

IdentifierDescription
DEV_RFPACKET_RAW_8BITSSymbols are stored as uint8_t
DEV_RFPACKET_RAW_16BITSSymbols are stored as uint16_t
DEV_RFPACKET_RAW_32BITSSymbols are stored as uint32_t

enum dev_rfpacket_timestamp_anchor_e  

This enum is declared in device/class/rfpacket.h source file, line 549.

IdentifierDescription
DEV_RFPACKET_TIMESTAMP_START
DEV_RFPACKET_TIMESTAMP_END

void dev_rfpacket_wait_cleanup(struct dev_rfpacket_wait_ctx_s *ctx)  

This function release resource used by the blocking rfpacket context.

This is available when CONFIG_DEVICE_RFPACKET and CONFIG_MUTEK_CONTEXT_SCHED are both defined.

struct dev_rfpacket_wait_ctx_s  

This struct is declared in device/class/rfpacket.h source file, line 742.

This struct is a context used by blocking helper functions for the rfpacket class of devices.

See also dev_rfpacket_wait_init.

error_t dev_rfpacket_wait_init(struct dev_rfpacket_wait_ctx_s *ctx, const struct device_rfpacket_s *rf_dev, const struct dev_rfpacket_rf_cfg_s *rf_cfg, const struct dev_rfpacket_pk_cfg_s *pk_cfg)  

This function initializes a context for use by rfpacket blocking helper functions.

This is available when CONFIG_DEVICE_RFPACKET and CONFIG_MUTEK_CONTEXT_SCHED are both defined.

See also dev_rfpacket_wait_init, dev_rfpacket_start_rx, dev_rfpacket_stop_rx, dev_rfpacket_wait_rx, dev_rfpacket_wait_tx and dev_rfpacket_wait_cleanup.

error_t dev_rfpacket_wait_rq(const struct device_rfpacket_s *accessor, struct dev_rfpacket_rq_s *rq)  

This function is declared in device/class/rfpacket.h source file, line 737.

This is available when CONFIG_DEVICE_RFPACKET and CONFIG_MUTEK_CONTEXT_SCHED are both defined.

error_t dev_rfpacket_wait_rx(struct dev_rfpacket_wait_ctx_s *ctx, uint8_t *buffer, size_t *size)  

This function waits for an incoming packet and stores the received packet in the provided buffer. The dev_rfpacket_start_rx function must have been called previously.

The current scheduler context is stopped waiting for an incoming packet.

This function may return the following errors:

  • -EBUSY if the transceiver is not currently in RX state.

  • -ETIMEDOUT if the timeout delay has elapsed while waiting for a packet.

  • Any other error code reported by the transceiver error while waiting for a packet. This does not mean end of RX.

  • 0 if a packet has been received and stored in the provided buffer.

The size parameter must initially indicate the size of the buffer and is updated with the size of the received packet. Packets too large to fit the provided buffer are ignored.

Because receiving a packet does not remove the transceiver from RX state, this function can be called multiple times.

This is available when CONFIG_DEVICE_RFPACKET and CONFIG_MUTEK_CONTEXT_SCHED are both defined.

error_t dev_rfpacket_wait_tx(struct dev_rfpacket_wait_ctx_s *ctx, const uint8_t *data, size_t size, uint_fast16_t channel, dev_rfpacket_pwr_t pwr, dev_timer_delay_t timeout)  

This function transmit a packet. If the transceiver is currently in RX state, the RX will resume after transmitting the packet. When the timeout parameter is not 0, a fair TX is used.

The current scheduler context is stopped until the transceiver has transmitted the packet.

This is available when CONFIG_DEVICE_RFPACKET and CONFIG_MUTEK_CONTEXT_SCHED are both defined.

struct device_rfpacket_s  

This struct is declared in DRIVER_CLASS_TYPES function like macro expansion, line 20 in device/class/rfpacket.h source file, line 713.

This struct is the device accessor object type for the rfpacket device class. This accessor must be initialized by calling the device_get_accessor function.

See also DRIVER_CLASS_RFPACKET, struct device_accessor_s and Device accessor.

FieldDescription
union <anonymous> {
struct device_accessor_s base;
struct <anonymous> {
struct device_s * dev;
struct driver_rfpacket_s * api;
uint_fast8_t number;
};
};

struct device_accessor_s * device_rfpacket_s_base(struct device_rfpacket_s *x)  

This function is declared in DRIVER_CLASS_TYPES function like macro expansion, line 41 in device/class/rfpacket.h source file, line 713.

This function casts a rfpacket device accessor to a generic device accessor

struct device_rfpacket_s * device_rfpacket_s_cast(struct device_accessor_s *x)  

This function is declared in DRIVER_CLASS_TYPES function like macro expansion, line 34 in device/class/rfpacket.h source file, line 713.

This function casts a generic device accessor to a rfpacket device accessor

struct driver_rfpacket_s  

This struct is declared in DRIVER_CLASS_TYPES function like macro expansion, line 5 in device/class/rfpacket.h source file, line 713.

This struct is the driver API descriptor for the rfpacket device class.

See also DRIVER_CLASS_RFPACKET and struct driver_class_s.

Valid XHTML 1.0 StrictGenerated by diaxen on Wed Oct 17 21:18:38 2018 using MkDoc