ISSDK  1.8
IoT Sensing Software Development Kit
Macros | Functions
status.c File Reference

Application-specific status subsystem. More...

#include "board.h"
#include "fsl_port.h"
#include "sensor_fusion.h"
#include "drivers.h"
#include "status.h"
Include dependency graph for status.c:

Go to the source code of this file.

Macros

#define N   0x00
 
#define R   0x04
 
#define G   0x02
 
#define B   0x01
 

Functions

void ssSetLeds (int8_t RGB)
 
void ssSetStatusNow (StatusSubsystem *pStatus, fusion_status_t status)
 
void ssTest (StatusSubsystem *pStatus)
 
void ssQueueStatus (StatusSubsystem *pStatus, fusion_status_t status)
 
void ssUpdateStatus (StatusSubsystem *pStatus)
 
void ssSetStatus (StatusSubsystem *pStatus, fusion_status_t status)
 
void initializeStatusSubsystem (StatusSubsystem *pStatus)
 

Detailed Description

Application-specific status subsystem.

Applications may change how they choose to display status information. The default implementation here uses LEDs on NXP Freedom boards. You may swap out implementations as long as the "Required" methods and states are retained.

Definition in file status.c.

Macro Definition Documentation

◆ B

#define B   0x01

Definition at line 30 of file status.c.

Referenced by ssSetLeds().

◆ G

#define G   0x02

Definition at line 29 of file status.c.

Referenced by ssSetLeds(), and ssSetStatusNow().

◆ N

#define N   0x00

Definition at line 27 of file status.c.

Referenced by ssSetStatusNow().

◆ R

#define R   0x04

Definition at line 28 of file status.c.

Referenced by ssSetLeds(), and ssSetStatusNow().

Function Documentation

◆ initializeStatusSubsystem()

void initializeStatusSubsystem ( StatusSubsystem pStatus)

initializeStatusSubsystem() should be called once at startup to initialize the data structure and to put hardware into the proper state for communicating status.

Parameters
pStatuspointer to the status subsystem

Definition at line 165 of file status.c.

References BOARD_LED_GREEN_GPIO_PIN, BOARD_LED_GREEN_GPIO_PORT, BOARD_LED_RED_GPIO_PIN, BOARD_LED_RED_GPIO_PORT, gpioHandleKSDK::clockName, GREEN_LED, LED_GREEN_INIT, LED_RED_INIT, LOGIC_LED_OFF, OFF, StatusSubsystem::previous, StatusSubsystem::queue, RED_LED, StatusSubsystem::set, ssQueueStatus(), ssSetStatus(), ssTest(), ssUpdateStatus(), StatusSubsystem::test, StatusSubsystem::toggle, and StatusSubsystem::update.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ssQueueStatus()

void ssQueueStatus ( StatusSubsystem pStatus,
fusion_status_t  status 
)

Definition at line 144 of file status.c.

References StatusSubsystem::next, and status.

Referenced by initializeStatusSubsystem().

Here is the caller graph for this function:

◆ ssSetLeds()

void ssSetLeds ( int8_t  RGB)

Definition at line 33 of file status.c.

References B, G, LED_BLUE_OFF, LED_BLUE_ON, LED_GREEN_OFF, LED_GREEN_ON, LED_RED_OFF, LED_RED_ON, and R.

Referenced by ssSetStatusNow().

Here is the caller graph for this function:

◆ ssSetStatus()

void ssSetStatus ( StatusSubsystem pStatus,
fusion_status_t  status 
)

Definition at line 157 of file status.c.

References StatusSubsystem::next, ssUpdateStatus(), and status.

Referenced by initializeStatusSubsystem().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ssSetStatusNow()

void ssSetStatusNow ( StatusSubsystem pStatus,
fusion_status_t  status 
)

Definition at line 50 of file status.c.

References G, HARD_FAULT, INITIALIZING, LOWPOWER, N, StatusSubsystem::next, NORMAL, StatusSubsystem::previous, R, SOFT_FAULT, ssSetLeds(), StatusSubsystem::status, status, and StatusSubsystem::toggle.

Referenced by ssTest(), and ssUpdateStatus().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ssTest()

void ssTest ( StatusSubsystem pStatus)

Definition at line 105 of file status.c.

References HARD_FAULT, INITIALIZING, LOWPOWER, NORMAL, OFF, RECEIVING_WIRED, RECEIVING_WIRELESS, SOFT_FAULT, ssSetStatusNow(), and StatusSubsystem::status.

Referenced by initializeStatusSubsystem().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ssUpdateStatus()

void ssUpdateStatus ( StatusSubsystem pStatus)

Definition at line 150 of file status.c.

References StatusSubsystem::next, StatusSubsystem::previous, ssSetStatusNow(), and StatusSubsystem::status.

Referenced by initializeStatusSubsystem(), and ssSetStatus().

Here is the call graph for this function:
Here is the caller graph for this function: