Webserver+3d print

Dependents:   Nucleo

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers mrf24wg_driver.h Source File

mrf24wg_driver.h

Go to the documentation of this file.
00001 /**
00002  * @file mrf24wg_driver.h
00003  * @brief MRF24WG Wi-Fi controller
00004  *
00005  * @section License
00006  *
00007  * Copyright (C) 2010-2017 Oryx Embedded SARL. All rights reserved.
00008  *
00009  * This file is part of CycloneTCP Open.
00010  *
00011  * This program is free software; you can redistribute it and/or
00012  * modify it under the terms of the GNU General Public License
00013  * as published by the Free Software Foundation; either version 2
00014  * of the License, or (at your option) any later version.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program; if not, write to the Free Software Foundation,
00023  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00024  *
00025  * @author Oryx Embedded SARL (www.oryx-embedded.com)
00026  * @version 1.7.6
00027  **/
00028 
00029 #ifndef _MRF24WG_DRIVER_H
00030 #define _MRF24WG_DRIVER_H
00031 
00032 //Dependencies
00033 #include "core/nic.h"
00034 
00035 //TX buffer size
00036 #ifndef MRF24WG_TX_BUFFER_SIZE
00037    #define MRF24WG_TX_BUFFER_SIZE 1536
00038 #elif (MRF24WG_TX_BUFFER_SIZE != 1536)
00039    #error MRF24WG_TX_BUFFER_SIZE parameter is not valid
00040 #endif
00041 
00042 //RX buffer size
00043 #ifndef MRF24WG_RX_BUFFER_SIZE
00044    #define MRF24WG_RX_BUFFER_SIZE 1536
00045 #elif (MRF24WG_RX_BUFFER_SIZE != 1536)
00046    #error MRF24WG_RX_BUFFER_SIZE parameter is not valid
00047 #endif
00048 
00049 
00050 /**
00051  * @brief TX buffer
00052  **/
00053 
00054 typedef struct
00055 {
00056    bool_t used;
00057    size_t length;
00058    uint8_t data[MRF24WG_TX_BUFFER_SIZE];
00059 } Mrf24wgBuffer;
00060 
00061 
00062 //MRF24WG driver
00063 extern const NicDriver mrf24wgDriver;
00064 
00065 //MRF24WG related functions
00066 error_t mrf24wgInit(NetInterface *interface);
00067 
00068 void mrf24wgTick(NetInterface *interface);
00069 
00070 void mrf24wgEnableIrq(NetInterface *interface);
00071 void mrf24wgDisableIrq(NetInterface *interface);
00072 void mrf24wgEventHandler(NetInterface *interface);
00073 
00074 error_t mrf24wgSendPacket(NetInterface *interface,
00075    const NetBuffer *buffer, size_t offset);
00076 
00077 error_t mrf24wgSetMulticastFilter(NetInterface *interface);
00078 
00079 void mrf24wgAppWifiEvent(uint8_t msgType, void *msg);
00080 void mrf24wgAppEthEvent(uint8_t msgType, void *msg, void *ctrlBuf);
00081 
00082 #endif
00083