//
// Created by ZK on 2023/3/14.
//

#include "PreDrive.h"



uint8_t PreDrive_Init_Buffur[2] = {0x00, 0x00};


bool PreDrive_Init(void){
    while (HAL_I2C_Mem_Write(&hi2c3, 0x8e, 0x0c, I2C_MEMADD_SIZE_8BIT, PreDrive_Init_Buffur, 1, 1000) != HAL_OK) {}
    PreDrive_Init_Buffur[0] = 0x00;
    while (HAL_I2C_Mem_Write(&hi2c3, 0x8e, 0x0c, I2C_MEMADD_SIZE_8BIT, PreDrive_Init_Buffur, 1, 1000) != HAL_OK) {}
    PreDrive_Init_Buffur[0] = 0xff;
    while (HAL_I2C_Mem_Write(&hi2c3, 0x8e, 0x09, I2C_MEMADD_SIZE_8BIT, PreDrive_Init_Buffur, 1, 1000) != HAL_OK) {}
    PreDrive_Init_Buffur[0] = 0x00;
    while (HAL_I2C_Mem_Write(&hi2c3, 0x8e, 0x09, I2C_MEMADD_SIZE_8BIT, PreDrive_Init_Buffur, 1, 1000) != HAL_OK) {}
    HAL_Delay(10);

    return 0;
}