NetBurner 3.0
nbWicedSPI.h
Go to the documentation of this file.
1 /*NB_REVISION*/
2 
3 /*NB_COPYRIGHT*/
4 
9 #ifndef __NBWICEDSPI_H
10 #define __NBWICEDSPI_H
11 
12 #include <buffers.h>
13 #include <nettypes.h>
14 #include <netinterface.h>
15 #include <constants.h>
16 #include <utils.h>
18 
19 namespace NBWifi {
20 namespace Broadcom {
21 
22 class SPIMaster : public WICED
23 {
24  enum BusDirection {
25  MASTER_RX = 0x0,
26  MASTER_TX = 0x1,
27  };
28  int m_moduleNum; // Select SPI for platforms with multiple SPI
29  int m_csNum; // SPI chip select, or -1 to use a GPIO as a chip select
30  int m_IRQNum; // IRQ number/priority
31  int m_csConnector; // Connector containing the chip select
32  int m_gpioPinNum; // Used only if a GPIO signal is used for SPI chip select
33  OS_SEM BusTransferSem;
34  OS_SEM SlaveReadySem;
35 
36  static void ISR_0();
37  static void ISR_1();
38 
39  void RXTask() override;
40  virtual void SendBusMessage_Core( PoolPtr txMessage ) override;
41  virtual void TransmitBuffer_Core( PoolPtr txBuffer, uint8_t credits ) override;
42 
43  friend class Master;
44  friend class WICED;
45 
46  public:
47 
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 
58  void SendCreditRequest() override;
59  void SendCreditReport( uint8_t credits = 0xFF ) override;
60  virtual bool SetBusSpeed( uint32_t busSpeed ) override;
61  SPIMaster( int irqNum, int moduleNum, int csNum, int connectorNum, int csGpioPinNum, int resetPinNum, const char * name );
62 };
63 
64 }
65 }
66 
67 #endif /* ----- #ifndef __NBWICEDSPI_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
NetBurner Buffers API.