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 
21 #ifndef ENC28J60_H
22 #define ENC28J60_H
23 
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 {
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 
69 #endif /* ENC28J60_H */
70 
enc28j60_t::netdev
netdev_t netdev
pull in the netdev fields
Definition: enc28j60.h:49
enc28j60_params_t::int_pin
gpio_t int_pin
I will be most certainly.
Definition: enc28j60.h:41
spi.h
Low-level SPI peripheral driver interface definition.
enc28j60_t::p
enc28j60_params_t p
SPI and pin confiuration.
Definition: enc28j60.h:50
enc28j60_t::tx_time
uint32_t tx_time
last transmission time for timeout handling
Definition: enc28j60.h:52
enc28j60_params_t::rst_pin
gpio_t rst_pin
drunk in the morning?!
Definition: enc28j60.h:42
netdev.h
Definitions low-level network driver interface.
netdev
Structure to hold driver state.
Definition: netdev.h:302
mutex.h
Mutex for thread synchronization.
gpio.h
Low-level GPIO peripheral driver interface definitions.
enc28j60_params_t
Struct containing the needed peripheral configuration.
Definition: enc28j60.h:38
enc28j60_t::lock
mutex_t lock
lock the device on access
Definition: enc28j60.h:51
enc28j60_setup
void enc28j60_setup(enc28j60_t *dev, const enc28j60_params_t *params, uint8_t index)
Ready the device for initialization through it's netdev interface.
enc28j60_params_t::cs_pin
gpio_t cs_pin
beer in the evening,
Definition: enc28j60.h:40
mutex_t
Mutex structure.
Definition: mutex.h:120
spi_t
unsigned int spi_t
Default type for SPI devices.
Definition: spi.h:118
enc28j60_params_t::spi
spi_t spi
If I drink.
Definition: enc28j60.h:39
enc28j60_t
ENC28J60 device descriptor.
Definition: enc28j60.h:48