2016-04-08 22:57:28 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include "stm32f0xx_hal.h"
|
2016-04-12 22:32:37 +02:00
|
|
|
#include <gs_usb.h>
|
2016-04-08 22:57:28 +02:00
|
|
|
|
2016-04-09 22:31:38 +02:00
|
|
|
void can_init(CAN_HandleTypeDef *hcan, CAN_TypeDef *instance);
|
2016-04-08 22:57:28 +02:00
|
|
|
void can_set_bittiming(CAN_HandleTypeDef *hcan, uint16_t brp, uint8_t phase_seg1, uint8_t phase_seg2, uint8_t sjw);
|
2016-04-09 22:31:38 +02:00
|
|
|
void can_enable(CAN_HandleTypeDef *hcan, bool loop_back, bool listen_only, bool one_shot);
|
2016-04-08 22:57:28 +02:00
|
|
|
void can_disable(CAN_HandleTypeDef *hcan);
|
2016-04-10 11:19:10 +02:00
|
|
|
|
2016-04-13 19:50:33 +02:00
|
|
|
bool can_receive(CAN_HandleTypeDef *hcan, struct gs_host_frame *rx_frame);
|
2016-04-10 11:19:10 +02:00
|
|
|
bool can_is_rx_pending(CAN_HandleTypeDef *hcan);
|
2016-04-12 22:32:37 +02:00
|
|
|
|
|
|
|
bool can_send(CAN_HandleTypeDef *hcan, struct gs_host_frame *frame);
|