wifi test
Dependencies: X_NUCLEO_IKS01A2 mbed-http
easy-connect/mcr20a-rf-driver/mcr20a-rf-driver/NanostackRfPhyMcr20a.h@0:24d3eb812fd4, 2018-09-05 (annotated)
- Committer:
- JMF
- Date:
- Wed Sep 05 14:28:24 2018 +0000
- Revision:
- 0:24d3eb812fd4
Initial commit
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| JMF | 0:24d3eb812fd4 | 1 | /* |
| JMF | 0:24d3eb812fd4 | 2 | * Copyright (c) 2014-2015 ARM Limited. All rights reserved. |
| JMF | 0:24d3eb812fd4 | 3 | * SPDX-License-Identifier: Apache-2.0 |
| JMF | 0:24d3eb812fd4 | 4 | * Licensed under the Apache License, Version 2.0 (the License); you may |
| JMF | 0:24d3eb812fd4 | 5 | * not use this file except in compliance with the License. |
| JMF | 0:24d3eb812fd4 | 6 | * You may obtain a copy of the License at |
| JMF | 0:24d3eb812fd4 | 7 | * |
| JMF | 0:24d3eb812fd4 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| JMF | 0:24d3eb812fd4 | 9 | * |
| JMF | 0:24d3eb812fd4 | 10 | * Unless required by applicable law or agreed to in writing, software |
| JMF | 0:24d3eb812fd4 | 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT |
| JMF | 0:24d3eb812fd4 | 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| JMF | 0:24d3eb812fd4 | 13 | * See the License for the specific language governing permissions and |
| JMF | 0:24d3eb812fd4 | 14 | * limitations under the License. |
| JMF | 0:24d3eb812fd4 | 15 | */ |
| JMF | 0:24d3eb812fd4 | 16 | |
| JMF | 0:24d3eb812fd4 | 17 | #ifndef NANOSTACK_PHY_MCR20A_H_ |
| JMF | 0:24d3eb812fd4 | 18 | #define NANOSTACK_PHY_MCR20A_H_ |
| JMF | 0:24d3eb812fd4 | 19 | |
| JMF | 0:24d3eb812fd4 | 20 | #include "mbed.h" |
| JMF | 0:24d3eb812fd4 | 21 | |
| JMF | 0:24d3eb812fd4 | 22 | #ifdef MBED_CONF_NANOSTACK_CONFIGURATION |
| JMF | 0:24d3eb812fd4 | 23 | |
| JMF | 0:24d3eb812fd4 | 24 | #include "NanostackRfPhy.h" |
| JMF | 0:24d3eb812fd4 | 25 | |
| JMF | 0:24d3eb812fd4 | 26 | // Arduino pin defaults for convenience |
| JMF | 0:24d3eb812fd4 | 27 | #if !defined(MCR20A_SPI_MOSI) |
| JMF | 0:24d3eb812fd4 | 28 | #define MCR20A_SPI_MOSI D11 |
| JMF | 0:24d3eb812fd4 | 29 | #endif |
| JMF | 0:24d3eb812fd4 | 30 | #if !defined(MCR20A_SPI_MISO) |
| JMF | 0:24d3eb812fd4 | 31 | #define MCR20A_SPI_MISO D12 |
| JMF | 0:24d3eb812fd4 | 32 | #endif |
| JMF | 0:24d3eb812fd4 | 33 | #if !defined(MCR20A_SPI_SCLK) |
| JMF | 0:24d3eb812fd4 | 34 | #define MCR20A_SPI_SCLK D13 |
| JMF | 0:24d3eb812fd4 | 35 | #endif |
| JMF | 0:24d3eb812fd4 | 36 | #if !defined(MCR20A_SPI_CS) |
| JMF | 0:24d3eb812fd4 | 37 | #define MCR20A_SPI_CS D10 |
| JMF | 0:24d3eb812fd4 | 38 | #endif |
| JMF | 0:24d3eb812fd4 | 39 | #if !defined(MCR20A_SPI_RST) |
| JMF | 0:24d3eb812fd4 | 40 | #define MCR20A_SPI_RST D5 |
| JMF | 0:24d3eb812fd4 | 41 | #endif |
| JMF | 0:24d3eb812fd4 | 42 | #if !defined(MCR20A_SPI_IRQ) |
| JMF | 0:24d3eb812fd4 | 43 | #define MCR20A_SPI_IRQ D2 |
| JMF | 0:24d3eb812fd4 | 44 | #endif |
| JMF | 0:24d3eb812fd4 | 45 | |
| JMF | 0:24d3eb812fd4 | 46 | class NanostackRfPhyMcr20a : public NanostackRfPhy { |
| JMF | 0:24d3eb812fd4 | 47 | public: |
| JMF | 0:24d3eb812fd4 | 48 | NanostackRfPhyMcr20a(PinName spi_mosi, PinName spi_miso, |
| JMF | 0:24d3eb812fd4 | 49 | PinName spi_sclk, PinName spi_cs, PinName spi_rst, |
| JMF | 0:24d3eb812fd4 | 50 | PinName spi_irq); |
| JMF | 0:24d3eb812fd4 | 51 | virtual ~NanostackRfPhyMcr20a(); |
| JMF | 0:24d3eb812fd4 | 52 | virtual int8_t rf_register(); |
| JMF | 0:24d3eb812fd4 | 53 | virtual void rf_unregister(); |
| JMF | 0:24d3eb812fd4 | 54 | virtual void get_mac_address(uint8_t *mac); |
| JMF | 0:24d3eb812fd4 | 55 | virtual void set_mac_address(uint8_t *mac); |
| JMF | 0:24d3eb812fd4 | 56 | |
| JMF | 0:24d3eb812fd4 | 57 | private: |
| JMF | 0:24d3eb812fd4 | 58 | SPI _spi; |
| JMF | 0:24d3eb812fd4 | 59 | DigitalOut _rf_cs; |
| JMF | 0:24d3eb812fd4 | 60 | DigitalOut _rf_rst; |
| JMF | 0:24d3eb812fd4 | 61 | InterruptIn _rf_irq; |
| JMF | 0:24d3eb812fd4 | 62 | DigitalIn _rf_irq_pin; |
| JMF | 0:24d3eb812fd4 | 63 | Thread _irq_thread; |
| JMF | 0:24d3eb812fd4 | 64 | |
| JMF | 0:24d3eb812fd4 | 65 | void _pins_set(); |
| JMF | 0:24d3eb812fd4 | 66 | void _pins_clear(); |
| JMF | 0:24d3eb812fd4 | 67 | }; |
| JMF | 0:24d3eb812fd4 | 68 | |
| JMF | 0:24d3eb812fd4 | 69 | #endif /* MBED_CONF_NANOSTACK_CONFIGURATION */ |
| JMF | 0:24d3eb812fd4 | 70 | #endif /* NANOSTACK_PHY_MCR20A_H_ */ |