-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 635cee4
Showing
318 changed files
with
149,799 additions
and
0 deletions.
There are no files selected for viewing
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 @@ | ||
123 |
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,140 @@ | ||
menu.LORAWAN_REGION=LORAWAN_REGION | ||
menu.LORAWAN_MODE=LORAWAN_MODE | ||
menu.LORAWAN_RGB=LORAWAN_RGB | ||
############################################################## | ||
|
||
CubeCell-Board.name=CubeCell-Board | ||
|
||
CubeCell-Board.upload.tool=CubeCellflash | ||
CubeCell-Board.upload.maximum_size=131072 | ||
CubeCell-Board.upload.maximum_data_size=131072 | ||
CubeCell-Board.upload.wait_for_upload_port=true | ||
|
||
CubeCell-Board.build.board=CubeCell-Board | ||
CubeCell-Board.build.core=asr650x | ||
|
||
CubeCell-Board.menu.LORAWAN_REGION.923AS=REGION_AS923 | ||
CubeCell-Board.menu.LORAWAN_REGION.923AS.build.band=REGION_AS923 | ||
CubeCell-Board.menu.LORAWAN_REGION.915AU=REGION_AU915 | ||
CubeCell-Board.menu.LORAWAN_REGION.915AU.build.band=REGION_AU915 | ||
CubeCell-Board.menu.LORAWAN_REGION.470CN=REGION_CN470 | ||
CubeCell-Board.menu.LORAWAN_REGION.470CN.build.band=REGION_CN470 | ||
CubeCell-Board.menu.LORAWAN_REGION.779CN=REGION_CN779 | ||
CubeCell-Board.menu.LORAWAN_REGION.779CN.build.band=REGION_CN779 | ||
CubeCell-Board.menu.LORAWAN_REGION.433EU=REGION_EU433 | ||
CubeCell-Board.menu.LORAWAN_REGION.433EU.build.band=REGION_EU433 | ||
CubeCell-Board.menu.LORAWAN_REGION.868EU=REGION_EU868 | ||
CubeCell-Board.menu.LORAWAN_REGION.868EU.build.band=REGION_EU868 | ||
CubeCell-Board.menu.LORAWAN_REGION.920KR=REGION_KR920 | ||
CubeCell-Board.menu.LORAWAN_REGION.920KR.build.band=REGION_KR920 | ||
CubeCell-Board.menu.LORAWAN_REGION.865IN=REGION_IN865 | ||
CubeCell-Board.menu.LORAWAN_REGION.865IN.build.band=REGION_IN865 | ||
CubeCell-Board.menu.LORAWAN_REGION.915US=REGION_US915 | ||
CubeCell-Board.menu.LORAWAN_REGION.915US.build.band=REGION_US915 | ||
CubeCell-Board.menu.LORAWAN_REGION.915_HYBRID=REGION_US915_HYBRID | ||
CubeCell-Board.menu.LORAWAN_REGION.915_HYBRID.build.band=REGION_US915_HYBRID | ||
CubeCell-Board.menu.LORAWAN_REGION.470ACN=REGION_CN470A | ||
CubeCell-Board.menu.LORAWAN_REGION.470ACN.build.band=REGION_CN470A | ||
|
||
CubeCell-Board.menu.LORAWAN_MODE.0=CLASS_A | ||
CubeCell-Board.menu.LORAWAN_MODE.0.build.LORAWAN_MODE=CLASS_A | ||
##CubeCell-Board.menu.LORAWAN_MODE.1=CLASS_B | ||
##CubeCell-Board.menu.LORAWAN_MODE.1.build.LORAWAN_MODE=CLASS_B | ||
CubeCell-Board.menu.LORAWAN_MODE.2=CLASS_C | ||
CubeCell-Board.menu.LORAWAN_MODE.2.build.LORAWAN_MODE=CLASS_C | ||
|
||
CubeCell-Board.menu.LORAWAN_RGB.1=ACTIVE | ||
CubeCell-Board.menu.LORAWAN_RGB.1.build.RGB=1 | ||
CubeCell-Board.menu.LORAWAN_RGB.0=DEACTIVE | ||
CubeCell-Board.menu.LORAWAN_RGB.0.build.RGB=0 | ||
############################################################## | ||
|
||
CubeCell-Capsule.name=CubeCell-Capsule | ||
|
||
CubeCell-Capsule.upload.tool=CubeCellflash | ||
CubeCell-Capsule.upload.maximum_size=131072 | ||
CubeCell-Capsule.upload.maximum_data_size=131072 | ||
CubeCell-Capsule.upload.wait_for_upload_port=true | ||
|
||
CubeCell-Capsule.build.board=CubeCell-Capsule | ||
CubeCell-Capsule.build.core=asr650x | ||
|
||
CubeCell-Capsule.menu.LORAWAN_REGION.923AS=REGION_AS923 | ||
CubeCell-Capsule.menu.LORAWAN_REGION.923AS.build.band=REGION_AS923 | ||
CubeCell-Capsule.menu.LORAWAN_REGION.915AU=REGION_AU915 | ||
CubeCell-Capsule.menu.LORAWAN_REGION.915AU.build.band=REGION_AU915 | ||
CubeCell-Capsule.menu.LORAWAN_REGION.470CN=REGION_CN470 | ||
CubeCell-Capsule.menu.LORAWAN_REGION.470CN.build.band=REGION_CN470 | ||
CubeCell-Capsule.menu.LORAWAN_REGION.779CN=REGION_CN779 | ||
CubeCell-Capsule.menu.LORAWAN_REGION.779CN.build.band=REGION_CN779 | ||
CubeCell-Capsule.menu.LORAWAN_REGION.433EU=REGION_EU433 | ||
CubeCell-Capsule.menu.LORAWAN_REGION.433EU.build.band=REGION_EU433 | ||
CubeCell-Capsule.menu.LORAWAN_REGION.868EU=REGION_EU868 | ||
CubeCell-Capsule.menu.LORAWAN_REGION.868EU.build.band=REGION_EU868 | ||
CubeCell-Capsule.menu.LORAWAN_REGION.920KR=REGION_KR920 | ||
CubeCell-Capsule.menu.LORAWAN_REGION.920KR.build.band=REGION_KR920 | ||
CubeCell-Capsule.menu.LORAWAN_REGION.865IN=REGION_IN865 | ||
CubeCell-Capsule.menu.LORAWAN_REGION.865IN.build.band=REGION_IN865 | ||
CubeCell-Capsule.menu.LORAWAN_REGION.915US=REGION_US915 | ||
CubeCell-Capsule.menu.LORAWAN_REGION.915US.build.band=REGION_US915 | ||
CubeCell-Capsule.menu.LORAWAN_REGION.915_HYBRID=REGION_US915_HYBRID | ||
CubeCell-Capsule.menu.LORAWAN_REGION.915_HYBRID.build.band=REGION_US915_HYBRID | ||
CubeCell-Capsule.menu.LORAWAN_REGION.470ACN=REGION_CN470A | ||
CubeCell-Capsule.menu.LORAWAN_REGION.470ACN.build.band=REGION_CN470A | ||
|
||
CubeCell-Capsule.menu.LORAWAN_MODE.0=CLASS_A | ||
CubeCell-Capsule.menu.LORAWAN_MODE.0.build.LORAWAN_MODE=CLASS_A | ||
##CubeCell-Capsule.menu.LORAWAN_MODE.1=CLASS_B | ||
##CubeCell-Capsule.menu.LORAWAN_MODE.1.build.LORAWAN_MODE=CLASS_B | ||
CubeCell-Capsule.menu.LORAWAN_MODE.2=CLASS_C | ||
CubeCell-Capsule.menu.LORAWAN_MODE.2.build.LORAWAN_MODE=CLASS_C | ||
|
||
CubeCell-Capsule.menu.LORAWAN_RGB.1=ACTIVE | ||
CubeCell-Capsule.menu.LORAWAN_RGB.1.build.RGB=1 | ||
CubeCell-Capsule.menu.LORAWAN_RGB.0=DEACTIVE | ||
CubeCell-Capsule.menu.LORAWAN_RGB.0.build.RGB=0 | ||
|
||
############################################################## | ||
|
||
CubeCell-Module.name=CubeCell-Module | ||
|
||
CubeCell-Module.upload.tool=CubeCellflash | ||
CubeCell-Module.upload.maximum_size=131072 | ||
CubeCell-Module.upload.maximum_data_size=131072 | ||
CubeCell-Module.upload.wait_for_upload_port=true | ||
|
||
CubeCell-Module.build.board=CubeCell-Module | ||
CubeCell-Module.build.core=asr650x | ||
|
||
CubeCell-Module.menu.LORAWAN_REGION.923AS=REGION_AS923 | ||
CubeCell-Module.menu.LORAWAN_REGION.923AS.build.band=REGION_AS923 | ||
CubeCell-Module.menu.LORAWAN_REGION.915AU=REGION_AU915 | ||
CubeCell-Module.menu.LORAWAN_REGION.915AU.build.band=REGION_AU915 | ||
CubeCell-Module.menu.LORAWAN_REGION.470CN=REGION_CN470 | ||
CubeCell-Module.menu.LORAWAN_REGION.470CN.build.band=REGION_CN470 | ||
CubeCell-Module.menu.LORAWAN_REGION.779CN=REGION_CN779 | ||
CubeCell-Module.menu.LORAWAN_REGION.779CN.build.band=REGION_CN779 | ||
CubeCell-Module.menu.LORAWAN_REGION.433EU=REGION_EU433 | ||
CubeCell-Module.menu.LORAWAN_REGION.433EU.build.band=REGION_EU433 | ||
CubeCell-Module.menu.LORAWAN_REGION.868EU=REGION_EU868 | ||
CubeCell-Module.menu.LORAWAN_REGION.868EU.build.band=REGION_EU868 | ||
CubeCell-Module.menu.LORAWAN_REGION.920KR=REGION_KR920 | ||
CubeCell-Module.menu.LORAWAN_REGION.920KR.build.band=REGION_KR920 | ||
CubeCell-Module.menu.LORAWAN_REGION.865IN=REGION_IN865 | ||
CubeCell-Module.menu.LORAWAN_REGION.865IN.build.band=REGION_IN865 | ||
CubeCell-Module.menu.LORAWAN_REGION.915US=REGION_US915 | ||
CubeCell-Module.menu.LORAWAN_REGION.915US.build.band=REGION_US915 | ||
CubeCell-Module.menu.LORAWAN_REGION.915_HYBRID=REGION_US915_HYBRID | ||
CubeCell-Module.menu.LORAWAN_REGION.915_HYBRID.build.band=REGION_US915_HYBRID | ||
CubeCell-Module.menu.LORAWAN_REGION.470ACN=REGION_CN470A | ||
CubeCell-Module.menu.LORAWAN_REGION.470ACN.build.band=REGION_CN470A | ||
|
||
CubeCell-Module.menu.LORAWAN_MODE.0=CLASS_A | ||
CubeCell-Module.menu.LORAWAN_MODE.0.build.LORAWAN_MODE=CLASS_A | ||
##CubeCell-Module.menu.LORAWAN_MODE.1=CLASS_B | ||
##CubeCell-Module.menu.LORAWAN_MODE.1.build.LORAWAN_MODE=CLASS_B | ||
CubeCell-Module.menu.LORAWAN_MODE.2=CLASS_C | ||
CubeCell-Module.menu.LORAWAN_MODE.2.build.LORAWAN_MODE=CLASS_C | ||
|
||
CubeCell-Module.menu.LORAWAN_RGB.0=DEACTIVE | ||
CubeCell-Module.menu.LORAWAN_RGB.0.build.RGB=0 |
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,85 @@ | ||
/* | ||
Arduino.h - Main include file for the Arduino SDK | ||
Copyright (c) 2014 Arduino LLC. 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 | ||
*/ | ||
|
||
#ifndef Arduino_h | ||
#define Arduino_h | ||
|
||
#include <stdbool.h> | ||
#include <stdint.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
#include <math.h> | ||
#include <ASR_Arduino.h> | ||
#include <HardwareSerial.h> | ||
#include <CyLib.h> | ||
|
||
|
||
//extern HardwareSerial Serial; | ||
|
||
#define PI 3.1415926535897932384626433832795 | ||
#define HALF_PI 1.5707963267948966192313216916398 | ||
#define TWO_PI 6.283185307179586476925286766559 | ||
#define DEG_TO_RAD 0.017453292519943295769236907684886 | ||
#define RAD_TO_DEG 57.295779513082320876798154814105 | ||
#define EULER 2.718281828459045235360287471352 | ||
|
||
|
||
#define lowByte(w) ((w) & 0xff) | ||
#define highByte(w) ((w) >> 8) | ||
#define bitRead(value, bit) (((value) >> (bit)) & 0x01) | ||
#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit)) | ||
#define bitSet(value, bit) ((value) |= (1UL << (bit))) | ||
#define bitClear(value, bit) ((value) &= ~(1UL << (bit))) | ||
#define bit(b) (1 << (b)) | ||
|
||
#define min(a, b) ((a)<(b)?(a):(b)) | ||
#define max(a, b) ((a)>(b)?(a):(b)) | ||
#define abs(x) ((x)>0?(x):-(x)) | ||
#define constrain(amt, low, high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt))) | ||
#define _min(a,b) ((a)<(b)?(a):(b)) | ||
#define _max(a,b) ((a)>(b)?(a):(b)) | ||
#define noInterrupts() CyGlobalIntDisable | ||
#define interrupts() CyGlobalIntEnable | ||
|
||
|
||
|
||
|
||
typedef bool boolean; | ||
typedef uint8_t byte; | ||
typedef uint16_t word; | ||
|
||
// some libraries and sketches depend on this AVR stuff, | ||
// assuming Arduino.h or WProgram.h automatically includes it... | ||
// | ||
|
||
|
||
// Include Atmel headers | ||
|
||
void yield( void ) ; | ||
|
||
/* system functions */ | ||
int main( void ); | ||
void init( void ); | ||
|
||
/* sketch */ | ||
void setup( void ) ; | ||
void loop( void ) ; | ||
|
||
|
||
#endif // Arduino_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,100 @@ | ||
/* | ||
SPI.cpp - SPI library for esp8266 | ||
Copyright (c) 2015 Hristo Gochkov. All rights reserved. | ||
This file is part of the esp8266 core for Arduino environment. | ||
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 | ||
*/ | ||
|
||
#include "SPI.h" | ||
#include "project.h" | ||
|
||
|
||
#define spi_TIMEOUT 500 | ||
|
||
|
||
SPIClass::SPIClass(uint8_t ss):_ss(ss),_inTransaction(false){} | ||
|
||
|
||
void SPIClass::begin(uint8_t ss) | ||
{ | ||
_ss = ss; | ||
pinMode(_ss,OUTPUT); | ||
SPI_1_Start(); | ||
} | ||
|
||
void SPIClass::end() | ||
{ | ||
SPI_1_Stop(); | ||
} | ||
|
||
|
||
void SPIClass::beginTransaction(void) | ||
{ | ||
_inTransaction = true; | ||
digitalWrite(_ss,LOW); | ||
} | ||
|
||
void SPIClass::endTransaction() | ||
{ | ||
if(_inTransaction){ | ||
_inTransaction = false; | ||
// spiEndTransaction(_spi); | ||
} | ||
digitalWrite(_ss,HIGH); | ||
} | ||
|
||
|
||
|
||
uint32_t SPIClass::transfer(uint32_t data) | ||
{ | ||
uint32 rxdata; | ||
uint32 timeout = 0; | ||
|
||
while(SPI_1_SpiUartGetTxBufferSize() != 0); | ||
SPI_1_SpiUartWriteTxData(data); | ||
|
||
while(SPI_1_SpiUartGetRxBufferSize() == 0) | ||
{ | ||
timeout++; | ||
if(timeout > spi_TIMEOUT )break; | ||
} | ||
if(timeout > spi_TIMEOUT ){} | ||
// DBG_PRINTF("Receive Data timeout!.\r\n"); | ||
else | ||
{ | ||
rxdata = SPI_1_SpiUartReadRxData(); | ||
return rxdata; | ||
} | ||
} | ||
|
||
void SPIClass::transfer(uint8_t * data, uint32_t size) | ||
{ | ||
//transferBytes(data, data, size); | ||
} | ||
|
||
|
||
/* @param data uint8_t * data buffer. can be NULL for Read Only operation | ||
* @param out uint8_t * output buffer. can be NULL for Write Only operation | ||
* @param size uint32_t | ||
*/ | ||
void SPIClass::transferBytes(uint8_t * data, uint8_t * out, uint32_t size) | ||
{ | ||
|
||
} | ||
|
||
|
||
SPIClass SPI(-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,50 @@ | ||
/* | ||
SPI.h - SPI library for esp8266 | ||
Copyright (c) 2015 Hristo Gochkov. All rights reserved. | ||
This file is part of the esp8266 core for Arduino environment. | ||
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 | ||
*/ | ||
|
||
|
||
#include <string.h> | ||
#include <stdbool.h> | ||
#include <stdint.h> | ||
#include <stdlib.h> | ||
|
||
|
||
class SPIClass | ||
{ | ||
private: | ||
int8_t _ss; | ||
bool _inTransaction; | ||
|
||
public: | ||
SPIClass(uint8_t ss=-1); | ||
void begin(uint8_t ss=-1); | ||
void end(); | ||
void beginTransaction(void); | ||
void endTransaction(void); | ||
void transfer(uint8_t * data, uint32_t size); | ||
uint32_t transfer(uint32_t data); | ||
|
||
void transferBytes(uint8_t * data, uint8_t * out, uint32_t size); | ||
}; | ||
typedef SPIClass SPIC; | ||
|
||
extern SPIClass SPI; | ||
|
||
|
Oops, something went wrong.