├── .gitattributes ├── .gitignore ├── Example ├── BLE_Indoor_Positioning_Software │ └── BLE_Positioning │ │ ├── BLE_Positioning.exe │ │ ├── BLE_Positioning.py │ │ ├── icon.png │ │ └── office_map.png ├── LoRaWAN │ ├── examples │ │ ├── OTAA_FULL_FUNCTION │ │ │ ├── GPS.cpp │ │ │ ├── GPS.h │ │ │ ├── GXHT30.cpp │ │ │ ├── GXHT30.h │ │ │ ├── OTAA_FULL_FUNCTION.ino │ │ │ ├── at.cpp │ │ │ ├── at.h │ │ │ ├── common.cpp │ │ │ ├── common.h │ │ │ ├── config.h │ │ │ ├── extiButton.cpp │ │ │ ├── extiButton.h │ │ │ ├── lora.cpp │ │ │ ├── lora.h │ │ │ └── recording.txt │ │ ├── TrackerD │ │ │ ├── GPS.cpp │ │ │ ├── GPS.h │ │ │ ├── GXHT30.cpp │ │ │ ├── GXHT30.h │ │ │ ├── OneButton.cpp │ │ │ ├── OneButton.h │ │ │ ├── TinyGPS++.cpp │ │ │ ├── TinyGPS++.h │ │ │ ├── TrackerD.ino │ │ │ ├── at.cpp │ │ │ ├── at.h │ │ │ ├── blescan.cpp │ │ │ ├── blescan.h │ │ │ ├── common.cpp │ │ │ ├── common.h │ │ │ ├── config.h │ │ │ ├── extiButton.cpp │ │ │ ├── extiButton.h │ │ │ ├── extiButtonLS.cpp │ │ │ ├── extiButtonLS.h │ │ │ ├── lis3dh-motion-detection.cpp │ │ │ ├── lis3dh-motion-detection.h │ │ │ ├── lora.cpp │ │ │ ├── lora.h │ │ │ ├── notes.h │ │ │ ├── wifiscan.cpp │ │ │ └── wifiscan.h │ │ └── extras │ │ │ ├── STMicroelectronics-LIS3DHTR_C15134.pdf │ │ │ ├── apply_patches.py │ │ │ └── patches │ │ │ ├── pico32_dragino_trackerd.patch │ │ │ └── pins_arduino.h │ ├── platformio.ini │ └── src │ │ ├── OneButton.cpp │ │ ├── OneButton.h │ │ ├── TinyGPS++.cpp │ │ ├── TinyGPS++.h │ │ ├── lis3dh-motion-detection.cpp │ │ └── lis3dh-motion-detection.h └── None LoRaWAN │ └── pingpong │ ├── LoRaReceiver │ └── LoRaReceiver.ino │ ├── LoRaSender │ └── LoRaSender.ino │ └── lib │ └── arduino-LoRa │ ├── .github │ └── FUNDING.yml │ ├── .travis.yml │ ├── API.md │ ├── LICENSE │ ├── README.md │ ├── examples │ ├── LoRaDumpRegisters │ │ └── LoRaDumpRegisters.ino │ ├── LoRaDuplex │ │ └── LoRaDuplex.ino │ ├── LoRaDuplexCallback │ │ └── LoRaDuplexCallback.ino │ ├── LoRaReceiver │ │ └── LoRaReceiver.ino │ ├── LoRaReceiverCallback │ │ └── LoRaReceiverCallback.ino │ ├── LoRaSender │ │ └── LoRaSender.ino │ ├── LoRaSenderNonBlocking │ │ └── LoRaSenderNonBlocking.ino │ ├── LoRaSenderNonBlockingCallback │ │ └── LoRaSenderNonBlockingCallback.ino │ ├── LoRaSetSpread │ │ └── LoRaSetSpread.ino │ ├── LoRaSetSyncWord │ │ └── LoRaSetSyncWord.ino │ ├── LoRaSimpleGateway │ │ └── LoRaSimpleGateway.ino │ └── LoRaSimpleNode │ │ └── LoRaSimpleNode.ino │ ├── issue_template.md │ ├── keywords.txt │ ├── library.properties │ └── src │ ├── LoRa.cpp │ └── LoRa.h ├── Library └── arduino-lmic │ └── arduino-lmic │ ├── .github │ ├── ISSUE_TEMPLATE │ │ ├── 00-support-request.md │ │ ├── 10-bug_report.md │ │ ├── 20-feature_request.md │ │ └── 30-doc_issue.md │ └── workflows │ │ └── ci-arduinocli.yml │ ├── .gitignore │ ├── .hgignore │ ├── HOWTO-ADD-REGION.md │ ├── LICENSE │ ├── README.md │ ├── assets │ ├── Feather-M0-LoRa-Wire.ai │ └── Feather-M0-LoRa-Wire.png │ ├── ci │ ├── lmic-filter-common.sh │ └── platformio.sh │ ├── doc │ ├── IBM-DISCLAIMER.txt │ ├── IBM-release-notes.txt │ ├── LMIC-FSM.cdd │ ├── LMIC-FSM.pdf │ ├── LMIC-structure-diagram.cdd │ ├── LMIC-structure-diagram.pdf │ ├── LMIC-v4.1.0-redline.pdf │ ├── LMIC-v4.1.0.docx │ ├── LMIC-v4.1.0.pdf │ ├── LoRaWAN-at-a-glance.pdf │ ├── LoRaWAN-at-a-glance.vsdx │ ├── README.md │ └── RadioDriver.md │ ├── examples │ ├── compliance-otaa-halconfig │ │ ├── compliance-otaa-halconfig.ino │ │ └── extra │ │ │ └── ci │ │ │ └── lmic-filter.sh │ ├── header_test │ │ └── header_test.ino │ ├── helium-otaa │ │ └── helium-otaa.ino │ ├── raw-feather │ │ ├── extra │ │ │ └── ci │ │ │ │ └── lmic-filter.sh │ │ └── raw-feather.ino │ ├── raw-halconfig │ │ └── raw-halconfig.ino │ ├── raw │ │ └── raw.ino │ ├── ttn-abp-feather-us915-dht22 │ │ ├── extra │ │ │ └── ci │ │ │ │ └── lmic-filter.sh │ │ └── ttn-abp-feather-us915-dht22.ino │ ├── ttn-abp │ │ └── ttn-abp.ino │ ├── ttn-otaa-feather-us915-dht22 │ │ ├── extra │ │ │ └── ci │ │ │ │ └── lmic-filter.sh │ │ └── ttn-otaa-feather-us915-dht22.ino │ ├── ttn-otaa-feather-us915 │ │ ├── extra │ │ │ └── ci │ │ │ │ └── lmic-filter.sh │ │ └── ttn-otaa-feather-us915.ino │ ├── ttn-otaa-halconfig-us915 │ │ └── ttn-otaa-halconfig-us915.ino │ ├── ttn-otaa-network-time │ │ ├── extra │ │ │ └── ci │ │ │ │ └── lmic-filter.sh │ │ └── ttn-otaa-network-time.ino │ └── ttn-otaa │ │ └── ttn-otaa.ino │ ├── library.properties │ ├── project_config │ └── lmic_project_config.h │ └── src │ ├── aes │ ├── ideetron │ │ └── AES-128_V10.cpp │ ├── lmic.c │ └── other.c │ ├── arduino_lmic.h │ ├── arduino_lmic_hal_boards.h │ ├── arduino_lmic_hal_configuration.h │ ├── arduino_lmic_lorawan_compliance.h │ ├── arduino_lmic_user_configuration.h │ ├── hal │ ├── getpinmap_catena4420.cpp │ ├── getpinmap_catena4551.cpp │ ├── getpinmap_catena4610.cpp │ ├── getpinmap_catena4611.cpp │ ├── getpinmap_catena4612.cpp │ ├── getpinmap_catena4617.cpp │ ├── getpinmap_catena4618.cpp │ ├── getpinmap_catena4630.cpp │ ├── getpinmap_catena4801.cpp │ ├── getpinmap_catena4802.cpp │ ├── getpinmap_disco_l072cs_lrwan1.cpp │ ├── getpinmap_feather32u4lora.cpp │ ├── getpinmap_featherm0lora.cpp │ ├── getpinmap_heltec_lora32.cpp │ ├── getpinmap_thisboard.cpp │ ├── getpinmap_ttgo_lora32_v1.cpp │ ├── getpinmap_ttgo_lora32_v2.1.cpp │ ├── hal.cpp │ └── hal.h │ ├── lmic.h │ └── lmic │ ├── config.h │ ├── hal.h │ ├── lmic.c │ ├── lmic.h │ ├── lmic_as923.c │ ├── lmic_au915.c │ ├── lmic_bandplan.h │ ├── lmic_bandplan_as923.h │ ├── lmic_bandplan_au915.h │ ├── lmic_bandplan_eu868.h │ ├── lmic_bandplan_in866.h │ ├── lmic_bandplan_kr920.h │ ├── lmic_bandplan_kz865.h │ ├── lmic_bandplan_ma869.h │ ├── lmic_bandplan_ru864.h │ ├── lmic_bandplan_us915.h │ ├── lmic_channelshuffle.c │ ├── lmic_compat.h │ ├── lmic_compliance.c │ ├── lmic_compliance.h │ ├── lmic_config_preconditions.h │ ├── lmic_env.h │ ├── lmic_eu868.c │ ├── lmic_eu_like.c │ ├── lmic_eu_like.h │ ├── lmic_in866.c │ ├── lmic_kr920.c │ ├── lmic_kz865.c │ ├── lmic_ma869.c │ ├── lmic_ru864.c │ ├── lmic_us915.c │ ├── lmic_us_like.c │ ├── lmic_us_like.h │ ├── lmic_util.c │ ├── lmic_util.h │ ├── lorabase.h │ ├── lorabase_as923.h │ ├── lorabase_au915.h │ ├── lorabase_eu868.h │ ├── lorabase_in866.h │ ├── lorabase_kr920.h │ ├── lorabase_kz865.h │ ├── lorabase_ma869.h │ ├── lorabase_ru864.h │ ├── lorabase_us915.h │ ├── lorawan_spec_compliance.h │ ├── oslmic.c │ ├── oslmic.h │ ├── oslmic_types.h │ └── radio.c ├── README.md └── hardware ├── TrackerD v1.2.layout.pdf ├── TrackerD v1.2.sch.pdf └── TrackerD v1.2.silkscreen.pdf /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set the default behavior, in case people don't have core.autocrlf set. 2 | * text=auto 3 | 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.toptal.com/developers/gitignore/api/platformio 3 | # Edit at https://www.toptal.com/developers/gitignore?templates=platformio 4 | 5 | ### PlatformIO ### 6 | .pioenvs 7 | .piolibdeps 8 | .clang_complete 9 | .gcc-flags.json 10 | .pio 11 | 12 | # End of https://www.toptal.com/developers/gitignore/api/platformio 13 | 14 | -------------------------------------------------------------------------------- /Example/BLE_Indoor_Positioning_Software/BLE_Positioning/BLE_Positioning.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dragino/TrackerD/17da65a702d8cabf88331d2f1550f4b046dae9ce/Example/BLE_Indoor_Positioning_Software/BLE_Positioning/BLE_Positioning.exe -------------------------------------------------------------------------------- /Example/BLE_Indoor_Positioning_Software/BLE_Positioning/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dragino/TrackerD/17da65a702d8cabf88331d2f1550f4b046dae9ce/Example/BLE_Indoor_Positioning_Software/BLE_Positioning/icon.png -------------------------------------------------------------------------------- /Example/BLE_Indoor_Positioning_Software/BLE_Positioning/office_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dragino/TrackerD/17da65a702d8cabf88331d2f1550f4b046dae9ce/Example/BLE_Indoor_Positioning_Software/BLE_Positioning/office_map.png -------------------------------------------------------------------------------- /Example/LoRaWAN/examples/OTAA_FULL_FUNCTION/GPS.h: -------------------------------------------------------------------------------- 1 | #ifndef _GPS_h_ 2 | #define _GPS_h_ 3 | 4 | #include "common.h" 5 | 6 | #define GPS_POWER 12 7 | 8 | void GPS_Init(uint8_t power_pin=GPS_POWER); 9 | void GPS_DeInit(void); 10 | void GPS_boot(void); 11 | void GPS_shutdown(void); 12 | bool GPS_DATA(void); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /Example/LoRaWAN/examples/OTAA_FULL_FUNCTION/GXHT30.cpp: -------------------------------------------------------------------------------- 1 | #include "GXHT30.h" 2 | 3 | static uint8_t gxht_data[GXHT_DATA_LEN]={0}; 4 | 5 | void GXHT3x_Reset(void) 6 | { 7 | uint8_t buff[2]={0x30,0xA2}; 8 | I2C_Sent(gxht_addr,buff,2); 9 | } 10 | 11 | void GXHT3x_LowPower(void) 12 | { 13 | uint8_t buff[2]={0x24,016}; 14 | I2C_Sent(gxht_addr,buff,2); 15 | } 16 | 17 | void GXHT3x_GetData(void) 18 | { 19 | uint8_t buff[2]={0x2C,0x06}; 20 | I2C_Sent(gxht_addr,buff,2); 21 | I2C_Read(gxht_addr,gxht_data,GXHT_DATA_LEN,100); 22 | } 23 | 24 | float GXHT3x_GetHum(void) 25 | { 26 | float hum = 0.0; 27 | hum = ((((gxht_data[3] * 256.0) + gxht_data[4]) * 100) / 65535.0); 28 | Serial.printf("HUM:%.2f\n",hum); 29 | return hum; 30 | } 31 | 32 | float GXHT3x_GetTem(void) 33 | { 34 | float tem = 0.0; 35 | tem = ((((gxht_data[0] * 256.0) + gxht_data[1]) * 175) / 65535.0) - 45; 36 | Serial.printf("TEM:%.2f\n",tem); 37 | return tem; 38 | } -------------------------------------------------------------------------------- /Example/LoRaWAN/examples/OTAA_FULL_FUNCTION/GXHT30.h: -------------------------------------------------------------------------------- 1 | #ifndef _gxht30_h_ 2 | #define _gxht30_h_ 3 | 4 | #include "common.h" 5 | 6 | #define gxht_addr 0x44 7 | #define GXHT_DATA_LEN 6 8 | 9 | 10 | void GXHT3x_Sent(uint8_t* buff,uint8_t buff_len); 11 | void GXHT3x_Reset(void); 12 | void GXHT3x_LowPower(void); 13 | void GXHT3x_GetData(void); 14 | float GXHT3x_GetHum(void); 15 | float GXHT3x_GetTem(void); 16 | 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /Example/LoRaWAN/examples/OTAA_FULL_FUNCTION/common.h: -------------------------------------------------------------------------------- 1 | #ifndef _common_h_ 2 | #define _common_h_ 3 | 4 | #include "WiFi.h" 5 | #include "EEPROM.h" 6 | #include "Wire.h" 7 | #include "lora.h" 8 | #include "extiButton.h" 9 | 10 | 11 | #define Pro_model "LGT92 " 12 | #define Pro_version "v1.0.0 " 13 | #define EEPROM_DATA_SIZE 512 14 | #define EEPROM_KEY_SIZE 68 15 | #define EEPROM_GPSDATA_SIZE 4096 16 | 17 | #define BAT_PIN_READ 35 18 | #define BAT_PIN_LOW 4 19 | #define LED_PIN_RED 13 20 | #define LED_PIN_BLUE 2 21 | #define LED_PIN_GREEN 15 22 | 23 | #define DEFAULT_MODE 0x00 24 | #define MOVE_DETECT_MODE 0x01 25 | #define COLLISION_DETECT_MODE 0x02 26 | #define CUSTOM_MOVE_DETECT_MODE 0x03 27 | #define GXHT3x_MODE 0x04 28 | 29 | class SYS:public LORA 30 | { 31 | public: 32 | SYS(uint8_t pin_red=LED_PIN_RED,uint8_t pin_blue=LED_PIN_BLUE,uint8_t pin_green=LED_PIN_GREEN); 33 | ~SYS(void); 34 | void eeprom_init(void); 35 | void DATA_CLEAR(void); 36 | void config_Write(void); 37 | void config_Read(void); 38 | void gps_data_Weite(void); 39 | void gps_data_Read(void); 40 | void read_gps_data_on_flash(); 41 | void GPSDATA_CLEAR(void); 42 | uint8_t gps_data_buff[15]; 43 | uint32_t tdc = 1200000; //uint:ms 44 | uint8_t mod = 0; 45 | uint8_t lon = 1; //1:on 2:0ff 46 | uint32_t Positioning_time = 180000; 47 | uint8_t frame = 0; 48 | uint8_t alarm = 0; 49 | uint8_t gps_start = 1; 50 | uint8_t gps_alarm = 0; 51 | uint8_t alarm_count = 0; 52 | uint8_t buzzer_flag = 0; 53 | uint8_t exti_flag = 1; 54 | uint8_t sleep_flag = 0; 55 | uint8_t port = 2; 56 | uint8_t sensor_mode = 1; 57 | uint16_t fire_version=0; 58 | uint8_t channel_single = 1; 59 | uint32_t addr_gps_write=0; 60 | uint32_t addr_gps_read=0; 61 | uint8_t frame_ACK =0; 62 | uint8_t frame_flag = 0; 63 | uint8_t loggpsdata_send = 0; 64 | int data_read = 0; 65 | bool gps_work_flag = true; 66 | bool collect_sensor_flag = false; 67 | 68 | private: 69 | }; 70 | class Devicet 71 | { 72 | public: 73 | uint8_t sensor_type; 74 | 75 | uint16_t firm_ver; 76 | 77 | uint8_t freq_band; 78 | 79 | uint8_t sub_band; 80 | 81 | uint16_t battrey; 82 | }; 83 | 84 | #include "at.h" 85 | #include "GPS.h" 86 | #include "GXHT30.h" 87 | 88 | class Sensor 89 | { 90 | public: 91 | int hum=0; 92 | int tem=0; 93 | int bat=0; 94 | int latitude=0; 95 | int longitude=0; 96 | int year_gps = 0; 97 | int month_gps = 0; 98 | int day_gps = 0; 99 | int hour_gps = 0; 100 | int minute_gps = 0; 101 | int second_gps = 0; 102 | float pdop_gps ; 103 | int Fix_Status; 104 | int16_t x=0; 105 | int16_t y=0; 106 | int16_t z=0; 107 | }; 108 | 109 | extern SYS sys; 110 | extern Sensor sensor; 111 | extern Devicet devicet; 112 | 113 | int BatGet(void); 114 | void buzzer(void); 115 | void Stop_buzzer(void); 116 | void Device_status(); 117 | void I2C_Sent(int addr,uint8_t* buff,uint8_t buff_len); 118 | void I2C_Read(int addr,uint8_t* buff,uint8_t buff_len,int delay_ms); 119 | char *rtrim(char* str); 120 | void StrToHex(uint8_t *pbDest, char *pszSrc, int nLen); 121 | uint16_t string_touint(void); 122 | void Device_status(); 123 | #endif 124 | -------------------------------------------------------------------------------- /Example/LoRaWAN/examples/OTAA_FULL_FUNCTION/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _config_h_ 2 | #define _config_h_ 3 | 4 | #define Pro_model "Skylab " 5 | #define Pro_version "v1.0.0 " 6 | //#define EEPROM_SIZE 128 7 | //#define EEPROM_KEY_SIZE 32 8 | 9 | #define maxRxSize 128 10 | 11 | 12 | #define EXTI_PIN 0 13 | #define BAT_PIN_READ 35 14 | #define BAT_PIN_LOW 4 15 | #define LED_PIN_RED 15 16 | #define LED_PIN_BLUE 2 17 | #define LED_PIN_GREEN 13 18 | -------------------------------------------------------------------------------- /Example/LoRaWAN/examples/OTAA_FULL_FUNCTION/extiButton.h: -------------------------------------------------------------------------------- 1 | #ifndef _extiButton_h_ 2 | #define _extiButton_h_ 3 | 4 | 5 | #include 6 | #include "OneButton.h"//引用库函数 7 | #include "common.h" 8 | 9 | #define BUTTON_PIN 0 //将按钮引脚绑定到GPIO 0 10 | 11 | void attachClick(); 12 | 13 | void attachDoubleClick(); 14 | 15 | void attachLongPressStart(); 16 | 17 | void attachDuringLongPress(); 18 | 19 | void attachLongPressStop(); 20 | 21 | void attachMultiClick(); 22 | 23 | void button_event_init(); 24 | 25 | void button_attach_loop(); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /Example/LoRaWAN/examples/OTAA_FULL_FUNCTION/lora.cpp: -------------------------------------------------------------------------------- 1 | #include "lora.h" 2 | 3 | LORA::LORA() 4 | {} 5 | 6 | LORA::~LORA() 7 | {} 8 | 9 | void LORA::LORA_SetDEUI( uint8_t *deui) 10 | { 11 | memcpy(deveui,deui,8); 12 | } 13 | 14 | void LORA::LORA_GetDEUI( uint8_t *deui) 15 | { 16 | memcpy(deui,deveui,8); 17 | } 18 | 19 | void LORA::LORA_SetAEUI( uint8_t *aeui) 20 | { 21 | memcpy(appeui,aeui,8); 22 | } 23 | 24 | void LORA::LORA_GetAEUI( uint8_t *aeui) 25 | { 26 | memcpy(aeui,appeui,8); 27 | } 28 | 29 | void LORA::LORA_SetAKEY( uint8_t *akey) 30 | { 31 | memcpy(appkey,akey,16); 32 | } 33 | 34 | void LORA::LORA_GetAKEY( uint8_t *akey) 35 | { 36 | memcpy(akey,appkey,16); 37 | } 38 | 39 | void LORA::LORA_SetAPPSKEY( uint8_t *appskey) 40 | { 41 | memcpy(appSKey,appskey,16); 42 | } 43 | 44 | void LORA::LORA_GetAPPSKEY( uint8_t *appskey) 45 | { 46 | memcpy(appskey,appSKey,16); 47 | } 48 | 49 | void LORA::LORA_SetNWKSKEY( uint8_t *nwkskey) 50 | { 51 | memcpy(nwkSKey,nwkskey,16); 52 | } 53 | 54 | void LORA::LORA_GetNWKSKEY( uint8_t *nwkskey) 55 | { 56 | memcpy(nwkskey,nwkSKey,16); 57 | } 58 | 59 | void LORA::LORA_SetDevaddr(uint32_t daddr) 60 | { 61 | devaddr = daddr; 62 | } 63 | 64 | uint32_t LORA::LORA_GetDevaddr( void) 65 | { 66 | return devaddr; 67 | } 68 | 69 | void LORA::LORA_SetADR(bool _adr) 70 | { 71 | adr_flag = _adr; 72 | } 73 | 74 | bool LORA::LORA_GetADR(void) 75 | { 76 | return adr_flag; 77 | } 78 | 79 | void LORA::LORA_SetDR(uint8_t _dr) 80 | { 81 | dr = _dr; 82 | } 83 | 84 | uint8_t LORA::LORA_GetDR(void) 85 | { 86 | return dr; 87 | } 88 | 89 | void LORA::LORA_SetTXP(uint8_t _txp) 90 | { 91 | txp = _txp; 92 | } 93 | 94 | uint8_t LORA::LORA_GetTXP(void) 95 | { 96 | return txp; 97 | } 98 | 99 | void LORA::LORA_EnterSleepMode( void) 100 | { 101 | uint8_t cmd = 0; 102 | uint8_t reg_mode = 0x01; 103 | hal_spi_write(reg_mode,&cmd,1); 104 | } 105 | 106 | -------------------------------------------------------------------------------- /Example/LoRaWAN/examples/OTAA_FULL_FUNCTION/lora.h: -------------------------------------------------------------------------------- 1 | #ifndef _lora_h_ 2 | #define _lora_h_ 3 | 4 | #include 5 | #include 6 | #include "Arduino.h" 7 | 8 | #define ADR_ENABLE 1 9 | 10 | class LORA 11 | { 12 | public: 13 | LORA(); 14 | ~LORA(); 15 | 16 | uint32_t netid; 17 | uint8_t appSKey[16]={0}; 18 | uint8_t nwkSKey[16]={0}; 19 | uint32_t devaddr = 0; 20 | 21 | void LORA_SetDEUI( uint8_t *deui); 22 | void LORA_GetDEUI( uint8_t *deui); 23 | 24 | void LORA_SetAEUI( uint8_t *aeui); 25 | void LORA_GetAEUI( uint8_t *aeui); 26 | 27 | void LORA_SetAKEY( uint8_t *akey); 28 | void LORA_GetAKEY( uint8_t *akey); 29 | 30 | void LORA_SetAPPSKEY( uint8_t *appskey); 31 | void LORA_GetAPPSKEY( uint8_t *appskey); 32 | 33 | void LORA_SetNWKSKEY( uint8_t *nwkskey); 34 | void LORA_GetNWKSKEY( uint8_t *nwkskey); 35 | 36 | void LORA_SetDevaddr(uint32_t daddr); 37 | uint32_t LORA_GetDevaddr( void); 38 | 39 | void LORA_SetADR(bool _adr); 40 | bool LORA_GetADR(void); 41 | 42 | void LORA_SetDR(uint8_t _dr); 43 | uint8_t LORA_GetDR(void); 44 | 45 | void LORA_SetTXP(uint8_t _txp); 46 | uint8_t LORA_GetTXP(void); 47 | 48 | void LORA_EnterSleepMode( void); 49 | 50 | private: 51 | uint8_t deveui[8]={0}; //lsb 52 | uint8_t appeui[8]={0}; //lsb 53 | uint8_t appkey[16]={0}; //msb 54 | bool adr_flag; 55 | uint8_t dr; 56 | uint8_t txp; 57 | }; 58 | 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /Example/LoRaWAN/examples/OTAA_FULL_FUNCTION/recording.txt: -------------------------------------------------------------------------------- 1 | 欲完成功能: 2 | 1. 3 | 4 | -------------------------------------------------------------------------------- /Example/LoRaWAN/examples/TrackerD/GPS.h: -------------------------------------------------------------------------------- 1 | #ifndef _GPS_h_ 2 | #define _GPS_h_ 3 | 4 | #include "common.h" 5 | 6 | #define GPS_POWER 12 7 | #define GPS_RESET 25 8 | 9 | void GPS_Init(uint8_t power_pin=GPS_POWER); 10 | void GPS_DeInit(void); 11 | void GPS_boot(void); 12 | void GPS_shutdown(void); 13 | bool GPS_DATA(void); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /Example/LoRaWAN/examples/TrackerD/GXHT30.cpp: -------------------------------------------------------------------------------- 1 | #include "GXHT30.h" 2 | 3 | static uint8_t gxht_data[GXHT_DATA_LEN]={0}; 4 | 5 | void GXHT3x_Reset(void) 6 | { 7 | uint8_t buff[2]={0x30,0xA2}; 8 | I2C_Sent(gxht_addr,buff,2); 9 | } 10 | 11 | void GXHT3x_LowPower(void) 12 | { 13 | uint8_t buff[2]={0x24,016}; 14 | I2C_Sent(gxht_addr,buff,2); 15 | } 16 | 17 | void GXHT3x_GetData(void) 18 | { 19 | uint8_t buff[2]={0x2C,0x06}; 20 | I2C_Sent(gxht_addr,buff,2); 21 | I2C_Read(gxht_addr,gxht_data,GXHT_DATA_LEN,100); 22 | } 23 | 24 | float GXHT3x_GetHum(void) 25 | { 26 | float hum = 0.0; 27 | hum = ((((gxht_data[3] * 256.0) + gxht_data[4]) * 100) / 65535.0); 28 | Serial.printf("HUM:%.2f\r\n",hum); 29 | return hum; 30 | } 31 | 32 | float GXHT3x_GetTem(void) 33 | { 34 | float tem = 0.0; 35 | tem = ((((gxht_data[0] * 256.0) + gxht_data[1]) * 175) / 65535.0) - 45; 36 | Serial.printf("TEM:%.2f\r\n",tem); 37 | return tem; 38 | } 39 | -------------------------------------------------------------------------------- /Example/LoRaWAN/examples/TrackerD/GXHT30.h: -------------------------------------------------------------------------------- 1 | #ifndef _gxht30_h_ 2 | #define _gxht30_h_ 3 | 4 | #include "common.h" 5 | 6 | #define gxht_addr 0x44 7 | #define GXHT_DATA_LEN 6 8 | 9 | 10 | void GXHT3x_Sent(uint8_t* buff,uint8_t buff_len); 11 | void GXHT3x_Reset(void); 12 | void GXHT3x_LowPower(void); 13 | void GXHT3x_GetData(void); 14 | float GXHT3x_GetHum(void); 15 | float GXHT3x_GetTem(void); 16 | 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /Example/LoRaWAN/examples/TrackerD/blescan.h: -------------------------------------------------------------------------------- 1 | #ifndef _blescan_h_ 2 | #define _blescan_h_ 3 | 4 | #include "common.h" 5 | 6 | 7 | void ble_init(); 8 | void ble_run(); 9 | void ble_data(void); 10 | int hexToint_ble(char *str); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /Example/LoRaWAN/examples/TrackerD/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _config_h_ 2 | #define _config_h_ 3 | 4 | #define Pro_model "TrackerD " 5 | #define Pro_version "v1.4.9" 6 | //#define EEPROM_SIZE 128 7 | //#define EEPROM_KEY_SIZE 32 8 | 9 | #define maxRxSize 128 10 | 11 | #define EXTI_PIN 0 12 | #define BAT_PIN_READ 35 13 | #define BAT_PIN_LOW 4 14 | #define LED_PIN_RED 15 15 | #define LED_PIN_BLUE 2 16 | #define LED_PIN_GREEN 13 17 | -------------------------------------------------------------------------------- /Example/LoRaWAN/examples/TrackerD/extiButton.h: -------------------------------------------------------------------------------- 1 | #ifndef _extiButton_h_ 2 | #define _extiButton_h_ 3 | 4 | 5 | #include 6 | #include "OneButton.h" 7 | #include "common.h" 8 | 9 | #define BUTTON_PIN 0 10 | 11 | void attachClick(); 12 | 13 | void attachDoubleClick(); 14 | 15 | void attachLongPressStart(); 16 | 17 | void attachDuringLongPress(); 18 | 19 | void attachLongPressStop(); 20 | 21 | void attachMultiClick(); 22 | 23 | void button_event_init(); 24 | 25 | void button_attach_loop(); 26 | 27 | void alarm(); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /Example/LoRaWAN/examples/TrackerD/extiButtonLS.h: -------------------------------------------------------------------------------- 1 | #ifndef _extiButtonLS_h_ 2 | #define _extiButtonLS_h_ 3 | 4 | 5 | #include 6 | #include "OneButton.h" 7 | #include "common.h" 8 | 9 | #define BUTTON_PIN1 25 10 | 11 | void attachClick1(); 12 | 13 | void attachDoubleClick1(); 14 | 15 | void attachLongPressStart1(); 16 | 17 | void attachDuringLongPress1(); 18 | 19 | void attachLongPressStop1(); 20 | 21 | void attachMultiClick1(); 22 | 23 | void button_event_init1(); 24 | 25 | void button_attach_loop1(); 26 | 27 | void alarm1(); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /Example/LoRaWAN/examples/TrackerD/lora.cpp: -------------------------------------------------------------------------------- 1 | #include "lora.h" 2 | 3 | LORA::LORA() 4 | {} 5 | 6 | LORA::~LORA() 7 | {} 8 | 9 | void LORA::LORA_SetDEUI( uint8_t *deui) 10 | { 11 | memcpy(deveui,deui,8); 12 | } 13 | 14 | void LORA::LORA_GetDEUI( uint8_t *deui) 15 | { 16 | memcpy(deui,deveui,8); 17 | } 18 | 19 | void LORA::LORA_SetAEUI( uint8_t *aeui) 20 | { 21 | memcpy(appeui,aeui,8); 22 | } 23 | 24 | void LORA::LORA_GetAEUI( uint8_t *aeui) 25 | { 26 | memcpy(aeui,appeui,8); 27 | } 28 | 29 | void LORA::LORA_SetAKEY( uint8_t *akey) 30 | { 31 | memcpy(appkey,akey,16); 32 | } 33 | 34 | void LORA::LORA_GetAKEY( uint8_t *akey) 35 | { 36 | memcpy(akey,appkey,16); 37 | } 38 | 39 | void LORA::LORA_SetAPPSKEY( uint8_t *appskey) 40 | { 41 | memcpy(appSKey,appskey,16); 42 | } 43 | 44 | void LORA::LORA_GetAPPSKEY( uint8_t *appskey) 45 | { 46 | memcpy(appskey,appSKey,16); 47 | } 48 | 49 | void LORA::LORA_SetNWKSKEY( uint8_t *nwkskey) 50 | { 51 | memcpy(nwkSKey,nwkskey,16); 52 | } 53 | 54 | void LORA::LORA_GetNWKSKEY( uint8_t *nwkskey) 55 | { 56 | memcpy(nwkskey,nwkSKey,16); 57 | } 58 | 59 | void LORA::LORA_SetDevaddr(uint32_t daddr) 60 | { 61 | devaddr = daddr; 62 | } 63 | 64 | uint32_t LORA::LORA_GetDevaddr( void) 65 | { 66 | return devaddr; 67 | } 68 | 69 | void LORA::LORA_SetADR(bool _adr) 70 | { 71 | adr_flag = _adr; 72 | } 73 | 74 | bool LORA::LORA_GetADR(void) 75 | { 76 | return adr_flag; 77 | } 78 | 79 | void LORA::LORA_SetDR(uint8_t _dr) 80 | { 81 | dr = _dr; 82 | } 83 | 84 | uint8_t LORA::LORA_GetDR(void) 85 | { 86 | return dr; 87 | } 88 | 89 | void LORA::LORA_SetTXP(uint8_t _txp) 90 | { 91 | txp = _txp; 92 | } 93 | 94 | uint8_t LORA::LORA_GetTXP(void) 95 | { 96 | return txp; 97 | } 98 | 99 | void LORA::LORA_EnterSleepMode( void) 100 | { 101 | uint8_t cmd = 0; 102 | uint8_t reg_mode = 0x01; 103 | hal_spi_write(reg_mode,&cmd,1); 104 | } 105 | 106 | -------------------------------------------------------------------------------- /Example/LoRaWAN/examples/TrackerD/lora.h: -------------------------------------------------------------------------------- 1 | #ifndef _lora_h_ 2 | #define _lora_h_ 3 | 4 | #include 5 | #include 6 | #include "Arduino.h" 7 | 8 | #define ADR_ENABLE 1 9 | 10 | class LORA 11 | { 12 | public: 13 | LORA(); 14 | ~LORA(); 15 | 16 | uint32_t netid; 17 | uint8_t appSKey[16]={0}; 18 | uint8_t nwkSKey[16]={0}; 19 | uint32_t devaddr = 0; 20 | 21 | void LORA_SetDEUI( uint8_t *deui); 22 | void LORA_GetDEUI( uint8_t *deui); 23 | 24 | void LORA_SetAEUI( uint8_t *aeui); 25 | void LORA_GetAEUI( uint8_t *aeui); 26 | 27 | void LORA_SetAKEY( uint8_t *akey); 28 | void LORA_GetAKEY( uint8_t *akey); 29 | 30 | void LORA_SetAPPSKEY( uint8_t *appskey); 31 | void LORA_GetAPPSKEY( uint8_t *appskey); 32 | 33 | void LORA_SetNWKSKEY( uint8_t *nwkskey); 34 | void LORA_GetNWKSKEY( uint8_t *nwkskey); 35 | 36 | void LORA_SetDevaddr(uint32_t daddr); 37 | uint32_t LORA_GetDevaddr( void); 38 | 39 | void LORA_SetADR(bool _adr); 40 | bool LORA_GetADR(void); 41 | 42 | void LORA_SetDR(uint8_t _dr); 43 | uint8_t LORA_GetDR(void); 44 | 45 | void LORA_SetTXP(uint8_t _txp); 46 | uint8_t LORA_GetTXP(void); 47 | 48 | void LORA_EnterSleepMode( void); 49 | 50 | private: 51 | uint8_t deveui[8]={0}; //lsb 52 | uint8_t appeui[8]={0}; //lsb 53 | uint8_t appkey[16]={0}; //msb 54 | bool adr_flag; 55 | uint8_t dr; 56 | uint8_t txp; 57 | }; 58 | 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /Example/LoRaWAN/examples/TrackerD/notes.h: -------------------------------------------------------------------------------- 1 | // contains note definitions so you don't need to know specific frequencies. Just a bit of music theory 2 | #define NOTE_B0 31 3 | #define NOTE_C1 33 4 | #define NOTE_CS1 35 5 | #define NOTE_D1 37 6 | #define NOTE_DS1 39 7 | #define NOTE_E1 41 8 | #define NOTE_F1 44 9 | #define NOTE_FS1 46 10 | #define NOTE_G1 49 11 | #define NOTE_GS1 52 12 | #define NOTE_A1 55 13 | #define NOTE_AS1 58 14 | #define NOTE_B1 62 15 | #define NOTE_C2 65 16 | #define NOTE_CS2 69 17 | #define NOTE_D2 73 18 | #define NOTE_DS2 78 19 | #define NOTE_E2 82 20 | #define NOTE_F2 87 21 | #define NOTE_FS2 93 22 | #define NOTE_G2 98 23 | #define NOTE_GS2 104 24 | #define NOTE_A2 110 25 | #define NOTE_AS2 117 26 | #define NOTE_B2 123 27 | #define NOTE_C3 131 28 | #define NOTE_CS3 139 29 | #define NOTE_D3 147 30 | #define NOTE_DS3 156 31 | #define NOTE_E3 165 32 | #define NOTE_F3 175 33 | #define NOTE_FS3 185 34 | #define NOTE_G3 196 35 | #define NOTE_GS3 208 36 | #define NOTE_A3 220 37 | #define NOTE_AS3 233 38 | #define NOTE_B3 247 39 | #define NOTE_C4 262 40 | #define NOTE_CS4 277 41 | #define NOTE_D4 294 42 | #define NOTE_DS4 311 43 | #define NOTE_E4 330 44 | #define NOTE_F4 349 45 | #define NOTE_FS4 370 46 | #define NOTE_G4 392 47 | #define NOTE_GS4 415 48 | #define NOTE_A4 440 49 | #define NOTE_AS4 466 50 | #define NOTE_B4 494 51 | #define NOTE_C5 523 52 | #define NOTE_CS5 554 53 | #define NOTE_D5 587 54 | #define NOTE_DS5 622 55 | #define NOTE_E5 659 56 | #define NOTE_F5 698 57 | #define NOTE_FS5 740 58 | #define NOTE_G5 784 59 | #define NOTE_GS5 831 60 | #define NOTE_A5 880 61 | #define NOTE_AS5 932 62 | #define NOTE_B5 988 63 | #define NOTE_C6 1047 64 | #define NOTE_CS6 1109 65 | #define NOTE_D6 1175 66 | #define NOTE_DS6 1245 67 | #define NOTE_E6 1319 68 | #define NOTE_F6 1397 69 | #define NOTE_FS6 1480 70 | #define NOTE_G6 1568 71 | #define NOTE_GS6 1661 72 | #define NOTE_A6 1760 73 | #define NOTE_AS6 1865 74 | #define NOTE_B6 1976 75 | #define NOTE_C7 2093 76 | #define NOTE_CS7 2217 77 | #define NOTE_D7 2349 78 | #define NOTE_DS7 2489 79 | #define NOTE_E7 2637 80 | #define NOTE_F7 2794 81 | #define NOTE_FS7 2960 82 | #define NOTE_G7 3136 83 | #define NOTE_GS7 3322 84 | #define NOTE_A7 3520 85 | #define NOTE_AS7 3729 86 | #define NOTE_B7 3951 87 | #define NOTE_C8 4186 88 | #define NOTE_CS8 4435 89 | #define NOTE_D8 4699 90 | #define NOTE_DS8 4978 -------------------------------------------------------------------------------- /Example/LoRaWAN/examples/TrackerD/wifiscan.h: -------------------------------------------------------------------------------- 1 | #ifndef _wifiscan_h_ 2 | #define _wifiscan_h_ 3 | 4 | #include "common.h" 5 | 6 | void wifi_scan(void); 7 | 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /Example/LoRaWAN/examples/extras/STMicroelectronics-LIS3DHTR_C15134.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dragino/TrackerD/17da65a702d8cabf88331d2f1550f4b046dae9ce/Example/LoRaWAN/examples/extras/STMicroelectronics-LIS3DHTR_C15134.pdf -------------------------------------------------------------------------------- /Example/LoRaWAN/examples/extras/apply_patches.py: -------------------------------------------------------------------------------- 1 | from os.path import join, isfile 2 | 3 | Import("env") 4 | 5 | FRAMEWORK_DIR = env.PioPlatform().get_package_dir("framework-arduinoespressif32") 6 | patchflag_path = join(FRAMEWORK_DIR, ".patching-done") 7 | 8 | # patch file only if we didn't do it before 9 | if not isfile(join(FRAMEWORK_DIR, ".patching-done")): 10 | original_file = join(FRAMEWORK_DIR, "variants", "pico32", "pins_arduino.h") 11 | patched_file = join("examples", "extras", "patches", "pico32_dragino_trackerd.patch") 12 | 13 | assert isfile(original_file) and isfile(patched_file) 14 | 15 | env.Execute("patch %s %s" % (original_file, patched_file)) 16 | # env.Execute("touch " + patchflag_path) 17 | 18 | 19 | def _touch(path): 20 | with open(path, "w") as fp: 21 | fp.write("") 22 | 23 | env.Execute(lambda *args, **kwargs: _touch(patchflag_path)) 24 | -------------------------------------------------------------------------------- /Example/LoRaWAN/examples/extras/patches/pico32_dragino_trackerd.patch: -------------------------------------------------------------------------------- 1 | 20,21c20,21 2 | < static const uint8_t SS = 5; 3 | < static const uint8_t MOSI = 23; 4 | --- 5 | > static const uint8_t SS = 18; 6 | > static const uint8_t MOSI = 27; 7 | 23c23 8 | < static const uint8_t SCK = 18; 9 | --- 10 | > static const uint8_t SCK = 5; 11 | -------------------------------------------------------------------------------- /Example/LoRaWAN/examples/extras/patches/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t TX = 1; 15 | static const uint8_t RX = 3; 16 | 17 | static const uint8_t SDA = 21; 18 | static const uint8_t SCL = 22; 19 | 20 | static const uint8_t SS = 18; 21 | static const uint8_t MOSI = 27; 22 | static const uint8_t MISO = 19; 23 | static const uint8_t SCK = 5; 24 | 25 | static const uint8_t A0 = 36; 26 | static const uint8_t A3 = 39; 27 | static const uint8_t A4 = 32; 28 | static const uint8_t A5 = 33; 29 | static const uint8_t A6 = 34; 30 | static const uint8_t A7 = 35; 31 | static const uint8_t A10 = 4; 32 | static const uint8_t A11 = 0; 33 | static const uint8_t A12 = 2; 34 | static const uint8_t A13 = 15; 35 | static const uint8_t A14 = 13; 36 | static const uint8_t A15 = 12; 37 | static const uint8_t A16 = 14; 38 | static const uint8_t A17 = 27; 39 | static const uint8_t A18 = 25; 40 | static const uint8_t A19 = 26; 41 | 42 | static const uint8_t T0 = 4; 43 | static const uint8_t T1 = 0; 44 | static const uint8_t T2 = 2; 45 | static const uint8_t T3 = 15; 46 | static const uint8_t T4 = 13; 47 | static const uint8_t T5 = 12; 48 | static const uint8_t T6 = 14; 49 | static const uint8_t T7 = 27; 50 | static const uint8_t T8 = 33; 51 | static const uint8_t T9 = 32; 52 | 53 | static const uint8_t DAC1 = 25; 54 | static const uint8_t DAC2 = 26; 55 | 56 | #endif /* Pins_Arduino_h */ 57 | -------------------------------------------------------------------------------- /Example/LoRaWAN/platformio.ini: -------------------------------------------------------------------------------- 1 | ; PlatformIO Project Configuration File 2 | ; 3 | ; Please visit documentation for the other options and examples 4 | ; https://docs.platformio.org/page/projectconf.html 5 | 6 | [platformio] 7 | default_envs = 8 | dragino_lbt2 9 | src_dir = examples/TrackerD 10 | 11 | [common] 12 | monitor_speed = 115200 ; No need to change this. 13 | build_flags = 14 | -D DO_WORK_INTERVAL_SECONDS=60 15 | ; -D ABP_ACTIVATION ; Use ABP instead of OTAA activation. 16 | lib_deps = 17 | 18 | 19 | 20 | [mcci_lmic] 21 | ; Perform 'PlatformIO: Clean' after changing library version and 22 | ; in case of issues remove the old version from .pio/libdeps/*. 23 | lib_deps = 24 | ; Please test before changing version 25 | ; mcci-catena/MCCI LoRaWAN LMIC library@4.1.0 26 | mcci-catena/MCCI LoRaWAN LMIC library@4.1.1 27 | build_flags = 28 | ; Workaround for incompatibility with Arduino-ESP32 2.x 29 | -D hal_init=LMICHAL_init 30 | 31 | ; Use platformio.ini for settings instead lmic_project_config.h. 32 | -D ARDUINO_LMIC_PROJECT_CONFIG_H_SUPPRESS 33 | 34 | ; Ping and beacons not supported for class A, disable to save memory. 35 | -D DISABLE_PING 36 | -D DISABLE_BEACONS 37 | 38 | -D LMIC_DEBUG_LEVEL=2 ; 0, 1 or 2 39 | 40 | ; -D CFG_sx1272_radio=1 ; Use for SX1272 radio 41 | -D CFG_sx1276_radio=1 ; Use for SX1276 radio 42 | ; -D CFG_sx1276mb1_board=1 43 | -D USE_ORIGINAL_AES ; Faster but larger, see docs 44 | ; -D USE_IDEETRON_AES 45 | ; -D LMIC_USE_INTERRUPTS ; Not tested or supported on many platforms 46 | ; -D LMIC_ENABLE_DeviceTimeReq=1 ; Network time support 47 | ; -D LMIC_LORAWAN_SPEC_VERSION=LMIC_LORAWAN_SPEC_VERSION_1_0_2 48 | -D LMIC_LORAWAN_SPEC_VERSION=LMIC_LORAWAN_SPEC_VERSION_1_0_3 49 | 50 | ; --- Regional settings ----- 51 | ; Enable only one of the following regions: 52 | ; -D CFG_as923=1 53 | ; -D CFG_as923jp=1 54 | ; -D CFG_au915=1 55 | ; -D CFG_cn490=1 ; Not yet supported 56 | ; -D CFG_cn783=1 ; Not yet supported 57 | ; -D CFG_eu433=1 ; Not yet supported 58 | -D CFG_eu868=1 59 | ; -D CFG_in866=1 60 | ; -D CFG_kr920=1 61 | ; -D CFG_us915=1 62 | 63 | 64 | 65 | [tinygpsplus] 66 | lib_deps = 67 | mikalhart/TinyGPSPlus@1.0.2 68 | build_flags = 69 | 70 | 71 | 72 | [env:dragino_lbt2] 73 | ;lib_ldf_mode = off 74 | ;platform = espressif32 75 | platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream 76 | ;platform = https://github.com/platformio/platform-espressif32.git#develop 77 | board = pico32 78 | ;board_f_flash = 80000000L 79 | board_build.f_flash = 80000000L 80 | framework = arduino 81 | upload_speed = 921600 82 | monitor_speed = ${common.monitor_speed} 83 | platform_packages = 84 | ; platformio/framework-arduinoespressif32@3 85 | platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.1-RC1 86 | lib_deps = 87 | ${common.lib_deps} 88 | ${mcci_lmic.lib_deps} 89 | ${tinygpsplus.lib_deps} 90 | build_flags = 91 | ${common.build_flags} 92 | ${mcci_lmic.build_flags} 93 | ${tinygpsplus.build_flags} 94 | -D BSFILE=\"boards/dragino_lbt2.h\" 95 | -D LMIC_PRINTF_TO=Serial 96 | board_build.partitions = no_ota.csv 97 | extra_scripts = pre:examples/extras/apply_patches.py -------------------------------------------------------------------------------- /Example/None LoRaWAN/pingpong/LoRaReceiver/LoRaReceiver.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void setup() { 5 | Serial.begin(115200); 6 | while (!Serial); 7 | 8 | Serial.println("LoRa Receiver"); 9 | 10 | if (!LoRa.begin(915E6)) { 11 | Serial.println("Starting LoRa failed!"); 12 | while (1); 13 | } 14 | } 15 | 16 | void loop() { 17 | // try to parse packet 18 | int packetSize = LoRa.parsePacket(); 19 | if (packetSize) { 20 | // received a packet 21 | Serial.print("Received packet '"); 22 | 23 | // read packet 24 | while (LoRa.available()) { 25 | Serial.print((char)LoRa.read()); 26 | } 27 | 28 | // print RSSI of packet 29 | Serial.print("' with RSSI "); 30 | Serial.println(LoRa.packetRssi()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Example/None LoRaWAN/pingpong/LoRaSender/LoRaSender.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int counter = 0; 5 | 6 | void setup() { 7 | Serial.begin(115200); 8 | while (!Serial); 9 | 10 | Serial.println("LoRa Sender"); 11 | 12 | if (!LoRa.begin(915E6)) { 13 | Serial.println("Starting LoRa failed!"); 14 | while (1); 15 | } 16 | } 17 | 18 | void loop() { 19 | Serial.print("Sending packet: "); 20 | Serial.println(counter); 21 | 22 | // send packet 23 | LoRa.beginPacket(); 24 | LoRa.print("hello "); 25 | LoRa.print(counter); 26 | LoRa.endPacket(); 27 | 28 | counter++; 29 | 30 | delay(5000); 31 | } 32 | -------------------------------------------------------------------------------- /Example/None LoRaWAN/pingpong/lib/arduino-LoRa/.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [sandeepmistry] 4 | -------------------------------------------------------------------------------- /Example/None LoRaWAN/pingpong/lib/arduino-LoRa/.travis.yml: -------------------------------------------------------------------------------- 1 | language: generic 2 | env: 3 | global: 4 | - IDE_VERSION=1.8.2 5 | matrix: 6 | - BOARD="arduino:avr:uno" 7 | - BOARD="arduino:avr:micro" 8 | - BOARD="arduino:avr:mega:cpu=atmega2560" 9 | - BOARD="arduino:samd:arduino_zero_edbg" 10 | - BOARD="arduino:samd:mkr1000" 11 | - BOARD="arduino:samd:mkrzero" 12 | - BOARD="arduino:samd:mkrwan1300" 13 | - BOARD="arduino:samd:mkrwan1310" 14 | before_install: 15 | - wget http://downloads.arduino.cc/arduino-$IDE_VERSION-linux64.tar.xz 16 | - tar xf arduino-$IDE_VERSION-linux64.tar.xz 17 | - mv arduino-$IDE_VERSION $HOME/arduino-ide 18 | - export PATH=$PATH:$HOME/arduino-ide 19 | - if [[ "$BOARD" =~ "arduino:samd:" ]]; then 20 | arduino --install-boards arduino:samd &> /dev/null; 21 | fi 22 | - buildExampleSketch() { arduino --verbose-build --verify --board $BOARD $PWD/examples/$1/$1.ino; } 23 | install: 24 | - mkdir -p $HOME/Arduino/libraries 25 | - ln -s $PWD $HOME/Arduino/libraries/LoRa 26 | script: 27 | - buildExampleSketch LoRaDumpRegisters 28 | - buildExampleSketch LoRaDuplex 29 | - if [[ "$BOARD" != "arduino:samd:mkrwan1300" ]]; then 30 | buildExampleSketch LoRaDuplexCallback; 31 | fi 32 | - buildExampleSketch LoRaReceiver 33 | - if [[ "$BOARD" != "arduino:samd:mkrwan1300" ]]; then 34 | buildExampleSketch LoRaReceiverCallback; 35 | fi 36 | - buildExampleSketch LoRaSender 37 | - buildExampleSketch LoRaSenderNonBlocking 38 | - buildExampleSketch LoRaSetSpread 39 | - buildExampleSketch LoRaSetSyncWord 40 | -------------------------------------------------------------------------------- /Example/None LoRaWAN/pingpong/lib/arduino-LoRa/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Sandeep Mistry 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Example/None LoRaWAN/pingpong/lib/arduino-LoRa/examples/LoRaDumpRegisters/LoRaDumpRegisters.ino: -------------------------------------------------------------------------------- 1 | /* 2 | LoRa register dump 3 | 4 | This examples shows how to inspect and output the LoRa radio's 5 | registers on the Serial interface 6 | */ 7 | #include // include libraries 8 | #include 9 | 10 | void setup() { 11 | Serial.begin(9600); // initialize serial 12 | while (!Serial); 13 | 14 | Serial.println("LoRa Dump Registers"); 15 | 16 | // override the default CS, reset, and IRQ pins (optional) 17 | // LoRa.setPins(7, 6, 1); // set CS, reset, IRQ pin 18 | 19 | if (!LoRa.begin(915E6)) { // initialize ratio at 915 MHz 20 | Serial.println("LoRa init failed. Check your connections."); 21 | while (true); // if failed, do nothing 22 | } 23 | 24 | LoRa.dumpRegisters(Serial); 25 | } 26 | 27 | 28 | void loop() { 29 | } 30 | 31 | -------------------------------------------------------------------------------- /Example/None LoRaWAN/pingpong/lib/arduino-LoRa/examples/LoRaDuplex/LoRaDuplex.ino: -------------------------------------------------------------------------------- 1 | /* 2 | LoRa Duplex communication 3 | 4 | Sends a message every half second, and polls continually 5 | for new incoming messages. Implements a one-byte addressing scheme, 6 | with 0xFF as the broadcast address. 7 | 8 | Uses readString() from Stream class to read payload. The Stream class' 9 | timeout may affect other functuons, like the radio's callback. For an 10 | 11 | created 28 April 2017 12 | by Tom Igoe 13 | */ 14 | #include // include libraries 15 | #include 16 | 17 | const int csPin = 7; // LoRa radio chip select 18 | const int resetPin = 6; // LoRa radio reset 19 | const int irqPin = 1; // change for your board; must be a hardware interrupt pin 20 | 21 | String outgoing; // outgoing message 22 | 23 | byte msgCount = 0; // count of outgoing messages 24 | byte localAddress = 0xBB; // address of this device 25 | byte destination = 0xFF; // destination to send to 26 | long lastSendTime = 0; // last send time 27 | int interval = 2000; // interval between sends 28 | 29 | void setup() { 30 | Serial.begin(9600); // initialize serial 31 | while (!Serial); 32 | 33 | Serial.println("LoRa Duplex"); 34 | 35 | // override the default CS, reset, and IRQ pins (optional) 36 | LoRa.setPins(csPin, resetPin, irqPin);// set CS, reset, IRQ pin 37 | 38 | if (!LoRa.begin(915E6)) { // initialize ratio at 915 MHz 39 | Serial.println("LoRa init failed. Check your connections."); 40 | while (true); // if failed, do nothing 41 | } 42 | 43 | Serial.println("LoRa init succeeded."); 44 | } 45 | 46 | void loop() { 47 | if (millis() - lastSendTime > interval) { 48 | String message = "HeLoRa World!"; // send a message 49 | sendMessage(message); 50 | Serial.println("Sending " + message); 51 | lastSendTime = millis(); // timestamp the message 52 | interval = random(2000) + 1000; // 2-3 seconds 53 | } 54 | 55 | // parse for a packet, and call onReceive with the result: 56 | onReceive(LoRa.parsePacket()); 57 | } 58 | 59 | void sendMessage(String outgoing) { 60 | LoRa.beginPacket(); // start packet 61 | LoRa.write(destination); // add destination address 62 | LoRa.write(localAddress); // add sender address 63 | LoRa.write(msgCount); // add message ID 64 | LoRa.write(outgoing.length()); // add payload length 65 | LoRa.print(outgoing); // add payload 66 | LoRa.endPacket(); // finish packet and send it 67 | msgCount++; // increment message ID 68 | } 69 | 70 | void onReceive(int packetSize) { 71 | if (packetSize == 0) return; // if there's no packet, return 72 | 73 | // read packet header bytes: 74 | int recipient = LoRa.read(); // recipient address 75 | byte sender = LoRa.read(); // sender address 76 | byte incomingMsgId = LoRa.read(); // incoming msg ID 77 | byte incomingLength = LoRa.read(); // incoming msg length 78 | 79 | String incoming = ""; 80 | 81 | while (LoRa.available()) { 82 | incoming += (char)LoRa.read(); 83 | } 84 | 85 | if (incomingLength != incoming.length()) { // check length for error 86 | Serial.println("error: message length does not match length"); 87 | return; // skip rest of function 88 | } 89 | 90 | // if the recipient isn't this device or broadcast, 91 | if (recipient != localAddress && recipient != 0xFF) { 92 | Serial.println("This message is not for me."); 93 | return; // skip rest of function 94 | } 95 | 96 | // if message is for this device, or broadcast, print details: 97 | Serial.println("Received from: 0x" + String(sender, HEX)); 98 | Serial.println("Sent to: 0x" + String(recipient, HEX)); 99 | Serial.println("Message ID: " + String(incomingMsgId)); 100 | Serial.println("Message length: " + String(incomingLength)); 101 | Serial.println("Message: " + incoming); 102 | Serial.println("RSSI: " + String(LoRa.packetRssi())); 103 | Serial.println("Snr: " + String(LoRa.packetSnr())); 104 | Serial.println(); 105 | } 106 | 107 | -------------------------------------------------------------------------------- /Example/None LoRaWAN/pingpong/lib/arduino-LoRa/examples/LoRaReceiver/LoRaReceiver.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void setup() { 5 | Serial.begin(9600); 6 | while (!Serial); 7 | 8 | Serial.println("LoRa Receiver"); 9 | 10 | if (!LoRa.begin(915E6)) { 11 | Serial.println("Starting LoRa failed!"); 12 | while (1); 13 | } 14 | } 15 | 16 | void loop() { 17 | // try to parse packet 18 | int packetSize = LoRa.parsePacket(); 19 | if (packetSize) { 20 | // received a packet 21 | Serial.print("Received packet '"); 22 | 23 | // read packet 24 | while (LoRa.available()) { 25 | Serial.print((char)LoRa.read()); 26 | } 27 | 28 | // print RSSI of packet 29 | Serial.print("' with RSSI "); 30 | Serial.println(LoRa.packetRssi()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Example/None LoRaWAN/pingpong/lib/arduino-LoRa/examples/LoRaReceiverCallback/LoRaReceiverCallback.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifdef ARDUINO_SAMD_MKRWAN1300 5 | #error "This example is not compatible with the Arduino MKR WAN 1300 board!" 6 | #endif 7 | 8 | void setup() { 9 | Serial.begin(9600); 10 | while (!Serial); 11 | 12 | Serial.println("LoRa Receiver Callback"); 13 | 14 | if (!LoRa.begin(915E6)) { 15 | Serial.println("Starting LoRa failed!"); 16 | while (1); 17 | } 18 | 19 | // Uncomment the next line to disable the default AGC and set LNA gain, values between 1 - 6 are supported 20 | // LoRa.setGain(6); 21 | 22 | // register the receive callback 23 | LoRa.onReceive(onReceive); 24 | 25 | // put the radio into receive mode 26 | LoRa.receive(); 27 | } 28 | 29 | void loop() { 30 | // do nothing 31 | } 32 | 33 | void onReceive(int packetSize) { 34 | // received a packet 35 | Serial.print("Received packet '"); 36 | 37 | // read packet 38 | for (int i = 0; i < packetSize; i++) { 39 | Serial.print((char)LoRa.read()); 40 | } 41 | 42 | // print RSSI of packet 43 | Serial.print("' with RSSI "); 44 | Serial.println(LoRa.packetRssi()); 45 | } 46 | -------------------------------------------------------------------------------- /Example/None LoRaWAN/pingpong/lib/arduino-LoRa/examples/LoRaSender/LoRaSender.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int counter = 0; 5 | 6 | void setup() { 7 | Serial.begin(9600); 8 | while (!Serial); 9 | 10 | Serial.println("LoRa Sender"); 11 | 12 | if (!LoRa.begin(915E6)) { 13 | Serial.println("Starting LoRa failed!"); 14 | while (1); 15 | } 16 | } 17 | 18 | void loop() { 19 | Serial.print("Sending packet: "); 20 | Serial.println(counter); 21 | 22 | // send packet 23 | LoRa.beginPacket(); 24 | LoRa.print("hello "); 25 | LoRa.print(counter); 26 | LoRa.endPacket(); 27 | 28 | counter++; 29 | 30 | delay(5000); 31 | } 32 | -------------------------------------------------------------------------------- /Example/None LoRaWAN/pingpong/lib/arduino-LoRa/examples/LoRaSenderNonBlocking/LoRaSenderNonBlocking.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int counter = 0; 5 | 6 | void setup() { 7 | Serial.begin(9600); 8 | while (!Serial); 9 | 10 | Serial.println("LoRa Sender non-blocking"); 11 | 12 | if (!LoRa.begin(915E6)) { 13 | Serial.println("Starting LoRa failed!"); 14 | while (1); 15 | } 16 | } 17 | 18 | void loop() { 19 | // wait until the radio is ready to send a packet 20 | while (LoRa.beginPacket() == 0) { 21 | Serial.print("waiting for radio ... "); 22 | delay(100); 23 | } 24 | 25 | Serial.print("Sending packet non-blocking: "); 26 | Serial.println(counter); 27 | 28 | // send in async / non-blocking mode 29 | LoRa.beginPacket(); 30 | LoRa.print("hello "); 31 | LoRa.print(counter); 32 | LoRa.endPacket(true); // true = async / non-blocking mode 33 | 34 | counter++; 35 | } 36 | -------------------------------------------------------------------------------- /Example/None LoRaWAN/pingpong/lib/arduino-LoRa/examples/LoRaSenderNonBlockingCallback/LoRaSenderNonBlockingCallback.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int counter = 0; 5 | 6 | void setup() { 7 | Serial.begin(9600); 8 | while (!Serial); 9 | 10 | Serial.println("LoRa Sender non-blocking Callback"); 11 | 12 | if (!LoRa.begin(915E6)) { 13 | Serial.println("Starting LoRa failed!"); 14 | while (1); 15 | } 16 | 17 | LoRa.onTxDone(onTxDone); 18 | } 19 | 20 | void loop() { 21 | if (runEvery(5000)) { // repeat every 5000 millis 22 | 23 | Serial.print("Sending packet non-blocking: "); 24 | Serial.println(counter); 25 | 26 | // send in async / non-blocking mode 27 | LoRa.beginPacket(); 28 | LoRa.print("hello "); 29 | LoRa.print(counter); 30 | LoRa.endPacket(true); // true = async / non-blocking mode 31 | 32 | counter++; 33 | } 34 | } 35 | 36 | void onTxDone() { 37 | Serial.println("TxDone"); 38 | } 39 | 40 | boolean runEvery(unsigned long interval) 41 | { 42 | static unsigned long previousMillis = 0; 43 | unsigned long currentMillis = millis(); 44 | if (currentMillis - previousMillis >= interval) 45 | { 46 | previousMillis = currentMillis; 47 | return true; 48 | } 49 | return false; 50 | } 51 | -------------------------------------------------------------------------------- /Example/None LoRaWAN/pingpong/lib/arduino-LoRa/examples/LoRaSetSpread/LoRaSetSpread.ino: -------------------------------------------------------------------------------- 1 | /* 2 | LoRa Duplex communication with Spreading Factor 3 | 4 | Sends a message every half second, and polls continually 5 | for new incoming messages. Sets the LoRa radio's spreading factor. 6 | 7 | Spreading factor affects how far apart the radio's transmissions 8 | are, across the available bandwidth. Radios with different spreading 9 | factors will not receive each other's transmissions. This is one way you 10 | can filter out radios you want to ignore, without making an addressing scheme. 11 | 12 | Spreading factor affects reliability of transmission at high rates, however, 13 | so avoid a hugh spreading factor when you're sending continually. 14 | 15 | See the Semtech datasheet, http://www.semtech.com/images/datasheet/sx1276.pdf 16 | for more on Spreading Factor. 17 | 18 | created 28 April 2017 19 | by Tom Igoe 20 | */ 21 | #include // include libraries 22 | #include 23 | 24 | const int csPin = 7; // LoRa radio chip select 25 | const int resetPin = 6; // LoRa radio reset 26 | const int irqPin = 1; // change for your board; must be a hardware interrupt pin 27 | 28 | byte msgCount = 0; // count of outgoing messages 29 | int interval = 2000; // interval between sends 30 | long lastSendTime = 0; // time of last packet send 31 | 32 | void setup() { 33 | Serial.begin(9600); // initialize serial 34 | while (!Serial); 35 | 36 | Serial.println("LoRa Duplex - Set spreading factor"); 37 | 38 | // override the default CS, reset, and IRQ pins (optional) 39 | LoRa.setPins(csPin, resetPin, irqPin); // set CS, reset, IRQ pin 40 | 41 | if (!LoRa.begin(915E6)) { // initialize ratio at 915 MHz 42 | Serial.println("LoRa init failed. Check your connections."); 43 | while (true); // if failed, do nothing 44 | } 45 | 46 | LoRa.setSpreadingFactor(8); // ranges from 6-12,default 7 see API docs 47 | Serial.println("LoRa init succeeded."); 48 | } 49 | 50 | void loop() { 51 | if (millis() - lastSendTime > interval) { 52 | String message = "HeLoRa World! "; // send a message 53 | message += msgCount; 54 | sendMessage(message); 55 | Serial.println("Sending " + message); 56 | lastSendTime = millis(); // timestamp the message 57 | interval = random(2000) + 1000; // 2-3 seconds 58 | msgCount++; 59 | } 60 | 61 | // parse for a packet, and call onReceive with the result: 62 | onReceive(LoRa.parsePacket()); 63 | } 64 | 65 | void sendMessage(String outgoing) { 66 | LoRa.beginPacket(); // start packet 67 | LoRa.print(outgoing); // add payload 68 | LoRa.endPacket(); // finish packet and send it 69 | msgCount++; // increment message ID 70 | } 71 | 72 | void onReceive(int packetSize) { 73 | if (packetSize == 0) return; // if there's no packet, return 74 | 75 | // read packet header bytes: 76 | String incoming = ""; 77 | 78 | while (LoRa.available()) { 79 | incoming += (char)LoRa.read(); 80 | } 81 | 82 | Serial.println("Message: " + incoming); 83 | Serial.println("RSSI: " + String(LoRa.packetRssi())); 84 | Serial.println("Snr: " + String(LoRa.packetSnr())); 85 | Serial.println(); 86 | } 87 | 88 | -------------------------------------------------------------------------------- /Example/None LoRaWAN/pingpong/lib/arduino-LoRa/examples/LoRaSetSyncWord/LoRaSetSyncWord.ino: -------------------------------------------------------------------------------- 1 | /* 2 | LoRa Duplex communication with Sync Word 3 | 4 | Sends a message every half second, and polls continually 5 | for new incoming messages. Sets the LoRa radio's Sync Word. 6 | 7 | Spreading factor is basically the radio's network ID. Radios with different 8 | Sync Words will not receive each other's transmissions. This is one way you 9 | can filter out radios you want to ignore, without making an addressing scheme. 10 | 11 | See the Semtech datasheet, http://www.semtech.com/images/datasheet/sx1276.pdf 12 | for more on Sync Word. 13 | 14 | created 28 April 2017 15 | by Tom Igoe 16 | */ 17 | #include // include libraries 18 | #include 19 | const int csPin = 7; // LoRa radio chip select 20 | const int resetPin = 6; // LoRa radio reset 21 | const int irqPin = 1; // change for your board; must be a hardware interrupt pin 22 | 23 | byte msgCount = 0; // count of outgoing messages 24 | int interval = 2000; // interval between sends 25 | long lastSendTime = 0; // time of last packet send 26 | 27 | void setup() { 28 | Serial.begin(9600); // initialize serial 29 | while (!Serial); 30 | 31 | Serial.println("LoRa Duplex - Set sync word"); 32 | 33 | // override the default CS, reset, and IRQ pins (optional) 34 | LoRa.setPins(csPin, resetPin, irqPin);// set CS, reset, IRQ pin 35 | 36 | if (!LoRa.begin(915E6)) { // initialize ratio at 915 MHz 37 | Serial.println("LoRa init failed. Check your connections."); 38 | while (true); // if failed, do nothing 39 | } 40 | 41 | LoRa.setSyncWord(0xF3); // ranges from 0-0xFF, default 0x34, see API docs 42 | Serial.println("LoRa init succeeded."); 43 | } 44 | 45 | void loop() { 46 | if (millis() - lastSendTime > interval) { 47 | String message = "HeLoRa World! "; // send a message 48 | message += msgCount; 49 | sendMessage(message); 50 | Serial.println("Sending " + message); 51 | lastSendTime = millis(); // timestamp the message 52 | interval = random(2000) + 1000; // 2-3 seconds 53 | msgCount++; 54 | } 55 | 56 | // parse for a packet, and call onReceive with the result: 57 | onReceive(LoRa.parsePacket()); 58 | } 59 | 60 | void sendMessage(String outgoing) { 61 | LoRa.beginPacket(); // start packet 62 | LoRa.print(outgoing); // add payload 63 | LoRa.endPacket(); // finish packet and send it 64 | msgCount++; // increment message ID 65 | } 66 | 67 | void onReceive(int packetSize) { 68 | if (packetSize == 0) return; // if there's no packet, return 69 | 70 | // read packet header bytes: 71 | String incoming = ""; 72 | 73 | while (LoRa.available()) { 74 | incoming += (char)LoRa.read(); 75 | } 76 | 77 | Serial.println("Message: " + incoming); 78 | Serial.println("RSSI: " + String(LoRa.packetRssi())); 79 | Serial.println("Snr: " + String(LoRa.packetSnr())); 80 | Serial.println(); 81 | } 82 | 83 | -------------------------------------------------------------------------------- /Example/None LoRaWAN/pingpong/lib/arduino-LoRa/examples/LoRaSimpleGateway/LoRaSimpleGateway.ino: -------------------------------------------------------------------------------- 1 | /* 2 | LoRa Simple Gateway/Node Exemple 3 | 4 | This code uses InvertIQ function to create a simple Gateway/Node logic. 5 | 6 | Gateway - Sends messages with enableInvertIQ() 7 | - Receives messages with disableInvertIQ() 8 | 9 | Node - Sends messages with disableInvertIQ() 10 | - Receives messages with enableInvertIQ() 11 | 12 | With this arrangement a Gateway never receive messages from another Gateway 13 | and a Node never receive message from another Node. 14 | Only Gateway to Node and vice versa. 15 | 16 | This code receives messages and sends a message every second. 17 | 18 | InvertIQ function basically invert the LoRa I and Q signals. 19 | 20 | See the Semtech datasheet, http://www.semtech.com/images/datasheet/sx1276.pdf 21 | for more on InvertIQ register 0x33. 22 | 23 | created 05 August 2018 24 | by Luiz H. Cassettari 25 | */ 26 | 27 | #include // include libraries 28 | #include 29 | 30 | const long frequency = 915E6; // LoRa Frequency 31 | 32 | const int csPin = 10; // LoRa radio chip select 33 | const int resetPin = 9; // LoRa radio reset 34 | const int irqPin = 2; // change for your board; must be a hardware interrupt pin 35 | 36 | void setup() { 37 | Serial.begin(9600); // initialize serial 38 | while (!Serial); 39 | 40 | LoRa.setPins(csPin, resetPin, irqPin); 41 | 42 | if (!LoRa.begin(frequency)) { 43 | Serial.println("LoRa init failed. Check your connections."); 44 | while (true); // if failed, do nothing 45 | } 46 | 47 | Serial.println("LoRa init succeeded."); 48 | Serial.println(); 49 | Serial.println("LoRa Simple Gateway"); 50 | Serial.println("Only receive messages from nodes"); 51 | Serial.println("Tx: invertIQ enable"); 52 | Serial.println("Rx: invertIQ disable"); 53 | Serial.println(); 54 | 55 | LoRa.onReceive(onReceive); 56 | LoRa.onTxDone(onTxDone); 57 | LoRa_rxMode(); 58 | } 59 | 60 | void loop() { 61 | if (runEvery(5000)) { // repeat every 5000 millis 62 | 63 | String message = "HeLoRa World! "; 64 | message += "I'm a Gateway! "; 65 | message += millis(); 66 | 67 | LoRa_sendMessage(message); // send a message 68 | 69 | Serial.println("Send Message!"); 70 | } 71 | } 72 | 73 | void LoRa_rxMode(){ 74 | LoRa.disableInvertIQ(); // normal mode 75 | LoRa.receive(); // set receive mode 76 | } 77 | 78 | void LoRa_txMode(){ 79 | LoRa.idle(); // set standby mode 80 | LoRa.enableInvertIQ(); // active invert I and Q signals 81 | } 82 | 83 | void LoRa_sendMessage(String message) { 84 | LoRa_txMode(); // set tx mode 85 | LoRa.beginPacket(); // start packet 86 | LoRa.print(message); // add payload 87 | LoRa.endPacket(true); // finish packet and send it 88 | } 89 | 90 | void onReceive(int packetSize) { 91 | String message = ""; 92 | 93 | while (LoRa.available()) { 94 | message += (char)LoRa.read(); 95 | } 96 | 97 | Serial.print("Gateway Receive: "); 98 | Serial.println(message); 99 | } 100 | 101 | void onTxDone() { 102 | Serial.println("TxDone"); 103 | LoRa_rxMode(); 104 | } 105 | 106 | boolean runEvery(unsigned long interval) 107 | { 108 | static unsigned long previousMillis = 0; 109 | unsigned long currentMillis = millis(); 110 | if (currentMillis - previousMillis >= interval) 111 | { 112 | previousMillis = currentMillis; 113 | return true; 114 | } 115 | return false; 116 | } 117 | 118 | -------------------------------------------------------------------------------- /Example/None LoRaWAN/pingpong/lib/arduino-LoRa/examples/LoRaSimpleNode/LoRaSimpleNode.ino: -------------------------------------------------------------------------------- 1 | /* 2 | LoRa Simple Gateway/Node Exemple 3 | 4 | This code uses InvertIQ function to create a simple Gateway/Node logic. 5 | 6 | Gateway - Sends messages with enableInvertIQ() 7 | - Receives messages with disableInvertIQ() 8 | 9 | Node - Sends messages with disableInvertIQ() 10 | - Receives messages with enableInvertIQ() 11 | 12 | With this arrangement a Gateway never receive messages from another Gateway 13 | and a Node never receive message from another Node. 14 | Only Gateway to Node and vice versa. 15 | 16 | This code receives messages and sends a message every second. 17 | 18 | InvertIQ function basically invert the LoRa I and Q signals. 19 | 20 | See the Semtech datasheet, http://www.semtech.com/images/datasheet/sx1276.pdf 21 | for more on InvertIQ register 0x33. 22 | 23 | created 05 August 2018 24 | by Luiz H. Cassettari 25 | */ 26 | 27 | #include // include libraries 28 | #include 29 | 30 | const long frequency = 915E6; // LoRa Frequency 31 | 32 | const int csPin = 10; // LoRa radio chip select 33 | const int resetPin = 9; // LoRa radio reset 34 | const int irqPin = 2; // change for your board; must be a hardware interrupt pin 35 | 36 | void setup() { 37 | Serial.begin(9600); // initialize serial 38 | while (!Serial); 39 | 40 | LoRa.setPins(csPin, resetPin, irqPin); 41 | 42 | if (!LoRa.begin(frequency)) { 43 | Serial.println("LoRa init failed. Check your connections."); 44 | while (true); // if failed, do nothing 45 | } 46 | 47 | Serial.println("LoRa init succeeded."); 48 | Serial.println(); 49 | Serial.println("LoRa Simple Node"); 50 | Serial.println("Only receive messages from gateways"); 51 | Serial.println("Tx: invertIQ disable"); 52 | Serial.println("Rx: invertIQ enable"); 53 | Serial.println(); 54 | 55 | LoRa.onReceive(onReceive); 56 | LoRa.onTxDone(onTxDone); 57 | LoRa_rxMode(); 58 | } 59 | 60 | void loop() { 61 | if (runEvery(1000)) { // repeat every 1000 millis 62 | 63 | String message = "HeLoRa World! "; 64 | message += "I'm a Node! "; 65 | message += millis(); 66 | 67 | LoRa_sendMessage(message); // send a message 68 | 69 | Serial.println("Send Message!"); 70 | } 71 | } 72 | 73 | void LoRa_rxMode(){ 74 | LoRa.enableInvertIQ(); // active invert I and Q signals 75 | LoRa.receive(); // set receive mode 76 | } 77 | 78 | void LoRa_txMode(){ 79 | LoRa.idle(); // set standby mode 80 | LoRa.disableInvertIQ(); // normal mode 81 | } 82 | 83 | void LoRa_sendMessage(String message) { 84 | LoRa_txMode(); // set tx mode 85 | LoRa.beginPacket(); // start packet 86 | LoRa.print(message); // add payload 87 | LoRa.endPacket(true); // finish packet and send it 88 | } 89 | 90 | void onReceive(int packetSize) { 91 | String message = ""; 92 | 93 | while (LoRa.available()) { 94 | message += (char)LoRa.read(); 95 | } 96 | 97 | Serial.print("Node Receive: "); 98 | Serial.println(message); 99 | } 100 | 101 | void onTxDone() { 102 | Serial.println("TxDone"); 103 | LoRa_rxMode(); 104 | } 105 | 106 | boolean runEvery(unsigned long interval) 107 | { 108 | static unsigned long previousMillis = 0; 109 | unsigned long currentMillis = millis(); 110 | if (currentMillis - previousMillis >= interval) 111 | { 112 | previousMillis = currentMillis; 113 | return true; 114 | } 115 | return false; 116 | } 117 | 118 | -------------------------------------------------------------------------------- /Example/None LoRaWAN/pingpong/lib/arduino-LoRa/issue_template.md: -------------------------------------------------------------------------------- 1 | Are you receiving `Starting LoRa failed` while using the demo code? 2 | 3 | PLEASE see the [FAQ #1](https://github.com/sandeepmistry/arduino-LoRa#faq) about using [setPins](https://github.com/sandeepmistry/arduino-LoRa/blob/master/API.md#set-pins) **BEFORE** submitting an issue. 4 | -------------------------------------------------------------------------------- /Example/None LoRaWAN/pingpong/lib/arduino-LoRa/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For LoRa 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | LoRa KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | 15 | begin KEYWORD2 16 | end KEYWORD2 17 | 18 | beginPacket KEYWORD2 19 | endPacket KEYWORD2 20 | 21 | parsePacket KEYWORD2 22 | packetRssi KEYWORD2 23 | packetSnr KEYWORD2 24 | packetFrequencyError KEYWORD2 25 | 26 | rssi KEYWORD2 27 | 28 | write KEYWORD2 29 | 30 | available KEYWORD2 31 | read KEYWORD2 32 | peek KEYWORD2 33 | flush KEYWORD2 34 | 35 | onReceive KEYWORD2 36 | onTxDone KEYWORD2 37 | receive KEYWORD2 38 | idle KEYWORD2 39 | sleep KEYWORD2 40 | 41 | setTxPower KEYWORD2 42 | setFrequency KEYWORD2 43 | setSpreadingFactor KEYWORD2 44 | setSignalBandwidth KEYWORD2 45 | setCodingRate4 KEYWORD2 46 | setPreambleLength KEYWORD2 47 | setSyncWord KEYWORD2 48 | enableCrc KEYWORD2 49 | disableCrc KEYWORD2 50 | enableInvertIQ KEYWORD2 51 | disableInvertIQ KEYWORD2 52 | setGain KEYWORD2 53 | 54 | random KEYWORD2 55 | setPins KEYWORD2 56 | setSPIFrequency KEYWORD2 57 | dumpRegisters KEYWORD2 58 | 59 | ####################################### 60 | # Constants (LITERAL1) 61 | ####################################### 62 | 63 | PA_OUTPUT_RFO_PIN LITERAL1 64 | PA_OUTPUT_PA_BOOST_PIN LITERAL1 65 | -------------------------------------------------------------------------------- /Example/None LoRaWAN/pingpong/lib/arduino-LoRa/library.properties: -------------------------------------------------------------------------------- 1 | name=LoRa 2 | version=0.8.0 3 | author=Sandeep Mistry 4 | maintainer=Sandeep Mistry 5 | sentence=An Arduino library for sending and receiving data using LoRa radios. 6 | paragraph=Supports Semtech SX1276/77/78/79 based boards/shields. 7 | category=Communication 8 | url=https://github.com/sandeepmistry/arduino-LoRa 9 | architectures=* 10 | includes=LoRa.h 11 | -------------------------------------------------------------------------------- /Example/None LoRaWAN/pingpong/lib/arduino-LoRa/src/LoRa.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) Sandeep Mistry. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | #ifndef LORA_H 5 | #define LORA_H 6 | 7 | #include 8 | #include 9 | 10 | #if defined(ARDUINO_SAMD_MKRWAN1300) 11 | #define LORA_DEFAULT_SPI SPI1 12 | #define LORA_DEFAULT_SPI_FREQUENCY 200000 13 | #define LORA_DEFAULT_SS_PIN LORA_IRQ_DUMB 14 | #define LORA_DEFAULT_RESET_PIN -1 15 | #define LORA_DEFAULT_DIO0_PIN -1 16 | #elif defined(ARDUINO_SAMD_MKRWAN1310) 17 | #define LORA_DEFAULT_SPI SPI1 18 | #define LORA_DEFAULT_SPI_FREQUENCY 200000 19 | #define LORA_DEFAULT_SS_PIN LORA_IRQ_DUMB 20 | #define LORA_DEFAULT_RESET_PIN -1 21 | #define LORA_DEFAULT_DIO0_PIN LORA_IRQ 22 | #else 23 | #define LORA_DEFAULT_SPI SPI 24 | #define LORA_DEFAULT_SPI_FREQUENCY 8E6 25 | //#define LORA_DEFAULT_SS_PIN 10 26 | #define LORA_DEFAULT_SS_PIN 18 27 | //#define LORA_DEFAULT_RESET_PIN 9 28 | #define LORA_DEFAULT_RESET_PIN 23 29 | //#define LORA_DEFAULT_DIO0_PIN 2 30 | #define LORA_DEFAULT_DIO0_PIN 26 31 | #endif 32 | 33 | #define PA_OUTPUT_RFO_PIN 0 34 | #define PA_OUTPUT_PA_BOOST_PIN 1 35 | 36 | class LoRaClass : public Stream { 37 | public: 38 | LoRaClass(); 39 | 40 | int begin(long frequency); 41 | void end(); 42 | 43 | int beginPacket(int implicitHeader = false); 44 | int endPacket(bool async = false); 45 | 46 | int parsePacket(int size = 0); 47 | int packetRssi(); 48 | float packetSnr(); 49 | long packetFrequencyError(); 50 | 51 | int rssi(); 52 | 53 | // from Print 54 | virtual size_t write(uint8_t byte); 55 | virtual size_t write(const uint8_t *buffer, size_t size); 56 | 57 | // from Stream 58 | virtual int available(); 59 | virtual int read(); 60 | virtual int peek(); 61 | virtual void flush(); 62 | 63 | #ifndef ARDUINO_SAMD_MKRWAN1300 64 | void onReceive(void(*callback)(int)); 65 | void onTxDone(void(*callback)()); 66 | 67 | void receive(int size = 0); 68 | #endif 69 | void idle(); 70 | void sleep(); 71 | 72 | void setTxPower(int level, int outputPin = PA_OUTPUT_PA_BOOST_PIN); 73 | void setFrequency(long frequency); 74 | void setSpreadingFactor(int sf); 75 | void setSignalBandwidth(long sbw); 76 | void setCodingRate4(int denominator); 77 | void setPreambleLength(long length); 78 | void setSyncWord(int sw); 79 | void enableCrc(); 80 | void disableCrc(); 81 | void enableInvertIQ(); 82 | void disableInvertIQ(); 83 | 84 | void setOCP(uint8_t mA); // Over Current Protection control 85 | 86 | void setGain(uint8_t gain); // Set LNA gain 87 | 88 | // deprecated 89 | void crc() { enableCrc(); } 90 | void noCrc() { disableCrc(); } 91 | 92 | byte random(); 93 | 94 | void setPins(int ss = LORA_DEFAULT_SS_PIN, int reset = LORA_DEFAULT_RESET_PIN, int dio0 = LORA_DEFAULT_DIO0_PIN); 95 | void setSPI(SPIClass& spi); 96 | void setSPIFrequency(uint32_t frequency); 97 | 98 | void dumpRegisters(Stream& out); 99 | 100 | private: 101 | void explicitHeaderMode(); 102 | void implicitHeaderMode(); 103 | 104 | void handleDio0Rise(); 105 | bool isTransmitting(); 106 | 107 | int getSpreadingFactor(); 108 | long getSignalBandwidth(); 109 | 110 | void setLdoFlag(); 111 | 112 | uint8_t readRegister(uint8_t address); 113 | void writeRegister(uint8_t address, uint8_t value); 114 | uint8_t singleTransfer(uint8_t address, uint8_t value); 115 | 116 | static void onDio0Rise(); 117 | 118 | private: 119 | SPISettings _spiSettings; 120 | SPIClass* _spi; 121 | int _ss; 122 | int _reset; 123 | int _dio0; 124 | long _frequency; 125 | int _packetIndex; 126 | int _implicitHeaderMode; 127 | void (*_onReceive)(int); 128 | void (*_onTxDone)(); 129 | }; 130 | 131 | extern LoRaClass LoRa; 132 | 133 | #endif 134 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/.github/ISSUE_TEMPLATE/00-support-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Support request 3 | about: Ask for help on a problem 4 | title: '' 5 | labels: question 6 | assignees: terrillmoore 7 | 8 | --- 9 | 10 | **Consider raising support questions on the forum first** 11 | 12 | There is a discussion site, [forum.mcci.io](https://forum.mcci.io), which includes a [category focused on the Arduino LMIC](https://forum.mcci.io/c/device-software/arduino-lmic/5). Unless you're sure that your problem is a bug in the LMIC, it would be great if you can try for help there first. That will keep issues focused on work that needs to be done by the developers. 13 | 14 | **Describe your question or issue** 15 | 16 | Please give a clear and concise description of the problem you're facing and what you'd like help with. 17 | 18 | **Environment** 19 | 20 | This information is very important; it's hard to help without a complete set of answers. 21 | 22 | - Version of LMIC being used. If using the latest github mainline, let us know, otherwise state the version. 23 | - Version of Arduino IDE being used: 24 | - Network provider (The Things Network, Swisscom, ChirpStack, etc.) 25 | - Region (EU868, US915, etc.) 26 | - Board (MCCI Catena, Adafruit Feather M0, Heltec Wi-Fi LoRa 32 v2, etc.) 27 | - Radio (HopeRF, SX1276, etc.) 28 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/.github/ISSUE_TEMPLATE/10-bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Report a code defect 4 | title: '' 5 | labels: bug 6 | assignees: terrillmoore 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | 12 | A clear and concise description of what the bug is. _If you're not sure it's a bug, please consider opening a discussion at [forum.mcci.io](https://forum.mcci.io/c/device-software/arduino-lmic/5), or file a Support Request instead._ A bug is a problem in the code, where you do something that the documentation says should work, but doesn't; _and_ you have reason to believe it's not working due to a defect in the code. 13 | 14 | Wireless is tricky; if in doubt, start with a support request, rather than a bug report. 15 | 16 | **Environment** 17 | 18 | - Version of LMIC being used. If using the latest GitHub mainline, let us know, otherwise state the version. 19 | - Version of Arduino IDE being used. 20 | - Network provider (The Things Network, Swisscom, ChirpStack, etc.) 21 | - Region (EU868, US915, etc.) 22 | - Board (MCCI Catena, Adafruit Feather M0, Heltec, etc.) 23 | - CPU (AVR, STM32L0, etc.) 24 | - Radio (HopeRF, SX1276, etc.) 25 | 26 | **To Reproduce** 27 | 28 | Steps to reproduce the problem. 29 | 30 | **Expected behavior** 31 | 32 | A clear and concise description of what you expected to happen. 33 | 34 | **Screenshots** 35 | 36 | If applicable, add screenshots to help explain your problem. 37 | 38 | **Additional context** 39 | 40 | Add any other context about the problem here. 41 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/.github/ISSUE_TEMPLATE/20-feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: terrillmoore 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/.github/ISSUE_TEMPLATE/30-doc_issue.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Documentation issue 3 | about: Report a problem in the documentation 4 | title: '' 5 | labels: docs 6 | assignees: terrillmoore 7 | 8 | --- 9 | 10 | Thanks for your contribution! 11 | 12 | **What document is involved?** 13 | 14 | If this is an existing document, please include the full path to the file. 15 | 16 | If there's a need for a new document, please suggest the places in existing docs that should link to it. 17 | 18 | Make sure you mention the version, and please also check the current version at GitHub, to be sure that the problem hasn't already been corrected for a pending release. 19 | 20 | **What changes are needed?** 21 | 22 | Indicate the changes you think are needed. Explicit help is always better. File a PR with your changes if possible! 23 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/.github/workflows/ci-arduinocli.yml: -------------------------------------------------------------------------------- 1 | ############################################################################## 2 | # 3 | # File: ci-arduinocli.yml 4 | # 5 | # Function: 6 | # YAML file specifying how to do continuous integration for Arduino-LMIC 7 | # (using arduino-cli) 8 | # 9 | ############################################################################## 10 | 11 | # the name that appears in the GitHub UI, the badge, etc 12 | name: Arduino CI 13 | 14 | # global environment 15 | env: 16 | MCCI_CI_LIBRARY: arduino-lmic 17 | 18 | # specify the events that trigger runs. 19 | on: 20 | # pull requests (default settings) 21 | pull_request: 22 | # pushes (default settings) 23 | push: 24 | # repository operations 25 | repository_dispatch: 26 | schedule: 27 | # do a build once a week at 06:07Z Sunday 28 | - cron: '7 6 * * 0' 29 | 30 | # what to do: 31 | jobs: 32 | 33 | # define a job named "arduinocli" 34 | arduinocli: 35 | # select a target OS 36 | runs-on: ubuntu-latest 37 | name: ${{ matrix.arch }} 38 | 39 | strategy: 40 | fail-fast: false 41 | matrix: 42 | arch: [samd, stm32, esp32, avr] 43 | # get info about all the configs. 44 | 45 | # step-by-step 46 | steps: 47 | # check out this repo as {root}/arduino-lmic 48 | - uses: actions/checkout@v2 49 | name: Check out the repo 50 | with: 51 | path: libraries/${{ env.MCCI_CI_LIBRARY }} 52 | 53 | - uses: actions/checkout@v2 54 | name: Set up mcci-catena-ci 55 | with: 56 | repository: mcci-catena/mcci-catena-ci 57 | path: mcci-catena-ci 58 | 59 | - name: "Get library: Adafruit_Sensor" 60 | uses: actions/checkout@v2 61 | with: 62 | repository: adafruit/Adafruit_Sensor 63 | path: libraries/Adafruit_Sensor 64 | 65 | - name: "Get library: DHT-sensor-library" 66 | uses: actions/checkout@v2 67 | with: 68 | repository: adafruit/DHT-sensor-library 69 | path: libraries/DHT-sensor-library 70 | 71 | - name: "Get library: Time" 72 | uses: actions/checkout@v2 73 | with: 74 | repository: PaulStoffregen/Time 75 | path: libraries/Time 76 | 77 | - name: Set up to build 78 | run: bash mcci-catena-ci/setup.sh -l libraries/${{ env.MCCI_CI_LIBRARY }} -a ${{ matrix.arch }} 79 | 80 | - name: Display structure of checkout 81 | run: tree -d $(realpath .) 82 | 83 | - name: Compile examples 84 | run: bash mcci-catena-ci/arduino-lmic-regress-wrap.sh -l libraries/${{env.MCCI_CI_LIBRARY}} -a ${{ matrix.arch }} 85 | 86 | ### end of file ### 87 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | *.obj 6 | 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | 11 | # Compiled Dynamic libraries 12 | *.so 13 | *.dylib 14 | *.dll 15 | 16 | # Fortran module files 17 | *.mod 18 | *.smod 19 | 20 | # Compiled Static libraries 21 | *.lai 22 | *.la 23 | *.a 24 | *.lib 25 | 26 | # Executables 27 | *.exe 28 | *.out 29 | *.app 30 | 31 | # Backup files 32 | *.BAK 33 | *.CKP 34 | *.wbk 35 | ~$*.docx 36 | 37 | # files from Visual Micro 38 | Release 39 | *.vcxproj 40 | *.vcxproj.filters 41 | *.vcxitems 42 | vs-readme.txt 43 | __vm 44 | .vs 45 | *.sln 46 | 47 | # files from vscode 48 | .vscode 49 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/.hgignore: -------------------------------------------------------------------------------- 1 | ^CVS 2 | .*/CVS 3 | .*/CVS/.* 4 | \.\#.*$ 5 | ^\.DS_Store$ 6 | .*\.BAK$ 7 | .*\.bak$ 8 | .*\.CKP$ 9 | ^build 10 | ^build/.* 11 | ^.*\.o$ 12 | ^.*\.d$ 13 | ^.*\.td$ 14 | \.a$ 15 | ^core$ 16 | .*/core$ 17 | .*\.rej$ 18 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (C) 2014-2016 IBM Corporation 4 | Copyright (c) 2015 Thomas Telkamp and Matthijs Kooijman 5 | Copyright (c) 2016-2021 MCCI Corporation 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/assets/Feather-M0-LoRa-Wire.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dragino/TrackerD/17da65a702d8cabf88331d2f1550f4b046dae9ce/Library/arduino-lmic/arduino-lmic/assets/Feather-M0-LoRa-Wire.ai -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/assets/Feather-M0-LoRa-Wire.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dragino/TrackerD/17da65a702d8cabf88331d2f1550f4b046dae9ce/Library/arduino-lmic/arduino-lmic/assets/Feather-M0-LoRa-Wire.png -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/ci/lmic-filter-common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ############################################################################## 4 | # 5 | # Module: lmic-filter-common.sh 6 | # 7 | # Function: 8 | # This script must be sourced; it sets variables used by other 9 | # scripts in this directory. 10 | # 11 | # Usage: 12 | # source ci/lmic-filter.sh 13 | # 14 | # Copyright and License: 15 | # See accompanying LICENSE.md file 16 | # 17 | # Author: 18 | # Terry Moore, MCCI February 2021 19 | # 20 | ############################################################################## 21 | 22 | #### Capture the file path #### 23 | MCCI_THISFILE="$0" 24 | 25 | #### mandatory function: do the filtering 26 | function _lmic_filter { 27 | declare -r CMD="$1" 28 | shift 29 | case "$CMD" in 30 | 31 | # return 0 (success) if should process this sketch. 32 | "process") 33 | case "$MCCI_CI_ARCH:$(basename "$1")" in 34 | # we need to skip this sketch until the SAMD 35 | # bsp is updated; the Time library uses prog_read_ptr() 36 | # which is broken in v2.3.0 37 | "samd:ttn-otaa-network-time.ino") 38 | return 1 39 | ;; 40 | # some of the feather sketches fail on non-Feathers 41 | "esp32:raw-feather.ino" | \ 42 | "esp32:ttn-otaa-feather-us915.ino") 43 | return 1 44 | ;; 45 | # some of the feather sketches fail on non-Feathers 46 | "stm32:raw-feather.ino" | \ 47 | "stm32:ttn-otaa-feather-us915.ino") 48 | return 1 49 | ;; 50 | *) 51 | return 0 52 | ;; 53 | esac 54 | ;; 55 | 56 | # print 1 if must use projcfg; 0 if not forced. 57 | "use-projcfg") 58 | if [[ "$MCCI_CI_ARCH" = "avr" ]]; then 59 | echo 1 60 | else 61 | echo 0 62 | fi 63 | ;; 64 | 65 | # call the suitable flavor of _projcfg. 66 | "projcfg") 67 | declare -r LMIC_FILTER_SKETCH="$1" 68 | _debug _lmic_filter: LMIC_FILTER_SKETCH="$LMIC_FILTER_SKETCH" 69 | shift 70 | if [[ "$MCCI_CI_ARCH" = "avr" ]]; then 71 | _projcfg_class_a "$@" 72 | else 73 | _projcfg "$@" 74 | fi 75 | ;; 76 | *) 77 | _error "_lmic_filter: unknown command:" "$@" 78 | ;; 79 | esac 80 | } 81 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/doc/IBM-DISCLAIMER.txt: -------------------------------------------------------------------------------- 1 | The original distribution from IBM includes the following notice as README.txt. 2 | 3 | DISCLAIMER: 4 | Please note that the software is provided AS IS and we cannot 5 | provide support for optimizations, adaptations, integration, 6 | ports to other platforms or device drivers! 7 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/doc/IBM-release-notes.txt: -------------------------------------------------------------------------------- 1 | ============================================================================== 2 | LMIC VERSION 1.6 (13-July-2015) 3 | --------------------------------- 4 | 5 | - License changed to BSD 6 | - Modem included, see LMiC-Modem.pdf and examples/modem 7 | - Additional stm32 hardware and Blipper board specific peripheral code 8 | 9 | 10 | ============================================================================== 11 | LMIC VERSION 1.5 (8-May-2015) 12 | ------------------------------ 13 | 14 | - fixed condition in convFreq() 15 | 16 | - fixed freq*100 bug and freq==0 bug for CFList 17 | 18 | - fixed TX scheduling bug 19 | 20 | - better support for GNU compiler toolchain 21 | 22 | 23 | ============================================================================== 24 | LMIC VERSION 1.4 (17-Mar-2015) 25 | ------------------------------- 26 | 27 | - changed API: inverted port indicator flag in LMIC.txrxFlags 28 | (now TXRX_PORT, previously TXRX_NOPORT) 29 | 30 | - fixed offset OFF_CFLIST constant 31 | 32 | - changed CRC-16 algorithm for beacons to CCITT(XMODEM) polynomial 33 | 34 | - fixed radio driver (low data rate optimization for SF11+SF12 only for BW125) 35 | 36 | - fixed timer rollover handling in job queue 37 | 38 | ============================================================================== 39 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/doc/LMIC-FSM.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dragino/TrackerD/17da65a702d8cabf88331d2f1550f4b046dae9ce/Library/arduino-lmic/arduino-lmic/doc/LMIC-FSM.pdf -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/doc/LMIC-structure-diagram.cdd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 18 | 19 | 21 | 22 | 40 | 41 | 44 | LMIC 45 | 46 | 47 | 50 | Radio 51 | 52 | 53 | 54 | 58 | 61 | 65 | 66 | 67 | 70 | Chip 71 | 72 | 73 | 74 | 78 | 80 | 85 | 86 | 87 | 90 | Radio layer just does what it's told.

91 | It's dumb. "Send these bytes" or "start listening" 92 | 93 | 94 | 97 | Hardware: SX1276 98 | 99 | 100 | 103 | Secure Element 104 | 105 | 106 | 107 | 111 | 114 | 118 | 119 | 120 | 123 | AES Decrypt 124 | 125 | 126 | 127 | 131 | 134 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/doc/LMIC-structure-diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dragino/TrackerD/17da65a702d8cabf88331d2f1550f4b046dae9ce/Library/arduino-lmic/arduino-lmic/doc/LMIC-structure-diagram.pdf -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/doc/LMIC-v4.1.0-redline.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dragino/TrackerD/17da65a702d8cabf88331d2f1550f4b046dae9ce/Library/arduino-lmic/arduino-lmic/doc/LMIC-v4.1.0-redline.pdf -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/doc/LMIC-v4.1.0.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dragino/TrackerD/17da65a702d8cabf88331d2f1550f4b046dae9ce/Library/arduino-lmic/arduino-lmic/doc/LMIC-v4.1.0.docx -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/doc/LMIC-v4.1.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dragino/TrackerD/17da65a702d8cabf88331d2f1550f4b046dae9ce/Library/arduino-lmic/arduino-lmic/doc/LMIC-v4.1.0.pdf -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/doc/LoRaWAN-at-a-glance.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dragino/TrackerD/17da65a702d8cabf88331d2f1550f4b046dae9ce/Library/arduino-lmic/arduino-lmic/doc/LoRaWAN-at-a-glance.pdf -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/doc/LoRaWAN-at-a-glance.vsdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dragino/TrackerD/17da65a702d8cabf88331d2f1550f4b046dae9ce/Library/arduino-lmic/arduino-lmic/doc/LoRaWAN-at-a-glance.vsdx -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/doc/README.md: -------------------------------------------------------------------------------- 1 | # LMIC Documentation 2 | 3 | This directory contains documentation on the use and implementation of the LMIC. 4 | 5 | ## Usage documentation 6 | 7 | - [`LMIC-v3.3.0.pdf`](./LMIC-v3.3.0.pdf): API documentation on the LMIC as of 3.3.0. 8 | - [`LMIC-v3.3.0-redline.pdf`](./LMIC-v3.3.0-redline.pdf): changes in the document since last update, marked up by Litera Workshare Compare. 9 | 10 | ## Background information 11 | 12 | - [`LoRaWAN-at-a-glance.pdf`](./LoRaWAN-at-a-glance.pdf): a wall chart showing key features of the LoRaWAN 1.0.3 protocol. 13 | 14 | ## Implementation documentation 15 | 16 | - [`RadioDriver.md`](./RadioDriver.md): documentation of the radio driver interface. 17 | - [`LMIC-structure-diagram.pdf`](./LMIC-structure-diagram.pdf): a structural diagram of the LMIC. This is somewhat UML like. 18 | - [`LMIC-FSM.pdf`](./LMIC-FSM.pdf): the operating logic of the LMIC, modeled as a finite state machine. As of version 3.2, this model is idealized; the actual implementation is not an explicit state machine. However, if you search for `os_setCallback()` and `os_setTimedCallback()`, you will see the links between event callbacks, and that will generally correspond to the implementation. The FSM diagram doesn't show class-B or class-C operation as yet. 19 | 20 | ## Historical information 21 | 22 | - `IBM-DISCLAIMER.txt` and `IBM-release-notes.txt` are artifacts of the original IBM distribution, retained for reference. 23 | 24 | ## Meta 25 | 26 | Source files are included for documents that have separate sources. 27 | 28 | - The source for the API documentation is a Microsoft Word file. 29 | - The source for "LoRaWAN at a glance" is a Visio file. 30 | - The sources for LMIC-FSM and LMIC-structure are [Cadifra](https://www.cadifra.com/) files. Cadifra is an inexpensive ($50) commercial tool that the author uses as a UML whiteboard; it's really lightweight and very cleanly implemented on Windows. 31 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/examples/compliance-otaa-halconfig/extra/ci/lmic-filter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ############################################################################## 4 | # 5 | # Module: compliance-otaa-halconfig/extra/ci/lmic-filter.sh 6 | # 7 | # Function: 8 | # This script must be sourced; it sets variables used by other 9 | # scripts in this directory. 10 | # 11 | # Usage: 12 | # source ci/lmic-filter.sh 13 | # 14 | # Copyright and License: 15 | # See accompanying LICENSE.md file 16 | # 17 | # Author: 18 | # Terry Moore, MCCI February 2021 19 | # 20 | ############################################################################## 21 | 22 | #### use the common code. 23 | # shellcheck source=../../../../ci/lmic-filter-common.sh 24 | source "$(dirname "$MCCI_CI_FILTER_NAME")"/../../../../ci/lmic-filter-common.sh 25 | 26 | #### end of file #### 27 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/examples/header_test/header_test.ino: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Module: header_test.ino 4 | 5 | Function: 6 | Simple hello-world (and compile-test) app 7 | 8 | Copyright notice and License: 9 | See LICENSE file accompanying this project. 10 | 11 | Author: 12 | Terry Moore, MCCI Corporation April 2018 13 | 14 | */ 15 | 16 | #include 17 | 18 | # define STATIC_ASSERT(e) \ 19 | void STATIC_ASSERT__(int MCCIADK_C_ASSERT_x[(e) ? 1: -1]) 20 | 21 | STATIC_ASSERT(ARDUINO_LMIC_VERSION >= ARDUINO_LMIC_VERSION_CALC(2,1,5,0)); 22 | 23 | STATIC_ASSERT(ARDUINO_LMIC_VERSION_CALC(1,2,3,4) == 0x01020304); 24 | 25 | STATIC_ASSERT(ARDUINO_LMIC_VERSION_GET_MAJOR(ARDUINO_LMIC_VERSION_CALC(1,2,3,4)) == 1); 26 | STATIC_ASSERT(ARDUINO_LMIC_VERSION_GET_MINOR(ARDUINO_LMIC_VERSION_CALC(1,2,3,4)) == 2); 27 | STATIC_ASSERT(ARDUINO_LMIC_VERSION_GET_PATCH(ARDUINO_LMIC_VERSION_CALC(1,2,3,4)) == 3); 28 | STATIC_ASSERT(ARDUINO_LMIC_VERSION_GET_LOCAL(ARDUINO_LMIC_VERSION_CALC(1,2,3,4)) == 4); 29 | 30 | void setup() 31 | { 32 | } 33 | 34 | void loop() 35 | { 36 | } 37 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/examples/raw-feather/extra/ci/lmic-filter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ############################################################################## 4 | # 5 | # Module: compliance-otaa-halconfig/extra/ci/lmic-filter.sh 6 | # 7 | # Function: 8 | # This script must be sourced; it sets variables used by other 9 | # scripts in this directory. 10 | # 11 | # Usage: 12 | # source ci/lmic-filter.sh 13 | # 14 | # Copyright and License: 15 | # See accompanying LICENSE.md file 16 | # 17 | # Author: 18 | # Terry Moore, MCCI February 2021 19 | # 20 | ############################################################################## 21 | 22 | #### use the common code. 23 | # shellcheck source=../../../../ci/lmic-filter-common.sh 24 | source "$(dirname "$MCCI_CI_FILTER_NAME")"/../../../../ci/lmic-filter-common.sh 25 | 26 | #### end of file #### 27 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/examples/ttn-abp-feather-us915-dht22/extra/ci/lmic-filter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ############################################################################## 4 | # 5 | # Module: ttn-abp-feather-us915-dht22/extra/ci/lmic-filter.sh 6 | # 7 | # Function: 8 | # This script must be sourced; it sets variables used by other 9 | # scripts in this directory. 10 | # 11 | # Usage: 12 | # source ci/lmic-filter.sh 13 | # 14 | # Copyright and License: 15 | # See accompanying LICENSE.md file 16 | # 17 | # Author: 18 | # Terry Moore, MCCI February 2021 19 | # 20 | ############################################################################## 21 | 22 | #### use the common code. 23 | # shellcheck source=../../../../ci/lmic-filter-common.sh 24 | source "$(dirname "$MCCI_CI_FILTER_NAME")"/../../../../ci/lmic-filter-common.sh 25 | 26 | #### end of file #### 27 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/examples/ttn-otaa-feather-us915-dht22/extra/ci/lmic-filter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ############################################################################## 4 | # 5 | # Module: ttn-otaa-feather-us915-dht22/extra/ci/lmic-filter.sh 6 | # 7 | # Function: 8 | # This script must be sourced; it sets variables used by other 9 | # scripts in this directory. 10 | # 11 | # Usage: 12 | # source ci/lmic-filter.sh 13 | # 14 | # Copyright and License: 15 | # See accompanying LICENSE.md file 16 | # 17 | # Author: 18 | # Terry Moore, MCCI February 2021 19 | # 20 | ############################################################################## 21 | 22 | #### use the common code. 23 | # shellcheck source=../../../../ci/lmic-filter-common.sh 24 | source "$(dirname "$MCCI_CI_FILTER_NAME")"/../../../../ci/lmic-filter-common.sh 25 | 26 | #### end of file #### 27 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/examples/ttn-otaa-feather-us915/extra/ci/lmic-filter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ############################################################################## 4 | # 5 | # Module: ttn-otaa-feather-us915/extra/ci/lmic-filter.sh 6 | # 7 | # Function: 8 | # This script must be sourced; it sets variables used by other 9 | # scripts in this directory. 10 | # 11 | # Usage: 12 | # source ci/lmic-filter.sh 13 | # 14 | # Copyright and License: 15 | # See accompanying LICENSE.md file 16 | # 17 | # Author: 18 | # Terry Moore, MCCI February 2021 19 | # 20 | ############################################################################## 21 | 22 | #### use the common code. 23 | # shellcheck source=../../../../ci/lmic-filter-common.sh 24 | source "$(dirname "$MCCI_CI_FILTER_NAME")"/../../../../ci/lmic-filter-common.sh 25 | 26 | #### end of file #### 27 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/examples/ttn-otaa-network-time/extra/ci/lmic-filter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ############################################################################## 4 | # 5 | # Module: ttn-otaa-network-time/extra/ci/lmic-filter.sh 6 | # 7 | # Function: 8 | # This script must be sourced; it sets variables used by other 9 | # scripts in this directory. 10 | # 11 | # Usage: 12 | # source ci/lmic-filter.sh 13 | # 14 | # Copyright and License: 15 | # See accompanying LICENSE.md file 16 | # 17 | # Author: 18 | # Terry Moore, MCCI February 2021 19 | # 20 | ############################################################################## 21 | 22 | #### use the common code. 23 | # shellcheck source=../../../../ci/lmic-filter-common.sh 24 | source "$(dirname "$MCCI_CI_FILTER_NAME")"/../../../../ci/lmic-filter-common.sh 25 | 26 | #### end of file #### 27 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/library.properties: -------------------------------------------------------------------------------- 1 | name=MCCI LoRaWAN LMIC library 2 | version=4.1.0 3 | author=IBM, Matthijs Kooijman, Terry Moore, ChaeHee Won, Frank Rose 4 | maintainer=Terry Moore 5 | sentence=Arduino port of the LMIC (LoraWAN-MAC-in-C) framework provided by IBM. 6 | paragraph=Supports LoRaWAN 1.0.2/1.0.3 Class A devices implemented using the Semtech SX1272/SX1276 (including HopeRF RFM92/RFM95 and Murata modules). Support for EU868, US, AU, AS923, KR and IN regional plans. Untested support for Class B and FSK operation. Various enhancements and bug fixes from MCCI and The Things Network New York. Original IBM URL http://www.research.ibm.com/labs/zurich/ics/lrsc/lmic.html. 7 | category=Communication 8 | url=https://github.com/mcci-catena/arduino-lmic 9 | architectures=* 10 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/project_config/lmic_project_config.h: -------------------------------------------------------------------------------- 1 | // project-specific definitions 2 | //#define CFG_eu868 1 3 | //#define CFG_us915 1 4 | #define CFG_au915 1 5 | //#define CFG_as923 1 6 | // #define LMIC_COUNTRY_CODE LMIC_COUNTRY_CODE_JP /* for as923-JP; also define CFG_as923 */ 7 | //#define CFG_kr920 1 8 | //#define CFG_in866 1 9 | //#define CFG_kz865 1 10 | //#define CFG_ru864 1 11 | //#define CFG_ma869 1 12 | #define CFG_sx1276_radio 1 13 | 14 | #define LMIC_DEBUG_LEVEL 2 15 | //#define LMIC_USE_INTERRUPTS 16 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/arduino_lmic.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Module: arduino_lmic.h 4 | 5 | Function: 6 | Arduino-LMIC C++ top-level include file 7 | 8 | Copyright & License: 9 | See accompanying LICENSE file. 10 | 11 | Author: 12 | Matthijs Kooijman 2015 13 | Terry Moore, MCCI November 2018 14 | 15 | */ 16 | 17 | #pragma once 18 | 19 | #ifndef _ARDUINO_LMIC_H_ 20 | # define _ARDUINO_LMIC_H_ 21 | 22 | #ifdef __cplusplus 23 | extern "C"{ 24 | #endif 25 | 26 | #include "lmic/lmic.h" 27 | #include "lmic/lmic_bandplan.h" 28 | #include "lmic/lmic_util.h" 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | #endif /* _ARDUINO_LMIC_H_ */ 35 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/arduino_lmic_hal_boards.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Module: arduino_lmic_hal_boards.h 4 | 5 | Function: 6 | Arduino-LMIC C++ HAL pinmaps for various boards 7 | 8 | Copyright & License: 9 | See accompanying LICENSE file. 10 | 11 | Author: 12 | Terry Moore, MCCI November 2018 13 | 14 | */ 15 | 16 | #pragma once 17 | 18 | #ifndef _arduino_lmic_hal_boards_h_ 19 | # define _arduino_lmic_hal_boards_h_ 20 | 21 | #include "arduino_lmic_hal_configuration.h" 22 | 23 | namespace Arduino_LMIC { 24 | 25 | const HalPinmap_t *GetPinmap_FeatherM0LoRa(); 26 | const HalPinmap_t *GetPinmap_Feather32U4LoRa(); 27 | 28 | const HalPinmap_t *GetPinmap_Catena4420(); 29 | const HalPinmap_t *GetPinmap_Catena4551(); 30 | const HalPinmap_t *GetPinmap_Catena4610(); 31 | const HalPinmap_t *GetPinmap_Catena4610(); 32 | const HalPinmap_t *GetPinmap_Catena4611(); 33 | const HalPinmap_t *GetPinmap_Catena4612(); 34 | const HalPinmap_t *GetPinmap_Catena4617(); 35 | const HalPinmap_t *GetPinmap_Catena4618(); 36 | const HalPinmap_t *GetPinmap_Catena4630(); 37 | const HalPinmap_t *GetPinmap_Catena4801(); 38 | const HalPinmap_t *GetPinmap_Catena4802(); 39 | const HalPinmap_t* GetPinmap_ttgo_lora32_v1(); 40 | const HalPinmap_t *GetPinmap_ttgo_lora32_v21(); 41 | const HalPinmap_t* GetPinmap_heltec_lora32(); 42 | const HalPinmap_t* GetPinmap_Disco_L072cz_Lrwan1(); 43 | 44 | const HalPinmap_t *GetPinmap_ThisBoard(); 45 | 46 | }; /* namespace Arduino_LIMC */ 47 | 48 | #endif /* _arduino_lmic_hal_boards_h_ */ 49 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/arduino_lmic_hal_configuration.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Module: arduino_lmic_hal_configuration.h 4 | 5 | Function: 6 | Arduino-LMIC C++ HAL configuration APIs 7 | 8 | Copyright & License: 9 | See accompanying LICENSE file. 10 | 11 | Author: 12 | Matthijs Kooijman 2015 13 | Terry Moore, MCCI November 2018 14 | 15 | */ 16 | #pragma once 17 | 18 | #ifndef _arduino_lmic_hal_configuration_h_ 19 | # define _arduino_lmic_hal_configuration_h_ 20 | 21 | #include 22 | #include "lmic/lmic_env.h" 23 | 24 | namespace Arduino_LMIC { 25 | 26 | /* these types should match the types used by the LMIC */ 27 | typedef int32_t ostime_t; 28 | 29 | // this type is used when we need to represent a threee-state signal 30 | enum class ThreeState_t : uint8_t { 31 | Off = 0, 32 | On = 1, 33 | HiZ = 2 34 | }; 35 | 36 | // forward reference 37 | class HalConfiguration_t; 38 | 39 | // 40 | // for legacy reasons, we need a plain-old-data C-like 41 | // structure that defines the "pin mapping" for the 42 | // common pins. Many clients initialize an instance of 43 | // this structure using named-field initialization. 44 | // 45 | // Be careful of alignment below. 46 | struct HalPinmap_t { 47 | // Use this for any unused pins. 48 | static constexpr uint8_t UNUSED_PIN = 0xff; 49 | static constexpr int NUM_DIO = 3; 50 | // for backward compatibility... 51 | static constexpr uint8_t LMIC_UNUSED_PIN = UNUSED_PIN; 52 | 53 | /* the contents */ 54 | uint8_t nss; // byte 0: pin for select 55 | uint8_t rxtx; // byte 1: pin for rx/tx control 56 | uint8_t rst; // byte 2: pin for reset 57 | uint8_t dio[NUM_DIO]; // bytes 3..5: pins for DIO0, DOI1, DIO2 58 | // true if we must set rxtx for rx_active, false for tx_active 59 | uint8_t rxtx_rx_active; // byte 6: polarity of rxtx active 60 | int8_t rssi_cal; // byte 7: cal in dB -- added to RSSI 61 | // measured prior to decision. 62 | // Must include noise guardband! 63 | uint32_t spi_freq; // bytes 8..11: SPI freq in Hz. 64 | 65 | // optional pointer to configuration object (bytes 12..15) 66 | HalConfiguration_t *pConfig; 67 | }; 68 | 69 | class HalConfiguration_t 70 | { 71 | public: 72 | HalConfiguration_t() {}; 73 | 74 | // these must match the constants in radio.c 75 | enum class TxPowerPolicy_t : uint8_t 76 | { 77 | RFO, 78 | PA_BOOST, 79 | PA_BOOST_20dBm 80 | }; 81 | 82 | virtual ostime_t setModuleActive(bool state) { 83 | LMIC_API_PARAMETER(state); 84 | 85 | // by default, if not overridden, do nothing 86 | // and return 0 to indicate that the caller 87 | // need not delay. 88 | return 0; 89 | } 90 | 91 | virtual void begin(void) {} 92 | virtual void end(void) {} 93 | virtual bool queryUsingTcxo(void) { return false; } 94 | 95 | // compute desired transmit power policy. HopeRF needs 96 | // (and previous versions of this library always chose) 97 | // PA_BOOST mode. So that's our default. Override this 98 | // for the Murata module. 99 | virtual TxPowerPolicy_t getTxPowerPolicy( 100 | TxPowerPolicy_t policy, 101 | int8_t requestedPower, 102 | uint32_t frequency 103 | ) 104 | { 105 | LMIC_API_PARAMETER(policy); 106 | LMIC_API_PARAMETER(requestedPower); 107 | LMIC_API_PARAMETER(frequency); 108 | // default: use PA_BOOST exclusively 109 | return TxPowerPolicy_t::PA_BOOST; 110 | } 111 | }; 112 | 113 | bool hal_init_with_pinmap(const HalPinmap_t *pPinmap); 114 | 115 | }; // end namespace Arduino_LMIC 116 | 117 | #endif 118 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/arduino_lmic_lorawan_compliance.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Module: arduino_lmic_lorawan_compliance.h 4 | 5 | Function: 6 | Arduino-LMIC C++ include file for LoRaWAN compliance 7 | 8 | Copyright & License: 9 | See accompanying LICENSE file. 10 | 11 | Author: 12 | Terry Moore, MCCI March 2019 13 | 14 | */ 15 | 16 | #pragma once 17 | 18 | #ifndef _ARDUINO_LMIC_LORAWAN_COMPLIANCE_H_ 19 | # define _ARDUINO_LMIC_LORAWAN_COMPLIANCE_H_ 20 | 21 | #ifdef __cplusplus 22 | extern "C"{ 23 | #endif 24 | 25 | #include "lmic/lorawan_spec_compliance.h" 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | 31 | #endif /* _ARDUINO_LMIC_LORAWAN_COMPLIANCE_H_ */ 32 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/arduino_lmic_user_configuration.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Module: arduino_lmic_user_configuration.h 4 | 5 | Function: 6 | Get the Arduino-LMIC configuration into scope 7 | 8 | Copyright & License: 9 | See accompanying LICENSE file. 10 | 11 | Author: 12 | Terry Moore, MCCI November 2018 13 | 14 | */ 15 | #pragma once 16 | 17 | #ifndef _arduino_lmic_user_configuration_h_ 18 | # define _arduino_lmic_user_configuration_h_ 19 | 20 | # ifdef __cplusplus 21 | extern "C" { 22 | # endif 23 | 24 | # include "lmic/lmic_config_preconditions.h" 25 | 26 | # ifdef __cplusplus 27 | } 28 | # endif 29 | 30 | #endif /* _arduino_lmic_user_configuration_h_ */ 31 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/hal/getpinmap_catena4420.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Module: getconfig_catena4420.cpp 4 | 5 | Function: 6 | Arduino-LMIC C++ HAL pinmap for MCCI Catena 4420 7 | 8 | Copyright & License: 9 | See accompanying LICENSE file. 10 | 11 | Author: 12 | Terry Moore, MCCI November 2018 13 | 14 | */ 15 | 16 | #if defined(ARDUINO_MCCI_CATENA_4420) || \ 17 | /* legacy names */ \ 18 | defined(ARDUINO_CATENA_4420) 19 | 20 | #include 21 | #include 22 | 23 | #include "../lmic/oslmic.h" 24 | 25 | namespace Arduino_LMIC { 26 | 27 | class HalConfiguration_Catena4420_t : public HalConfiguration_t 28 | { 29 | public: 30 | enum DIGITAL_PINS : uint8_t 31 | { 32 | PIN_SX1276_NSS = 6, 33 | PIN_SX1276_NRESET = 5, 34 | PIN_SX1276_DIO0 = 12, // pin assignment for DIO0 (aka IRQ) 35 | PIN_SX1276_DIO1 = 11, 36 | PIN_SX1276_DIO2 = 10, 37 | PIN_SX1276_ANT_SWITCH_RX = HalPinmap_t::UNUSED_PIN, 38 | PIN_SX1276_ANT_SWITCH_TX_BOOST = HalPinmap_t::UNUSED_PIN, 39 | PIN_SX1276_ANT_SWITCH_TX_RFO = HalPinmap_t::UNUSED_PIN, 40 | PIN_VDD_BOOST_ENABLE = HalPinmap_t::UNUSED_PIN, 41 | }; 42 | 43 | virtual void begin(void) override 44 | { 45 | digitalWrite(PIN_SX1276_NSS, 1); 46 | pinMode(PIN_SX1276_NSS, OUTPUT); 47 | } 48 | 49 | // virtual void end(void) override 50 | 51 | // virtual ostime_t setModuleActive(bool state) override 52 | 53 | }; 54 | 55 | static HalConfiguration_Catena4420_t myConfig; 56 | 57 | static const HalPinmap_t myPinmap = 58 | { 59 | .nss = HalConfiguration_Catena4420_t::PIN_SX1276_NSS, // chip select is D7 60 | .rxtx = HalConfiguration_Catena4420_t::PIN_SX1276_ANT_SWITCH_RX, // RXTX is D29 61 | .rst = HalConfiguration_Catena4420_t::PIN_SX1276_NRESET, // NRESET is D8 62 | 63 | .dio = {HalConfiguration_Catena4420_t::PIN_SX1276_DIO0, // DIO0 (IRQ) is D25 64 | HalConfiguration_Catena4420_t::PIN_SX1276_DIO1, // DIO1 is D26 65 | HalConfiguration_Catena4420_t::PIN_SX1276_DIO2, // DIO2 is D27 66 | }, 67 | .rxtx_rx_active = 0, 68 | .rssi_cal = 10, 69 | .spi_freq = 8000000, /* 8MHz */ 70 | .pConfig = &myConfig 71 | }; 72 | 73 | const HalPinmap_t *GetPinmap_Catena4420(void) 74 | { 75 | return &myPinmap; 76 | } 77 | 78 | } // namespace Arduino_LMIC 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/hal/getpinmap_catena4551.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Module: getconfig_catena4551.cpp 4 | 5 | Function: 6 | Arduino-LMIC C++ HAL pinmaps for various boards 7 | 8 | Copyright & License: 9 | See accompanying LICENSE file. 10 | 11 | Author: 12 | Terry Moore, MCCI November 2018 13 | 14 | */ 15 | 16 | #if defined(ARDUINO_MCCI_CATENA_4551) || \ 17 | /* legacy names */ \ 18 | defined(ARDUINO_CATENA_4551) 19 | 20 | #include 21 | #include 22 | 23 | #include "../lmic/oslmic.h" 24 | 25 | namespace Arduino_LMIC { 26 | 27 | class HalConfiguration_Catena4551_t : public HalConfiguration_t 28 | { 29 | public: 30 | enum DIGITAL_PINS : uint8_t 31 | { 32 | PIN_SX1276_NSS = D7, 33 | PIN_SX1276_NRESET = D8, 34 | PIN_SX1276_DIO0 = D25, 35 | PIN_SX1276_DIO1 = D26, 36 | PIN_SX1276_DIO2 = D27, 37 | PIN_SX1276_ANT_SWITCH_RX = D29, 38 | PIN_SX1276_ANT_SWITCH_TX_BOOST = D30, 39 | PIN_SX1276_ANT_SWITCH_TX_RFO = D31, 40 | PIN_VDD_BOOST_ENABLE = A0, 41 | PIN_TCXO_VDD = D33, 42 | }; 43 | 44 | virtual void begin(void) override 45 | { 46 | digitalWrite(PIN_SX1276_NSS, 1); 47 | pinMode(PIN_SX1276_NSS, OUTPUT); 48 | } 49 | 50 | // virtual void end(void) override 51 | 52 | // On the 4551, we can't control the TCXO; it's always on. 53 | // So we use the default. 54 | // virtual ostime_t setModuleActive(bool state) override 55 | virtual bool queryUsingTcxo(void) override { return true; }; 56 | }; 57 | 58 | // save some typing by bringing the pin numbers into scope 59 | static HalConfiguration_Catena4551_t myConfig; 60 | 61 | static const HalPinmap_t myPinmap = 62 | { 63 | .nss = HalConfiguration_Catena4551_t::PIN_SX1276_NSS, // chip select is D7 64 | .rxtx = HalConfiguration_Catena4551_t::PIN_SX1276_ANT_SWITCH_RX, // RXTX is D29 65 | .rst = HalConfiguration_Catena4551_t::PIN_SX1276_NRESET, // NRESET is D8 66 | 67 | .dio = {HalConfiguration_Catena4551_t::PIN_SX1276_DIO0, // DIO0 (IRQ) is D25 68 | HalConfiguration_Catena4551_t::PIN_SX1276_DIO1, // DIO1 is D26 69 | HalConfiguration_Catena4551_t::PIN_SX1276_DIO2, // DIO2 is D27 70 | }, 71 | .rxtx_rx_active = 1, 72 | .rssi_cal = 10, 73 | .spi_freq = 8000000, /* 8MHz */ 74 | .pConfig = &myConfig, 75 | }; 76 | 77 | const HalPinmap_t *GetPinmap_Catena4551(void) 78 | { 79 | return &myPinmap; 80 | } 81 | 82 | }; // namespace Arduino_LMIC 83 | 84 | #endif /* defined(ARDUINO_MCCI_CATENA_4551) */ 85 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/hal/getpinmap_catena4610.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Module: getconfig_catena4610.cpp 4 | 5 | Function: 6 | Arduino-LMIC C++ HAL pinmaps for the Catena 4610 7 | 8 | Copyright & License: 9 | See accompanying LICENSE file. 10 | 11 | Author: 12 | Terry Moore, MCCI November 2018 13 | 14 | */ 15 | 16 | #if defined(ARDUINO_MCCI_CATENA_4610) 17 | 18 | #include 19 | #include 20 | 21 | #include "../lmic/oslmic.h" 22 | 23 | namespace Arduino_LMIC { 24 | 25 | class HalConfiguration_Catena4610_t : public HalConfiguration_t 26 | { 27 | public: 28 | enum DIGITAL_PINS : uint8_t 29 | { 30 | PIN_SX1276_NSS = D7, 31 | PIN_SX1276_NRESET = D8, 32 | PIN_SX1276_DIO0 = D25, 33 | PIN_SX1276_DIO1 = D26, 34 | PIN_SX1276_DIO2 = D27, 35 | PIN_SX1276_ANT_SWITCH_RX = D29, 36 | PIN_SX1276_ANT_SWITCH_TX_BOOST = D30, 37 | PIN_SX1276_ANT_SWITCH_TX_RFO = D31, 38 | PIN_VDD_BOOST_ENABLE = A0, 39 | PIN_TCXO_VDD = D33, 40 | }; 41 | 42 | static constexpr ostime_t TCXO_DELAY_MS = 5; 43 | 44 | virtual void begin(void) override 45 | { 46 | digitalWrite(PIN_TCXO_VDD, 0); 47 | pinMode(PIN_TCXO_VDD, OUTPUT); 48 | } 49 | 50 | virtual void end(void) override 51 | { 52 | digitalWrite(PIN_TCXO_VDD, 0); 53 | pinMode(PIN_TCXO_VDD, INPUT); 54 | } 55 | 56 | virtual bool queryUsingTcxo(void) override { return true; }; 57 | 58 | virtual ostime_t setModuleActive(bool state) override 59 | { 60 | ostime_t result; 61 | const int oldState = digitalRead(PIN_TCXO_VDD); 62 | 63 | // if turning on, we need to delay. 64 | result = 0; 65 | if (state && ! oldState) 66 | result = ms2osticksCeil(TCXO_DELAY_MS); 67 | 68 | if (state != oldState) 69 | digitalWrite(PIN_TCXO_VDD, state); 70 | 71 | return result; 72 | } 73 | }; 74 | 75 | // save some typing by bringing the pin numbers into scope 76 | static HalConfiguration_Catena4610_t myConfig; 77 | 78 | static const HalPinmap_t myPinmap = 79 | { 80 | .nss = HalConfiguration_Catena4610_t::PIN_SX1276_NSS, // chip select is D7 81 | .rxtx = HalConfiguration_Catena4610_t::PIN_SX1276_ANT_SWITCH_RX, // RXTX is D29 82 | .rst = HalConfiguration_Catena4610_t::PIN_SX1276_NRESET, // NRESET is D8 83 | 84 | .dio = {HalConfiguration_Catena4610_t::PIN_SX1276_DIO0, // DIO0 (IRQ) is D25 85 | HalConfiguration_Catena4610_t::PIN_SX1276_DIO1, // DIO1 is D26 86 | HalConfiguration_Catena4610_t::PIN_SX1276_DIO2, // DIO2 is D27 87 | }, 88 | .rxtx_rx_active = 1, 89 | .rssi_cal = 10, 90 | .spi_freq = 8000000, /* 8MHz */ 91 | .pConfig = &myConfig 92 | }; 93 | 94 | const HalPinmap_t *GetPinmap_Catena4610(void) 95 | { 96 | return &myPinmap; 97 | } 98 | 99 | }; // namespace Arduino_LMIC 100 | 101 | #endif /* defined(ARDUINO_MCCI_CATENA_4610 */ 102 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/hal/getpinmap_catena4611.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Module: getconfig_catena4611.cpp 4 | 5 | Function: 6 | Arduino-LMIC C++ HAL pinmaps for various boards 7 | 8 | Copyright & License: 9 | See accompanying LICENSE file. 10 | 11 | Author: 12 | Terry Moore, MCCI November 2018 13 | 14 | */ 15 | 16 | #if defined(ARDUINO_MCCI_CATENA_4611) 17 | 18 | #include 19 | #include 20 | 21 | #include "../lmic/oslmic.h" 22 | 23 | namespace Arduino_LMIC { 24 | 25 | class HalConfiguration_Catena4611_t : public HalConfiguration_t 26 | { 27 | public: 28 | enum DIGITAL_PINS : uint8_t 29 | { 30 | PIN_SX1276_NSS = D7, 31 | PIN_SX1276_NRESET = D8, 32 | PIN_SX1276_DIO0 = D25, 33 | PIN_SX1276_DIO1 = D26, 34 | PIN_SX1276_DIO2 = D27, 35 | PIN_SX1276_ANT_SWITCH_RX = D29, 36 | PIN_SX1276_ANT_SWITCH_TX_BOOST = D30, 37 | PIN_SX1276_ANT_SWITCH_TX_RFO = D31, 38 | PIN_VDD_BOOST_ENABLE = A0, 39 | PIN_TCXO_VDD = D33, 40 | }; 41 | 42 | static constexpr ostime_t TCXO_DELAY_MS = 5; 43 | 44 | virtual void begin(void) override 45 | { 46 | digitalWrite(PIN_TCXO_VDD, 0); 47 | pinMode(PIN_TCXO_VDD, OUTPUT); 48 | } 49 | 50 | virtual void end(void) override 51 | { 52 | digitalWrite(PIN_TCXO_VDD, 0); 53 | pinMode(PIN_TCXO_VDD, INPUT); 54 | } 55 | 56 | virtual bool queryUsingTcxo(void) override { return true; }; 57 | 58 | virtual ostime_t setModuleActive(bool state) override 59 | { 60 | ostime_t result; 61 | const int oldState = digitalRead(PIN_TCXO_VDD); 62 | 63 | // if turning on, we need to delay. 64 | result = 0; 65 | if (state && ! oldState) 66 | result = ms2osticksCeil(TCXO_DELAY_MS); 67 | 68 | if (state != oldState) 69 | digitalWrite(PIN_TCXO_VDD, state); 70 | 71 | return result; 72 | } 73 | }; 74 | 75 | // save some typing by bringing the pin numbers into scope 76 | static HalConfiguration_Catena4611_t myConfig; 77 | 78 | static const HalPinmap_t myPinmap = 79 | { 80 | .nss = HalConfiguration_Catena4611_t::PIN_SX1276_NSS, // chip select is D7 81 | .rxtx = HalConfiguration_Catena4611_t::PIN_SX1276_ANT_SWITCH_RX, // RXTX is D29 82 | .rst = HalConfiguration_Catena4611_t::PIN_SX1276_NRESET, // NRESET is D8 83 | 84 | .dio = {HalConfiguration_Catena4611_t::PIN_SX1276_DIO0, // DIO0 (IRQ) is D25 85 | HalConfiguration_Catena4611_t::PIN_SX1276_DIO1, // DIO1 is D26 86 | HalConfiguration_Catena4611_t::PIN_SX1276_DIO2, // DIO2 is D27 87 | }, 88 | .rxtx_rx_active = 1, 89 | .rssi_cal = 10, 90 | .spi_freq = 8000000, /* 8MHz */ 91 | .pConfig = &myConfig 92 | }; 93 | 94 | const HalPinmap_t *GetPinmap_Catena4611(void) 95 | { 96 | return &myPinmap; 97 | } 98 | 99 | }; // namespace Arduino_LMIC 100 | 101 | #endif /* defined(ARDUINO_MCCI_CATENA_4611) */ 102 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/hal/getpinmap_catena4612.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Module: getconfig_catena4612.cpp 4 | 5 | Function: 6 | Arduino-LMIC C++ HAL pinmaps for various boards 7 | 8 | Copyright & License: 9 | See accompanying LICENSE file. 10 | 11 | Author: 12 | Terry Moore, MCCI November 2018 13 | 14 | */ 15 | 16 | #if defined(ARDUINO_MCCI_CATENA_4612) || \ 17 | /* legacy name */ \ 18 | defined(ARDUINO_CATENA_4612) 19 | 20 | #include 21 | #include 22 | 23 | #include "../lmic/oslmic.h" 24 | 25 | namespace Arduino_LMIC { 26 | 27 | class HalConfiguration_Catena4612_t : public HalConfiguration_t 28 | { 29 | public: 30 | enum DIGITAL_PINS : uint8_t 31 | { 32 | PIN_SX1276_NSS = D7, 33 | PIN_SX1276_NRESET = D8, 34 | PIN_SX1276_DIO0 = D25, 35 | PIN_SX1276_DIO1 = D26, 36 | PIN_SX1276_DIO2 = D27, 37 | PIN_SX1276_ANT_SWITCH_RX = D29, 38 | PIN_SX1276_ANT_SWITCH_TX_BOOST = D30, 39 | PIN_SX1276_ANT_SWITCH_TX_RFO = D31, 40 | PIN_VDD_BOOST_ENABLE = A0, 41 | PIN_TCXO_VDD = D33, 42 | }; 43 | 44 | static constexpr ostime_t TCXO_DELAY_MS = 5; 45 | 46 | virtual void begin(void) override 47 | { 48 | digitalWrite(PIN_TCXO_VDD, 0); 49 | pinMode(PIN_TCXO_VDD, OUTPUT); 50 | } 51 | 52 | virtual void end(void) override 53 | { 54 | digitalWrite(PIN_TCXO_VDD, 0); 55 | pinMode(PIN_TCXO_VDD, INPUT); 56 | } 57 | 58 | virtual bool queryUsingTcxo(void) override { return true; }; 59 | 60 | virtual ostime_t setModuleActive(bool state) override 61 | { 62 | ostime_t result; 63 | const int oldState = digitalRead(PIN_TCXO_VDD); 64 | 65 | // if turning on, we need to delay. 66 | result = 0; 67 | if (state && ! oldState) 68 | result = ms2osticksCeil(TCXO_DELAY_MS); 69 | 70 | if (state != oldState) 71 | digitalWrite(PIN_TCXO_VDD, state); 72 | 73 | return result; 74 | } 75 | }; 76 | 77 | // save some typing by bringing the pin numbers into scope 78 | static HalConfiguration_Catena4612_t myConfig; 79 | 80 | static const HalPinmap_t myPinmap = 81 | { 82 | .nss = HalConfiguration_Catena4612_t::PIN_SX1276_NSS, // chip select is D7 83 | .rxtx = HalConfiguration_Catena4612_t::PIN_SX1276_ANT_SWITCH_RX, // RXTX is D29 84 | .rst = HalConfiguration_Catena4612_t::PIN_SX1276_NRESET, // NRESET is D8 85 | 86 | .dio = {HalConfiguration_Catena4612_t::PIN_SX1276_DIO0, // DIO0 (IRQ) is D25 87 | HalConfiguration_Catena4612_t::PIN_SX1276_DIO1, // DIO1 is D26 88 | HalConfiguration_Catena4612_t::PIN_SX1276_DIO2, // DIO2 is D27 89 | }, 90 | .rxtx_rx_active = 1, 91 | .rssi_cal = 10, 92 | .spi_freq = 8000000, /* 8MHz */ 93 | .pConfig = &myConfig 94 | }; 95 | 96 | const HalPinmap_t *GetPinmap_Catena4612(void) 97 | { 98 | return &myPinmap; 99 | } 100 | 101 | }; // namespace Arduino_LMIC 102 | 103 | #endif /* defined(ARDUINO_MCCI_CATENA_4612) || defined(ARDUINO_CATENA_4612) */ 104 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/hal/getpinmap_catena4617.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Module: getconfig_catena4617.cpp 4 | 5 | Function: 6 | Arduino-LMIC C++ HAL pinmaps for various boards 7 | 8 | Copyright & License: 9 | See accompanying LICENSE file. 10 | 11 | Author: 12 | Lakshmi Priya Natarajan, MCCI June 2019 13 | 14 | */ 15 | 16 | #if defined(ARDUINO_MCCI_CATENA_4617) 17 | 18 | #include 19 | #include 20 | 21 | #include "../lmic/oslmic.h" 22 | 23 | namespace Arduino_LMIC { 24 | 25 | class HalConfiguration_Catena4617_t : public HalConfiguration_t 26 | { 27 | public: 28 | enum DIGITAL_PINS : uint8_t 29 | { 30 | PIN_SX1276_NSS = D7, 31 | PIN_SX1276_NRESET = D8, 32 | PIN_SX1276_DIO0 = D25, 33 | PIN_SX1276_DIO1 = D26, 34 | PIN_SX1276_DIO2 = D27, 35 | PIN_SX1276_ANT_SWITCH_RX = D29, 36 | PIN_SX1276_ANT_SWITCH_TX_BOOST = D30, 37 | PIN_SX1276_ANT_SWITCH_TX_RFO = D31, 38 | PIN_VDD_BOOST_ENABLE = A0, 39 | PIN_TCXO_VDD = D33, 40 | }; 41 | 42 | static constexpr ostime_t TCXO_DELAY_MS = 5; 43 | 44 | virtual void begin(void) override 45 | { 46 | digitalWrite(PIN_TCXO_VDD, 0); 47 | pinMode(PIN_TCXO_VDD, OUTPUT); 48 | } 49 | 50 | virtual void end(void) override 51 | { 52 | digitalWrite(PIN_TCXO_VDD, 0); 53 | pinMode(PIN_TCXO_VDD, INPUT); 54 | } 55 | 56 | virtual bool queryUsingTcxo(void) override { return true; }; 57 | 58 | virtual ostime_t setModuleActive(bool state) override 59 | { 60 | ostime_t result; 61 | const int oldState = digitalRead(PIN_TCXO_VDD); 62 | 63 | // if turning on, we need to delay. 64 | result = 0; 65 | if (state && ! oldState) 66 | result = ms2osticksCeil(TCXO_DELAY_MS); 67 | 68 | if (state != oldState) 69 | digitalWrite(PIN_TCXO_VDD, state); 70 | 71 | return result; 72 | } 73 | }; 74 | 75 | // save some typing by bringing the pin numbers into scope 76 | static HalConfiguration_Catena4617_t myConfig; 77 | 78 | static const HalPinmap_t myPinmap = 79 | { 80 | .nss = HalConfiguration_Catena4617_t::PIN_SX1276_NSS, // chip select is D7 81 | .rxtx = HalConfiguration_Catena4617_t::PIN_SX1276_ANT_SWITCH_RX, // RXTX is D29 82 | .rst = HalConfiguration_Catena4617_t::PIN_SX1276_NRESET, // NRESET is D8 83 | 84 | .dio = {HalConfiguration_Catena4617_t::PIN_SX1276_DIO0, // DIO0 (IRQ) is D25 85 | HalConfiguration_Catena4617_t::PIN_SX1276_DIO1, // DIO1 is D26 86 | HalConfiguration_Catena4617_t::PIN_SX1276_DIO2, // DIO2 is D27 87 | }, 88 | .rxtx_rx_active = 1, 89 | .rssi_cal = 10, 90 | .spi_freq = 8000000, /* 8MHz */ 91 | .pConfig = &myConfig 92 | }; 93 | 94 | const HalPinmap_t *GetPinmap_Catena4617(void) 95 | { 96 | return &myPinmap; 97 | } 98 | 99 | }; // namespace Arduino_LMIC 100 | 101 | #endif /* defined(ARDUINO_MCCI_CATENA_4617) || defined(ARDUINO_CATENA_4617) */ 102 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/hal/getpinmap_catena4618.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Module: getconfig_catena4618.cpp 4 | 5 | Function: 6 | Arduino-LMIC C++ HAL pinmaps for various boards 7 | 8 | Copyright & License: 9 | See accompanying LICENSE file. 10 | 11 | Author: 12 | Lakshmi Priya Natarajan, MCCI June 2019 13 | 14 | */ 15 | 16 | #if defined(ARDUINO_MCCI_CATENA_4618) 17 | 18 | #include 19 | #include 20 | 21 | #include "../lmic/oslmic.h" 22 | 23 | namespace Arduino_LMIC { 24 | 25 | class HalConfiguration_Catena4618_t : public HalConfiguration_t 26 | { 27 | public: 28 | enum DIGITAL_PINS : uint8_t 29 | { 30 | PIN_SX1276_NSS = D7, 31 | PIN_SX1276_NRESET = D8, 32 | PIN_SX1276_DIO0 = D25, 33 | PIN_SX1276_DIO1 = D26, 34 | PIN_SX1276_DIO2 = D27, 35 | PIN_SX1276_ANT_SWITCH_RX = D29, 36 | PIN_SX1276_ANT_SWITCH_TX_BOOST = D30, 37 | PIN_SX1276_ANT_SWITCH_TX_RFO = D31, 38 | PIN_VDD_BOOST_ENABLE = A0, 39 | PIN_TCXO_VDD = D33, 40 | }; 41 | 42 | static constexpr ostime_t TCXO_DELAY_MS = 5; 43 | 44 | virtual void begin(void) override 45 | { 46 | digitalWrite(PIN_TCXO_VDD, 0); 47 | pinMode(PIN_TCXO_VDD, OUTPUT); 48 | } 49 | 50 | virtual void end(void) override 51 | { 52 | digitalWrite(PIN_TCXO_VDD, 0); 53 | pinMode(PIN_TCXO_VDD, INPUT); 54 | } 55 | 56 | virtual bool queryUsingTcxo(void) override { return true; }; 57 | 58 | virtual ostime_t setModuleActive(bool state) override 59 | { 60 | ostime_t result; 61 | const int oldState = digitalRead(PIN_TCXO_VDD); 62 | 63 | // if turning on, we need to delay. 64 | result = 0; 65 | if (state && ! oldState) 66 | result = ms2osticksCeil(TCXO_DELAY_MS); 67 | 68 | if (state != oldState) 69 | digitalWrite(PIN_TCXO_VDD, state); 70 | 71 | return result; 72 | } 73 | }; 74 | 75 | // save some typing by bringing the pin numbers into scope 76 | static HalConfiguration_Catena4618_t myConfig; 77 | 78 | static const HalPinmap_t myPinmap = 79 | { 80 | .nss = HalConfiguration_Catena4618_t::PIN_SX1276_NSS, // chip select is D7 81 | .rxtx = HalConfiguration_Catena4618_t::PIN_SX1276_ANT_SWITCH_RX, // RXTX is D29 82 | .rst = HalConfiguration_Catena4618_t::PIN_SX1276_NRESET, // NRESET is D8 83 | 84 | .dio = {HalConfiguration_Catena4618_t::PIN_SX1276_DIO0, // DIO0 (IRQ) is D25 85 | HalConfiguration_Catena4618_t::PIN_SX1276_DIO1, // DIO1 is D26 86 | HalConfiguration_Catena4618_t::PIN_SX1276_DIO2, // DIO2 is D27 87 | }, 88 | .rxtx_rx_active = 1, 89 | .rssi_cal = 10, 90 | .spi_freq = 8000000, /* 8MHz */ 91 | .pConfig = &myConfig 92 | }; 93 | 94 | const HalPinmap_t *GetPinmap_Catena4618(void) 95 | { 96 | return &myPinmap; 97 | } 98 | 99 | }; // namespace Arduino_LMIC 100 | 101 | #endif /* defined(ARDUINO_MCCI_CATENA_4618) || defined(ARDUINO_CATENA_4618) */ 102 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/hal/getpinmap_catena4630.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Module: getconfig_catena4630.cpp 4 | 5 | Function: 6 | Arduino-LMIC C++ HAL pinmaps for various boards 7 | 8 | Copyright & License: 9 | See accompanying LICENSE file. 10 | 11 | Author: 12 | Dhinesh Kumar Pitchai, MCCI June 2019 13 | 14 | */ 15 | 16 | #if defined(ARDUINO_MCCI_CATENA_4630) 17 | 18 | #include 19 | #include 20 | 21 | #include "../lmic/oslmic.h" 22 | 23 | namespace Arduino_LMIC { 24 | 25 | class HalConfiguration_Catena4630_t : public HalConfiguration_t 26 | { 27 | public: 28 | enum DIGITAL_PINS : uint8_t 29 | { 30 | PIN_SX1276_NSS = D7, 31 | PIN_SX1276_NRESET = D8, 32 | PIN_SX1276_DIO0 = D25, 33 | PIN_SX1276_DIO1 = D26, 34 | PIN_SX1276_DIO2 = D27, 35 | PIN_SX1276_ANT_SWITCH_RX = D29, 36 | PIN_SX1276_ANT_SWITCH_TX_BOOST = D30, 37 | PIN_SX1276_ANT_SWITCH_TX_RFO = D31, 38 | PIN_VDD_BOOST_ENABLE = A0, 39 | PIN_TCXO_VDD = D33, 40 | }; 41 | 42 | static constexpr ostime_t TCXO_DELAY_MS = 5; 43 | 44 | virtual void begin(void) override 45 | { 46 | digitalWrite(PIN_TCXO_VDD, 0); 47 | pinMode(PIN_TCXO_VDD, OUTPUT); 48 | } 49 | 50 | virtual void end(void) override 51 | { 52 | digitalWrite(PIN_TCXO_VDD, 0); 53 | pinMode(PIN_TCXO_VDD, INPUT); 54 | } 55 | 56 | virtual bool queryUsingTcxo(void) override { return true; }; 57 | 58 | virtual ostime_t setModuleActive(bool state) override 59 | { 60 | ostime_t result; 61 | const int oldState = digitalRead(PIN_TCXO_VDD); 62 | 63 | // if turning on, we need to delay. 64 | result = 0; 65 | if (state && ! oldState) 66 | result = ms2osticksCeil(TCXO_DELAY_MS); 67 | 68 | if (state != oldState) 69 | digitalWrite(PIN_TCXO_VDD, state); 70 | 71 | return result; 72 | } 73 | }; 74 | 75 | // save some typing by bringing the pin numbers into scope 76 | static HalConfiguration_Catena4630_t myConfig; 77 | 78 | static const HalPinmap_t myPinmap = 79 | { 80 | .nss = HalConfiguration_Catena4630_t::PIN_SX1276_NSS, // chip select is D7 81 | .rxtx = HalConfiguration_Catena4630_t::PIN_SX1276_ANT_SWITCH_RX, // RXTX is D29 82 | .rst = HalConfiguration_Catena4630_t::PIN_SX1276_NRESET, // NRESET is D8 83 | 84 | .dio = {HalConfiguration_Catena4630_t::PIN_SX1276_DIO0, // DIO0 (IRQ) is D25 85 | HalConfiguration_Catena4630_t::PIN_SX1276_DIO1, // DIO1 is D26 86 | HalConfiguration_Catena4630_t::PIN_SX1276_DIO2, // DIO2 is D27 87 | }, 88 | .rxtx_rx_active = 1, 89 | .rssi_cal = 10, 90 | .spi_freq = 8000000, /* 8MHz */ 91 | .pConfig = &myConfig 92 | }; 93 | 94 | const HalPinmap_t *GetPinmap_Catena4630(void) 95 | { 96 | return &myPinmap; 97 | } 98 | 99 | }; // namespace Arduino_LMIC 100 | 101 | #endif /* defined(ARDUINO_MCCI_CATENA_4630) || defined(ARDUINO_CATENA_4630) */ 102 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/hal/getpinmap_catena4801.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Module: getconfig_catena4801.cpp 4 | 5 | Function: 6 | Arduino-LMIC C++ HAL pinmaps for various boards 7 | 8 | Copyright & License: 9 | See accompanying LICENSE file. 10 | 11 | Author: 12 | Terry Moore, MCCI November 2018 13 | 14 | */ 15 | 16 | #if defined(ARDUINO_MCCI_CATENA_4801) || \ 17 | /* legacy names */ \ 18 | defined(ARDUINO_CATENA_4801) 19 | 20 | #include 21 | #include 22 | 23 | #include "../lmic/oslmic.h" 24 | 25 | namespace Arduino_LMIC { 26 | 27 | class HalConfiguration_Catena4801_t : public HalConfiguration_t 28 | { 29 | public: 30 | enum DIGITAL_PINS : uint8_t 31 | { 32 | PIN_SX1276_NSS = D7, 33 | PIN_SX1276_NRESET = D8, 34 | PIN_SX1276_DIO0 = D25, 35 | PIN_SX1276_DIO1 = D26, 36 | PIN_SX1276_DIO2 = D27, 37 | PIN_SX1276_ANT_SWITCH_RX = D29, 38 | PIN_SX1276_ANT_SWITCH_TX_BOOST = D30, 39 | PIN_SX1276_ANT_SWITCH_TX_RFO = D31, 40 | PIN_VDD_BOOST_ENABLE = A0, 41 | PIN_TCXO_VDD = D33, 42 | }; 43 | 44 | virtual void begin(void) override 45 | { 46 | digitalWrite(PIN_TCXO_VDD, 0); 47 | pinMode(PIN_TCXO_VDD, OUTPUT); 48 | } 49 | 50 | virtual void end(void) override 51 | { 52 | digitalWrite(PIN_TCXO_VDD, 0); 53 | pinMode(PIN_TCXO_VDD, INPUT); 54 | } 55 | 56 | virtual bool queryUsingTcxo(void) override { return true; }; 57 | 58 | virtual ostime_t setModuleActive(bool state) override 59 | { 60 | ostime_t result; 61 | const int oldState = digitalRead(PIN_TCXO_VDD); 62 | 63 | // if turning on, we need to delay. 64 | result = 0; 65 | if (state && ! oldState) 66 | result = ms2osticksCeil(3); 67 | 68 | if (state != oldState) 69 | digitalWrite(PIN_TCXO_VDD, state); 70 | 71 | return result; 72 | } 73 | }; 74 | 75 | // save some typing by bringing the pin numbers into scope 76 | static HalConfiguration_Catena4801_t myConfig; 77 | 78 | static const HalPinmap_t myPinmap = 79 | { 80 | .nss = HalConfiguration_Catena4801_t::PIN_SX1276_NSS, // chip select is D7 81 | .rxtx = HalConfiguration_Catena4801_t::PIN_SX1276_ANT_SWITCH_RX, // RXTX is D29 82 | .rst = HalConfiguration_Catena4801_t::PIN_SX1276_NRESET, // NRESET is D8 83 | 84 | .dio = {HalConfiguration_Catena4801_t::PIN_SX1276_DIO0, // DIO0 (IRQ) is D25 85 | HalConfiguration_Catena4801_t::PIN_SX1276_DIO1, // DIO1 is D26 86 | HalConfiguration_Catena4801_t::PIN_SX1276_DIO2, // DIO2 is D27 87 | }, 88 | .rxtx_rx_active = 1, 89 | .rssi_cal = 10, 90 | .spi_freq = 8000000, /* 8MHz */ 91 | .pConfig = &myConfig 92 | }; 93 | 94 | const HalPinmap_t *GetPinmap_Catena4801(void) 95 | { 96 | return &myPinmap; 97 | } 98 | 99 | }; // namespace Arduino_LMIC 100 | 101 | #endif /* defined(ARDUINO_CATENA_4611) || defined(ARDUINO_CATENA_4801) */ 102 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/hal/getpinmap_catena4802.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Module: getconfig_catena4802.cpp 4 | 5 | Function: 6 | Arduino-LMIC C++ HAL pinmaps for various boards 7 | 8 | Copyright & License: 9 | See accompanying LICENSE file. 10 | 11 | Author: 12 | Dhinesh Kumar Pitchai, MCCI November 2020 13 | 14 | */ 15 | 16 | #if defined(ARDUINO_MCCI_CATENA_4802) || \ 17 | /* legacy names */ \ 18 | defined(ARDUINO_CATENA_4802) 19 | 20 | #include 21 | #include 22 | 23 | #include "../lmic/oslmic.h" 24 | 25 | namespace Arduino_LMIC { 26 | 27 | class HalConfiguration_Catena4802_t : public HalConfiguration_t 28 | { 29 | public: 30 | enum DIGITAL_PINS : uint8_t 31 | { 32 | PIN_SX1276_NSS = D7, 33 | PIN_SX1276_NRESET = D8, 34 | PIN_SX1276_DIO0 = D25, 35 | PIN_SX1276_DIO1 = D26, 36 | PIN_SX1276_DIO2 = D27, 37 | PIN_SX1276_ANT_SWITCH_RX = D29, 38 | PIN_SX1276_ANT_SWITCH_TX_BOOST = D30, 39 | PIN_SX1276_ANT_SWITCH_TX_RFO = D31, 40 | PIN_VDD_BOOST_ENABLE = A0, 41 | PIN_TCXO_VDD = D33, 42 | }; 43 | 44 | virtual void begin(void) override 45 | { 46 | digitalWrite(PIN_TCXO_VDD, 0); 47 | pinMode(PIN_TCXO_VDD, OUTPUT); 48 | } 49 | 50 | virtual void end(void) override 51 | { 52 | digitalWrite(PIN_TCXO_VDD, 0); 53 | pinMode(PIN_TCXO_VDD, INPUT); 54 | } 55 | 56 | virtual bool queryUsingTcxo(void) override { return true; }; 57 | 58 | virtual ostime_t setModuleActive(bool state) override 59 | { 60 | ostime_t result; 61 | const int oldState = digitalRead(PIN_TCXO_VDD); 62 | 63 | // if turning on, we need to delay. 64 | result = 0; 65 | if (state && ! oldState) 66 | result = ms2osticksCeil(3); 67 | 68 | if (state != oldState) 69 | digitalWrite(PIN_TCXO_VDD, state); 70 | 71 | return result; 72 | } 73 | }; 74 | 75 | // save some typing by bringing the pin numbers into scope 76 | static HalConfiguration_Catena4802_t myConfig; 77 | 78 | static const HalPinmap_t myPinmap = 79 | { 80 | .nss = HalConfiguration_Catena4802_t::PIN_SX1276_NSS, // chip select is D7 81 | .rxtx = HalConfiguration_Catena4802_t::PIN_SX1276_ANT_SWITCH_RX, // RXTX is D29 82 | .rst = HalConfiguration_Catena4802_t::PIN_SX1276_NRESET, // NRESET is D8 83 | 84 | .dio = {HalConfiguration_Catena4802_t::PIN_SX1276_DIO0, // DIO0 (IRQ) is D25 85 | HalConfiguration_Catena4802_t::PIN_SX1276_DIO1, // DIO1 is D26 86 | HalConfiguration_Catena4802_t::PIN_SX1276_DIO2, // DIO2 is D27 87 | }, 88 | .rxtx_rx_active = 1, 89 | .rssi_cal = 10, 90 | .spi_freq = 8000000, /* 8MHz */ 91 | .pConfig = &myConfig 92 | }; 93 | 94 | const HalPinmap_t *GetPinmap_Catena4802(void) 95 | { 96 | return &myPinmap; 97 | } 98 | 99 | }; // namespace Arduino_LMIC 100 | 101 | #endif /* defined(ARDUINO_CATENA_4611) || defined(ARDUINO_CATENA_4802) */ 102 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/hal/getpinmap_disco_l072cs_lrwan1.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Module: getpinmap_disco_l072cz_lrwan1.cpp 4 | 5 | Function: 6 | Arduino-LMIC C++ HAL pinmaps for the Discovery L072CZ LRWAN1 7 | 8 | Copyright & License: 9 | See accompanying LICENSE file. 10 | 11 | Author: 12 | Helium February 2020 13 | 14 | */ 15 | 16 | #if defined(ARDUINO_DISCO_L072CZ_LRWAN1) 17 | 18 | #include 19 | #include 20 | 21 | #include "../lmic/oslmic.h" 22 | 23 | namespace Arduino_LMIC { 24 | 25 | class HalConfiguration_Disco_L072cz_Lrwan1_t : public HalConfiguration_t 26 | { 27 | public: 28 | enum DIGITAL_PINS : uint8_t 29 | { 30 | PIN_SX1276_NSS = 37, 31 | PIN_SX1276_NRESET = 33, 32 | PIN_SX1276_DIO0 = 38, 33 | PIN_SX1276_DIO1 = 39, 34 | PIN_SX1276_DIO2 = 40, 35 | PIN_SX1276_RXTX = 21, 36 | }; 37 | 38 | virtual bool queryUsingTcxo(void) override { return false; }; 39 | }; 40 | // save some typing by bringing the pin numbers into scope 41 | static HalConfiguration_Disco_L072cz_Lrwan1_t myConfig; 42 | 43 | static const HalPinmap_t myPinmap = 44 | { 45 | .nss = HalConfiguration_Disco_L072cz_Lrwan1_t::PIN_SX1276_NSS, 46 | .rxtx = HalConfiguration_Disco_L072cz_Lrwan1_t::PIN_SX1276_RXTX, 47 | .rst = HalConfiguration_Disco_L072cz_Lrwan1_t::PIN_SX1276_NRESET, 48 | 49 | .dio = {HalConfiguration_Disco_L072cz_Lrwan1_t::PIN_SX1276_DIO0, 50 | HalConfiguration_Disco_L072cz_Lrwan1_t::PIN_SX1276_DIO1, 51 | HalConfiguration_Disco_L072cz_Lrwan1_t::PIN_SX1276_DIO2, 52 | }, 53 | .rxtx_rx_active = 1, 54 | .rssi_cal = 10, 55 | .spi_freq = 8000000, /* 8MHz */ 56 | .pConfig = &myConfig 57 | }; 58 | 59 | const HalPinmap_t *GetPinmap_Disco_L072cz_Lrwan1(void) 60 | { 61 | return &myPinmap; 62 | } 63 | 64 | }; // namespace Arduino_LMIC 65 | 66 | #endif /* defined(ARDUINO_DISCO_L072CZ_LRWAN1) */ 67 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/hal/getpinmap_feather32u4lora.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Module: getconfig_feather32u4lora.cpp 4 | 5 | Function: 6 | Arduino-LMIC C++ HAL pinmap for Adafruit Feather 32U4 LoRa 7 | 8 | Copyright & License: 9 | See accompanying LICENSE file. 10 | 11 | Author: 12 | Terry Moore, MCCI November 2018 13 | 14 | */ 15 | 16 | #if defined(ARDUINO_AVR_FEATHER32U4) 17 | 18 | #include 19 | #include 20 | 21 | #include "../lmic/oslmic.h" 22 | 23 | namespace Arduino_LMIC { 24 | 25 | class HalConfiguration_Feather32U4LoRa_t : public HalConfiguration_t 26 | { 27 | public: 28 | enum DIGITAL_PINS : uint8_t 29 | { 30 | PIN_SX1276_NSS = 8, 31 | PIN_SX1276_NRESET = 4, 32 | PIN_SX1276_DIO0 = 7, 33 | PIN_SX1276_DIO1 = 6, 34 | PIN_SX1276_DIO2 = HalPinmap_t::UNUSED_PIN, 35 | PIN_SX1276_ANT_SWITCH_RX = HalPinmap_t::UNUSED_PIN, 36 | PIN_SX1276_ANT_SWITCH_TX_BOOST = HalPinmap_t::UNUSED_PIN, 37 | PIN_SX1276_ANT_SWITCH_TX_RFO = HalPinmap_t::UNUSED_PIN, 38 | PIN_VDD_BOOST_ENABLE = HalPinmap_t::UNUSED_PIN, 39 | }; 40 | 41 | virtual void begin(void) override 42 | { 43 | digitalWrite(PIN_SX1276_NSS, 1); 44 | pinMode(PIN_SX1276_NSS, OUTPUT); 45 | } 46 | 47 | // virtual void end(void) override 48 | 49 | // virtual ostime_t setModuleActive(bool state) override 50 | 51 | }; 52 | 53 | static HalConfiguration_Feather32U4LoRa_t myConfig; 54 | 55 | // Pin mapping for Adafruit Feather 32u4 LoRa, etc. 56 | // Just like Feather M0 LoRa, but uses SPI at 1MHz; and that's only 57 | // because MCCI doesn't have a test board; probably higher frequencies 58 | // will work. 59 | 60 | static const HalPinmap_t myPinmap = 61 | { 62 | .nss = HalConfiguration_Feather32U4LoRa_t::PIN_SX1276_NSS, // chip select is D7 63 | .rxtx = HalConfiguration_Feather32U4LoRa_t::PIN_SX1276_ANT_SWITCH_RX, // RXTX is D29 64 | .rst = HalConfiguration_Feather32U4LoRa_t::PIN_SX1276_NRESET, // NRESET is D8 65 | 66 | .dio = {HalConfiguration_Feather32U4LoRa_t::PIN_SX1276_DIO0, // DIO0 (IRQ) is D25 67 | HalConfiguration_Feather32U4LoRa_t::PIN_SX1276_DIO1, // DIO1 is D26 68 | HalConfiguration_Feather32U4LoRa_t::PIN_SX1276_DIO2, // DIO2 is D27 69 | }, 70 | .rxtx_rx_active = 0, 71 | .rssi_cal = 8, 72 | .spi_freq = 1000000, /* 1MHz */ 73 | .pConfig = &myConfig, 74 | }; 75 | 76 | const HalPinmap_t *GetPinmap_Feather32U4LoRa(void) 77 | { 78 | return &myPinmap; 79 | } 80 | 81 | }; // namespace Arduino_LMIC 82 | 83 | #endif // ARDUINO_AVR_FEATHER32U4 84 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/hal/getpinmap_featherm0lora.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Module: getconfig_featherm0lora.cpp 4 | 5 | Function: 6 | Arduino-LMIC C++ HAL pinmap for Adafruit Feather M0 LoRa 7 | 8 | Copyright & License: 9 | See accompanying LICENSE file. 10 | 11 | Author: 12 | Terry Moore, MCCI November 2018 13 | 14 | */ 15 | 16 | // The Adafruit FeatherM0 and FeatherM0 Express BSPs are not consistent 17 | // as to how they declare themselves. Both are SAMDs. Detect either one. 18 | #if defined(ARDUINO_ARCH_SAMD) 19 | # if defined(ADAFRUIT_FEATHER_M0) || defined(ARDUINO_SAMD_FEATHER_M0) 20 | 21 | #include 22 | #include 23 | 24 | #include "../lmic/oslmic.h" 25 | 26 | namespace Arduino_LMIC { 27 | 28 | class HalConfiguration_FeatherM0LoRa_t : public HalConfiguration_t 29 | { 30 | public: 31 | enum DIGITAL_PINS : uint8_t 32 | { 33 | PIN_SX1276_NSS = 8, 34 | PIN_SX1276_NRESET = 4, 35 | PIN_SX1276_DIO0 = 3, 36 | PIN_SX1276_DIO1 = 6, 37 | PIN_SX1276_DIO2 = HalPinmap_t::UNUSED_PIN, 38 | PIN_SX1276_ANT_SWITCH_RX = HalPinmap_t::UNUSED_PIN, 39 | PIN_SX1276_ANT_SWITCH_TX_BOOST = HalPinmap_t::UNUSED_PIN, 40 | PIN_SX1276_ANT_SWITCH_TX_RFO = HalPinmap_t::UNUSED_PIN, 41 | PIN_VDD_BOOST_ENABLE = HalPinmap_t::UNUSED_PIN, 42 | }; 43 | 44 | virtual void begin(void) override 45 | { 46 | digitalWrite(PIN_SX1276_NSS, 1); 47 | pinMode(PIN_SX1276_NSS, OUTPUT); 48 | } 49 | 50 | // virtual void end(void) override 51 | 52 | // virtual ostime_t setModuleActive(bool state) override 53 | 54 | }; 55 | 56 | static HalConfiguration_FeatherM0LoRa_t myConfig; 57 | 58 | static const HalPinmap_t myPinmap = 59 | { 60 | .nss = HalConfiguration_FeatherM0LoRa_t::PIN_SX1276_NSS, // chip select is D7 61 | .rxtx = HalConfiguration_FeatherM0LoRa_t::PIN_SX1276_ANT_SWITCH_RX, // RXTX is D29 62 | .rst = HalConfiguration_FeatherM0LoRa_t::PIN_SX1276_NRESET, // NRESET is D8 63 | 64 | .dio = {HalConfiguration_FeatherM0LoRa_t::PIN_SX1276_DIO0, // DIO0 (IRQ) is D25 65 | HalConfiguration_FeatherM0LoRa_t::PIN_SX1276_DIO1, // DIO1 is D26 66 | HalConfiguration_FeatherM0LoRa_t::PIN_SX1276_DIO2, // DIO2 is D27 67 | }, 68 | .rxtx_rx_active = 0, 69 | .rssi_cal = 10, 70 | .spi_freq = 8000000, /* 8MHz */ 71 | .pConfig = &myConfig 72 | }; 73 | 74 | const HalPinmap_t *GetPinmap_FeatherM0LoRa(void) 75 | { 76 | return &myPinmap; 77 | } 78 | 79 | }; // namespace Arduino_LMIC 80 | 81 | # endif // defined(ADAFRUIT_FEATHER_M0) || defined(ARDUINO_SAMD_FEATHER_M0) 82 | #endif // defined(ARDUINO_ARCH_SAMD) 83 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/hal/getpinmap_heltec_lora32.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Module: getpinmap_heltec_lora32.cpp 4 | 5 | Function: 6 | Arduino-LMIC C++ HAL pinmap for Heltec WiFi LoRa 32 (V1 & V2) and Heltec Wireless Stick 7 | 8 | Copyright & License: 9 | See accompanying LICENSE file. 10 | 11 | Author: 12 | Manuel Bleichenbacher, manuel.bleichenbacher@gmail.com October 2019 13 | 14 | */ 15 | 16 | #if defined(ARDUINO_HELTEC_WIFI_LORA_32) || defined(ARDUINO_HELTEC_WIFI_LORA_32_V2) || defined(ARDUINO_HELTEC_WIRELESS_STICK) 17 | 18 | #include 19 | #include 20 | 21 | #include "../lmic/oslmic.h" 22 | 23 | // Note: The pin constants SS, RST_LoRa and DIOx are defined in pins_arduino.h 24 | // (board-specific variant in Arduino core). Even if it won't be used, this 25 | // file needs to compile for all other variants as well. 26 | #if !defined(ARDUINO_HELTEC_WIFI_LORA_32) && !defined(ARDUINO_HELTEC_WIFI_LORA_32_V2) && !defined(ARDUINO_HELTEC_WIRELESS_STICK) 27 | #undef SS 28 | #undef RST_LoRa 29 | #undef DIO0 30 | #undef DIO1 31 | #undef DIO2 32 | #define SS HalPinmap_t::UNUSED_PIN 33 | #define RST_LoRa HalPinmap_t::UNUSED_PIN 34 | #define DIO0 HalPinmap_t::UNUSED_PIN 35 | #define DIO1 HalPinmap_t::UNUSED_PIN 36 | #define DIO2 HalPinmap_t::UNUSED_PIN 37 | #endif 38 | 39 | 40 | namespace Arduino_LMIC 41 | { 42 | 43 | class HalConfiguration_heltec_lora32 : public HalConfiguration_t 44 | { 45 | public: 46 | enum DIGITAL_PINS : uint8_t 47 | { 48 | PIN_SX1276_NSS = SS, 49 | PIN_SX1276_NRESET = RST_LoRa, 50 | PIN_SX1276_DIO0 = DIO0, 51 | PIN_SX1276_DIO1 = DIO1, 52 | PIN_SX1276_DIO2 = DIO2, 53 | PIN_SX1276_ANT_SWITCH_RX = HalPinmap_t::UNUSED_PIN, 54 | PIN_SX1276_ANT_SWITCH_TX_BOOST = HalPinmap_t::UNUSED_PIN, 55 | PIN_SX1276_ANT_SWITCH_TX_RFO = HalPinmap_t::UNUSED_PIN, 56 | PIN_VDD_BOOST_ENABLE = HalPinmap_t::UNUSED_PIN, 57 | }; 58 | }; 59 | 60 | static HalConfiguration_heltec_lora32 myConfig; 61 | 62 | static const HalPinmap_t myPinmap = 63 | { 64 | .nss = HalConfiguration_heltec_lora32::PIN_SX1276_NSS, 65 | .rxtx = HalConfiguration_heltec_lora32::PIN_SX1276_ANT_SWITCH_RX, 66 | .rst = HalConfiguration_heltec_lora32::PIN_SX1276_NRESET, 67 | .dio = { 68 | HalConfiguration_heltec_lora32::PIN_SX1276_DIO0, 69 | HalConfiguration_heltec_lora32::PIN_SX1276_DIO1, 70 | HalConfiguration_heltec_lora32::PIN_SX1276_DIO2, 71 | }, 72 | .rxtx_rx_active = 0, 73 | .rssi_cal = 10, 74 | .spi_freq = 8000000, /* 8MHz */ 75 | .pConfig = &myConfig}; 76 | 77 | const HalPinmap_t *GetPinmap_heltec_lora32(void) 78 | { 79 | return &myPinmap; 80 | } 81 | 82 | }; // namespace Arduino_LMIC 83 | 84 | #endif // defined(ARDUINO_HELTEC_WIFI_LORA_32) || defined(ARDUINO_HELTEC_WIFI_LORA_32_V2) || defined(ARDUINO_HELTEC_WIRELESS_STICK) 85 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/hal/getpinmap_thisboard.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Module: getconfig_thisboard.cpp 4 | 5 | Function: 6 | Return a suitable LMIC config for this board. 7 | 8 | Copyright & License: 9 | See accompanying LICENSE file. 10 | 11 | Author: 12 | Terry Moore, MCCI November 2018 13 | 14 | */ 15 | 16 | #include 17 | 18 | namespace Arduino_LMIC { 19 | 20 | const HalPinmap_t *GetPinmap_ThisBoard(void) 21 | { 22 | /* 23 | || Adafruit BSPs are not consistent -- m0 express defs ARDUINO_SAMD_FEATHER_M0, 24 | || m0 defs ADAFRUIT_FEATHER_M0 25 | */ 26 | #if defined(ARDUINO_SAMD_FEATHER_M0) || defined(ADAFRUIT_FEATHER_M0) 27 | # if defined(ARDUINO_MCCI_CATENA_4420) 28 | // this uses a radiowing and an odd configuration 29 | return GetPinmap_Catena4420(); 30 | # else 31 | // others use Feather M0 LoRa 32 | return GetPinmap_FeatherM0LoRa(); 33 | # endif 34 | #elif defined(ARDUINO_AVR_FEATHER32U4) 35 | return GetPinmap_Feather32U4LoRa(); 36 | #elif defined(ARDUINO_MCCI_CATENA_4551) || \ 37 | /* legacy names */ \ 38 | defined(ARDUINO_CATENA_4551) 39 | return GetPinmap_Catena4551(); 40 | #elif defined(ARDUINO_MCCI_CATENA_4610) 41 | return GetPinmap_Catena4610(); 42 | #elif defined(ARDUINO_MCCI_CATENA_4611) || \ 43 | /* legacy names */ \ 44 | defined(ARDUINO_CATENA_4611) 45 | return GetPinmap_Catena4611(); 46 | #elif defined(ARDUINO_MCCI_CATENA_4612) || \ 47 | /* legacy names */ \ 48 | defined(ARDUINO_CATENA_4612) 49 | return GetPinmap_Catena4612(); 50 | #elif defined(ARDUINO_MCCI_CATENA_4617) 51 | return GetPinmap_Catena4617(); 52 | #elif defined(ARDUINO_MCCI_CATENA_4618) 53 | return GetPinmap_Catena4618(); 54 | #elif defined(ARDUINO_MCCI_CATENA_4630) 55 | return GetPinmap_Catena4630(); 56 | #elif defined(ARDUINO_MCCI_CATENA_4801) 57 | return GetPinmap_Catena4801(); 58 | #elif defined(ARDUINO_MCCI_CATENA_4802) 59 | return GetPinmap_Catena4802(); 60 | #elif defined(ARDUINO_DISCO_L072CZ_LRWAN1) 61 | return GetPinmap_Disco_L072cz_Lrwan1(); 62 | #elif defined(PINNOCHIO_SCOUT) 63 | return GetPinmap_PinnochioScount(); 64 | #elif defined(ARDUINO_TTGO_LoRa32_V1) 65 | return GetPinmap_ttgo_lora32_v1(); 66 | #elif defined(ARDUINO_TTGO_LoRa32_v21new) 67 | return GetPinmap_ttgo_lora32_v21(); 68 | #elif defined(ARDUINO_HELTEC_WIFI_LORA_32) || defined(ARDUINO_HELTEC_WIFI_LORA_32_V2) || defined(ARDUINO_HELTEC_WIRELESS_STICK) 69 | return GetPinmap_heltec_lora32(); 70 | #else 71 | #pragma message("Board not supported -- use an explicit pinmap") 72 | return nullptr; 73 | #endif 74 | } 75 | 76 | }; // namespace Arduino_LMIC 77 | 78 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/hal/getpinmap_ttgo_lora32_v1.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Module: getconfig_ttgo_lora32_v1.cpp 4 | 5 | Function: 6 | Arduino-LMIC C++ HAL pinmap for TTGO ESP32 OLED V1 7 | 8 | Copyright & License: 9 | See accompanying LICENSE file. 10 | 11 | Author: 12 | German Martin, gmag11@gmail.com June 2019 13 | 14 | */ 15 | 16 | #if defined(ARDUINO_TTGO_LoRa32_V1) 17 | 18 | #include 19 | #include 20 | 21 | #include "../lmic/oslmic.h" 22 | 23 | #define LORA_DIO0 26 24 | #define LORA_DIO1 33 25 | #define LORA_DIO2 32 26 | 27 | namespace Arduino_LMIC { 28 | 29 | class HalConfiguration_ttgo_lora32_v1 : public HalConfiguration_t 30 | { 31 | public: 32 | enum DIGITAL_PINS : uint8_t 33 | { 34 | PIN_SX1276_NSS = 18, 35 | PIN_SX1276_NRESET = 14, 36 | PIN_SX1276_DIO0 = LORA_DIO0, 37 | PIN_SX1276_DIO1 = LORA_DIO1, 38 | PIN_SX1276_DIO2 = LORA_DIO2, 39 | PIN_SX1276_ANT_SWITCH_RX = HalPinmap_t::UNUSED_PIN, 40 | PIN_SX1276_ANT_SWITCH_TX_BOOST = HalPinmap_t::UNUSED_PIN, 41 | PIN_SX1276_ANT_SWITCH_TX_RFO = HalPinmap_t::UNUSED_PIN, 42 | PIN_VDD_BOOST_ENABLE = HalPinmap_t::UNUSED_PIN, 43 | }; 44 | 45 | virtual void begin(void) override 46 | { 47 | digitalWrite(PIN_SX1276_NSS, 1); 48 | pinMode(PIN_SX1276_NSS, OUTPUT); 49 | } 50 | 51 | // virtual void end(void) override 52 | 53 | // virtual ostime_t setModuleActive(bool state) override 54 | 55 | }; 56 | 57 | static HalConfiguration_ttgo_lora32_v1 myConfig; 58 | 59 | static const HalPinmap_t myPinmap = 60 | { 61 | .nss = HalConfiguration_ttgo_lora32_v1::PIN_SX1276_NSS, // chip select is D7 62 | .rxtx = HalConfiguration_ttgo_lora32_v1::PIN_SX1276_ANT_SWITCH_RX, // RXTX is D29 63 | .rst = HalConfiguration_ttgo_lora32_v1::PIN_SX1276_NRESET, // NRESET is D8 64 | 65 | .dio = {HalConfiguration_ttgo_lora32_v1::PIN_SX1276_DIO0, // DIO0 (IRQ) is D25 66 | HalConfiguration_ttgo_lora32_v1::PIN_SX1276_DIO1, // DIO1 is D26 67 | HalConfiguration_ttgo_lora32_v1::PIN_SX1276_DIO2, // DIO2 is D27 68 | }, 69 | .rxtx_rx_active = 0, 70 | .rssi_cal = 10, 71 | .spi_freq = 8000000, /* 8MHz */ 72 | .pConfig = &myConfig 73 | }; 74 | 75 | const HalPinmap_t * GetPinmap_ttgo_lora32_v1 (void) 76 | { 77 | return &myPinmap; 78 | } 79 | 80 | }; // namespace Arduino_LMIC 81 | 82 | #endif // ARDUINO_TTGO_LoRa32_V1 83 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/hal/getpinmap_ttgo_lora32_v2.1.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Module: getconfig_ttgo_lora32_v2.1.cpp 4 | 5 | Function: 6 | Arduino-LMIC C++ HAL pinmap for TTGO ESP32 OLED V2.1 7 | 8 | Copyright & License: 9 | See accompanying LICENSE file. 10 | 11 | Author: 12 | Christoph Schultz, GitHub @ChrSchultz March 2021 13 | 14 | */ 15 | 16 | #if defined(ARDUINO_TTGO_LoRa32_v21new) 17 | 18 | #include 19 | #include 20 | 21 | #include "../lmic/oslmic.h" 22 | 23 | #define LORA_DIO0 26 24 | #define LORA_DIO1 33 25 | #define LORA_DIO2 32 26 | 27 | namespace Arduino_LMIC { 28 | 29 | class HalConfiguration_ttgo_lora32_v21 : public HalConfiguration_t 30 | { 31 | public: 32 | enum DIGITAL_PINS : uint8_t 33 | { 34 | PIN_SX1276_NSS = 18, 35 | PIN_SX1276_NRESET = 23, 36 | PIN_SX1276_DIO0 = LORA_DIO0, 37 | PIN_SX1276_DIO1 = LORA_DIO1, 38 | PIN_SX1276_DIO2 = LORA_DIO2, 39 | PIN_SX1276_ANT_SWITCH_RX = HalPinmap_t::UNUSED_PIN, 40 | PIN_SX1276_ANT_SWITCH_TX_BOOST = HalPinmap_t::UNUSED_PIN, 41 | PIN_SX1276_ANT_SWITCH_TX_RFO = HalPinmap_t::UNUSED_PIN, 42 | PIN_VDD_BOOST_ENABLE = HalPinmap_t::UNUSED_PIN, 43 | }; 44 | 45 | virtual void begin(void) override 46 | { 47 | digitalWrite(PIN_SX1276_NSS, 1); 48 | pinMode(PIN_SX1276_NSS, OUTPUT); 49 | } 50 | 51 | // virtual void end(void) override 52 | 53 | // virtual ostime_t setModuleActive(bool state) override 54 | 55 | }; 56 | 57 | static HalConfiguration_ttgo_lora32_v21 myConfig; 58 | 59 | static const HalPinmap_t myPinmap = 60 | { 61 | .nss = HalConfiguration_ttgo_lora32_v21::PIN_SX1276_NSS, // chip select is D7 62 | .rxtx = HalConfiguration_ttgo_lora32_v21::PIN_SX1276_ANT_SWITCH_RX, // RXTX is D29 63 | .rst = HalConfiguration_ttgo_lora32_v21::PIN_SX1276_NRESET, // NRESET is D8 64 | 65 | .dio = {HalConfiguration_ttgo_lora32_v21::PIN_SX1276_DIO0, // DIO0 (IRQ) is D25 66 | HalConfiguration_ttgo_lora32_v21::PIN_SX1276_DIO1, // DIO1 is D26 67 | HalConfiguration_ttgo_lora32_v21::PIN_SX1276_DIO2, // DIO2 is D27 68 | }, 69 | .rxtx_rx_active = 0, 70 | .rssi_cal = 10, 71 | .spi_freq = 8000000, /* 8MHz */ 72 | .pConfig = &myConfig 73 | }; 74 | 75 | const HalPinmap_t * GetPinmap_ttgo_lora32_v21 (void) 76 | { 77 | return &myPinmap; 78 | } 79 | 80 | }; // namespace Arduino_LMIC 81 | 82 | #endif // ARDUINO_TTGO_LoRa32_v21new 83 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/hal/hal.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2015-2016 Matthijs Kooijman 3 | * Copyright (c) 2016-2018 MCCI Corporation 4 | * 5 | * All rights reserved. This program and the accompanying materials 6 | * are made available under the terms of the Eclipse Public License v1.0 7 | * which accompanies this distribution, and is available at 8 | * http://www.eclipse.org/legal/epl-v10.html 9 | * 10 | * This the HAL to run LMIC on top of the Arduino environment. 11 | *******************************************************************************/ 12 | #ifndef _hal_hal_h_ 13 | #define _hal_hal_h_ 14 | 15 | #include "arduino_lmic_hal_configuration.h" 16 | 17 | // for compatbility reasons, we need to disclose the configuration 18 | // structure as global type lmic_pinmap. 19 | using lmic_pinmap = Arduino_LMIC::HalPinmap_t; 20 | 21 | // similarly, we need to disclose NUM_DIO and LMIC_UNUSED_PIN 22 | static const int NUM_DIO = lmic_pinmap::NUM_DIO; 23 | 24 | // Use this for any unused pins. 25 | const u1_t LMIC_UNUSED_PIN = lmic_pinmap::UNUSED_PIN; 26 | 27 | // Declared here, to be defined and initialized by the application. 28 | // Use os_init_ex() if you want not to use a const table, or if 29 | // you need to define a derived type (so you can override methods). 30 | extern const lmic_pinmap lmic_pins; 31 | 32 | #endif // _hal_hal_h_ 33 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/lmic.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Module: lmic.h 4 | 5 | Function: 6 | Deprecated C++ top-level include file (use instead). 7 | 8 | Copyright & License: 9 | See accompanying LICENSE file. 10 | 11 | Author: 12 | Terry Moore, MCCI November 2018 13 | 14 | Note: 15 | This header file is deprecated and is included for 16 | transitional purposes. It's deprecated because it's 17 | confusing to have src/lmic.h (this file) and src/lmic/lmic.h 18 | (the API file for the C library). We can't take it out 19 | yet, because it would inconvenience the world, but 20 | we can hope that someday it will wither away (on a major 21 | version bump). 22 | 23 | Please don't add any new functionality in this file; 24 | it is just a wrapper for arduino_lmic.h. 25 | 26 | */ 27 | 28 | #include "arduino_lmic.h" 29 | 30 | /* end of file */ 31 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/lmic/lmic_bandplan_au915.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 IBM Corporation. 3 | * Copyright (c) 2017, 2019-2021 MCCI Corporation. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the nor the 14 | * names of its contributors may be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _lmic_bandplan_au915_h_ 30 | # define _lmic_bandplan_au915_h_ 31 | 32 | // preconditions for lmic_us_like.h 33 | #define LMICuslike_getFirst500kHzDR() (LORAWAN_DR6) 34 | #define LMICuslike_getJoin125kHzDR() (LORAWAN_DR2) 35 | 36 | #ifndef _lmic_us_like_h_ 37 | # include "lmic_us_like.h" 38 | #endif 39 | 40 | // return maximum frame length (including PHY header) for this data rate (au915); 0 --> not valid dr. 41 | uint8_t LMICau915_maxFrameLen(uint8_t dr); 42 | // return maximum frame length (including PHY header) for this data rate; 0 --> not valid dr. 43 | #define LMICbandplan_maxFrameLen(dr) LMICau915_maxFrameLen(dr) 44 | 45 | int8_t LMICau915_pow2dbm(uint8_t mcmd_ladr_p1); 46 | #define pow2dBm(mcmd_ladr_p1) LMICau915_pow2dbm(mcmd_ladr_p1) 47 | 48 | ostime_t LMICau915_dr2hsym(uint8_t dr); 49 | #define dr2hsym(dr) LMICau915_dr2hsym(dr) 50 | 51 | 52 | #define LMICbandplan_getInitialDrJoin() (LORAWAN_DR2) 53 | 54 | void LMICau915_initJoinLoop(void); 55 | #define LMICbandplan_initJoinLoop() LMICau915_initJoinLoop() 56 | 57 | void LMICau915_setBcnRxParams(void); 58 | #define LMICbandplan_setBcnRxParams() LMICau915_setBcnRxParams() 59 | 60 | u4_t LMICau915_convFreq(xref2cu1_t ptr); 61 | #define LMICbandplan_convFreq(ptr) LMICau915_convFreq(ptr) 62 | 63 | void LMICau915_setRx1Params(void); 64 | #define LMICbandplan_setRx1Params() LMICau915_setRx1Params() 65 | 66 | void LMICau915_updateTx(ostime_t txbeg); 67 | #define LMICbandplan_updateTx(txbeg) LMICau915_updateTx(txbeg) 68 | 69 | #undef LMICbandplan_validDR 70 | bit_t LMICau915_validDR(dr_t dr); 71 | #define LMICbandplan_validDR(dr) LMICau915_validDR(dr) 72 | 73 | #endif // _lmic_bandplan_au915_h_ 74 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/lmic/lmic_bandplan_eu868.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 IBM Corporation. 3 | * Copyright (c) 2017, 2019-2021 MCCI Corporation. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the nor the 14 | * names of its contributors may be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _lmic_eu868_h_ 30 | # define _lmic_eu868_h_ 31 | 32 | #ifndef _lmic_eu_like_h_ 33 | # include "lmic_eu_like.h" 34 | #endif 35 | 36 | // return maximum frame length (including PHY header) for this data rate (eu868); 0 --> not valid dr. 37 | uint8_t LMICeu868_maxFrameLen(uint8_t dr); 38 | // return maximum frame length (including PHY header) for this data rate; 0 --> not valid dr. 39 | #define LMICbandplan_maxFrameLen(dr) LMICeu868_maxFrameLen(dr) 40 | 41 | int8_t LMICeu868_pow2dBm(uint8_t mcmd_ladr_p1); 42 | #define pow2dBm(mcmd_ladr_p1) LMICeu868_pow2dBm(mcmd_ladr_p1) 43 | 44 | // Times for half symbol per DR 45 | // Per DR table to minimize rounding errors 46 | ostime_t LMICeu868_dr2hsym(uint8_t dr); 47 | #define dr2hsym(dr) LMICeu868_dr2hsym(dr) 48 | 49 | 50 | // TODO(tmm@mcci.com) this looks bogus compared to current 1.02 regional 51 | // spec. https://github.com/mcci-catena/arduino-lmic/issues/18 52 | static inline int 53 | LMICeu868_isValidBeacon1(const uint8_t *d) { 54 | return d[OFF_BCN_CRC1] != (u1_t)os_crc16(d, OFF_BCN_CRC1); 55 | } 56 | 57 | #undef LMICbandplan_isValidBeacon1 58 | #define LMICbandplan_isValidBeacon1(pFrame) LMICeu868_isValidBeacon1(pFrame) 59 | 60 | // override default for LMICbandplan_isFSK() 61 | #undef LMICbandplan_isFSK 62 | #define LMICbandplan_isFSK() (/* RX datarate */LMIC.dndr == EU868_DR_FSK) 63 | 64 | #define LMICbandplan_getInitialDrJoin() (EU868_DR_SF7) 65 | 66 | void LMICeu868_setBcnRxParams(void); 67 | #define LMICbandplan_setBcnRxParams() LMICeu868_setBcnRxParams() 68 | 69 | u4_t LMICeu868_convFreq(xref2cu1_t ptr); 70 | #define LMICbandplan_convFreq(ptr) LMICeu868_convFreq(ptr) 71 | 72 | void LMICeu868_initJoinLoop(void); 73 | #define LMICbandplan_initJoinLoop() LMICeu868_initJoinLoop() 74 | 75 | ostime_t LMICeu868_nextTx(ostime_t now); 76 | #define LMICbandplan_nextTx(now) LMICeu868_nextTx(now) 77 | 78 | ostime_t LMICeu868_nextJoinState(void); 79 | #define LMICbandplan_nextJoinState() LMICeu868_nextJoinState() 80 | 81 | void LMICeu868_initDefaultChannels(bit_t join); 82 | #define LMICbandplan_initDefaultChannels(join) LMICeu868_initDefaultChannels(join) 83 | 84 | #undef LMICbandplan_nextJoinTime 85 | ostime_t LMICeu868_nextJoinTime(ostime_t now); 86 | #define LMICbandplan_nextJoinTime(now) LMICeu868_nextJoinTime(now) 87 | 88 | void LMICeu868_setRx1Params(void); 89 | #define LMICbandplan_setRx1Params() LMICeu868_setRx1Params() 90 | 91 | #undef LMICbandplan_validDR 92 | bit_t LMICeu868_validDR(dr_t dr); 93 | #define LMICbandplan_validDR(dr) LMICeu868_validDR(dr) 94 | 95 | #endif // _lmic_eu868_h_ 96 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/lmic/lmic_bandplan_in866.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 IBM Corporation. 3 | * Copyright (c) 2017, 2019-2021 MCCI Corporation. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the nor the 14 | * names of its contributors may be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _lmic_bandplan_in866_h_ 30 | # define _lmic_bandplan_in866_h_ 31 | 32 | #ifndef _lmic_eu_like_h_ 33 | # include "lmic_eu_like.h" 34 | #endif 35 | 36 | // return maximum frame length (including PHY header) for this data rate (in866); 0 --> not valid dr. 37 | uint8_t LMICin866_maxFrameLen(uint8_t dr); 38 | // return maximum frame length (including PHY header) for this data rate; 0 --> not valid dr. 39 | #define LMICbandplan_maxFrameLen(dr) LMICin866_maxFrameLen(dr) 40 | 41 | int8_t LMICin866_pow2dBm(uint8_t mcmd_ladr_p1); 42 | #define pow2dBm(mcmd_ladr_p1) LMICin866_pow2dBm(mcmd_ladr_p1) 43 | 44 | // Times for half symbol per DR 45 | // Per DR table to minimize rounding errors 46 | ostime_t LMICin866_dr2hsym(uint8_t dr); 47 | #define dr2hsym(dr) LMICin866_dr2hsym(dr) 48 | 49 | static inline int 50 | LMICin866_isValidBeacon1(const uint8_t *d) { 51 | return os_rlsbf2(&d[OFF_BCN_CRC1]) != os_crc16(d, OFF_BCN_CRC1); 52 | } 53 | 54 | #undef LMICbandplan_isValidBeacon1 55 | #define LMICbandplan_isValidBeacon1(pFrame) LMICin866_isValidBeacon1(pFrame) 56 | 57 | // override default for LMICbandplan_isFSK() 58 | #undef LMICbandplan_isFSK 59 | #define LMICbandplan_isFSK() (/* TX datarate */LMIC.dndr == IN866_DR_FSK) 60 | 61 | #define LMICbandplan_getInitialDrJoin() (IN866_DR_SF7) 62 | 63 | void LMICin866_setBcnRxParams(void); 64 | #define LMICbandplan_setBcnRxParams() LMICin866_setBcnRxParams() 65 | 66 | u4_t LMICin866_convFreq(xref2cu1_t ptr); 67 | #define LMICbandplan_convFreq(ptr) LMICin866_convFreq(ptr) 68 | 69 | void LMICin866_initJoinLoop(void); 70 | #define LMICbandplan_initJoinLoop() LMICin866_initJoinLoop() 71 | 72 | ostime_t LMICin866_nextTx(ostime_t now); 73 | #define LMICbandplan_nextTx(now) LMICin866_nextTx(now) 74 | 75 | ostime_t LMICin866_nextJoinState(void); 76 | #define LMICbandplan_nextJoinState() LMICin866_nextJoinState() 77 | 78 | void LMICin866_initDefaultChannels(bit_t join); 79 | #define LMICbandplan_initDefaultChannels(join) LMICin866_initDefaultChannels(join) 80 | 81 | void LMICin866_setRx1Params(void); 82 | #define LMICbandplan_setRx1Params() LMICin866_setRx1Params() 83 | 84 | #undef LMICbandplan_validDR 85 | bit_t LMICin866_validDR(dr_t dr); 86 | #define LMICbandplan_validDR(dr) LMICin866_validDR(dr) 87 | 88 | #endif // _lmic_bandplan_in866_h_ 89 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/lmic/lmic_bandplan_kr920.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 IBM Corporation. 3 | * Copyright (c) 2017, 2019-2021 MCCI Corporation. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the nor the 14 | * names of its contributors may be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _lmic_kr920_h_ 30 | # define _lmic_kr920_h_ 31 | 32 | #ifndef _lmic_eu_like_h_ 33 | # include "lmic_eu_like.h" 34 | #endif 35 | 36 | // return maximum frame length (including PHY header) for this data rate (kr920); 0 --> not valid dr. 37 | uint8_t LMICkr920_maxFrameLen(uint8_t dr); 38 | // return maximum frame length (including PHY header) for this data rate; 0 --> not valid dr. 39 | #define LMICbandplan_maxFrameLen(dr) LMICkr920_maxFrameLen(dr) 40 | 41 | int8_t LMICkr920_pow2dBm(uint8_t mcmd_ladr_p1); 42 | #define pow2dBm(mcmd_ladr_p1) LMICkr920_pow2dBm(mcmd_ladr_p1) 43 | 44 | // Times for half symbol per DR 45 | // Per DR table to minimize rounding errors 46 | ostime_t LMICkr920_dr2hsym(uint8_t dr); 47 | #define dr2hsym(dr) LMICkr920_dr2hsym(dr) 48 | 49 | 50 | // TODO(tmm@mcci.com) this looks bogus compared to current 1.02 regional 51 | // spec. https://github.com/mcci-catena/arduino-lmic/issues/18 52 | static inline int 53 | LMICkr920_isValidBeacon1(const uint8_t *d) { 54 | return d[OFF_BCN_CRC1] != (u1_t)os_crc16(d, OFF_BCN_CRC1); 55 | } 56 | 57 | #undef LMICbandplan_isValidBeacon1 58 | #define LMICbandplan_isValidBeacon1(pFrame) LMICkr920_isValidBeacon1(pFrame) 59 | 60 | // override default for LMICbandplan_isFSK() 61 | #undef LMICbandplan_isFSK 62 | #define LMICbandplan_isFSK() (/* always false */ 0) 63 | 64 | #define LMICbandplan_getInitialDrJoin() (KR920_DR_SF7) 65 | 66 | void LMICkr920_setBcnRxParams(void); 67 | #define LMICbandplan_setBcnRxParams() LMICkr920_setBcnRxParams() 68 | 69 | u4_t LMICkr920_convFreq(xref2cu1_t ptr); 70 | #define LMICbandplan_convFreq(ptr) LMICkr920_convFreq(ptr) 71 | 72 | void LMICkr920_initJoinLoop(void); 73 | #define LMICbandplan_initJoinLoop() LMICkr920_initJoinLoop() 74 | 75 | ostime_t LMICkr920_nextTx(ostime_t now); 76 | #define LMICbandplan_nextTx(now) LMICkr920_nextTx(now) 77 | 78 | ostime_t LMICkr920_nextJoinState(void); 79 | #define LMICbandplan_nextJoinState() LMICkr920_nextJoinState() 80 | 81 | void LMICkr920_initDefaultChannels(bit_t join); 82 | #define LMICbandplan_initDefaultChannels(join) LMICkr920_initDefaultChannels(join) 83 | 84 | void LMICkr920_setRx1Params(void); 85 | #define LMICbandplan_setRx1Params() LMICkr920_setRx1Params() 86 | 87 | #undef LMICbandplan_updateTx 88 | void LMICkr920_updateTx(ostime_t txbeg); 89 | #define LMICbandplan_updateTx(t) LMICkr920_updateTx(t) 90 | 91 | #undef LMICbandplan_validDR 92 | bit_t LMICkr920_validDR(dr_t dr); 93 | #define LMICbandplan_validDR(dr) LMICkr920_validDR(dr) 94 | 95 | #endif // _lmic_kr920_h_ 96 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/lmic/lmic_bandplan_kz865.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 IBM Corporation. 3 | * Copyright (c) 2017, 2019-2021 MCCI Corporation. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the nor the 14 | * names of its contributors may be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _lmic_bandplan_kz865_h_ 30 | # define _lmic_bandplan_kz865_h_ 31 | 32 | #ifndef _lmic_eu_like_h_ 33 | # include "lmic_eu_like.h" 34 | #endif 35 | 36 | // return maximum frame length (including PHY header) for this data rate (in866); 0 --> not valid dr. 37 | uint8_t LMICkz865_maxFrameLen(uint8_t dr); 38 | // return maximum frame length (including PHY header) for this data rate; 0 --> not valid dr. 39 | #define LMICbandplan_maxFrameLen(dr) LMICkz865_maxFrameLen(dr) 40 | 41 | int8_t LMICkz865_pow2dBm(uint8_t mcmd_ladr_p1); 42 | #define pow2dBm(mcmd_ladr_p1) LMICkz865_pow2dBm(mcmd_ladr_p1) 43 | 44 | // Times for half symbol per DR 45 | // Per DR table to minimize rounding errors 46 | ostime_t LMICkz865_dr2hsym(uint8_t dr); 47 | #define dr2hsym(dr) LMICkz865_dr2hsym(dr) 48 | 49 | static inline int 50 | LMICkz865_isValidBeacon1(const uint8_t *d) { 51 | return os_rlsbf2(&d[OFF_BCN_CRC1]) != os_crc16(d, OFF_BCN_CRC1); 52 | } 53 | 54 | #undef LMICbandplan_isValidBeacon1 55 | #define LMICbandplan_isValidBeacon1(pFrame) LMICkz865_isValidBeacon1(pFrame) 56 | 57 | // override default for LMICbandplan_isFSK() 58 | #undef LMICbandplan_isFSK 59 | #define LMICbandplan_isFSK() (/* TX datarate */LMIC.dndr == KZ865_DR_FSK) 60 | 61 | #define LMICbandplan_getInitialDrJoin() (KZ865_DR_SF7) 62 | 63 | void LMICkz865_setBcnRxParams(void); 64 | #define LMICbandplan_setBcnRxParams() LMICkz865_setBcnRxParams() 65 | 66 | u4_t LMICkz865_convFreq(xref2cu1_t ptr); 67 | #define LMICbandplan_convFreq(ptr) LMICkz865_convFreq(ptr) 68 | 69 | void LMICkz865_initJoinLoop(void); 70 | #define LMICbandplan_initJoinLoop() LMICkz865_initJoinLoop() 71 | 72 | ostime_t LMICkz865_nextTx(ostime_t now); 73 | #define LMICbandplan_nextTx(now) LMICkz865_nextTx(now) 74 | 75 | ostime_t LMICkz865_nextJoinState(void); 76 | #define LMICbandplan_nextJoinState() LMICkz865_nextJoinState() 77 | 78 | void LMICkz865_initDefaultChannels(bit_t join); 79 | #define LMICbandplan_initDefaultChannels(join) LMICkz865_initDefaultChannels(join) 80 | 81 | void LMICkz865_setRx1Params(void); 82 | #define LMICbandplan_setRx1Params() LMICkz865_setRx1Params() 83 | 84 | #undef LMICbandplan_validDR 85 | bit_t LMICkz865_validDR(dr_t dr); 86 | #define LMICbandplan_validDR(dr) LMICkz865_validDR(dr) 87 | 88 | #endif // _lmic_bandplan_kz865_h_ 89 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/lmic/lmic_bandplan_ma869.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 IBM Corporation. 3 | * Copyright (c) 2017, 2019-2021 MCCI Corporation. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the nor the 14 | * names of its contributors may be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _lmic_bandplan_ma869_h_ 30 | # define _lmic_bandplan_ma869_h_ 31 | 32 | #ifndef _lmic_eu_like_h_ 33 | # include "lmic_eu_like.h" 34 | #endif 35 | 36 | // return maximum frame length (including PHY header) for this data rate (in866); 0 --> not valid dr. 37 | uint8_t LMICma869_maxFrameLen(uint8_t dr); 38 | // return maximum frame length (including PHY header) for this data rate; 0 --> not valid dr. 39 | #define LMICbandplan_maxFrameLen(dr) LMICma869_maxFrameLen(dr) 40 | 41 | int8_t LMICma869_pow2dBm(uint8_t mcmd_ladr_p1); 42 | #define pow2dBm(mcmd_ladr_p1) LMICma869_pow2dBm(mcmd_ladr_p1) 43 | 44 | // Times for half symbol per DR 45 | // Per DR table to minimize rounding errors 46 | ostime_t LMICma869_dr2hsym(uint8_t dr); 47 | #define dr2hsym(dr) LMICma869_dr2hsym(dr) 48 | 49 | static inline int 50 | LMICma869_isValidBeacon1(const uint8_t *d) { 51 | return os_rlsbf2(&d[OFF_BCN_CRC1]) != os_crc16(d, OFF_BCN_CRC1); 52 | } 53 | 54 | #undef LMICbandplan_isValidBeacon1 55 | #define LMICbandplan_isValidBeacon1(pFrame) LMICma869_isValidBeacon1(pFrame) 56 | 57 | // override default for LMICbandplan_isFSK() 58 | #undef LMICbandplan_isFSK 59 | #define LMICbandplan_isFSK() (/* TX datarate */LMIC.dndr == MA869_DR_FSK) 60 | 61 | #define LMICbandplan_getInitialDrJoin() (MA869_DR_SF7) 62 | 63 | void LMICma869_setBcnRxParams(void); 64 | #define LMICbandplan_setBcnRxParams() LMICma869_setBcnRxParams() 65 | 66 | u4_t LMICma869_convFreq(xref2cu1_t ptr); 67 | #define LMICbandplan_convFreq(ptr) LMICma869_convFreq(ptr) 68 | 69 | void LMICma869_initJoinLoop(void); 70 | #define LMICbandplan_initJoinLoop() LMICma869_initJoinLoop() 71 | 72 | ostime_t LMICma869_nextTx(ostime_t now); 73 | #define LMICbandplan_nextTx(now) LMICma869_nextTx(now) 74 | 75 | ostime_t LMICma869_nextJoinState(void); 76 | #define LMICbandplan_nextJoinState() LMICma869_nextJoinState() 77 | 78 | void LMICma869_initDefaultChannels(bit_t join); 79 | #define LMICbandplan_initDefaultChannels(join) LMICma869_initDefaultChannels(join) 80 | 81 | void LMICma869_setRx1Params(void); 82 | #define LMICbandplan_setRx1Params() LMICma869_setRx1Params() 83 | 84 | #undef LMICbandplan_validDR 85 | bit_t LMICma869_validDR(dr_t dr); 86 | #define LMICbandplan_validDR(dr) LMICma869_validDR(dr) 87 | 88 | #endif // _lmic_bandplan_ma869_h_ 89 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/lmic/lmic_bandplan_ru864.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 IBM Corporation. 3 | * Copyright (c) 2017, 2019-2021 MCCI Corporation. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the nor the 14 | * names of its contributors may be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _lmic_bandplan_ru864_h_ 30 | # define _lmic_bandplan_ru864_h_ 31 | 32 | #ifndef _lmic_eu_like_h_ 33 | # include "lmic_eu_like.h" 34 | #endif 35 | 36 | // return maximum frame length (including PHY header) for this data rate (ru864); 0 --> not valid dr. 37 | uint8_t LMICru864_maxFrameLen(uint8_t dr); 38 | // return maximum frame length (including PHY header) for this data rate; 0 --> not valid dr. 39 | #define LMICbandplan_maxFrameLen(dr) LMICru864_maxFrameLen(dr) 40 | 41 | int8_t LMICru864_pow2dBm(uint8_t mcmd_ladr_p1); 42 | #define pow2dBm(mcmd_ladr_p1) LMICru864_pow2dBm(mcmd_ladr_p1) 43 | 44 | // Times for half symbol per DR 45 | // Per DR table to minimize rounding errors 46 | ostime_t LMICru864_dr2hsym(uint8_t dr); 47 | #define dr2hsym(dr) LMICru864_dr2hsym(dr) 48 | 49 | static inline int 50 | LMICru864_isValidBeacon1(const uint8_t *d) { 51 | return os_rlsbf2(&d[OFF_BCN_CRC1]) != os_crc16(d, OFF_BCN_CRC1); 52 | } 53 | 54 | #undef LMICbandplan_isValidBeacon1 55 | #define LMICbandplan_isValidBeacon1(pFrame) LMICru864_isValidBeacon1(pFrame) 56 | 57 | // override default for LMICbandplan_isFSK() 58 | #undef LMICbandplan_isFSK 59 | #define LMICbandplan_isFSK() (/* RX datarate */LMIC.dndr == RU864_DR_FSK) 60 | 61 | #define LMICbandplan_getInitialDrJoin() (RU864_DR_SF10) 62 | 63 | void LMICru864_setBcnRxParams(void); 64 | #define LMICbandplan_setBcnRxParams() LMICru864_setBcnRxParams() 65 | 66 | u4_t LMICru864_convFreq(xref2cu1_t ptr); 67 | #define LMICbandplan_convFreq(ptr) LMICru864_convFreq(ptr) 68 | 69 | void LMICru864_initJoinLoop(void); 70 | #define LMICbandplan_initJoinLoop() LMICru864_initJoinLoop() 71 | 72 | // for as923, depending on dwell, we may need to do something else 73 | #undef LMICbandplan_setRx1Params 74 | void LMICru864_setRx1Params(void); 75 | #define LMICbandplan_setRx1Params() LMICru864_setRx1Params() 76 | 77 | ostime_t LMICru864_nextTx(ostime_t now); 78 | #define LMICbandplan_nextTx(now) LMICru864_nextTx(now) 79 | 80 | ostime_t LMICru864_nextJoinState(void); 81 | #define LMICbandplan_nextJoinState() LMICru864_nextJoinState() 82 | 83 | void LMICru864_initDefaultChannels(bit_t join); 84 | #define LMICbandplan_initDefaultChannels(join) LMICru864_initDefaultChannels(join) 85 | 86 | #undef LMICbandplan_validDR 87 | bit_t LMICru864_validDR(dr_t dr); 88 | #define LMICbandplan_validDR(dr) LMICru864_validDR(dr) 89 | 90 | #endif // _lmic_bandplan_ru864_h_ 91 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/lmic/lmic_bandplan_us915.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 IBM Corporation. 3 | * Copyright (c) 2017, 2019-2021 MCCI Corporation. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the nor the 14 | * names of its contributors may be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _lmic_bandplan_us915_h_ 30 | # define _lmic_bandplan_us915_h_ 31 | 32 | // preconditions for lmic_us_like.h 33 | #define LMICuslike_getFirst500kHzDR() (LORAWAN_DR4) 34 | #define LMICuslike_getJoin125kHzDR() (LORAWAN_DR0) 35 | 36 | #ifndef _lmic_us_like_h_ 37 | # include "lmic_us_like.h" 38 | #endif 39 | 40 | // return maximum frame length (including PHY header) for this data rate (us915); 0 --> not valid dr. 41 | uint8_t LMICus915_maxFrameLen(uint8_t dr); 42 | // return maximum frame length (including PHY header) for this data rate; 0 --> not valid dr. 43 | #define LMICbandplan_maxFrameLen(dr) LMICus915_maxFrameLen(dr) 44 | 45 | int8_t LMICus915_pow2dbm(uint8_t mcmd_ladr_p1); 46 | #define pow2dBm(mcmd_ladr_p1) LMICus915_pow2dbm(mcmd_ladr_p1) 47 | 48 | ostime_t LMICus915_dr2hsym(uint8_t dr); 49 | #define dr2hsym(dr) LMICus915_dr2hsym(dr) 50 | 51 | 52 | #define LMICbandplan_getInitialDrJoin() (LORAWAN_DR0) 53 | 54 | void LMICus915_setBcnRxParams(void); 55 | #define LMICbandplan_setBcnRxParams() LMICus915_setBcnRxParams() 56 | 57 | u4_t LMICus915_convFreq(xref2cu1_t ptr); 58 | #define LMICbandplan_convFreq(ptr) LMICus915_convFreq(ptr) 59 | 60 | void LMICus915_initJoinLoop(void); 61 | #define LMICbandplan_initJoinLoop() LMICus915_initJoinLoop() 62 | 63 | void LMICus915_setRx1Params(void); 64 | #define LMICbandplan_setRx1Params() LMICus915_setRx1Params() 65 | 66 | void LMICus915_updateTx(ostime_t txbeg); 67 | #define LMICbandplan_updateTx(txbeg) LMICus915_updateTx(txbeg) 68 | 69 | #undef LMICbandplan_validDR 70 | bit_t LMICus915_validDR(dr_t dr); 71 | #define LMICbandplan_validDR(dr) LMICus915_validDR(dr) 72 | 73 | #endif // _lmic_bandplan_us915_h_ 74 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/lmic/lmic_compat.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Module: lmic_compat.h 4 | 5 | Function: 6 | Symbols that are defined for backward compatibility 7 | 8 | Copyright notice and license info: 9 | See LICENSE file accompanying this project. 10 | 11 | Author: 12 | Terry Moore, MCCI Corporation January 2020 13 | 14 | Description: 15 | This include file centralizes backwards compatibility 16 | definitions. The idea is to centralize the decision, 17 | so it's clear as to what's deprecated. 18 | 19 | */ 20 | 21 | #ifndef _lmic_compat_h_ /* prevent multiple includes */ 22 | #define _lmic_compat_h_ 23 | 24 | #ifdef __cplusplus 25 | extern "C"{ 26 | #endif 27 | 28 | #ifndef ARDUINO_LMIC_VERSION 29 | # error "This file is normally included from lmic.h, not stand alone" 30 | #endif 31 | 32 | #define LMIC_DEPRECATE(m) _Pragma(#m) 33 | 34 | #if ! defined(LMIC_REGION_au921) && ARDUINO_LMIC_VERSION < ARDUINO_LMIC_VERSION_CALC(5,0,0,0) 35 | # define LMIC_REGION_au921 LMIC_DEPRECATE(GCC warning "LMIC_REGION_au921 is deprecated, EOL at V5, use LMIC_REGION_au915") \ 36 | LMIC_REGION_au915 37 | 38 | // Frequency plan symbols 39 | # define AU921_DR_SF12 LMIC_DEPRECATE(GCC warning "A921 symbols are deprecated EOL V5, use AU915") AU915_DR_SF12 40 | # define AU921_DR_SF11 LMIC_DEPRECATE(GCC warning "A921 symbols are deprecated EOL V5, use AU915") AU915_DR_SF11 41 | # define AU921_DR_SF10 LMIC_DEPRECATE(GCC warning "A921 symbols are deprecated EOL V5, use AU915") AU915_DR_SF10 42 | # define AU921_DR_SF9 LMIC_DEPRECATE(GCC warning "A921 symbols are deprecated EOL V5, use AU915") AU915_DR_SF9 43 | # define AU921_DR_SF8 LMIC_DEPRECATE(GCC warning "A921 symbols are deprecated EOL V5, use AU915") AU915_DR_SF8 44 | # define AU921_DR_SF7 LMIC_DEPRECATE(GCC warning "A921 symbols are deprecated EOL V5, use AU915") AU915_DR_SF7 45 | # define AU921_DR_SF8C LMIC_DEPRECATE(GCC warning "A921 symbols are deprecated EOL V5, use AU915") AU915_DR_SF8C 46 | # define AU921_DR_NONE LMIC_DEPRECATE(GCC warning "A921 symbols are deprecated EOL V5, use AU915") AU915_DR_NONE 47 | # define AU921_DR_SF12CR LMIC_DEPRECATE(GCC warning "A921 symbols are deprecated EOL V5, use AU915") AU915_DR_SF12CR 48 | # define AU921_DR_SF11CR LMIC_DEPRECATE(GCC warning "A921 symbols are deprecated EOL V5, use AU915") AU915_DR_SF11CR 49 | # define AU921_DR_SF10CR LMIC_DEPRECATE(GCC warning "A921 symbols are deprecated EOL V5, use AU915") AU915_DR_SF10CR 50 | # define AU921_DR_SF9CR LMIC_DEPRECATE(GCC warning "A921 symbols are deprecated EOL V5, use AU915") AU915_DR_SF9CR 51 | # define AU921_DR_SF8CR LMIC_DEPRECATE(GCC warning "A921 symbols are deprecated EOL V5, use AU915") AU915_DR_SF8CR 52 | # define AU921_DR_SF7CR LMIC_DEPRECATE(GCC warning "A921 symbols are deprecated EOL V5, use AU915") AU915_DR_SF7CR 53 | # define AU921_125kHz_UPFBASE LMIC_DEPRECATE(GCC warning "A921 symbols are deprecated EOL V5, use AU915") AU915_125kHz_UPFBASE 54 | # define AU921_125kHz_UPFSTEP LMIC_DEPRECATE(GCC warning "A921 symbols are deprecated EOL V5, use AU915") AU915_125kHz_UPFSTEP 55 | # define AU921_500kHz_UPFBASE LMIC_DEPRECATE(GCC warning "A921 symbols are deprecated EOL V5, use AU915") AU915_500kHz_UPFBASE 56 | # define AU921_500kHz_UPFSTEP LMIC_DEPRECATE(GCC warning "A921 symbols are deprecated EOL V5, use AU915") AU915_500kHz_UPFSTEP 57 | # define AU921_500kHz_DNFBASE LMIC_DEPRECATE(GCC warning "A921 symbols are deprecated EOL V5, use AU915") AU915_500kHz_DNFBASE 58 | # define AU921_500kHz_DNFSTEP LMIC_DEPRECATE(GCC warning "A921 symbols are deprecated EOL V5, use AU915") AU915_500kHz_DNFSTEP 59 | # define AU921_FREQ_MIN LMIC_DEPRECATE(GCC warning "A921 symbols are deprecated EOL V5, use AU915") AU915_FREQ_MIN 60 | # define AU921_FREQ_MAX LMIC_DEPRECATE(GCC warning "A921 symbols are deprecated EOL V5, use AU915") AU915_FREQ_MAX 61 | # define AU921_TX_EIRP_MAX_DBM LMIC_DEPRECATE(GCC warning "A921 symbols are deprecated EOL V5, use AU915") AU915_TX_EIRP_MAX_DBM 62 | # define AU921_INITIAL_TxParam_UplinkDwellTime LMIC_DEPRECATE(GCC warning "A921 symbols are deprecated EOL V5, use AU915") AU915_INITIAL_TxParam_UplinkDwellTime 63 | # define AU921_UPLINK_DWELL_TIME_osticks LMIC_DEPRECATE(GCC warning "A921 symbols are deprecated EOL V5, use AU915") AU915_UPLINK_DWELL_TIME_osticks 64 | # define DR_PAGE_AU921 LMIC_DEPRECATE(GCC warning "A921 symbols are deprecated EOL V5, use AU915") DR_PAGE_AU915 65 | # define AU921_LMIC_REGION_EIRP LMIC_DEPRECATE(GCC warning "A921 symbols are deprecated EOL V5, use AU915") AU915_LMIC_REGION_EIRP 66 | #endif 67 | 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | 72 | #endif /* _lmic_compat_h_ */ 73 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/lmic/lmic_util.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Module: lmic_util.h 4 | 5 | Function: 6 | Declare encoding and decoding utilities for LMIC clients. 7 | 8 | Copyright & License: 9 | See accompanying LICENSE file. 10 | 11 | Author: 12 | Terry Moore, MCCI September 2018 13 | 14 | */ 15 | 16 | #ifndef _LMIC_UTIL_H_ 17 | # define _LMIC_UTIL_H_ 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | #include 24 | 25 | uint16_t LMIC_f2sflt16(float); 26 | uint16_t LMIC_f2sflt12(float); 27 | uint16_t LMIC_f2uflt16(float); 28 | uint16_t LMIC_f2uflt12(float); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | #endif /* _LMIC_UTIL_H_ */ 35 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/lmic/lorabase_au915.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 IBM Corporation. 3 | * All rights reserved. 4 | * 5 | * Copyright (c) 2017 MCCI Corporation 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * * Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * * Neither the name of the nor the 16 | * names of its contributors may be used to endorse or promote products 17 | * derived from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 23 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef _lorabase_au915_h_ 32 | #define _lorabase_au915_h_ 33 | 34 | #ifndef _LMIC_CONFIG_PRECONDITIONS_H_ 35 | # include "lmic_config_preconditions.h" 36 | #endif 37 | 38 | /****************************************************************************\ 39 | | 40 | | Basic definitions for AU 915 (always in scope) 41 | | 42 | \****************************************************************************/ 43 | 44 | // Frequency plan for AU 915 MHz 45 | enum _dr_au915_t { 46 | AU915_DR_SF12 = 0, 47 | AU915_DR_SF11, 48 | AU915_DR_SF10, 49 | AU915_DR_SF9, 50 | AU915_DR_SF8, 51 | AU915_DR_SF7, 52 | AU915_DR_SF8C, 53 | AU915_DR_NONE, 54 | // Devices behind a router: 55 | AU915_DR_SF12CR = 8, 56 | AU915_DR_SF11CR, 57 | AU915_DR_SF10CR, 58 | AU915_DR_SF9CR, 59 | AU915_DR_SF8CR, 60 | AU915_DR_SF7CR 61 | }; 62 | 63 | // Default frequency plan for AU 915MHz 64 | enum { 65 | AU915_125kHz_UPFBASE = 915200000, 66 | AU915_125kHz_UPFSTEP = 200000, 67 | AU915_500kHz_UPFBASE = 915900000, 68 | AU915_500kHz_UPFSTEP = 1600000, 69 | AU915_500kHz_DNFBASE = 923300000, 70 | AU915_500kHz_DNFSTEP = 600000 71 | }; 72 | enum { 73 | AU915_FREQ_MIN = 915000000, 74 | AU915_FREQ_MAX = 928000000 75 | }; 76 | enum { 77 | AU915_TX_EIRP_MAX_DBM = 30 // 30 dBm 78 | }; 79 | enum { 80 | // initial value of UplinkDwellTime before TxParamSetupReq received. 81 | AU915_INITIAL_TxParam_UplinkDwellTime = 0, 82 | AU915_UPLINK_DWELL_TIME_osticks = sec2osticks(20), 83 | }; 84 | 85 | enum { DR_PAGE_AU915 = 0x10 * (LMIC_REGION_au915 - 1) }; 86 | 87 | enum { AU915_LMIC_REGION_EIRP = 1 }; // region uses EIRP 88 | 89 | #endif /* _lorabase_au915_h_ */ -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/lmic/lorabase_eu868.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 IBM Corporation. 3 | * All rights reserved. 4 | * 5 | * Copyright (c) 2017 MCCI Corporation 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * * Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * * Neither the name of the nor the 16 | * names of its contributors may be used to endorse or promote products 17 | * derived from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 23 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef _lorabase_eu868_h_ 32 | #define _lorabase_eu868_h_ 33 | 34 | #ifndef _LMIC_CONFIG_PRECONDITIONS_H_ 35 | # include "lmic_config_preconditions.h" 36 | #endif 37 | 38 | /****************************************************************************\ 39 | | 40 | | Basic definitions for EU868 (always in scope) 41 | | 42 | \****************************************************************************/ 43 | 44 | // 45 | // Default frequency plan for EU 868MHz ISM band 46 | // data rates 47 | // this is a little confusing: the integer values of these constants are the 48 | // DataRates from the LoRaWAN Regional Parmaeter spec. The names are just 49 | // convenient indications, so we can use them in the rare case that we need to 50 | // choose a DataRate by SF and configuration, not by DR code. 51 | 52 | enum _dr_eu868_t { 53 | EU868_DR_SF12 = 0, 54 | EU868_DR_SF11, 55 | EU868_DR_SF10, 56 | EU868_DR_SF9, 57 | EU868_DR_SF8, 58 | EU868_DR_SF7, 59 | EU868_DR_SF7B, 60 | EU868_DR_FSK, 61 | EU868_DR_NONE 62 | }; 63 | 64 | // Bands: 65 | // g1 : 1% 14dBm 66 | // g2 : 0.1% 14dBm 67 | // g3 : 10% 27dBm 68 | // freq band datarates 69 | enum { 70 | EU868_F1 = 868100000, // g1 SF7-12 71 | EU868_F2 = 868300000, // g1 SF7-12 FSK SF7/250 72 | EU868_F3 = 868500000, // g1 SF7-12 73 | EU868_F4 = 868850000, // g2 SF7-12 74 | EU868_F5 = 869050000, // g2 SF7-12 75 | EU868_F6 = 869525000, // g3 SF7-12 76 | EU868_J4 = 864100000, // g2 SF7-12 used during join 77 | EU868_J5 = 864300000, // g2 SF7-12 ditto 78 | EU868_J6 = 864500000, // g2 SF7-12 ditto 79 | }; 80 | enum { 81 | EU868_FREQ_MIN = 863000000, 82 | EU868_FREQ_MAX = 870000000 83 | }; 84 | enum { 85 | EU868_TX_EIRP_MAX_DBM = 16 // 16 dBm EIRP. So subtract 3 dBm for a 3 dBi antenna. 86 | }; 87 | 88 | enum { EU868_LMIC_REGION_EIRP = 1 }; // region uses EIRP 89 | 90 | enum { DR_PAGE_EU868 = 0x10 * (LMIC_REGION_eu868 - 1) }; 91 | 92 | #endif /* _lorabase_eu868_h_ */ -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/lmic/lorabase_in866.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 IBM Corporation. 3 | * All rights reserved. 4 | * 5 | * Copyright (c) 2017 MCCI Corporation 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * * Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * * Neither the name of the nor the 16 | * names of its contributors may be used to endorse or promote products 17 | * derived from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 23 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef _lorabase_in866_h_ 32 | #define _lorabase_in866_h_ 33 | 34 | #ifndef _LMIC_CONFIG_PRECONDITIONS_H_ 35 | # include "lmic_config_preconditions.h" 36 | #endif 37 | 38 | /****************************************************************************\ 39 | | 40 | | Basic definitions for IN866 (always in scope) 41 | | 42 | \****************************************************************************/ 43 | 44 | enum _dr_in866_t { 45 | IN866_DR_SF12 = 0, // DR0 46 | IN866_DR_SF11, // DR1 47 | IN866_DR_SF10, // DR2 48 | IN866_DR_SF9, // DR3 49 | IN866_DR_SF8, // DR4 50 | IN866_DR_SF7, // DR5 51 | IN866_DR_RFU, // - 52 | IN866_DR_FSK, // DR7 53 | IN866_DR_NONE 54 | }; 55 | 56 | // There is no dwell-time or duty-cycle limitation for IN 57 | // 58 | // max power: 30dBM 59 | // 60 | // freq datarates 61 | enum { 62 | IN866_F1 = 865062500, // SF7-12 (DR0-5) 63 | IN866_F2 = 865402500, // SF7-12 (DR0-5) 64 | IN866_F3 = 865985000, // SF7-12 (DR0-5) 65 | IN866_FB = 866550000, // beacon/ping 66 | }; 67 | enum { 68 | IN866_FREQ_MIN = 865000000, 69 | IN866_FREQ_MAX = 867000000 70 | }; 71 | enum { 72 | IN866_TX_EIRP_MAX_DBM = 30 // 30 dBm 73 | }; 74 | enum { DR_PAGE_IN866 = 0x10 * (LMIC_REGION_in866 - 1) }; 75 | 76 | enum { IN866_LMIC_REGION_EIRP = 1 }; // region uses EIRP 77 | 78 | #endif /* _lorabase_in866_h_ */ -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/lmic/lorabase_kr920.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 IBM Corporation. 3 | * All rights reserved. 4 | * 5 | * Copyright (c) 2017, 2019 MCCI Corporation 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * * Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * * Neither the name of the nor the 16 | * names of its contributors may be used to endorse or promote products 17 | * derived from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 23 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef _lorabase_kr920_h_ 32 | #define _lorabase_kr920_h_ 33 | 34 | #ifndef _LMIC_CONFIG_PRECONDITIONS_H_ 35 | # include "lmic_config_preconditions.h" 36 | #endif 37 | 38 | /****************************************************************************\ 39 | | 40 | | Basic definitions for KR920 (always in scope) 41 | | 42 | \****************************************************************************/ 43 | 44 | enum _dr_kr920_t { 45 | KR920_DR_SF12 = 0, // DR0 46 | KR920_DR_SF11, // DR1 47 | KR920_DR_SF10, // DR2 48 | KR920_DR_SF9, // DR3 49 | KR920_DR_SF8, // DR4 50 | KR920_DR_SF7, // DR5 51 | KR920_DR_NONE 52 | }; 53 | 54 | // There is no dwell-time or duty-cycle limitation for IN 55 | // 56 | // max power: 30dBM 57 | // 58 | // freq datarates 59 | enum { 60 | KR920_F1 = 922100000, // SF7-12 (DR0-5) 61 | KR920_F2 = 922300000, // SF7-12 (DR0-5) 62 | KR920_F3 = 922500000, // SF7-12 (DR0-5) 63 | KR920_FBCN = 923100000, // beacon/ping 64 | KR920_F14DBM = 922100000, // Allows 14 dBm (not 10) if >= this. 65 | KR920_FDOWN = 921900000, // RX2 downlink frequency 66 | }; 67 | enum { 68 | KR920_FREQ_MIN = 920900000, 69 | KR920_FREQ_MAX = 923300000 70 | }; 71 | enum { 72 | KR920_TX_EIRP_MAX_DBM = 14, // 14 dBm for most 73 | KR920_TX_EIRP_MAX_DBM_LOW = 10, // 10 dBm for some 74 | }; 75 | enum { DR_PAGE_KR920 = 0x10 * (LMIC_REGION_kr920 - 1) }; 76 | 77 | enum { KR920_LMIC_REGION_EIRP = 1 }; // region uses EIRP 78 | 79 | enum { KR920_LBT_US = 128 }; // microseconds of LBT time. 80 | 81 | enum { KR920_LBT_DB_MAX = -80 }; // maximum channel strength in dB; if TX 82 | // we measure more than this, we don't tx. 83 | 84 | #endif /* _lorabase_in866_h_ */ -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/lmic/lorabase_kz865.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 IBM Corporation. 3 | * All rights reserved. 4 | * 5 | * Copyright (c) 2017 MCCI Corporation 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * * Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * * Neither the name of the nor the 16 | * names of its contributors may be used to endorse or promote products 17 | * derived from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 23 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef _lorabase_kz865_h_ 32 | #define _lorabase_kz865_h_ 33 | 34 | #ifndef _LMIC_CONFIG_PRECONDITIONS_H_ 35 | # include "lmic_config_preconditions.h" 36 | #endif 37 | 38 | /****************************************************************************\ 39 | | 40 | | Basic definitions for IN866 (always in scope) 41 | | 42 | \****************************************************************************/ 43 | 44 | enum _dr_kz865_t { 45 | KZ865_DR_SF12 = 0, // DR0 46 | KZ865_DR_SF11, // DR1 47 | KZ865_DR_SF10, // DR2 48 | KZ865_DR_SF9, // DR3 49 | KZ865_DR_SF8, // DR4 50 | KZ865_DR_SF7, // DR5 51 | KZ865_DR_SF7B, 52 | KZ865_DR_FSK, // DR7 53 | KZ865_DR_NONE 54 | }; 55 | 56 | // There is no dwell-time or duty-cycle limitation for IN 57 | // 58 | // max power: 30dBM 59 | // 60 | // freq datarates 61 | enum { 62 | KZ865_F1 = 865100000, // SF7-12 (DR0-5) 63 | KZ865_F2 = 865300000, // SF7-12 (DR0-5) 64 | KZ865_F3 = 865500000, // SF7-12 (DR0-5) 65 | KZ865_FB = 866700000, // beacon/ping 66 | }; 67 | enum { 68 | KZ865_FREQ_MIN = 865000000, 69 | KZ865_FREQ_MAX = 868000000 70 | }; 71 | enum { 72 | KZ865_TX_EIRP_MAX_DBM = 30 // 30 dBm 73 | }; 74 | enum { DR_PAGE_KZ865 = 0x10 * (LMIC_REGION_kz865 - 1) }; 75 | 76 | enum { KZ865_LMIC_REGION_EIRP = 1 }; // region uses EIRP 77 | 78 | #endif /* _lorabase_kz865_ */ -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/lmic/lorabase_ma869.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 IBM Corporation. 3 | * All rights reserved. 4 | * 5 | * Copyright (c) 2017 MCCI Corporation 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * * Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * * Neither the name of the nor the 16 | * names of its contributors may be used to endorse or promote products 17 | * derived from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 23 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef _lorabase_ma869_h_ 32 | #define _lorabase_ma869_h_ 33 | 34 | #ifndef _LMIC_CONFIG_PRECONDITIONS_H_ 35 | # include "lmic_config_preconditions.h" 36 | #endif 37 | 38 | /****************************************************************************\ 39 | | 40 | | Basic definitions for IN866 (always in scope) 41 | | 42 | \****************************************************************************/ 43 | 44 | enum _dr_ma869_t { 45 | MA869_DR_SF12 = 0, // DR0 46 | MA869_DR_SF11, // DR1 47 | MA869_DR_SF10, // DR2 48 | MA869_DR_SF9, // DR3 49 | MA869_DR_SF8, // DR4 50 | MA869_DR_SF7, // DR5 51 | MA869_DR_SF7B, 52 | MA869_DR_FSK, // DR7 53 | MA869_DR_NONE 54 | }; 55 | 56 | // There is no dwell-time or duty-cycle limitation for IN 57 | // 58 | // max power: 30dBM 59 | // 60 | // freq datarates 61 | enum { 62 | MA869_F1 = 869100000, // SF7-12 (DR0-5) 63 | MA869_F2 = 869300000, // SF7-12 (DR0-5) 64 | MA869_F3 = 869500000, // SF7-12 (DR0-5) 65 | MA869_FB = 869525000, // beacon/ping 66 | }; 67 | enum { 68 | MA869_FREQ_MIN = 863000000, 69 | MA869_FREQ_MAX = 870000000 70 | }; 71 | enum { 72 | MA869_TX_EIRP_MAX_DBM = 16 // 16 dBm 73 | }; 74 | enum { DR_PAGE_MA869 = 0x10 * (LMIC_REGION_ma869 - 1) }; 75 | 76 | enum { MA869_LMIC_REGION_EIRP = 1 }; // region uses EIRP 77 | 78 | #endif /* _lorabase_ma869_ */ -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/lmic/lorabase_ru864.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 IBM Corporation. 3 | * All rights reserved. 4 | * 5 | * Copyright (c) 2017 MCCI Corporation 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * * Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * * Neither the name of the nor the 16 | * names of its contributors may be used to endorse or promote products 17 | * derived from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 23 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef _lorabase_ru864_h_ 32 | #define _lorabase_ru864_h_ 33 | 34 | #ifndef _LMIC_CONFIG_PRECONDITIONS_H_ 35 | # include "lmic_config_preconditions.h" 36 | #endif 37 | 38 | /****************************************************************************\ 39 | | 40 | | Basic definitions for RU864 (always in scope) 41 | | 42 | \****************************************************************************/ 43 | 44 | enum _dr_ru864_t { 45 | RU864_DR_SF12 = 0, 46 | RU864_DR_SF11, 47 | RU864_DR_SF10, 48 | RU864_DR_SF9, 49 | RU864_DR_SF8, 50 | RU864_DR_SF7, 51 | RU864_DR_SF7B, 52 | RU864_DR_FSK, 53 | RU864_DR_NONE 54 | }; 55 | 56 | // Bands: 57 | // g1 : 1% 16dBm 58 | // freq band datarates 59 | enum { 60 | 61 | RU864_F1 = 868900000, // g1 SF7-12 62 | RU864_F2 = 869100000, // g1 SF7-12 63 | RU864_FDOWN = 869100000, // (RX2 freq, DR2) 64 | RU864_FBCN = 869100000, // default BCN, DR3 65 | RU864_FPING = 868900000, // default ping, DR3 66 | 67 | }; 68 | enum { 69 | RU864_FREQ_MIN = 864000000, 70 | RU864_FREQ_MAX = 870000000 71 | }; 72 | enum { 73 | RU864_TX_EIRP_MAX_DBM = 16 // 16 dBm EIRP. So subtract 3 dBm for a 3 dBi antenna. 74 | }; 75 | 76 | enum { RU864_LMIC_REGION_EIRP = 1 }; // region uses EIRP 77 | 78 | enum { DR_PAGE_RU864 = 0x10 * (LMIC_REGION_ru864 - 1) }; 79 | 80 | #endif /* _lorabase_ru864_h_ */ 81 | -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/lmic/lorabase_us915.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 IBM Corporation. 3 | * All rights reserved. 4 | * 5 | * Copyright (c) 2017 MCCI Corporation 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * * Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * * Neither the name of the nor the 16 | * names of its contributors may be used to endorse or promote products 17 | * derived from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 23 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef _lorabase_us915_h_ 32 | #define _lorabase_us915_h_ 33 | 34 | #ifndef _LMIC_CONFIG_PRECONDITIONS_H_ 35 | # include "lmic_config_preconditions.h" 36 | #endif 37 | 38 | /****************************************************************************\ 39 | | 40 | | Basic definitions for US915 (always in scope) 41 | | 42 | \****************************************************************************/ 43 | 44 | // Frequency plan for US 915MHz ISM band 45 | // data rates 46 | enum _dr_us915_t { 47 | US915_DR_SF10 = 0, 48 | US915_DR_SF9, 49 | US915_DR_SF8, 50 | US915_DR_SF7, 51 | US915_DR_SF8C, 52 | US915_DR_NONE, 53 | // Devices "behind a router" (and upper half of DR list): 54 | US915_DR_SF12CR = 8, 55 | US915_DR_SF11CR, 56 | US915_DR_SF10CR, 57 | US915_DR_SF9CR, 58 | US915_DR_SF8CR, 59 | US915_DR_SF7CR 60 | }; 61 | 62 | // Default frequency plan for US 915MHz 63 | enum { 64 | US915_125kHz_UPFBASE = 902300000, 65 | US915_125kHz_UPFSTEP = 200000, 66 | US915_500kHz_UPFBASE = 903000000, 67 | US915_500kHz_UPFSTEP = 1600000, 68 | US915_500kHz_DNFBASE = 923300000, 69 | US915_500kHz_DNFSTEP = 600000 70 | }; 71 | enum { 72 | US915_FREQ_MIN = 902000000, 73 | US915_FREQ_MAX = 928000000 74 | }; 75 | enum { 76 | US915_TX_MAX_DBM = 30 // 30 dBm (but not EIRP): assumes we're 77 | // on an 64-channel bandplan. See code 78 | // that computes tx power. 79 | }; 80 | 81 | enum { 82 | US915_LinkAdrReq_POW_MAX_1_0_2 = 0xA, 83 | US915_LinkAdrReq_POW_MAX_1_0_3 = 0xE, 84 | }; 85 | 86 | enum { DR_PAGE_US915 = 0x10 * (LMIC_REGION_us915 - 1) }; 87 | 88 | enum { US915_LMIC_REGION_EIRP = 0 }; // region doesn't use EIRP, uses tx power 89 | 90 | #endif /* _lorabase_us915_h_ */ -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/lmic/lorawan_spec_compliance.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Module: lorawan_spec_compliance.h 4 | 5 | Function: 6 | Details from the LoRaWAN specification for compliance. 7 | 8 | Copyright notice and license info: 9 | See LICENSE file accompanying this project. 10 | 11 | Author: 12 | Terry Moore, MCCI Corporation March 2019 13 | 14 | */ 15 | 16 | #ifndef _lorawan_spec_COMPLIANCE_H_ /* prevent multiple includes */ 17 | #define _lorawan_spec_COMPLIANCE_H_ 18 | 19 | #ifdef __cplusplus 20 | extern "C"{ 21 | #endif 22 | 23 | enum { 24 | // the port for MAC commands 25 | LORAWAN_PORT_MAC = 0u, 26 | // the first port available for applications 27 | LORAWAN_PORT_USER_MIN = 1u, 28 | // the last port available for applications 29 | LORAWAN_PORT_USER_MAX = 223u, 30 | // the base of the reserved port numbers 31 | LORAWAN_PORT_RESERVED = 224u, 32 | // the port for the compliance protocol 33 | LORAWAN_PORT_COMPLIANCE = LORAWAN_PORT_RESERVED + 0u, 34 | }; 35 | 36 | enum lowawan_compliance_cmd_e { 37 | LORAWAN_COMPLIANCE_CMD_DEACTIVATE = 0u, 38 | LORAWAN_COMPLIANCE_CMD_ACTIVATE = 1u, 39 | LORAWAN_COMPLIANCE_CMD_SET_CONFIRM = 2u, 40 | LORAWAN_COMPLIANCE_CMD_SET_UNCONFIRM = 3u, 41 | LORAWAN_COMPLIANCE_CMD_ECHO = 4u, 42 | LORAWAN_COMPLIANCE_CMD_LINK = 5u, 43 | LORAWAN_COMPLIANCE_CMD_JOIN = 6u, 44 | LORAWAN_COMPLIANCE_CMD_CW = 7u, 45 | LORAWAN_COMPLIANCE_CMD_MFG_BASE = 0x80u, 46 | }; 47 | 48 | typedef unsigned char lorawan_compliance_cmd_t; 49 | 50 | // info on specific commands 51 | enum { 52 | LORAWAN_COMPLIANCE_CMD_ACTIVATE_LEN = 4u, 53 | LORAWAN_COMPLIANCE_CMD_ACTIVATE_MAGIC = 1u, 54 | 55 | // Maximum crypto frame size; although the spec says 18, it 56 | // is also used for testing max packet size. 57 | LORAWAN_COMPLIANCE_CMD_ECHO_LEN_MAX = 242u, 58 | }; 59 | 60 | #ifdef __cplusplus 61 | } // extern "C" 62 | #endif 63 | 64 | #endif /* _lorawan_spec_COMPLIANCE_H_ */ -------------------------------------------------------------------------------- /Library/arduino-lmic/arduino-lmic/src/lmic/oslmic_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Module: oslmic_types.h 4 | 5 | Function: 6 | Basic types from oslmic.h, shared by all layers. 7 | 8 | Copyright & License: 9 | See accompanying LICENSE file. 10 | 11 | Author: 12 | Terry Moore, MCCI November 2018 13 | (based on oslmic.h from IBM). 14 | 15 | */ 16 | 17 | #ifndef _oslmic_types_h_ 18 | # define _oslmic_types_h_ 19 | 20 | #include 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | //================================================================================ 27 | //================================================================================ 28 | // Target platform as C library 29 | typedef uint8_t bit_t; 30 | typedef uint8_t u1_t; 31 | typedef int8_t s1_t; 32 | typedef uint16_t u2_t; 33 | typedef int16_t s2_t; 34 | typedef uint32_t u4_t; 35 | typedef int32_t s4_t; 36 | typedef unsigned int uint; 37 | typedef const char* str_t; 38 | 39 | // the HAL needs to give us ticks, so it ought to know the right type. 40 | typedef s4_t ostime_t; 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | /* end of oslmic_types.h */ 47 | #endif /* _oslmic_types_h_ */ 48 | -------------------------------------------------------------------------------- /hardware/TrackerD v1.2.layout.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dragino/TrackerD/17da65a702d8cabf88331d2f1550f4b046dae9ce/hardware/TrackerD v1.2.layout.pdf -------------------------------------------------------------------------------- /hardware/TrackerD v1.2.sch.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dragino/TrackerD/17da65a702d8cabf88331d2f1550f4b046dae9ce/hardware/TrackerD v1.2.sch.pdf -------------------------------------------------------------------------------- /hardware/TrackerD v1.2.silkscreen.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dragino/TrackerD/17da65a702d8cabf88331d2f1550f4b046dae9ce/hardware/TrackerD v1.2.silkscreen.pdf --------------------------------------------------------------------------------