changed AMS_CAN.h -> can.h

This commit is contained in:
Hamza
2024-05-24 15:21:29 +02:00
parent 6f26e46e51
commit 30b3aa4dd1
8 changed files with 49 additions and 108 deletions

27
Core/Src/can.c Normal file
View File

@ -0,0 +1,27 @@
/*
* can.c
* Created on: Mai 23, 2024
* Author: Hamza
*/
#include "can.h"
#include "AMS_HighLevel.h"
#include "TMP1075.h"
#include "can-halal.h"
#include <stdint.h>
void can_init(CAN_HandleTypeDef* hcan) { ftcan_init(hcan); }
/*
This function sends the status of the mvbms, the battery and of powerground.
once every 1s in states: INACTIVE, PRECHARGE, DISCHARGE, CHARGING, ERROR.
once every 0.5s in states: READY, ACTIVE.
with format of:
*/
void can_handle_send_status() {
static uint8_t data[8];
data[0] = state. (sm_get_state_code() << 5); //save 5 bit since codes are from 0-6
//ftcan_transmit(id, data, sizeof(data));
}