no-OS
Loading...
Searching...
No Matches
state_machine.c File Reference

STOUT state machine implementation file. More...

#include "no_os_print_log.h"
#include "state_machine.h"
#include "no_os_delay.h"
#include "no_os_alloc.h"
#include "common_data.h"
#include "no_os_error.h"
#include "self_test.h"
#include "interface.h"
#include "ade9113.h"
#include "supply.h"
#include "pilot.h"
#include "relay.h"
#include "gpio.h"
#include "rcd.h"
Include dependency graph for state_machine.c:

Functions

int state_machine ()
 State machine main execution.
 
enum state_machine_events_e state_machine_det_event_cp (struct stout *stout, enum state_machine_events_e event_in)
 Determine next state based on CP measurements and previous events.
 
enum state_machine_events_e state_machine_det_event_temperature (struct stout *stout, enum state_machine_events_e event_in)
 Determine next state based on temperature measurements and previous events.
 
enum state_machine_events_e state_machine_det_event_supply (struct stout *stout, enum state_machine_events_e event_in)
 Determine next state based on supply measurements and previous events.
 
uint16_t get_action (void)
 Get take action flag.
 
void set_action_flag (void)
 Set take action flag.
 
void reset_action_flag (void)
 Reset take action flag.
 
void inc_action_flag (void)
 Increment take action flag.
 
void start_charging (void)
 Signal that EV starts charging.
 
void stop_charging (void)
 Signal that EV stops charging.
 
uint8_t car_is_charging (void)
 Get charging state.
 

Variables

uint16_t zcross_cnt
 
uint8_t is_charging
 

Detailed Description

STOUT state machine implementation file.

Author
GMois (georg.nosp@m.e.mo.nosp@m.is@an.nosp@m.alog.nosp@m..com), REtz (radu..nosp@m.etz@.nosp@m.analo.nosp@m.g.co.nosp@m.m)

Copyright (c) 2023 Analog Devices, Inc.

SPDX-License-Identifier: BSD-3-Clause

Function Documentation

◆ car_is_charging()

uint8_t car_is_charging ( void )

Get charging state.

Returns
charging state - 1 charging, 0 - not charging

◆ get_action()

uint16_t get_action ( void )

Get take action flag.

Returns
flag value

◆ inc_action_flag()

void inc_action_flag ( void )

Increment take action flag.

Increment take action flag

◆ reset_action_flag()

void reset_action_flag ( void )

Reset take action flag.

Reset take action flag

◆ set_action_flag()

void set_action_flag ( void )

Set take action flag.

Set take action flag

◆ start_charging()

void start_charging ( void )

Signal that EV starts charging.

Signal that EV starts charging

◆ state_machine()

int state_machine ( )

State machine main execution.

Returns
Result of the example execution. If working correctly, will execute continuously the while(1) loop.

◆ state_machine_det_event_cp()

enum state_machine_events_e state_machine_det_event_cp ( struct stout * stout,
enum state_machine_events_e event_in )

Determine next state based on CP measurements and previous events.

Parameters
stout- state machine descriptor
event_in- previous event
Returns
event that took place

◆ state_machine_det_event_supply()

enum state_machine_events_e state_machine_det_event_supply ( struct stout * stout,
enum state_machine_events_e event_in )

Determine next state based on supply measurements and previous events.

Parameters
stout- state machine descriptor
event_in- previous event
Returns
event that took place

◆ state_machine_det_event_temperature()

enum state_machine_events_e state_machine_det_event_temperature ( struct stout * stout,
enum state_machine_events_e event_in )

Determine next state based on temperature measurements and previous events.

Parameters
stout- state machine descriptor
event_in- previous event
Returns
event that took place

◆ stop_charging()

void stop_charging ( void )

Signal that EV stops charging.

Signal that EV stops charging

Variable Documentation

◆ is_charging

uint8_t is_charging

◆ zcross_cnt

uint16_t zcross_cnt