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) 2015-2020 Alibaba Group Holding Limited */ #include <stdlib.h> #include "aos/hal/flash.h" #include "cmsis_os.h" #include "cmsis.h" #include "hal_trace.h" #include "hal_norflash.h" #define BES_HAL_DEBUG 0 #include "app_hal.h" #include "ota_port.h" #define FLASH_PAGE_SIZE_IN_BYTES 256 extern const...
YifuLiu/AliOS-Things
hardware/chip/haas1000/hal/flash.c
C
apache-2.0
21,934
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include <string.h> #include "aos/hal/gpio.h" #include "hal_gpio.h" #include "hal_trace.h" struct gpio_irq_handler { uint8_t port; gpio_irq_handler_t func; void *arg; }; static struct gpio_irq_handler bes_gpio_irq...
YifuLiu/AliOS-Things
hardware/chip/haas1000/hal/gpio.c
C
apache-2.0
7,325
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include "aos/hal/i2c.h" #include "hal_i2c.h" #include "app_hal.h" #include "aos/kernel.h" #include "hal_trace.h" aos_mutex_t i2c_mutex; static bool mutex_init = false; /*#define I2C1_IOMUX_INDEX 22*/ /** * Initialises an I2C interfa...
YifuLiu/AliOS-Things
hardware/chip/haas1000/hal/i2c.c
C
apache-2.0
9,755
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include "aos/hal/i2s.h" /** * Initialises a I2S dev * * @param[in] i2s the dev which should be initialised * * @return 0 : on success, EIO : if an error occurred with any step */ int32_t hal_i2s_init(i2s_dev_t *i2s) { return 0; } /** * Tran...
YifuLiu/AliOS-Things
hardware/chip/haas1000/hal/i2s.c
C
apache-2.0
2,181
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include "aos/hal/interpt.h" /** * Interrupt vector init * * @return 0 : on success, -1 : if an error occurred with any step */ int32_t hal_interpt_init(void) { return 0; } /** * Mask specified interrupt vector * * * @param[in] vec specifie...
YifuLiu/AliOS-Things
hardware/chip/haas1000/hal/interpt.c
C
apache-2.0
967
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include "aos/hal/nand.h" /** * Initialises a nand flash interface * * @param[in] nand the interface which should be initialised * * @return 0 : on success, EIO : if an error occurred with any step */ int32_t hal_nand_init(nand_dev_t *nand) { r...
YifuLiu/AliOS-Things
hardware/chip/haas1000/hal/nand.c
C
apache-2.0
2,700
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include "aos/hal/nor.h" /** * Initialises a nor flash interface * * @param[in] nor the interface which should be initialised * * @return 0 : on success, EIO : if an error occurred with any step */ int32_t hal_nor_init(nor_dev_t *nor) { return...
YifuLiu/AliOS-Things
hardware/chip/haas1000/hal/nor.c
C
apache-2.0
2,109
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include "aos/hal/pwm.h" #include "hal_pwm.h" #include "hal_gpio.h" #include "hal_trace.h" #include "hal_iomux.h" #include "hal_cmu.h" #include "pmu.h" #define _HAL_PWM_MAX_NUM 4 static struct HAL_IOMUX_PIN_FUNCTION_MAP pinmux_pwm[_HAL_PWM_MAX_NUM] = { ...
YifuLiu/AliOS-Things
hardware/chip/haas1000/hal/pwm.c
C
apache-2.0
4,610
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include "aos/hal/qspi.h" /** * Initialises the QSPI interface for a given QSPI device * * @param[in] qspi the spi device * * @return 0 : on success, EIO : if an error occurred */ int32_t hal_qspi_init(qspi_dev_t *qspi) { return 0; } /** * Q...
YifuLiu/AliOS-Things
hardware/chip/haas1000/hal/qspi.c
C
apache-2.0
2,228
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include "aos/hal/rng.h" /** * Fill in a memory buffer with random data * * @param[in] random the random device * @param[out] inBuffer Point to a valid memory buffer, this function will fill * in this memory w...
YifuLiu/AliOS-Things
hardware/chip/haas1000/hal/rng.c
C
apache-2.0
586
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include "aos/hal/rtc.h" /** * This function will initialize the on board CPU real time clock * * * @param[in] rtc rtc device * * @return 0 : on success, EIO : if an error occurred with any step */ int32_t hal_rtc_init(rtc_dev_t *rtc) { retur...
YifuLiu/AliOS-Things
hardware/chip/haas1000/hal/rtc.c
C
apache-2.0
1,239
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include <errno.h> #include "aos/hal/sd.h" #include "hal_sdmmc.h" #include "hal_iomux.h" #include "hal_iomux_haas1000.h" #include "hal_gpio.h" #include "hal_trace.h" static struct HAL_IOMUX_PIN_FUNCTION_MAP sd_pinmux[] = { {HAL_IOMUX_PIN_P1_2, HAL_IOMUX...
YifuLiu/AliOS-Things
hardware/chip/haas1000/hal/sd.c
C
apache-2.0
4,712
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include "aos/hal/spi.h" #include "hal_iomux.h" #include "hal_spi.h" #include "hal_trace.h" #include "hal_gpio.h" #include "hal_iomux_haas1000.h" #include "hal_cache.h" #include "cmsis_os.h" #include "cmsis.h" #define SPI_DMA_MAX 4095 osSemaphoreDef(spi...
YifuLiu/AliOS-Things
hardware/chip/haas1000/hal/spi.c
C
apache-2.0
16,444
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include "aos/hal/timer.h" #define IGNORE_HAL_TIMER_RAW_API_CHECK #include "hal_timer_raw.h" #define BES_HAL_DEBUG 0 #include "app_hal.h" #undef hal_timer_start #undef hal_timer_stop #include "hal_trace.h" static timer_dev_t _tim; static void oneshot_ti...
YifuLiu/AliOS-Things
hardware/chip/haas1000/hal/timer.c
C
apache-2.0
3,538
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include "cmsis.h" #include "cmsis_os.h" #define BES_HAL_DEBUG 0 #include "aos/kernel.h" #include "k_api.h" #include "app_hal.h" #include "aos/errno.h" #include "aos/hal/uart.h" #include "ulog/ulog.h" #include "hal_uart.h" #include "hal_trace.h" #inclu...
YifuLiu/AliOS-Things
hardware/chip/haas1000/hal/uart.c
C
apache-2.0
19,240
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include "aos/hal/usbd.h" /* Initialization */ /******************************************************************************************/ /** * @brief Initialize usb device driver * * @param[in] pdev point to usb device handler * * @return the ...
YifuLiu/AliOS-Things
hardware/chip/haas1000/hal/usbd.c
C
apache-2.0
5,784
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include "aos/hal/usbh.h" /** * @brief Initialize The USB Host Controller * * @param[in] phost pointer to the usb host handler * @param[in] phcd pointer to the usb hcd pointer * * @return 0:success, otherwise is failed */ int hal_usbh_init(v...
YifuLiu/AliOS-Things
hardware/chip/haas1000/hal/usbh.c
C
apache-2.0
2,752
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include "aos/hal/wdg.h" #include "watchdog.h" /** * This function will initialize the on board CPU hardware watch dog * * @param[in] wdg the watch dog device * * @return 0 : on success, EIO : if an error occurred with any step */ int32_t hal_wd...
YifuLiu/AliOS-Things
hardware/chip/haas1000/hal/wdg.c
C
apache-2.0
817
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include <drivers/u_ld.h> #include <vfsdev/wifi_dev.h> #if(AOS_COMP_USERVICE > 0) #include <uservice/uservice.h> #include <uservice/eventid.h> #endif #include <aos/hal/wifi.h> #if LWIP_ETHERNETIF && !LWIP_SUPPORT #include <lwip/def.h> #include <lwip/netdb...
YifuLiu/AliOS-Things
hardware/chip/haas1000/hal/wifi_port.c
C
apache-2.0
25,309
#!/usr/bin/env python import os, sys, re, time, json from flash_program_ll import burn_bin_files try: import serial from serial.tools import miniterm except: print("\nNot found pyserial, please install it by: \nsudo python%d -m pip install pyserial" % (sys.version_info.major)) sys.exit(-1) def get_bin...
YifuLiu/AliOS-Things
hardware/chip/haas1000/release/aos_burn_tool/flash_program.py
Python
apache-2.0
4,144
#!/usr/bin/env python import os, sys, re, time from ymodem import YModem try: import serial from serial.tools import miniterm except: print("\nNot found pyserial, please install it by: \nsudo python%d -m pip install pyserial" % (sys.version_info.major)) sys.exit(-1) def match_and_send(serialport, patt...
YifuLiu/AliOS-Things
hardware/chip/haas1000/release/aos_burn_tool/flash_program_ll.py
Python
apache-2.0
6,928
#! /usr/bin/env python # -*- coding: utf-8 -*- """ MIT License Copyright (c) 2018 Alex Woo 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 Software without restriction, including without limitation the ri...
YifuLiu/AliOS-Things
hardware/chip/haas1000/release/aos_burn_tool/ymodem.py
Python
apache-2.0
18,742
#! /usr/bin/env python import os import platform import argparse import sys import shutil print(sys.argv) parser = argparse.ArgumentParser() parser.add_argument('--target', dest='target', action='store') args = parser.parse_args() mypath = os.path.dirname(sys.argv[0]) os.chdir(mypath) print(os.getcwd()) target = arg...
YifuLiu/AliOS-Things
hardware/chip/haas1000/release/auto_build_tool/build_bin.py
Python
apache-2.0
2,265
EXTRA_POST_BUILD_TARGETS += gen_2ndboot_images MODULE_LIB_PATH = out/$(APP_FULL)@$(PLATFORM)/libraries/ DST_LIB_PATH = ./$($(HOST_MCU_FAMILY)_LOCATION)/drivers/tests/ota_boot_secboot/lib/ gen_2ndboot_images: echo "gen 2ndboot image" cp $(MODULE_LIB_PATH)/mcu_haas1000.a $(DST_LIB_PATH)/mcu_haas1000.a cp $(MODULE_LI...
YifuLiu/AliOS-Things
hardware/chip/haas1000/release/auto_build_tool/haas1000_2ndboot_genbin.mk
Makefile
apache-2.0
578
#!/usr/bin/python # -*- coding: utf-8 -*- #本文件位于\AliOS-Things\platform\mcu\haas1000\release\auto_build_tool文件夹下 #本文件用于适配python3.x版本,在3.7.3版本下测试通过。其他版本未测试。 #修改本文件的目的是解决3.x版本下,使用aos make命令编译固件时发生的两个错误 #第一个错误是“missing parentheses in call to 'print'” #第二个错误是“module ‘string’ has no attribute 'find'" #与阿里云提供的haashaa...
YifuLiu/AliOS-Things
hardware/chip/haas1000/release/auto_build_tool/haas1000_genbin.py
Python
apache-2.0
17,324
.\mklittlefs.exe -c ..\\..\\prebuild\\data\\ -d 5 -b 4096 -p 1198 -s 4907008 ..\\..\\prebuild\\littlefs.bin
YifuLiu/AliOS-Things
hardware/chip/haas1000/release/auto_build_tool/haas1000_genfs.bat
Batchfile
apache-2.0
107
#!/usr/bin/env bash if [ "$(uname)" = "Darwin" ]; then ./mklittlefs_osx -c ../../prebuild/data/ -d 5 -b 4096 -p 1198 -s 4907008 ../../prebuild/littlefs.bin elif [ "$(expr substr $(uname -s) 1 5)" = "Linux" ]; then ./mklittlefs_linux -c ../../prebuild/data/ -d 5 -b 4096 -p 1198 -s 4907008 ../../prebuild/littlefs.bin ...
YifuLiu/AliOS-Things
hardware/chip/haas1000/release/auto_build_tool/haas1000_genfs.sh
Shell
apache-2.0
394
EXTRA_POST_BUILD_TARGETS += gen_mklitlefs_data GEN_MK_DATA_FILE:= haas1000_genfs.sh gen_mklitlefs_data: echo "make littlefs" cd ./$($(HOST_MCU_FAMILY)_LOCATION)release/auto_build_tool/ && ./$(GEN_MK_DATA_FILE) echo "make littlefs done"
YifuLiu/AliOS-Things
hardware/chip/haas1000/release/auto_build_tool/haas1000_littlefs.mk
Makefile
apache-2.0
245
#! /usr/bin/env python3 import os, sys, re, struct, platform, getopt, subprocess from sys import platform as _platform import array,hashlib,struct def update_crc16(crcin, byte): crc = crcin calculen = byte | 0x100 crc <<= 1 calculen <<= 1 if calculen & 0x100 > 0: crc += 1 if crc & 0x10...
YifuLiu/AliOS-Things
hardware/chip/haas1000/release/auto_build_tool/ota_gen_md5_bin.py
Python
apache-2.0
3,481
linux_only_targets="" windows_only_targets=""
YifuLiu/AliOS-Things
hardware/chip/haas1000/ucube.py
Python
apache-2.0
46
#include "rec_pub.h" #include "ameba_soc.h" #include "build_info.h" #include "strproc.h" #include "system_8195a.h" void aos_2boot_os_entry() { uint8_t buf[0x30]; uint32_t bd_addr = 0; uint32_t bd_len = 0; uint32_t partition_start_addr; uint32_t os_entry_section_addr[2] = {0, 0}; hal_logic_partition_t *app_logic...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/2nd_boot/boot_startup.c
C
apache-2.0
2,871
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include "rec_flash.h" #include "flash_api.h" #include "hal_platform.h" static flash_t flash_obj; /* Logic partition on flash devices */ extern const hal_logic_partition_t hal_partitions[]; extern const size_t hal_partitions_amount; static void flash_re...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/2nd_boot/rec_flash.c
C
apache-2.0
1,316
#ifndef __REC_FLASH_H__ #define __REC_FLASH_H__ #include "rec_pub.h" #define REG_READ(addr) *((volatile UINT32 *)(addr)) #define REG_WRITE(addr, _data) (*((volatile UINT32 *)(addr)) = (_data)) #define MODE_STD 0 #define MODE_DUAL ...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/2nd_boot/rec_flash.h
C
apache-2.0
2,713
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ /* * 该头文件用于为recovery屏蔽平台差异 */ #ifndef _REC_HAL_H_ #define _REC_HAL_H_ #define FLASH_SECTOR_SIZE 0x1000 #define SECTOR_SIZE 0x1000 #define SPLICT_SIZE 0x10000 #define SPLISE_NUM (1024*1024/SPLICT_SIZE) // OTA 分区1M #define OTA_ADD...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/2nd_boot/rec_hal.h
C
apache-2.0
449
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include "rec_sys.h" #include "sys_api.h" void rec_delayms(volatile int timesMS) { DelayMs(timesMS); } void rec_hal_init() { rec_uart_init(); rec_flash_init(); } void rec_err_print(void *errinfo) { printf("rec Exception.\r\n"); } void rec_...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/2nd_boot/rec_sys.c
C
apache-2.0
716
#ifndef __REC_SYS_H__ #define __REC_SYS_H__ #include "rec_pub.h" /* ICU MACROS */ #define REG_ICU_BASE_ADDR (0x00802000UL) #define REG_ICU_PERI_CLK_PWD_ADDR (REG_ICU_BASE_ADDR + 0x2 * 4) #define REG_ICU_PERI_CLK_PWD_MASK 0x000BFFFFUL #define REG_ICU_PERI_CLK_PWD ...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/2nd_boot/rec_sys.h
C
apache-2.0
1,387
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include "rec_uart.h" #include "serial_api.h" #define UART_BUFF_LEN 1032 static unsigned char uart_buf[UART_BUFF_LEN]; static unsigned int uart_buf_write_index = 0; static unsigned int uart_buf_read_index = 0; void rec_uart_printf(const char *fmt, .....
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/2nd_boot/rec_uart.c
C
apache-2.0
1,794
#ifndef __REC_UART_H__ #define __REC_UART_H__ #include "rec_pub.h" #endif // __REC_UART_H__
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/2nd_boot/rec_uart.h
C
apache-2.0
98
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include "rec_sys.h" #include "sys_api.h" void rec_wdt_init(unsigned int timeout_ms) { watchdog_init(timeout_ms); } void rec_wdt_start() { watchdog_start(); } void rec_wdt_stop() { watchdog_stop(); } void rec_wdt_feed() { watchdog_refr...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/2nd_boot/rec_wdt.c
C
apache-2.0
328
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include "CheckSumUtils.h" uint8_t UpdateCRC8(uint8_t crcIn, uint8_t byte) { uint8_t crc = crcIn; uint8_t i; crc ^= byte; for (i = 0; i < 8; i++) { if (crc & 0x01) { crc = (crc >> 1) ^ 0x8C; } else { ...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/CheckSumUtils.c
C
apache-2.0
1,867
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #ifndef __CheckSumUtils_h__ #define __CheckSumUtils_h__ #include <stdint.h> #include <stdbool.h> #include <stdlib.h> #include <stdio.h> /******************CRC-8 XMODEM x8+x5+x4+1****************************** *************************************...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/CheckSumUtils.h
C
apache-2.0
2,395
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #ifndef AOS_DEBUG_H #define AOS_DEBUG_H #ifdef __cplusplus extern "C" { #endif #define SHORT_FILE __FILENAME__ #define debug_print_assert(A,B,C,D,E,F) #if (!defined(unlikely)) #define unlikely(EXPRESSSION) !!(EXPRESSSION) #endif /* * Check that an e...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/aos/aos_debug.h
C
apache-2.0
16,130
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ //#include <autoconf.h> #include <osdep_service.h> #include <stdio.h> #include <alios/wrapper.h> #include "aos/kernel.h" #include <aos/errno.h> #include <freertos_pmu.h> #include "k_api.h" /********************* os depended utilities ********************/...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/aos/aos_osdep.c
C
apache-2.0
21,549
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #ifndef __AOS_OSDEP_SERVICE_H_ #define __AOS_OSDEP_SERVICE_H_ #include "dlist.h" #include "aos/kernel.h" #include <k_api.h> // -------------------------------------------- // Platform dependent include file // -------------------------------------------- ...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/aos/aos_osdep.h
C
apache-2.0
3,156
/** * @file * Ethernet Interface Skeleton * */ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistribution...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/aos/ethernetif.c
C
apache-2.0
10,967
#ifndef __ETHERNETIF_H__ #define __ETHERNETIF_H__ #include "lwip/err.h" #include "lwip/netif.h" //----- ------------------------------------------------------------------ // Ethernet Buffer //----- ------------------------------------------------------------------ struct eth_drv_sg { unsigned int buf; unsign...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/aos/ethernetif.h
C
apache-2.0
625
#ifndef _GPIO_QC_TEST_H #define _GPIO_QC_TEST_H typedef struct { uint8_t output_pin; uint8_t input_pin; } qc_test_gpio_pair_t; #endif
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/aos/gpio_test.h
C
apache-2.0
154
#include <string.h> #include <aos/flashpart.h> #include "ota_port.h" #include "cmsis.h" #include "sys_api.h" #include "rtl8721d_ota.h" int ota_get_bootinfo(struct ota_boot_info *info, enum bootinfo_zone zone) { return 0; } int ota_set_bootinfo_crc32value(struct ota_boot_info *info) { return 0; } int ota_set...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/aos/ota_port.c
C
apache-2.0
3,078
/** * Copyright (C) 2019 Alibaba.inc, All rights reserved. * * @file: ota_port.h * @brief: vendor ota interface * @author: * @date: 2019/12/16 * @version: 1.0 */ #ifndef _TG_VENDOR_OTA_H_ #define _TG_VENDOR_OTA_H_ #include <aos/hal/flash.h> #ifdef __cplusplus extern "C" { #endif #define OTA_BOOT_INF...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/aos/ota_port.h
C
apache-2.0
3,051
#include <sys/unistd.h> #include <sys/errno.h> #include <stdarg.h> #include "aos/hal/flash.h" #include "aos/hal/uart.h" #include "aos/hal/wifi.h" #include "CheckSumUtils.h" #include <wifi/wifi_conf.h> #include <wifi/wifi_util.h> #include <wifi/wifi_ind.h> static uart_dev_t qc_uart; extern uart_dev_t uart_0; #ifndef...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/aos/qc.c
C
apache-2.0
5,234
#include "aos/hal/gpio.h" #include "gpio_test.h" /****************************************************** * Variables Definitions ******************************************************/ extern const qc_test_gpio_pair_t qc_test_gpio_pairs[]; extern const int qc_test_gpio_pairs_num; static int g...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/aos/qc_gpio_test.c
C
apache-2.0
2,263
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include <k_api.h> #include <assert.h> #include <stdio.h> #include <sys/time.h> #include "diag.h" #include "ameba_soc.h" #include "build_info.h" //#include "strproc.h" #include "rtl8721d_system.h" #if AOS_COMP_CLI #include "aos/cli.h" #endif float soc_...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/aos/soc_impl.c
C
apache-2.0
3,938
/* * Copyright (C) 2020-2021 Alibaba Group Holding Limited */ #include <aos/flash_core.h> #include <objects.h> #include <PinNames.h> #include <pinmap.h> #include <ameba_soc.h> #include <drv/spiflash.h> typedef struct { aos_flash_t flash; uint32_t page_data_buf[256 / sizeof(uint32_t)]; } flash_rtl872xd_t; s...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/aos_adapter/flash.c
C
apache-2.0
4,372
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include <drv/pwm.h> #include <aos/pwm_core.h> #include "device.h" #include "objects.h" #include "pinmap.h" #define BIT_PWM_TIM_IDX_FLAG BIT(7) #define BIT_PWM_TIM_IDX_SHIFT 7 #define PWM_TIMER 5 #define DIV_ROUND_CLOSEST(x, divisor)( \ { ...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/aos_adapter/pwm.c
C
apache-2.0
7,052
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include <objects.h> #include <pinmap.h> #include <drv/uart.h> #include <aos/tty_core.h> typedef struct { aos_tty_t tty; UART_InitTypeDef params; uint8_t ier; } tty_uart_t; static const PinMap CSI_PinMap_UART_TX[] = { { PA_12, UART_3,...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/aos_adapter/uart.c
C
apache-2.0
12,267
/* * Copyright (c) 2001-2003 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright ...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/arch/cc.h
C
apache-2.0
4,754
/* * Copyright (c) 2001-2003 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright ...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/arch/cpu.h
C
apache-2.0
1,720
#ifndef __LWIP_INTF_H__ #define __LWIP_INTF_H__ #define LWIP_INTF_DEBUG #ifdef LWIP_INTF_DEBUG #define LWIP_INTF_PRT warning_prf #define LWIP_INTF_WARN warning_prf #define LWIP_INTF_FATAL fatal_prf #else #define LWIP_INTF_PRT null_prf #define LWIP_INTF_WARN null_prf #define LWIP_INTF_FATAL null...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/arch/lwip_intf.h
C
apache-2.0
348
/* * Copyright (c) 2001-2003 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright not...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/arch/lwipopts.h
C
apache-2.0
15,492
#ifndef _TYPEDEF_H_ #define _TYPEDEF_H_ #include <stdint.h> #include <stdbool.h> typedef unsigned char UINT8; /* Unsigned 8 bit quantity */ typedef signed char INT8; /* Signed 8 bit quantity */ typedef unsigned short UINT16; /* Unsigned 16 bit quantity ...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/arch/typedef.h
C
apache-2.0
2,068
#! /usr/bin/env python import os import platform import argparse import sys import shutil print(sys.argv) parser = argparse.ArgumentParser() parser.add_argument('--target', dest='target', action='store') args = parser.parse_args() mypath = os.path.dirname(sys.argv[0]) os.chdir(mypath) print(os.getcwd()) target = arg...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/build_bin.py
Python
apache-2.0
1,369
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include <drv/adc.h> #include <aos/adc_csi.h> #include "objects.h" #include "PinNames.h" #include "pinmap.h" static const PinMap CSI_PinMap_ADC[] = { { PB_4, ADC_CH0, 0 }, { PB_5, ADC_CH1, 0 }, { PB_6, ADC_CH2, 0 }, { PB_7, ADC_CH3, 0 }, ...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/csi_driver/adc/adc.c
C
apache-2.0
5,835
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include "objects.h" #include "pinmap.h" #include "PinNames.h" #include <drv/gpio.h> #include <aos/gpioc_csi.h> static void user_interrupt_handler(csi_gpio_t *gpio, uint32_t id) { if (gpio->callback != NULL) { uint32_t pin_mask; pin_...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/csi_driver/gpio/gpio.c
C
apache-2.0
7,142
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include "objects.h" #include "PinNames.h" #include "pinmap.h" #include <drv/iic.h> static const PinMap CSI_PinMap_I2C_SCL[] = { {PA_25, (int32_t)I2C0_DEV, PIN_DATA(PullUp, PINMUX_FUNCTION_I2C)}, {NC, NC, 0...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/csi_driver/iic/iic.c
C
apache-2.0
13,461
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include <drv/pwm.h> #include <aos/pwm_csi.h> #include "device.h" #include "objects.h" #include "pinmap.h" #define BIT_PWM_TIM_IDX_FLAG BIT(7) #define BIT_PWM_TIM_IDX_SHIFT 7 #define PWM_TIMER 5 /* Table elements express the pin to PWM channel number, t...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/csi_driver/pwm/pwm.c
C
apache-2.0
5,044
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include <drv/spi.h> #include "objects.h" #include "PinNames.h" #include "pinmap.h" typedef struct csi_spi_pin { uint32_t spi_idx; PinName spi_mosi; PinName spi_miso; PinName spi_sclk; PinName spi_cs; } csi_spi_pin_t; static csi_spi_...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/csi_driver/spi/spi.c
C
apache-2.0
16,335
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include "objects.h" #include "PinNames.h" #include "pinmap.h" #include "ameba_soc.h" #include <drv/spiflash.h> #include <aos/mtd.h> #include <aos/mtdpart.h> #include <aos/hal/flash.h> csi_error_t csi_spiflash_spi_init(csi_spiflash_t *spiflash, uint32_t ...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/csi_driver/spiflash/spiflash.c
C
apache-2.0
7,486
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include "objects.h" #include <drv/timer.h> #define GTIMER_MAX 4 static void csi_gtimer_timeout_handler(uint32_t data) { csi_timer_t *timer = (csi_timer_t *)data; uint32_t tid = timer->dev.idx; RTIM_INTClear(TIMx[tid]); if (timer-...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/csi_driver/timer/timer.c
C
apache-2.0
2,984
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include <objects.h> #include <pinmap.h> #include <drv/uart.h> #define EVENT_RX_READY ((uint32_t)1 << 0) typedef struct { UART_InitTypeDef init_data; aos_event_t event; } uart_priv_t; static const PinMap CSI_PinMap_UART_TX[] = { { PA_12, ...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/csi_driver/uart/uart.c
C
apache-2.0
12,499
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include "objects.h" #include "ameba_soc.h" #include "cmsis.h" #include <drv/wdt.h> csi_error_t csi_wdt_init(csi_wdt_t *wdt, uint32_t idx) { if(!wdt) return CSI_ERROR; wdt->priv = (WDG_InitTypeDef *)malloc(sizeof(WDG_InitTy...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/csi_driver/wdt/wdt.c
C
apache-2.0
1,745
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # # Copyright (C) 2021 Alibaba Group Holding Limited """ Generate the bin files including ota bin and the final bin files for chip rtl872xd. """ import sys import os import shutil import subprocess import platform home_path = os.path.expanduser("~") toolchain_path = os....
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/gen_crc_bin.py
Python
apache-2.0
8,500
#include <stdint.h> #include "analogin_api.h" #include "aos/hal/adc.h" static analogin_t hal_adc[8]; static u32 adc_pin2chan[8][2]={ {PB_4, 0}, {PB_5, 1}, {PB_6, 2}, {PB_7, 3}, {PB_1, 4}, {PB_2, 5}, {PB_3, 6}, {VBAT_MEAS, 7} }; /** * Initialises an ADC interface, Pre...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/hal/adc.c
C
apache-2.0
1,906
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include <ulog/ulog.h> #include <string.h> #include <stdio.h> #include <aos/list.h> #include "audio_rtos.h" #include "control.h" #include "drv/gpio.h" #include "audio_internel.h" #define LOG_TAG "[haas200_audio]" pcm_stream_handler_t audio_stream_hdl...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/hal/audio.c
C
apache-2.0
10,381
/* * Copyright (C) 2015-2018 Alibaba Group Holding Limited */ #ifndef CONFIG_MESH_STACK_ALONE #include <bluetooth/bluetooth.h> #include <bluetooth/storage.h> #include <bluetooth/hci.h> #endif #include <aos/kernel.h> #include <aos/hal/flash.h> #include <aos/errno.h> #include "ble_port.h" #ifndef AOS_COMP_KV #defin...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/hal/ble_port.c
C
apache-2.0
3,808
/* * Copyright (C) 2015-2018 Alibaba Group Holding Limited */ #ifndef BLE_PORT_H #define BLE_PORT_H int ble_storage_init(void); #endif//BLE_PORT_H
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/hal/ble_port.h
C
apache-2.0
154
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ //#include "platform_peripheral.h" #include "aos/hal/flash.h" #include "board.h" #include "flash_api.h" #include "hal_platform.h" #define SPI_FLASH_SEC_SIZE 4096 /**< SPI Flash sector size */ #define ROUND_DOWN(a,b) (((a) / (b)) * (b)) flash_t fla...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/hal/flash.c
C
apache-2.0
4,131
/** ****************************************************************************** * @file paltform_gpio.c * @author William Xu * @version V1.0.0 * @date 05-May-2014 * @brief This file provide GPIO driver functions. ****************************************************************************** * * The MIT Li...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/hal/gpio.c
C
apache-2.0
6,588
#include <stdio.h> #include "aos/kernel.h" #include <k_api.h> #include <stdint.h> #include <stdbool.h> #include "board.h" #include "aos/hal/spi.h" #include "spi_api.h" #include "spi_ex_api.h" #include "pinmap.h" /*SPI pin location: * SPI0: * - S0: PA_16(MOSI)/PA_17(MISO)/PA_18(SCLK)/PA_19(CS). * - S1: PB_4(MOSI)...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/hal/hal_spi.c
C
apache-2.0
6,729
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include <stdio.h> #include <stdint.h> #include <string.h> #include "aos/kernel.h" #include "aos/hal/adc.h" #include "adc_test.h" static adc_dev_t adc_dev; static aos_timer_t gpio_test_timer; void adc_test_task(void *arg); void hal_adc_test(void) { ...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/hal/hal_test/adc/adc_test.c
C
apache-2.0
938
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #define PORT_ADC_TEST 0 void hal_adc_test(void);
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/hal/hal_test/adc/adc_test.h
C
apache-2.0
115
NAME := adc_test $(NAME)_MBINS_TYPE := app $(NAME)_VERSION := 0.0.1 $(NAME)_SUMMARY := testcase for adc $(NAME)_SOURCES += adc_test.c $(NAME)_CFLAGS += -Wall -Werror
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/hal/hal_test/adc/aos.mk
Makefile
apache-2.0
176
src = Split(''' adc_test.c ''') component = aos_component('adc_test', src) component.add_cflags('-Wall') component.add_cflags('-Werror')
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/hal/hal_test/adc/ucube.py
Python
apache-2.0
143
NAME := hal_test $(NAME)_MBINS_TYPE := app $(NAME)_VERSION := 0.0.1 $(NAME)_SUMMARY := testcase for hal $(NAME)_SOURCES += hal_test.c $(NAME)_CFLAGS += -Wall -Werror
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/hal/hal_test/aos.mk
Makefile
apache-2.0
175
NAME := dac_test $(NAME)_MBINS_TYPE := app $(NAME)_VERSION := 0.0.1 $(NAME)_SUMMARY := testcase for dac $(NAME)_SOURCES += dac_test.c $(NAME)_CFLAGS += -Wall -Werror
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/hal/hal_test/dac/aos.mk
Makefile
apache-2.0
176
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include <stdio.h> #include <stdint.h> #include <string.h> #include "aos/kernel.h" #include "aos/hal/dac.h" #include "dac_test.h" dac_dev_t dac_dev; void hal_dac_test(void) { int ret = -1; printf("*********** dac test start ! ***********\n"); ...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/hal/hal_test/dac/dac_test.c
C
apache-2.0
704
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #define PORT_DAC_TEST 0 void hal_dac_test(void);
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/hal/hal_test/dac/dac_test.h
C
apache-2.0
115
src = Split(''' dac_test.c ''') component = aos_component('dac_test', src) component.add_cflags('-Wall') component.add_cflags('-Werror')
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/hal/hal_test/dac/ucube.py
Python
apache-2.0
143
NAME := flash_test $(NAME)_MBINS_TYPE := app $(NAME)_VERSION := 0.0.1 $(NAME)_SUMMARY := testcase for flash $(NAME)_SOURCES += flash_test.c $(NAME)_CFLAGS += -Wall -Werror
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/hal/hal_test/flash/aos.mk
Makefile
apache-2.0
182
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include <stdint.h> #include <stdio.h> #include <string.h> #include "aos/kernel.h" #include "aos/hal/flash.h" #include "flash_test.h" #define TEST_BUFFER_WORDS 512 uint16_t flash_test_buffer[TEST_BUFFER_WORDS]; void hal_flash_test(void) { int ...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/hal/hal_test/flash/flash_test.c
C
apache-2.0
3,006
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #define HAL_PARTITION_TEST HAL_PARTITION_PARAMETER_3 void hal_flash_test(void);
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/hal/hal_test/flash/flash_test.h
C
apache-2.0
146
src = Split(''' flash_test.c ''') component = aos_component('flash_test', src) component.add_cflags('-Wall') component.add_cflags('-Werror')
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/hal/hal_test/flash/ucube.py
Python
apache-2.0
147
NAME := gpio_test $(NAME)_MBINS_TYPE := app $(NAME)_VERSION := 0.0.1 $(NAME)_SUMMARY := testcase for gpio $(NAME)_SOURCES += gpio_test.c $(NAME)_CFLAGS += -Wall -Werror
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/hal/hal_test/gpio/aos.mk
Makefile
apache-2.0
179
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include <stdint.h> #include <stdio.h> #include <string.h> #include "aos/kernel.h" #include "aos/hal/gpio.h" #include "gpio_test.h" static aos_timer_t gpio_test_timer; static aos_sem_t gpio_test_sem; static gpio_dev_t gpio_out; static gpio_dev_t gpi...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/hal/hal_test/gpio/gpio_test.c
C
apache-2.0
4,309
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #define PORT_GPIO_TEST_OUT 24 #define PORT_GPIO_TEST_IN 25 void hal_gpio_test(void);
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/hal/hal_test/gpio/gpio_test.h
C
apache-2.0
152
src = Split(''' gpio_test.c ''') component = aos_component('gpio_test', src) component.add_cflags('-Wall') component.add_cflags('-Werror')
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/hal/hal_test/gpio/ucube.py
Python
apache-2.0
145
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include <stdint.h> #include <stdio.h> #include <string.h> #include "aos/kernel.h" #include "aos/hal/uart.h" #include "yunit.h" extern void hal_uart_test(void); extern void hal_gpio_test(void); extern void hal_i2c_test(void); extern void hal_spi_test(vo...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/hal/hal_test/hal_test.c
C
apache-2.0
5,393
NAME := i2c_test $(NAME)_MBINS_TYPE := app $(NAME)_VERSION := 0.0.1 $(NAME)_SUMMARY := testcase for i2c $(NAME)_SOURCES += i2c_test.c $(NAME)_CFLAGS += -Wall -Werror
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/hal/hal_test/i2c/aos.mk
Makefile
apache-2.0
176
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include <stdio.h> #include <string.h> #include <stdint.h> #include "aos/kernel.h" #include "aos/hal/i2c.h" #include "aos/hal/rtc.h" #include "i2c_test.h" #define RTC_DATA_LEN 7 #define I2C_RTC_DELAY_MS 2000 #define I2C_RTC_TOLERANCE_RANGE 0.01f static...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/hal/hal_test/i2c/i2c_test.c
C
apache-2.0
4,148
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #define PORT_I2C_TEST 0 /* if the slave device addr is 0xFF,  and your mcu only need to set the addr to 0xFE, the last bit will be added by the hardware, set I2C_ADD_LSB_AUTO to 1. If your mcu will not add the last bit auto, you must set the addr t...
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/hal/hal_test/i2c/i2c_test.h
C
apache-2.0
423
src = Split(''' i2c_test.c ''') component = aos_component('i2c_test', src) component.add_cflags('-Wall') component.add_cflags('-Werror')
YifuLiu/AliOS-Things
hardware/chip/rtl872xd/hal/hal_test/i2c/ucube.py
Python
apache-2.0
143