mirror of
https://github.com/taubel/sdk-ameba-v4.0b-gcc.git
synced 2026-07-04 02:25:39 +00:00
initial commit
This commit is contained in:
commit
60a7afcc83
2528 changed files with 1001987 additions and 0 deletions
|
|
@ -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
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
Example Description
|
||||
|
||||
This example describes how to use the RTC API. The RTC function is implemented by an independent BCD timer/counter.
|
||||
|
||||
Behavior:
|
||||
This example will print out the time information every second.
|
||||
|
||||
|
|
@ -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)
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* Routines to access hardware
|
||||
*
|
||||
* Copyright (c) 2013 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 "rtc_api.h"
|
||||
#include "wait_api.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
time_t seconds;
|
||||
struct tm *timeinfo;
|
||||
|
||||
rtc_init();
|
||||
rtc_write(1256729737); // Set RTC time to Wed, 28 Oct 2009 11:35:37
|
||||
|
||||
while(1) {
|
||||
seconds = rtc_read();
|
||||
timeinfo = localtime(&seconds);
|
||||
|
||||
DBG_8195A("Time as seconds since January 1, 1970 = %d\n", seconds);
|
||||
|
||||
DBG_8195A("Time as a basic string = %s", ctime(&seconds));
|
||||
|
||||
DBG_8195A("Time as a custom formatted string = %d-%d-%d %d:%d:%d\n",
|
||||
timeinfo->tm_year, timeinfo->tm_mon, timeinfo->tm_mday, timeinfo->tm_hour,
|
||||
timeinfo->tm_min,timeinfo->tm_sec);
|
||||
|
||||
wait(1.0);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue