ISSDK  1.8
IoT Sensing Software Development Kit
status.h
Go to the documentation of this file.
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
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.
39  StatusSubsystem *pStatus ///< pointer to the status subsystem
40 );
41 
42 #endif /* SENSOR_FUSION_STATUS_H_ */
void() ssUpdateStatus_t(struct StatusSubsystem *pStatus)
ssUpdateStatus_t * test
unit test which simply increments to next state
Definition: status.h:31
ssUpdateStatus_t * update
make pending status active/visible
Definition: status.h:30
uint8_t toggle
This implementation can change LED color and have either solid/toggle.
Definition: status.h:33
fusion_status_t status
Current status.
Definition: status.h:25
ssSetStatus_t * queue
queue status change for next regular interval
Definition: status.h:29
void initializeStatusSubsystem(StatusSubsystem *pStatus)
Definition: status.c:165
fusion_status_t next
Pending status change.
Definition: status.h:26
fusion_status_t previous
Previous status state - fusion_status_t is defined in sensor_fusion.h.
Definition: status.h:24
void() ssSetStatus_t(struct StatusSubsystem *pStatus, fusion_status_t status)
fusion_status_t
Application-specific serial communications system.
struct StatusSubsystem StatusSubsystem
StatusSubsystem() provides an object-like interface for communicating status to the user...
StatusSubsystem() provides an object-like interface for communicating status to the user...
Definition: status.h:22