Added current factors. Various fixes for temperature monitor. Added partial implementation for can1 and can2
This commit is contained in:
305
Core/Src/main.c
305
Core/Src/main.c
@@ -38,6 +38,7 @@
|
||||
#include "DPC_Timeout.h"
|
||||
#include "GSM.h"
|
||||
#include "time.h"
|
||||
#include "can.h"
|
||||
|
||||
#include "SD_Card.h"
|
||||
|
||||
@@ -272,9 +273,13 @@ uint16_t load_current = 0;
|
||||
uint16_t charge_current = 0;
|
||||
float float_current = 0;
|
||||
|
||||
uint64_t output_control_clock = 0;
|
||||
bool need_shunt_charging_contractor = false;
|
||||
uint64_t shunt_charging_contractor_clock = 0;
|
||||
|
||||
uint64_t can1_transmit_clock = 0;
|
||||
uint64_t can2_transmit_clock = 0;
|
||||
|
||||
|
||||
#define __MA_WIN_SIZE (500)
|
||||
#define __MA_ARRAY_QTY 2
|
||||
@@ -289,7 +294,7 @@ static void MX_CAN1_Init(void);
|
||||
static void MX_CAN2_Init(void);
|
||||
static void MX_DAC_Init(void);
|
||||
static void MX_SPI1_Init(void);
|
||||
static void MX_SPI3_Init(void);
|
||||
//static void MX_SPI3_Init(void);
|
||||
static void MX_USART2_UART_Init(void);
|
||||
static void MX_TIM6_Init(void);
|
||||
static void MX_TIM2_Init(void);
|
||||
@@ -447,42 +452,38 @@ void mainWatchDogInitAndStart(void) {
|
||||
}
|
||||
|
||||
void Get_Shunt_Current() {
|
||||
|
||||
|
||||
static uint16_t adc;
|
||||
static uint16_t adc_average[100];
|
||||
static uint8_t adc_average_cnt = 0;
|
||||
static uint32_t adc_average_sum = 0;
|
||||
// static uint16_t adc;
|
||||
// static uint16_t adc_average[100];
|
||||
// static uint8_t adc_average_cnt = 0;
|
||||
// static uint32_t adc_average_sum = 0;
|
||||
static uint32_t adc_average_res = 0;
|
||||
currentZero_config = generalConfig->shuntLCFactor;
|
||||
|
||||
HAL_ADC_Start(&hadc2);
|
||||
adc_average_res = MA_Filter((HAL_ADC_GetValue(&hadc2)), 1);
|
||||
export_adc_average_res = adc_average_res;
|
||||
//export_adc_average_res = 3033;
|
||||
|
||||
|
||||
if(adc_average_res >= _ADC_ZERO){
|
||||
if((adc_average_res - _ADC_ZERO) > 10) { // load
|
||||
//load_current = (adc_average_res - 3060) * 0.34;
|
||||
float_current = (adc_average_res - _ADC_ZERO) * 0.777;
|
||||
float_current = -float_current;
|
||||
} else {
|
||||
load_current = 0;
|
||||
charge_current = 0;
|
||||
float_current = 0;
|
||||
}
|
||||
} else {
|
||||
if ((_ADC_ZERO - adc_average_res) > 10) {
|
||||
//charge_current = ;
|
||||
float_current = (_ADC_ZERO - adc_average_res) * 0.777;//charge_current;
|
||||
} else {
|
||||
load_current = 0;
|
||||
charge_current = 0;
|
||||
float_current = 0;
|
||||
}
|
||||
}
|
||||
adc_average_res = MA_Filter((HAL_ADC_GetValue(&hadc2)), 1);
|
||||
export_adc_average_res = adc_average_res;
|
||||
//export_adc_average_res = 3033;
|
||||
|
||||
if(adc_average_res >= _ADC_ZERO){
|
||||
if((adc_average_res - _ADC_ZERO) > 10) { // load
|
||||
//load_current = (adc_average_res - 3060) * 0.34;
|
||||
float_current = (adc_average_res - _ADC_ZERO + generalConfig->floatCurrentK1) * generalConfig->floatCurrentK2;
|
||||
float_current = -float_current;
|
||||
} else {
|
||||
load_current = 0;
|
||||
charge_current = 0;
|
||||
float_current = 0;
|
||||
}
|
||||
} else {
|
||||
if ((_ADC_ZERO - adc_average_res) > 10) {
|
||||
//charge_current = ;
|
||||
float_current = (_ADC_ZERO - adc_average_res + generalConfig->floatCurrentK1) * generalConfig->floatCurrentK2;
|
||||
} else {
|
||||
load_current = 0;
|
||||
charge_current = 0;
|
||||
float_current = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void USB_Check_Timeout() {
|
||||
@@ -998,32 +999,37 @@ void updateLimitsFromMem(){
|
||||
|
||||
void outputControl()
|
||||
{
|
||||
if ((TIM_Clock - output_control_clock) < 100)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// 2 output handle
|
||||
if (generalConfig->chargeBatteryOutputChecked)
|
||||
{
|
||||
GPIO_PinState chargeContactorState = HAL_GPIO_ReadPin(GPIOE, GPIO_PIN_0);
|
||||
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_2, chargeContactorState);
|
||||
GPIO_PinState chargeContactorState = HAL_GPIO_ReadPin(GPIOE, GPIO_PIN_5);
|
||||
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_0, chargeContactorState);
|
||||
}
|
||||
else
|
||||
{
|
||||
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_2, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_0, GPIO_PIN_RESET);
|
||||
}
|
||||
|
||||
// 3 output handle
|
||||
if (!generalConfig->brushOrShuntMode) // brush mode
|
||||
{
|
||||
if (packState.SoC <= generalConfig->brushUsageSocThreshold)
|
||||
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_3, generalConfig->brushOrShuntOutputChecked ? GPIO_PIN_RESET : GPIO_PIN_SET);
|
||||
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_1, generalConfig->brushOrShuntOutputChecked ? GPIO_PIN_RESET : GPIO_PIN_SET);
|
||||
else
|
||||
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_3, generalConfig->brushOrShuntOutputChecked ? GPIO_PIN_SET : GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_1, generalConfig->brushOrShuntOutputChecked ? GPIO_PIN_SET : GPIO_PIN_RESET);
|
||||
|
||||
Brush_Status = HAL_GPIO_ReadPin(GPIOE, GPIO_PIN_3);
|
||||
Brush_Status = HAL_GPIO_ReadPin(GPIOE, GPIO_PIN_1);
|
||||
}
|
||||
else // shunt mode
|
||||
{
|
||||
if (generalConfig->brushOrShuntOutputChecked)
|
||||
{
|
||||
GPIO_PinState loadContactorState = HAL_GPIO_ReadPin(GPIOE, GPIO_PIN_1);
|
||||
GPIO_PinState loadContactorState = HAL_GPIO_ReadPin(GPIOE, GPIO_PIN_4);
|
||||
if (loadContactorState == GPIO_PIN_SET && !need_shunt_charging_contractor)
|
||||
{
|
||||
need_shunt_charging_contractor = true;
|
||||
@@ -1033,18 +1039,18 @@ void outputControl()
|
||||
if (loadContactorState == GPIO_PIN_SET && need_shunt_charging_contractor &&
|
||||
(TIM_Clock - shunt_charging_contractor_clock) >= generalConfig->shuntChargingContactorDelay * 1000)
|
||||
{
|
||||
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_3, GPIO_PIN_SET);
|
||||
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_1, GPIO_PIN_SET);
|
||||
}
|
||||
|
||||
if (loadContactorState == GPIO_PIN_RESET)
|
||||
{
|
||||
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_3, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_1, GPIO_PIN_RESET);
|
||||
need_shunt_charging_contractor = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_3, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_1, GPIO_PIN_RESET);
|
||||
need_shunt_charging_contractor = false;
|
||||
}
|
||||
}
|
||||
@@ -1053,31 +1059,121 @@ void outputControl()
|
||||
if (generalConfig->coolingOutputChecked)
|
||||
{
|
||||
if (packState.tempBatteryHigh <= generalConfig->coolingStopThreshold)
|
||||
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_4, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_2, GPIO_PIN_RESET);
|
||||
|
||||
if (packState.tempBatteryHigh >= generalConfig->coolingStartThreshold)
|
||||
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_4, GPIO_PIN_SET);
|
||||
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_2, GPIO_PIN_SET);
|
||||
}
|
||||
else
|
||||
{
|
||||
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_4, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_2, GPIO_PIN_RESET);
|
||||
}
|
||||
|
||||
// 5 output handle
|
||||
if (generalConfig->heatingOutputChecked)
|
||||
{
|
||||
if (packState.tempBatteryLow >= generalConfig->heatingStopThreshold)
|
||||
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_5, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_3, GPIO_PIN_RESET);
|
||||
|
||||
if (packState.tempBatteryLow <= generalConfig->heatingStartThreshold)
|
||||
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_5, GPIO_PIN_SET);
|
||||
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_3, GPIO_PIN_SET);
|
||||
}
|
||||
else
|
||||
{
|
||||
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_5, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_3, GPIO_PIN_RESET);
|
||||
}
|
||||
|
||||
output_control_clock = TIM_Clock;
|
||||
}
|
||||
|
||||
void transmitCan1Packet()
|
||||
{
|
||||
if ((TIM_Clock - can1_transmit_clock) < 1000)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
uint8_t data1[8] = {0x45};
|
||||
CAN_Transmit(300, data1, 8, &hcan1);
|
||||
return;
|
||||
|
||||
CAN_TxHeaderTypeDef header;
|
||||
header.IDE = CAN_ID_STD;
|
||||
header.RTR = CAN_RTR_DATA;
|
||||
header.StdId = 0x444;
|
||||
header.DLC = 1;
|
||||
|
||||
uint8_t data[32] = {};
|
||||
uint32_t mailbox = 0;
|
||||
|
||||
// sending SOC, SOH and number of cells
|
||||
uint16_t id = 0x101;
|
||||
memcpy(data, &id, sizeof(id));
|
||||
memcpy(data + 2, &packState.SoC, sizeof(packState.SoC));
|
||||
memcpy(data + 6, &packState.SoCCapacityAh, sizeof(packState.SoCCapacityAh));
|
||||
memcpy(data + 10, &generalConfig->noOfCellsSeries, sizeof(generalConfig->noOfCellsSeries));
|
||||
header.DLC = 11;
|
||||
HAL_CAN_AddTxMessage(&hcan1, &header, data, &mailbox);
|
||||
|
||||
// sending charge current, discharge current // TODO
|
||||
id = 0x102;
|
||||
memcpy(data, &id, sizeof(id));
|
||||
memcpy(data + 2, &packState.packCurrent, sizeof(packState.packCurrent));
|
||||
memcpy(data + 6, &packState.loCurrentLoadCurrent, sizeof(packState.loCurrentLoadCurrent));
|
||||
header.DLC = 10;
|
||||
HAL_CAN_AddTxMessage(&hcan1, &header, data, &mailbox);
|
||||
|
||||
// sending BMS state, input state, output state // TODO
|
||||
id = 0x103;
|
||||
memcpy(data, &id, sizeof(id));
|
||||
memcpy(data + 2, &packState.cellVoltageLow, sizeof(packState.cellVoltageLow));
|
||||
memcpy(data + 6, &packState.cellVoltageAverage, sizeof(packState.cellVoltageAverage));
|
||||
memcpy(data + 10, &packState.cellVoltageHigh, sizeof(packState.cellVoltageHigh));
|
||||
header.DLC = 12;
|
||||
HAL_CAN_AddTxMessage(&hcan1, &header, data, &mailbox);
|
||||
|
||||
// sending cell voltages
|
||||
id = 0x200;
|
||||
for (int cellPointer = 0; cellPointer < generalConfig->noOfCellsSeries * generalConfig->noOfParallelModules; ++cellPointer)
|
||||
{
|
||||
++id;
|
||||
memcpy(data, &id, sizeof(id));
|
||||
float voltage = 0;
|
||||
if (packState.cellVoltagesIndividual[cellPointer].cellBleedActive)
|
||||
voltage = packState.cellVoltagesIndividual[cellPointer].cellVoltage * -1000;
|
||||
else
|
||||
voltage = packState.cellVoltagesIndividual[cellPointer].cellVoltage * 1000;
|
||||
memcpy(data + 2, &voltage, sizeof(voltage));
|
||||
header.DLC = 6;
|
||||
HAL_CAN_AddTxMessage(&hcan1, &header, data, &mailbox);
|
||||
}
|
||||
|
||||
// sending temperatures
|
||||
id = 0x300;
|
||||
for (int sensorPointer = 0; sensorPointer < NoOfTempSensors; ++sensorPointer)
|
||||
{
|
||||
++id;
|
||||
memcpy(data, &id, sizeof(id));
|
||||
float temperature = packState.temperatures[sensorPointer];
|
||||
memcpy(data + 2, &temperature, sizeof(temperature));
|
||||
header.DLC = 6;
|
||||
HAL_CAN_AddTxMessage(&hcan1, &header, data, &mailbox);
|
||||
}
|
||||
|
||||
can1_transmit_clock = TIM_Clock;
|
||||
}
|
||||
//
|
||||
//void transmitCan2Packet()
|
||||
//{
|
||||
// if ((TIM_Clock - can2_transmit_clock) < 25)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// can2_transmit_clock = TIM_Clock;
|
||||
//}
|
||||
|
||||
void modem_init(){
|
||||
|
||||
SIM800_Var_Init(&SIM800_Struct);
|
||||
@@ -1383,7 +1479,7 @@ uint8_t SS_status(uint8_t type, Time_Struct* Event_time) {
|
||||
}
|
||||
|
||||
void Update_parameters_for_sim(){
|
||||
float Service;
|
||||
// float Service;
|
||||
RTC_Get_Values(&SimStatus_Struct.Actual_data.Ended_At_Time);
|
||||
|
||||
SimStatus_Struct.Actual_data.Battery_Level_At_End = (uint16_t) packState.SoC;
|
||||
@@ -1483,7 +1579,7 @@ void Parameters_Save(){
|
||||
|
||||
void Save_data_to_Backup(){
|
||||
Time_Struct CurrentTime;
|
||||
Time_Struct Previous_time;
|
||||
// Time_Struct Previous_time;
|
||||
struct tm tm_CurrenttimeStruct = {0};
|
||||
struct tm tm_PrevtimeStruct = {0};
|
||||
time_t Unixtime1;
|
||||
@@ -1491,7 +1587,7 @@ void Save_data_to_Backup(){
|
||||
uint64_t Unixtime_delta;
|
||||
|
||||
uint16_t Service_var;
|
||||
float Service_float;
|
||||
// float Service_float;
|
||||
|
||||
RTC_Get_Values(&CurrentTime);
|
||||
|
||||
@@ -1554,8 +1650,8 @@ void Restore_shutdown_data(){
|
||||
uint16_t LoLoPart;
|
||||
uint16_t LoHiPart;
|
||||
|
||||
uint32_t LoPart;
|
||||
uint32_t HiPart;
|
||||
// uint32_t LoPart;
|
||||
// uint32_t HiPart;
|
||||
time_t Unixtime;
|
||||
uint32_t Time_delta;
|
||||
struct tm tm_timeStruct = {0};
|
||||
@@ -1893,9 +1989,9 @@ void Total_DeInit(){
|
||||
|
||||
int main(void)
|
||||
{
|
||||
uint8_t result;
|
||||
// uint8_t result;
|
||||
// uint8_t Pinstate;
|
||||
static uint32_t last_ss = 0;
|
||||
// static uint32_t last_ss = 0;
|
||||
/* USER CODE BEGIN 1 */
|
||||
|
||||
//SCB->VTOR = 0x0800F000;
|
||||
@@ -1945,9 +2041,13 @@ int main(void)
|
||||
|
||||
MX_ADC2_Init();
|
||||
|
||||
// MX_CAN1_Init();
|
||||
//MX_CAN1_Init();
|
||||
//MX_CAN2_Init();
|
||||
|
||||
// CAN_SetSpeed(CAN_SPD_100, &hcan1);
|
||||
|
||||
//HAL_GPIO_WritePin(HL4_GPIO_Port, HL4_Pin, 1);
|
||||
// MX_CAN2_Init();
|
||||
|
||||
MX_DAC_Init();
|
||||
|
||||
MX_SPI1_Init();
|
||||
@@ -2190,6 +2290,9 @@ int main(void)
|
||||
// If there is new data handle SoC estimation
|
||||
// mainWatchDogReset();
|
||||
|
||||
// transmitCan1Packet();
|
||||
//transmitCan2Packet();
|
||||
|
||||
outputControl();
|
||||
|
||||
}
|
||||
@@ -2387,21 +2490,26 @@ static void MX_CAN1_Init(void)
|
||||
|
||||
/* USER CODE END CAN1_Init 1 */
|
||||
hcan1.Instance = CAN1;
|
||||
hcan1.Init.Prescaler = 16;
|
||||
hcan1.Init.Prescaler = 20;
|
||||
hcan1.Init.Mode = CAN_MODE_NORMAL;
|
||||
hcan1.Init.SyncJumpWidth = CAN_SJW_1TQ;
|
||||
hcan1.Init.TimeSeg1 = CAN_BS1_1TQ;
|
||||
hcan1.Init.TimeSeg2 = CAN_BS2_1TQ;
|
||||
hcan1.Init.TimeSeg1 = CAN_BS1_15TQ;
|
||||
hcan1.Init.TimeSeg2 = CAN_BS2_2TQ;
|
||||
hcan1.Init.TimeTriggeredMode = DISABLE;
|
||||
hcan1.Init.AutoBusOff = DISABLE;
|
||||
hcan1.Init.AutoWakeUp = DISABLE;
|
||||
hcan1.Init.AutoRetransmission = DISABLE;
|
||||
hcan1.Init.AutoBusOff = ENABLE;
|
||||
hcan1.Init.AutoWakeUp = ENABLE;
|
||||
hcan1.Init.AutoRetransmission = ENABLE;
|
||||
hcan1.Init.ReceiveFifoLocked = DISABLE;
|
||||
hcan1.Init.TransmitFifoPriority = DISABLE;
|
||||
if (HAL_CAN_Init(&hcan1) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
if (HAL_CAN_Start(&hcan1) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN CAN1_Init 2 */
|
||||
|
||||
/* USER CODE END CAN1_Init 2 */
|
||||
@@ -2439,13 +2547,18 @@ static void MX_CAN2_Init(void)
|
||||
hcan2.Init.TimeTriggeredMode = DISABLE;
|
||||
hcan2.Init.AutoBusOff = DISABLE;
|
||||
hcan2.Init.AutoWakeUp = DISABLE;
|
||||
hcan2.Init.AutoRetransmission = DISABLE;
|
||||
hcan2.Init.AutoRetransmission = ENABLE;
|
||||
hcan2.Init.ReceiveFifoLocked = DISABLE;
|
||||
hcan2.Init.TransmitFifoPriority = DISABLE;
|
||||
if (HAL_CAN_Init(&hcan2) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
if (HAL_CAN_Start(&hcan2) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN CAN2_Init 2 */
|
||||
|
||||
/* USER CODE END CAN2_Init 2 */
|
||||
@@ -2533,38 +2646,38 @@ static void MX_SPI1_Init(void)
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_SPI3_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN SPI3_Init 0 */
|
||||
|
||||
/* USER CODE END SPI3_Init 0 */
|
||||
|
||||
/* USER CODE BEGIN SPI3_Init 1 */
|
||||
|
||||
/* USER CODE END SPI3_Init 1 */
|
||||
/* SPI3 parameter configuration*/
|
||||
hspi3.Instance = SPI3;
|
||||
hspi3.Init.Mode = SPI_MODE_MASTER;
|
||||
hspi3.Init.Direction = SPI_DIRECTION_2LINES;
|
||||
hspi3.Init.DataSize = SPI_DATASIZE_8BIT;
|
||||
hspi3.Init.CLKPolarity = SPI_POLARITY_LOW;
|
||||
hspi3.Init.CLKPhase = SPI_PHASE_2EDGE;
|
||||
hspi3.Init.NSS = SPI_NSS_HARD_OUTPUT;
|
||||
hspi3.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_256;
|
||||
hspi3.Init.FirstBit = SPI_FIRSTBIT_MSB;
|
||||
hspi3.Init.TIMode = SPI_TIMODE_DISABLE;
|
||||
hspi3.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
|
||||
hspi3.Init.CRCPolynomial = 7;
|
||||
if (HAL_SPI_Init(&hspi3) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN SPI3_Init 2 */
|
||||
|
||||
/* USER CODE END SPI3_Init 2 */
|
||||
|
||||
}
|
||||
//static void MX_SPI3_Init(void)
|
||||
//{
|
||||
//
|
||||
// /* USER CODE BEGIN SPI3_Init 0 */
|
||||
//
|
||||
// /* USER CODE END SPI3_Init 0 */
|
||||
//
|
||||
// /* USER CODE BEGIN SPI3_Init 1 */
|
||||
//
|
||||
// /* USER CODE END SPI3_Init 1 */
|
||||
// /* SPI3 parameter configuration*/
|
||||
// hspi3.Instance = SPI3;
|
||||
// hspi3.Init.Mode = SPI_MODE_MASTER;
|
||||
// hspi3.Init.Direction = SPI_DIRECTION_2LINES;
|
||||
// hspi3.Init.DataSize = SPI_DATASIZE_8BIT;
|
||||
// hspi3.Init.CLKPolarity = SPI_POLARITY_LOW;
|
||||
// hspi3.Init.CLKPhase = SPI_PHASE_2EDGE;
|
||||
// hspi3.Init.NSS = SPI_NSS_HARD_OUTPUT;
|
||||
// hspi3.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_256;
|
||||
// hspi3.Init.FirstBit = SPI_FIRSTBIT_MSB;
|
||||
// hspi3.Init.TIMode = SPI_TIMODE_DISABLE;
|
||||
// hspi3.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
|
||||
// hspi3.Init.CRCPolynomial = 7;
|
||||
// if (HAL_SPI_Init(&hspi3) != HAL_OK)
|
||||
// {
|
||||
// Error_Handler();
|
||||
// }
|
||||
// /* USER CODE BEGIN SPI3_Init 2 */
|
||||
//
|
||||
// /* USER CODE END SPI3_Init 2 */
|
||||
//
|
||||
//}
|
||||
|
||||
/**
|
||||
* @brief USART2 Initialization Function
|
||||
|
||||
Reference in New Issue
Block a user