Fork of my original MQTTGateway

Dependencies:   mbed-http

Committer:
vpcola
Date:
Sat Apr 08 14:43:14 2017 +0000
Revision:
0:a1734fe1ec4b
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
vpcola 0:a1734fe1ec4b 1 #ifndef NANOSTACK_RF_PHY_SPIRIT1_H_
vpcola 0:a1734fe1ec4b 2 #define NANOSTACK_RF_PHY_SPIRIT1_H_
vpcola 0:a1734fe1ec4b 3
vpcola 0:a1734fe1ec4b 4 #include <stdint.h>
vpcola 0:a1734fe1ec4b 5
vpcola 0:a1734fe1ec4b 6 #include "NanostackRfPhy.h"
vpcola 0:a1734fe1ec4b 7 #include "PinNames.h"
vpcola 0:a1734fe1ec4b 8
vpcola 0:a1734fe1ec4b 9 // Arduino pin defaults for convenience
vpcola 0:a1734fe1ec4b 10 #if !defined(SPIRIT1_SPI_MOSI)
vpcola 0:a1734fe1ec4b 11 #define SPIRIT1_SPI_MOSI D11
vpcola 0:a1734fe1ec4b 12 #endif
vpcola 0:a1734fe1ec4b 13 #if !defined(SPIRIT1_SPI_MISO)
vpcola 0:a1734fe1ec4b 14 #define SPIRIT1_SPI_MISO D12
vpcola 0:a1734fe1ec4b 15 #endif
vpcola 0:a1734fe1ec4b 16 #if !defined(SPIRIT1_SPI_SCLK)
vpcola 0:a1734fe1ec4b 17 #define SPIRIT1_SPI_SCLK D13
vpcola 0:a1734fe1ec4b 18 #endif
vpcola 0:a1734fe1ec4b 19 #if !defined(SPIRIT1_DEV_IRQ)
vpcola 0:a1734fe1ec4b 20 #define SPIRIT1_DEV_IRQ D9
vpcola 0:a1734fe1ec4b 21 #endif
vpcola 0:a1734fe1ec4b 22 #if !defined(SPIRIT1_DEV_CS)
vpcola 0:a1734fe1ec4b 23 #define SPIRIT1_DEV_CS D10
vpcola 0:a1734fe1ec4b 24 #endif
vpcola 0:a1734fe1ec4b 25 #if !defined(SPIRIT1_DEV_SDN)
vpcola 0:a1734fe1ec4b 26 #define SPIRIT1_DEV_SDN D2
vpcola 0:a1734fe1ec4b 27 #endif
vpcola 0:a1734fe1ec4b 28 #if !defined(SPIRIT1_BRD_LED)
vpcola 0:a1734fe1ec4b 29 #define SPIRIT1_BRD_LED NC
vpcola 0:a1734fe1ec4b 30 #endif
vpcola 0:a1734fe1ec4b 31
vpcola 0:a1734fe1ec4b 32 class NanostackRfPhySpirit1 : public NanostackRfPhy {
vpcola 0:a1734fe1ec4b 33 public:
vpcola 0:a1734fe1ec4b 34 NanostackRfPhySpirit1(PinName spi_mosi, PinName spi_miso, PinName spi_sclk,
vpcola 0:a1734fe1ec4b 35 PinName dev_irq, PinName dev_cs, PinName dev_sdn, PinName brd_led);
vpcola 0:a1734fe1ec4b 36 ~NanostackRfPhySpirit1();
vpcola 0:a1734fe1ec4b 37 int8_t rf_register();
vpcola 0:a1734fe1ec4b 38 void rf_unregister();
vpcola 0:a1734fe1ec4b 39 void get_mac_address(uint8_t *mac);
vpcola 0:a1734fe1ec4b 40 void set_mac_address(uint8_t *mac);
vpcola 0:a1734fe1ec4b 41
vpcola 0:a1734fe1ec4b 42 private:
vpcola 0:a1734fe1ec4b 43 void rf_init(void);
vpcola 0:a1734fe1ec4b 44
vpcola 0:a1734fe1ec4b 45 const PinName _spi_mosi;
vpcola 0:a1734fe1ec4b 46 const PinName _spi_miso;
vpcola 0:a1734fe1ec4b 47 const PinName _spi_sclk;
vpcola 0:a1734fe1ec4b 48 const PinName _dev_irq;
vpcola 0:a1734fe1ec4b 49 const PinName _dev_cs;
vpcola 0:a1734fe1ec4b 50 const PinName _dev_sdn;
vpcola 0:a1734fe1ec4b 51 const PinName _brd_led;
vpcola 0:a1734fe1ec4b 52 };
vpcola 0:a1734fe1ec4b 53
vpcola 0:a1734fe1ec4b 54 #endif /* NANOSTACK_RF_PHY_SPIRIT1_H_ */