-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenc28j60.h
42 lines (32 loc) · 858 Bytes
/
enc28j60.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* enc28j60.h
*
*/
#ifndef ENC28J60_H_
#define ENC28J60_H_
#include <common.h>
#include <stdint.h>
#include <stdbool.h>
#include <lwip/netif.h>
/* Pins */
#define ENC_CS_PORT GPIO_PORTB_BASE
#define ENC_INT_PORT GPIO_PORTE_BASE
//#define ENC_RESET_PORT GPIO_PORTA_BASE
#define ENC_CS GPIO_PIN_5
#define ENC_INT GPIO_PIN_4
//#define ENC_RESET GPIO_PIN_2
err_t enc28j60_init(struct netif *netif);
/**** API ****/
void enc_init(const uint8_t *mac);
/**
* Function which does all the heavy work
* It should be called when the ENC28J60 has signaled an interrupt
*/
void enc_action(struct netif *netif);
/**
* Send an ethernet packet. Function will block until
* transmission has completed.
* TODO: Return if the transmission was successful or not
*/
void enc_send_packet(const uint8_t *buf, uint16_t count);
#endif /* ENC28J60_H_ */