IoT Supervisor 0.0
|
Modules | |
Heart Beat Blinker | |
Voltage In and Reset State Machine | |
vin and reset the state machine | |
Modbus WDT State Machine | |
The modbus watchdog timer state machine. | |
Configuration State Machine | |
The configuration state machine starts and maintains the system configuration. | |
Data Structures | |
union | sv_dev_sta_t |
Enumerations | |
enum | LastRst_t { eLR_Init = 0 , eLR_VSM , eLR_WDT } |
Functions | |
void | SiLabs_Startup (void) |
SiLabs_Startup() Routine. | |
int | main (void) |
Variables | |
volatile sv_dev_sta_t | sv_dev_sta = {0} |
volatile t1Count_t | t1Count = 0 |
volatile uint8_t | t0Count = 0 |
uint8_t | T0C_TOP = 0 |
enum LastRst_t |
Last Reset Source _ Type
Last Reset Source _ Type
Enumerator | |
---|---|
eLR_Init | Initial State. No recorded reset. |
eLR_VSM | A low voltage condition caused the last reset. |
eLR_WDT | The modbus watchdog timer caused the last reset. |
Definition at line 87 of file IoT_Supervisor.h.
int main | ( | void | ) |
This is the main function where the configuration and modbus are run.
It is assumed that the main function is run after the cinit and startup implementations, so all global and static variables are initialized to their correct default values.
The main function takes into consideration the reset condition to determine whether the vin state machine should start into the "ok" state or the "Init" state.
The main function implements a counter-based system using the t1Count global which is incremented once a millisecond. An internal counter is incremented each time the modbus loop is executed. This makes it acceptable for the modbus process to overrun its timeslot through multiple cycles without affecting the number of times it is executed for timing purposes. Note that there is an anti-windup feature activated when run_petitmodbus is not set where the internal counter is immediately set to the value of t1Count rather than incremented upon each execution.
Definition at line 831 of file IoT Supervisor_main.c.
void SiLabs_Startup | ( | void | ) |
SiLabs_Startup() Routine.
This function is called immediately after reset, before the initialization code is run in SILABS_STARTUP.A51 (which runs before main() ). This is a useful place to disable the watchdog timer, which is enabled by default and may trigger before main() in some instances.
Definition at line 38 of file IoT Supervisor_main.c.
volatile sv_dev_sta_t sv_dev_sta = {0} |
Definition at line 47 of file IoT Supervisor_main.c.
uint8_t T0C_TOP = 0 |
Software counter to implement modbus inter-byte timeout
Definition at line 55 of file IoT Supervisor_main.c.
volatile uint8_t t0Count = 0 |
Definition at line 53 of file IoT Supervisor_main.c.
volatile t1Count_t t1Count = 0 |
Definition at line 50 of file IoT Supervisor_main.c.