Nordic Semiconductor nRF5 AirFuel SDK
version 2.2.0
|
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include "ptu_latching_fault.h"
#include "ptu_config.h"
#include "ptu_sensors.h"
#include "ptu_power_ctl.h"
#include "ptu_test_mux.h"
Go to the source code of this file.
Functions | |
API implementation | |
uint32_t | ptu_latching_fault_entered (ptu_sm_state_t previous) |
Handle the entry of latching fault state. More... | |
uint32_t | ptu_latching_fault_init (ptu_sm_handler_t sm_handler) |
Initialize latching fault module. More... | |
Static functions and variables | |
enum | lf_timer_state_t { LF_TIMER_STATE_BEACON_OFF, LF_TIMER_STATE_BEACON_SHORT } |
Enumerator describing what m_short_beacon_timer_id is being used for. More... | |
static ptu_sm_handler_t | m_ptu_sm_execute |
static lf_status_t | m_lf_status |
APP_TIMER_DEF (m_clear_latching_fault_timer_id) | |
APP_TIMER_DEF (m_short_beacon_timer_id) | |
APP_TIMER_DEF (m_reset_nof_consecutive_latching_fault_count_timer_id) | |
static void | m_reset_nof_consecutive_latching_fault_count_timer_handler (void *p_context) |
Clear number of consecutive latching faults timer handler. More... | |
static void | m_latch_fault_attempt_to_clear_timer_handler (void *p_context) |
Latch fault entry handler. More... | |
static bool | m_no_devices_on_pad (const ptu_sensor_data_t *p_sensor_data) |
Check if no load variation has been seen for PTU_PRU_NO_LOAD_VAR_NO_DEVICES_MS milliseconds, implying that no devices are on the pad. More... | |
static void | m_latch_fault_short_beacon_timer_handler (void *p_context) |
Latch fault short beacon timer handler. More... | |
enum lf_timer_state_t |
Enumerator describing what m_short_beacon_timer_id is being used for.
Enumerator | |
---|---|
LF_TIMER_STATE_BEACON_OFF |
Multiple latching faults beacon sequence |
LF_TIMER_STATE_BEACON_SHORT |
Multiple latching faults beacon sequence |
Definition at line 34 of file ptu_latching_fault.c.
APP_TIMER_DEF | ( | m_clear_latching_fault_timer_id | ) |
Clear latching fault timer
APP_TIMER_DEF | ( | m_short_beacon_timer_id | ) |
Beacon timer
APP_TIMER_DEF | ( | m_reset_nof_consecutive_latching_fault_count_timer_id | ) |
Reset number of consecutive latching faults timer
|
static |
Clear number of consecutive latching faults timer handler.
[in] | p_context | Generic context to sent to handler. |
Definition at line 63 of file ptu_latching_fault.c.
|
static |
Latch fault entry handler.
[in] | p_context | Generic context to sent to handler. |
Definition at line 74 of file ptu_latching_fault.c.
|
static |
Check if no load variation has been seen for PTU_PRU_NO_LOAD_VAR_NO_DEVICES_MS milliseconds, implying that no devices are on the pad.
p_sensor_data | Pointer to PTU sensor data. |
Definition at line 86 of file ptu_latching_fault.c.
|
static |
Latch fault short beacon timer handler.
[in] | p_context | Generic context to sent to handler. |
Definition at line 109 of file ptu_latching_fault.c.
uint32_t ptu_latching_fault_entered | ( | ptu_sm_state_t | previous | ) |
Handle the entry of latching fault state.
previous | The previous state of the PTU state machine. |
Definition at line 179 of file ptu_latching_fault.c.
uint32_t ptu_latching_fault_init | ( | ptu_sm_handler_t | sm_handler | ) |
Initialize latching fault module.
sm_handler | The state machine handler of the PTU. |
Definition at line 212 of file ptu_latching_fault.c.
|
static |
Profiles state machine handler
Definition at line 52 of file ptu_latching_fault.c.
|
static |
Latching fault status
Definition at line 56 of file ptu_latching_fault.c.