센서보드 RF IRQ 테스트 중
Fork of stm-spirit1-rf-driver by
stm-spirit1-rf-driver/NanostackRfPhySpirit1.h@54:0f6612d36a29, 2017-03-07 (annotated)
- Committer:
- Wolfgang Betz
- Date:
- Tue Mar 07 08:34:31 2017 +0100
- Revision:
- 54:0f6612d36a29
- Parent:
- 41:ebaceefad0de
- Child:
- 76:f4f990741baf
Use macro `SPIRIT1_SPI_MOSI=PB_5` for pin mods
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 | |
Wolfgang Betz |
38:5deec3ab2025 | 6 | #include "NanostackRfPhy.h" |
Wolfgang Betz |
38:5deec3ab2025 | 7 | #include "PinNames.h" |
Wolfgang Betz |
38:5deec3ab2025 | 8 | |
Wolfgang Betz |
38:5deec3ab2025 | 9 | // Arduino pin defaults for convenience |
Wolfgang Betz |
38:5deec3ab2025 | 10 | #if !defined(SPIRIT1_SPI_MOSI) |
Wolfgang Betz |
38:5deec3ab2025 | 11 | #define SPIRIT1_SPI_MOSI D11 |
Wolfgang Betz |
38:5deec3ab2025 | 12 | #endif |
Wolfgang Betz |
38:5deec3ab2025 | 13 | #if !defined(SPIRIT1_SPI_MISO) |
Wolfgang Betz |
38:5deec3ab2025 | 14 | #define SPIRIT1_SPI_MISO D12 |
Wolfgang Betz |
38:5deec3ab2025 | 15 | #endif |
Wolfgang Betz |
38:5deec3ab2025 | 16 | #if !defined(SPIRIT1_SPI_SCLK) |
Wolfgang Betz |
38:5deec3ab2025 | 17 | #define SPIRIT1_SPI_SCLK D13 |
Wolfgang Betz |
38:5deec3ab2025 | 18 | #endif |
Wolfgang Betz |
38:5deec3ab2025 | 19 | #if !defined(SPIRIT1_DEV_IRQ) |
Wolfgang Betz |
38:5deec3ab2025 | 20 | #define SPIRIT1_DEV_IRQ D9 |
Wolfgang Betz |
38:5deec3ab2025 | 21 | #endif |
Wolfgang Betz |
38:5deec3ab2025 | 22 | #if !defined(SPIRIT1_DEV_CS) |
Wolfgang Betz |
38:5deec3ab2025 | 23 | #define SPIRIT1_DEV_CS D10 |
Wolfgang Betz |
38:5deec3ab2025 | 24 | #endif |
Wolfgang Betz |
38:5deec3ab2025 | 25 | #if !defined(SPIRIT1_DEV_SDN) |
Wolfgang Betz |
38:5deec3ab2025 | 26 | #define SPIRIT1_DEV_SDN D2 |
Wolfgang Betz |
38:5deec3ab2025 | 27 | #endif |
Wolfgang Betz |
38:5deec3ab2025 | 28 | #if !defined(SPIRIT1_BRD_LED) |
Wolfgang Betz |
38:5deec3ab2025 | 29 | #define SPIRIT1_BRD_LED NC |
Wolfgang Betz |
38:5deec3ab2025 | 30 | #endif |
Wolfgang Betz |
38:5deec3ab2025 | 31 | |
Wolfgang Betz |
38:5deec3ab2025 | 32 | class NanostackRfPhySpirit1 : public NanostackRfPhy { |
Wolfgang Betz |
38:5deec3ab2025 | 33 | public: |
Wolfgang Betz |
38:5deec3ab2025 | 34 | NanostackRfPhySpirit1(PinName spi_mosi, PinName spi_miso, PinName spi_sclk, |
Wolfgang Betz |
38:5deec3ab2025 | 35 | PinName dev_irq, PinName dev_cs, PinName dev_sdn, PinName brd_led); |
Wolfgang Betz |
38:5deec3ab2025 | 36 | ~NanostackRfPhySpirit1(); |
Wolfgang Betz |
38:5deec3ab2025 | 37 | int8_t rf_register(); |
Wolfgang Betz |
38:5deec3ab2025 | 38 | void rf_unregister(); |
Wolfgang Betz |
38:5deec3ab2025 | 39 | void get_mac_address(uint8_t *mac); |
Wolfgang Betz |
38:5deec3ab2025 | 40 | void set_mac_address(uint8_t *mac); |
Wolfgang Betz |
38:5deec3ab2025 | 41 | |
Wolfgang Betz |
38:5deec3ab2025 | 42 | private: |
Wolfgang Betz |
38:5deec3ab2025 | 43 | void rf_init(void); |
Wolfgang Betz |
38:5deec3ab2025 | 44 | |
Wolfgang Betz |
38:5deec3ab2025 | 45 | const PinName _spi_mosi; |
Wolfgang Betz |
38:5deec3ab2025 | 46 | const PinName _spi_miso; |
Wolfgang Betz |
38:5deec3ab2025 | 47 | const PinName _spi_sclk; |
Wolfgang Betz |
38:5deec3ab2025 | 48 | const PinName _dev_irq; |
Wolfgang Betz |
38:5deec3ab2025 | 49 | const PinName _dev_cs; |
Wolfgang Betz |
38:5deec3ab2025 | 50 | const PinName _dev_sdn; |
Wolfgang Betz |
38:5deec3ab2025 | 51 | const PinName _brd_led; |
Wolfgang Betz |
38:5deec3ab2025 | 52 | }; |
Wolfgang Betz |
38:5deec3ab2025 | 53 | |
Wolfgang Betz |
38:5deec3ab2025 | 54 | #endif /* NANOSTACK_RF_PHY_SPIRIT1_H_ */ |