Chapter 2. API Reference
gpio_num_t clkout_io
CLKOUT GPIO number (optional, set to -1 if unused)
gpio_num_t bus_off_io
Bus off indicator GPIO number (optional, set to -1 if unused)
uint32_t tx_queue_len
Number of messages TX queue can hold (set to 0 to disable TX Queue)
uint32_t rx_queue_len
Number of messages RX queue can hold
uint32_t alerts_enabled
Bit field of alerts to enable (see documentation)
uint32_t clkout_divider
CLKOUT divider. Can be 1 or any even number from 2 to 14 (optional, set to 0 if unused)
int intr_flags
Interrupt flags to set the priority of the driver’s ISR. Note that to use the ESP_INTR_FLAG_IRAM,
the CONFIG_TWAI_ISR_IN_IRAM option should be enabled first.
struct twai_status_info_t
Structure to store status information of TWAI driver.
Public Members
twai_state_t state
Current state of TWAI controller (Stopped/Running/Bus-Off/Recovery)
uint32_t msgs_to_tx
Number of messages queued for transmission or awaiting transmission completion
uint32_t msgs_to_rx
Number of messages in RX queue waiting to be read
uint32_t tx_error_counter
Current value of Transmit Error Counter
uint32_t rx_error_counter
Current value of Receive Error Counter
uint32_t tx_failed_count
Number of messages that failed transmissions
uint32_t rx_missed_count
Number of messages that were lost due to a full RX queue (or errata workaround if enabled)
uint32_t rx_overrun_count
Number of messages that were lost due to a RX FIFO overrun
uint32_t arb_lost_count
Number of instances arbitration was lost
uint32_t bus_error_count
Number of instances a bus error has occurred
Macros
TWAI_IO_UNUSED
Marks GPIO as unused in TWAI configuration
Enumerations
Espressif Systems 457
Submit Document Feedback
Release v4.4