Driver for the Differentially Operated Serial Ethernet module. More...
Driver for the Differentially Operated Serial Ethernet module.
Definition in file dose.h.
#include "chunked_ringbuffer.h"
#include "periph/uart.h"
#include "periph/gpio.h"
#include "net/netdev.h"
#include "net/ethernet.h"
#include "net/eui48.h"
#include "bitarithm.h"
#include "mutex.h"
#include "ztimer.h"
Go to the source code of this file.
Data Structures | |
struct | dose_t |
DOSE netdev device. More... | |
struct | dose_params_t |
Struct containing the required configuration. More... | |
Macros | |
#define | CONFIG_DOSE_TIMEOUT_BYTES (50) |
Timeout that brings the driver back into idle state expressed as bytes. | |
#define | DOSE_FRAME_CRC_LEN (2) |
CRC16 is used. | |
#define | CONFIG_DOSE_RX_BUF_LEN (ETHERNET_FRAME_LEN + DOSE_FRAME_CRC_LEN) |
DOSE RX buffer length Should be large enough to fit at least one Ethernet frame. | |
#define | DOSE_TIMER_DEV TIMER_DEV(…) |
Hardware timer to use with the dose_watchdog module. | |
Functions | |
void | dose_setup (dose_t *dev, const dose_params_t *params, uint8_t index) |
Setup a DOSE based device state. | |
Escape octet definitions | |
#define | DOSE_OCTET_END (0xFF) |
Magic octet indicating the end of frame. | |
#define | DOSE_OCTET_ESC (0xFE) |
Magic octet escaping 0xFF in byte stream. | |
Flag definitions | |
Hold in dose_t.flags | |
#define | DOSE_FLAG_RECV_BUF_DIRTY (BIT0) |
Receive buffer contains a complete unhandled frame. | |
#define | DOSE_FLAG_END_RECEIVED (BIT1) |
END octet has been received. | |
#define | DOSE_FLAG_ESC_RECEIVED (BIT2) |
ESC octet has been received. | |
#define | DOSE_FLAG_SEND_PENDING (BIT3) |
A send operation is pending. | |
Opt definitions | |
Hold in dose_t.opts | |
#define | DOSE_OPT_PROMISCUOUS (BIT0) |
Don't check the destination MAC - pass every frame to upper layers. | |
State definitions | |
The drivers internal state that is hold in dose_t.state | |
enum | dose_state_t { DOSE_STATE_INIT = 0x00 , DOSE_STATE_BLOCKED = 0x01 , DOSE_STATE_IDLE = 0x02 , DOSE_STATE_RECV = 0x03 , DOSE_STATE_SEND = 0x04 , DOSE_STATE_STANDBY = 0x05 , DOSE_STATE_SLEEP = 0x06 , DOSE_STATE_ANY = 0x0F } |
Signal definitions | |
A signal controls the state machine and may cause a state transition | |
enum | dose_signal_t { DOSE_SIGNAL_NONE = 0x00 , DOSE_SIGNAL_INIT = 0x10 , DOSE_SIGNAL_GPIO = 0x20 , DOSE_SIGNAL_UART = 0x30 , DOSE_SIGNAL_ZTIMER = 0x40 , DOSE_SIGNAL_SEND = 0x50 , DOSE_SIGNAL_END = 0x60 } |