wilc1000_driver.h
Go to the documentation of this file.
1 /**
2  * @file wilc1000_driver.h
3  * @brief WILC1000 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 _WILC1000_DRIVER_H
32 #define _WILC1000_DRIVER_H
33 
34 //Dependencies
35 #include "core/nic.h"
36 
37 //TX buffer size
38 #ifndef WILC1000_TX_BUFFER_SIZE
39  #define WILC1000_TX_BUFFER_SIZE 1600
40 #elif (WILC1000_TX_BUFFER_SIZE != 1600)
41  #error WILC1000_TX_BUFFER_SIZE parameter is not valid
42 #endif
43 
44 //RX buffer size
45 #ifndef WILC1000_RX_BUFFER_SIZE
46  #define WILC1000_RX_BUFFER_SIZE 1600
47 #elif (WILC1000_RX_BUFFER_SIZE != 1600)
48  #error WILC1000_RX_BUFFER_SIZE parameter is not valid
49 #endif
50 
51 //C++ guard
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
56 //WILC1000 driver (STA mode)
57 extern const NicDriver wilc1000StaDriver;
58 //WILC1000 driver (AP mode)
59 extern const NicDriver wilc1000ApDriver;
60 
61 //WILC1000 related functions
63 
64 void wilc1000Tick(NetInterface *interface);
65 
66 void wilc1000EnableIrq(NetInterface *interface);
67 void wilc1000DisableIrq(NetInterface *interface);
69 void wilc1000EventHandler(NetInterface *interface);
70 
72  const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary);
73 
75 bool_t wilc1000GetAddrRefCount(NetInterface *interface, const MacAddr *macAddr);
76 
77 void wilc1000AppWifiEvent(uint8_t msgType, void *msg);
78 void wilc1000AppEthEvent(uint8_t msgType, void *msg, void *ctrlBuf);
79 
80 //C++ guard
81 #ifdef __cplusplus
82 }
83 #endif
84 
85 #endif
int bool_t
Definition: compiler_port.h:53
Structure describing a buffer that spans multiple chunks.
Definition: net_mem.h:89
void wilc1000EventHandler(NetInterface *interface)
WILC1000 event handler.
void wilc1000AppWifiEvent(uint8_t msgType, void *msg)
Callback function that handles Wi-Fi events.
void wilc1000EnableIrq(NetInterface *interface)
Enable interrupts.
bool_t wilc1000GetAddrRefCount(NetInterface *interface, const MacAddr *macAddr)
Get reference count for the specified multicast MAC address.
void wilc1000Tick(NetInterface *interface)
WILC1000 timer handler.
error_t wilc1000UpdateMacAddrFilter(NetInterface *interface)
Configure MAC address filtering.
void wilc1000DisableIrq(NetInterface *interface)
Disable interrupts.
const NicDriver wilc1000StaDriver
WILC1000 driver (STA mode)
error_t
Error codes.
Definition: error.h:43
#define NetInterface
Definition: net.h:36
#define NetTxAncillary
Definition: net_misc.h:36
const NicDriver wilc1000ApDriver
WILC1000 driver (AP mode)
error_t wilc1000SendPacket(NetInterface *interface, const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
Send a packet.
MacAddr
Definition: ethernet.h:195
void wilc1000AppEthEvent(uint8_t msgType, void *msg, void *ctrlBuf)
Callback function that handles events in bypass mode.
uint8_t msgType
Network interface controller abstraction layer.
bool_t wilc1000IrqHandler(void)
WILC1000 interrupt service routine.
NIC driver.
Definition: nic.h:286
error_t wilc1000Init(NetInterface *interface)
WILC1000 initialization.