Skip to content

File syn_gbt27930.h

FileList > proto > syn_gbt27930.h

Go to the source code of this file

GB/T 27930 (EV DC Fast Charging Protocol on SAE J1939 CAN Bus). More...

  • #include "../common/syn_defs.h"
  • #include "../drivers/syn_can.h"
  • #include "syn_j1939.h"
  • #include <stdbool.h>
  • #include <stddef.h>
  • #include <stdint.h>

Classes

Type Name
struct SYN_GBT27930_BMS_Config
BMS Static Parameters (BRM / BCP).
struct SYN_GBT27930_Charger_Config
Charger Static Parameters (CML).
struct SYN_GBT27930_Session
GB/T 27930 Session Context.
struct SYN_GBT27930_Telemetry
Real-time Charging Telemetry (BCL / BCS / CCS / BSM).

Public Types

Type Name
enum SYN_GBT27930_Role
GB/T 27930 Node Role.
enum SYN_GBT27930_State
GB/T 27930 State Machine Phases.

Public Functions

Type Name
void syn_gbt27930_init (SYN_GBT27930_Session * session, SYN_GBT27930_Role role)
Initialize GB/T 27930 Charging Session.
SYN_Status syn_gbt27930_process_rx_frame (SYN_GBT27930_Session * session, const SYN_CAN_Frame * frame)
Process incoming CAN frame on GB/T 27930 session.
SYN_Status syn_gbt27930_start_handshake (SYN_GBT27930_Session * session)
Start handshake phase.
bool syn_gbt27930_step (SYN_GBT27930_Session * session, uint32_t dt_ms, SYN_CAN_Frame * tx_frame)
Step session state machine timers and produce periodic CAN frames.
void syn_gbt27930_stop_charging (SYN_GBT27930_Session * session, uint8_t reason)
Stop charging session cleanly.

Detailed Description

Implements GB/T 27930-2015 / GB/T 27930-2024 EV DC Fast Charging Protocol state machine and framing for BMS (Vehicle, 0xF4) and Charger (EVSE, 0x56) nodes.

Public Types Documentation

enum SYN_GBT27930_Role

GB/T 27930 Node Role.

enum SYN_GBT27930_Role {
    SYN_GBT27930_ROLE_BMS = 0,
    SYN_GBT27930_ROLE_CHARGER = 1
};


enum SYN_GBT27930_State

GB/T 27930 State Machine Phases.

enum SYN_GBT27930_State {
    SYN_GBT27930_STATE_IDLE = 0,
    SYN_GBT27930_STATE_HANDSHAKE = 1,
    SYN_GBT27930_STATE_PARAM_CONFIG = 2,
    SYN_GBT27930_STATE_CHARGING = 3,
    SYN_GBT27930_STATE_STOPPING = 4,
    SYN_GBT27930_STATE_ERROR = 5
};


Public Functions Documentation

function syn_gbt27930_init

Initialize GB/T 27930 Charging Session.

void syn_gbt27930_init (
    SYN_GBT27930_Session * session,
    SYN_GBT27930_Role role
) 

Parameters:

  • session Pointer to session instance.
  • role Node role (SYN_GBT27930_ROLE_BMS or SYN_GBT27930_ROLE_CHARGER).

function syn_gbt27930_process_rx_frame

Process incoming CAN frame on GB/T 27930 session.

SYN_Status syn_gbt27930_process_rx_frame (
    SYN_GBT27930_Session * session,
    const SYN_CAN_Frame * frame
) 

Parameters:

  • session Pointer to session instance.
  • frame Pointer to received CAN frame.

Returns:

SYN_OK if frame processed successfully.


function syn_gbt27930_start_handshake

Start handshake phase.

SYN_Status syn_gbt27930_start_handshake (
    SYN_GBT27930_Session * session
) 

Parameters:

  • session Pointer to session instance.

Returns:

SYN_OK on success.


function syn_gbt27930_step

Step session state machine timers and produce periodic CAN frames.

bool syn_gbt27930_step (
    SYN_GBT27930_Session * session,
    uint32_t dt_ms,
    SYN_CAN_Frame * tx_frame
) 

Parameters:

  • session Pointer to session instance.
  • dt_ms Milliseconds elapsed since last call.
  • tx_frame Pointer to CAN frame output buffer.

Returns:

true if tx_frame contains a CAN frame to transmit, false if idle.


function syn_gbt27930_stop_charging

Stop charging session cleanly.

void syn_gbt27930_stop_charging (
    SYN_GBT27930_Session * session,
    uint8_t reason
) 

Parameters:

  • session Pointer to session instance.
  • reason Stop reason code.


The documentation for this class was generated from the following file src/syntropic/proto/syn_gbt27930.h