FsmVCR.c File Reference

FSM for VCR. More...

`#include "ES2_V4_app.h"`
Include dependency graph for FsmVCR.c:

## Functions

_Bool | bFsmVCRInitialize (void)
| init VCR FSM More...
_Bool | bFsmVCRDispatchEvent (int32_t s32Event)
| dispatch event VCR FSM More...
_Bool | bFsmVCRIsStateChanged ()
| check if state changed More...
int32_t | s32FsmVCRGetState ()
| get FSM state More...
const char * | pcFsmVCRGetStateName ()
| get FSM state name More...
void | vEntry_sStandby (void)
| entry for sStandby More...
void | vEntry_sRecord (void)
| entry for sRecord More...
void | vExit_sRecord (void)
| exit for sRecord More...
void | vEntry_sPlay (void)
| entry for sPlay More...
void | vExit_sPlay (void)
| exit for sPlay More...
void | vEntry_sRewind (void)
| entry for sRewind More...
void | vExit_sRewind (void)
| entry for sRewind More...
void | vEntry_sFastForward (void)
| entry for sFastForward More...
void | vExit_sFastForward (void)
| exit for sFastForward More...
_Bool | bGuard_tapein_andnot_atend (void)
| guard for Tape in and not at end More...
_Bool | bGuard_tapein_andnot_atbegin (void)
| guard for Tape in and not at begin More...

## Variables

sStateMachine_t | sFsmVCR
static const char * | pcFsmVCRstates_names [] = {"Standby","Record","Play","Rewind","Fastforward", "LastStateVCR"}
sStateTransitions_t | asEventsFsmVCRStandby []
sStateTransitions_t | asEventsFsmVCRRecord []
sStateTransitions_t | asEventsFsmVCRSPlay []
sStateTransitions_t | asEventsFsmVCRRewind []
sStateTransitions_t | asEventsFsmVCRFastForward []
sStateTable_t | asFsmVCRStates []

## Detailed Description

FSM for VCR.

Header FSM for VCR.

Author
  Hendrik Schutter

Version
  V1.0

Date
  24.10.2020

This file contains the FSM for VCR.

Author
  Hendrik Schutter

Version
  V1.0

Date
  24.10.2020

This file contains the Header FSM for VCR.

## Function Documentation

## bFsmVCRDispatchEvent()

bFsmVCRDispatchEvent | ( | int32_t | s32Event | ) |

dispatch event VCR FSM

Sends an event to the state machine.

Parameters

  FSM | event

Returns
  _Bool

Author
  hendrik schutter

Date
  24.10.2020

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

## bFsmVCRInitialize()

bFsmVCRInitialize | ( | void |  | ) |

init VCR FSM

Wrapper function to statemachine_init().

Parameters

  void |

Returns
  _Bool

Author
  hendrik schutter

Date
  24.10.2020

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

## bFsmVCRIsStateChanged()

bFsmVCRIsStateChanged | ( | void |  | ) |

check if state changed

Indicates if a state changed happend.

Parameters

  voids |

Returns
  _Bool

Author
  hendrik schutter

Date
  24.10.2020

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

## bGuard_tapein_andnot_atbegin()

bGuard_tapein_andnot_atbegin | ( | void |  | ) |

guard for Tape in and not at begin

Parameters

  void |

Returns
  _Bool

Author
  hendrik schutter

Date
  24.10.2020

Here is the call graph for this function:

## bGuard_tapein_andnot_atend()

bGuard_tapein_andnot_atend | ( | void |  | ) |

guard for Tape in and not at end

Parameters

  void |

Returns
  _Bool

Author
  hendrik schutter

Date
  24.10.2020

Here is the call graph for this function:

## pcFsmVCRGetStateName()

pcFsmVCRGetStateName | ( | void |  | ) |

get FSM state name

Get the name of the current state.

Parameters

  void |

Returns
  const char* State Name

Author
  hendrik schutter

Date
  24.10.2020

Here is the call graph for this function:

## s32FsmVCRGetState()

s32FsmVCRGetState | ( | void |  | ) |

get FSM state

Returns the current state of the fsm.

Parameters

  voids |

Returns
  int32_t FSM state

Author
  hendrik schutter

Date
  24.10.2020

Here is the call graph for this function:

## vEntry_sFastForward()

vEntry_sFastForward | ( | void |  | ) |

entry for sFastForward

Parameters

  void |

Returns
  void

Author
  hendrik schutter

Date
  24.10.2020

## vEntry_sPlay()

vEntry_sPlay | ( | void |  | ) |

entry for sPlay

Parameters

  void |

Returns
  void

Author
  hendrik schutter

Date
  24.10.2020

## vEntry_sRecord()

vEntry_sRecord | ( | void |  | ) |

entry for sRecord

Parameters

  void |

Returns
  void

Author
  hendrik schutter

Date
  24.10.2020

## vEntry_sRewind()

vEntry_sRewind | ( | void |  | ) |

entry for sRewind

Parameters

  void |

Returns
  void

Author
  hendrik schutter

Date
  24.10.2020

## vEntry_sStandby()

vEntry_sStandby | ( | void |  | ) |

entry for sStandby

Parameters

  void |

Returns
  void

Author
  hendrik schutter

Date
  24.10.2020

## vExit_sFastForward()

vExit_sFastForward | ( | void |  | ) |

exit for sFastForward

Parameters

  void |

Returns
  void

Author
  hendrik schutter

Date
  24.10.2020

## vExit_sPlay()

vExit_sPlay | ( | void |  | ) |

exit for sPlay

Parameters

  void |

Returns
  void

Author
  hendrik schutter

Date
  24.10.2020

## vExit_sRecord()

vExit_sRecord | ( | void |  | ) |

exit for sRecord

Parameters

  void |

Returns
  void

Author
  hendrik schutter

Date
  24.10.2020

## vExit_sRewind()

vExit_sRewind | ( | void |  | ) |

entry for sRewind

Parameters

  void |

Returns
  void

Author
  hendrik schutter

Date
  24.10.2020

## Variable Documentation

## asEventsFsmVCRFastForward

sStateTransitions_t asEventsFsmVCRFastForward[]

Initial value:
= {
{ evPlaybutton, 0, 0, sPlay },
{ evStopbutton, 0, 0, sStandby },
{ evFastforwardbutton, 0, 0, FAULT_STATE },
{ evRecordbutton, 0, 0, FAULT_STATE },
{ evRewindbutton, 0, 0, sRewind },
{ evBegintape, 0, 0, FAULT_STATE },
{ evEndtape, 0, 0, sStandby },
{ evTapeout, 0, 0, sStandby }
}

## asEventsFsmVCRRecord

sStateTransitions_t asEventsFsmVCRRecord[]

Initial value:
= {
{ evPlaybutton, 0, 0, FAULT_STATE },
{ evStopbutton, 0, 0, sStandby },
{ evFastforwardbutton, 0, 0, FAULT_STATE },
{ evRecordbutton, 0, 0, FAULT_STATE },
{ evRewindbutton, 0, 0, FAULT_STATE },
{ evBegintape, 0, 0, FAULT_STATE },
{ evEndtape, 0, 0, sStandby },
{ evTapeout, 0, 0, sStandby }
}

## asEventsFsmVCRRewind

sStateTransitions_t asEventsFsmVCRRewind[]

Initial value:
= {
{ evPlaybutton, 0, 0, sPlay },
{ evStopbutton, 0, 0, sStandby },
{ evFastforwardbutton, 0, 0, sFastForward },
{ evRecordbutton, 0, 0, FAULT_STATE },
{ evRewindbutton, 0, 0, FAULT_STATE },
{ evBegintape, 0, 0, sStandby },
{ evEndtape, 0, 0, FAULT_STATE },
{ evTapeout, 0, 0, sStandby }
}

## asEventsFsmVCRSPlay

sStateTransitions_t asEventsFsmVCRSPlay[]

Initial value:
= {
{ evPlaybutton, 0, 0, FAULT_STATE },
{ evStopbutton, 0, 0, sStandby },
{ evFastforwardbutton, 0, 0, sFastForward },
{ evRecordbutton, 0, 0, FAULT_STATE },
{ evRewindbutton, 0, 0, sRewind },
{ evBegintape, 0, 0, FAULT_STATE },
{ evEndtape, 0, 0, sStandby },
{ evTapeout, 0, 0, sStandby }
}

## asEventsFsmVCRStandby

sStateTransitions_t asEventsFsmVCRStandby[]

Initial value:
= {
{ evPlaybutton, bGuard_tapein_andnot_atend, 0, sPlay },
{ evStopbutton, 0, 0, FAULT_STATE },
{ evFastforwardbutton, bGuard_tapein_andnot_atend, 0, sFastForward },
{ evRecordbutton, bGuard_tapein_andnot_atend, 0, sRecord },
{ evRewindbutton, bGuard_tapein_andnot_atbegin, 0, sRewind },
{ evBegintape, 0, 0, FAULT_STATE },
{ evEndtape, 0, 0, FAULT_STATE },
{ evTapeout, 0, 0, FAULT_STATE }
}

## asFsmVCRStates

sStateTable_t asFsmVCRStates[]

Initial value:
= {
{ sStandby, vEntry_sStandby, 0, 0, asEventsFsmVCRStandby, 0 },
{ sRecord, vEntry_sRecord, 0, vExit_sRecord, asEventsFsmVCRRecord, 0 },
{ sPlay, vEntry_sPlay, 0, vExit_sPlay, asEventsFsmVCRSPlay, 0 },
{ sRewind, vEntry_sRewind, 0, vExit_sRewind, asEventsFsmVCRRewind, 0 },
{ sFastForward, vEntry_sFastForward, 0, vExit_sFastForward, asEventsFsmVCRFastForward, 0 }
}

## pcFsmVCRstates_names

const char* pcFsmVCRstates_names[] = {"Standby","Record","Play","Rewind","Fastforward", "LastStateVCR"}

static

## sFsmVCR

sStateMachine_t sFsmVCR

vEntry_sRecord
void vEntry_sRecord(void)
entry for sRecord
Definition: FsmVCR.c:175
evPlaybutton
@ evPlaybutton
Definition: FsmVCR.h:23
evBegintape
@ evBegintape
Definition: FsmVCR.h:28
asEventsFsmVCRRecord
sStateTransitions_t asEventsFsmVCRRecord[]
Definition: FsmVCR.c:27
asEventsFsmVCRFastForward
sStateTransitions_t asEventsFsmVCRFastForward[]
Definition: FsmVCR.c:60
asEventsFsmVCRRewind
sStateTransitions_t asEventsFsmVCRRewind[]
Definition: FsmVCR.c:49
asEventsFsmVCRStandby
sStateTransitions_t asEventsFsmVCRStandby[]
Definition: FsmVCR.c:16
sPlay
@ sPlay
Definition: FsmVCR.h:46
bGuard_tapein_andnot_atend
_Bool bGuard_tapein_andnot_atend(void)
guard for Tape in and not at end
Definition: FsmVCR.c:303
evTapeout
@ evTapeout
Definition: FsmVCR.h:30
FAULT_STATE
@ FAULT_STATE
Definition: FsmFramework.h:76
evRecordbutton
@ evRecordbutton
Definition: FsmVCR.h:26
vExit_sRewind
void vExit_sRewind(void)
entry for sRewind
Definition: FsmVCR.c:258
sStandby
@ sStandby
Definition: FsmVCR.h:44
evEndtape
@ evEndtape
Definition: FsmVCR.h:29
vExit_sFastForward
void vExit_sFastForward(void)
exit for sFastForward
Definition: FsmVCR.c:290
vEntry_sPlay
void vEntry_sPlay(void)
entry for sPlay
Definition: FsmVCR.c:207
sFastForward
@ sFastForward
Definition: FsmVCR.h:48
evRewindbutton
@ evRewindbutton
Definition: FsmVCR.h:27
evFastforwardbutton
@ evFastforwardbutton
Definition: FsmVCR.h:25
asEventsFsmVCRSPlay
sStateTransitions_t asEventsFsmVCRSPlay[]
Definition: FsmVCR.c:38
vExit_sPlay
void vExit_sPlay(void)
exit for sPlay
Definition: FsmVCR.c:226
evStopbutton
@ evStopbutton
Definition: FsmVCR.h:24
vEntry_sStandby
void vEntry_sStandby(void)
entry for sStandby
Definition: FsmVCR.c:157
sRecord
@ sRecord
Definition: FsmVCR.h:45
vEntry_sRewind
void vEntry_sRewind(void)
entry for sRewind
Definition: FsmVCR.c:239
vEntry_sFastForward
void vEntry_sFastForward(void)
entry for sFastForward
Definition: FsmVCR.c:271
vExit_sRecord
void vExit_sRecord(void)
exit for sRecord
Definition: FsmVCR.c:194
sRewind
@ sRewind
Definition: FsmVCR.h:47
bGuard_tapein_andnot_atbegin
_Bool bGuard_tapein_andnot_atbegin(void)
guard for Tape in and not at begin
Definition: FsmVCR.c:326