Buoyancy Firmware  1.0
Buoyancy Vehicle Firmware Documentation
FSM program file

Contain FSM module with related structures and functions. More...

Data Structures

struct  FSM_t
 Structure of FSM specific variables. More...
 

Enumerations

enum  systemState_t {
  INIT, IDLE, CONFIGURE, MISSION,
  PICKUP, SLEEP, LOWPOWER, FAILURE
}
 Type definition of system state enumeration. More...
 
enum  systemEvent_t {
  Initialize, Init_Finished, HallEffectInterrupt, BLEInterrupt,
  Failure, MissionStart, MissionFinished, MissionAbort,
  Sleep
}
 Type definition of system events. More...
 

Functions

systemState_t InitStateHandler (void)
 handler to go to initialization state. More...
 
systemState_t IdleStateHandler (void)
 handler to go to idle state. More...
 
systemState_t ConfigureStateHandler (void)
 handler to go to configuration state. More...
 
systemState_t failureHandler (void)
 handler to go to failure state. More...
 
systemState_t MissionStartHandler (void)
 handler to go to mission state. More...
 
systemState_t MissionFinishedHandler (void)
 handler to go to PickUp state. More...
 
systemState_t MissionAbortHandler (void)
 handler to go to failure state upon aborted mission. More...
 
systemState_t SleepHandler (void)
 handler to go to PickUp state. More...
 
systemState_t LowPowerHandler (void)
 handler to go to low power state state. More...
 
void waitForEvent ()
 handler to go to failure state. More...
 
void INITstate (void)
 Initialize Finite state machine after reset. More...
 
void IDLEstate ()
 Idle state, transistion to sleep mode after 2 minutes. More...
 
void CONFIGUREstate ()
 Configure state, BLE advertise to configre vehicle or transfer file. More...
 
void MISSIONstate ()
 Mission state, BLE is disconnected, and mission is started. More...
 
void PICKUPstate ()
 PickUp state, BLE is advertising, and vehicle can be re-configured and/or file transfered. More...
 
void SLEEPstate (void)
 Sleep state, SD card is unmounted and system is powered down to off-mode. More...
 
void LOWPOWERstate (void)
 Low Power state, vehicle is floated to surface, SD card is unmounted. More...
 
void FAILUREstate (void)
 Failure state, vehicle is floated to surface, SD card is unmounted. More...
 
void FSM (void)
 Main FSM loop. More...
 

Variables

FSM_t fsm
 Create Finite State Machine struct instance. More...
 

Detailed Description

Contain FSM module with related structures and functions.

Enumeration Type Documentation

◆ systemEvent_t

Type definition of system events.

Attention
Depricated, not in use
Enumerator
Initialize 
Init_Finished 
HallEffectInterrupt 
BLEInterrupt 
Failure 
MissionStart 
MissionFinished 
MissionAbort 
Sleep 

◆ systemState_t

Type definition of system state enumeration.

Enumerator
INIT 
IDLE 
CONFIGURE 
MISSION 
PICKUP 
SLEEP 
LOWPOWER 
FAILURE 

Function Documentation

◆ CONFIGUREstate()

void CONFIGUREstate ( )

Configure state, BLE advertise to configre vehicle or transfer file.

< blue LED.

◆ ConfigureStateHandler()

systemState_t ConfigureStateHandler ( void  )

handler to go to configuration state.

< Go to CONFIGURE state.

◆ failureHandler()

systemState_t failureHandler ( void  )

handler to go to failure state.

Note
Currently not in use as FAILUREstate() is called directly.

< Go to FAILURE state.

◆ FAILUREstate()

void FAILUREstate ( void  )

Failure state, vehicle is floated to surface, SD card is unmounted.

Note
System requre reset to recover from failure state

◆ FSM()

void FSM ( )

Main FSM loop.

◆ IDLEstate()

void IDLEstate ( )

Idle state, transistion to sleep mode after 2 minutes.

BLE is not advertising, but system is in run-mode and ready to transition to next state upon hall effect button interrupt. otherwise it goes back to off-mode after 2 min.

< White color at minimum brightness.

◆ IdleStateHandler()

systemState_t IdleStateHandler ( void  )

handler to go to idle state.

< Go to IDLE state.

◆ INITstate()

void INITstate ( void  )

Initialize Finite state machine after reset.

< Initialize battery to just above LOWPOWER limit.

< Initialize battery to just above LOWPOWER limit.

◆ InitStateHandler()

systemState_t InitStateHandler ( void  )

handler to go to initialization state.

< Go to INIT state.

◆ LowPowerHandler()

systemState_t LowPowerHandler ( void  )

handler to go to low power state state.

Note
Currently not in use as LOWPOWERstate() is called directly.

Go to LOWPOWER state.

◆ LOWPOWERstate()

void LOWPOWERstate ( void  )

Low Power state, vehicle is floated to surface, SD card is unmounted.

Note
stay in Low Power state until system is reset to avoid mission to continue and pull the vehicle under water again.

< Red LED.

< Float to surface.

< unmount SD card.

◆ MissionAbortHandler()

systemState_t MissionAbortHandler ( void  )

handler to go to failure state upon aborted mission.

Note
Currently not in use as FAILUREstate() is called directly in case of errors, and mission is aborted only on errors or intended (and accidental) hall effect interrupt.

< Go to FAILURE state.

◆ MissionFinishedHandler()

systemState_t MissionFinishedHandler ( void  )

handler to go to PickUp state.

< Go to PICKUP state.

◆ MissionStartHandler()

systemState_t MissionStartHandler ( void  )

handler to go to mission state.

< Go to MISSION state.

◆ MISSIONstate()

void MISSIONstate ( )

Mission state, BLE is disconnected, and mission is started.

< green LED.

◆ PICKUPstate()

void PICKUPstate ( )

PickUp state, BLE is advertising, and vehicle can be re-configured and/or file transfered.

< Yellow LED.

◆ SleepHandler()

systemState_t SleepHandler ( void  )

handler to go to PickUp state.

< Go to SLEEP state.

◆ SLEEPstate()

void SLEEPstate ( void  )

Sleep state, SD card is unmounted and system is powered down to off-mode.

◆ waitForEvent()

void waitForEvent ( )

handler to go to failure state.

Note
Deprecated, no longer in use

Variable Documentation

◆ fsm

FSM_t fsm

Create Finite State Machine struct instance.