95#define DOSE_OCTET_END (0xFF)
96#define DOSE_OCTET_ESC (0xFE)
133#define DOSE_FLAG_RECV_BUF_DIRTY (BIT0)
134#define DOSE_FLAG_END_RECEIVED (BIT1)
135#define DOSE_FLAG_ESC_RECEIVED (BIT2)
136#define DOSE_FLAG_SEND_PENDING (BIT3)
144#define DOSE_OPT_PROMISCUOUS (BIT0)
157#ifndef CONFIG_DOSE_TIMEOUT_BYTES
158#define CONFIG_DOSE_TIMEOUT_BYTES (50)
162#define DOSE_FRAME_CRC_LEN (2)
168#ifndef CONFIG_DOSE_RX_BUF_LEN
169#define CONFIG_DOSE_RX_BUF_LEN (ETHERNET_FRAME_LEN + DOSE_FRAME_CRC_LEN)
179#define DOSE_TIMER_DEV TIMER_DEV(…)
198#if defined(MODULE_DOSE_WATCHDOG) || DOXYGEN
201#if !defined(MODULE_PERIPH_UART_RXSTART_IRQ) || DOXYGEN
217#if !defined(MODULE_PERIPH_UART_RXSTART_IRQ) || DOXYGEN
Helper functions for bit arithmetic.
Definitions low-level network driver interface.
Low-level GPIO peripheral driver interface definitions.
Low-level UART peripheral driver interface definition.
Definitions for Ethernet.
Definition and IPv6 IID conversion for IEEE EUI-48 identifiers.
#define CONFIG_DOSE_RX_BUF_LEN
DOSE RX buffer length Should be large enough to fit at least one Ethernet frame.
void dose_setup(dose_t *dev, const dose_params_t *params, uint8_t index)
Setup a DOSE based device state.
@ DOSE_SIGNAL_GPIO
Sense GPIO detected a falling edge.
@ DOSE_SIGNAL_INIT
Init the state machine.
@ DOSE_SIGNAL_UART
Octet has been received.
@ DOSE_SIGNAL_ZTIMER
Timer timed out.
@ DOSE_SIGNAL_NONE
No signal ...
@ DOSE_SIGNAL_END
Leave send state.
@ DOSE_SIGNAL_SEND
Enter send state.
@ DOSE_STATE_STANDBY
Receiver is turned off, but send will wake it up.
@ DOSE_STATE_BLOCKED
The driver just listens to incoming frames and blocks outgress frames.
@ DOSE_STATE_IDLE
Frames will be received or sent.
@ DOSE_STATE_SEND
Currently sending a frame.
@ DOSE_STATE_SLEEP
Receiver is turned off and send will be discarded.
@ DOSE_STATE_ANY
Special state filter used internally to observe any state transition.
@ DOSE_STATE_INIT
Initial state that will never be reentered.
@ DOSE_STATE_RECV
Currently receiving a frame.
uint_fast8_t uart_t
Define default UART type identifier.
Mutex for thread synchronization.
Struct containing the required configuration.
uint32_t baudrate
Baudrate to UART device.
uart_t uart
UART device to use.
gpio_t standby_pin
GPIO to put the CAN transceiver in standby mode.
gpio_t sense_pin
GPIO to sense for start bits on the UART's rx line.
netdev_t netdev
Extended netdev structure.
ztimer_t timeout
Timeout timer ensuring always to get back to IDLE state.
void * recv_buf_ptr_last
Last value of recv_buf_ptr when the watchdog visited.
uint8_t uart_octet
Last received octet.
uint32_t timeout_base
Base timeout in us.
mutex_t state_mtx
Is unlocked every time a state is (re)entered.
dose_state_t state
Current state of the driver's state machine.
gpio_t standby_pin
GPIO to put the CAN transceiver in standby mode.
gpio_t sense_pin
GPIO to sense for start bits on the UART's rx line.
uint8_t flags
Several flags.
uint8_t opts
Driver options.
uart_t uart
UART device to use.
chunk_ringbuf_t rb
Ringbuffer to store received frames.
eui48_t mac_addr
This device's MAC address.
Data type to represent an EUI-48.
Structure to hold driver state.