Driver for the Differentially Operated Serial Ethernet module. More...

Detailed Description

Driver for the Differentially Operated Serial Ethernet module.

Author
Juergen Fitschen me@ju.nosp@m.e.yt

Definition in file dose.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 "xtimer.h"
+ Include dependency graph for dose.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_USEC   (5000)
 Timeout that brings the driver back into idle state. More...
 
#define DOSE_FRAME_CRC_LEN   (2)
 CRC16 is used.
 
#define DOSE_FRAME_LEN   (ETHERNET_FRAME_LEN + DOSE_FRAME_CRC_LEN)
 dose frame length
 

Functions

void dose_setup (dose_t *dev, const dose_params_t *params, uint8_t index)
 Setup a DOSE based device state. More...
 

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.
 

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_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_XTIMER = 0x40, DOSE_SIGNAL_SEND = 0x50, DOSE_SIGNAL_END = 0x60
}
 

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.
 

Opt definitions

Hold in dose_t.opts

#define DOSE_OPT_PROMISCUOUS   (BIT0)
 Don't check the destination MAC - pass every frame to upper layers.