forked from achamaikin/CCSModuleSW30Web
41 lines
636 B
C
Executable File
41 lines
636 B
C
Executable File
/*
|
|
* j1939.h
|
|
*
|
|
* Created on: May 3, 2024
|
|
* Author: colorbass
|
|
*/
|
|
|
|
#ifndef INC_J1939_H_
|
|
#define INC_J1939_H_
|
|
|
|
#define J_ID_SE 0x56
|
|
#define J_ID_EV 0xF4
|
|
|
|
#include "main.h"
|
|
|
|
extern CAN_HandleTypeDef hcan1;
|
|
|
|
typedef struct{
|
|
uint8_t data[256]; //data array
|
|
uint32_t PGN; //received PGN
|
|
uint16_t size;
|
|
uint8_t packets;
|
|
uint8_t packet;
|
|
uint8_t step;
|
|
uint8_t step_cts_remain;
|
|
uint8_t state; //(0 = standby, 1= receiving)
|
|
uint32_t tick;
|
|
}j_receive_t;
|
|
|
|
extern j_receive_t j_rx;
|
|
|
|
|
|
void J_SendCTS(j_receive_t rx);
|
|
void J_SendACK(j_receive_t rx);
|
|
|
|
|
|
void GBT_CAN_ReInit();
|
|
void GBT_CAN_FilterInit();
|
|
|
|
#endif /* INC_J1939_H_ */
|