-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is RUIv3 SDK inside 8.0.0-p1_rc6.41 release.
- Loading branch information
1 parent
b917809
commit 1ccac19
Showing
9,930 changed files
with
15,860,661 additions
and
2 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,53 @@ | ||
# RAK-nRF52-RUI | ||
RUI V3 BSP for RAK4630/RAK4631 modules | ||
This is Arduino SDK of RUI v3, which is an unified platform designed by RAKwireless. | ||
========== | ||
|
||
Before You Start | ||
-------- | ||
|
||
- Firstly, read chapter 3 "Installation of Board Support Package in Arduino IDE" of "Getting Started Guide for RAK Unified Interface (RUI) Version 3.0 Arduino Software (IDE)" to setup your development environment. | ||
- Secondly, read CHANGELOG.md to know every added and changed features and fixed bugs of every release. | ||
- Thirdly, you can refer to the examples provided by SDK from Arduino IDE menu to build your own application. | ||
|
||
Software Layering and Architecture | ||
-------- | ||
|
||
- Basically, use MVC model to separate software components: | ||
- Separate software components that do hardware access. (M) | ||
- Separate software components that are API wrappers. (V) | ||
- Separate software components that are reusable common code. (C) | ||
- Besides, separate software components from other components if: | ||
- These software components are replaceable, that we can easily replace them in the future. | ||
- These software components are platform independent, that we can reuse them for different platforms. | ||
- These software components are from vendor or 3rd party, that we can easily upgrade them in the future. | ||
- These software components is proprietary, that we can use different release policy for it. | ||
|
||
Software Component | ||
-------- | ||
|
||
- BSP (Board Support Package) Base: This component contains two major parts: boot code and UHAL (Unified Hardware Abstraction Layer). Boot code is the low level startup code provided by MCU vendor. UHAL is responsible to adapt different MCU. All MCU dependent code is in this layer, that only includes pure hardware access, but no any complicated logic. | ||
- Board Dependent File: Contain all the board dependent source code or board dependent configuration files. | ||
- UDRV (Unified Driver): Provide hardware independent API to upper layers, so different hardware information is hidden from upper layers. All common software logic that can be shared among different hardware platform is in this layer. | ||
- Service: Multiple UDRV components could be used to construct larger software components that is called Service providing more powerful API for application to use. | ||
- RUI API: This layer is used for customers to write customized firmware. It wraps all above mentioned software layers to any higher level programming language and provide unified API across different hardwares. | ||
- AT Command: This software component provides an interactive command line interface that can be easily used to control hardware without programming any line of code. | ||
- API Command: This software component provides an efficient M2M (Machine to Machine) communication for a 3rd party firmware on a 3rd party hardware to remote control RUI firmware. | ||
|
||
Operating Mode | ||
-------- | ||
|
||
- AT Command Mode | ||
- It is designed for humans to configure devices interactively. | ||
- It can also be used for M2M communication, but transmission of big-sized human-readable text data is very inefficient. | ||
- Transparent Mode | ||
- It is designed to share LoRaWAN connectivity to another device without LoRaWAN connectivity. | ||
- It automatically passes-through any data from another connected device to LoRaWAN network, and vice versa. | ||
- In this mode, users can’t configure devices. | ||
- API Mode | ||
- It is designed for efficient M2M communication. | ||
- It uses proprietary protocol for devices to communicate with each other. | ||
- It can be used for both configuring devices and transmitting data. | ||
- Custom Mode | ||
- The above 3 modes all have their corresponding parsers to analyze every bytes received from serial port. | ||
- This mode disable all serial port parsers. | ||
- In this mode, a customized parser MUST be written by users themselves. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Copyright (c) 2014-2015 Arduino LLC. All right reserved. | ||
# Copyright (c) 2016 Sandeep Mistry All right reserved. | ||
# Copyright (c) 2017 Adafruit Industries. All right reserved. | ||
# | ||
# This library is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU Lesser General Public | ||
# License as published by the Free Software Foundation; either | ||
# version 2.1 of the License, or (at your option) any later version. | ||
# | ||
# This library is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
# See the GNU Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public | ||
# License along with this library; if not, write to the Free Software | ||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
|
||
menu.softdevice=Bootloader | ||
menu.debug=Debug | ||
|
||
# ---------------------------------- | ||
# WisBlock Core RAK4631 Board | ||
# ---------------------------------- | ||
WisCoreRAK4631Board.name=WisBlock Core RAK4631 Board | ||
WisCoreRAK4631Board.bootloader.tool=bootburn | ||
|
||
# Upload | ||
WisCoreRAK4631Board.upload.tool=uploader | ||
WisCoreRAK4631Board.upload.protocol=uploader | ||
WisCoreRAK4631Board.upload.use_1200bps_touch=true | ||
WisCoreRAK4631Board.upload.wait_for_upload_port=true | ||
WisCoreRAK4631Board.upload.maximum_size=815104 | ||
WisCoreRAK4631Board.upload.maximum_data_size=237568 | ||
|
||
# Build | ||
WisCoreRAK4631Board.build.mcu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard | ||
WisCoreRAK4631Board.build.f_cpu=64000000 | ||
WisCoreRAK4631Board.build.board=WisCore_RAK4631_Board | ||
WisCoreRAK4631Board.build.core=nRF5 | ||
WisCoreRAK4631Board.build.variant=WisCore_RAK4631_Board | ||
WisCoreRAK4631Board.build.usb_manufacturer="RAKwireless" | ||
WisCoreRAK4631Board.build.usb_product="WisCore RAK4631 Board" | ||
WisCoreRAK4631Board.build.extra_flags=-DNRF52840_XXAA {build.flags.usb} | ||
WisCoreRAK4631Board.build.ldscript=flash.ld | ||
WisCoreRAK4631Board.build.vid=0x239A | ||
WisCoreRAK4631Board.build.pid=0x8029 | ||
|
||
# SoftDevice Menu | ||
WisCoreRAK4631Board.menu.softdevice.s140v6=0.3.2 SoftDevice s140 7.2.0 | ||
WisCoreRAK4631Board.menu.softdevice.s140v6.build.sd_name=s140 | ||
WisCoreRAK4631Board.menu.softdevice.s140v6.build.sd_version=7.2.0 | ||
WisCoreRAK4631Board.menu.softdevice.s140v6.build.sd_fwid=0x0100 | ||
|
||
# Debug Menu | ||
WisCoreRAK4631Board.menu.debug.l0=Level 0 (Release) | ||
WisCoreRAK4631Board.menu.debug.l0.build.debug_flags=-DCFG_DEBUG=0 | ||
WisCoreRAK4631Board.menu.debug.l1=Level 1 (Error Message) | ||
WisCoreRAK4631Board.debug.l1.build.debug_flags=-DCFG_DEBUG=1 | ||
WisCoreRAK4631Board.menu.debug.l2=Level 2 (Full Debug) | ||
WisCoreRAK4631Board.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2 | ||
WisCoreRAK4631Board.menu.debug.l3=Level 3 (Segger SystemView) | ||
WisCoreRAK4631Board.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3 | ||
WisCoreRAK4631Board.menu.debug.l3.build.sysview_flags=-DCFG_SYSVIEW=1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
extern void setup(); | ||
extern void loop(); | ||
|
||
extern "C" void rui_setup() { | ||
setup(); | ||
} | ||
|
||
extern "C" void rui_loop() { | ||
loop(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/*! | ||
* \file adc-board.h | ||
* | ||
* \brief Target board ADC driver implementation | ||
* | ||
* \copyright Revised BSD License, see section \ref LICENSE. | ||
* | ||
* \code | ||
* ______ _ | ||
* / _____) _ | | | ||
* ( (____ _____ ____ _| |_ _____ ____| |__ | ||
* \____ \| ___ | (_ _) ___ |/ ___) _ \ | ||
* _____) ) ____| | | || |_| ____( (___| | | | | ||
* (______/|_____)_|_|_| \__)_____)\____)_| |_| | ||
* (C)2013-2017 Semtech | ||
* | ||
* \endcode | ||
* | ||
* \author Miguel Luis ( Semtech ) | ||
* | ||
* \author Gregory Cristian ( Semtech ) | ||
*/ | ||
#ifndef __ADC_BOARD_H__ | ||
#define __ADC_BOARD_H__ | ||
|
||
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif | ||
|
||
#include "adc.h" | ||
|
||
/*! | ||
* \brief Initializes the ADC object and MCU peripheral | ||
* | ||
* \param [IN] obj ADC object | ||
* \param [IN] adcInput ADC input pin | ||
*/ | ||
void AdcMcuInit( Adc_t *obj, PinNames adcInput ); | ||
|
||
/*! | ||
* \brief Initializes the ADC internal parameters | ||
*/ | ||
void AdcMcuConfig( void ); | ||
|
||
/*! | ||
* \brief Reads the value of the given channel | ||
* | ||
* \param [IN] obj ADC object | ||
* \param [IN] channel ADC input channel | ||
*/ | ||
uint16_t AdcMcuReadChannel( Adc_t *obj, uint32_t channel ); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif // __ADC_BOARD_H__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef __APP_H__ | ||
#define __APP_H__ | ||
|
||
#include <stdint.h> | ||
|
||
#ifdef __cplusplus | ||
#define EXTERNC extern "C" | ||
#else | ||
#define EXTERNC | ||
#endif | ||
|
||
EXTERNC void rui_setup(); | ||
EXTERNC void rui_loop(); | ||
EXTERNC void app_cli_handler(uint8_t ch); | ||
|
||
#undef EXTERNC | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#ifndef __AT_H__ | ||
#define __AT_H__ | ||
|
||
|
||
|
||
#define AT_BLE_MASK 0x01 | ||
#define AT_UART_MARK 0x02 | ||
#define AT_USBD_MASK 0x04 | ||
//at cmd return info, include 128 kinds | ||
|
||
//successful return ok | ||
#define RAK_OK 0x00 // 0000 0000 | ||
|
||
//error return error first and reason followed | ||
#define RAK_ERROR 0x80 // 1000 0000 | ||
#define READ_FLASH_FAIL 0x81 // 1000 0001 | ||
#define WRITE_FLASH_FAIL 0x82 // 1000 0010 | ||
|
||
#define RAK_ERROR_LORA 0x10 | ||
#define RAK_ERROR_NOT_JOIN 0x11 | ||
|
||
|
||
#define AT_HELP \ | ||
" at+version----Get the current firmware version number\n \ | ||
at+set_config=device:restart----device restart cmd\n \ | ||
at+get_config=device:status----show all components status\n \ | ||
at+set_config=device:sleep:X----device sleep command\n \ | ||
at+set_config=device:gps:X----gps on/off command\n \ | ||
at+set_config=device:cellular:X----cellular on/off command\n \ | ||
at+set_config=cellular:send_interval:X:Y----device period send task\n \ | ||
at+scan=cellular----cellular search net command\n \ | ||
at+set_config=cellular:XXX:Y:ZZZ: AAA:BBB:C----cellular config join parameters\n \ | ||
at+set_config=cellular:(XXX)----cellular AT unvarnished transmission\n \ | ||
at+send=cellular:XXX----cellular send manually\n \ | ||
at+help----show all at command supported\n \ | ||
at+set_config=hologram:----set hologram card id\n \ | ||
at+send=hologram:user:----send user define data\n \ | ||
at+send=hologram:sensor----send device data\n \ | ||
at+set_config=ble:work_mode:----ble mode choose\n \ | ||
at+set_config=uart:work_mode:x----set uart work mode \n" | ||
|
||
|
||
#ifndef AT_HELP | ||
#define AT_HELP " " | ||
#endif | ||
void usbd_send(uint8_t *pdata, uint16_t len); | ||
#endif | ||
|
Oops, something went wrong.