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 UART to communicate with PC.
Required Components:
USBtoTTL adapter
Connect to PC
- Connect Ground: connect to GND pin via USBtoTTL adapter
- Use UART0
GPIOA_18 as UART0_RX connect to TX of USBtoTTL adapter
GPIOA_23 as UART0_TX connect to RX of USBtoTTL adapter
Open Super terminal or teraterm and
set baud rate to 38400, 1 stopbit, no parity, no flow contorl.
This example shows:
1. The RX data ready interrupt service routine is used to receive characters from the PC, and then loopback them to the PC.
2. The TX done interrupt service routine will send a prompt string "8195a$" to the PC.

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,70 @@
/*
* 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 "serial_api.h"
#include "main.h"
/*UART pin location:
UART0:
PA_23 (TX)
PA_18 (RX)
*/
#define UART_TX PA_23
#define UART_RX PA_18
volatile char rc=0;
void uart_send_string(serial_t *sobj, char *pstr)
{
unsigned int i=0;
while (*(pstr+i) != 0) {
serial_putc(sobj, *(pstr+i));
i++;
}
}
void uart_irq(uint32_t id, SerialIrq event)
{
serial_t *sobj = (void*)id;
if(event == RxIrq) {
rc = serial_getc(sobj);
serial_putc(sobj, rc);
}
if(event == TxIrq && rc!=0){
uart_send_string(sobj, "\r\n8195a$");
rc = 0;
}
}
void main(void)
{
// sample text
serial_t sobj;
// mbed uart test
serial_init(&sobj,UART_TX,UART_RX);
serial_baud(&sobj,38400);
serial_format(&sobj, 8, ParityNone, 1);
uart_send_string(&sobj, "UART IRQ API Demo...\r\n");
uart_send_string(&sobj, "Hello World!!\n");
uart_send_string(&sobj, "\r\n8195a$");
serial_irq_handler(&sobj, uart_irq, (uint32_t)&sobj);
serial_irq_set(&sobj, RxIrq, 1);
serial_irq_set(&sobj, TxIrq, 1);
while(1);
}