Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
cc2500_compat.c File Reference
#include "cc2500_compat.h"
#include "state.h"
#include "mcu_periph/adc.h"
#include "mcu_periph/gpio.h"
#include "mcu_periph/sys_time.h"
#include "subsystems/electrical.h"
#include <stdbool.h>
#include <assert.h>
#include <math.h>
+ Include dependency graph for cc2500_compat.c:

Go to the source code of this file.

Macros

#define M_PI_FLOAT   3.14159265358979323846f
 

Functions

bool bf_featureIsEnabled (const uint32_t mask)
 
float pt1FilterGain (float f_cut, float dT)
 
void pt1FilterInit (pt1Filter_t *filter, float k)
 
void pt1FilterUpdateCutoff (pt1Filter_t *filter, float k)
 
float pt1FilterApply (pt1Filter_t *filter, float input)
 
void bf_delayMicroseconds (timeUs_t us)
 
void bf_delay (timeMs_t ms)
 
timeUs_t bf_micros (void)
 
timeMs_t bf_millis (void)
 
uint16_t bf_adcGetChannel (uint8_t channel)
 
bool bf_rxSpiDeviceInit (void)
 
IO_t bf_IOGetByTag (ioTag_t io)
 
void bf_IOInit (IO_t io, uint8_t owner, uint8_t index)
 
void bf_IOConfigGPIO (IO_t io, enum ioconfig_t cfg)
 
bool bf_IORead (IO_t gpio)
 
void bf_IOHi (IO_t io)
 
void bf_IOLo (IO_t io)
 
void bf_IOToggle (IO_t io)
 
int32_t bf_getEstimatedAltitudeCm (void)
 
int16_t bf_getEstimatedVario (void)
 
bool bf_isBatteryVoltageConfigured (void)
 
uint16_t bf_getLegacyBatteryVoltage (void)
 
uint16_t bf_getBatteryVoltage (void)
 
uint8_t bf_getBatteryCellCount (void)
 
bool bf_isAmperageConfigured (void)
 
int32_t bf_getAmperage (void)
 
int32_t bf_getMAhDrawn (void)
 

Variables

struct attitude_t bf_attitude = { { 0, 0, 0 } }
 
struct pidProfile_scurrentPidProfile
 
controlRateConfig_tcurrentControlRateProfile
 

Macro Definition Documentation

◆ M_PI_FLOAT

#define M_PI_FLOAT   3.14159265358979323846f

Definition at line 54 of file cc2500_compat.c.

Function Documentation

◆ bf_adcGetChannel()

uint16_t bf_adcGetChannel ( uint8_t  channel)

Definition at line 95 of file cc2500_compat.c.

References channel, Electrical::current, and electrical.

◆ bf_delay()

void bf_delay ( timeMs_t  ms)

Definition at line 81 of file cc2500_compat.c.

References bf_delayMicroseconds().

+ Here is the call graph for this function:

◆ bf_delayMicroseconds()

void bf_delayMicroseconds ( timeUs_t  us)

Definition at line 77 of file cc2500_compat.c.

References sys_time_usleep().

Referenced by bf_delay().

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

◆ bf_featureIsEnabled()

bool bf_featureIsEnabled ( const uint32_t  mask)

Definition at line 47 of file cc2500_compat.c.

References FEATURE_RX_SPI, and FEATURE_TELEMETRY.

◆ bf_getAmperage()

int32_t bf_getAmperage ( void  )

Definition at line 193 of file cc2500_compat.c.

References Electrical::current, and electrical.

◆ bf_getBatteryCellCount()

uint8_t bf_getBatteryCellCount ( void  )

Definition at line 185 of file cc2500_compat.c.

◆ bf_getBatteryVoltage()

uint16_t bf_getBatteryVoltage ( void  )

Definition at line 181 of file cc2500_compat.c.

References electrical, and Electrical::vsupply.

◆ bf_getEstimatedAltitudeCm()

int32_t bf_getEstimatedAltitudeCm ( void  )

Definition at line 163 of file cc2500_compat.c.

References stateGetPositionEnu_f(), and EnuCoor_f::z.

+ Here is the call graph for this function:

◆ bf_getEstimatedVario()

int16_t bf_getEstimatedVario ( void  )

Definition at line 167 of file cc2500_compat.c.

References stateGetSpeedEnu_f(), and EnuCoor_f::z.

+ Here is the call graph for this function:

◆ bf_getLegacyBatteryVoltage()

uint16_t bf_getLegacyBatteryVoltage ( void  )

Definition at line 177 of file cc2500_compat.c.

References electrical, and Electrical::vsupply.

◆ bf_getMAhDrawn()

int32_t bf_getMAhDrawn ( void  )

Definition at line 197 of file cc2500_compat.c.

References Electrical::charge, and electrical.

◆ bf_IOConfigGPIO()

void bf_IOConfigGPIO ( IO_t  io,
enum ioconfig_t  cfg 
)

Definition at line 119 of file cc2500_compat.c.

References gpio_setup_input(), gpio_setup_input_pullup(), gpio_setup_output(), IOCFG_IN_FLOATING, IOCFG_IPU, IOCFG_OUT_PP, gpio_t::pin, and gpio_t::port.

+ Here is the call graph for this function:

◆ bf_IOGetByTag()

IO_t bf_IOGetByTag ( ioTag_t  io)

Definition at line 109 of file cc2500_compat.c.

◆ bf_IOHi()

void bf_IOHi ( IO_t  io)

Definition at line 142 of file cc2500_compat.c.

References gpio_t::hi, gpio_t::pin, and gpio_t::port.

◆ bf_IOInit()

void bf_IOInit ( IO_t  io,
uint8_t  owner,
uint8_t  index 
)

Definition at line 113 of file cc2500_compat.c.

◆ bf_IOLo()

void bf_IOLo ( IO_t  io)

Definition at line 147 of file cc2500_compat.c.

References gpio_t::lo, gpio_t::pin, and gpio_t::port.

◆ bf_IORead()

bool bf_IORead ( IO_t  gpio)

Definition at line 137 of file cc2500_compat.c.

References gpio_get(), gpio_t::pin, and gpio_t::port.

+ Here is the call graph for this function:

◆ bf_IOToggle()

void bf_IOToggle ( IO_t  io)

Definition at line 152 of file cc2500_compat.c.

References gpio_toggle(), gpio_t::pin, and gpio_t::port.

+ Here is the call graph for this function:

◆ bf_isAmperageConfigured()

bool bf_isAmperageConfigured ( void  )

Definition at line 189 of file cc2500_compat.c.

References TRUE.

◆ bf_isBatteryVoltageConfigured()

bool bf_isBatteryVoltageConfigured ( void  )

Definition at line 173 of file cc2500_compat.c.

References TRUE.

◆ bf_micros()

timeUs_t bf_micros ( void  )

Definition at line 85 of file cc2500_compat.c.

References get_sys_time_usec().

+ Here is the call graph for this function:

◆ bf_millis()

timeMs_t bf_millis ( void  )

Definition at line 89 of file cc2500_compat.c.

References get_sys_time_msec().

+ Here is the call graph for this function:

◆ bf_rxSpiDeviceInit()

bool bf_rxSpiDeviceInit ( void  )

Definition at line 103 of file cc2500_compat.c.

References TRUE.

◆ pt1FilterApply()

float pt1FilterApply ( pt1Filter_t filter,
float  input 
)

Definition at line 70 of file cc2500_compat.c.

References pt1Filter_s::k, and pt1Filter_s::state.

Referenced by setRssi().

+ Here is the caller graph for this function:

◆ pt1FilterGain()

float pt1FilterGain ( float  f_cut,
float  dT 
)

Definition at line 55 of file cc2500_compat.c.

References M_PI_FLOAT.

Referenced by rxInit().

+ Here is the caller graph for this function:

◆ pt1FilterInit()

void pt1FilterInit ( pt1Filter_t filter,
float  k 
)

Definition at line 61 of file cc2500_compat.c.

References pt1Filter_s::k, and pt1Filter_s::state.

Referenced by rxInit().

+ Here is the caller graph for this function:

◆ pt1FilterUpdateCutoff()

void pt1FilterUpdateCutoff ( pt1Filter_t filter,
float  k 
)

Definition at line 66 of file cc2500_compat.c.

References pt1Filter_s::k.

Variable Documentation

◆ bf_attitude

struct attitude_t bf_attitude = { { 0, 0, 0 } }

Definition at line 39 of file cc2500_compat.c.

◆ currentControlRateProfile

controlRateConfig_t* currentControlRateProfile

Definition at line 159 of file cc2500_compat.c.

Referenced by processSmartPortTelemetry().

◆ currentPidProfile

struct pidProfile_s* currentPidProfile

Definition at line 43 of file cc2500_compat.c.

Referenced by processSmartPortTelemetry().