mrf24wg_driver.h
Go to the documentation of this file.
1 /**
2  * @file mrf24wg_driver.h
3  * @brief MRF24WG Wi-Fi controller
4  *
5  * @section License
6  *
7  * Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.
8  *
9  * This file is part of CycloneTCP Open.
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software Foundation,
23  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24  *
25  * @author Oryx Embedded SARL (www.oryx-embedded.com)
26  * @version 1.9.0
27  **/
28 
29 #ifndef _MRF24WG_DRIVER_H
30 #define _MRF24WG_DRIVER_H
31 
32 //Dependencies
33 #include "core/nic.h"
34 
35 //TX buffer size
36 #ifndef MRF24WG_TX_BUFFER_SIZE
37  #define MRF24WG_TX_BUFFER_SIZE 1536
38 #elif (MRF24WG_TX_BUFFER_SIZE != 1536)
39  #error MRF24WG_TX_BUFFER_SIZE parameter is not valid
40 #endif
41 
42 //RX buffer size
43 #ifndef MRF24WG_RX_BUFFER_SIZE
44  #define MRF24WG_RX_BUFFER_SIZE 1536
45 #elif (MRF24WG_RX_BUFFER_SIZE != 1536)
46  #error MRF24WG_RX_BUFFER_SIZE parameter is not valid
47 #endif
48 
49 //C++ guard
50 #ifdef __cplusplus
51  extern "C" {
52 #endif
53 
54 
55 /**
56  * @brief TX buffer
57  **/
58 
59 typedef struct
60 {
62  size_t length;
65 
66 
67 //MRF24WG driver
68 extern const NicDriver mrf24wgDriver;
69 
70 //MRF24WG related functions
71 error_t mrf24wgInit(NetInterface *interface);
72 
73 void mrf24wgTick(NetInterface *interface);
74 
75 void mrf24wgEnableIrq(NetInterface *interface);
76 void mrf24wgDisableIrq(NetInterface *interface);
77 void mrf24wgEventHandler(NetInterface *interface);
78 
80  const NetBuffer *buffer, size_t offset);
81 
83 
84 void mrf24wgAppWifiEvent(uint8_t msgType, void *msg);
85 void mrf24wgAppEthEvent(uint8_t msgType, void *msg, void *ctrlBuf);
86 
87 //C++ guard
88 #ifdef __cplusplus
89  }
90 #endif
91 
92 #endif
void mrf24wgEnableIrq(NetInterface *interface)
Enable interrupts.
const NicDriver mrf24wgDriver
MRF24WG driver.
void mrf24wgAppEthEvent(uint8_t msgType, void *msg, void *ctrlBuf)
error_t mrf24wgSendPacket(NetInterface *interface, const NetBuffer *buffer, size_t offset)
Send a packet.
#define MRF24WG_TX_BUFFER_SIZE
error_t mrf24wgInit(NetInterface *interface)
MRF24WG initialization.
void mrf24wgTick(NetInterface *interface)
MRF24WG timer handler.
NIC driver.
Definition: nic.h:161
Structure describing a buffer that spans multiple chunks.
Definition: net_mem.h:86
void mrf24wgDisableIrq(NetInterface *interface)
Disable interrupts.
void mrf24wgEventHandler(NetInterface *interface)
MRF24WG event handler.
TX buffer.
void mrf24wgAppWifiEvent(uint8_t msgType, void *msg)
error_t
Error codes.
Definition: error.h:40
uint8_t data[]
Definition: dtls_misc.h:167
#define NetInterface
Definition: net.h:34
error_t mrf24wgUpdateMacAddrFilter(NetInterface *interface)
Configure MAC address filtering.
uint8_t msgType
Definition: dtls_misc.h:177
int bool_t
Definition: compiler_port.h:47
Network interface controller abstraction layer.