wifi test
Dependencies: X_NUCLEO_IKS01A2 mbed-http
easy-connect/atmel-rf-driver/atmel-rf-driver/NanostackRfPhyAtmel.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_RF_PHY_ATMEL_H_ |
| JMF | 0:24d3eb812fd4 | 18 | #define NANOSTACK_RF_PHY_ATMEL_H_ |
| JMF | 0:24d3eb812fd4 | 19 | |
| JMF | 0:24d3eb812fd4 | 20 | #include "at24mac.h" |
| JMF | 0:24d3eb812fd4 | 21 | #include "PinNames.h" |
| JMF | 0:24d3eb812fd4 | 22 | |
| JMF | 0:24d3eb812fd4 | 23 | #ifdef MBED_CONF_NANOSTACK_CONFIGURATION |
| JMF | 0:24d3eb812fd4 | 24 | |
| JMF | 0:24d3eb812fd4 | 25 | #include "NanostackRfPhy.h" |
| JMF | 0:24d3eb812fd4 | 26 | |
| JMF | 0:24d3eb812fd4 | 27 | // Arduino pin defaults for convenience |
| JMF | 0:24d3eb812fd4 | 28 | #if !defined(ATMEL_SPI_MOSI) |
| JMF | 0:24d3eb812fd4 | 29 | #define ATMEL_SPI_MOSI D11 |
| JMF | 0:24d3eb812fd4 | 30 | #endif |
| JMF | 0:24d3eb812fd4 | 31 | #if !defined(ATMEL_SPI_MISO) |
| JMF | 0:24d3eb812fd4 | 32 | #define ATMEL_SPI_MISO D12 |
| JMF | 0:24d3eb812fd4 | 33 | #endif |
| JMF | 0:24d3eb812fd4 | 34 | #if !defined(ATMEL_SPI_SCLK) |
| JMF | 0:24d3eb812fd4 | 35 | #define ATMEL_SPI_SCLK D13 |
| JMF | 0:24d3eb812fd4 | 36 | #endif |
| JMF | 0:24d3eb812fd4 | 37 | #if !defined(ATMEL_SPI_CS) |
| JMF | 0:24d3eb812fd4 | 38 | #define ATMEL_SPI_CS D10 |
| JMF | 0:24d3eb812fd4 | 39 | #endif |
| JMF | 0:24d3eb812fd4 | 40 | #if !defined(ATMEL_SPI_RST) |
| JMF | 0:24d3eb812fd4 | 41 | #define ATMEL_SPI_RST D5 |
| JMF | 0:24d3eb812fd4 | 42 | #endif |
| JMF | 0:24d3eb812fd4 | 43 | #if !defined(ATMEL_SPI_SLP) |
| JMF | 0:24d3eb812fd4 | 44 | #define ATMEL_SPI_SLP D7 |
| JMF | 0:24d3eb812fd4 | 45 | #endif |
| JMF | 0:24d3eb812fd4 | 46 | #if !defined(ATMEL_SPI_IRQ) |
| JMF | 0:24d3eb812fd4 | 47 | #define ATMEL_SPI_IRQ D9 |
| JMF | 0:24d3eb812fd4 | 48 | #endif |
| JMF | 0:24d3eb812fd4 | 49 | #if !defined(ATMEL_I2C_SDA) |
| JMF | 0:24d3eb812fd4 | 50 | #define ATMEL_I2C_SDA D14 |
| JMF | 0:24d3eb812fd4 | 51 | #endif |
| JMF | 0:24d3eb812fd4 | 52 | #if !defined(ATMEL_I2C_SCL) |
| JMF | 0:24d3eb812fd4 | 53 | #define ATMEL_I2C_SCL D15 |
| JMF | 0:24d3eb812fd4 | 54 | #endif |
| JMF | 0:24d3eb812fd4 | 55 | |
| JMF | 0:24d3eb812fd4 | 56 | class RFBits; |
| JMF | 0:24d3eb812fd4 | 57 | |
| JMF | 0:24d3eb812fd4 | 58 | class NanostackRfPhyAtmel : public NanostackRfPhy { |
| JMF | 0:24d3eb812fd4 | 59 | public: |
| JMF | 0:24d3eb812fd4 | 60 | NanostackRfPhyAtmel(PinName spi_mosi, PinName spi_miso, |
| JMF | 0:24d3eb812fd4 | 61 | PinName spi_sclk, PinName spi_cs, PinName spi_rst, PinName spi_slp, PinName spi_irq, |
| JMF | 0:24d3eb812fd4 | 62 | PinName i2c_sda, PinName i2c_scl); |
| JMF | 0:24d3eb812fd4 | 63 | virtual ~NanostackRfPhyAtmel(); |
| JMF | 0:24d3eb812fd4 | 64 | virtual int8_t rf_register(); |
| JMF | 0:24d3eb812fd4 | 65 | virtual void rf_unregister(); |
| JMF | 0:24d3eb812fd4 | 66 | virtual void get_mac_address(uint8_t *mac); |
| JMF | 0:24d3eb812fd4 | 67 | virtual void set_mac_address(uint8_t *mac); |
| JMF | 0:24d3eb812fd4 | 68 | |
| JMF | 0:24d3eb812fd4 | 69 | private: |
| JMF | 0:24d3eb812fd4 | 70 | AT24Mac _mac; |
| JMF | 0:24d3eb812fd4 | 71 | uint8_t _mac_addr[8]; |
| JMF | 0:24d3eb812fd4 | 72 | RFBits *_rf; |
| JMF | 0:24d3eb812fd4 | 73 | bool _mac_set; |
| JMF | 0:24d3eb812fd4 | 74 | |
| JMF | 0:24d3eb812fd4 | 75 | const PinName _spi_mosi; |
| JMF | 0:24d3eb812fd4 | 76 | const PinName _spi_miso; |
| JMF | 0:24d3eb812fd4 | 77 | const PinName _spi_sclk; |
| JMF | 0:24d3eb812fd4 | 78 | const PinName _spi_cs; |
| JMF | 0:24d3eb812fd4 | 79 | const PinName _spi_rst; |
| JMF | 0:24d3eb812fd4 | 80 | const PinName _spi_slp; |
| JMF | 0:24d3eb812fd4 | 81 | const PinName _spi_irq; |
| JMF | 0:24d3eb812fd4 | 82 | }; |
| JMF | 0:24d3eb812fd4 | 83 | |
| JMF | 0:24d3eb812fd4 | 84 | #endif /* MBED_CONF_NANOSTACK_CONFIGURATION */ |
| JMF | 0:24d3eb812fd4 | 85 | #endif /* NANOSTACK_RF_PHY_ATMEL_H_ */ |