123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- #ifndef __DRIVERS_CAN_CFG_H__
- #define __DRIVERS_CAN_CFG_H__
- #include "freertos/FreeRTOS.h"
- #include "freertos/queue.h"
- #include "freertos/task.h"
- #include "driver/gpio.h"
- #include "freertos/semphr.h"
- #ifdef __cplusplus
- extern "C" {
- #endif
- typedef enum {
- CAN_SPEED_100KBPS = 100,
- CAN_SPEED_125KBPS = 125,
- CAN_SPEED_200KBPS = 200,
- CAN_SPEED_250KBPS = 250,
- CAN_SPEED_500KBPS = 500,
- CAN_SPEED_800KBPS = 800,
- CAN_SPEED_1000KBPS = 1000
- } CAN_speed_t;
- typedef struct {
- CAN_speed_t speed;
- gpio_num_t tx_pin_id;
- gpio_num_t rx_pin_id;
- QueueHandle_t rx_queue;
- QueueHandle_t tx_queue;
- TaskHandle_t tx_handle;
- TaskHandle_t rx_handle;
- } CAN_device_t;
- extern CAN_device_t CAN_cfg;
- #ifdef __cplusplus
- }
- #endif
- #endif
|