![]() |
ISSDK
1.7
IoT Sensing Software Development Kit
|
Application-specific status subsystem. More...
#include "board.h"
#include "fsl_port.h"
#include "sensor_fusion.h"
#include "drivers.h"
#include "status.h"
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) |
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.
#define B 0x01 |
Definition at line 56 of file status.c.
Referenced by ssSetLeds().
#define G 0x02 |
Definition at line 55 of file status.c.
Referenced by ssSetLeds(), and ssSetStatusNow().
#define N 0x00 |
Definition at line 53 of file status.c.
Referenced by ssSetStatusNow().
#define R 0x04 |
Definition at line 54 of file status.c.
Referenced by ssSetLeds(), and ssSetStatusNow().
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.
pStatus | pointer to the status subsystem |
Definition at line 191 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().
void ssQueueStatus | ( | StatusSubsystem * | pStatus, |
fusion_status_t | status | ||
) |
Definition at line 170 of file status.c.
References StatusSubsystem::next, and status.
Referenced by initializeStatusSubsystem().
void ssSetLeds | ( | int8_t | RGB | ) |
Definition at line 59 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().
void ssSetStatus | ( | StatusSubsystem * | pStatus, |
fusion_status_t | status | ||
) |
Definition at line 183 of file status.c.
References StatusSubsystem::next, ssUpdateStatus(), and status.
Referenced by initializeStatusSubsystem().
void ssSetStatusNow | ( | StatusSubsystem * | pStatus, |
fusion_status_t | status | ||
) |
Definition at line 76 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().
void ssTest | ( | StatusSubsystem * | pStatus | ) |
Definition at line 131 of file status.c.
References HARD_FAULT, INITIALIZING, LOWPOWER, NORMAL, OFF, RECEIVING_WIRED, RECEIVING_WIRELESS, SOFT_FAULT, ssSetStatusNow(), and StatusSubsystem::status.
Referenced by initializeStatusSubsystem().
void ssUpdateStatus | ( | StatusSubsystem * | pStatus | ) |
Definition at line 176 of file status.c.
References StatusSubsystem::next, StatusSubsystem::previous, ssSetStatusNow(), and StatusSubsystem::status.
Referenced by initializeStatusSubsystem(), and ssSetStatus().