initial commit

This commit is contained in:
Tautvydas Belgeras 2018-06-05 16:16:17 +03:00
commit 60a7afcc83
2528 changed files with 1001987 additions and 0 deletions

View file

@ -0,0 +1,24 @@
.PHONY: all copy clean
#*****************************************************************************#
# Source FILE LIST #
#*****************************************************************************#
CSRC = src inc
#*****************************************************************************#
# RULES TO GENERATE TARGETS #
#*****************************************************************************#
# Define the Rules to build the core targets
all: copy
copy:
for cpf in $(CSRC); do \
cp -rf $$cpf ../..; \
done

View file

@ -0,0 +1,19 @@
Example Description
This example describes how to use Bor2 Brown-Out Reset.
Requirement Components:
a USB to TTL Adapter
Operating process:
- Remove R43 on the demo board
- Give 3.3V at pin that near the chip of J34 by power supply.
- Boot up device, and you will see the log"Supply 2.6V-3.0V voltage!!!"
- Change 3.3V to 2.6V-3.0V to trigger Bor2 Interrupt,and will call the registered "bor_intr_Handler"
- Recover voltage to 3.3V
Note:
- Never give 3.3V at the other pin of J34

View file

@ -0,0 +1,52 @@
include $(MAKE_INCLUDE_GEN)
#include ./Makefile.inc
.PHONY: all clean
CHIP = rtl8195a
HALINCDIR = realtek/v3_0/include
MODULE_IFLAGS += -I$(shell pwd -L)/../inc
MODULE_IFLAGS += -I$(SWLIBDIR)/api
MODULE_IFLAGS += -I$(SWLIBDIR)/api/mbed/hal/
MODULE_IFLAGS += -I$(SWLIBDIR)/api/mbed/api/
MODULE_IFLAGS += -I$(SWLIBDIR)/drivers/targets/cmsis/rtl8195a/
MODULE_IFLAGS += -I$(SWLIBDIR)/drivers/targets/hal/rtl8195a/
GLOBAL_CFLAGS += -DCONFIG_PLATFORM_8195A
#*****************************************************************************#
# Source FILE LIST #
#*****************************************************************************#
CSRC += main.c
#*****************************************************************************#
# Object FILE LIST #
#*****************************************************************************#
OBJS = $(CSRC:.c=.o)
#*****************************************************************************#
# Object FILE LIST #
#*****************************************************************************#
#OBJS = monitor.o rtl_consol.o
#*****************************************************************************#
# RULES TO GENERATE TARGETS #
#*****************************************************************************#
# Define the Rules to build the core targets
all: CORE_TARGETS COPY_RAM_OBJS
#*****************************************************************************#
# GENERATE OBJECT FILE
#*****************************************************************************#
CORE_TARGETS: $(OBJS)
#*****************************************************************************#
# GENERATE OBJECT FILE
#*****************************************************************************#
clean:
rm -f $(CSRC:.c=.o) $(CSRC:.c=.d) $(CSRC:.c=.i) $(CSRC:.c=.s)

View file

@ -0,0 +1,54 @@
/*
* Routines to access hardware
*
* Copyright (c) 2015 Realtek Semiconductor Corp.
*
* This module is a confidential and proprietary property of RealTek and
* possession or use of this module requires written permission of RealTek.
*/
#include "device.h"
#include "gpio_api.h" // mbed
#include "gpio_irq_api.h" // mbed
#include "sleep_ex_api.h"
#include "sys_api.h"
#include "diag.h"
#include "main.h"
void bor_intr_Handler(void)
{
DBG_8195A("bor_intr_handler!!!\n");
}
void bor2_test(void)
{
// mbed BOR2 test
BOR2_ModeSet(BOR2_INTR);
BOR2_INTRegister((void *)bor_intr_Handler);
BOR2_INTCmd(ENABLE);
DBG_8195A("Supply 2.6V-3.0V voltage!!!\n");
vTaskDelete(NULL);
}
void main(void)
{
// create demo Task
if(xTaskCreate( (TaskFunction_t)bor2_test, "BOR2 DEMO", (2048/4), NULL, (tskIDLE_PRIORITY + 1), NULL)!= pdPASS) {
DBG_8195A("Cannot create bor2 demo task\n\r");
goto end_demo;
}
#if defined(CONFIG_KERNEL) && !TASK_SCHEDULER_DISABLED
#ifdef PLATFORM_FREERTOS
vTaskStartScheduler();
#endif
#else
#error !!!Need FREERTOS!!!
#endif
end_demo:
while(1);
}