code
stringlengths
1
1.05M
repo_name
stringlengths
6
83
path
stringlengths
3
242
language
stringclasses
222 values
license
stringclasses
20 values
size
int64
1
1.05M
/* * Copyright (C) 2021 Alibaba Group Holding Limited */ /* Support newlib internal locks */ #ifndef _SYS_LOCK_H #define _SYS_LOCK_H #include <pthread.h> #ifdef __cplusplus extern "C" { #endif #define _LOCK_T pthread_mutex_t #define _LOCK_RECURSIVE_T pthread_mutex_t #define __LOCK_INIT(class, lock) \ class ...
YifuLiu/AliOS-Things
components/posix/include/sys/lock.h
C++
apache-2.0
1,129
/* * Copyright (C) 2021 Alibaba Group Holding Limited */ #ifndef _SYS_MMAN_H #define _SYS_MMAN_H #ifdef __cplusplus extern "C" { #endif #include <stddef.h> #include <sys/types.h> void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset); int munmap(void *addr, size_t length); #ifdef __cplu...
YifuLiu/AliOS-Things
components/posix/include/sys/mman.h
C
apache-2.0
361
/* * Copyright (C) 2018-2020 Alibaba Group Holding Limited */ #ifndef _PRCTL_H #define _PRCTL_H #ifdef __cplusplus extern "C" { #endif /* * PR_SET_NAME: Set the name of the calling thread, using the value in the * location pointed to by (char *) arg2. */ #define PR_SET_NAME 0x00000000 int prctl(in...
YifuLiu/AliOS-Things
components/posix/include/sys/prctl.h
C
apache-2.0
388
/* * Copyright (C) 2021 Alibaba Group Holding Limited */ #ifndef _SYS_SELECT_H #define _SYS_SELECT_H #ifdef __cplusplus extern "C" { #endif #include <sys/_timeval.h> #ifndef FD_SETSIZE #define FD_SETSIZE 1024 #endif typedef unsigned long fd_mask; typedef struct { unsigned long fds_bits[FD_SETSIZE / 8 / sizeo...
YifuLiu/AliOS-Things
components/posix/include/sys/select.h
C
apache-2.0
985
/* * Copyright (C) 2021 Alibaba Group Holding Limited */ #ifndef _SYS_STATFS_H #define _SYS_STATFS_H #ifdef __cplusplus extern "C" { #endif struct statfs { long f_type; /* fs type */ long f_bsize; /* optimized transport block size */ long f_blocks; /* total blocks */ long f_bfree; /* availa...
YifuLiu/AliOS-Things
components/posix/include/sys/statfs.h
C
apache-2.0
698
#include <sys/statfs.h>
YifuLiu/AliOS-Things
components/posix/include/sys/vfs.h
C
apache-2.0
24
/* * Copyright (C) 2018-2021 Alibaba Group Holding Limited */ #include <dirent.h> #include <aos/errno.h> #include <aos/kernel.h> #include "internal/common.h" DIR *opendir(const char *dirname) { if (dirname == NULL) { errno = EINVAL; return NULL; } return (DIR *)aos_opendir(dirname); } ...
YifuLiu/AliOS-Things
components/posix/src/dirent.c
C
apache-2.0
3,183
/* * Copyright (C) 2015-2021 Alibaba Group Holding Limited */ #include <unistd.h> #include <pthread.h> #include <enviro.h> #include <aos/kernel.h> /* Define POSIX_ENV as 1 to enable env apis here when there is no env apis in libc. * Note: Newlib libc already implements env apis, tzset depends on them. */ #if (POS...
YifuLiu/AliOS-Things
components/posix/src/enviro.c
C
apache-2.0
11,148
/* * Copyright (C) 2015-2022 Alibaba Group Holding Limited */ #include <stddef.h> #include <unistd.h> #include <fcntl.h> #include <sys/stat.h> #include <sys/statfs.h> #include <utime.h> #include <aos/vfs.h> #include "internal/common.h" int statfs(const char *path, struct statfs *buf) { int ret; struct aos_...
YifuLiu/AliOS-Things
components/posix/src/fs.c
C
apache-2.0
3,154
/* * Copyright (C) 2015-2021 Alibaba Group Holding Limited */ #ifndef __POSIX_INTERNAL_COMMON_H #define __POSIX_INTERNAL_COMMON_H #include <aos/errno.h> #define CHECK_AOS_RET(ret) do {if ((ret) < 0) {errno = -(ret); return -1; } } while (0) #define CHECK_POSIX_PARAM(param) do {if ((param) == NULL) {errno = EINVAL;...
YifuLiu/AliOS-Things
components/posix/src/internal/common.h
C
apache-2.0
383
/* * Copyright (C) 2015-2021 Alibaba Group Holding Limited */ #ifndef __POSIX_INTERNAL_PTHREAD_H #define __POSIX_INTERNAL_PTHREAD_H #include <pthread.h> #include <aos/kernel.h> #define PTHREAD_DEFAULT_STACK_SIZE 2048 #define PTHREAD_DEFAULT_GUARD_SIZE 256 #define PTHREAD_DEFAULT_PRIORITY 30 #define PTHREAD_DEFAU...
YifuLiu/AliOS-Things
components/posix/src/internal/pthread.h
C
apache-2.0
1,860
/* * Copyright (C) 2020-2021 Alibaba Group Holding Limited */ #ifndef __POSIX_INTERNAL_SCHED_H #define __POSIX_INTERNAL_SCHED_H #include <sched.h> #include <pthread.h> #include <k_api.h> /* Convert the schedule policy of posix to rhino. */ static inline int sched_policy_posix2rhino(int policy) { switch (policy...
YifuLiu/AliOS-Things
components/posix/src/internal/sched.h
C
apache-2.0
1,245
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ /* TODO: replace krhino apis with aos apis. */ #include <mqueue.h> #include <k_api.h> mqd_t mq_open(const char *name, int oflag, ...) { kbuf_queue_t *mq; kstat_t ret; ret = krhino_buf_queue_dyn_create(&mq, "buf_queue", DEFAULT_MQUEUE_...
YifuLiu/AliOS-Things
components/posix/src/mqueue.c
C
apache-2.0
2,091
/* * Copyright (C) 2021 Alibaba Group Holding Limited */ #include <poll.h> extern int aos_poll(struct pollfd *fds, int nfds, int timeout); int poll(struct pollfd fds[], nfds_t nfds, int timeout) { return aos_poll(fds, nfds, timeout); }
YifuLiu/AliOS-Things
components/posix/src/poll.c
C
apache-2.0
244
/* * Copyright (C) 2018-2021 Alibaba Group Holding Limited */ #include <stdarg.h> #include <sys/prctl.h> #include <aos/errno.h> #include <pthread.h> int prctl(int option, ...) { va_list ap; unsigned long arg; if (option == PR_SET_NAME) { va_start(ap, option); arg = va_arg(ap, unsigned l...
YifuLiu/AliOS-Things
components/posix/src/prctl.c
C
apache-2.0
573
/* * Copyright (C) 2015-2021 Alibaba Group Holding Limited */ #include <string.h> #include <stdint.h> #include <stdlib.h> #include <time.h> #include <sched.h> #include <aos/errno.h> #include <aos/kernel.h> #include <aos/rhino.h> #include "internal/pthread.h" #include "internal/sched.h" pthread_mutex_t g_pthread_lo...
YifuLiu/AliOS-Things
components/posix/src/pthread.c
C
apache-2.0
13,478
/* * Copyright (C) 2015-2021 Alibaba Group Holding Limited */ #include <errno.h> #include <string.h> #include <pthread.h> #include <sched.h> #include "internal/pthread.h" int pthread_attr_init(pthread_attr_t *attr) { if (attr == NULL) { return EINVAL; } memset(attr, 0, sizeof(pthread_attr_t));...
YifuLiu/AliOS-Things
components/posix/src/pthread_attr.c
C
apache-2.0
5,295
/* * Copyright (C) 2015-2021 Alibaba Group Holding Limited */ #include <stdint.h> #include <string.h> #include <errno.h> #include <time.h> #include <pthread.h> #include <aos/kernel.h> #include "internal/pthread.h" int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr) { int ret = 0; i...
YifuLiu/AliOS-Things
components/posix/src/pthread_cond.c
C
apache-2.0
7,823
/* * Copyright (C) 2015-2021 Alibaba Group Holding Limited */ #include <errno.h> #include <pthread.h> #include <sched.h> #include <aos/kernel.h> #include "internal/pthread.h" #define PTHREAD_MUTEXATTR_IS_INITED(x) do { if ((x)->flag != PTHREAD_DYN_INIT) return EINVAL; } \ wh...
YifuLiu/AliOS-Things
components/posix/src/pthread_mutex.c
C
apache-2.0
6,933
/* * Copyright (C) 2015-2021 Alibaba Group Holding Limited */ #include <stdlib.h> #include <string.h> #include <aos/errno.h> #include "internal/pthread.h" typedef struct key_value { pthread_t thread; const uint32_t *value; } key_value_t; typedef struct pthread_key_value { key_value_t key_value; ...
YifuLiu/AliOS-Things
components/posix/src/pthread_tsd.c
C
apache-2.0
11,401
/* * Copyright (C) 2020-2021 Alibaba Group Holding Limited */ #include <stdint.h> #include <errno.h> #include <time.h> #include <pthread.h> #include <sched.h> #include <aos/kernel.h> #include <aos/rhino.h> #include "internal/pthread.h" #include "internal/sched.h" /* Note: pid is directly converted into pthread han...
YifuLiu/AliOS-Things
components/posix/src/sched.c
C
apache-2.0
5,894
/* * Copyright (C) 2021 Alibaba Group Holding Limited */ #include <sys/select.h> extern int aos_select(int maxfd, fd_set *readset, fd_set *writeset, fd_set *exceptset, struct timeval *timeout); int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct...
YifuLiu/AliOS-Things
components/posix/src/select.c
C
apache-2.0
410
/* * Copyright (C) 2020-2021 Alibaba Group Holding Limited */ #include <string.h> #include <stdlib.h> #include <stdint.h> #include <time.h> #include <semaphore.h> #include <aos/kernel.h> #include <aos/errno.h> #define SEM_NAME_MAX 1024 /* Initialize an unnamed semaphore */ int sem_init(sem_t *sem, int pshared, uns...
YifuLiu/AliOS-Things
components/posix/src/semaphore.c
C
apache-2.0
3,938
/* * Copyright (C) 2015-2021 Alibaba Group Holding Limited */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <pthread.h> #include <aos/kernel.h> #define TEMP_PATH_MAX 64 #define TEMP_FILE_PREFIX "/data/tmp" pthread_mutex_t g_tmpnam_lock = PTHREAD_MUTEX_INITIALIZER; char *tmp...
YifuLiu/AliOS-Things
components/posix/src/temp.c
C
apache-2.0
1,273
/* * Copyright (C) 2015-2021 Alibaba Group Holding Limited */ #include <stdint.h> #include <time.h> #include <aos/errno.h> #include <aos/kernel.h> int clock_getres(clockid_t clock_id, struct timespec *res) { /* At now, only support CLOCK_REALTIME/CLOCK_MONOTONIC clock. */ if (((clock_id != CLOCK_REALTIME) ...
YifuLiu/AliOS-Things
components/posix/src/time.c
C
apache-2.0
3,400
/* * Copyright (C) 2015-2021 Alibaba Group Holding Limited */ #include <stdint.h> #include <stdlib.h> #include <string.h> #include <signal.h> #include <time.h> #include <pthread.h> #include <aos/errno.h> #include <aos/kernel.h> #define POSIX_TIMER_ID_MIN 1 typedef struct timer_list_s { timer_t id; aos_ti...
YifuLiu/AliOS-Things
components/posix/src/timer.c
C
apache-2.0
8,454
# Top-level cmake file for building MicroPython on ESP32. cmake_minimum_required(VERSION 3.12) # Set the location of this port's directory. set(MICROPY_PORT_DIR ${CMAKE_SOURCE_DIR}) # Set location of base MicroPython directory. if(NOT MICROPY_DIR) get_filename_component(MICROPY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/.....
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/CMakeLists.txt
CMake
apache-2.0
3,068
# Makefile for MicroPython on ESP32. # # This is a simple, convenience wrapper around idf.py (which uses cmake). # Select the board to build for, defaulting to GENERIC. BOARD ?= GENERIC # If the build directory is not given, make it reflect the board name. BUILD ?= build-$(BOARD) # Device serial settings. PORT ?= /d...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/Makefile
Makefile
apache-2.0
1,542
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #ifndef __AMP_MACHINE_CONFIG_H__ #define __AMP_MACHINE_CONFIG_H__ /* python engine root dir define */ #define MP_PY_PATH "main.py" #define MP_FS_IDF_DIR "/" #define MP_FS_ROOT_DIR "/data" #define MP_FS_EXT_ROOT_DIR "/sdcard" #define AMP_FS_ROOT_DI...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/board_config.h
C
apache-2.0
686
set(IDF_TARGET esp32) set(SDKCONFIG_DEFAULTS boards/sdkconfig.base boards/sdkconfig.ble boards/GENERIC/sdkconfig.board ) if(NOT MICROPY_FROZEN_MANIFEST) set(MICROPY_FROZEN_MANIFEST ${MICROPY_PORT_DIR}/boards/manifest.py) endif()
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/GENERIC/mpconfigboard.cmake
CMake
apache-2.0
247
#define MICROPY_HW_BOARD_NAME "ESP32 module" #define MICROPY_HW_MCU_NAME "ESP32" #define MICROPY_SW_VENDOR_NAME "HaaSPython"
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/GENERIC/mpconfigboard.h
C
apache-2.0
125
set(IDF_TARGET esp32c3) set(SDKCONFIG_DEFAULTS boards/sdkconfig.base boards/sdkconfig.ble boards/GENERIC_C3/sdkconfig.board ) if(NOT MICROPY_FROZEN_MANIFEST) set(MICROPY_FROZEN_MANIFEST ${MICROPY_PORT_DIR}/boards/manifest.py) endif()
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/GENERIC_C3/mpconfigboard.cmake
CMake
apache-2.0
252
// This configuration is for a generic ESP32C3 board with 4MiB (or more) of flash. #define MICROPY_HW_BOARD_NAME "ESP32C3 module" #define MICROPY_HW_MCU_NAME "ESP32C3" #define MICROPY_SW_VENDOR_NAME "HaaSPython" #define MICROPY_HW_ENABLE_SDCARD (0) #define MICROPY...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/GENERIC_C3/mpconfigboard.h
C
apache-2.0
401
set(IDF_TARGET esp32c3) set(SDKCONFIG_DEFAULTS boards/sdkconfig.base boards/sdkconfig.ble boards/GENERIC_C3_USB/sdkconfig.board ) if(NOT MICROPY_FROZEN_MANIFEST) set(MICROPY_FROZEN_MANIFEST ${MICROPY_PORT_DIR}/boards/manifest.py) endif()
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/GENERIC_C3_USB/mpconfigboard.cmake
CMake
apache-2.0
256
// This configuration is for a generic ESP32C3 board with 4MiB (or more) of flash. #define MICROPY_HW_BOARD_NAME "ESP32C3_USB module" #define MICROPY_HW_MCU_NAME "ESP32-C3" #define MICROPY_SW_VENDOR_NAME "HaaSPython" #define MICROPY_HW_ENABLE_SDCARD (0) #define MI...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/GENERIC_C3_USB/mpconfigboard.h
C
apache-2.0
406
set(SDKCONFIG_DEFAULTS boards/sdkconfig.base boards/sdkconfig.ble boards/GENERIC_D2WD/sdkconfig.board ) if(NOT MICROPY_FROZEN_MANIFEST) set(MICROPY_FROZEN_MANIFEST ${MICROPY_PORT_DIR}/boards/manifest.py) endif()
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/GENERIC_D2WD/mpconfigboard.cmake
CMake
apache-2.0
229
#define MICROPY_HW_BOARD_NAME "Generic ESP32-D2WD module" #define MICROPY_HW_MCU_NAME "ESP32-D2WD"
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/GENERIC_D2WD/mpconfigboard.h
C
apache-2.0
99
set(SDKCONFIG_DEFAULTS boards/sdkconfig.base boards/sdkconfig.ble boards/GENERIC_OTA/sdkconfig.board ) if(NOT MICROPY_FROZEN_MANIFEST) set(MICROPY_FROZEN_MANIFEST ${MICROPY_PORT_DIR}/boards/manifest.py) endif()
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/GENERIC_OTA/mpconfigboard.cmake
CMake
apache-2.0
228
#define MICROPY_HW_BOARD_NAME "4MB/OTA module" #define MICROPY_HW_MCU_NAME "ESP32"
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/GENERIC_OTA/mpconfigboard.h
C
apache-2.0
83
set(IDF_TARGET esp32s2) set(SDKCONFIG_DEFAULTS boards/sdkconfig.base boards/sdkconfig.usb ) if(NOT MICROPY_FROZEN_MANIFEST) set(MICROPY_FROZEN_MANIFEST ${MICROPY_PORT_DIR}/boards/manifest.py) endif()
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/GENERIC_S2/mpconfigboard.cmake
CMake
apache-2.0
214
#define MICROPY_HW_BOARD_NAME "ESP32S2 module" #define MICROPY_HW_MCU_NAME "ESP32S2" #define MICROPY_PY_BLUETOOTH (0) #define MICROPY_HW_ENABLE_SDCARD (0)
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/GENERIC_S2/mpconfigboard.h
C
apache-2.0
212
set(IDF_TARGET esp32s3) set(SDKCONFIG_DEFAULTS boards/sdkconfig.base boards/sdkconfig.ble boards/GENERIC_S3/sdkconfig.board ) if(NOT MICROPY_FROZEN_MANIFEST) set(MICROPY_FROZEN_MANIFEST ${MICROPY_PORT_DIR}/boards/manifest.py) endif()
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/GENERIC_S3/mpconfigboard.cmake
CMake
apache-2.0
252
#define MICROPY_HW_BOARD_NAME "ESP32S3 module" #define MICROPY_HW_MCU_NAME "ESP32-S3" #define MICROPY_SW_VENDOR_NAME "HaaSPython" #define MICROPY_PY_MACHINE_DAC (0) #define MICROPY_HW_I2C0_SCL (9) #define MICROPY_HW_I2C0_SDA (8)
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/GENERIC_S3/mpconfigboard.h
C
apache-2.0
241
set(SDKCONFIG_DEFAULTS boards/sdkconfig.base boards/sdkconfig.ble boards/sdkconfig.spiram ) if(NOT MICROPY_FROZEN_MANIFEST) set(MICROPY_FROZEN_MANIFEST ${MICROPY_PORT_DIR}/boards/manifest.py) endif()
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/GENERIC_SPIRAM/mpconfigboard.cmake
CMake
apache-2.0
217
#define MICROPY_HW_BOARD_NAME "ESP32 module (spiram)" #define MICROPY_HW_MCU_NAME "ESP32"
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/GENERIC_SPIRAM/mpconfigboard.h
C
apache-2.0
90
include("$(PORT_DIR)/boards/manifest.py") freeze("modules")
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/M5STACK_ATOM/manifest.py
Python
apache-2.0
60
# M5Stack ATOM MicroPython Helper Library # MIT license; Copyright (c) 2021 IAMLIUBO work for M5STACK # # Hardware details: # ATOM Lite https://docs.m5stack.com/en/core/atom_lite # ATOM Matrix https://docs.m5stack.com/en/core/atom_matrix from micropython import const from machine import Pin import neop...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/M5STACK_ATOM/modules/atom.py
Python
apache-2.0
1,652
set(SDKCONFIG_DEFAULTS boards/sdkconfig.base boards/sdkconfig.ble boards/sdkconfig.240mhz boards/M5STACK_ATOM/sdkconfig.board ) if(NOT MICROPY_FROZEN_MANIFEST) set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py) endif()
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/M5STACK_ATOM/mpconfigboard.cmake
CMake
apache-2.0
251
#define MICROPY_HW_BOARD_NAME "M5Stack ATOM" #define MICROPY_HW_MCU_NAME "ESP32-PICO-D4"
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/M5STACK_ATOM/mpconfigboard.h
C
apache-2.0
89
set(IDF_TARGET esp32) set(SDKCONFIG_DEFAULTS boards/sdkconfig.base boards/sdkconfig.ble boards/sdkconfig.spiram boards/sdkconfig.240mhz boards/M5STACK_CORE2/sdkconfig.board boards/M5STACK_CORE2/sdkconfig.lvgl ) if(NOT MICROPY_FROZEN_MANIFEST) set(MICROPY_FROZEN_MANIFEST ${MICROPY_PORT_DIR}/...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/M5STACK_CORE2/mpconfigboard.cmake
CMake
apache-2.0
348
#define MICROPY_HW_BOARD_NAME "ESP32 module (spiram)" #define MICROPY_HW_MCU_NAME "ESP32" #define MICROPY_HW_BOARD_TYPE "8M" #define MICROPY_SW_VENDOR_NAME "HaaSPython"
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/M5STACK_CORE2/mpconfigboard.h
C
apache-2.0
169
set(SDKCONFIG_DEFAULTS boards/sdkconfig.base boards/sdkconfig.ble boards/sdkconfig.240mhz boards/SIL_WESP32/sdkconfig.board ) if(NOT MICROPY_FROZEN_MANIFEST) set(MICROPY_FROZEN_MANIFEST ${MICROPY_PORT_DIR}/boards/manifest.py) endif()
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/SIL_WESP32/mpconfigboard.cmake
CMake
apache-2.0
255
#define MICROPY_HW_BOARD_NAME "Silicognition wESP32" #define MICROPY_HW_MCU_NAME "ESP32"
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/SIL_WESP32/mpconfigboard.h
C
apache-2.0
89
include("$(PORT_DIR)/boards/manifest.py") freeze("$(PORT_DIR)/boards/UM_TINYPICO/modules", "dotstar.py") freeze("modules")
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/UM_FEATHERS2/manifest.py
Python
apache-2.0
123
# FeatherS2 MicroPython Helper Library # 2021 Seon Rozenblum - Unexpected Maker # # Project home: # https://feathers2.io # # 2021-Mar-21 - v0.1 - Initial implementation # Import required libraries from micropython import const from machine import Pin, SPI, ADC import machine, time # FeatherS2 Hardware Pin Assignmen...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/UM_FEATHERS2/modules/feathers2.py
Python
apache-2.0
2,619
set(IDF_TARGET esp32s2) set(SDKCONFIG_DEFAULTS boards/sdkconfig.base boards/sdkconfig.spiram_sx boards/sdkconfig.usb boards/UM_FEATHERS2/sdkconfig.board ) set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py)
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/UM_FEATHERS2/mpconfigboard.cmake
CMake
apache-2.0
233
#define MICROPY_HW_BOARD_NAME "FeatherS2" #define MICROPY_HW_MCU_NAME "ESP32-S2" #define MICROPY_PY_BLUETOOTH (0) #define MICROPY_HW_ENABLE_SDCARD (0) #define MICROPY_HW_I2C0_SCL (9) #define MICROPY_HW_I2C0_SDA (8) #define MICROPY_HW_SPI1_MOSI (35) // SDO #define MICROPY_HW_SPI1_MISO (37) ...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/UM_FEATHERS2/mpconfigboard.h
C
apache-2.0
361
include("$(PORT_DIR)/boards/manifest.py") freeze("modules")
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/UM_TINYPICO/manifest.py
Python
apache-2.0
60
# DotStar strip driver for MicroPython # # The MIT License (MIT) # # Copyright (c) 2016 Damien P. George (original Neopixel object) # Copyright (c) 2017 Ladyada # Copyright (c) 2017 Scott Shawcroft for Adafruit Industries # Copyright (c) 2019 Matt Trentini (porting back to MicroPython) # # Permission is hereby granted,...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/UM_TINYPICO/modules/dotstar.py
Python
apache-2.0
8,673
# TinyPICO MicroPython Helper Library # 2019 Seon Rozenblum, Matt Trentini # # Project home: # https://github.com/TinyPICO # # 2019-Mar-12 - v0.1 - Initial implementation # 2019-May-20 - v1.0 - Initial Release # 2019-Oct-23 - v1.1 - Removed temp sensor code, prep for frozen modules # Import required libraries from m...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/UM_TINYPICO/modules/tinypico.py
Python
apache-2.0
4,322
set(SDKCONFIG_DEFAULTS boards/sdkconfig.base boards/sdkconfig.ble boards/sdkconfig.240mhz boards/sdkconfig.spiram boards/UM_TINYPICO/sdkconfig.board ) if(NOT MICROPY_FROZEN_MANIFEST) set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py) endif()
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/UM_TINYPICO/mpconfigboard.cmake
CMake
apache-2.0
278
#define MICROPY_HW_BOARD_NAME "TinyPICO" #define MICROPY_HW_MCU_NAME "ESP32-PICO-D4" #define MICROPY_HW_I2C0_SCL (22) #define MICROPY_HW_I2C0_SDA (21) #define MICROPY_HW_SPI1_SCK (18) #define MICROPY_HW_SPI1_MOSI (23) #define MICROPY_HW_SPI1_MISO (19)
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/UM_TINYPICO/mpconfigboard.h
C
apache-2.0
254
include("$(PORT_DIR)/boards/manifest.py") freeze("modules")
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/UM_TINYS2/manifest.py
Python
apache-2.0
60
# TinyS2 MicroPython Helper Library # 2021 Seon Rozenblum - Unexpected Maker # # Project home: # https://tinys2.io # # 2021-Apr-10 - v0.1 - Initial implementation # Import required libraries from micropython import const from machine import Pin, SPI, ADC import machine, time # TinyS2 Hardware Pin Assignments # Sen...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/UM_TINYS2/modules/tinys2.py
Python
apache-2.0
2,193
set(IDF_TARGET esp32s2) set(SDKCONFIG_DEFAULTS boards/sdkconfig.base boards/sdkconfig.spiram_sx boards/sdkconfig.usb ) set(MICROPY_FROZEN_MANIFEST ${MICROPY_PORT_DIR}/boards/manifest.py)
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/UM_TINYS2/mpconfigboard.cmake
CMake
apache-2.0
200
#define MICROPY_HW_BOARD_NAME "TinyS2" #define MICROPY_HW_MCU_NAME "ESP32-S2FN4R2" #define MICROPY_PY_BLUETOOTH (0) #define MICROPY_HW_ENABLE_SDCARD (0) #define MICROPY_HW_I2C0_SCL (9) #define MICROPY_HW_I2C0_SDA (8) #define MICROPY_HW_SPI1_MOSI (35) #define MICROPY_HW_SPI1_MISO (36) #defin...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/UM_TINYS2/mpconfigboard.h
C
apache-2.0
347
freeze("$(PORT_DIR)/modules") freeze("$(MPY_DIR)/tools", ("upip.py", "upip_utarfile.py")) freeze("$(MPY_DIR)/drivers/dht", "dht.py") freeze("$(MPY_DIR)/drivers/onewire") include("$(MPY_DIR)/extmod/uasyncio/manifest.py") include("$(MPY_DIR)/extmod/webrepl/manifest.py") include("$(MPY_DIR)/drivers/neopixel/manifest.py")
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/manifest.py
Python
apache-2.0
320
include("manifest.py") freeze("$(MPY_LIB_DIR)/python-ecosys/urequests", "urequests.py") freeze("$(MPY_LIB_DIR)/micropython/upysh", "upysh.py") freeze("$(MPY_LIB_DIR)/micropython/umqtt.simple", "umqtt/simple.py") freeze("$(MPY_LIB_DIR)/micropython/umqtt.robust", "umqtt/robust.py")
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/boards/manifest_release.py
Python
apache-2.0
283
idf_component_register(SRC_DIRS "." )
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/components/dummy_main/CMakeLists.txt
CMake
apache-2.0
41
#include <stdio.h> void app_main(void) { printf(" ====== main_dummy enter ======\r\n"); }
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/components/dummy_main/main_dummy.c
C
apache-2.0
94
/* * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * * Copyright (c) 2021 by Thorsten von Eicken * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * i...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/esp32_nvs.c
C
apache-2.0
6,540
/* * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * * Copyright (c) 2019 Damien P. George * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the ...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/esp32_partition.c
C
apache-2.0
10,642
/* * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * * Copyright (c) 2019 "Matt Trentini" <matt.trentini@gmail.com> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Softw...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/esp32_rmt.c
C
apache-2.0
12,574
/* * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * * Copyright (c) 2018 "Andreas Valder" <andreas.valder@serioese.gmbh> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the ...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/esp32_ulp.c
C
apache-2.0
3,901
/* * This file is part of the MicroPython project, http://micropython.org/ * * Development of the code in this file was sponsored by Microbric Pty Ltd * * The MIT License (MIT) * * Copyright (c) 2013, 2014, 2016 Damien P. George * * Permission is hereby granted, free of charge, to any person obtaining a copy ...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/fatfs_port.c
C
apache-2.0
1,408
/* * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * * Copyright (c) 2013, 2014 Damien P. George * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * i...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/font_petme128_8x8.h
C
apache-2.0
6,551
import kv import time import _thread import uos def _on_get_url(url): kv.set('_amp_pyapp_url',url) execfile('/lib/appOta.py') def _connect_wifi(): time.sleep(5) ssid = kv.get('_amp_wifi_ssid') passwd = kv.get('_amp_wifi_passwd') if isinstance(ssid,str) and isinstance(passwd,str): import...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/fs/boot.py
Python
apache-2.0
1,086
import uos as os import uerrno as errno import ujson as json import uzlib import upip_utarfile as tarfile import gc import time import ussl import usocket import kv import machine file_buf = bytearray(128) def install_pkg(package_url, install_path): gzdict_sz = 16 + 15 f1 = url_open(package_url) if (isin...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/fs/lib/appOta.py
Python
apache-2.0
3,702
import uos as os import uerrno as errno import ujson as json import uzlib import upip_utarfile as tarfile import gc import time import ussl import usocket import kv import network import time file_buf = bytearray(128) def install_pkg(package_url, install_path): gzdict_sz = 16 + 15 f1 = url_open(package_url) ...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/fs/lib/appUpgrade.py
Python
apache-2.0
4,070
import bluetooth import struct import json import gc import time import network from micropython import const _wlan = network.WLAN(network.STA_IF) _ble = bluetooth.BLE() _bleNetConfigStatus = None _ble_adv_name = 'esp-node' _ble_tx = None _ble_rx = None _ble_msg = '' BLE_CONNECTED = const(0x00) BLE_DISCONNECTED = co...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/fs/lib/bleNetConfig.py
Python
apache-2.0
7,111
""" Copyright (C) 2015-2021 Alibaba Group Holding Limited MicroPython's driver for CHT8305 Author: HaaS Date: 2022/05/11 """ import lvgl as lv import lvgl_display print("display_driver init") if not lv.is_initialized(): #print("lv.init") lv.init() if not lvgl_display.is_initialized(): #pr...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/fs/lib/display_driver.py
Python
apache-2.0
369
print('enable OneMinuteOnCloud') import ubluetooth import uos as os import uerrno as errno import ujson as json import uzlib import upip_utarfile as tarfile import gc import time import machine import ussl import usocket import network _wlan = network.WLAN(network.STA_IF) _ble = ubluetooth.BLE() _ble_adv_name = 'esp-...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/fs/lib/oneMinuteOnCloud.py
Python
apache-2.0
11,221
/* * This file is part of the MicroPython project, http://micropython.org/ * * Development of the code in this file was sponsored by Microbric Pty Ltd * * The MIT License (MIT) * * Copyright (c) 2014 Damien P. George * Copyright (c) 2017 Pycom Limited * * Permission is hereby granted, free of charge, to any p...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/gccollect.c
C
apache-2.0
2,494
/* * This file is part of the MicroPython project, http://micropython.org/ * * Development of the code in this file was sponsored by Microbric Pty Ltd * * The MIT License (MIT) * * Copyright (c) 2014 Damien P. George * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this so...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/gccollect.h
C
apache-2.0
1,678
/* * This file is part of the MicroPython project, http://micropython.org/ * * Development of the code in this file was sponsored by Microbric Pty Ltd * * The MIT License (MIT) * * Copyright (c) 2013-2016 Damien P. George * * Permission is hereby granted, free of charge, to any person obtaining a copy * of th...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/help.c
C
apache-2.0
2,811
/* * This file is part of the MicroPython ESP32 project, https://github.com/loboris/MicroPython_ESP32_psRAM_LoBo * * The MIT License (MIT) * * Copyright (c) 2018 LoBo (https://github.com/loboris) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated d...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/libs/neopixel.c
C
apache-2.0
16,108
/* * This file is part of the MicroPython ESP32 project, https://github.com/loboris/MicroPython_ESP32_psRAM_LoBo * * The MIT License (MIT) * * Copyright (c) 2018 LoBo (https://github.com/loboris) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated d...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/libs/neopixel.h
C
apache-2.0
3,060
import axp192 import kv import uos try: # for m5stack-core2 only axp = axp192.Axp192() axp.powerAll() axp.setLCDBrightness(80) # 设置背光亮度 0~100 except OSError: print("make sure axp192.py is in libs folder") def _on_get_url(url): kv.set('_amp_pyapp_url', url) execfile('/lib/appOta.py') de...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/m5stackcore2/boot.py
Python
apache-2.0
1,167
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" class Airpressure: scr = None iconImg = None airpressureLable = None unityLabel = None tipLabel = None def __init__(self, screen): self.scr = screen self.createAirpressureItem(self.scr, RESOURCES_ROOT + "airpressure.p...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/m5stackcore2/data/pyamp/airpressure.py
Python
apache-2.0
1,977
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" class Angle: scr = None iconImg = None angleLable = None unityLabel = None tipLabel = None def __init__(self, screen): self.scr = screen self.createAngleItem(self.scr, RESOURCES_ROOT + "angle.png", "Angle") def c...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/m5stackcore2/data/pyamp/angle.py
Python
apache-2.0
1,872
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/" compass_ttf_alive = False def compass_back_click_callback(e, win): global compass_ttf_alive if (compass_ttf_alive): from smart_panel import load_smart_panel load_smart_panel() compass_ttf_alive = False def compass_back_press_callbac...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/m5stackcore2/data/pyamp/compass.py
Python
apache-2.0
4,147
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" class Distance: scr = None iconImg = None distanceLable = None unityLabel = None tipLabel = None def __init__(self, screen): self.scr = screen self.createDistanceItem(self.scr, RESOURCES_ROOT + "distance.png", "DST") ...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/m5stackcore2/data/pyamp/distance.py
Python
apache-2.0
1,918
import lvgl as lv import utime RESOURCES_ROOT = "S:/data/pyamp/" def drawOver(e): global g_clickTime if (g_clickTime != 0): currentTime = utime.ticks_ms() print("create Environment page use: %dms" % int((currentTime - g_clickTime))) g_clickTime = 0 environment_alive = False def envi...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/m5stackcore2/data/pyamp/environment.py
Python
apache-2.0
4,518
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" class Fm: scr = None iconImg = None fmLable = None unityLabel = None tipLabel = None def __init__(self, screen): self.scr = screen self.createFmItem(self.scr, RESOURCES_ROOT + "FM.png", "FM") def createFmItem(sel...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/m5stackcore2/data/pyamp/fm.py
Python
apache-2.0
1,823
import lvgl as lv font_not_load_16 = True info_16 = None style_16 = None def set_text_size_16(parent): global font_not_load_16 global info_16 global style_16 if (font_not_load_16): info_16 = lv.ft_info_t() info_16.name ="/data/pyamp/font/AlibabaPuHuiTiM_16.ttf" info_16.weight =...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/m5stackcore2/data/pyamp/font_Alibaba_PuHuiTi.py
Python
apache-2.0
2,463
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" class Gas: scr = None iconImg = None gasLable = None unityLabel = None tipLabel = None def __init__(self, screen): self.scr = screen self.createGasItem(self.scr, RESOURCES_ROOT + "gas.png", "Nature Gas") def crea...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/m5stackcore2/data/pyamp/gas.py
Python
apache-2.0
1,848
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" class Hcho: scr = None iconImg = None hchoLable = None unityLabel = None tipLabel = None def __init__(self, screen): self.scr = screen self.createHchoItem(self.scr, RESOURCES_ROOT + "hcho.png", "PA") def createHc...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/m5stackcore2/data/pyamp/hcho.py
Python
apache-2.0
1,857
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" class Heartrate: scr = None iconImg = None heartrateLable = None unityLabel = None tipLabel = None def __init__(self, screen): self.scr = screen self.createHeartrateItem(self.scr, RESOURCES_ROOT + "heartrate.png", "HR...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/m5stackcore2/data/pyamp/heartrate.py
Python
apache-2.0
1,935
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" class Humidity: scr = None iconImg = None humidityLable = None unityLabel = None tipLabel = None def __init__(self, screen): self.scr = screen self.createHumidityItem(self.scr, RESOURCES_ROOT + "humidity.png", "TDS") ...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/m5stackcore2/data/pyamp/humidity.py
Python
apache-2.0
1,920
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/" environment_alive = False functionImage = [ RESOURCES_ROOT + "images/refrigeration.png", RESOURCES_ROOT + "images/heating.png", RESOURCES_ROOT + "images/dehumidification.png", RESOURCES_ROOT + "images/ventilation.png"] functionImage...
YifuLiu/AliOS-Things
components/py_engine/adapter/esp32/m5stackcore2/data/pyamp/hvac.py
Python
apache-2.0
8,415