센서보드 RF IRQ 테스트 중 and bug fix?
Fork of EV-COG-AD3029LZ by
stm-spirit1-rf-driver/NanostackRfPhySpirit1.h@85:38de5ee78824, 2018-09-20 (annotated)
- Committer:
- jmhong
- Date:
- Thu Sep 20 06:34:33 2018 +0000
- Revision:
- 85:38de5ee78824
- Parent:
- 76:f4f990741baf
bug fix?
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Wolfgang Betz |
38:5deec3ab2025 | 1 | #ifndef NANOSTACK_RF_PHY_SPIRIT1_H_ |
Wolfgang Betz |
38:5deec3ab2025 | 2 | #define NANOSTACK_RF_PHY_SPIRIT1_H_ |
Wolfgang Betz |
38:5deec3ab2025 | 3 | |
Wolfgang Betz |
38:5deec3ab2025 | 4 | #include <stdint.h> |
Wolfgang Betz |
38:5deec3ab2025 | 5 | |
Seppo Takalo |
76:f4f990741baf | 6 | #ifdef MBED_CONF_NANOSTACK_CONFIGURATION |
Seppo Takalo |
76:f4f990741baf | 7 | |
Wolfgang Betz |
38:5deec3ab2025 | 8 | #include "NanostackRfPhy.h" |
Wolfgang Betz |
38:5deec3ab2025 | 9 | #include "PinNames.h" |
Wolfgang Betz |
38:5deec3ab2025 | 10 | |
Wolfgang Betz |
38:5deec3ab2025 | 11 | // Arduino pin defaults for convenience |
Wolfgang Betz |
38:5deec3ab2025 | 12 | #if !defined(SPIRIT1_SPI_MOSI) |
Wolfgang Betz |
38:5deec3ab2025 | 13 | #define SPIRIT1_SPI_MOSI D11 |
Wolfgang Betz |
38:5deec3ab2025 | 14 | #endif |
Wolfgang Betz |
38:5deec3ab2025 | 15 | #if !defined(SPIRIT1_SPI_MISO) |
Wolfgang Betz |
38:5deec3ab2025 | 16 | #define SPIRIT1_SPI_MISO D12 |
Wolfgang Betz |
38:5deec3ab2025 | 17 | #endif |
Wolfgang Betz |
38:5deec3ab2025 | 18 | #if !defined(SPIRIT1_SPI_SCLK) |
Wolfgang Betz |
38:5deec3ab2025 | 19 | #define SPIRIT1_SPI_SCLK D13 |
Wolfgang Betz |
38:5deec3ab2025 | 20 | #endif |
Wolfgang Betz |
38:5deec3ab2025 | 21 | #if !defined(SPIRIT1_DEV_IRQ) |
Wolfgang Betz |
38:5deec3ab2025 | 22 | #define SPIRIT1_DEV_IRQ D9 |
Wolfgang Betz |
38:5deec3ab2025 | 23 | #endif |
Wolfgang Betz |
38:5deec3ab2025 | 24 | #if !defined(SPIRIT1_DEV_CS) |
Wolfgang Betz |
38:5deec3ab2025 | 25 | #define SPIRIT1_DEV_CS D10 |
Wolfgang Betz |
38:5deec3ab2025 | 26 | #endif |
Wolfgang Betz |
38:5deec3ab2025 | 27 | #if !defined(SPIRIT1_DEV_SDN) |
Wolfgang Betz |
38:5deec3ab2025 | 28 | #define SPIRIT1_DEV_SDN D2 |
Wolfgang Betz |
38:5deec3ab2025 | 29 | #endif |
Wolfgang Betz |
38:5deec3ab2025 | 30 | #if !defined(SPIRIT1_BRD_LED) |
Wolfgang Betz |
38:5deec3ab2025 | 31 | #define SPIRIT1_BRD_LED NC |
Wolfgang Betz |
38:5deec3ab2025 | 32 | #endif |
Wolfgang Betz |
38:5deec3ab2025 | 33 | |
Wolfgang Betz |
38:5deec3ab2025 | 34 | class NanostackRfPhySpirit1 : public NanostackRfPhy { |
Wolfgang Betz |
38:5deec3ab2025 | 35 | public: |
Wolfgang Betz |
38:5deec3ab2025 | 36 | NanostackRfPhySpirit1(PinName spi_mosi, PinName spi_miso, PinName spi_sclk, |
Wolfgang Betz |
38:5deec3ab2025 | 37 | PinName dev_irq, PinName dev_cs, PinName dev_sdn, PinName brd_led); |
Wolfgang Betz |
38:5deec3ab2025 | 38 | ~NanostackRfPhySpirit1(); |
Wolfgang Betz |
38:5deec3ab2025 | 39 | int8_t rf_register(); |
Wolfgang Betz |
38:5deec3ab2025 | 40 | void rf_unregister(); |
Wolfgang Betz |
38:5deec3ab2025 | 41 | void get_mac_address(uint8_t *mac); |
Wolfgang Betz |
38:5deec3ab2025 | 42 | void set_mac_address(uint8_t *mac); |
Wolfgang Betz |
38:5deec3ab2025 | 43 | |
Wolfgang Betz |
38:5deec3ab2025 | 44 | private: |
Wolfgang Betz |
38:5deec3ab2025 | 45 | void rf_init(void); |
Wolfgang Betz |
38:5deec3ab2025 | 46 | |
Wolfgang Betz |
38:5deec3ab2025 | 47 | const PinName _spi_mosi; |
Wolfgang Betz |
38:5deec3ab2025 | 48 | const PinName _spi_miso; |
Wolfgang Betz |
38:5deec3ab2025 | 49 | const PinName _spi_sclk; |
Wolfgang Betz |
38:5deec3ab2025 | 50 | const PinName _dev_irq; |
Wolfgang Betz |
38:5deec3ab2025 | 51 | const PinName _dev_cs; |
Wolfgang Betz |
38:5deec3ab2025 | 52 | const PinName _dev_sdn; |
Wolfgang Betz |
38:5deec3ab2025 | 53 | const PinName _brd_led; |
Wolfgang Betz |
38:5deec3ab2025 | 54 | }; |
Wolfgang Betz |
38:5deec3ab2025 | 55 | |
Seppo Takalo |
76:f4f990741baf | 56 | #endif /* MBED_CONF_NANOSTACK_CONFIGURATION */ |
Wolfgang Betz |
38:5deec3ab2025 | 57 | #endif /* NANOSTACK_RF_PHY_SPIRIT1_H_ */ |