PX4 Firmware
PX4 Autopilot Software http://px4.io
spektrum_rssi.h File Reference

RSSI dBm to percentage conversion for Spektrum telemetry receivers. More...

#include <climits>
Include dependency graph for spektrum_rssi.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MASK(n)   (n >> (sizeof(n) * CHAR_BIT - 1))
 

Functions

constexpr unsigned c_abs (int n)
 
constexpr int8_t spek_dbm_to_percent (int8_t dbm)
 

Variables

constexpr int8_t lu_dbm_percent []
 

Detailed Description

RSSI dBm to percentage conversion for Spektrum telemetry receivers.

Author
Kurt Kiefer kekie.nosp@m.fer@.nosp@m.gmail.nosp@m..com

Definition in file spektrum_rssi.h.

Macro Definition Documentation

◆ MASK

#define MASK (   n)    (n >> (sizeof(n) * CHAR_BIT - 1))

Definition at line 70 of file spektrum_rssi.h.

Referenced by c_abs().

Function Documentation

◆ c_abs()

constexpr unsigned c_abs ( int  n)

Definition at line 73 of file spektrum_rssi.h.

References MASK.

Referenced by spek_dbm_to_percent().

Here is the caller graph for this function:

◆ spek_dbm_to_percent()

constexpr int8_t spek_dbm_to_percent ( int8_t  dbm)

Definition at line 79 of file spektrum_rssi.h.

References c_abs(), and lu_dbm_percent.

Referenced by dsm_decode().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ lu_dbm_percent

constexpr int8_t lu_dbm_percent[]
Initial value:
= {
100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 99, 98, 98, 97, 96,
95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 79,
78, 77, 75, 74, 73, 71, 70, 68, 66, 65, 63, 61, 59, 57, 55, 52,
50, 47, 45, 42, 39, 35, 32, 28, 24, 19, 13, 7, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0,
}

Definition at line 58 of file spektrum_rssi.h.

Referenced by spek_dbm_to_percent().