Skip to content

Commit 635cee4

Browse files
First release
0 parents  commit 635cee4

File tree

318 files changed

+149799
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

318 files changed

+149799
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
123

boards.txt

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
menu.LORAWAN_REGION=LORAWAN_REGION
2+
menu.LORAWAN_MODE=LORAWAN_MODE
3+
menu.LORAWAN_RGB=LORAWAN_RGB
4+
##############################################################
5+
6+
CubeCell-Board.name=CubeCell-Board
7+
8+
CubeCell-Board.upload.tool=CubeCellflash
9+
CubeCell-Board.upload.maximum_size=131072
10+
CubeCell-Board.upload.maximum_data_size=131072
11+
CubeCell-Board.upload.wait_for_upload_port=true
12+
13+
CubeCell-Board.build.board=CubeCell-Board
14+
CubeCell-Board.build.core=asr650x
15+
16+
CubeCell-Board.menu.LORAWAN_REGION.923AS=REGION_AS923
17+
CubeCell-Board.menu.LORAWAN_REGION.923AS.build.band=REGION_AS923
18+
CubeCell-Board.menu.LORAWAN_REGION.915AU=REGION_AU915
19+
CubeCell-Board.menu.LORAWAN_REGION.915AU.build.band=REGION_AU915
20+
CubeCell-Board.menu.LORAWAN_REGION.470CN=REGION_CN470
21+
CubeCell-Board.menu.LORAWAN_REGION.470CN.build.band=REGION_CN470
22+
CubeCell-Board.menu.LORAWAN_REGION.779CN=REGION_CN779
23+
CubeCell-Board.menu.LORAWAN_REGION.779CN.build.band=REGION_CN779
24+
CubeCell-Board.menu.LORAWAN_REGION.433EU=REGION_EU433
25+
CubeCell-Board.menu.LORAWAN_REGION.433EU.build.band=REGION_EU433
26+
CubeCell-Board.menu.LORAWAN_REGION.868EU=REGION_EU868
27+
CubeCell-Board.menu.LORAWAN_REGION.868EU.build.band=REGION_EU868
28+
CubeCell-Board.menu.LORAWAN_REGION.920KR=REGION_KR920
29+
CubeCell-Board.menu.LORAWAN_REGION.920KR.build.band=REGION_KR920
30+
CubeCell-Board.menu.LORAWAN_REGION.865IN=REGION_IN865
31+
CubeCell-Board.menu.LORAWAN_REGION.865IN.build.band=REGION_IN865
32+
CubeCell-Board.menu.LORAWAN_REGION.915US=REGION_US915
33+
CubeCell-Board.menu.LORAWAN_REGION.915US.build.band=REGION_US915
34+
CubeCell-Board.menu.LORAWAN_REGION.915_HYBRID=REGION_US915_HYBRID
35+
CubeCell-Board.menu.LORAWAN_REGION.915_HYBRID.build.band=REGION_US915_HYBRID
36+
CubeCell-Board.menu.LORAWAN_REGION.470ACN=REGION_CN470A
37+
CubeCell-Board.menu.LORAWAN_REGION.470ACN.build.band=REGION_CN470A
38+
39+
CubeCell-Board.menu.LORAWAN_MODE.0=CLASS_A
40+
CubeCell-Board.menu.LORAWAN_MODE.0.build.LORAWAN_MODE=CLASS_A
41+
##CubeCell-Board.menu.LORAWAN_MODE.1=CLASS_B
42+
##CubeCell-Board.menu.LORAWAN_MODE.1.build.LORAWAN_MODE=CLASS_B
43+
CubeCell-Board.menu.LORAWAN_MODE.2=CLASS_C
44+
CubeCell-Board.menu.LORAWAN_MODE.2.build.LORAWAN_MODE=CLASS_C
45+
46+
CubeCell-Board.menu.LORAWAN_RGB.1=ACTIVE
47+
CubeCell-Board.menu.LORAWAN_RGB.1.build.RGB=1
48+
CubeCell-Board.menu.LORAWAN_RGB.0=DEACTIVE
49+
CubeCell-Board.menu.LORAWAN_RGB.0.build.RGB=0
50+
##############################################################
51+
52+
CubeCell-Capsule.name=CubeCell-Capsule
53+
54+
CubeCell-Capsule.upload.tool=CubeCellflash
55+
CubeCell-Capsule.upload.maximum_size=131072
56+
CubeCell-Capsule.upload.maximum_data_size=131072
57+
CubeCell-Capsule.upload.wait_for_upload_port=true
58+
59+
CubeCell-Capsule.build.board=CubeCell-Capsule
60+
CubeCell-Capsule.build.core=asr650x
61+
62+
CubeCell-Capsule.menu.LORAWAN_REGION.923AS=REGION_AS923
63+
CubeCell-Capsule.menu.LORAWAN_REGION.923AS.build.band=REGION_AS923
64+
CubeCell-Capsule.menu.LORAWAN_REGION.915AU=REGION_AU915
65+
CubeCell-Capsule.menu.LORAWAN_REGION.915AU.build.band=REGION_AU915
66+
CubeCell-Capsule.menu.LORAWAN_REGION.470CN=REGION_CN470
67+
CubeCell-Capsule.menu.LORAWAN_REGION.470CN.build.band=REGION_CN470
68+
CubeCell-Capsule.menu.LORAWAN_REGION.779CN=REGION_CN779
69+
CubeCell-Capsule.menu.LORAWAN_REGION.779CN.build.band=REGION_CN779
70+
CubeCell-Capsule.menu.LORAWAN_REGION.433EU=REGION_EU433
71+
CubeCell-Capsule.menu.LORAWAN_REGION.433EU.build.band=REGION_EU433
72+
CubeCell-Capsule.menu.LORAWAN_REGION.868EU=REGION_EU868
73+
CubeCell-Capsule.menu.LORAWAN_REGION.868EU.build.band=REGION_EU868
74+
CubeCell-Capsule.menu.LORAWAN_REGION.920KR=REGION_KR920
75+
CubeCell-Capsule.menu.LORAWAN_REGION.920KR.build.band=REGION_KR920
76+
CubeCell-Capsule.menu.LORAWAN_REGION.865IN=REGION_IN865
77+
CubeCell-Capsule.menu.LORAWAN_REGION.865IN.build.band=REGION_IN865
78+
CubeCell-Capsule.menu.LORAWAN_REGION.915US=REGION_US915
79+
CubeCell-Capsule.menu.LORAWAN_REGION.915US.build.band=REGION_US915
80+
CubeCell-Capsule.menu.LORAWAN_REGION.915_HYBRID=REGION_US915_HYBRID
81+
CubeCell-Capsule.menu.LORAWAN_REGION.915_HYBRID.build.band=REGION_US915_HYBRID
82+
CubeCell-Capsule.menu.LORAWAN_REGION.470ACN=REGION_CN470A
83+
CubeCell-Capsule.menu.LORAWAN_REGION.470ACN.build.band=REGION_CN470A
84+
85+
CubeCell-Capsule.menu.LORAWAN_MODE.0=CLASS_A
86+
CubeCell-Capsule.menu.LORAWAN_MODE.0.build.LORAWAN_MODE=CLASS_A
87+
##CubeCell-Capsule.menu.LORAWAN_MODE.1=CLASS_B
88+
##CubeCell-Capsule.menu.LORAWAN_MODE.1.build.LORAWAN_MODE=CLASS_B
89+
CubeCell-Capsule.menu.LORAWAN_MODE.2=CLASS_C
90+
CubeCell-Capsule.menu.LORAWAN_MODE.2.build.LORAWAN_MODE=CLASS_C
91+
92+
CubeCell-Capsule.menu.LORAWAN_RGB.1=ACTIVE
93+
CubeCell-Capsule.menu.LORAWAN_RGB.1.build.RGB=1
94+
CubeCell-Capsule.menu.LORAWAN_RGB.0=DEACTIVE
95+
CubeCell-Capsule.menu.LORAWAN_RGB.0.build.RGB=0
96+
97+
##############################################################
98+
99+
CubeCell-Module.name=CubeCell-Module
100+
101+
CubeCell-Module.upload.tool=CubeCellflash
102+
CubeCell-Module.upload.maximum_size=131072
103+
CubeCell-Module.upload.maximum_data_size=131072
104+
CubeCell-Module.upload.wait_for_upload_port=true
105+
106+
CubeCell-Module.build.board=CubeCell-Module
107+
CubeCell-Module.build.core=asr650x
108+
109+
CubeCell-Module.menu.LORAWAN_REGION.923AS=REGION_AS923
110+
CubeCell-Module.menu.LORAWAN_REGION.923AS.build.band=REGION_AS923
111+
CubeCell-Module.menu.LORAWAN_REGION.915AU=REGION_AU915
112+
CubeCell-Module.menu.LORAWAN_REGION.915AU.build.band=REGION_AU915
113+
CubeCell-Module.menu.LORAWAN_REGION.470CN=REGION_CN470
114+
CubeCell-Module.menu.LORAWAN_REGION.470CN.build.band=REGION_CN470
115+
CubeCell-Module.menu.LORAWAN_REGION.779CN=REGION_CN779
116+
CubeCell-Module.menu.LORAWAN_REGION.779CN.build.band=REGION_CN779
117+
CubeCell-Module.menu.LORAWAN_REGION.433EU=REGION_EU433
118+
CubeCell-Module.menu.LORAWAN_REGION.433EU.build.band=REGION_EU433
119+
CubeCell-Module.menu.LORAWAN_REGION.868EU=REGION_EU868
120+
CubeCell-Module.menu.LORAWAN_REGION.868EU.build.band=REGION_EU868
121+
CubeCell-Module.menu.LORAWAN_REGION.920KR=REGION_KR920
122+
CubeCell-Module.menu.LORAWAN_REGION.920KR.build.band=REGION_KR920
123+
CubeCell-Module.menu.LORAWAN_REGION.865IN=REGION_IN865
124+
CubeCell-Module.menu.LORAWAN_REGION.865IN.build.band=REGION_IN865
125+
CubeCell-Module.menu.LORAWAN_REGION.915US=REGION_US915
126+
CubeCell-Module.menu.LORAWAN_REGION.915US.build.band=REGION_US915
127+
CubeCell-Module.menu.LORAWAN_REGION.915_HYBRID=REGION_US915_HYBRID
128+
CubeCell-Module.menu.LORAWAN_REGION.915_HYBRID.build.band=REGION_US915_HYBRID
129+
CubeCell-Module.menu.LORAWAN_REGION.470ACN=REGION_CN470A
130+
CubeCell-Module.menu.LORAWAN_REGION.470ACN.build.band=REGION_CN470A
131+
132+
CubeCell-Module.menu.LORAWAN_MODE.0=CLASS_A
133+
CubeCell-Module.menu.LORAWAN_MODE.0.build.LORAWAN_MODE=CLASS_A
134+
##CubeCell-Module.menu.LORAWAN_MODE.1=CLASS_B
135+
##CubeCell-Module.menu.LORAWAN_MODE.1.build.LORAWAN_MODE=CLASS_B
136+
CubeCell-Module.menu.LORAWAN_MODE.2=CLASS_C
137+
CubeCell-Module.menu.LORAWAN_MODE.2.build.LORAWAN_MODE=CLASS_C
138+
139+
CubeCell-Module.menu.LORAWAN_RGB.0=DEACTIVE
140+
CubeCell-Module.menu.LORAWAN_RGB.0.build.RGB=0

cores/asr650x/Arduino.h

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/*
2+
Arduino.h - Main include file for the Arduino SDK
3+
Copyright (c) 2014 Arduino LLC. All right reserved.
4+
5+
This library is free software; you can redistribute it and/or
6+
modify it under the terms of the GNU Lesser General Public
7+
License as published by the Free Software Foundation; either
8+
version 2.1 of the License, or (at your option) any later version.
9+
10+
This library is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
Lesser General Public License for more details.
14+
15+
You should have received a copy of the GNU Lesser General Public
16+
License along with this library; if not, write to the Free Software
17+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18+
*/
19+
20+
#ifndef Arduino_h
21+
#define Arduino_h
22+
23+
#include <stdbool.h>
24+
#include <stdint.h>
25+
#include <stdlib.h>
26+
#include <string.h>
27+
#include <math.h>
28+
#include <ASR_Arduino.h>
29+
#include <HardwareSerial.h>
30+
#include <CyLib.h>
31+
32+
33+
//extern HardwareSerial Serial;
34+
35+
#define PI 3.1415926535897932384626433832795
36+
#define HALF_PI 1.5707963267948966192313216916398
37+
#define TWO_PI 6.283185307179586476925286766559
38+
#define DEG_TO_RAD 0.017453292519943295769236907684886
39+
#define RAD_TO_DEG 57.295779513082320876798154814105
40+
#define EULER 2.718281828459045235360287471352
41+
42+
43+
#define lowByte(w) ((w) & 0xff)
44+
#define highByte(w) ((w) >> 8)
45+
#define bitRead(value, bit) (((value) >> (bit)) & 0x01)
46+
#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
47+
#define bitSet(value, bit) ((value) |= (1UL << (bit)))
48+
#define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
49+
#define bit(b) (1 << (b))
50+
51+
#define min(a, b) ((a)<(b)?(a):(b))
52+
#define max(a, b) ((a)>(b)?(a):(b))
53+
#define abs(x) ((x)>0?(x):-(x))
54+
#define constrain(amt, low, high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
55+
#define _min(a,b) ((a)<(b)?(a):(b))
56+
#define _max(a,b) ((a)>(b)?(a):(b))
57+
#define noInterrupts() CyGlobalIntDisable
58+
#define interrupts() CyGlobalIntEnable
59+
60+
61+
62+
63+
typedef bool boolean;
64+
typedef uint8_t byte;
65+
typedef uint16_t word;
66+
67+
// some libraries and sketches depend on this AVR stuff,
68+
// assuming Arduino.h or WProgram.h automatically includes it...
69+
//
70+
71+
72+
// Include Atmel headers
73+
74+
void yield( void ) ;
75+
76+
/* system functions */
77+
int main( void );
78+
void init( void );
79+
80+
/* sketch */
81+
void setup( void ) ;
82+
void loop( void ) ;
83+
84+
85+
#endif // Arduino_h

cores/asr650x/SPI/SPI.cpp

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
/*
2+
SPI.cpp - SPI library for esp8266
3+
4+
Copyright (c) 2015 Hristo Gochkov. All rights reserved.
5+
This file is part of the esp8266 core for Arduino environment.
6+
7+
This library is free software; you can redistribute it and/or
8+
modify it under the terms of the GNU Lesser General Public
9+
License as published by the Free Software Foundation; either
10+
version 2.1 of the License, or (at your option) any later version.
11+
12+
This library is distributed in the hope that it will be useful,
13+
but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+
Lesser General Public License for more details.
16+
17+
You should have received a copy of the GNU Lesser General Public
18+
License along with this library; if not, write to the Free Software
19+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20+
*/
21+
22+
#include "SPI.h"
23+
#include "project.h"
24+
25+
26+
#define spi_TIMEOUT 500
27+
28+
29+
SPIClass::SPIClass(uint8_t ss):_ss(ss),_inTransaction(false){}
30+
31+
32+
void SPIClass::begin(uint8_t ss)
33+
{
34+
_ss = ss;
35+
pinMode(_ss,OUTPUT);
36+
SPI_1_Start();
37+
}
38+
39+
void SPIClass::end()
40+
{
41+
SPI_1_Stop();
42+
}
43+
44+
45+
void SPIClass::beginTransaction(void)
46+
{
47+
_inTransaction = true;
48+
digitalWrite(_ss,LOW);
49+
}
50+
51+
void SPIClass::endTransaction()
52+
{
53+
if(_inTransaction){
54+
_inTransaction = false;
55+
// spiEndTransaction(_spi);
56+
}
57+
digitalWrite(_ss,HIGH);
58+
}
59+
60+
61+
62+
uint32_t SPIClass::transfer(uint32_t data)
63+
{
64+
uint32 rxdata;
65+
uint32 timeout = 0;
66+
67+
while(SPI_1_SpiUartGetTxBufferSize() != 0);
68+
SPI_1_SpiUartWriteTxData(data);
69+
70+
while(SPI_1_SpiUartGetRxBufferSize() == 0)
71+
{
72+
timeout++;
73+
if(timeout > spi_TIMEOUT )break;
74+
}
75+
if(timeout > spi_TIMEOUT ){}
76+
// DBG_PRINTF("Receive Data timeout!.\r\n");
77+
else
78+
{
79+
rxdata = SPI_1_SpiUartReadRxData();
80+
return rxdata;
81+
}
82+
}
83+
84+
void SPIClass::transfer(uint8_t * data, uint32_t size)
85+
{
86+
//transferBytes(data, data, size);
87+
}
88+
89+
90+
/* @param data uint8_t * data buffer. can be NULL for Read Only operation
91+
* @param out uint8_t * output buffer. can be NULL for Write Only operation
92+
* @param size uint32_t
93+
*/
94+
void SPIClass::transferBytes(uint8_t * data, uint8_t * out, uint32_t size)
95+
{
96+
97+
}
98+
99+
100+
SPIClass SPI(-1);

cores/asr650x/SPI/SPI.h

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
SPI.h - SPI library for esp8266
3+
4+
Copyright (c) 2015 Hristo Gochkov. All rights reserved.
5+
This file is part of the esp8266 core for Arduino environment.
6+
7+
This library is free software; you can redistribute it and/or
8+
modify it under the terms of the GNU Lesser General Public
9+
License as published by the Free Software Foundation; either
10+
version 2.1 of the License, or (at your option) any later version.
11+
12+
This library is distributed in the hope that it will be useful,
13+
but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+
Lesser General Public License for more details.
16+
17+
You should have received a copy of the GNU Lesser General Public
18+
License along with this library; if not, write to the Free Software
19+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20+
*/
21+
22+
23+
#include <string.h>
24+
#include <stdbool.h>
25+
#include <stdint.h>
26+
#include <stdlib.h>
27+
28+
29+
class SPIClass
30+
{
31+
private:
32+
int8_t _ss;
33+
bool _inTransaction;
34+
35+
public:
36+
SPIClass(uint8_t ss=-1);
37+
void begin(uint8_t ss=-1);
38+
void end();
39+
void beginTransaction(void);
40+
void endTransaction(void);
41+
void transfer(uint8_t * data, uint32_t size);
42+
uint32_t transfer(uint32_t data);
43+
44+
void transferBytes(uint8_t * data, uint8_t * out, uint32_t size);
45+
};
46+
typedef SPIClass SPIC;
47+
48+
extern SPIClass SPI;
49+
50+

0 commit comments

Comments
 (0)