Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
NanostackRfPhyAtmel.h
00001 /* 00002 * Copyright (c) 2014-2015 ARM Limited. All rights reserved. 00003 * SPDX-License-Identifier: Apache-2.0 00004 * Licensed under the Apache License, Version 2.0 (the License); you may 00005 * not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an AS IS BASIS, WITHOUT 00012 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 #ifndef NANOSTACK_RF_PHY_ATMEL_H_ 00018 #define NANOSTACK_RF_PHY_ATMEL_H_ 00019 00020 #include "NanostackRfPhy.h" 00021 #include "at24mac.h" 00022 #include "PinNames.h" 00023 00024 // Arduino pin defaults for convenience 00025 #if !defined(ATMEL_SPI_MOSI) 00026 #define ATMEL_SPI_MOSI D11 00027 #endif 00028 #if !defined(ATMEL_SPI_MISO) 00029 #define ATMEL_SPI_MISO D12 00030 #endif 00031 #if !defined(ATMEL_SPI_SCLK) 00032 #define ATMEL_SPI_SCLK D13 00033 #endif 00034 #if !defined(ATMEL_SPI_CS) 00035 #define ATMEL_SPI_CS D10 00036 #endif 00037 #if !defined(ATMEL_SPI_RST) 00038 #define ATMEL_SPI_RST D5 00039 #endif 00040 #if !defined(ATMEL_SPI_SLP) 00041 #define ATMEL_SPI_SLP D7 00042 #endif 00043 #if !defined(ATMEL_SPI_IRQ) 00044 #define ATMEL_SPI_IRQ D9 00045 #endif 00046 #if !defined(ATMEL_I2C_SDA) 00047 #define ATMEL_I2C_SDA D14 00048 #endif 00049 #if !defined(ATMEL_I2C_SCL) 00050 #define ATMEL_I2C_SCL D15 00051 #endif 00052 00053 class RFBits; 00054 00055 class NanostackRfPhyAtmel : public NanostackRfPhy { 00056 public: 00057 NanostackRfPhyAtmel(PinName spi_mosi, PinName spi_miso, 00058 PinName spi_sclk, PinName spi_cs, PinName spi_rst, PinName spi_slp, PinName spi_irq, 00059 PinName i2c_sda, PinName i2c_scl); 00060 ~NanostackRfPhyAtmel(); 00061 int8_t rf_register(); 00062 void rf_unregister(); 00063 void get_mac_address(uint8_t *mac); 00064 void set_mac_address(uint8_t *mac); 00065 00066 private: 00067 AT24Mac _mac; 00068 uint8_t _mac_addr[8]; 00069 RFBits *_rf; 00070 bool _mac_set; 00071 00072 const PinName _spi_mosi; 00073 const PinName _spi_miso; 00074 const PinName _spi_sclk; 00075 const PinName _spi_cs; 00076 const PinName _spi_rst; 00077 const PinName _spi_slp; 00078 const PinName _spi_irq; 00079 }; 00080 00081 #endif /* NANOSTACK_RF_PHY_ATMEL_H_ */
Generated on Tue Jul 12 2022 19:14:50 by
