Version of easy-connect with the u-blox cellular platforms C027 and C030 added.

Dependents:   HelloMQTT

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers NanostackRfPhyMcr20a.h Source File

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 #include "mbed.h"
00021 #include "NanostackRfPhy.h"
00022 
00023 // Arduino pin defaults for convenience
00024 #if !defined(MCR20A_SPI_MOSI)
00025 #define MCR20A_SPI_MOSI   D11
00026 #endif
00027 #if !defined(MCR20A_SPI_MISO)
00028 #define MCR20A_SPI_MISO   D12
00029 #endif
00030 #if !defined(MCR20A_SPI_SCLK)
00031 #define MCR20A_SPI_SCLK   D13
00032 #endif
00033 #if !defined(MCR20A_SPI_CS)
00034 #define MCR20A_SPI_CS     D10
00035 #endif
00036 #if !defined(MCR20A_SPI_RST)
00037 #define MCR20A_SPI_RST    D5
00038 #endif
00039 #if !defined(MCR20A_SPI_IRQ)
00040 #define MCR20A_SPI_IRQ    D2
00041 #endif
00042 
00043 class NanostackRfPhyMcr20a : public NanostackRfPhy {
00044 public:
00045     NanostackRfPhyMcr20a(PinName spi_mosi, PinName spi_miso,
00046                          PinName spi_sclk, PinName spi_cs,  PinName spi_rst,
00047                          PinName spi_irq);
00048     virtual ~NanostackRfPhyMcr20a();
00049     virtual int8_t rf_register();
00050     virtual void rf_unregister();
00051     virtual void get_mac_address(uint8_t *mac);
00052     virtual void set_mac_address(uint8_t *mac);
00053 
00054 private:
00055     SPI _spi;
00056     DigitalOut _rf_cs;
00057     DigitalOut _rf_rst;
00058     InterruptIn _rf_irq;
00059     DigitalIn _rf_irq_pin;
00060 
00061     void _pins_set();
00062     void _pins_clear();
00063 };
00064 
00065 #endif /* NANOSTACK_PHY_MCR20A_H_ */