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 |
|---|---|---|---|---|---|
/*
Please add this section into app.json when run this script as app.js.
This configuration is designed for haas100 edu k1.
"qlc5883": {
"type": "I2C",
"port": 1,
"addrWidth": 7,
"freq": 400000,
"mode": "master",
"devAddr": 13
}
*/
console.log('testing qlc5883...');
var qlc5883 = require('./q... | YifuLiu/AliOS-Things | components/amp/test/test_qlc5883.js | JavaScript | apache-2.0 | 548 |
var gpio = require('gpio');
var spi = require('spi');
var sh1106 = require('./sh1106.js');
console.log('Hello')
var oled_dc = gpio.open({
id: 'oled_dc',
success: function () {
console.log('gpio: open oled_dc success')
},
fail: function () {
console.log('gpio: open oled_dc failed')
... | YifuLiu/AliOS-Things | components/amp/test/test_sh1106.js | JavaScript | apache-2.0 | 944 |
/*
Please add this section into app.json when run this script as app.js.
This configuration is designed for haas100 edu k1.
"si7006": {
"type": "I2C",
"port": 1,
"addrWidth": 7,
"freq": 400000,
"mode": "master",
"devAddr": 64
}
*/
console.log('testing si7006...');
var si7006 = require('./si70... | YifuLiu/AliOS-Things | components/amp/test/test_si7006.js | JavaScript | apache-2.0 | 730 |
/*
Please add this section into app.json when run this script as app.js.
This configuration is designed for haas100 edu k1.
"spl06": {
"type": "I2C",
"port": 1,
"addrWidth": 7,
"freq": 400000,
"mode": "master",
"devAddr": 119
}
*/
console.log('testing spl06...');
var spl06 = require('./spl06.j... | YifuLiu/AliOS-Things | components/amp/test/test_spl06.js | JavaScript | apache-2.0 | 499 |
/* 本测试case,测试tcp的接口,接口返回值等,tcp server是公网tcp服务器:47.101.151.113 */
function ArrayToString(fileData){
var dataString = "";
for (var i = 0; i < fileData.length; i++) {
dataString += String.fromCharCode(fileData[i]);
}
return dataString;
}
console.log('tcp: testing tcp...');
// 测试 tcp 模块
var tcp = require('tc... | YifuLiu/AliOS-Things | components/amp/test/test_tcp.js | JavaScript | apache-2.0 | 2,463 |
/* 本测试case,测试udp的接口,接口返回值等,udp server是公网udp服务器:47.101.151.113 */
function ArrayToString(fileData){
var dataString = "";
for (var i = 0; i < fileData.length; i++) {
dataString += String.fromCharCode(fileData[i]);
}
return dataString;
}
console.log('udp: testing udp...');
// 测试 udp 模块
var udp... | YifuLiu/AliOS-Things | components/amp/test/test_udp.js | JavaScript | apache-2.0 | 2,643 |
#./demo_prj_v1.2/democfg.mak
#---------------------------------------------------------
# tool chain define
#---------------------------------------------------------
AMP_VERSION = "2.0.0"
GIT_COMMIT = "$(shell git show -s --pretty=format:%h)"
COMPILE_TIME = "$(shell date +"%Y-%m-%d %H:%M:%S")"
CC = gcc
CXX = g... | YifuLiu/AliOS-Things | components/amp/tools/config.mk | Makefile | apache-2.0 | 1,014 |
include $(TOOLS_DIR)/config.mk
SUB_ALL_SRCS := $(MOD_SOURCES)
SUB_ALL_OBJS := $(patsubst %.c,%.o,$(SUB_ALL_SRCS))
$(foreach inc, $(MOD_INCLUDES), $(eval SUB_ALL_INCS += -I$(inc)))
all: $(LIBS_DIR)/$(TARGET)
$(LIBS_DIR)/$(TARGET): $(SUB_ALL_OBJS)
$(ECHO) "Archiving $@ ..."
$(AR) $(ARFLAGS) $@ $^
$(SUB_ALL_OBJS)... | YifuLiu/AliOS-Things | components/amp/tools/rules.mk | Makefile | apache-2.0 | 402 |
/**
* @file lvgl.h
* Include all LittleV GL related headers
*/
#ifndef LV_H
#define LV_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
//#include "aui_version.h"
#include "../../../../littlevgl/src/lv_draw/lv_draw_img.h"
#include "../../../../littlevgl/sr... | YifuLiu/AliOS-Things | components/amp/ui/render/include/lvgl.h | C | apache-2.0 | 3,084 |
#ifndef _MODEL_BIND_H
#define _MODEL_BIND_H
#include "view_model.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef int (*MODEL_DATA_SEND_TO_VM_F)(vm_msg_t *, int);
typedef struct _model_bind_proc_t {
bool flag;
MODEL_DATA_SEND_TO_VM_F send;
}model_bind_proc_t;
int model_data_bind_init(MOD... | YifuLiu/AliOS-Things | components/amp/ui/render/include/model_bind.h | C | apache-2.0 | 562 |
#ifndef _WIDGET_H
#define _WIDGET_H
//#include <unistd.h>
//#include "amp_system.h"
#include "lvgl.h"
#include "render_public.h"
#include "render_style.h"
#ifdef CONFIG_ENGINE_DUKTAPE
#include "be_inl.h"
#endif
#include "amp_defines.h"
#ifdef __cplusplus
extern "C" {
#endif
#define UI_MOD_STR "AMP_UI"
#define UI_ME... | YifuLiu/AliOS-Things | components/amp/ui/render/include/render.h | C | apache-2.0 | 8,667 |
#ifndef _WIDGET_BASE_H
#define _WIDGET_BASE_H
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
//#include <memory.h>
#include "amp_defines.h"
//#include "amp_system.h"
#ifdef __cplusplus
extern "C" {
#endif
#if 0
typedef unsigned char uint8_t;
typedef signed char int8_t;
ty... | YifuLiu/AliOS-Things | components/amp/ui/render/include/render_public.h | C | apache-2.0 | 2,739 |
#ifndef _WIDGET_STYLE_H
#define _WIDGET_STYLE_H
#include "render_public.h"
#ifdef __cplusplus
extern "C" {
#endif
#define STYLE_MAX_CLASS_SELECTOR_ONCE 32
typedef enum {
//css_parse_start,
css_parse_selector_start,
css_parse_selector_id,
css_parse_selector_class_flag,
css_parse_selector_class... | YifuLiu/AliOS-Things | components/amp/ui/render/include/render_style.h | C | apache-2.0 | 3,315 |
#ifndef _VIEW_BIND_H
#define _VIEW_BIND_H
#include "view_model.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef int (*VIEW_SEND_TO_VM_F)(vm_msg_t *, int);
typedef int (*VIEW_DATA_BIND_VM_F)(widget_desc_t *, char *, char *);
typedef int (*VIEW_DATA_UNBIND_VM_F)(widget_desc_t *, char *, char *);
typedef struct _vie... | YifuLiu/AliOS-Things | components/amp/ui/render/include/view_bind.h | C | apache-2.0 | 987 |
#ifndef _VIEW_MODEL_H
#define _VIEW_MODEL_H
//#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
//#include <memory.h>
#include "aos_system.h"
#include "render.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _vm_desc_t{
vm_data_state_e state;
widge... | YifuLiu/AliOS-Things | components/amp/ui/render/include/view_model.h | C | apache-2.0 | 1,120 |
/**
* @file amp_list.h
* @copyright Copyright (C) 2015-2018 Alibaba Group Holding Limited
*/
#ifndef AMP_LIST_H
#define AMP_LIST_H
#ifdef __cplusplus
extern "C" {
#endif
/** @addtogroup amp_list LIST
* list data structure manage.
*
* @{
*/
/*
* Get offset of a member variable.
*
* @param[in] type th... | YifuLiu/AliOS-Things | components/amp/utils/list/amp_list.h | C | apache-2.0 | 10,953 |
TARGET = libadapter.a
MODULE = adapter
MOD_SOURCES := \
platform/linux/peripheral/amp_hal_adc.c \
platform/linux/peripheral/amp_hal_can.c \
platform/linux/peripheral/amp_hal_gpio.c \
platform/linux/peripheral/amp_hal_i2c.c \
platform/linux/peripheral/amp_hal_pwm.c \
platform/linux/peripheral/amp_hal_rtc.c ... | YifuLiu/AliOS-Things | components/amp_adapter/Makefile | Makefile | apache-2.0 | 2,265 |
NAME := amp_adapter
$(NAME)_MBINS_TYPE := app
$(NAME)_VERSION := 1.0.0
$(NAME)_SUMMARY := amp adapter
$(NAME)_SOURCES += \
platform/aos/aos_fs.c \
platform/aos/haas700/amp_ota_port.c \
platform/aos/aos_system.c \
platform/aos/network/aos_cellular.c \
platform/aos/network/aos_httpc.c \
pl... | YifuLiu/AliOS-Things | components/amp_adapter/aos.mk | Makefile | apache-2.0 | 1,154 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#ifndef AMP_FS_H
#define AMP_FS_H
#include <fcntl.h>
#include "amp_platform.h"
#ifdef AOS_COMP_VFS
#include <aos/vfs.h>
#endif
#if defined(__cplusplus)
extern "C" {
#endif
/**
* @brief aos_fs_init() initializes vfs system.
*
* @param[in] NULL
*
*... | YifuLiu/AliOS-Things | components/amp_adapter/include/aos_fs.h | C | apache-2.0 | 1,016 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#ifndef _AOS_HTTPC_H_
#define _AOS_HTTPC_H_
#include "lwip/sockets.h"
struct hostent *aos_httpc_get_host_by_name(const char *name);
int aos_httpc_socket_connect(uintptr_t fd, const struct sockaddr *name, socklen_t namelen);
#endif /* _AOS_HTTPC_H_ */
... | YifuLiu/AliOS-Things | components/amp_adapter/include/aos_httpc.h | C | apache-2.0 | 321 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#ifndef AOS_LOG_H
#define AOS_LOG_H
#include <stdarg.h>
#include <string.h>
typedef enum {
AOS_LOG_NONE, /* disable log */
AOS_LOG_FATAL, /* fatal log will output */
AOS_LOG_ERROR, /* fatal + error log will output */
AOS_LOG_WARN, ... | YifuLiu/AliOS-Things | components/amp_adapter/include/aos_log.h | C | apache-2.0 | 1,692 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#ifndef AOS_NETWORK_H
#define AOS_NETWORK_H
#include <stdbool.h>
#include "aos/kernel.h"
#ifndef _AOS_NETWORK_H_
#define _AOS_NETWORK_H_
#define SCANNED_WIFI_COUNT_MAX 32
#define SCANNED_LOCATOR_COUNT_MAX 32
typedef enum {
AOS_ERR_WIFI_BASE = 0x3000,... | YifuLiu/AliOS-Things | components/amp_adapter/include/aos_network.h | C | apache-2.0 | 7,741 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#ifndef AOS_OTA_H
#define AOS_OTA_H
/**
* sys ota upgrade thread function.
*
* @param[in] ctx device information.
*
* @return 0 on success, negative error on failure.
*/
int interval_sys_upgrade_start(void *ctx);
/**
* submodule ota cb.
*
*... | YifuLiu/AliOS-Things | components/amp_adapter/include/aos_ota.h | C | apache-2.0 | 765 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#ifndef __AOS_PCM_H__
#define __AOS_PCM_H__
#define AOS_PCM_DIR_OUT 0
#define AOS_PCM_DIR_IN 1
typedef enum {
AOS_PCM_FORMAT_INVALID = -1,
AOS_PCM_FORMAT_S16_LE = 0, /* 16-bit signed */
AOS_PCM_FORMAT_S32_LE, /* 32-bit signed */
A... | YifuLiu/AliOS-Things | components/amp_adapter/include/aos_pcm.h | C | apache-2.0 | 3,105 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#ifndef AOS_PM_H
#define AOS_PM_H
typedef enum {
AOS_CHARGER_STAT_SHUTDOWN = 0,
AOS_CHARGER_STAT_CHECK,
AOS_CHARGER_STAT_TRICKLE,
AOS_CHARGER_STAT_PRE,
AOS_CHARGER_STAT_CC,
AOS_CHARGER_STAT_CV,
AOS_CHARGER_STAT_TERMINAL,
A... | YifuLiu/AliOS-Things | components/amp_adapter/include/aos_pm.h | C | apache-2.0 | 4,377 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#ifndef _AOS_SMARTCARD_H_
#define _AOS_SMARTCARD_H_
typedef enum {
AOS_SMARTCARD_ACT_NULL = 0,
AOS_SMARTCARD_ACT_2G,
AOS_SMARTCARD_ACT_3G,
AOS_SMARTCARD_ACT_4G
} aos_smartcard_act_t;
/**
* Configure smartcard
*
* @param[in] module_t... | YifuLiu/AliOS-Things | components/amp_adapter/include/aos_smartcard.h | C | apache-2.0 | 2,505 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#ifndef _AOS_SOCKET_H_
#define _AOS_SOCKET_H_
#include <sys/socket.h>
#include "netdb.h"
/**
* @brief get socket errno.
*
* @param[in] NULL
*
* @return socket errno
*/
int aos_socket_errno(void);
/**
* @brief creates an endpoint for communicati... | YifuLiu/AliOS-Things | components/amp_adapter/include/aos_socket.h | C | apache-2.0 | 5,785 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#ifndef AMP_SYSTEM_H
#define AMP_SYSTEM_H
#if defined(__cplusplus)
extern "C" {
#endif
#include "stdarg.h"
#include "ulog/ulog.h"
#include "aos/kernel.h"
/* log system operation wrapper */
#define amp_debug(mod, fmt, ...) LOGD(mod, fmt, ##__VA_ARGS... | YifuLiu/AliOS-Things | components/amp_adapter/include/aos_system.h | C | apache-2.0 | 2,306 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#ifndef _AOS_TCP_H_
#define _AOS_TCP_H_
/**
* This function will establish a tcp socket.
*
* @param[in] host host name of tcp socket connect
* @param[in] port port.
*
* @return 0: success, otherwise: fail.
*/
int aos_tcp_establish(const char ... | YifuLiu/AliOS-Things | components/amp_adapter/include/aos_tcp.h | C | apache-2.0 | 1,347 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#ifndef __AOS_TTS_H__
#define __AOS_TTS_H__
#include "aos_pcm.h"
typedef enum {
TEXT_ENCODE_TYPE_UTF8 = 1,
TEXT_ENCODE_TYPE_GBK,
} aos_text_encode_type_t;
typedef enum {
AOS_TTS_EVENT_INIT = 0,
AOS_TTS_EVENT_DEINIT,
AOS_TTS_EVENT_PL... | YifuLiu/AliOS-Things | components/amp_adapter/include/aos_tts.h | C | apache-2.0 | 3,252 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#ifndef _AOS_UDP_H_
#define _AOS_UDP_H_
#define NETWORK_ADDR_LEN (16)
typedef struct {
unsigned char
addr[NETWORK_ADDR_LEN];
unsigned short port;
} aos_networkAddr;
/**
* This function will establish a tcp socket.
*
* @param[in] host ... | YifuLiu/AliOS-Things | components/amp_adapter/include/aos_udp.h | C | apache-2.0 | 3,166 |
/**
* @file adc.h
* @copyright Copyright (C) 2015-2018 Alibaba Group Holding Limited
*/
#ifndef AOS_HAL_ADC_H
#define AOS_HAL_ADC_H
#ifdef __cplusplus
extern "C" {
#endif
/** @addtogroup hal_adc ADC
* ADC hal API.
*
* @{
*/
#include <stdint.h>
/* Define the wait forever timeout macro */
#define HAL_WAIT_F... | YifuLiu/AliOS-Things | components/amp_adapter/include/peripheral/aos_hal_adc.h | C | apache-2.0 | 2,519 |
/**
* @file can.h
* @copyright Copyright (C) 2015-2018 Alibaba Group Holding Limited
*/
#ifndef AOS_HAL_CAN_H
#define AOS_HAL_CAN_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
/** @addtogroup hal_can CAN
* CAN hal API.
*
* @{
*/
#define CAN_BAUD_1M 1000000
#define CAN_BAUD_500K 500000
#de... | YifuLiu/AliOS-Things | components/amp_adapter/include/peripheral/aos_hal_can.h | C | apache-2.0 | 3,575 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#ifndef AOS_HAL_DAC_H
#define AOS_HAL_DAC_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
typedef struct {
uint8_t port; /* dac port */
void *priv; /* priv data */
} dac_dev_t;
/**
* Initialises an dac interface
*
* @param[... | YifuLiu/AliOS-Things | components/amp_adapter/include/peripheral/aos_hal_dac.h | C | apache-2.0 | 2,008 |
/*
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
*/
#ifndef AOS_HAL_FLASH_H
#define AOS_HAL_FLASH_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define PAR_OPT_READ_POS (0)
#define PAR_OPT_WRITE_POS (1)
#define PAR_OPT_READ_MASK (0x1u << PAR_OPT_READ_POS)
#define PAR_OPT_WRITE_MASK (0x... | YifuLiu/AliOS-Things | components/amp_adapter/include/peripheral/aos_hal_flash.h | C | apache-2.0 | 8,359 |
#ifndef AOS_HAL_GPIO_H
#define AOS_HAL_GPIO_H
#include <aos_hal_gpio_internal.h>
typedef aos_hal_gpio_config_t gpio_config_t;
typedef aos_hal_gpio_irq_trigger_t gpio_irq_trigger_t;
typedef aos_hal_gpio_irq_handler_t gpio_irq_handler_t;
typedef aos_hal_gpio_dev_t gpio_dev_t;
#endif /* AOS_HAL_GPIO_H */
| YifuLiu/AliOS-Things | components/amp_adapter/include/peripheral/aos_hal_gpio.h | C | apache-2.0 | 306 |
/**
* @file gpio.h
* @copyright Copyright (C) 2015-2018 Alibaba Group Holding Limited
*/
#ifndef AOS_HAL_GPIO_INTERNAL_H
#define AOS_HAL_GPIO_INTERNAL_H
#ifdef __cplusplus
extern "C" {
#endif
/** @addtogroup hal_gpio GPIO
* gpio hal API.
*
* @{
*/
#include <stdint.h>
#ifndef ESP_PLATFORM
#include "aos/gpio... | YifuLiu/AliOS-Things | components/amp_adapter/include/peripheral/aos_hal_gpio_internal.h | C | apache-2.0 | 6,967 |
#ifndef AOS_HAL_I2C_H
#define AOS_HAL_I2C_H
#include <aos_hal_i2c_internal.h>
#define I2C_MODE_MASTER AOS_HAL_I2C_MODE_MASTER
#define I2C_MODE_SLAVE AOS_HAL_I2C_MODE_SLAVE
typedef aos_hal_i2c_config_t i2c_config_t;
typedef aos_hal_i2c_dev_t i2c_dev_t;
#endif /* AOS_HAL_I2C_H */
| YifuLiu/AliOS-Things | components/amp_adapter/include/peripheral/aos_hal_i2c.h | C | apache-2.0 | 284 |
/**
* @file i2c.h
* @copyright Copyright (C) 2015-2018 Alibaba Group Holding Limited
*/
#ifndef AOS_HAL_I2C_INTERNAL_H
#define AOS_HAL_I2C_INTERNAL_H
#ifdef __cplusplus
extern "C" {
#endif
/** @addtogroup hal_i2c I2C
* i2c hal API.
*
* @{
*/
#include <stdint.h>
/* Define the wait forever timeout macro */
... | YifuLiu/AliOS-Things | components/amp_adapter/include/peripheral/aos_hal_i2c_internal.h | C | apache-2.0 | 5,569 |
/**
* @file lcd.h
* @copyright Copyright (C) 2015-2018 Alibaba Group Holding Limited
*/
#ifndef AOS_HAL_LCD_H
#define AOS_HAL_LCD_H
#ifdef __cplusplus
extern "C" {
#endif
/** @addtogroup hal_lcd LCD
* lcd hal API.
*
* @{
*/
#include <stdint.h>
#include <stdbool.h>
/**
* Init the lcd module.
*
* @retrun... | YifuLiu/AliOS-Things | components/amp_adapter/include/peripheral/aos_hal_lcd.h | C | apache-2.0 | 1,466 |
#ifndef AOS_HAL_PWM_H
#define AOS_HAL_PWM_H
#include <aos_hal_pwm_internal.h>
typedef aos_hal_pwm_config_t pwm_config_t;
typedef aos_hal_pwm_dev_t pwm_dev_t;
#endif /* AOS_HAL_PWM_H */
| YifuLiu/AliOS-Things | components/amp_adapter/include/peripheral/aos_hal_pwm.h | C | apache-2.0 | 188 |
/**
* @file pwm.h
* @copyright Copyright (C) 2015-2018 Alibaba Group Holding Limited
*/
#ifndef AOS_HAL_PWM_INTERNAL_H
#define AOS_HAL_PWM_INTERNAL_H
#ifdef __cplusplus
extern "C" {
#endif
/** @addtogroup hal_pwm PWM
* pwm hal API.
*
* @{
*/
#include <stdint.h>
typedef struct {
uint32_t duty_cycle; /*... | YifuLiu/AliOS-Things | components/amp_adapter/include/peripheral/aos_hal_pwm_internal.h | C | apache-2.0 | 1,772 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#ifndef AOS_HAL_RTC_H
#define AOS_HAL_RTC_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define HAL_RTC_FORMAT_DEC 1
#define HAL_RTC_FORMAT_BCD 2
typedef struct {
uint8_t format; /* time formart DEC or BCD */
} rtc_config_t;
typede... | YifuLiu/AliOS-Things | components/amp_adapter/include/peripheral/aos_hal_rtc.h | C | apache-2.0 | 2,421 |
#ifndef AOS_HAL_SPI_H
#define AOS_HAL_SPI_H
#include <aos_hal_spi_internal.h>
#ifndef HAL_SPI_H
typedef aos_hal_spi_role_e spi_role_e;
typedef aos_hal_spi_firstbit_e spi_firstbit_e;
typedef aos_hal_spi_work_mode_e spi_work_mode_e;
typedef aos_hal_spi_transfer_mode_e spi_transfer_mode_e;
typedef aos_hal_spi_data_size_... | YifuLiu/AliOS-Things | components/amp_adapter/include/peripheral/aos_hal_spi.h | C | apache-2.0 | 538 |
/**
* @file spi.h
* @copyright Copyright (C) 2015-2018 Alibaba Group Holding Limited
*/
#ifndef AOS_HAL_SPI_INTERNAL_H
#define AOS_HAL_SPI_INTERNAL_H
#ifdef __cplusplus
extern "C" {
#endif
/** @addtogroup hal_spi SPI
* spi hal API.
*
* @{
*/
#include <stdint.h>
/* Define the wait forever timeout macro */
... | YifuLiu/AliOS-Things | components/amp_adapter/include/peripheral/aos_hal_spi_internal.h | C | apache-2.0 | 6,126 |
/**
* @file timer.h
* @copyright Copyright (C) 2015-2018 Alibaba Group Holding Limited
*/
#ifndef AOS_HAL_TIMER_H
#define AOS_HAL_TIMER_H
#include <aos_hal_timer_internal.h>
typedef aos_hal_timer_config_t timer_config_t;
typedef aos_hal_timer_dev_t timer_dev_t;
#endif /* AOS_HAL_TIMER_H */
| YifuLiu/AliOS-Things | components/amp_adapter/include/peripheral/aos_hal_timer.h | C | apache-2.0 | 299 |
/**
* @file timer.h
* @copyright Copyright (C) 2015-2018 Alibaba Group Holding Limited
*/
#ifndef AOS_HAL_TIMER_INTERNAL_H
#define AOS_HAL_TIMER_INTERNAL_H
#ifdef __cplusplus
extern "C" {
#endif
/** @addtogroup hal_timer TIMER
* timer hal API.
*
* @{
*/
#include <stdint.h>
#define TIMER_RELOAD_AUTO 1 /**... | YifuLiu/AliOS-Things | components/amp_adapter/include/peripheral/aos_hal_timer_internal.h | C | apache-2.0 | 2,301 |
#ifndef AOS_HAL_UART_H
#define AOS_HAL_UART_H
#include <aos_hal_uart_internal.h>
#ifndef HAL_UART_H
typedef aos_hal_uart_data_width_t hal_uart_data_width_t;
typedef aos_hal_uart_stop_bits_t hal_uart_stop_bits_t;
typedef aos_hal_uart_flow_control_t hal_uart_flow_control_t;
typedef aos_hal_uart_parity_t hal_uart_parity... | YifuLiu/AliOS-Things | components/amp_adapter/include/peripheral/aos_hal_uart.h | C | apache-2.0 | 489 |
/**
* @file uart.h
* @copyright Copyright (C) 2015-2018 Alibaba Group Holding Limited
*/
#ifndef AOS_HAL_UART_INTERNAL_H
#define AOS_HAL_UART_INTERNAL_H
#ifdef __cplusplus
extern "C" {
#endif
/** @addtogroup hal_uart UART
* uart hal API.
*
* @{
*/
#include <stdint.h>
/* Define the wait forever timeout mac... | YifuLiu/AliOS-Things | components/amp_adapter/include/peripheral/aos_hal_uart_internal.h | C | apache-2.0 | 6,918 |
/**
* @file wdg.h
* @copyright Copyright (C) 2015-2018 Alibaba Group Holding Limited
*/
#ifndef AOS_HAL_WDG_H
#define AOS_HAL_WDG_H
#ifdef __cplusplus
extern "C" {
#endif
/** @addtogroup hal_wdg WDG
* wdg hal API.
*
* @{
*/
#include <stdint.h>
/* Define wdt expired time */
typedef struct {
uint32_t ti... | YifuLiu/AliOS-Things | components/amp_adapter/include/peripheral/aos_hal_wdg.h | C | apache-2.0 | 1,202 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#include "stdio.h"
#include <stdlib.h>
#include <stdbool.h>
#include "aos/errno.h"
#include "aos/kernel.h"
#ifdef AOS_COMP_KV
#include "aos/kv.h"
#endif
#ifdef AOS_COMP_ULOG
#include "ulog/ulog.h"
#endif
// #include <sys/socket.h>
| YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/amp_platform.h | C | apache-2.0 | 296 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#include "amp_platform.h"
#include "aos_system.h"
#include "aos_fs.h"
#include "aos/vfs.h"
#ifndef AOS_BOARD_HAAS700
#include "vfs_types.h"
#else
#include "fs/vfs_types.h"
#endif
int aos_fs_init(void)
{
return 0;
}
int aos_rmdir_r(const char *path)
... | YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/aos_fs.c | C | apache-2.0 | 1,945 |
#include "aos_log.h"
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include "ulog/ulog.h"
#include "aos/kernel.h"
#include "aos/errno.h"
static int local_log_level = AOS_LOG_VERBOSE;
int aos_log(const unsigned char s, const char *tag, const char *fmt, ...)
{
if (s > local_log_level) {
retu... | YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/aos_log.c | C | apache-2.0 | 574 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <fcntl.h>
#include "k_api.h"
#include "aos/kernel.h"
#ifdef AOS_COMP_KV
#include "aos/kv.h"
#endif
#ifdef AOS_COMP_VFS
#include "aos/vfs.h"
#endif
#ifdef AOS_COMP_ULO... | YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/aos_system.c | C | apache-2.0 | 3,363 |
/*
* Copyright (C) 2015-2019 Alibaba Group Holding Limited
*/
#include "aos/kv.h"
#include "aos_system.h"
#define MOD_STR "APP_MGR"
static char app_version[32] = { 0 };
pthread_t system_reboot_thread;
void system_reboot(void *argv)
{
usleep(1000 * 1000);
aos_reboot();
}
int pyamp_app_upgrade(char *url)
{
... | YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/app_ota.c | C | apache-2.0 | 1,965 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#ifndef __AMP_BOARD_CONFIG_H__
#define __AMP_BOARD_CONFIG_H__
#define AMP_RECOVERY_PORT 0
#define AMP_RECOVERY_PORT_BAUDRATE 1500000UL
#define AMP_REPL_UART_PORT 0
#define AMP_REPL_UART_BAUDRATE 1500000UL
#define AMP_STATUS_IO 40
... | YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/haas100/amp_board_config.h | C | apache-2.0 | 439 |
#include "amp_platform.h"
#include "aos_system.h"
#include "ota_agent.h"
void internal_sys_upgrade_start(void *ctx)
{
ota_service_start((ota_service_t *)ctx);
aos_task_exit(0);
return;
} | YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/haas100/amp_ota_port.c | C | apache-2.0 | 199 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#ifndef __AMP_BOARD_CONFIG_H__
#define __AMP_BOARD_CONFIG_H__
#define AMP_RECOVERY_PORT 0
#define AMP_RECOVERY_PORT_BAUDRATE 115200UL
#define AMP_REPL_UART_PORT 0
#define AMP_REPL_UART_BAUDRATE 115200UL
#define AMP_STATUS_IO 40
#d... | YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/haas200/amp_board_config.h | C | apache-2.0 | 438 |
#include "amp_platform.h"
#include "aos_system.h"
#include "ota_agent.h"
void internal_sys_upgrade_start(void *ctx)
{
ota_service_start((ota_service_t *)ctx);
aos_task_exit(0);
return;
}
| YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/haas200/amp_ota_port.c | C | apache-2.0 | 200 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#ifndef __AMP_BOARD_CONFIG_H__
#define __AMP_BOARD_CONFIG_H__
#define AMP_RECOVERY_PORT 0
#define AMP_RECOVERY_PORT_BAUDRATE 115200UL
#define AMP_REPL_UART_PORT 0
#define AMP_REPL_UART_BAUDRATE 115200UL
#define AMP_STATUS_IO 40
#d... | YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/haas700/amp_board_config.h | C | apache-2.0 | 357 |
void internal_sys_upgrade_start(void *ctx)
{
return;
}
| YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/haas700/amp_ota_port.c | C | apache-2.0 | 59 |
/** @defgroup ota_agent_api
* @{
*
* This is an include file of OTA agent transporting with clould.
*
* Copyright (C) 2015-2021 Alibaba Group Holding Limited
*/
#ifndef OTA_AGENT_H
#define OTA_AGENT_H
/*******************************************************************
*********** OTA Agent ... | YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/haas700/ota_agent.h | C | apache-2.0 | 23,309 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#ifndef __AMP_BOARD_CONFIG_H__
#define __AMP_BOARD_CONFIG_H__
#define AMP_RECOVERY_PORT 0
#define AMP_RECOVERY_PORT_BAUDRATE 1500000UL
#define AMP_REPL_UART_PORT 0
#define AMP_REPL_UART_BAUDRATE 1500000UL
#define AMP_STATUS_IO 40
... | YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/haaseduk1/amp_board_config.h | C | apache-2.0 | 440 |
#include "amp_platform.h"
#include "aos_system.h"
#include "ota_agent.h"
void internal_sys_upgrade_start(void *ctx)
{
ota_service_start((ota_service_t *)ctx);
aos_task_exit(0);
return;
} | YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/haaseduk1/amp_ota_port.c | C | apache-2.0 | 199 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#include "aos_network.h"
#include "amp_platform.h"
int aos_get_sim_info(aos_sim_info_t *sim_info)
{
int ret = -1;
return ret;
}
int aos_get_locator_info(aos_locator_info_t *locator_info)
{
int ret = -1;
return ret;
}
int aos_get_neigh... | YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/network/aos_cellular.c | C | apache-2.0 | 787 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#include "aos_network.h"
#include "amp_platform.h"
#include "aos_socket.h"
struct hostent *aos_httpc_get_host_by_name(const char *name)
{
return gethostbyname(name);
}
int32_t aos_httpc_socket_connect(uintptr_t fd, const struct sockaddr *name, sockl... | YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/network/aos_httpc.c | C | apache-2.0 | 377 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#include "amp_platform.h"
#include "aos_network.h"
#include "netdev.h"
#define WIFI_DEV "wifi0"
void amp_netdev_set_default(char* netdev_name)
{
struct netdev* netdev;
if(netdev_name == NULL) {
return ;
}
netdev = netdev_get_by_... | YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/network/aos_netdev.c | C | apache-2.0 | 2,819 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#ifndef AOS_BOARD_HAAS700
#include "amp_platform.h"
#include "aos_network.h"
#include "netmgr.h"
#include "netmgr_wifi.h"
#include <uservice/eventid.h>
#include <uservice/uservice.h>
#ifndef WIFI_DEV_PATH
#define WIFI_DEV_PATH "/dev/wifi0"
#endif
#define... | YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/network/aos_network.c | C | apache-2.0 | 8,418 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include "aos/kernel.h"
#include "aos_tcp.h"
#include "aos_socket.h"
#include "aos_system.h"
#define PLATFORM_LOG_D(format, ...) \
do { ... | YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/network/aos_tcp.c | C | apache-2.0 | 7,520 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "ulog/ulog.h"
#include "aos/kernel.h"
#include "aos_socket.h"
#include <netdb.h>
#include "aos_udp.h"
#include "aos_system.h"
#define TRANSPORT_ADDR_LEN 16
#ifndef IP... | YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/network/aos_udp.c | C | apache-2.0 | 9,452 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <aos/errno.h>
#include "aos_hal_adc.h"
#ifndef AOS_BOARD_HAAS700
#include <vfsdev/adc_dev.h>
#endif
int32_t aos_hal_adc_init(adc_dev_t *adc)
{
#... | YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/peripheral/aos_hal_adc.c | C | apache-2.0 | 2,524 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#include <stdio.h>
#include <stdlib.h>
#include "aos/hal/can.h"
#include "aos_hal_can.h"
#include "aos_system.h"
typedef enum {
PORT_CAN1 = 1,
PORT_CAN2 = 2,
PORT_CAN_SIZE,
PORT_CAN_INVALID = 255,
} PORT_CAN_NUM;
extern can_dev_t g_can_h... | YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/peripheral/aos_hal_can.c | C | apache-2.0 | 2,231 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#include <stdio.h>
#include "aos_hal_flash.h"
int32_t aos_hal_flash_info_get(hal_partition_t in_partition, hal_logic_partition_t **partition)
{
return 0;
}
int32_t aos_hal_flash_read(hal_partition_t id, uint32_t *offset, void *buffer, uint32_t buff... | YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/peripheral/aos_hal_flash.c | C | apache-2.0 | 571 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#ifndef AOS_BOARD_HAAS700
#endif
#include "aos_hal_gpio.h"
#ifdef CONFIG_GPIO_NUM
#define PLATFORM_GPIO_NUM CONFIG_GPIO_NUM
#else
#define PLATFORM_GPIO_N... | YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/peripheral/aos_hal_gpio.c | C | apache-2.0 | 7,560 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <aos/errno.h>
#ifndef AOS_BOARD_HAAS700
#include <vfsdev/i2c_dev.h>
#endif
#include "aos_hal_i2c.h"
int32_t aos_hal_i2c_init(i2c_dev_t *i2c)
{
#i... | YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/peripheral/aos_hal_i2c.c | C | apache-2.0 | 5,075 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#include <stdio.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include "aos_hal_lcd.h"
#ifndef AOS_BOARD_HAAS700
#include "udisplay.h"
#endif
int32_t aos_hal_lcd_init(void)
{
#ifndef AOS_BOARD_HAAS700
return udisplay_init();
#else
return -1;
#end... | YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/peripheral/aos_hal_lcd.c | C | apache-2.0 | 820 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <aos/errno.h>
#include "aos_hal_pwm.h"
#ifndef AOS_BOARD_HAAS700
#include <aos/pwm.h>
#endif
#define NS_PER_SEC (1000000000UL)
#define DIV_ROUND... | YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/peripheral/aos_hal_pwm.c | C | apache-2.0 | 3,246 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#include <stdio.h>
#include "aos_hal_rtc.h"
int32_t aos_hal_rtc_init(rtc_dev_t *rtc)
{
//return hal_rtc_init(rtc);
}
int32_t aos_hal_rtc_get_time(rtc_dev_t *rtc, rtc_time_t *time)
{
//return hal_rtc_get_time(rtc, time);
}
int32_t aos_hal_rtc_se... | YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/peripheral/aos_hal_rtc.c | C | apache-2.0 | 499 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#include <stdio.h>
#include <aos/errno.h>
#ifndef AOS_BOARD_HAAS700
#include <vfsdev/spi_dev.h>
#endif
#include "aos/hal/spi.h"
#include "aos_hal_spi.h"
int32_t aos_hal_spi_init(spi_dev_t *spi)
{
#ifndef AOS_BOARD_HAAS700
return hal_spi_init(spi);
#e... | YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/peripheral/aos_hal_spi.c | C | apache-2.0 | 1,736 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <aos/errno.h>
#include "aos_hal_timer.h"
#ifndef AOS_BOARD_HAAS700
#include <vfsdev/timer_dev.h>
#endif
int32_t aos_hal_timer_init(timer_dev_t *... | YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/peripheral/aos_hal_timer.c | C | apache-2.0 | 3,536 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#include <stdio.h>
#include <unistd.h>
#include <limits.h>
#include <poll.h>
#include <errno.h>
#ifndef AOS_BOARD_HAAS700
#include <vfsdev/uart_dev.h>
#endif
#include "aos/hal/uart.h"
#include "aos/kernel.h"
#include "aos_hal_uart.h"
#ifdef CONFIG_UART_N... | YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/peripheral/aos_hal_uart.c | C | apache-2.0 | 4,479 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <aos/errno.h>
#include "aos_hal_wdg.h"
#ifndef AOS_BOARD_HAAS700
#include <vfsdev/wdg_dev.h>
#endif
int32_t aos_hal_wdg_init(wdg_dev_t *wdg)
{
#... | YifuLiu/AliOS-Things | components/amp_adapter/platform/aos/peripheral/aos_hal_wdg.c | C | apache-2.0 | 2,135 |
#include "amp_platform.h"
#include "aos_system.h"
#include "ota_agent.h"
void internal_sys_upgrade_start(void *ctx)
{
ota_service_start((ota_service_t *)ctx);
aos_task_exit(0);
return;
}
| YifuLiu/AliOS-Things | components/amp_adapter/platform/esp_idf/amp_ota_port.c | C | apache-2.0 | 201 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include "aos_hal_adc.h"
#include "driver/gpio.h"
#include "driver/adc.h"
uint8_t adc_bit_width;
uint8_t adc_atten_value;
typedef enum {
ESP32_GPIO... | YifuLiu/AliOS-Things | components/amp_adapter/platform/esp_idf/peripheral/aos_hal_adc.c | C | apache-2.0 | 7,452 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#include <stdio.h>
#include "aos_hal_flash.h"
#include "esp_partition.h"
static hal_logic_partition_t default_partitions[HAL_PARTITION_MAX];
int32_t hal_partition_to_esp_partition_type(hal_partition_t in_partition, esp_partition_type_t *type, esp_partit... | YifuLiu/AliOS-Things | components/amp_adapter/platform/esp_idf/peripheral/aos_hal_flash.c | C | apache-2.0 | 3,466 |
#include <errno.h>
#include <driver/gpio.h>
#include <aos_hal_gpio_internal.h>
int32_t aos_hal_gpio_init(aos_hal_gpio_dev_t *gpio)
{
gpio_config_t config = { .intr_type = GPIO_INTR_DISABLE, };
if (!gpio)
return -EINVAL;
config.pin_bit_mask = (uint64_t)1 << gpio->port;
switch (gpio->config) {... | YifuLiu/AliOS-Things | components/amp_adapter/platform/esp_idf/peripheral/aos_hal_gpio.c | C | apache-2.0 | 4,362 |
#include <aos_hal_i2c_internal.h>
#include <driver/i2c.h>
#include <errno.h>
#include "esp_log.h"
#include "hal/i2c_ll.h"
#define TAG "i2c"
int32_t aos_hal_i2c_init(aos_hal_i2c_dev_t *i2c)
{
i2c_config_t config = {
.sda_pullup_en = true,
.scl_pullup_en = true,
/* remove as not supported b... | YifuLiu/AliOS-Things | components/amp_adapter/platform/esp_idf/peripheral/aos_hal_i2c.c | C | apache-2.0 | 9,415 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#include "aos_hal_pwm.h"
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include "driver/ledc.h"
bool pwm_inited = false;
int chan_gpio[LEDC_CHANNEL_MAX];
// Params for PW operation
// 5khz
#define... | YifuLiu/AliOS-Things | components/amp_adapter/platform/esp_idf/peripheral/aos_hal_pwm.c | C | apache-2.0 | 4,645 |
#include <aos_hal_spi_internal.h>
#include <driver/spi_common.h>
#include <driver/spi_master.h>
#include <errno.h>
#include <stdlib.h>
#include "esp_log.h"
#define TAG "SPI"
#if defined CONFIG_IDF_TARGET_ESP32C3
#define PIN_NUM_MISO 2
#define PIN_NUM_MOSI 7
#define PIN_NUM_CLK 6
#define PIN_NUM_CS 10
#el... | YifuLiu/AliOS-Things | components/amp_adapter/platform/esp_idf/peripheral/aos_hal_spi.c | C | apache-2.0 | 8,233 |
#include "esp_system.h"
void aos_hal_reboot(void)
{
esp_restart();
}
char g_chip_id[32];
const char *aos_get_device_name(void)
{
uint8_t mac[32] = {0};
extern esp_err_t esp_read_mac(uint8_t *mac, esp_mac_type_t type);
esp_read_mac(mac, ESP_MAC_WIFI_STA);
memset(g_chip_id, 0, 32);
snprintf(g_ch... | YifuLiu/AliOS-Things | components/amp_adapter/platform/esp_idf/peripheral/aos_hal_system.c | C | apache-2.0 | 438 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include "aos_hal_timer_internal.h"
#include "driver/timer.h"
#include "hal/timer_ll.h"
#define TIMER_INTR_SEL TIMER_INTR_LEVEL
#define TIMER_DIVIDER 8
... | YifuLiu/AliOS-Things | components/amp_adapter/platform/esp_idf/peripheral/aos_hal_timer.c | C | apache-2.0 | 3,575 |
#include <errno.h>
#include <driver/uart_select.h>
#include <aos_hal_uart_internal.h>
#include "esp_log.h"
#include <soc/uart_caps.h>
#if defined CONFIG_IDF_TARGET_ESP32C3
#define GPIO_UART_TXD_OUT (9)
#define GPIO_UART_RXD_IN (3)
#elif defined CONFIG_IDF_TARGET_ESP32S3
#define GPIO_UART_TXD_OUT (41)
#define GPIO_... | YifuLiu/AliOS-Things | components/amp_adapter/platform/esp_idf/peripheral/aos_hal_uart.c | C | apache-2.0 | 5,519 |
/*
* Copyright (C) 2015-2021 Alibaba Group Holding Limited
*/
#include <stdint.h>
#include <stdbool.h>
#include <aos/errno.h>
#include <aos_hal_wdg.h>
#include <esp_task_wdt.h>
#include <esp_err.h>
static inline int32_t esp_err_to_std(esp_err_t error)
{
switch (error) {
case ESP_OK:
return 0;
ca... | YifuLiu/AliOS-Things | components/amp_adapter/platform/esp_idf/peripheral/aos_hal_wdg.c | C | apache-2.0 | 1,619 |
/*
* Copyright (C) 2015-2019 Alibaba Group Holding Limited
*/
#include "aos/kv.h"
#include "aos_system.h"
#define MOD_STR "APP_MGR"
static char app_version[32] = { 0 };
pthread_t system_reboot_thread;
void system_reboot(void *argv)
{
usleep(1000 * 1000);
esp_restart();
}
int pyamp_app_upgrade(char *url)
{... | YifuLiu/AliOS-Things | components/amp_adapter/platform/esp_idf/peripheral/app_ota.c | C | apache-2.0 | 1,947 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#ifndef __AMP_BOARD_CONFIG_H__
#define __AMP_BOARD_CONFIG_H__
#define AMP_BOOT_UART_PORT 0
#define AMP_BOOT_UART_BAUDRATE 1500000UL
#define AMP_REPL_UART_PORT 0
#define AMP_REPL_UART_BAUDRATE 1500000UL
#define AMP_STATUS_IO 40
#de... | YifuLiu/AliOS-Things | components/amp_adapter/platform/linux/amp_board_config.h | C | apache-2.0 | 355 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#include "amp_board_config.h"
#define AMP_FS_ROOT_DIR "./test/"
/* js engine low memory enabled */
// #define AMP_LOWMEMORY_ENABLE
/* manager channel */
// #define AMP_NETWORK_ENABLE
/* das(device security) service */
// #define AMP_DAS_ENABLED
/* nt... | YifuLiu/AliOS-Things | components/amp_adapter/platform/linux/amp_config.h | C | apache-2.0 | 2,179 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#include "stdio.h"
#include <stdlib.h>
#include <stdbool.h>
#include <sys/socket.h>
#include <fcntl.h>
#include <unistd.h>
| YifuLiu/AliOS-Things | components/amp_adapter/platform/linux/amp_platform.h | C | apache-2.0 | 189 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#include <stdio.h>
#include <dirent.h>
#include "amp_config.h"
#include "amp_platform.h"
#include "aos_system.h"
#include "aos_fs.h"
#include "aos/vfs.h"
int aos_fs_init(void)
{
return 0;
}
int aos_open(const char *path, int flags)
{
return ope... | YifuLiu/AliOS-Things | components/amp_adapter/platform/linux/aos_fs.c | C | apache-2.0 | 3,363 |
/*
* Copyright (C) 2015-2020 Alibaba Group Holding Limited
*/
#include <stdio.h>
#include <dirent.h>
#include <string.h>
#include "amp_config.h"
#include "amp_platform.h"
#include "aos_system.h"
#include "aos/kv.h"
#include <stdio.h>
#include <sys/stat.h>
#define LEN 128
char tmp_key[LEN] = {0};
char tmp_val[LEN] =... | YifuLiu/AliOS-Things | components/amp_adapter/platform/linux/aos_kv.c | C | apache-2.0 | 903 |
#include "amp_config.h"
#include "aos_system.h"
#include "amp_defines.h"
#include "ota_agent.h"
#include "ota_import.h"
#include "app_upgrade.h"
void app_js_stop()
{
}
int ota_install_jsapp(void *ota_ctx, char *store_file, int store_file_len, char *install_path)
{
return 0;
}
int ota_verify_fsfile(ota_boot_param_t... | YifuLiu/AliOS-Things | components/amp_adapter/platform/linux/aos_ota.c | C | apache-2.0 | 1,573 |