1 /*
2  * Copyright (c) 2015, Freescale Semiconductor, Inc.
3  * Copyright 2016-2017 NXP
4  * All rights reserved.
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  */
8 
9 #ifndef SENSOR_FUSION_STATUS_H_
10 #define SENSOR_FUSION_STATUS_H_
11 
12 
13 /*! \file status.h
14     \brief Application-specific status subsystem
15 
16     Applications may change how they choose to display status information.
17     The default implementation here uses LEDs on NXP Freedom boards.
18     You may swap out implementations as long as the "Required" methods and states
19     are retained.
20 */
21 /// StatusSubsystem() provides an object-like interface for communicating status to the user
22 typedef struct StatusSubsystem {
23 	// Required internal states
24 	fusion_status_t		previous;       ///< Previous status state - fusion_status_t is defined in sensor_fusion.h
25 	fusion_status_t		status;         ///< Current status
26 	fusion_status_t		next;           ///< Pending status change
27 	// Required methods
28 	ssSetStatus_t           *set;	        ///< change status immediately - no delay
29 	ssSetStatus_t           *queue;         ///< queue status change for next regular interval
30 	ssUpdateStatus_t        *update;        ///< make pending status active/visible
31 	ssUpdateStatus_t        *test ;         ///< unit test which simply increments to next state
32 	// application-specific internal variables
33 	uint8_t toggle;                         ///< This implementation can change LED color and have either solid/toggle
34 } StatusSubsystem ;
35 
36 /// initializeStatusSubsystem() should be called once at startup to initialize the
37 /// data structure and to put hardware into the proper state for communicating status.
38 void initializeStatusSubsystem (
39   StatusSubsystem *pStatus                      ///< pointer to the status subsystem
40 );
41 
42 #endif /* SENSOR_FUSION_STATUS_H_ */
43