mirror of
https://github.com/taubel/sdk-ameba-v4.0b-gcc.git
synced 2026-04-05 21:15:23 +00:00
initial commit
This commit is contained in:
commit
60a7afcc83
2528 changed files with 1001987 additions and 0 deletions
|
|
@ -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,49 @@
|
|||
/*
|
||||
* 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 "device.h"
|
||||
#include "gpio_api.h" // mbed
|
||||
#include "main.h"
|
||||
|
||||
#define GPIO_LED_PIN PA_5
|
||||
#define GPIO_PUSHBT_PIN PA_12
|
||||
|
||||
/**
|
||||
* @brief Main program.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
//int main_app(IN u16 argc, IN u8 *argv[])
|
||||
void main(void)
|
||||
{
|
||||
gpio_t gpio_led;
|
||||
gpio_t gpio_btn;
|
||||
|
||||
// Init LED control pin
|
||||
gpio_init(&gpio_led, GPIO_LED_PIN);
|
||||
gpio_dir(&gpio_led, PIN_OUTPUT); // Direction: Output
|
||||
gpio_mode(&gpio_led, PullNone); // No pull
|
||||
|
||||
// Initial Push Button pin
|
||||
gpio_init(&gpio_btn, GPIO_PUSHBT_PIN);
|
||||
gpio_dir(&gpio_btn, PIN_INPUT); // Direction: Input
|
||||
gpio_mode(&gpio_btn, PullUp); // Pull-High
|
||||
|
||||
while(1){
|
||||
if (gpio_read(&gpio_btn)) {
|
||||
// turn off LED
|
||||
gpio_write(&gpio_led, 0);
|
||||
}
|
||||
else {
|
||||
// turn on LED
|
||||
gpio_write(&gpio_led, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue