w5500.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2023 Stefan Schmidt
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 
36 #include <stdint.h>
37 
38 #include "periph/spi.h"
39 #include "periph/gpio.h"
40 #include "net/netdev.h"
41 #include "kernel_defines.h"
42 #include "ztimer.h"
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
51 typedef struct {
52  spi_t spi;
54  gpio_t cs;
55  gpio_t irq;
58 
62 typedef struct w5500 {
65  uint16_t frame_size;
66  bool link_up;
67  bool frame_sent;
70 
82 void w5500_setup(w5500_t *dev, const w5500_params_t *params, uint8_t index);
83 
84 #ifdef __cplusplus
85 }
86 #endif
87 
spi_clk_t
Definition: periph_cpu.h:351
Definitions low-level network driver interface.
Low-level GPIO peripheral driver interface definitions.
void w5500_setup(w5500_t *dev, const w5500_params_t *params, uint8_t index)
So the initial device setup.
struct w5500 w5500_t
Device descriptor for W5500 devices.
Common macros and compiler attributes/pragmas configuration.
Low-level SPI peripheral driver interface definition.
Structure to hold driver state.
Definition: netdev.h:364
W5500 device descriptor.
Definition: w5500.h:51
gpio_t cs
pin connected to the chip select line
Definition: w5500.h:54
uint32_t polling_interval_ms
interval for polling, 0 if interrupt mode
Definition: w5500.h:56
gpio_t irq
pin connected to the INT line
Definition: w5500.h:55
spi_t spi
SPI bus used.
Definition: w5500.h:52
spi_clk_t clk
clock speed used on the selected SPI bus
Definition: w5500.h:53
Device descriptor for W5500 devices.
Definition: w5500.h:62
w5500_params_t p
device configuration parameters
Definition: w5500.h:64
bool link_up
used to prevent sending the same LINK event twice
Definition: w5500.h:66
bool frame_sent
indicates that the frame has been transmitted
Definition: w5500.h:67
netdev_t netdev
extends the netdev structure
Definition: w5500.h:63
uint16_t frame_size
size of the frame which has been send
Definition: w5500.h:65
ztimer_t timerInstance
stores the polling interval timer in polling mode
Definition: w5500.h:68
ztimer structure
Definition: ztimer.h:319
ztimer API