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.
Dependents: TYBLE16_simple_data_logger TYBLE16_MP3_Air
NanostackRfPhyMcr20a.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_PHY_MCR20A_H_ 00018 #define NANOSTACK_PHY_MCR20A_H_ 00019 00020 #if defined(MBED_CONF_NANOSTACK_CONFIGURATION) && DEVICE_SPI && DEVICE_INTERRUPTIN && defined(MBED_CONF_RTOS_PRESENT) 00021 #include "inttypes.h" 00022 #include "NanostackRfPhy.h" 00023 #include "DigitalIn.h" 00024 #include "DigitalOut.h" 00025 #include "InterruptIn.h" 00026 #include "SPI.h" 00027 #include "rtos.h" 00028 00029 // Arduino pin defaults for convenience 00030 #if !defined(MCR20A_SPI_MOSI) 00031 #define MCR20A_SPI_MOSI D11 00032 #endif 00033 #if !defined(MCR20A_SPI_MISO) 00034 #define MCR20A_SPI_MISO D12 00035 #endif 00036 #if !defined(MCR20A_SPI_SCLK) 00037 #define MCR20A_SPI_SCLK D13 00038 #endif 00039 #if !defined(MCR20A_SPI_CS) 00040 #define MCR20A_SPI_CS D10 00041 #endif 00042 #if !defined(MCR20A_SPI_RST) 00043 #define MCR20A_SPI_RST D5 00044 #endif 00045 #if !defined(MCR20A_SPI_IRQ) 00046 #define MCR20A_SPI_IRQ D2 00047 #endif 00048 00049 class NanostackRfPhyMcr20a : public NanostackRfPhy { 00050 public: 00051 NanostackRfPhyMcr20a(PinName spi_mosi, PinName spi_miso, 00052 PinName spi_sclk, PinName spi_cs, PinName spi_rst, 00053 PinName spi_irq); 00054 virtual ~NanostackRfPhyMcr20a(); 00055 virtual int8_t rf_register(); 00056 virtual void rf_unregister(); 00057 virtual void get_mac_address(uint8_t *mac); 00058 virtual void set_mac_address(uint8_t *mac); 00059 00060 private: 00061 mbed::SPI _spi; 00062 mbed::DigitalOut _rf_cs; 00063 mbed::DigitalOut _rf_rst; 00064 mbed::InterruptIn _rf_irq; 00065 mbed::DigitalIn _rf_irq_pin; 00066 rtos::Thread _irq_thread; 00067 00068 void _pins_set(); 00069 void _pins_clear(); 00070 }; 00071 00072 #endif /* MBED_CONF_NANOSTACK_CONFIGURATION */ 00073 #endif /* NANOSTACK_PHY_MCR20A_H_ */
Generated on Tue Jul 12 2022 13:54:36 by
1.7.2