blob: fa1de61fb69bd287bfbbcdf38dab577de08ba463 (
plain)
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
|
#define NET_DEV_NET EOS_PWR_DEV_NET
#define NET_DEV_APP EOS_PWR_DEV_APP
typedef struct NETConfig {
int sleep;
int sleep_req;
int present;
int gpio_mosi;
int gpio_miso;
int gpio_sclk;
int gpio_cs;
int gpio_rts;
int gpio_cts;
uint32_t dev;
spi_host_device_t spi_host;
spi_bus_config_t *spi_bus_cfg;
spi_slave_interface_config_t *spi_iface_cfg;
spi_slave_transaction_t *spi_tr_cfg;
TaskHandle_t xchg_task_handle;
SemaphoreHandle_t mutex;
SemaphoreHandle_t bufq_mutex;
SemaphoreHandle_t bufq_semaph;
EOSBufQ *buf_q;
EOSMsgQ *send_q;
eos_net_handler_t msg_handler;
} NETConfig;
void _eos_net_init_gpio(NETConfig *config);
unsigned char *_eos_net_alloc(NETConfig *config);
void _eos_net_free(NETConfig *config, unsigned char *buf);
int _eos_net_send(NETConfig *config, unsigned char mtype, unsigned char *buffer, uint16_t buf_len);
void _eos_net_sleep_req(NETConfig *config);
void _eos_net_wake(NETConfig *config);
|