NetBurner 3.5.8
PDF Version
Toggle main menu visibility
nbWifiSpi.h
1
/*NB_REVISION*/
2
3
/*NB_COPYRIGHT*/
4
8
9
#ifndef __NBWIFISPI_H
10
#define __NBWIFISPI_H
11
12
#include <buffers.h>
13
#include <nettypes.h>
14
#include <netinterface.h>
15
#include <constants.h>
16
#include <utils.h>
17
#include <wifi/nbwifi/nbWifiDriver.h>
18
19
namespace
NB
20
{
21
22
class
NBWifiSPI :
public
NBWifi
23
{
24
enum
BusDirection
25
{
26
MASTER_RX = 0x0,
27
MASTER_TX = 0x1,
28
};
29
int
m_moduleNum;
// Select SPI for platforms with multiple SPI
30
int
m_csNum;
// SPI chip select, or -1 to use a GPIO as a chip select
31
int
m_IRQNum;
// IRQ number/priority
32
int
m_csConnector;
// Connector containing the chip select
33
int
m_gpioPinNum;
// Used only if a GPIO signal is used for SPI chip select
34
OS_SEM BusTransferSem;
35
OS_SEM SlaveReadySem;
36
37
static
void
ISR_0();
38
static
void
ISR_1();
39
40
void
RXTask()
override
;
41
virtual
void
SendBusMessage_Core(PoolPtr txMessage)
override
;
42
virtual
void
TransmitBuffer_Core(PoolPtr txBuffer, uint8_t credits)
override
;
43
44
friend
class
Wifi;
45
friend
class
NBWifi;
46
47
public
:
48
/* InterfaceBlock virtual functions */
49
void
send_func(PoolPtr poolPtr)
override
;
50
void
kill_if()
override
;
51
void
EnableMulticast
(MACADR macAddress, BOOL addAddress)
override
;
52
bool
LinkActive
()
override
;
53
int
LinkSpeed
()
override
;
54
bool
LinkDuplex
()
override
;
55
const
char
*
GetInterfaceName
()
override
;
56
57
void
SendCreditRequest()
override
;
58
void
SendCreditReport(uint8_t credits = 0xFF)
override
;
59
virtual
bool
SetBusSpeed(uint32_t busSpeed)
override
;
60
NBWifiSPI(
int
irqNum,
int
moduleNum,
int
csNum,
int
connectorNum,
int
csGpioPinNum,
int
resetPinNum,
const
char
*name);
61
};
62
63
}
// namespace NB
64
65
#endif
/* ----- #ifndef __NBWIFISPI_H ----- */
InterfaceBlock::GetInterfaceName
virtual const char * GetInterfaceName()
Returns the interface name network interface.
InterfaceBlock::LinkDuplex
virtual bool LinkDuplex()=0
Returns the full or half link duplex of the network interface.
InterfaceBlock::LinkActive
virtual bool LinkActive()=0
Returns the link status of the network interface.
InterfaceBlock::LinkSpeed
virtual int LinkSpeed()=0
Returns the link speed of the network interface.
EnableMulticast
void EnableMulticast(MACADR macAddress, int interface=0)
Enable Multicast on an existing interface.
libraries
include
wifi
nbwifi
nbWifiSpi.h
Generated by
1.18.0