Exportable version of WizziLab's modem driver.

Dependents:   modem_ref_helper

Committer:
Jeej
Date:
Mon Mar 05 16:46:05 2018 +0000
Revision:
27:918293e12f1b
Parent:
22:db4d6bef62f3
Child:
35:ac940cf8ebe6
Activated dynamic ISM band selection for LoRaWAN.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Jeej 19:701d5669f2e9 1 /*
Jeej 19:701d5669f2e9 2 / _____) _ | |
Jeej 19:701d5669f2e9 3 ( (____ _____ ____ _| |_ _____ ____| |__
Jeej 19:701d5669f2e9 4 \____ \| ___ | (_ _) ___ |/ ___) _ \
Jeej 19:701d5669f2e9 5 _____) ) ____| | | || |_| ____( (___| | | |
Jeej 19:701d5669f2e9 6 (______/|_____)_|_|_| \__)_____)\____)_| |_|
Jeej 19:701d5669f2e9 7 (C)2013 Semtech
Jeej 19:701d5669f2e9 8
Jeej 19:701d5669f2e9 9 Description: LoRaMac classA device implementation
Jeej 19:701d5669f2e9 10
Jeej 19:701d5669f2e9 11 License: Revised BSD License, see LICENSE.TXT file include in the project
Jeej 19:701d5669f2e9 12
Jeej 19:701d5669f2e9 13 Maintainer: Miguel Luis, Gregory Cristian and Wael Guibene
Jeej 19:701d5669f2e9 14 */
Jeej 19:701d5669f2e9 15 /******************************************************************************
Jeej 19:701d5669f2e9 16 * @file lora.h
Jeej 19:701d5669f2e9 17 * @author MCD Application Team
Jeej 19:701d5669f2e9 18 * @version V1.0.3
Jeej 19:701d5669f2e9 19 * @date 01-January-2017
Jeej 19:701d5669f2e9 20 * @brief lora API to drive the lora state Machine
Jeej 19:701d5669f2e9 21 ******************************************************************************
Jeej 19:701d5669f2e9 22 * @attention
Jeej 19:701d5669f2e9 23 *
Jeej 19:701d5669f2e9 24 * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics International N.V.
Jeej 19:701d5669f2e9 25 * All rights reserved.</center></h2>
Jeej 19:701d5669f2e9 26 *
Jeej 19:701d5669f2e9 27 * Redistribution and use in source and binary forms, with or without
Jeej 19:701d5669f2e9 28 * modification, are permitted, provided that the following conditions are met:
Jeej 19:701d5669f2e9 29 *
Jeej 19:701d5669f2e9 30 * 1. Redistribution of source code must retain the above copyright notice,
Jeej 19:701d5669f2e9 31 * this list of conditions and the following disclaimer.
Jeej 19:701d5669f2e9 32 * 2. Redistributions in binary form must reproduce the above copyright notice,
Jeej 19:701d5669f2e9 33 * this list of conditions and the following disclaimer in the documentation
Jeej 19:701d5669f2e9 34 * and/or other materials provided with the distribution.
Jeej 19:701d5669f2e9 35 * 3. Neither the name of STMicroelectronics nor the names of other
Jeej 19:701d5669f2e9 36 * contributors to this software may be used to endorse or promote products
Jeej 19:701d5669f2e9 37 * derived from this software without specific written permission.
Jeej 19:701d5669f2e9 38 * 4. This software, including modifications and/or derivative works of this
Jeej 19:701d5669f2e9 39 * software, must execute solely and exclusively on microcontroller or
Jeej 19:701d5669f2e9 40 * microprocessor devices manufactured by or for STMicroelectronics.
Jeej 19:701d5669f2e9 41 * 5. Redistribution and use of this software other than as permitted under
Jeej 19:701d5669f2e9 42 * this license is void and will automatically terminate your rights under
Jeej 19:701d5669f2e9 43 * this license.
Jeej 19:701d5669f2e9 44 *
Jeej 19:701d5669f2e9 45 * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
Jeej 19:701d5669f2e9 46 * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
Jeej 19:701d5669f2e9 47 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
Jeej 19:701d5669f2e9 48 * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
Jeej 19:701d5669f2e9 49 * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
Jeej 19:701d5669f2e9 50 * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
Jeej 19:701d5669f2e9 51 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
Jeej 19:701d5669f2e9 52 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
Jeej 19:701d5669f2e9 53 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
Jeej 19:701d5669f2e9 54 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
Jeej 19:701d5669f2e9 55 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
Jeej 19:701d5669f2e9 56 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Jeej 19:701d5669f2e9 57 *
Jeej 19:701d5669f2e9 58 ******************************************************************************
Jeej 19:701d5669f2e9 59 */
Jeej 19:701d5669f2e9 60 /* Define to prevent recursive inclusion -------------------------------------*/
Jeej 19:701d5669f2e9 61
Jeej 19:701d5669f2e9 62 #ifndef __LORA_MAIN_H__
Jeej 19:701d5669f2e9 63 #define __LORA_MAIN_H__
Jeej 19:701d5669f2e9 64
Jeej 19:701d5669f2e9 65 #ifdef __cplusplus
Jeej 19:701d5669f2e9 66 extern "C" {
Jeej 19:701d5669f2e9 67 #endif
Jeej 19:701d5669f2e9 68
Jeej 19:701d5669f2e9 69 /* Includes ------------------------------------------------------------------*/
Jeej 19:701d5669f2e9 70 //#include "Comissioning.h"
Jeej 19:701d5669f2e9 71 //#include "LoRaMacCommon.h"
Jeej 19:701d5669f2e9 72 //#include "LoRaMac-board.h"
Jeej 19:701d5669f2e9 73 //
Jeej 19:701d5669f2e9 74 TYPEDEF_STRUCT_PACKED {
Jeej 19:701d5669f2e9 75 u8 activation_mode;
Jeej 19:701d5669f2e9 76 // LoRaWAN device class
Jeej 19:701d5669f2e9 77 u8 dev_class;
Jeej 19:701d5669f2e9 78 u32 dev_address;
Jeej 19:701d5669f2e9 79 u8 app_id[8];
Jeej 19:701d5669f2e9 80 u8 app_key[16];
Jeej 19:701d5669f2e9 81 u8 app_skey[16];
Jeej 19:701d5669f2e9 82 u8 nw_skey[16];
Jeej 19:701d5669f2e9 83 u32 nw_id;
Jeej 19:701d5669f2e9 84 // Enable or disable a public network
Jeej 19:701d5669f2e9 85 u8 nw_public;
Jeej 19:701d5669f2e9 86 // Activation state of adaptativeDatarate
Jeej 19:701d5669f2e9 87 u8 adr_enable;
Jeej 19:701d5669f2e9 88 // Uplink datarate, if adr_enable is off
Jeej 19:701d5669f2e9 89 s8 tx_datarate;
Jeej 27:918293e12f1b 90 // ISM Band
Jeej 27:918293e12f1b 91 u8 ism_band;
Jeej 19:701d5669f2e9 92 } lwan_cfg_t;
Jeej 19:701d5669f2e9 93
Jeej 19:701d5669f2e9 94 /* Exported constants --------------------------------------------------------*/
Jeej 19:701d5669f2e9 95 /* Exported types ------------------------------------------------------------*/
Jeej 19:701d5669f2e9 96
Jeej 19:701d5669f2e9 97 /*!
Jeej 19:701d5669f2e9 98 * LoRa ISM Bands
Jeej 19:701d5669f2e9 99 */
Jeej 19:701d5669f2e9 100 typedef enum
Jeej 19:701d5669f2e9 101 {
Jeej 19:701d5669f2e9 102 ISM_BAND_470,
Jeej 19:701d5669f2e9 103 ISM_BAND_780,
Jeej 19:701d5669f2e9 104 ISM_BAND_433,
Jeej 19:701d5669f2e9 105 ISM_BAND_868,
Jeej 19:701d5669f2e9 106 ISM_BAND_915,
Jeej 19:701d5669f2e9 107 ISM_BAND_915_HYBRID,
Jeej 19:701d5669f2e9 108 ISM_BAND_QTY,
Jeej 19:701d5669f2e9 109
Jeej 19:701d5669f2e9 110 } IsmBands_t;
Jeej 19:701d5669f2e9 111
Jeej 19:701d5669f2e9 112 #ifdef __cplusplus
Jeej 19:701d5669f2e9 113 }
Jeej 19:701d5669f2e9 114 #endif
Jeej 19:701d5669f2e9 115
Jeej 19:701d5669f2e9 116 #endif /*__LORA_MAIN_H__*/
Jeej 19:701d5669f2e9 117
Jeej 19:701d5669f2e9 118 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/