Skip to content

Commit 7bdb4ca

Browse files
committed
Upload art_pi_net_player project
1 parent 05a7023 commit 7bdb4ca

File tree

1,063 files changed

+240762
-589
lines changed

Some content is hidden

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

1,063 files changed

+240762
-589
lines changed

libraries/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@ menu "Board extended module"
1818
if ART_PI_USING_MEDIA_IO
1919
config BSP_USING_SPI_LCD_ILI9488
2020
bool
21+
config PKG_USING_PERSIMMON_SRC
22+
bool
2123

2224
config MEDIA_IO_USING_SCREEN
2325
select BSP_USING_SPI
2426
select BSP_USING_SPI2
2527
select BSP_USING_SDRAM
2628
select BSP_USING_SPI_LCD_ILI9488
29+
select PKG_USING_PERSIMMON_SRC
2730
bool "Enable Screen"
2831
default y
2932
config MEDIA_IO_USING_TOUCH

libraries/Persimmon/SConscript

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#-*- encoding: utf-8 -*-
2+
#---------------------------------------------------------------------------------
3+
# @File: Sconscript for Package
4+
# @Author: Copyright (c) 2018-2019, Shanghai Real-Thread Technology Co., Ltd
5+
#---------------------------------------------------------------------------------
6+
import os
7+
from building import *
8+
Import('RTT_ROOT')
9+
Import('rtconfig')
10+
11+
#---------------------------------------------------------------------------------
12+
# Package configuration
13+
#---------------------------------------------------------------------------------
14+
PKGNAME = "Persimmon"
15+
VERSION = "unknown"
16+
DEPENDS = ["PKG_USING_PERSIMMON_SRC"]
17+
18+
#---------------------------------------------------------------------------------
19+
# Compile the configuration
20+
#---------------------------------------------------------------------------------
21+
SOURCES = []
22+
23+
LOCAL_CPPPATH = []
24+
LOCAL_CCFLAGS = ""
25+
LOCAL_ASFLAGS = ""
26+
27+
CPPPATH = [os.path.join(GetCurrentDir(), 'inc')]
28+
29+
CCFLAGS = ""
30+
ASFLAGS = ""
31+
32+
CPPDEFINES = []
33+
LOCAL_CPPDEFINES = []
34+
35+
LIBS = ['Persimmon_3.0.0_armv7mfp_gcc']
36+
LIBPATH = [os.path.join(GetCurrentDir(), 'libs')]
37+
38+
LINKFLAGS = ""
39+
40+
#---------------------------------------------------------------------------------
41+
# Feature clip configuration, optional
42+
#---------------------------------------------------------------------------------
43+
44+
#---------------------------------------------------------------------------------
45+
# Compiler platform configuration, optional
46+
#---------------------------------------------------------------------------------
47+
48+
#---------------------------------------------------------------------------------
49+
# System variables
50+
#---------------------------------------------------------------------------------
51+
objs = []
52+
root = GetCurrentDir()
53+
54+
#---------------------------------------------------------------------------------
55+
# Sub target
56+
#---------------------------------------------------------------------------------
57+
list = os.listdir(root)
58+
if GetDepend(DEPENDS):
59+
for d in list:
60+
path = os.path.join(root, d)
61+
if os.path.isfile(os.path.join(path, 'SConscript')):
62+
objs = objs + SConscript(os.path.join(d, 'SConscript'))
63+
64+
#---------------------------------------------------------------------------------
65+
# Main target
66+
#---------------------------------------------------------------------------------
67+
objs += DefineGroup(name = PKGNAME, src = SOURCES, depend = DEPENDS,
68+
CPPPATH = CPPPATH,
69+
CCFLAGS = CCFLAGS,
70+
ASFLAGS = ASFLAGS,
71+
LOCAL_CPPPATH = LOCAL_CPPPATH,
72+
LOCAL_CCFLAGS = LOCAL_CCFLAGS,
73+
LOCAL_ASFLAGS = LOCAL_ASFLAGS,
74+
CPPDEFINES = CPPDEFINES,
75+
LOCAL_CPPDEFINES = LOCAL_CPPDEFINES,
76+
LIBS = LIBS,
77+
LIBPATH = LIBPATH,
78+
LINKFLAGS = LINKFLAGS)
79+
80+
Return("objs")
81+
#---------------------------------------------------------------------------------
82+
# End
83+
#---------------------------------------------------------------------------------
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/* Copyright JS Foundation and other contributors, http://js.foundation
2+
*
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
#ifndef _JERRYSCRIPT_MBED_DRIVERS_ANALOGIN_H
16+
#define _JERRYSCRIPT_MBED_DRIVERS_ANALOGIN_H
17+
18+
#include "jerryscript-mbed-library-registry/wrap_tools.h"
19+
20+
DECLARE_CLASS_CONSTRUCTOR(AnalogIn);
21+
22+
#endif // _JERRYSCRIPT_MBED_DRIVERS_ANALOGIN_H
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
/* Copyright JS Foundation and other contributors, http://js.foundation
2+
*
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
#ifndef _JERRYSCRIPT_MBED_EVENT_LOOP_BOUND_CALLBACK_H
16+
#define _JERRYSCRIPT_MBED_EVENT_LOOP_BOUND_CALLBACK_H
17+
18+
#include "Callback.h"
19+
20+
namespace mbed {
21+
namespace js {
22+
23+
template<typename T>
24+
class BoundCallback;
25+
26+
template<typename R, typename A0>
27+
class BoundCallback<R(A0)> {
28+
public:
29+
BoundCallback(Callback<R(A0)> cb, A0 a0) : a0(a0), cb(cb) { }
30+
31+
void call() {
32+
cb(a0);
33+
}
34+
35+
operator Callback<void()>() {
36+
Callback<void()> cb(this, &BoundCallback::call);
37+
return cb;
38+
}
39+
40+
private:
41+
A0 a0;
42+
Callback<R(A0)> cb;
43+
};
44+
45+
template<typename R, typename A0, typename A1>
46+
class BoundCallback<R(A0, A1)> {
47+
public:
48+
BoundCallback(Callback<R(A0, A1)> cb, A0 a0, A1 a1) : a0(a0), a1(a1), cb(cb) { }
49+
50+
void call() {
51+
cb(a0, a1);
52+
}
53+
54+
operator Callback<void()>() {
55+
Callback<void()> cb(this, &BoundCallback::call);
56+
return cb;
57+
}
58+
59+
private:
60+
A0 a0;
61+
A0 a1;
62+
63+
Callback<R(A0, A1)> cb;
64+
};
65+
66+
template<typename R, typename A0, typename A1, typename A2>
67+
class BoundCallback<R(A0, A1, A2)> {
68+
public:
69+
BoundCallback(Callback<R(A0, A1, A2)> cb, A0 a0, A1 a1, A2 a2) : a0(a0), a1(a1), a2(a2), cb(cb) { }
70+
71+
void call() {
72+
cb(a0, a1, a2);
73+
}
74+
75+
operator Callback<void()>() {
76+
Callback<void()> cb(this, &BoundCallback::call);
77+
return cb;
78+
}
79+
80+
private:
81+
A0 a0;
82+
A1 a1;
83+
A2 a2;
84+
85+
Callback<R(A0, A1, A2)> cb;
86+
};
87+
88+
template<typename R, typename A0, typename A1, typename A2, typename A3>
89+
class BoundCallback<R(A0, A1, A2, A3)> {
90+
public:
91+
BoundCallback(Callback<R(A0, A1, A2, A3)> cb, A0 a0, A1 a1, A2 a2, A3 a3) : a0(a0), a1(a1), a2(a2), a3(a3), cb(cb) { }
92+
93+
void call() {
94+
cb(a0, a1, a2, a3);
95+
}
96+
97+
operator Callback<void()>() {
98+
Callback<void()> cb(this, &BoundCallback::call);
99+
return cb;
100+
}
101+
102+
private:
103+
A0 a0;
104+
A1 a1;
105+
A2 a2;
106+
A3 a3;
107+
108+
Callback<R(A0, A1, A2, A3)> cb;
109+
};
110+
111+
} // namespace js
112+
} // namespace mbed
113+
114+
#endif // _JERRYSCRIPT_MBED_EVENT_LOOP_BOUND_CALLBACK_H

libraries/Persimmon/inc/DX8_API.h

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#ifndef __DX8_API_H__
2+
#define __DX8_API_H__
3+
4+
#ifdef __cplusplus
5+
extern "C"
6+
{
7+
#endif
8+
9+
#define DX8_SUCCESS 0x00
10+
#define DX8_BUS_ERR 0x01
11+
12+
#define DX8_NO_INIT 0x02
13+
#define DX8_RESET_ERR 0x03
14+
#define DX8_CHIP_INFO_ERR 0x04
15+
#define DX8_RESPONSE_LEN_ERR 0x05
16+
#define DX8_TRANSFER_CRC_ERR 0x06
17+
18+
#define DX8_STATUS_DATERR 0x07
19+
#define DX8_STATUS_RIGHTERR 0x08
20+
#define DX8_STATUS_CMDERR 0x09
21+
#define DX8_STATUS_TIMEOUT 0x0a
22+
#define DX8_SLEEP_ERR 0x0b
23+
#define DX8_WAKEUP_ERR 0x0c
24+
25+
#define DX8_VERIFY_PIN_ERR 0x0d
26+
#define DX8_VERIFY_KEY_ERR 0x0e
27+
28+
#define DX8_WRITE_ZONE_LEN_ERR 0x0f
29+
#define DX8_READ_ZONE_LEN_ERR 0x10
30+
31+
#define DX8_CRYPTO_KEY_ERR 0x11
32+
#define DX8_CRYPTO_LEN_ERR 0x12
33+
34+
#define DX8_ERASE_EEPROM_ERR 0x30
35+
#define DX8_CHECK_EEPROM_ERR 0x31
36+
37+
//-----------------------------------------------------------------------------------------------
38+
// extern function, need to be implementated by user according to CPU and OS
39+
//-----------------------------------------------------------------------------------------------
40+
extern unsigned char dxif_transfer(unsigned char *buf, unsigned short len);
41+
42+
//-----------------------------------------------------------------------------------------------
43+
// Data Structure definition
44+
//-----------------------------------------------------------------------------------------------
45+
typedef struct
46+
{
47+
unsigned char Type;
48+
unsigned char PageSize;
49+
unsigned char ZoneNum;
50+
unsigned short ZoneSize;
51+
unsigned char SN[8];
52+
unsigned char UID[7];
53+
unsigned char MID[6];
54+
unsigned char ZoneMode[16];
55+
unsigned char Fuse;
56+
} CHIP_INFO;
57+
58+
extern CHIP_INFO dx8_info; // user can access directly
59+
extern unsigned int srand_cnt; // reference can be used for host rand() function
60+
61+
//----------------------------------------------------------------------------------------------------------------
62+
// system function
63+
//----------------------------------------------------------------------------------------------------------------
64+
char *DX8_Version(void); // return DX8_API version, customID and company
65+
void DX8_SetDevAddress(unsigned char DevAddress); //default is 0x60, DX8-C2 should change to 0x20
66+
67+
unsigned char DX8_Reset(void);
68+
unsigned char DX8_Sleep(void);
69+
unsigned char DX8_Wakeup(void);
70+
unsigned char DX8_GetRandom(unsigned char *random, unsigned char len);
71+
unsigned char DX8_VerifyPin(unsigned char *seed, unsigned char *buf);
72+
73+
//----------------------------------------------------------------------------------------------------------------
74+
// host authentication
75+
//----------------------------------------------------------------------------------------------------------------
76+
unsigned char DX8_HostAuth(unsigned char *challenge, unsigned char len, unsigned char *response);
77+
void Lib_HostAuth(unsigned char *challenge, unsigned char len, unsigned char *buf, unsigned char *response);
78+
79+
//----------------------------------------------------------------------------------------------------------------
80+
// write and read memory
81+
//----------------------------------------------------------------------------------------------------------------
82+
unsigned char DX8_VerifyZone(unsigned char zone, unsigned char *seed, unsigned char *buf);
83+
unsigned char DX8_WriteZone(unsigned char zone, unsigned short address, unsigned short len, unsigned char *buf);
84+
unsigned char DX8_ReadZone(unsigned char zone, unsigned short address, unsigned short len, unsigned char *buf);
85+
86+
#ifdef __cplusplus
87+
}
88+
#endif
89+
90+
#endif
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/* Copyright JS Foundation and other contributors, http://js.foundation
2+
*
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
#ifndef _JERRYSCRIPT_MBED_DRIVERS_DIGITALOUT_H
16+
#define _JERRYSCRIPT_MBED_DRIVERS_DIGITALOUT_H
17+
18+
#include "jerryscript-mbed-library-registry/wrap_tools.h"
19+
20+
DECLARE_CLASS_CONSTRUCTOR(DigitalOut);
21+
22+
#endif // _JERRYSCRIPT_MBED_DRIVERS_DIGITALOUT_H

0 commit comments

Comments
 (0)