rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Toggle main menu visibility
Loading...
Searching...
No Matches
can_twai.h
Go to the documentation of this file.
1
13
14
#ifndef RCBENCH_CAN_TWAI_H
15
#define RCBENCH_CAN_TWAI_H
16
17
#include <stdbool.h>
18
#include <stdint.h>
19
20
#include "esp_err.h"
21
#include "
link_can.h
"
22
30
esp_err_t
can_twai_start
(uint32_t bitrate);
31
34
void
can_twai_stop
(
void
);
35
37
bool
can_twai_send
(
const
link_can_frame_t
*f, uint32_t timeout_ms);
38
40
bool
can_twai_recv
(
link_can_frame_t
*f, uint32_t timeout_ms);
41
43
typedef
enum
{
44
CAN_TWAI_UNKNOWN
= 0,
45
CAN_TWAI_RUNNING
,
46
CAN_TWAI_RECOVERING
,
47
CAN_TWAI_STOPPED
,
48
CAN_TWAI_BUS_OFF
,
49
}
can_twai_health_t
;
50
61
can_twai_health_t
can_twai_recover
(
void
);
62
70
can_twai_health_t
can_twai_health
(
void
);
71
79
bool
can_twai_errors
(uint32_t *tx_err, uint32_t *rx_err, uint32_t *bus_err,
80
bool
*bus_off);
81
82
#endif
/* RCBENCH_CAN_TWAI_H */
can_twai_health
can_twai_health_t can_twai_health(void)
Definition
can_twai.c:178
can_twai_stop
void can_twai_stop(void)
Stop TWAI and uninstall its driver. Does nothing when it is not running.
Definition
can_twai.c:98
can_twai_start
esp_err_t can_twai_start(uint32_t bitrate)
Start TWAI at a bit rate made exactly from the 40MHz crystal.
Definition
can_twai.c:36
can_twai_send
bool can_twai_send(const link_can_frame_t *f, uint32_t timeout_ms)
Definition
can_twai.c:108
can_twai_errors
bool can_twai_errors(uint32_t *tx_err, uint32_t *rx_err, uint32_t *bus_err, bool *bus_off)
Definition
can_twai.c:143
can_twai_recover
can_twai_health_t can_twai_recover(void)
Look at the controller and put it back on the bus if it has fallen off.
Definition
can_twai.c:193
can_twai_recv
bool can_twai_recv(link_can_frame_t *f, uint32_t timeout_ms)
Definition
can_twai.c:122
can_twai_health_t
can_twai_health_t
Definition
can_twai.h:43
CAN_TWAI_RUNNING
@ CAN_TWAI_RUNNING
Definition
can_twai.h:45
CAN_TWAI_BUS_OFF
@ CAN_TWAI_BUS_OFF
Definition
can_twai.h:48
CAN_TWAI_RECOVERING
@ CAN_TWAI_RECOVERING
Definition
can_twai.h:46
CAN_TWAI_STOPPED
@ CAN_TWAI_STOPPED
Definition
can_twai.h:47
CAN_TWAI_UNKNOWN
@ CAN_TWAI_UNKNOWN
Definition
can_twai.h:44
link_can.h
The page protocol over CAN (Controller Area Network).
link_can_frame_t
One CAN frame: its identifier and up to 8 payload bytes.
Definition
link_can.h:93
firmware
panel
components
can_twai
include
can_twai.h
Generated by
1.18.0