NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
failsafe.h File Reference
#include "system_calls.h"
#include "../config/failsafe.h"
Include dependency graph for failsafe.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  failsafe
 

Macros

#define FAILSAFE_POWER_ON_DELAY_US   (1000 * 1000 * 5)
 
#define MILLIS_PER_TENTH_SECOND   100
 
#define MILLIS_PER_SECOND   1000
 
#define PERIOD_OF_1_SECONDS   1 * MILLIS_PER_SECOND
 
#define PERIOD_OF_3_SECONDS   3 * MILLIS_PER_SECOND
 
#define PERIOD_OF_30_SECONDS   30 * MILLIS_PER_SECOND
 
#define PERIOD_RXDATA_FAILURE   200
 
#define PERIOD_RXDATA_RECOVERY   200
 

Enumerations

enum  failsafePhase_e {
  FAILSAFE_IDLE = 0, FAILSAFE_RX_LOSS_DETECTED, FAILSAFE_LANDING, FAILSAFE_LANDED,
  FAILSAFE_RX_LOSS_MONITORING, FAILSAFE_RX_LOSS_RECOVERED
}
 
enum  failsafeRxLinkState_e { FAILSAFE_RXLINK_DOWN = 0, FAILSAFE_RXLINK_UP }
 

Functions

void failsafe_init (struct failsafe *self, struct ninja *ninja, const struct config *config)
 
void failsafe_start_monitoring (struct failsafe *self)
 
void failsafe_update (struct failsafe *self)
 
void failsafe_reset (struct failsafe *self)
 
failsafePhase_e failsafe_get_state (struct failsafe *self)
 
bool failsafe_is_monitoring (struct failsafe *self)
 
bool failsafe_is_active (struct failsafe *self)
 
bool failsafe_is_receiving_rx (struct failsafe *self)
 
void failsafe_on_rx_suspend (struct failsafe *self, uint32_t suspendPeriod)
 
void failsafe_on_rx_resume (struct failsafe *self)
 
void failsafe_on_valid_data_received (struct failsafe *self)
 
void failsafe_on_valid_data_failed (struct failsafe *self)
 

Macro Definition Documentation

#define FAILSAFE_POWER_ON_DELAY_US   (1000 * 1000 * 5)
#define MILLIS_PER_SECOND   1000
#define MILLIS_PER_TENTH_SECOND   100
#define PERIOD_OF_1_SECONDS   1 * MILLIS_PER_SECOND
#define PERIOD_OF_30_SECONDS   30 * MILLIS_PER_SECOND
#define PERIOD_OF_3_SECONDS   3 * MILLIS_PER_SECOND
#define PERIOD_RXDATA_FAILURE   200
#define PERIOD_RXDATA_RECOVERY   200

Enumeration Type Documentation

Enumerator
FAILSAFE_IDLE 
FAILSAFE_RX_LOSS_DETECTED 
FAILSAFE_LANDING 
FAILSAFE_LANDED 
FAILSAFE_RX_LOSS_MONITORING 
FAILSAFE_RX_LOSS_RECOVERED 
Enumerator
FAILSAFE_RXLINK_DOWN 
FAILSAFE_RXLINK_UP 

Function Documentation

failsafePhase_e failsafe_get_state ( struct failsafe self)
void failsafe_init ( struct failsafe self,
struct ninja ninja,
const struct config config 
)
bool failsafe_is_active ( struct failsafe self)
bool failsafe_is_monitoring ( struct failsafe self)
bool failsafe_is_receiving_rx ( struct failsafe self)
void failsafe_on_rx_resume ( struct failsafe self)
void failsafe_on_rx_suspend ( struct failsafe self,
uint32_t  suspendPeriod 
)
void failsafe_on_valid_data_failed ( struct failsafe self)
void failsafe_on_valid_data_received ( struct failsafe self)
void failsafe_reset ( struct failsafe self)
void failsafe_start_monitoring ( struct failsafe self)
void failsafe_update ( struct failsafe self)