Nordic Semiconductor nRF5 AirFuel SDK  version 2.2.0
ptu_sm.h
Go to the documentation of this file.
1 /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
2  *
3  * The information contained herein is property of Nordic Semiconductor ASA.
4  * Terms and conditions of usage are described in detail in NORDIC
5  * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
6  *
7  * Licensees are granted free, non-transferable use of the information. NO
8  * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
9  * the file.
10  *
11  */
12 
21 #ifndef PTU_SM_PTU_H__
22 #define PTU_SM_PTU_H__
23 
24 #include <stdint.h>
25 
27 typedef enum
28 {
29  PTU_SM_LFR_PRU_SYSTEM_ERROR,
30  PTU_SM_LFR_ROGUE_OBJCT_MODE_TRANS_FAILED,
31  PTU_SM_LFR_ROGUE_OBJCT_DETECTED,
33 
35 typedef enum
36 {
37  PTU_SM_STATE_CONFIGURATION = 0,
38  PTU_SM_STATE_POWER_SAVE,
39  PTU_SM_STATE_LOW_POWER,
40  PTU_SM_STATE_POWER_TRANSFER,
41  PTU_SM_STATE_LATCH_FAULT,
42  PTU_SM_STATE_LOCAL_FAULT,
43  PTU_SM_STATE_COUNT
45 
46 
48 typedef enum
49 {
50  /* State Machine specific */
51  PTU_SM_SIGNAL_NULL,
52  PTU_SM_SIGNAL_CONFIGURATION_COMPLETE,
53  PTU_SM_SIGNAL_LOCAL_FAULT,
54  PTU_SM_SIGNAL_LOCAL_FAULT_CLEARED,
55  PTU_SM_SIGNAL_REGISTRATION_TIMEOUT,
56  PTU_SM_SIGNAL_CHARGE_START,
57  PTU_SM_SIGNAL_PRU_ADV_RCVD,
58  PTU_SM_SIGNAL_ALL_DEVICES_DISCONNECTED,
59  PTU_SM_SIGNAL_PRU_ALL_CHARGE_COMPLETE,
60  PTU_SM_SIGNAL_ROGUE_OBJECT_DETECTED,
61  PTU_SM_SIGNAL_SYSTEM_ERROR,
62  PTU_SM_SIGNAL_LATCHING_FAULT_CLEARED_BY_USER
64 
65 
67 typedef struct
68 {
73 
74 /******************************************************************************/
77 /******************************************************************************/
78 
87 
90 #endif // PTU_SM_PTU_H__
91 
92 //lint -restore
State machine state variables.
Definition: ptu_sm.h:67
ptu_sm_signal_type_t
PTU signal type.
Definition: ptu_sm.h:48
ptu_sm_state_t prev_state
Definition: ptu_sm.h:69
ptu_sm_state_t current_state
Definition: ptu_sm.h:70
sm_latch_fault_reason_t
PTU Latch Fault reason type.
Definition: ptu_sm.h:27
ptu_sm_state_t
PTU states.
Definition: ptu_sm.h:35
ptu_sm_state_t next_state
Definition: ptu_sm.h:71
ptu_sm_state_t ptu_sm_execute(ptu_sm_signal_type_t signal, ptu_sm_state_vars_t *p_state)
State machine input signal handler.
Definition: ptu_sm.c:94