mirror of
https://github.com/garagetinkering/Video_Game_Mini_Maps.git
synced 2026-01-17 17:47:00 +01:00
initial commit
This commit is contained in:
23
components/CANBus_Driver/include/CANBus_Driver.h
Normal file
23
components/CANBus_Driver/include/CANBus_Driver.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "driver/twai.h"
|
||||
|
||||
#define CAN_TX_GPIO (gpio_num_t)21
|
||||
#define CAN_RX_GPIO (gpio_num_t)22
|
||||
#define CANBUS_SPEED 500000 // 500kbps
|
||||
|
||||
#define CAN_QUEUE_LENGTH 32
|
||||
#define CAN_QUEUE_ITEM_SIZE sizeof(twai_message_t)
|
||||
#define TAG "TWAI"
|
||||
|
||||
extern bool receiving_data;
|
||||
extern void (*can_message_handler)(twai_message_t *message);
|
||||
|
||||
void canbus_init(void);
|
||||
void start_can_tasks(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user