NetBurner 3.0
NBWilcSPI.h
Go to the documentation of this file.
1 /*NB_REVISION*/
2 
3 /*NB_COPYRIGHT*/
4 
9 #ifndef __NBWILCSPI_H
10 #define __NBWILCSPI_H
11 
12 #include <buffers.h>
13 #include <nettypes.h>
14 #include <netinterface.h>
15 #include <constants.h>
16 #include <utils.h>
18 #include <nbwifi/wilc/ConfigNBWIFIAT.h>
19 #include <nbwifi/nbWifiBSP.h>
20 
21 extern NBWifi::Master * theWifiIntf;
22 
23 namespace NBWifi
24 {
25  namespace Atmel
26  {
27  class SPIMaster : public WILC1000
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 
36  static void ISR_0();
37  static void ISR_1();
38 
39  void WifiTask() override;
40 
41  friend class WILC1000;
42  friend class Master;
43 
44  public:
45 
46  /* InterfaceBlock virtual functions */
47  void send_func( PoolPtr poolPtr ) override;
48  void kill_if() override;
49  void EnableMulticast( MACADR macAddress, BOOL addAddress ) override;
50  bool LinkActive() override;
51  int LinkSpeed() override;
52  bool LinkDuplex() override;
53  const char* GetInterfaceName() override;
54 
55  bool SetBusSpeed( uint32_t busSpeed ) override;
56  SPIMaster( int irqNum, int moduleNum, uint8_t csNum, int connectorNum, int csGpioPinNum, int resetPinNum, const char * name);
57  inline int GetModuleNum() const {return m_moduleNum;};
58  inline OS_SEM * GetBusTransferSem() {return &BusTransferSem;};
59  inline OS_CRIT * GetBusTransferCrit() {return &busTxCrit;};
60 
61  };
62 
63  } //namespace ATMEL
64 } //namespace NBWifi
65 
66 #endif /* ----- #ifndef __NBWILCSPI_H ----- */
Semaphores are used to control access to shared resource critical section, or to communicate between ...
Definition: nbrtos.h:289
NetBurner System Constants.
NBWifi namespace that encompaces the WiFi driver.
Definition: nbWifiBsp.h:15
An OS_CRIT object is used to establish critical sections of code that can only be run by one task at ...
Definition: nbrtos.h:840
NetBurner Buffers API.