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