Fork of my MQTTGateway

Dependencies:   mbed-http

Committer:
vpcola
Date:
Sat Apr 08 14:45:51 2017 +0000
Revision:
0:f1d3878b8dd9
Initial commit

Who changed what in which revision?

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