The NSL01 library contains the software stack to control the NSL01 LoRaWAN shield from mCloud System GmbH. The NSL01 is a professional plug & play LoRaWAN shield for a wide range of STM32 Nucleo-64 boards with Arduino Uno Rev 3 connectivity. For more information about the NSL01 LoRaWAN shield have a look at: http://www.mcloud-systems.com/nsl01-lorawan-nucleo-arduino-shield
Fork of NSL01 by
NSL01_HCI_Layer.h
00001 /** 00002 ******************************************************************************** 00003 * @file NSL01_HCI_Layer.h 00004 * 00005 * @brief Functions for NSL01 class to create a Human Control Interface (HCI) 00006 * for controlling the onboard RF radio module. 00007 * 00008 * @brief For more information about the NSL01 LoRaWAN shield: 00009 * http://www.mcloud-systems.com/nsl01-lorawan-nucleo-arduino-shield 00010 * 00011 * @note The NSL01_HCI_Layer files are included in the dependencies directory 00012 * of the project and these files are necessary for the NSL01 class! 00013 * 00014 * @author - 00015 * @version V1.0 00016 * @date 20-June-2018 00017 ******************************************************************************** 00018 */ 00019 00020 #ifndef NSL01_HCI_LAYER_H 00021 #define NSL01_HCI_LAYER_H 00022 00023 //------------------------------------------------------------------------------ 00024 // 00025 // Include Files 00026 // 00027 //------------------------------------------------------------------------------ 00028 00029 #include "mbed.h" 00030 #include "./dependencies/CRC16.h" 00031 #include "./dependencies/SLIP.h" 00032 #include "./dependencies/SerialDevice.h" 00033 #include <stdint.h> 00034 00035 //------------------------------------------------------------------------------ 00036 // 00037 // Section Defines 00038 // 00039 //------------------------------------------------------------------------------ 00040 00041 //--Define HCI message parameter 00042 #define WIMOD_HCI_MSG_HEADER_SIZE 2 00043 #define WIMOD_HCI_MSG_PAYLOAD_SIZE 300 00044 #define WIMOD_HCI_MSG_FCS_SIZE 2 00045 00046 #define LOBYTE(x) (x) 00047 #define HIBYTE(x) ((UINT16)(x) >> 8) 00048 00049 //#define DEBUG 00050 00051 //------------------------------------------------------------------------------ 00052 // 00053 // Section Declarations 00054 // 00055 //------------------------------------------------------------------------------ 00056 00057 //--Global variables from main 00058 extern Serial comm_pc; 00059 extern Serial comm_LoRa; 00060 00061 //--Define shortcuts for datatypes 00062 typedef unsigned char UINT8; 00063 typedef uint16_t UINT16; 00064 typedef uint32_t UINT32; 00065 00066 //------------------------------------------------------------------------------ 00067 // 00068 // HCI Message Structure (internal software usage) 00069 // 00070 //------------------------------------------------------------------------------ 00071 00072 typedef struct 00073 { 00074 //--Payload length information 00075 UINT16 Length; 00076 00077 //--Service Access Point Identifier 00078 UINT8 SapID; 00079 00080 //--Message Identifier 00081 UINT8 MsgID; 00082 00083 //--Payload Field 00084 UINT8 Payload[WIMOD_HCI_MSG_PAYLOAD_SIZE]; 00085 00086 //--Frame Check Sequence Field 00087 UINT8 CRC16[WIMOD_HCI_MSG_FCS_SIZE]; 00088 00089 }TWiMOD_HCI_Message; 00090 00091 //------------------------------------------------------------------------------ 00092 // 00093 // Function Prototypes 00094 // 00095 //------------------------------------------------------------------------------ 00096 00097 00098 /** Human Control Interface (HCI) message receiver callback defintion. 00099 * 00100 * @param rxMessage : Pointer to HCI Rx message struct 00101 */ 00102 typedef TWiMOD_HCI_Message* (*TWiMOD_HCI_CbRxMessage)(TWiMOD_HCI_Message* rxMessage); 00103 00104 00105 /** Function to initialize Human Control Interface (HCI) message layer. 00106 * 00107 * @param cbRxMessage : Function pointer 00108 * @param rxMessage : Pointer to HCI Rx message struct 00109 */ 00110 void 00111 WiMOD_HCI_Init(TWiMOD_HCI_CbRxMessage cbRxMessage, 00112 TWiMOD_HCI_Message* rxMessage); 00113 00114 00115 /** Function to transmit a message via specified Human Control Interface (HCI) 00116 * with or without payload. 00117 * 00118 * @param txMessage : Pointer to HCI Tx message struct 00119 * 00120 * @returns 1 on success, -1 on error 00121 */ 00122 int 00123 WiMOD_HCI_SendMessage(TWiMOD_HCI_Message* txMessage); 00124 00125 00126 /** Function to read/process incoming serial data, which is a user triggered 00127 * function without using interrupts. 00128 * 00129 * @note This function is not necessary at the moment, because the incoming 00130 * serial data is processed via an Interrupt Service Routine (ISR). 00131 * 00132 */ 00133 void 00134 WiMOD_HCI_Process(); 00135 00136 #endif // NSL01_HCI_LAYER_H 00137 00138 //------------------------------------------------------------------------------ 00139 // end of file 00140 //------------------------------------------------------------------------------
Generated on Tue Jul 12 2022 20:20:04 by
1.7.2
