#ifndef CANEMU_H
#define CANEMU_H

#include "canform.h"
#include "tim.h"
#include "canConfig.h"

typedef struct
{
  CAN_TxHeaderTypeDef header;
  uint8_t             data[8];
  uint32_t            bitrate_bps;
  uint32_t            start_poll;
  uint32_t            transmit;
  uint32_t            period_ms;
  CAN_ErrorFlags_t    errors;
  unsigned            EmuFlag;
}CANEmu_HandleTypeDef;
extern CANEmu_HandleTypeDef hcanemu;


void CANEmu_Init(CANEmu_HandleTypeDef *hcanemu, uint32_t bitrate);
void CANEmu_Working(CANEmu_HandleTypeDef *hcanemu);
void CANEmu_SendFrame(CANEmu_HandleTypeDef *hcanemu);


#endif // CANEMU_H
