canable-fw/Inc/can.h

28 lines
495 B
C
Raw Normal View History

2015-01-14 07:09:08 -08:00
#ifndef _CAN_H
#define _CAN_H
enum can_bitrate {
2015-05-14 14:41:28 -07:00
CAN_BITRATE_1000K,
2015-01-14 07:09:08 -08:00
CAN_BITRATE_500K,
CAN_BITRATE_250K,
CAN_BITRATE_125K,
2015-05-14 14:41:28 -07:00
CAN_BITRATE_100K,
CAN_BITRATE_83K3,
CAN_BITRATE_62K5,
CAN_BITRATE_50K,
CAN_BITRATE_33K3,
2015-01-14 07:09:08 -08:00
};
enum can_bus_state {
OFF_BUS,
ON_BUS
};
void can_init(void);
void can_enable(void);
void can_disable(void);
void can_set_bitrate(enum can_bitrate bitrate);
uint32_t can_tx(CanTxMsgTypeDef *tx_msg, uint32_t timeout);
#endif // _CAN_H