LoRaWAN smart agriculture application using FRDM-K64F ARM mbed board along with SX1272MB2xAS LoRa shield as the LoRa Node.
Dependencies: DHT11 LMiC SX1272Lib mbed
Fork of LoRaWAN-lmic-app by
debug.h@6:3758685f4b75, 2018-04-02 (annotated)
- Committer:
- GTsapparellas
- Date:
- Mon Apr 02 12:16:01 2018 +0000
- Revision:
- 6:3758685f4b75
- Parent:
- 1:60184eda0066
LoRaWAN smart agriculture application using FRDM-K64F ARM mbed board along with SX1272MB2xAS LoRa shield as the LoRa Node.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mluis | 1:60184eda0066 | 1 | /******************************************************************************* |
mluis | 1:60184eda0066 | 2 | * Copyright (c) 2014-2015 IBM Corporation. |
mluis | 1:60184eda0066 | 3 | * All rights reserved. This program and the accompanying materials |
mluis | 1:60184eda0066 | 4 | * are made available under the terms of the Eclipse Public License v1.0 |
mluis | 1:60184eda0066 | 5 | * which accompanies this distribution, and is available at |
mluis | 1:60184eda0066 | 6 | * http://www.eclipse.org/legal/epl-v10.html |
mluis | 1:60184eda0066 | 7 | * |
mluis | 1:60184eda0066 | 8 | * Contributors: |
mluis | 1:60184eda0066 | 9 | * IBM Zurich Research Lab - initial API, implementation and documentation |
mluis | 1:60184eda0066 | 10 | * Semtech Apps Team - Adapted for MBED |
GTsapparellas | 6:3758685f4b75 | 11 | * ///////////////////////////////////////////////////////////////////////////// |
GTsapparellas | 6:3758685f4b75 | 12 | * |
GTsapparellas | 6:3758685f4b75 | 13 | * Used by Giorgos Tsapparellas for Internet of Things (IoT) smart monitoring |
GTsapparellas | 6:3758685f4b75 | 14 | * device for agriculture using LoRaWAN technology. |
GTsapparellas | 6:3758685f4b75 | 15 | * |
GTsapparellas | 6:3758685f4b75 | 16 | * Date of issued copy: 25 January 2018 |
GTsapparellas | 6:3758685f4b75 | 17 | * |
GTsapparellas | 6:3758685f4b75 | 18 | * Modifications: |
GTsapparellas | 6:3758685f4b75 | 19 | * - No external modifications of the existing "AS IT IS" software. |
GTsapparellas | 6:3758685f4b75 | 20 | * - Added some external comments for meeting good principles of |
GTsapparellas | 6:3758685f4b75 | 21 | * source code re-usability. |
mluis | 1:60184eda0066 | 22 | *******************************************************************************/ |
mluis | 1:60184eda0066 | 23 | #ifndef _debug_hpp_ |
mluis | 1:60184eda0066 | 24 | #define _debug_hpp_ |
mluis | 1:60184eda0066 | 25 | |
GTsapparellas | 6:3758685f4b75 | 26 | /* |
GTsapparellas | 6:3758685f4b75 | 27 | * debug_init function of type void. |
GTsapparellas | 6:3758685f4b75 | 28 | * |
GTsapparellas | 6:3758685f4b75 | 29 | * Intializes debug library. |
GTsapparellas | 6:3758685f4b75 | 30 | * |
GTsapparellas | 6:3758685f4b75 | 31 | * Input parameters: None |
GTsapparellas | 6:3758685f4b75 | 32 | */ |
mluis | 1:60184eda0066 | 33 | void debug_init (void); |
mluis | 1:60184eda0066 | 34 | |
GTsapparellas | 6:3758685f4b75 | 35 | /* |
GTsapparellas | 6:3758685f4b75 | 36 | * debug_led function of type void. |
GTsapparellas | 6:3758685f4b75 | 37 | * |
GTsapparellas | 6:3758685f4b75 | 38 | * Sets LED state. |
GTsapparellas | 6:3758685f4b75 | 39 | * |
GTsapparellas | 6:3758685f4b75 | 40 | * Input parameters: unsigned char val. |
GTsapparellas | 6:3758685f4b75 | 41 | * |
GTsapparellas | 6:3758685f4b75 | 42 | */ |
mluis | 1:60184eda0066 | 43 | void debug_led (u1_t val); |
mluis | 1:60184eda0066 | 44 | |
GTsapparellas | 6:3758685f4b75 | 45 | /* |
GTsapparellas | 6:3758685f4b75 | 46 | * debug_char function of type void. |
GTsapparellas | 6:3758685f4b75 | 47 | * |
GTsapparellas | 6:3758685f4b75 | 48 | * Writes character to UART |
GTsapparellas | 6:3758685f4b75 | 49 | * |
GTsapparellas | 6:3758685f4b75 | 50 | * Input parameters: unsigned char c. |
GTsapparellas | 6:3758685f4b75 | 51 | * |
GTsapparellas | 6:3758685f4b75 | 52 | */ |
mluis | 1:60184eda0066 | 53 | void debug_char (u1_t c); |
mluis | 1:60184eda0066 | 54 | |
GTsapparellas | 6:3758685f4b75 | 55 | /* |
GTsapparellas | 6:3758685f4b75 | 56 | * debug_hex function of type void. |
GTsapparellas | 6:3758685f4b75 | 57 | * |
GTsapparellas | 6:3758685f4b75 | 58 | * Writes byte as two hex digits to UART. |
GTsapparellas | 6:3758685f4b75 | 59 | * |
GTsapparellas | 6:3758685f4b75 | 60 | * Input parameters: unsigned char b. |
GTsapparellas | 6:3758685f4b75 | 61 | * |
GTsapparellas | 6:3758685f4b75 | 62 | */ |
mluis | 1:60184eda0066 | 63 | void debug_hex (u1_t b); |
mluis | 1:60184eda0066 | 64 | |
GTsapparellas | 6:3758685f4b75 | 65 | /* |
GTsapparellas | 6:3758685f4b75 | 66 | * debug_buf function of type void. |
GTsapparellas | 6:3758685f4b75 | 67 | * |
GTsapparellas | 6:3758685f4b75 | 68 | * Writes buffer as hex dump to UART. |
GTsapparellas | 6:3758685f4b75 | 69 | * |
GTsapparellas | 6:3758685f4b75 | 70 | * Input parameters: unsigned char buf |
GTsapparellas | 6:3758685f4b75 | 71 | * unsigned short len |
GTsapparellas | 6:3758685f4b75 | 72 | * |
GTsapparellas | 6:3758685f4b75 | 73 | */ |
mluis | 1:60184eda0066 | 74 | void debug_buf (const u1_t* buf, u2_t len); |
mluis | 1:60184eda0066 | 75 | |
GTsapparellas | 6:3758685f4b75 | 76 | /* |
GTsapparellas | 6:3758685f4b75 | 77 | * debug_uint function of type void. |
GTsapparellas | 6:3758685f4b75 | 78 | * |
GTsapparellas | 6:3758685f4b75 | 79 | * Writes 32-bit integer as eight hex digits to UART. |
GTsapparellas | 6:3758685f4b75 | 80 | * |
GTsapparellas | 6:3758685f4b75 | 81 | * Input parameters: unsigned int v |
GTsapparellas | 6:3758685f4b75 | 82 | * |
GTsapparellas | 6:3758685f4b75 | 83 | */ |
mluis | 1:60184eda0066 | 84 | void debug_uint (u4_t v); |
mluis | 1:60184eda0066 | 85 | |
GTsapparellas | 6:3758685f4b75 | 86 | /* |
GTsapparellas | 6:3758685f4b75 | 87 | * debug_str function of type void. |
GTsapparellas | 6:3758685f4b75 | 88 | * |
GTsapparellas | 6:3758685f4b75 | 89 | * Writes nul-terminated string to UART. |
GTsapparellas | 6:3758685f4b75 | 90 | * |
GTsapparellas | 6:3758685f4b75 | 91 | * Input parameters: const unsigned char str |
GTsapparellas | 6:3758685f4b75 | 92 | * |
GTsapparellas | 6:3758685f4b75 | 93 | */ |
mluis | 1:60184eda0066 | 94 | void debug_str (const u1_t* str); |
mluis | 1:60184eda0066 | 95 | |
GTsapparellas | 6:3758685f4b75 | 96 | /* |
GTsapparellas | 6:3758685f4b75 | 97 | * debug_val function of type void. |
GTsapparellas | 6:3758685f4b75 | 98 | * |
GTsapparellas | 6:3758685f4b75 | 99 | * Writes label and 32-bit value as hex to UART. |
GTsapparellas | 6:3758685f4b75 | 100 | * |
GTsapparellas | 6:3758685f4b75 | 101 | * Input parameters: const unsigned char label |
GTsapparellas | 6:3758685f4b75 | 102 | * unsigned int val |
GTsapparellas | 6:3758685f4b75 | 103 | * |
GTsapparellas | 6:3758685f4b75 | 104 | */ |
GTsapparellas | 6:3758685f4b75 | 105 | void debug_val (const u1_t* label, u4_t val); |
GTsapparellas | 6:3758685f4b75 | 106 | |
GTsapparellas | 6:3758685f4b75 | 107 | /* |
GTsapparellas | 6:3758685f4b75 | 108 | * debug_event function of type void. |
GTsapparellas | 6:3758685f4b75 | 109 | * |
GTsapparellas | 6:3758685f4b75 | 110 | * Writes LMiC event name to UART. |
GTsapparellas | 6:3758685f4b75 | 111 | * |
GTsapparellas | 6:3758685f4b75 | 112 | * Input parameters: int ev |
GTsapparellas | 6:3758685f4b75 | 113 | * |
GTsapparellas | 6:3758685f4b75 | 114 | */ |
mluis | 1:60184eda0066 | 115 | void debug_event (int ev); |
mluis | 1:60184eda0066 | 116 | |
mluis | 1:60184eda0066 | 117 | #endif // _debug_hpp_ |