encx24j600.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Kaspar Schleiser <kaspar@schleiser.de>
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser General
5  * Public License v2.1. See the file LICENSE in the top level directory for more
6  * details.
7  */
8 
21 #ifndef ENCX24J600_H
22 #define ENCX24J600_H
23 
24 #include "mutex.h"
25 #include "kernel_types.h"
26 #include "periph/spi.h"
27 #include "periph/gpio.h"
28 #include "net/netdev.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
38 typedef struct {
41  gpio_t cs;
42  gpio_t int_pin;
43  uint16_t rx_next_ptr;
44 } encx24j600_t;
45 
49 typedef struct {
51  gpio_t cs_pin;
52  gpio_t int_pin;
54 
64 void encx24j600_setup(encx24j600_t *dev, const encx24j600_params_t *params);
65 
66 #ifdef __cplusplus
67 }
68 #endif
69 #endif /* ENCX24J600_H */
70 
encx24j600_t::int_pin
gpio_t int_pin
SPI interrupt pin.
Definition: encx24j600.h:42
spi.h
Low-level SPI peripheral driver interface definition.
encx24j600_params_t
Struct containing the needed peripheral configuration.
Definition: encx24j600.h:49
encx24j600_params_t::int_pin
gpio_t int_pin
interrupt pin
Definition: encx24j600.h:52
encx24j600_t
encx24j600 netdev device
Definition: encx24j600.h:38
encx24j600_t::cs
gpio_t cs
SPI chip select pin.
Definition: encx24j600.h:41
encx24j600_t::spi
spi_t spi
SPI device the enc is connected to.
Definition: encx24j600.h:40
encx24j600_t::netdev
netdev_t netdev
extended netdev structure
Definition: encx24j600.h:39
encx24j600_params_t::spi
spi_t spi
SPI line.
Definition: encx24j600.h:50
netdev.h
Definitions low-level network driver interface.
encx24j600_t::rx_next_ptr
uint16_t rx_next_ptr
ptr to next packet within devices memory
Definition: encx24j600.h:43
encx24j600_setup
void encx24j600_setup(encx24j600_t *dev, const encx24j600_params_t *params)
Setup an encx24j600 based device state.
encx24j600_params_t::cs_pin
gpio_t cs_pin
chip select pin
Definition: encx24j600.h:51
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.
kernel_types.h
Types used by the kernel.
spi_t
unsigned int spi_t
Default type for SPI devices.
Definition: spi.h:118