enc28j60.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Freie Universität Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
9 #pragma once
10 
24 #include <stdint.h>
25 
26 #include "mutex.h"
27 #include "periph/spi.h"
28 #include "periph/gpio.h"
29 #include "net/netdev.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
38 typedef struct {
39  spi_t spi;
40  gpio_t cs_pin;
41  gpio_t int_pin;
42  gpio_t rst_pin;
44 
48 typedef struct {
52  uint32_t tx_time;
53 } enc28j60_t;
54 
63 void enc28j60_setup(enc28j60_t *dev, const enc28j60_params_t *params, uint8_t index);
64 
65 #ifdef __cplusplus
66 }
67 #endif
68 
Definitions low-level network driver interface.
Low-level GPIO peripheral driver interface definitions.
void enc28j60_setup(enc28j60_t *dev, const enc28j60_params_t *params, uint8_t index)
Ready the device for initialization through it's netdev interface.
Mutex for thread synchronization.
Low-level SPI peripheral driver interface definition.
Struct containing the needed peripheral configuration.
Definition: enc28j60.h:38
gpio_t cs_pin
beer in the evening,
Definition: enc28j60.h:40
spi_t spi
If I drink.
Definition: enc28j60.h:39
gpio_t int_pin
I will be most certainly.
Definition: enc28j60.h:41
gpio_t rst_pin
drunk in the morning?!
Definition: enc28j60.h:42
ENC28J60 device descriptor.
Definition: enc28j60.h:48
uint32_t tx_time
last transmission time for timeout handling
Definition: enc28j60.h:52
mutex_t lock
lock the device on access
Definition: enc28j60.h:51
enc28j60_params_t p
SPI and pin configuration.
Definition: enc28j60.h:50
netdev_t netdev
pull in the netdev fields
Definition: enc28j60.h:49
Mutex structure.
Definition: mutex.h:39
Structure to hold driver state.
Definition: netdev.h:364