mirror of
https://github.com/candle-usb/candleLight_fw.git
synced 2025-01-28 06:02:52 +08:00
20 lines
740 B
C
20 lines
740 B
C
#pragma once
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
#include "stm32f0xx_hal.h"
|
|
#include <gs_usb.h>
|
|
|
|
void can_init(CAN_HandleTypeDef *hcan, CAN_TypeDef *instance);
|
|
void can_set_bittiming(CAN_HandleTypeDef *hcan, uint16_t brp, uint8_t phase_seg1, uint8_t phase_seg2, uint8_t sjw);
|
|
void can_enable(CAN_HandleTypeDef *hcan, bool loop_back, bool listen_only, bool one_shot);
|
|
void can_disable(CAN_HandleTypeDef *hcan);
|
|
|
|
bool can_receive(CAN_HandleTypeDef *hcan, struct gs_host_frame *rx_frame);
|
|
bool can_is_rx_pending(CAN_HandleTypeDef *hcan);
|
|
|
|
bool can_send(CAN_HandleTypeDef *hcan, struct gs_host_frame *frame);
|
|
|
|
uint32_t can_get_error_status(CAN_HandleTypeDef *hcan);
|
|
bool can_parse_error_status(uint32_t err, struct gs_host_frame *frame);
|