|
CHAdeMO
|
CHAdeMO power supply equipment (SE) Logic (Hardware-Agnostic) More...
#include <stdbool.h>#include <stdint.h>Go to the source code of this file.
Data Structures | |
| struct | chademo_xx_can_frame |
| struct | chademo_se_vsensors |
| struct | chademo_se_psuctl_inputs |
| struct | chademo_se_psuctl_outputs |
| struct | chademo_se_vgpio |
| struct | chademo_se |
Macros | |
| #define | chademo_se_can_frame chademo_xx_can_frame |
| #define | chademo_ev_can_frame chademo_xx_can_frame |
Enumerations | |
| enum | chademo_se_psuctl_event { CHADEMO_SE_PSUCTL_EVENT_NONE , CHADEMO_SE_PSUCTL_EVENT_PLEASE_PROVIDE_INPUTS , CHADEMO_SE_PSUCTL_EVENT_PSU_CAN_BE_POWERED , CHADEMO_SE_PSUCTL_EVENT_PSU_CAN_PROVIDE_POWER , CHADEMO_SE_PSUCTL_EVENT_PSU_MUST_SHUTDOWN } |
| enum | chademo_se_psuctl_flags_fault { CHADEMO_SE_PSUCTL_FLAGS_FAULT_OVERVOLTAGE = 1u , CHADEMO_SE_PSUCTL_FLAGS_FAULT_OVERCURRENT = 2u , CHADEMO_SE_PSUCTL_FLAGS_FAULT_OVERTEMP = 4u , CHADEMO_SE_PSUCTL_FLAGS_FAULT_MALFUNCTION = 8u , CHADEMO_SE_PSUCTL_FLAGS_FAULT_OTHER = 16u , CHADEMO_SE_PSUCTL_FLAGS_FAULT_API = 16u } |
| enum | chademo_se_event { CHADEMO_SE_EVENT_NONE , CHADEMO_SE_EVENT_CHARGE_START_BUTTON_PRESSED , CHADEMO_SE_EVENT_GOT_EV_INITIAL_PARAMS , CHADEMO_SE_EVENT_INFO_BEFORE_CHARGING_IS_PROCESSED , CHADEMO_SE_EVENT_VEHICLE_CHARGE_PERMISSION , CHADEMO_SE_EVENT_EV_CONTACTORS_ARE_OPEN } |
Functions | |
| void | chademo_se_init (struct chademo_se *self) |
| void | chademo_se_get_vgpio_inputs (struct chademo_se *self, struct chademo_se_vgpio *dst) |
| void | chademo_se_set_vgpio_inputs (struct chademo_se *self, struct chademo_se_vgpio *src) |
| void | chademo_se_get_vgpio_outputs (struct chademo_se *self, struct chademo_se_vgpio *dst) |
| void | chademo_se_set_vsensors_inputs (struct chademo_se *self, struct chademo_se_vsensors *src) |
| void | chademo_se_get_psuctl_outputs (struct chademo_se *self, struct chademo_se_psuctl_outputs *dst) |
| bool | chademo_se_push_vcan_frame (struct chademo_se *self, struct chademo_se_can_frame *f) |
| bool | chademo_se_pop_vcan_frame (struct chademo_se *self, struct chademo_se_can_frame *f) |
| enum chademo_se_event | chademo_se_step (struct chademo_se *self, uint32_t delta_time_ms) |
CHAdeMO power supply equipment (SE) Logic (Hardware-Agnostic)
This file contains the software implementation of the CHAdeMO EVSE logic. The design is hardware-agnostic, requiring an external adaptation layer for hardware interaction.
Reference Specification: Implemented based on the technical specifications outlined in IEEE Std 2030.1.1™-2015. The specification is not included in this repository due to legal reasons.
Important IP Notice: This implementation utilizes the CHAdeMO protocol, which is subject to Patents (SEPs) and Trade Secrets held by the CHAdeMO Association.
Conventions: C89, Linux kernel style, MISRA, rule of 10, No hardware specific code, only generic C and some binding layer. Be extra specific about types.
Scientific units where posible at end of the names, for example:
Keep variables without units if they're unknown or not specified or hard to define with short notation.
| #define chademo_se_can_frame chademo_xx_can_frame |
Label for chademo_xx_can_frame
| #define chademo_ev_can_frame chademo_xx_can_frame |
Label for chademo_xx_can_frame
Events emited by PSU controller
| enum chademo_se_event |
Events emited by main instance FSM
| void chademo_se_init | ( | struct chademo_se * | self | ) |
Initializes main instance (must be done before anything else)
| void chademo_se_get_vgpio_inputs | ( | struct chademo_se * | self, |
| struct chademo_se_vgpio * | dst ) |
Reads vgpio inputs and stores result into a destination dst
| void chademo_se_set_vgpio_inputs | ( | struct chademo_se * | self, |
| struct chademo_se_vgpio * | src ) |
Sets vgpio inputs from source src
| void chademo_se_get_vgpio_outputs | ( | struct chademo_se * | self, |
| struct chademo_se_vgpio * | dst ) |
Gets vgpio outputs and stores result into a destination dst
| void chademo_se_set_vsensors_inputs | ( | struct chademo_se * | self, |
| struct chademo_se_vsensors * | src ) |
Sets vsensors inputs from source src
| void chademo_se_get_psuctl_outputs | ( | struct chademo_se * | self, |
| struct chademo_se_psuctl_outputs * | dst ) |
Gets psuctl outputs and stores result into a destination dst
| bool chademo_se_push_vcan_frame | ( | struct chademo_se * | self, |
| struct chademo_se_can_frame * | f ) |
CAN2.0 frames from EV must go here. Returns true if frame has been consumed. Frame may not be consumed if charger is not in LISTEN mode.
| bool chademo_se_pop_vcan_frame | ( | struct chademo_se * | self, |
| struct chademo_se_can_frame * | f ) |
CAN2.0 frames from charger emited here (popped from internal TX buffer). Returns true if frame has been returned. Frame may not be returned if internal buffer is empty.
| enum chademo_se_event chademo_se_step | ( | struct chademo_se * | self, |
| uint32_t | delta_time_ms ) |
Main instance FSM. Must be called inside main loop.