summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorJiaojinxing <jiaojinxing1987@gmail.com>2016-10-20 09:05:58 (GMT)
committer Jiaojinxing <jiaojinxing1987@gmail.com>2016-10-20 09:05:58 (GMT)
commitded0c1297c84948c40c10bb7422e86d55c91edf4 (patch)
treecf23753e0f627624df357ee59ed5866313edad4f
parentb6a12ed05d0530ac43b30a5547723a7801cd455a (diff)
downloadbspam335x-ded0c1297c84948c40c10bb7422e86d55c91edf4.zip
bspam335x-ded0c1297c84948c40c10bb7422e86d55c91edf4.tar.gz
bspam335x-ded0c1297c84948c40c10bb7422e86d55c91edf4.tar.bz2
Fixed audio driver bug and updated Makefiles.
-rw-r--r--.cproject77
-rw-r--r--.project77
-rw-r--r--.reproject13
-rw-r--r--.template/config.h44
-rw-r--r--.template/config.ld38
-rw-r--r--.template/config.mk41
-rw-r--r--.template/config.xml16
-rw-r--r--Makefile457
-rw-r--r--SylixOS/bsp/bspInit.c2
-rw-r--r--SylixOS/driver/audio/audioLib.c608
-rw-r--r--SylixOS/driver/audio/audioLib.h175
-rw-r--r--SylixOS/driver/audio/audioLibTest1.c150
-rw-r--r--SylixOS/driver/audio/audioLibTest2.c123
-rw-r--r--SylixOS/driver/audio/codec/tlv320aic3x/tlv320aic3x.c28
-rw-r--r--SylixOS/driver/audio/dsp/dspDrv.c47
-rw-r--r--SylixOS/driver/audio/dsp/dspDrv.h4
-rw-r--r--SylixOS/driver/mcasp/am335x_mcasp.c15
-rw-r--r--bspbeaglebone.mk187
-rw-r--r--bspok335xd.mk187
-rw-r--r--bspok335xs.mk187
-rw-r--r--config.lds2
-rw-r--r--config.mk17
22 files changed, 1817 insertions, 678 deletions
diff --git a/.cproject b/.cproject
index a8b863e..592ba28 100644
--- a/.cproject
+++ b/.cproject
@@ -1,66 +1,37 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
- <cconfiguration id="com.sylixos.realevo.toolChain.armsylixeabi.823775400">
- <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.sylixos.realevo.toolChain.armsylixeabi.823775400" moduleId="org.eclipse.cdt.core.settings" name="Default">
- <macros>
- <stringMacro name="SYLIXOS_TOOLCHAIN_PATH" type="VALUE_PATH_DIR" value="C:\ACOINFO\arm-sylixos-toolchain"/>
- <stringMacro name="SYLIXOS_TEMPLATE_ARCH" type="VALUE_TEXT" value="arm"/>
- <stringMacro name="SYLIXOS_TOOLCHAIN_VER" type="VALUE_TEXT" value="4.9.3"/>
- <stringMacro name="SYLIXOS_TOOLCHAIN_PREFIX" type="VALUE_TEXT" value="arm-sylixos-eabi"/>
- <stringMacro name="SYLIXOS_BASE_PATH" type="VALUE_PATH_DIR" value="D:/workspace/sylixos-base"/>
- <stringMacro name="SYLIXOS_TEMPLATE_NAME" type="VALUE_TEXT" value="arm-none"/>
- </macros>
+ <cconfiguration id="org.eclipse.cdt.core.default.config.855351316">
+ <storageModule buildSystemId="org.eclipse.cdt.core.defaultConfigDataProvider" id="org.eclipse.cdt.core.default.config.855351316" moduleId="org.eclipse.cdt.core.settings" name="Configuration">
<externalSettings/>
<extensions>
- <extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
- <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
</extensions>
</storageModule>
- <storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <configuration artifactName="${ProjName}" buildProperties="" description="" errorParsers="org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.VCErrorParser;org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.MakeErrorParser" id="com.sylixos.realevo.toolChain.armsylixeabi.823775400" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
- <folderInfo id="com.sylixos.realevo.toolChain.armsylixeabi.823775400.637875610" name="/" resourcePath="">
- <toolChain id="com.sylixos.realevo.toolChain.armsylixeabi.828488653" name="SylixOS Toolchain" superClass="com.sylixos.realevo.toolChain.armsylixeabi">
- <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.GNU_ELF" id="com.sylixos.realevo.targetPlatform.armsylixoseabi.150825304" isAbstract="false" name="SylixOS TagetPlagform" osList="all" superClass="com.sylixos.realevo.targetPlatform.armsylixoseabi"/>
- <builder id="com.sylixos.realevo.builder.armsylixeabi.71684235" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="SylixOS Builder" superClass="com.sylixos.realevo.builder.armsylixeabi"/>
- <tool id="com.sylixos.realevo.tool.armsylixeabi.1710126666" name="arm-sylixos-eabi-gcc" superClass="com.sylixos.realevo.tool.armsylixeabi">
- <option id="com.sylixos.realevo.option.armsylixoseabi.include.1175592689" name="Include paths (-I)" superClass="com.sylixos.realevo.option.armsylixoseabi.include" valueType="includePath">
- <listOptionValue builtIn="false" value="&quot;${SYLIXOS_BASE_PATH}/libsylixos/SylixOS&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${SYLIXOS_BASE_PATH}/libsylixos/SylixOS/include&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${SYLIXOS_BASE_PATH}/libsylixos/SylixOS/include/inet&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${SYLIXOS_TOOLCHAIN_PATH}/${SYLIXOS_TOOLCHAIN_PREFIX}/include&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${SYLIXOS_TOOLCHAIN_PATH}/lib/gcc/${SYLIXOS_TOOLCHAIN_PREFIX}/${SYLIXOS_TOOLCHAIN_VER}/include&quot;"/>
- </option>
- <option id="com.sylixos.realevo.option.armsylixoseabi.DefinedSymbols.599195610" name="Defined symbols(-D)" superClass="com.sylixos.realevo.option.armsylixoseabi.DefinedSymbols" valueType="definedSymbols">
- <listOptionValue builtIn="false" value="__GNUC__=4"/>
- <listOptionValue builtIn="false" value="SYLIXOS"/>
- </option>
- <inputType id="com.sylixos.realevo.inputType.armnsylixeabic.1978288920" name="SylixOS Input C" superClass="com.sylixos.realevo.inputType.armnsylixeabic"/>
- <inputType id="com.sylixos.realevo.inputType.armnsylixeabicpp.1142904684" name="SylixOS Input CPP" superClass="com.sylixos.realevo.inputType.armnsylixeabicpp"/>
- </tool>
- </toolChain>
- </folderInfo>
- </configuration>
- </storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
- <storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <project id="bspam335x.null.917398003" name="bspam335x"/>
- </storageModule>
- <storageModule moduleId="scannerConfiguration">
- <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
- </storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
- <storageModule moduleId="refreshScope" versionNumber="2">
- <configuration configurationName="Default">
- <resource resourceType="PROJECT" workspacePath="/bspam335x"/>
- </configuration>
+ <storageModule moduleId="org.eclipse.cdt.core.pathentry">
+ <pathentry kind="mac" name="__GNUC__" path="" value="4"/>
+ <pathentry kind="mac" name="SYLIXOS" path="" value=""/>
+ <pathentry kind="mac" name="__arm__" path="" value=""/>
+ <pathentry kind="mac" name="__BOOT_INRAM" path="" value="1"/>
+ <pathentry kind="mac" name="am335x" path="" value=""/>
+ <pathentry kind="mac" name="gcc" path="" value=""/>
+ <pathentry kind="mac" name="DMA_MODE" path="" value=""/>
+ <pathentry kind="mac" name="ok335xs" path="" value=""/>
+ <pathentry base-ref="bspam335x" include="C:/ACOINFO/RealEvo/compiler/arm-sylixos-toolchain/arm-sylixos-eabi/include" kind="inc" path="" system="true"/>
+ <pathentry base-ref="bspam335x" include="C:/ACOINFO/RealEvo/compiler/arm-sylixos-toolchain/lib/gcc/arm-sylixos-eabi/4.9.3/include" kind="inc" path="" system="true"/>
+ <pathentry base-ref="bspam335x" include="D:/RealEvo-Simulator/src/workspace/sylixos-base-a8/libsylixos/SylixOS" kind="inc" path="" system="true"/>
+ <pathentry base-ref="bspam335x" include="D:/RealEvo-Simulator/src/workspace/sylixos-base-a8/libsylixos/SylixOS/include" kind="inc" path="" system="true"/>
+ <pathentry base-ref="bspam335x" include="D:/RealEvo-Simulator/src/workspace/sylixos-base-a8/libsylixos/SylixOS/include/inet" kind="inc" path="" system="true"/>
+ <pathentry base-ref="bspam335x" include="SylixOS" kind="inc" path="" system="true"/>
+ <pathentry base-ref="bspam335x" include="SylixOS/bsp" kind="inc" path="" system="true"/>
+ <pathentry base-ref="bspam335x" include="SylixOS/StarterWare/include" kind="inc" path="" system="true"/>
+ <pathentry base-ref="bspam335x" include="SylixOS/StarterWare/include/hw" kind="inc" path="" system="true"/>
+ <pathentry base-ref="bspam335x" include="SylixOS/StarterWare/include/armv7a" kind="inc" path="" system="true"/>
+ <pathentry base-ref="bspam335x" include="SylixOS/StarterWare/include/armv7a/am335x" kind="inc" path="" system="true"/>
+ <pathentry base-ref="bspam335x" include="SylixOS/StarterWare/usblib/include" kind="inc" path="" system="true"/>
</storageModule>
</cproject>
diff --git a/.project b/.project
index 5bcb54e..584a152 100644
--- a/.project
+++ b/.project
@@ -6,27 +6,74 @@
</projects>
<buildSpec>
<buildCommand>
- <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+ <name>com.sylixos.realevo.projectmgr.SylixOSBuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
- <triggers>full,incremental,</triggers>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>com.sylixos.realevo.SylixOSBuilder</name>
- <arguments>
+ <dictionary>
+ <key>org.eclipse.cdt.core.errorOutputParser</key>
+ <value>org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.VCErrorParser;org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.MakeErrorParser;</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.append_environment</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.build.arguments</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.build.command</key>
+ <value>make</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.build.location</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.build.target.auto</key>
+ <value>all</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.build.target.clean</key>
+ <value>clean</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.build.target.inc</key>
+ <value>all</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+ <value>false</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableFullBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.environment</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.stopOnError</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+ <value>true</value>
+ </dictionary>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
- <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
- <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
- <nature>com.sylixos.realevo.SylixOSProject</nature>
+ <nature>com.sylixos.realevo.projectmgr.SylixOSNature</nature>
</natures>
</projectDescription>
diff --git a/.reproject b/.reproject
new file mode 100644
index 0000000..b714e9f
--- /dev/null
+++ b/.reproject
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="GB2312" standalone="no"?>
+<SylixOSSetting>
+<OutputSetting>
+<OutputPath Name="Output" Path="Release:Debug" TreeNode="Output"/>
+<OutputPath Name="Debug" Path="Debug" TreeNode="Debug"/>
+<OutputPath Name="Release" Path="Release" TreeNode="Release"/>
+</OutputSetting>
+<BaseSetting CoustomCfgMakefile="true" ProjectType="SylixOSBspProject"/>
+<BspSetting TemplatePath="/bsp/arm/arm-none"/>
+<FileFilter>
+<PairItem key="SylixOS/driver/netif/netio/getopt.c" value=""/>
+</FileFilter>
+</SylixOSSetting>
diff --git a/.template/config.h b/.template/config.h
deleted file mode 100644
index b58100e..0000000
--- a/.template/config.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*********************************************************************************************************
-**
-** 中国软件开源组织
-**
-** 嵌入式实时操作系统
-**
-** SylixOS(TM) LW : long wing
-**
-** Copyright All Rights Reserved
-**
-**--------------文件信息--------------------------------------------------------------------------------
-**
-** 文 件 名: config.h
-**
-** 创 建 人: RealEvo-IDE
-**
-** 文件创建日期: $(Create_Date)
-**
-** 描 述: 本文件由 RealEvo-IDE 生成,用于配置 BSP 相关地址信息
-*********************************************************************************************************/
-#ifndef __BSP_CONFIG_H
-#define __BSP_CONFIG_H
-
-/*********************************************************************************************************
- ROM RAM 相关配置
-*********************************************************************************************************/
-
-#define BSP_CFG_ROM_BASE 0x$(SylixOS_BspRomBase)
-#define BSP_CFG_ROM_SIZE ($(SylixOS_BspRomSize))
-
-#define BSP_CFG_RAM_BASE 0x$(SylixOS_BspRamBase)
-#define BSP_CFG_RAM_SIZE ($(SylixOS_BspRamSize))
-
-#define BSP_CFG_TEXT_SIZE ($(SylixOS_BspTextSize))
-#define BSP_CFG_DATA_SIZE ($(SylixOS_BspDataSize))
-#define BSP_CFG_DMA_SIZE ($(SylixOS_BspDmaSize))
-#define BSP_CFG_APP_SIZE ($(SylixOS_BspAppSize))
-
-#define BSP_CFG_BOOT_STACK_SIZE ($(SylixOS_BspBootStkSize))
-
-#endif /* __BSP_CONFIG_H */
-/*********************************************************************************************************
- END
-*********************************************************************************************************/
diff --git a/.template/config.ld b/.template/config.ld
deleted file mode 100644
index 1f60bf1..0000000
--- a/.template/config.ld
+++ /dev/null
@@ -1,38 +0,0 @@
-/*********************************************************************************************************
-**
-** 中国软件开源组织
-**
-** 嵌入式实时操作系统
-**
-** SylixOS(TM)
-**
-** Copyright All Rights Reserved
-**
-**--------------文件信息--------------------------------------------------------------------------------
-**
-** 文 件 名: config.ld
-**
-** 创 建 人: RealEvo-IDE
-**
-** 文件创建日期: $(Create_Date)
-**
-** 描 述: 本文件由 RealEvo-IDE 生成,用于配置链接脚本
-*********************************************************************************************************/
-
-#include "config.h"
-
-/*********************************************************************************************************
- 内存布局定义
-*********************************************************************************************************/
-
-MEMORY
-{
- TEXT (rx) : ORIGIN = BSP_CFG_RAM_BASE, LENGTH = BSP_CFG_TEXT_SIZE
- DATA (rw) : ORIGIN = BSP_CFG_RAM_BASE + (BSP_CFG_TEXT_SIZE), LENGTH = BSP_CFG_DATA_SIZE
-}
-
-BOOT_STACK_SIZE = BSP_CFG_BOOT_STACK_SIZE;
-
-/*********************************************************************************************************
- END
-*********************************************************************************************************/
diff --git a/.template/config.mk b/.template/config.mk
deleted file mode 100644
index ebc46ca..0000000
--- a/.template/config.mk
+++ /dev/null
@@ -1,41 +0,0 @@
-#*********************************************************************************************************
-#
-# 中国软件开源组织
-#
-# 嵌入式实时操作系统
-#
-# SylixOS(TM) LW : long wing
-#
-# Copyright All Rights Reserved
-#
-#--------------文件信息--------------------------------------------------------------------------------
-#
-# 文 件 名: config.mk
-#
-# 创 建 人: RealEvo-IDE
-#
-# 文件创建日期: $(Create_Date)
-#
-# 描 述: 本文件由 RealEvo-IDE 生成,用于配置 Makefile 功能,请勿手动修改
-#*********************************************************************************************************
-#*********************************************************************************************************
-# SylixOS Base Project path
-#*********************************************************************************************************
-SYLIXOS_BASE_PATH = $(SylixOS_Base_Path)
-
-#*********************************************************************************************************
-# Toolchain prefix
-#*********************************************************************************************************
-TOOLCHAIN_PREFIX = $(SylixOS_Toolchain)-
-
-#*********************************************************************************************************
-# Debug options (debug or release)
-#*********************************************************************************************************
-DEBUG_LEVEL = $(SylixOS_Debug_Level)
-
-#*********************************************************************************************************
-# NOTICE: libsylixos, BSP and other kernel modules projects CAN NOT use vfp!
-#*********************************************************************************************************
-FPUFLAGS = $(SylixOS_Fpu_Type)
-CPUFLAGS = $(SylixOS_Cpu_Type) $(FPUFLAGS)
-
diff --git a/.template/config.xml b/.template/config.xml
deleted file mode 100644
index 1975cb9..0000000
--- a/.template/config.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="GB2312" standalone="no"?>
-<node name="arm-none bsp Conguration">
- <node name="Rom Base Address(hex)" type="hextext" macro="SylixOS_BspRomBase" default="00000000" maxlen="8" />
- <node name="Rom Size" type="text" macro="SylixOS_BspRomSize" default="4 * 1024 * 1024" pattern = "[0-9\*\+\ ]+"/>
-
- <node name="Ram Base Address(hex)" type="hextext" macro="SylixOS_BspRamBase" default="30000000" maxlen="8" />
- <node name="Ram Size" type="text" macro="SylixOS_BspRamSize" default="64 * 1024 * 1024" min="1 * 1024 * 1024" pattern = "[0-9\*\+\ ]+"/>
-
- <node name="Text Section Size" type="text" macro="SylixOS_BspTextSize" default="6 * 1024 * 1024" min="1 * 1024 * 1024" pattern = "[0-9\*\+\ ]+"/>
- <node name="Data Section Size" type="text" macro="SylixOS_BspDataSize" default="18 * 1024 * 1024" min="1 * 1024 * 1024" pattern = "[0-9\*\+\ ]+"/>
-
- <node name="Dma Zone Size" type="text" macro="SylixOS_BspDmaSize" default="6 * 1024 * 1024" pattern = "[0-9\*\+\ ]+"/>
- <node name="App Zone Size" type="text" macro="SylixOS_BspAppSize" default="34 * 1024 * 1024" pattern = "[0-9\*\+\ ]+"/>
-
- <node name="Boot Stack Size" type="text" macro="SylixOS_BspBootStkSize" default="128 * 1024" min="64 * 1024" note="One cpu core use 64KB at least" pattern = "[0-9\*\+\ ]+"/>
-</node>
diff --git a/Makefile b/Makefile
index fdb6aad..0195b42 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,26 @@
#*********************************************************************************************************
-# bspam335x Makefile
-# target -> bspam335x.elf
-# bspam335x.bin
-#*********************************************************************************************************
-
-#*********************************************************************************************************
-# include config.mk
+#
+# 中国软件开源组织
+#
+# 嵌入式实时操作系统
+#
+# SylixOS(TM) LW : long wing
+#
+# Copyright All Rights Reserved
+#
+#--------------文件信息--------------------------------------------------------------------------------
+#
+# 文 件 名: Makefile
+#
+# 创 建 人: RealEvo-IDE
+#
+# 文件创建日期: 2016 年 10 月 20 日
+#
+# 描 述: 本文件由 RealEvo-IDE 生成,用于配置 Makefile 功能,请勿手动修改
+#*********************************************************************************************************
+
+#*********************************************************************************************************
+# Include config.mk
#*********************************************************************************************************
CONFIG_MK_EXIST = $(shell if [ -f ../config.mk ]; then echo exist; else echo notexist; fi;)
ifeq ($(CONFIG_MK_EXIST), exist)
@@ -20,430 +35,26 @@ endif
endif
#*********************************************************************************************************
-# check configure
-#*********************************************************************************************************
-check_defined = \
- $(foreach 1,$1,$(__check_defined))
-__check_defined = \
- $(if $(value $1),, \
- $(error Undefined $1$(if $(value 2), ($(strip $2)))))
-
-$(call check_defined, CONFIG_MK_EXIST, Please configure this project in RealEvo-IDE or \
-create a config.mk file!)
-$(call check_defined, SYLIXOS_BASE_PATH, SylixOS base project path)
-$(call check_defined, TOOLCHAIN_PREFIX, the prefix name of toolchain)
-$(call check_defined, DEBUG_LEVEL, debug level(debug or release))
-
-#*********************************************************************************************************
-# toolchain select
-#*********************************************************************************************************
-CC = $(TOOLCHAIN_PREFIX)gcc
-CXX = $(TOOLCHAIN_PREFIX)g++
-AS = $(TOOLCHAIN_PREFIX)gcc
-AR = $(TOOLCHAIN_PREFIX)ar
-LD = $(TOOLCHAIN_PREFIX)g++
-OC = $(TOOLCHAIN_PREFIX)objcopy
-SZ = $(TOOLCHAIN_PREFIX)size
-CPP = $(TOOLCHAIN_PREFIX)cpp
-LZOCOM = $(TOOLCHAIN_PREFIX)lzocom
-
-#*********************************************************************************************************
-# commercial toolchain check
-#*********************************************************************************************************
-COMMERCIAL = $(shell $(LZOCOM) 1>null 2>null && \
- (rm -rf null; echo 1) || \
- (rm -rf null; echo 0))
-
-#*********************************************************************************************************
-# platform, can use: evmAM335x evmskAM335x beaglebone ok335xd ok335xs ok335xs2
-# watertek platform, can use: FK2500 CT3520
-#*********************************************************************************************************
-PLATFORM = ok335xs
-
-#*********************************************************************************************************
-# symbol.c symbol.h path
-#*********************************************************************************************************
-SYMBOL_PATH = SylixOS/bsp
-
-#*********************************************************************************************************
-# do not change the following code
-# buildin internal application source
-#*********************************************************************************************************
-
-#*********************************************************************************************************
-# symbol.c
-#*********************************************************************************************************
-SYM_SRCS = $(SYMBOL_PATH)/symbol.c
-
-#*********************************************************************************************************
-# bsp src(s) file
-#*********************************************************************************************************
-BSP_SRCS = \
-SylixOS/bsp/bspInit.c \
-SylixOS/bsp/bspLib.c \
-SylixOS/bsp/startup.S
-
-ifeq ($(PLATFORM), ok335xd)
-BSP_SRCS += SylixOS/bsp/forlinx/bspForlinx.c
-endif
-
-ifeq ($(PLATFORM), ok335xs)
-BSP_SRCS += SylixOS/bsp/forlinx/bspForlinx.c
-endif
-
-ifeq ($(PLATFORM), ok335xs2)
-BSP_SRCS += SylixOS/bsp/forlinx/bspForlinx.c
-endif
-
-ifeq ($(PLATFORM), beaglebone)
-BSP_SRCS += SylixOS/bsp/beaglebone/bspBeaglebone.c
-endif
-
-ifeq ($(PLATFORM), evmAM335x)
-BSP_SRCS += SylixOS/bsp/ti/bspEvmAM335x.c
-endif
-
-ifeq ($(PLATFORM), evmskAM335x)
-BSP_SRCS += SylixOS/bsp/ti/bspEvmAM335x.c
-endif
-
-ifeq ($(PLATFORM), FK2500)
-BSP_SRCS += SylixOS/bsp/watertek/bspFK2500.c
-endif
-
-ifeq ($(PLATFORM), CT3520)
-BSP_SRCS += SylixOS/bsp/watertek/bspCT3520.c
-endif
-#*********************************************************************************************************
-# drivers src(s) file
-#*********************************************************************************************************
-DRV_SRCS = \
-SylixOS/driver/tps65217/tps65217.c \
-SylixOS/driver/dvfs/dvfs.c \
-SylixOS/driver/clock/am335x_clock_data.c \
-SylixOS/driver/clock/am335x_clock.c \
-SylixOS/driver/mcasp/am335x_mcasp.c \
-SylixOS/driver/audio/oss_test.c \
-SylixOS/driver/audio/dsp/dspDrv.c \
-SylixOS/driver/audio/mixer/mixerDrv.c \
-SylixOS/driver/audio/queue/queueLib.c \
-SylixOS/driver/audio/codec/codecDrv.c \
-SylixOS/driver/audio/codec/tlv320aic3x/tlv320aic3x.c \
-SylixOS/driver/pinmux/mux.c \
-SylixOS/driver/pinmux/mux_port.c \
-SylixOS/driver/pinmux/mux2420.c \
-SylixOS/driver/pinmux/mux2430.c \
-SylixOS/driver/pinmux/mux33xx.c \
-SylixOS/driver/pinmux/mux34xx.c \
-SylixOS/driver/pinmux/mux44xx.c \
-SylixOS/driver/gpio/am335x_gpio.c \
-SylixOS/driver/gpio/am335x_gpio_test.c \
-SylixOS/driver/lcd/am335x_lcd.c \
-SylixOS/driver/lcd/am335x_lcd_touch_test.c \
-SylixOS/driver/sio/am335x_sio.c \
-SylixOS/driver/sio/am335x_sio_test.c \
-SylixOS/driver/rtc/am335x_rtc.c \
-SylixOS/driver/rtc/am335x_rtc_test.c \
-SylixOS/driver/dma/am335x_dma.c \
-SylixOS/driver/dma/am335x_dma_test.c \
-SylixOS/driver/i2c/am335x_i2c.c \
-SylixOS/driver/pwm/am335x_pwm.c \
-SylixOS/driver/ecap/am335x_ecap.c \
-SylixOS/driver/ecap/am335x_ecap_test.c \
-SylixOS/driver/spi/am335x_spi.c \
-SylixOS/driver/spi/am335x_spi_test.c \
-SylixOS/driver/touch/am335x_adc_touch.c \
-SylixOS/driver/adc/am335x_adc.c \
-SylixOS/driver/adc/am335x_adc_test.c \
-SylixOS/driver/can/dcan_frame.c \
-SylixOS/driver/can/am335x_can.c \
-SylixOS/driver/can/am335x_can_test.c \
-SylixOS/driver/sdi/am335x_sdi.c \
-SylixOS/driver/sdi/am335x_sdi_init.c \
-SylixOS/driver/netif/cpswif.c \
-SylixOS/driver/netif/am335x_cpsw.c \
-SylixOS/driver/netif/netio/netio.c \
-SylixOS/driver/watchdog/am335x_watchdog.c \
-SylixOS/driver/memory/memory_port.c \
-SylixOS/driver/memory/elm/elm.c \
-SylixOS/driver/memory/gpmc/gpmc.c \
-SylixOS/driver/memory/gpmc/gpmc-nand.c \
-SylixOS/driver/memory/nand/omap2.c \
-SylixOS/driver/memory/am335x_nand.c \
-SylixOS/driver/usb/am335x_usb_hw_init.c \
-SylixOS/driver/ft5x06/ft5x06.c \
-SylixOS/driver/beep/beep.c \
-SylixOS/driver/beep/beep_test.c \
-SylixOS/driver/ds1337/ds1337.c \
-SylixOS/driver/ds1337/ds1337_test.c
-
-#*********************************************************************************************************
-# StarterWare src(s) file
-#*********************************************************************************************************
-STARTERWARE_DRIVERS_SRCS = \
-SylixOS/StarterWare/drivers/cpsw.c \
-SylixOS/StarterWare/drivers/dcan.c \
-SylixOS/StarterWare/drivers/dmtimer.c \
-SylixOS/StarterWare/drivers/ecap.c \
-SylixOS/StarterWare/drivers/edma.c \
-SylixOS/StarterWare/drivers/ehrpwm.c \
-SylixOS/StarterWare/drivers/elm.c \
-SylixOS/StarterWare/drivers/gpio_v2.c \
-SylixOS/StarterWare/drivers/gpmc.c \
-SylixOS/StarterWare/drivers/hs_mmcsd.c \
-SylixOS/StarterWare/drivers/hsi2c.c \
-SylixOS/StarterWare/drivers/mailbox.c \
-SylixOS/StarterWare/drivers/mcasp.c \
-SylixOS/StarterWare/drivers/mcspi.c \
-SylixOS/StarterWare/drivers/mdio.c \
-SylixOS/StarterWare/drivers/phy.c \
-SylixOS/StarterWare/drivers/raster.c \
-SylixOS/StarterWare/drivers/rtc.c \
-SylixOS/StarterWare/drivers/tsc_adc.c \
-SylixOS/StarterWare/drivers/uart_irda_cir.c \
-SylixOS/StarterWare/drivers/watchdog.c
-
-STARTERWARE_SYSTEM_CONFIG_SRCS = \
-SylixOS/StarterWare/system_config/armv7a/cache.c \
-SylixOS/StarterWare/system_config/armv7a/am335x/clock.c \
-SylixOS/StarterWare/system_config/armv7a/am335x/device.c \
-SylixOS/StarterWare/system_config/armv7a/am335x/interrupt.c
-
-STARTERWARE_UTILS_SRCS = \
-SylixOS/StarterWare/utils/delay.c \
-SylixOS/StarterWare/utils/perf.c
-
-STARTERWARE_PLATFORM_SRCS = \
-SylixOS/StarterWare/platform/platform.c
-
-STARTERWARE_SRCS += $(STARTERWARE_DRIVERS_SRCS)
-STARTERWARE_SRCS += $(STARTERWARE_SYSTEM_CONFIG_SRCS)
-STARTERWARE_SRCS += $(STARTERWARE_UTILS_SRCS)
-STARTERWARE_SRCS += $(STARTERWARE_PLATFORM_SRCS)
-
-#*********************************************************************************************************
-# user src(s) file
-#*********************************************************************************************************
-USR_SRCS = \
-SylixOS/user/main.c \
-
-#*********************************************************************************************************
-# all bspam335x source
-#*********************************************************************************************************
-SRCS = $(BSP_SRCS)
-SRCS += $(DRV_SRCS)
-SRCS += $(USR_SRCS)
-SRCS += $(SYM_SRCS)
-SRCS += $(STARTERWARE_SRCS)
-
-#*********************************************************************************************************
-# build path
-#*********************************************************************************************************
-ifeq ($(DEBUG_LEVEL), debug)
-OUTDIR = Debug
-else
-OUTDIR = Release
-endif
-
-OUTPATH = ./$(OUTDIR)
-OBJPATH = $(OUTPATH)/obj
-DEPPATH = $(OUTPATH)/dep
-
-#*********************************************************************************************************
-# target
-#*********************************************************************************************************
-O_IMG = $(OUTPATH)/bsp$(PLATFORM).elf
-O_BIN = $(OUTPATH)/bsp$(PLATFORM).bin
-O_SIZ = $(OUTPATH)/bsp$(PLATFORM).siz
-O_LZO = $(OUTPATH)/bsp$(PLATFORM).lzo
-
-#*********************************************************************************************************
-# bspam335x objects
-#*********************************************************************************************************
-OBJS = $(addprefix $(OBJPATH)/, $(addsuffix .o, $(basename $(SRCS))))
-DEPS = $(addprefix $(DEPPATH)/, $(addsuffix .d, $(basename $(SRCS))))
-
-#*********************************************************************************************************
-# include path
-#*********************************************************************************************************
-INCDIR = -I"$(SYLIXOS_BASE_PATH)/libsylixos/SylixOS"
-INCDIR += -I"$(SYLIXOS_BASE_PATH)/libsylixos/SylixOS/include"
-INCDIR += -I"$(SYLIXOS_BASE_PATH)/libsylixos/SylixOS/include/inet"
-
-INCDIR += -I"./SylixOS"
-INCDIR += -I"./SylixOS/bsp"
-INCDIR += -I"./SylixOS/StarterWare/include"
-INCDIR += -I"./SylixOS/StarterWare/include/hw"
-INCDIR += -I"./SylixOS/StarterWare/include/armv7a"
-INCDIR += -I"./SylixOS/StarterWare/include/armv7a/am335x"
-INCDIR += -I"./SylixOS/StarterWare/usblib/include"
-
-#*********************************************************************************************************
-# compiler preprocess
-#*********************************************************************************************************
-DSYMBOL = -DSYLIXOS
-DSYMBOL += -D__BOOT_INRAM=1
-DSYMBOL += -Dam335x
-DSYMBOL += -Dgcc
-DSYMBOL += -DDMA_MODE
-DSYMBOL += -D$(PLATFORM)
-
-#*********************************************************************************************************
-# load script
-#*********************************************************************************************************
-LD_SCRIPT = SylixOSBSP.ld
-
-#*********************************************************************************************************
-# depend dynamic library
-#*********************************************************************************************************
-DEPEND_DLL = -lsylixos
-
-#*********************************************************************************************************
-# depend dynamic library search path
-#*********************************************************************************************************
-DEPEND_DLL_PATH = -L"$(SYLIXOS_BASE_PATH)/libsylixos/$(OUTDIR)"
-
-#*********************************************************************************************************
-# compiler optimize
-#*********************************************************************************************************
-ifeq ($(DEBUG_LEVEL), debug)
-OPTIMIZE = -O0 -g3 -gdwarf-2
-else
-OPTIMIZE = -O2 -g1 -gdwarf-2 # Do NOT use -O3 and -Os
-endif # -Os is not align for function
- # loop and jump.
-#*********************************************************************************************************
-# depends and compiler parameter (cplusplus in kernel MUST NOT use exceptions and rtti)
-#*********************************************************************************************************
-DEPENDFLAG = -MM
-CXX_EXCEPT = -fno-exceptions -fno-rtti
-COMMONFLAGS = $(CPUFLAGS) $(OPTIMIZE) -Wall -fmessage-length=0 -fsigned-char -fno-short-enums
-ASFLAGS = -x assembler-with-cpp $(DSYMBOL) $(INCDIR) $(COMMONFLAGS) -c
-CFLAGS = $(DSYMBOL) $(INCDIR) $(COMMONFLAGS) -c
-CXXFLAGS = $(DSYMBOL) $(INCDIR) $(CXX_EXCEPT) $(COMMONFLAGS) -c
-ARFLAGS = -r
-
-#*********************************************************************************************************
-# define some useful variable
-#*********************************************************************************************************
-DEPEND = $(CC) $(DEPENDFLAG) $(CFLAGS)
-DEPEND.d = $(subst -g ,,$(DEPEND))
-COMPILE.S = $(AS) $(ASFLAGS)
-COMPILE_VFP.S = $(AS) $(ASFLAGS) -mfloat-abi=softfp -mfpu=vfpv3
-COMPILE.c = $(CC) $(CFLAGS)
-COMPILE.cxx = $(CXX) $(CXXFLAGS)
-
-#*********************************************************************************************************
-# target
-#*********************************************************************************************************
-ifeq ($(COMMERCIAL), 1)
-all: $(O_IMG) $(O_BIN) $(O_SIZ) $(O_LZO)
- @echo create "$(O_IMG) $(O_BIN) $(O_SIZ) $(O_LZO)" success.
-else
-all: $(O_IMG) $(O_BIN) $(O_SIZ)
- @echo create "$(O_IMG) $(O_BIN) $(O_SIZ)" success.
-endif
-
-#*********************************************************************************************************
-# include depends
-#*********************************************************************************************************
-ifneq ($(MAKECMDGOALS), clean)
-ifneq ($(MAKECMDGOALS), clean_project)
-sinclude $(DEPS)
-endif
-endif
-
-#*********************************************************************************************************
-# auto copy symbol.c symbol.h
-#*********************************************************************************************************
-EMPTY=
-SPACE= $(EMPTY) $(EMPTY)
-$(SYMBOL_PATH)/symbol.c:$(subst $(SPACE),\ ,$(SYLIXOS_BASE_PATH))/libsylixos/$(OUTDIR)/symbol.c
- cp "$(SYLIXOS_BASE_PATH)/libsylixos/$(OUTDIR)/symbol.c" $(SYMBOL_PATH)/symbol.c
- cp "$(SYLIXOS_BASE_PATH)/libsylixos/$(OUTDIR)/symbol.h" $(SYMBOL_PATH)/symbol.h
-
-#*********************************************************************************************************
-# create depends files
+# Include header.mk
#*********************************************************************************************************
-$(DEPPATH)/%.d: %.c
- @echo creating $@
- @if [ ! -d "$(dir $@)" ]; then mkdir -p "$(dir $@)"; fi
- @rm -f $@; \
- echo -n '$@ $(addprefix $(OBJPATH)/, $(dir $<))' > $@; \
- $(DEPEND.d) $< >> $@ || rm -f $@; exit;
+EMPTY =
+SPACE = $(EMPTY) $(EMPTY)
+MKTEMP = $(subst $(SPACE),\ ,$(SYLIXOS_BASE_PATH))/libsylixos/SylixOS/mktemp
-$(DEPPATH)/%.d: %.cpp
- @echo creating $@
- @if [ ! -d "$(dir $@)" ]; then mkdir -p "$(dir $@)"; fi
- @rm -f $@; \
- echo -n '$@ $(addprefix $(OBJPATH)/, $(dir $<))' > $@; \
- $(DEPEND.d) $< >> $@ || rm -f $@; exit;
-
-#*********************************************************************************************************
-# compile source files
-#*********************************************************************************************************
-$(OBJPATH)/%.o: %.S
- @if [ ! -d "$(dir $@)" ]; then mkdir -p "$(dir $@)"; fi
- $(COMPILE.S) $< -o $@
-
-$(OBJPATH)/%.o: %.c
- @if [ ! -d "$(dir $@)" ]; then mkdir -p "$(dir $@)"; fi
- $(COMPILE.c) $< -o $@
-
-$(OBJPATH)/%.o: %.cpp
- @if [ ! -d "$(dir $@)" ]; then mkdir -p "$(dir $@)"; fi
- $(COMPILE.cxx) $< -o $@
-
-#*********************************************************************************************************
-# link bspam335x.elf object files
-#*********************************************************************************************************
-$(O_IMG): $(OBJS) $(LD_SCRIPT)
- $(CPP) -E -P $(DSYMBOL) config.ld -o config.lds
- $(LD) $(CPUFLAGS) -nostdlib $(addprefix -T,$(LD_SCRIPT)) -o $(O_IMG) $(OBJS) \
- $(DEPEND_DLL_PATH) $(DEPEND_DLL) -lm -lgcc
-
-#*********************************************************************************************************
-# create bspam335x.bin
-#*********************************************************************************************************
-$(O_BIN): $(O_IMG)
- $(OC) -O binary $(O_IMG) $(O_BIN)
-
-#*********************************************************************************************************
-# create bspam335x.siz
-#*********************************************************************************************************
-$(O_SIZ): $(O_IMG)
- $(SZ) --format=berkeley $(O_IMG) > $(O_SIZ)
-
-#*********************************************************************************************************
-# create bspam335x.lzo
-#*********************************************************************************************************
-$(O_LZO): $(O_BIN)
- $(LZOCOM) -c $(O_BIN) $(O_LZO)
-
-#*********************************************************************************************************
-# clean
-#*********************************************************************************************************
-.PHONY: clean
-.PHONY: clean_project
+include $(MKTEMP)/header.mk
#*********************************************************************************************************
-# clean objects
+# Include targets makefiles
#*********************************************************************************************************
-clean:
- -rm -rf $(O_SIZ)
- -rm -rf $(O_IMG)
- -rm -rf $(O_BIN)
- -rm -rf $(O_LZO)
- -rm -rf $(SYMBOL_PATH)/symbol.c $(SYMBOL_PATH)/symbol.h
- -rm -rf $(OBJPATH)
- -rm -rf $(DEPPATH)
+include bspok335xs.mk
+include bspok335xd.mk
+include bspbeaglebone.mk
#*********************************************************************************************************
-# clean project
+# Include end.mk
#*********************************************************************************************************
-clean_project:
- -rm -rf $(OUTPATH)
+include $(END_MK)
#*********************************************************************************************************
-# END
+# End
#*********************************************************************************************************
diff --git a/SylixOS/bsp/bspInit.c b/SylixOS/bsp/bspInit.c
index b0a7cfd..859e9e1 100644
--- a/SylixOS/bsp/bspInit.c
+++ b/SylixOS/bsp/bspInit.c
@@ -914,7 +914,7 @@ INT bspInit (VOID)
*
* TODO: 可以修改内核启动参数
*/
- API_KernelStartParam("ncpus=1 kdlog=no kderror=yes kfpu=no heapchk=yes");
+ API_KernelStartParam("ncpus=1 kdlog=no kderror=yes kfpu=no heapchk=yes hz=1000 hhz=1000");
/* 操作系统启动参数设置 */
API_KernelStart(usrStartup,
(PVOID)&__heap_start,
diff --git a/SylixOS/driver/audio/audioLib.c b/SylixOS/driver/audio/audioLib.c
new file mode 100644
index 0000000..cd5d9c7
--- /dev/null
+++ b/SylixOS/driver/audio/audioLib.c
@@ -0,0 +1,608 @@
+/*********************************************************************************************************
+**
+** 中国软件开源组织
+**
+** 嵌入式实时操作系统
+**
+** SylixOS(TM)
+**
+** Copyright All Rights Reserved
+**
+**--------------文件信息--------------------------------------------------------------------------------
+**
+** 文 件 名: audioLib.c
+**
+** 创 建 人: Jiao.JinXing (焦进星)
+**
+** 文件创建日期: 2016 年 10 月 19 日
+**
+** 描 述: 音频库
+*********************************************************************************************************/
+#include "SylixOS.h"
+#include "unistd.h"
+#include "pthread.h"
+
+#include "sys/select.h"
+#include "sys/soundcard.h"
+#include "sys/mman.h"
+
+#include "stdlib.h"
+#include "stdio.h"
+#include "string.h"
+
+#include "audioLib.h"
+
+/*********************************************************************************************************
+ 类型定义
+*********************************************************************************************************/
+struct __AUDIO_CAPTURE_STRUCT {
+ AUDIO_CAPTURE_PARAM param; /* 音频捕捉参数 */
+ AUDIO_CATPURE_CALLBACK pfuncOnAudioCapture; /* 音频捕捉回调函数 */
+ VOID *pvCbArg; /* 回调参数 */
+ INT iFd; /* 文件描述符 */
+ BOOL bOpened; /* 是否已经打开 */
+ BOOL bConfiged; /* 是否已经配置 */
+ BOOL bStarted; /* 是否已经启动 */
+ UINT8 *pucDmaBuffer; /* DMA 缓冲区 */
+ size_t stDmaBufferAlignSize; /* DMA 缓冲区大小(对齐到页面) */
+ size_t stDmaBufferSize; /* DMA 缓冲区大小 */
+ BOOL bExitRequest; /* 退出请求 */
+ pthread_t hServiceThread; /* 服务线程 ID */
+};
+
+typedef struct __AUDIO_CAPTURE_STRUCT AUDIO_CAPTURE_STRUCT, *AUDIO_CAPTURE_HANDLE;
+
+struct __AUDIO_PLAY_STRUCT {
+ AUDIO_PLAY_PARAM param; /* 音频播放参数 */
+ INT iFd; /* 文件描述符 */
+ BOOL bOpened; /* 是否已经打开 */
+ BOOL bConfiged; /* 是否已经配置 */
+};
+
+typedef struct __AUDIO_PLAY_STRUCT AUDIO_PLAY_STRUCT, *AUDIO_PLAY_HANDLE;
+
+static VOID *__AudioCaptureService(VOID *pvArg);
+
+#ifndef ALIGN
+#define ALIGN(p, align) (((unsigned long)(p) + (align - 1)) & ~(align - 1))
+#endif
+/*********************************************************************************************************
+** 函数名称: API_AudioLibInit
+** 功能描述: 初始化音频库
+** 输 入 : NONE
+** 输 出 : ERROR CODE
+** 全局变量:
+** 调用模块:
+*********************************************************************************************************/
+INT API_AudioLibInit (VOID)
+{
+ return (ERROR_NONE);
+}
+/*********************************************************************************************************
+** 函数名称: API_AudioLibDeInit
+** 功能描述: 清理音频库
+** 输 入 : NONE
+** 输 出 : ERROR CODE
+** 全局变量:
+** 调用模块:
+*********************************************************************************************************/
+INT API_AudioLibDeInit (VOID)
+{
+ return (ERROR_NONE);
+}
+/*********************************************************************************************************
+** 函数名称: API_AudioCaptureOpen
+** 功能描述: 打开音频捕捉器
+** 输 入 : NONE
+** 输 出 : 音频捕捉器句柄
+** 全局变量:
+** 调用模块:
+*********************************************************************************************************/
+AUDIO_CAPTURE_HANDLE API_AudioCaptureOpen (VOID)
+{
+ AUDIO_CAPTURE_HANDLE hCaptureHandle;
+
+ hCaptureHandle = malloc(sizeof(AUDIO_CAPTURE_STRUCT));
+ if (hCaptureHandle) {
+ memset(hCaptureHandle, 0, sizeof(AUDIO_CAPTURE_STRUCT));
+
+ hCaptureHandle->iFd = open("/dev/dsp", O_RDONLY, 0666);
+ if (hCaptureHandle->iFd < 0) {
+ printf("failed to open /dev/dsp device!\n");
+ goto __error_handle;
+ }
+
+ hCaptureHandle->bOpened = LW_TRUE;
+ }
+
+ return (hCaptureHandle);
+
+ __error_handle:
+ free(hCaptureHandle);
+ return (NULL);
+}
+/*********************************************************************************************************
+** 函数名称: API_AudioCaptureClose
+** 功能描述: 关闭音频捕捉器
+** 输 入 : hCaptureHandle 音频捕捉器句柄
+** 输 出 : ERROR CODE
+** 全局变量:
+** 调用模块:
+*********************************************************************************************************/
+INT API_AudioCaptureClose (AUDIO_CAPTURE_HANDLE hCaptureHandle)
+{
+ if (!hCaptureHandle) {
+ return (PX_ERROR);
+ }
+
+ if (!hCaptureHandle->bOpened) {
+ return (PX_ERROR);
+ }
+
+ if (hCaptureHandle->bStarted) {
+ API_AudioCaptureStop(hCaptureHandle);
+ }
+
+ if (hCaptureHandle->bConfiged) {
+ munmap(hCaptureHandle->pucDmaBuffer, hCaptureHandle->stDmaBufferAlignSize);
+ hCaptureHandle->pucDmaBuffer = NULL;
+ hCaptureHandle->stDmaBufferAlignSize = 0;
+ hCaptureHandle->stDmaBufferSize = 0;
+
+ hCaptureHandle->bConfiged = LW_FALSE;
+ }
+
+ close(hCaptureHandle->iFd);
+ memset(hCaptureHandle, 0, sizeof(AUDIO_CAPTURE_STRUCT));
+ free(hCaptureHandle);
+ return (ERROR_NONE);
+}
+/*********************************************************************************************************
+** 函数名称: API_AudioCaptureSetParam
+** 功能描述: 设置音频捕捉器工作参数
+** 输 入 : hCaptureHandle 音频捕捉器句柄
+** pParam 音频捕捉参数
+** 输 出 : ERROR CODE
+** 全局变量:
+** 调用模块:
+*********************************************************************************************************/
+INT API_AudioCaptureSetParam (AUDIO_CAPTURE_HANDLE hCaptureHandle, AUDIO_CAPTURE_PARAM *pParam)
+{
+ INT iRet;
+ INT iSampleFmt;
+ INT iChannel;
+ INT iSampleRate;
+ INT iFragment;
+ UINT uiCaps, uiTriggerEnable;
+ UINT uiFragCount, uiFragSize;
+ UINT uiDmaBufferSize = 0, uiDmaBufferAlignSize = 0;
+ UINT8 *pucDmaBuffer = NULL;
+ audio_buf_info ispace;
+
+ if (!hCaptureHandle) {
+ return (PX_ERROR);
+ }
+
+ if (!pParam) {
+ return (PX_ERROR);
+ }
+
+ if (!hCaptureHandle->bOpened) {
+ return (PX_ERROR);
+ }
+
+ if (hCaptureHandle->bStarted) {
+ API_AudioCaptureStop(hCaptureHandle);
+ }
+
+ if (hCaptureHandle->bConfiged) {
+ munmap(hCaptureHandle->pucDmaBuffer, hCaptureHandle->stDmaBufferAlignSize);
+ hCaptureHandle->pucDmaBuffer = NULL;
+ hCaptureHandle->stDmaBufferAlignSize = 0;
+ hCaptureHandle->stDmaBufferSize = 0;
+ hCaptureHandle->bConfiged = LW_FALSE;
+ }
+
+ iSampleFmt = pParam->iSampleSize;
+ iRet = ioctl(hCaptureHandle->iFd, SNDCTL_DSP_SETFMT, &iSampleFmt);
+ if (iRet < 0) {
+ printf("failed to set sample format!\n");
+ goto __error_handle;
+ }
+
+ iChannel = pParam->iChannelNum;
+ iRet = ioctl(hCaptureHandle->iFd, SNDCTL_DSP_CHANNELS, &iChannel);
+ if (iRet < 0) {
+ printf("failed to set channels!\n");
+ goto __error_handle;
+ }
+
+ iSampleRate = pParam->iSampleRate;
+ iRet = ioctl(hCaptureHandle->iFd, SNDCTL_DSP_SPEED, &iSampleRate);
+ if (iRet < 0) {
+ printf("failed to set sample rate!\n");
+ goto __error_handle;
+ }
+
+ iRet = ioctl(hCaptureHandle->iFd, SNDCTL_DSP_GETCAPS, &uiCaps);
+ if (iRet < 0) {
+ printf("failed to read sound driver capabilities\n");
+ goto __error_handle;
+ }
+
+ if (!(uiCaps & DSP_CAP_MMAP) || !(uiCaps & DSP_CAP_TRIGGER)) {
+ printf("this sound driver is not capable of direct DMA.\n");
+ goto __error_handle;
+ }
+
+ iFragment = (pParam->iFrameNum << 16) + pParam->iFrameSize;
+ iRet = ioctl(hCaptureHandle->iFd, SNDCTL_DSP_SETFRAGMENT, &iFragment);
+ if (iRet < 0) {
+ printf("failed to query buffer information 1, %s\n", strerror(errno));
+ goto __error_handle;
+ }
+
+ iRet = ioctl(hCaptureHandle->iFd, SNDCTL_DSP_GETISPACE, &ispace);
+ if (iRet < 0) {
+ printf("failed to query buffer information 2\n");
+ goto __error_handle;
+ }
+
+ uiFragCount = ispace.fragstotal;
+ uiFragSize = ispace.fragsize;
+
+ uiDmaBufferSize = uiFragCount * uiFragSize;
+ uiDmaBufferAlignSize = ALIGN(uiDmaBufferSize, LW_CFG_VMM_PAGE_SIZE);
+
+ pucDmaBuffer = mmap(NULL,
+ uiDmaBufferAlignSize,
+ PROT_READ,
+ MAP_FILE | MAP_SHARED,
+ hCaptureHandle->iFd,
+ 0);
+ if (pucDmaBuffer == (UINT8 *)MAP_FAILED) {
+ printf("failed to mmap a DMA buffer\n");
+ goto __error_handle;
+ }
+
+ hCaptureHandle->pucDmaBuffer = pucDmaBuffer;
+ hCaptureHandle->stDmaBufferSize = uiDmaBufferSize;
+ hCaptureHandle->stDmaBufferAlignSize = uiDmaBufferAlignSize;
+
+ uiTriggerEnable = 0;
+ iRet = ioctl(hCaptureHandle->iFd, SNDCTL_DSP_SETTRIGGER, &uiTriggerEnable);
+ if (iRet < 0) {
+ printf("failed to disable PCM input\n");
+ munmap(hCaptureHandle->pucDmaBuffer, hCaptureHandle->stDmaBufferAlignSize);
+ hCaptureHandle->pucDmaBuffer = NULL;
+ hCaptureHandle->stDmaBufferAlignSize = 0;
+ hCaptureHandle->stDmaBufferSize = 0;
+ goto __error_handle;
+ }
+
+ memcpy(&hCaptureHandle->param, pParam, sizeof(AUDIO_CAPTURE_PARAM));
+
+ hCaptureHandle->bConfiged = LW_TRUE;
+
+ return (ERROR_NONE);
+
+ __error_handle:
+ return (PX_ERROR);
+}
+/*********************************************************************************************************
+** 函数名称: API_AudioCaptureStart
+** 功能描述: 启动音频捕捉器
+** 输 入 : hCaptureHandle 音频捕捉器句柄
+** pfuncOnAudioCapture 音频捕捉回调函数
+** pvCbArg 音频捕捉回调函数参数
+** 输 出 : ERROR CODE
+** 全局变量:
+** 调用模块:
+*********************************************************************************************************/
+INT API_AudioCaptureStart (AUDIO_CAPTURE_HANDLE hCaptureHandle,
+ AUDIO_CATPURE_CALLBACK pfuncOnAudioCapture,
+ VOID *pvCbArg)
+{
+ if (!hCaptureHandle) {
+ return (PX_ERROR);
+ }
+
+ if (!hCaptureHandle->bOpened) {
+ return (PX_ERROR);
+ }
+
+ if (!hCaptureHandle->bConfiged) {
+ return (PX_ERROR);
+ }
+
+ if (!pfuncOnAudioCapture) {
+ return (PX_ERROR);
+ }
+
+ if (hCaptureHandle->bStarted) {
+ API_AudioCaptureStop(hCaptureHandle);
+ }
+
+ hCaptureHandle->pfuncOnAudioCapture = pfuncOnAudioCapture;
+ hCaptureHandle->pvCbArg = pvCbArg;
+
+ hCaptureHandle->bExitRequest = LW_FALSE;
+
+ if (pthread_create(&hCaptureHandle->hServiceThread, NULL, __AudioCaptureService, hCaptureHandle) != 0) {
+ printf("failed to create capture service thread\n");
+ goto __error_handle;
+ }
+
+ pthread_setschedprio(hCaptureHandle->hServiceThread, 200);
+
+ pthread_setname_np(hCaptureHandle->hServiceThread, "t_audio");
+
+ hCaptureHandle->bStarted = LW_TRUE;
+
+ return (ERROR_NONE);
+
+ __error_handle:
+ return (PX_ERROR);
+}
+/*********************************************************************************************************
+** 函数名称: API_AudioCaptureStop
+** 功能描述: 停止音频捕捉器
+** 输 入 : hCaptureHandle 音频捕捉器句柄
+** 输 出 : ERROR CODE
+** 全局变量:
+** 调用模块:
+*********************************************************************************************************/
+INT API_AudioCaptureStop (AUDIO_CAPTURE_HANDLE hCaptureHandle)
+{
+ if (!hCaptureHandle) {
+ return (PX_ERROR);
+ }
+
+ if (!hCaptureHandle->bOpened) {
+ return (PX_ERROR);
+ }
+
+ if (hCaptureHandle->bStarted) {
+ hCaptureHandle->bExitRequest = LW_TRUE;
+ pthread_join(hCaptureHandle->hServiceThread, NULL);
+ hCaptureHandle->bExitRequest = LW_FALSE;
+
+ hCaptureHandle->bStarted = LW_FALSE;
+ }
+
+ return (ERROR_NONE);
+}
+/*********************************************************************************************************
+** 函数名称: API_AudioCaptureStop
+** 功能描述: 停止音频捕捉器
+** 输 入 : hCaptureHandle 音频捕捉器句柄
+** 输 出 : ERROR CODE
+** 全局变量:
+** 调用模块:
+*********************************************************************************************************/
+static VOID *__AudioCaptureService(VOID *pvArg)
+{
+ AUDIO_CAPTURE_HANDLE hCaptureHandle = pvArg;
+ struct count_info iptr;
+ INT iRet;
+ INT iCurrentPtr = 0;
+ UINT uiTtriggerEnable;
+ fd_set rfds;
+ struct timeval tv;
+
+ uiTtriggerEnable = PCM_ENABLE_INPUT;
+ iRet = ioctl(hCaptureHandle->iFd, SNDCTL_DSP_SETTRIGGER, &uiTtriggerEnable);
+ if (iRet < 0) {
+ printf("failed to enable PCM input\n");
+ goto __error_handle;
+ }
+
+ uiTtriggerEnable = 0;
+ iRet = ioctl(hCaptureHandle->iFd, SNDCTL_DSP_GETTRIGGER, &uiTtriggerEnable);
+ if (iRet < 0) {
+ printf("failed to enable PCM input\n");
+ goto __error_handle;
+ }
+ if (!(uiTtriggerEnable & PCM_ENABLE_INPUT)) {
+ printf("failed to enable PCM input\n");
+ goto __error_handle;
+ }
+
+ FD_ZERO(&rfds);
+
+ tv.tv_sec = 0;
+ tv.tv_usec = 10000;
+
+ while (!hCaptureHandle->bExitRequest) {
+
+ iRet = ioctl(hCaptureHandle->iFd, SNDCTL_DSP_GETIPTR, &iptr);
+ if (iRet < 0) {
+ printf("failed to query playback status\n");
+ goto __error_handle;
+ }
+
+ if (iptr.ptr != iCurrentPtr) {
+
+ if (iptr.ptr > iCurrentPtr) {
+ hCaptureHandle->pfuncOnAudioCapture(hCaptureHandle->pvCbArg,
+ hCaptureHandle->pucDmaBuffer + iCurrentPtr,
+ iptr.ptr - iCurrentPtr);
+ } else {
+ hCaptureHandle->pfuncOnAudioCapture(hCaptureHandle->pvCbArg,
+ hCaptureHandle->pucDmaBuffer + iCurrentPtr,
+ hCaptureHandle->stDmaBufferSize - iCurrentPtr);
+ if (iptr.ptr) {
+ hCaptureHandle->pfuncOnAudioCapture(hCaptureHandle->pvCbArg,
+ hCaptureHandle->pucDmaBuffer,
+ iptr.ptr);
+ }
+ }
+
+ iCurrentPtr = iptr.ptr;
+
+ } else {
+ FD_SET(hCaptureHandle->iFd, &rfds);
+ select(hCaptureHandle->iFd + 1, &rfds, NULL, NULL, &tv);
+ }
+ }
+ __error_handle:
+
+ hCaptureHandle->bStarted = LW_FALSE;
+
+ return (NULL);
+}
+/*********************************************************************************************************
+** 函数名称: API_AudioPlayOpen
+** 功能描述: 打开音频播放器
+** 输 入 : NONE
+** 输 出 : 音频播放器句柄
+** 全局变量:
+** 调用模块:
+*********************************************************************************************************/
+AUDIO_PLAY_HANDLE API_AudioPlayOpen (VOID)
+{
+ AUDIO_PLAY_HANDLE hPlayHandle;
+
+ hPlayHandle = malloc(sizeof(AUDIO_PLAY_STRUCT));
+ if (hPlayHandle) {
+ memset(hPlayHandle, 0, sizeof(AUDIO_PLAY_STRUCT));
+
+ hPlayHandle->iFd = open("/dev/dsp", O_WRONLY, 0666);
+ if (hPlayHandle->iFd < 0) {
+ printf("failed to open /dev/dsp device!\n");
+ goto __error_handle;
+ }
+
+ hPlayHandle->bOpened = LW_TRUE;
+ }
+
+ return (hPlayHandle);
+
+ __error_handle:
+ free(hPlayHandle);
+ return (NULL);
+}
+/*********************************************************************************************************
+** 函数名称: API_AudioPlayClose
+** 功能描述: 关闭播放捕捉器
+** 输 入 : hPlayHandle 音频播放器句柄
+** 输 出 : ERROR CODE
+** 全局变量:
+** 调用模块:
+*********************************************************************************************************/
+INT API_AudioPlayClose (AUDIO_PLAY_HANDLE hPlayHandle)
+{
+ if (!hPlayHandle) {
+ return (PX_ERROR);
+ }
+
+ if (!hPlayHandle->bOpened) {
+ return (PX_ERROR);
+ }
+
+ close(hPlayHandle->iFd);
+ memset(hPlayHandle, 0, sizeof(AUDIO_PLAY_STRUCT));
+ free(hPlayHandle);
+ return (ERROR_NONE);
+}
+/*********************************************************************************************************
+** 函数名称: API_AudioPlaySetParam
+** 功能描述: 设置音频播放器工作参数
+** 输 入 : hPlayHandle 音频播放器句柄
+** pParam 音频播放器参数
+** 输 出 : ERROR CODE
+** 全局变量:
+** 调用模块:
+*********************************************************************************************************/
+INT API_AudioPlaySetParam (AUDIO_PLAY_HANDLE hPlayHandle, AUDIO_PLAY_PARAM *pParam)
+{
+ INT iRet;
+ INT iSampleFmt;
+ INT iChannel;
+ INT iSampleRate;
+
+ if (!hPlayHandle) {
+ return (PX_ERROR);
+ }
+
+ if (!pParam) {
+ return (PX_ERROR);
+ }
+
+ if (!hPlayHandle->bOpened) {
+ return (PX_ERROR);
+ }
+
+ iSampleFmt = pParam->iSampleSize;
+ iRet = ioctl(hPlayHandle->iFd, SNDCTL_DSP_SETFMT, &iSampleFmt);
+ if (iRet < 0) {
+ printf("failed to set sample format!\n");
+ goto __error_handle;
+ }
+
+ iChannel = pParam->iChannelNum;
+ iRet = ioctl(hPlayHandle->iFd, SNDCTL_DSP_CHANNELS, &iChannel);
+ if (iRet < 0) {
+ printf("failed to set channels!\n");
+ goto __error_handle;
+ }
+
+ iSampleRate = pParam->iSampleRate;
+ iRet = ioctl(hPlayHandle->iFd, SNDCTL_DSP_SPEED, &iSampleRate);
+ if (iRet < 0) {
+ printf("failed to set sample rate!\n");
+ goto __error_handle;
+ }
+
+ memcpy(&hPlayHandle->param, pParam, sizeof(AUDIO_PLAY_PARAM));
+
+ hPlayHandle->bConfiged = LW_TRUE;
+
+ return (ERROR_NONE);
+
+ __error_handle:
+ return (PX_ERROR);
+}
+/*********************************************************************************************************
+** 函数名称: API_AudioPlay
+** 功能描述: 音频播放器播放音频数据
+** 输 入 : hPlayHandle 音频播放器句柄
+** pvData 音频数据
+** stDataLen 音频数据长度(字节)
+** 输 出 : ERROR CODE
+** 全局变量:
+** 调用模块:
+*********************************************************************************************************/
+INT API_AudioPlay (AUDIO_PLAY_HANDLE hPlayHandle, const VOID *pvData, size_t stDataLen)
+{
+ ssize_t stRet;
+ const UINT8 *pucPtr;
+
+ if (!hPlayHandle) {
+ return (PX_ERROR);
+ }
+
+ if (!hPlayHandle->bOpened) {
+ return (PX_ERROR);
+ }
+
+ if (!hPlayHandle->bConfiged) {
+ return (PX_ERROR);
+ }
+
+ pucPtr = (const UINT8 *)pvData;
+
+ while (stDataLen > 0) {
+ stRet = write(hPlayHandle->iFd, pucPtr, stDataLen);
+ if (stRet < 0) {
+ return (PX_ERROR);
+ }
+ pucPtr += stRet;
+ stDataLen -= stRet;
+ }
+
+ return (ERROR_NONE);
+}
+/*********************************************************************************************************
+ END
+*********************************************************************************************************/
diff --git a/SylixOS/driver/audio/audioLib.h b/SylixOS/driver/audio/audioLib.h
new file mode 100644
index 0000000..79e7920
--- /dev/null
+++ b/SylixOS/driver/audio/audioLib.h
@@ -0,0 +1,175 @@
+/*********************************************************************************************************
+**
+** 中国软件开源组织
+**
+** 嵌入式实时操作系统
+**
+** SylixOS(TM)
+**
+** Copyright All Rights Reserved
+**
+**--------------文件信息--------------------------------------------------------------------------------
+**
+** 文 件 名: audioLib.c
+**
+** 创 建 人: Jiao.JinXing (焦进星)
+**
+** 文件创建日期: 2016 年 10 月 19 日
+**
+** 描 述: 音频库
+*********************************************************************************************************/
+#ifndef AUDIOLIB_H_
+#define AUDIOLIB_H_
+
+/*********************************************************************************************************
+ 类型定义
+*********************************************************************************************************/
+typedef struct {
+ INT iChannelNum; /* 通道数 */
+ INT iSampleRate; /* 采样率 */
+ INT iSampleSize; /* 采样大小 */
+ INT iFrameNum; /* 帧数 */
+ INT iFrameSize; /* 帧大小 */
+} AUDIO_CAPTURE_PARAM; /* 音频捕捉参数 */
+
+typedef struct {
+ INT iChannelNum; /* 通道数 */
+ INT iSampleRate; /* 采样率 */
+ INT iSampleSize; /* 采样大小 */
+} AUDIO_PLAY_PARAM; /* 音频播放参数 */
+
+/*
+ * 音频捕捉回调函数
+ */
+typedef VOID (*AUDIO_CATPURE_CALLBACK)(VOID *pvArg, /* 注册的回调函数参数 */
+ const VOID *pvData, /* 音频数据 */
+ size_t stDataLen); /* 音频数据长度(字节) */
+
+struct __AUDIO_CAPTURE_STRUCT;
+typedef struct __AUDIO_CAPTURE_STRUCT *AUDIO_CAPTURE_HANDLE; /* 音频捕捉句柄 */
+
+struct __AUDIO_PLAY_STRUCT;
+typedef struct __AUDIO_PLAY_STRUCT *AUDIO_PLAY_HANDLE; /* 音频播放句柄 */
+
+/*********************************************************************************************************
+** 函数名称: API_AudioLibInit
+** 功能描述: 初始化音频库
+** 输 入 : NONE
+** 输 出 : ERROR CODE
+** 全局变量:
+** 调用模块:
+*********************************************************************************************************/
+INT API_AudioLibInit(VOID);
+
+/*********************************************************************************************************
+** 函数名称: API_AudioLibDeInit
+** 功能描述: 清理音频库
+** 输 入 : NONE
+** 输 出 : ERROR CODE
+** 全局变量:
+** 调用模块:
+*********************************************************************************************************/
+INT API_AudioLibDeInit(VOID);
+
+/*********************************************************************************************************
+** 函数名称: API_AudioCaptureOpen
+** 功能描述: 打开音频捕捉器
+** 输 入 : NONE
+** 输 出 : 音频捕捉器句柄
+** 全局变量:
+** 调用模块:
+*********************************************************************************************************/
+AUDIO_CAPTURE_HANDLE API_AudioCaptureOpen(VOID);
+
+/*********************************************************************************************************
+** 函数名称: API_AudioCaptureClose
+** 功能描述: 关闭音频捕捉器
+** 输 入 : hCaptureHandle 音频捕捉器句柄
+** 输 出 : ERROR CODE
+** 全局变量:
+** 调用模块:
+*********************************************************************************************************/
+INT API_AudioCaptureClose(AUDIO_CAPTURE_HANDLE hCaptureHandle);
+
+/*********************************************************************************************************
+** 函数名称: API_AudioCaptureSetParam
+** 功能描述: 设置音频捕捉器工作参数
+** 输 入 : hCaptureHandle 音频捕捉器句柄
+** pParam 音频捕捉参数
+** 输 出 : ERROR CODE
+** 全局变量:
+** 调用模块:
+*********************************************************************************************************/
+INT API_AudioCaptureSetParam(AUDIO_CAPTURE_HANDLE hCaptureHandle, AUDIO_CAPTURE_PARAM *pParam);
+
+/*********************************************************************************************************
+** 函数名称: API_AudioCaptureStart
+** 功能描述: 启动音频捕捉器
+** 输 入 : hCaptureHandle 音频捕捉器句柄
+** pfuncOnAudioCapture 音频捕捉回调函数
+** pvCbArg 音频捕捉回调函数参数
+** 输 出 : ERROR CODE
+** 全局变量:
+** 调用模块:
+*********************************************************************************************************/
+INT API_AudioCaptureStart(AUDIO_CAPTURE_HANDLE hCaptureHandle,
+ AUDIO_CATPURE_CALLBACK pfuncOnAudioCapture,
+ VOID *pvCbArg);
+
+/*********************************************************************************************************
+** 函数名称: API_AudioCaptureStop
+** 功能描述: 停止音频捕捉器
+** 输 入 : hCaptureHandle 音频捕捉器句柄
+** 输 出 : ERROR CODE
+** 全局变量:
+** 调用模块:
+*********************************************************************************************************/
+INT API_AudioCaptureStop(AUDIO_CAPTURE_HANDLE hCaptureHandle);
+
+/*********************************************************************************************************
+** 函数名称: API_AudioPlayOpen
+** 功能描述: 打开音频播放器
+** 输 入 : NONE
+** 输 出 : 音频播放器句柄
+** 全局变量:
+** 调用模块:
+*********************************************************************************************************/
+AUDIO_PLAY_HANDLE API_AudioPlayOpen(VOID);
+
+/*********************************************************************************************************
+** 函数名称: API_AudioPlayClose
+** 功能描述: 关闭播放捕捉器
+** 输 入 : hPlayHandle 音频播放器句柄
+** 输 出 : ERROR CODE
+** 全局变量:
+** 调用模块:
+*********************************************************************************************************/
+INT API_AudioPlayClose(AUDIO_PLAY_HANDLE hPlayHandle);
+
+/*********************************************************************************************************
+** 函数名称: API_AudioPlaySetParam
+** 功能描述: 设置音频播放器工作参数
+** 输 入 : hPlayHandle 音频播放器句柄
+** pParam 音频播放器参数
+** 输 出 : ERROR CODE
+** 全局变量:
+** 调用模块:
+*********************************************************************************************************/
+INT API_AudioPlaySetParam(AUDIO_PLAY_HANDLE hPlayHandle, AUDIO_PLAY_PARAM *pParam);
+
+/*********************************************************************************************************
+** 函数名称: API_AudioPlay
+** 功能描述: 音频播放器播放音频数据
+** 输 入 : hPlayHandle 音频播放器句柄
+** pvData 音频数据
+** stDataLen 音频数据长度(字节)
+** 输 出 : ERROR CODE
+** 全局变量:
+** 调用模块:
+*********************************************************************************************************/
+INT API_AudioPlay(AUDIO_PLAY_HANDLE hPlayHandle, const VOID *pvData, size_t stDataLen);
+
+#endif /* AUDIOLIB_H_ */
+/*********************************************************************************************************
+ END
+*********************************************************************************************************/
diff --git a/SylixOS/driver/audio/audioLibTest1.c b/SylixOS/driver/audio/audioLibTest1.c
new file mode 100644
index 0000000..5fae34f
--- /dev/null
+++ b/SylixOS/driver/audio/audioLibTest1.c
@@ -0,0 +1,150 @@
+/*********************************************************************************************************
+**
+** 中国软件开源组织
+**
+** 嵌入式实时操作系统
+**
+** SylixOS(TM)
+**
+** Copyright All Rights Reserved
+**
+**--------------文件信息--------------------------------------------------------------------------------
+**
+** 文 件 名: audioLibTest.c
+**
+** 创 建 人: Jiao.JinXing (焦进星)
+**
+** 文件创建日期: 2016 年 10 月 19 日
+**
+** 描 述: 音频库测试
+*********************************************************************************************************/
+#include "SylixOS.h"
+#include "unistd.h"
+#include "pthread.h"
+
+#include "stdlib.h"
+#include "stdio.h"
+#include "string.h"
+
+#include "audioLib.h"
+
+#include "time.h"
+/*********************************************************************************************************
+ 定义
+*********************************************************************************************************/
+#define __AUDIOLIB_TEST_BUFFER_LEN 10 * 1024
+#define __AUDIOLIB_TEST_WAV_FILE "/apps/wo.wav"
+
+#define __AUDIOLIB_TEST_SAMPLE_RATE 8000 /* 采样率 */
+#define __AUDIOLIB_TEST_CHANNELS 2 /* 通道数 */
+#define __AUDIOLIB_TEST_SAMPLE_SIZE 16 /* 采样大小(位数) */
+#define __AUDIOLIB_TEST_FRAME_NUM 4 /* 帧数 */
+/*
+ * 每帧的大小为 320 字节
+ * 由于是双通道,每帧含一个通道的数据大小是 160 字节,
+ * 每个采样的大小是 16bit,每帧含一个通道的采样数是 80 个,
+ * 采样率是 8000,所以每帧的时间是 80/8000 秒 = 10ms
+ */
+#define __AUDIOLIB_TEST_FRAME_SIZE 320 /* 帧大小 */
+/*********************************************************************************************************
+ 全局变量
+*********************************************************************************************************/
+static AUDIO_CAPTURE_HANDLE _G_hCaptureHandle; /* 音频捕捉器句柄 */
+static AUDIO_PLAY_HANDLE _G_hPlayHandle; /* 音频播放器句柄 */
+/*********************************************************************************************************
+** 函数名称: audio_capture_callback
+** 功能描述: 音频捕捉回调
+** 输 入 : arg 注册的回调函数参数
+** data 音频数据
+** len 音频数据长度(字节)
+** 输 出 : NONE
+** 全局变量:
+** 调用模块:
+*********************************************************************************************************/
+static void audio_capture_callback (void *arg, const void *data, size_t len)
+{
+ struct timespec tvNow;
+
+ lib_clock_gettime(CLOCK_REALTIME, &tvNow); /* 获得当前系统时间 */
+
+ printf("sec=%lld, ms=%ld\n", tvNow.tv_sec, tvNow.tv_nsec / 1000000);
+}
+/*********************************************************************************************************
+** 函数名称: audio_lib_test1
+** 功能描述: 音频库测试
+** 输 入 : NONE
+** 输 出 : NONE
+** 全局变量:
+** 调用模块:
+*********************************************************************************************************/
+int audio_lib_test1 (int argc, char **argv)
+{
+ ssize_t len;
+ CHAR *buf;
+ INT fd;
+ AUDIO_CAPTURE_PARAM captureParam;
+ AUDIO_PLAY_PARAM playParam;
+
+ API_AudioLibInit(); /* 初始化音频库 */
+
+ _G_hCaptureHandle = API_AudioCaptureOpen(); /* 打开音频捕捉器 */
+
+ captureParam.iChannelNum = __AUDIOLIB_TEST_CHANNELS;
+ captureParam.iFrameNum = __AUDIOLIB_TEST_FRAME_NUM;
+ captureParam.iFrameSize = __AUDIOLIB_TEST_FRAME_SIZE;
+ captureParam.iSampleRate = __AUDIOLIB_TEST_SAMPLE_RATE;
+ captureParam.iSampleSize = __AUDIOLIB_TEST_SAMPLE_SIZE;
+
+ API_AudioCaptureSetParam(_G_hCaptureHandle, &captureParam); /* 设置音频捕捉参数 */
+
+ API_AudioCaptureStart(_G_hCaptureHandle,
+ audio_capture_callback,
+ NULL); /* 启动音频捕捉 */
+
+ _G_hPlayHandle = API_AudioPlayOpen(); /* 打开音频播放器 */
+
+ playParam.iChannelNum = __AUDIOLIB_TEST_CHANNELS;
+ playParam.iSampleRate = __AUDIOLIB_TEST_SAMPLE_RATE;
+ playParam.iSampleSize = __AUDIOLIB_TEST_SAMPLE_SIZE;
+
+ API_AudioPlaySetParam(_G_hPlayHandle, &playParam); /* 设置音频播放参数 */
+
+ buf = malloc(__AUDIOLIB_TEST_BUFFER_LEN); /* 分配缓冲区 */
+ if (!buf) {
+ printf("failed to alloc buffer!\n");
+ return (-1);
+ }
+
+ fd = open(__AUDIOLIB_TEST_WAV_FILE, O_RDONLY, 0666); /* 打开 wav 文件 */
+ if (fd < 0) {
+ printf("failed to open test audio file %s!\n", __AUDIOLIB_TEST_WAV_FILE);
+ return (-1);
+ }
+
+ while (1) {
+
+ lseek(fd, 0x2E * 2, SEEK_SET); /* 跳过文件头 */
+
+ while ((len = read(fd, buf, __AUDIOLIB_TEST_BUFFER_LEN)) > 0) { /* 读文件 */
+
+ API_AudioPlay(_G_hPlayHandle, buf, len); /* 播放音频 */
+ }
+ }
+
+ close(fd); /* 关闭 wav 文件 */
+
+ free(buf); /* 释放缓冲区 */
+
+ API_AudioCaptureStop(_G_hCaptureHandle); /* 停止音频捕捉 */
+
+ API_AudioCaptureClose(_G_hCaptureHandle); /* 关闭音频捕捉器 */
+
+ API_AudioPlayClose(_G_hPlayHandle); /* 关闭音频播放器 */
+
+ API_AudioLibDeInit(); /* 清理音频库 */
+
+ return (0);
+}
+/*********************************************************************************************************
+ END
+*********************************************************************************************************/
diff --git a/SylixOS/driver/audio/audioLibTest2.c b/SylixOS/driver/audio/audioLibTest2.c
new file mode 100644
index 0000000..99332ba
--- /dev/null
+++ b/SylixOS/driver/audio/audioLibTest2.c
@@ -0,0 +1,123 @@
+/*********************************************************************************************************
+**
+** 中国软件开源组织
+**
+** 嵌入式实时操作系统
+**
+** SylixOS(TM)
+**
+** Copyright All Rights Reserved
+**
+**--------------文件信息--------------------------------------------------------------------------------
+**
+** 文 件 名: audioLibTest.c
+**
+** 创 建 人: Jiao.JinXing (焦进星)
+**
+** 文件创建日期: 2016 年 10 月 19 日
+**
+** 描 述: 音频库测试
+*********************************************************************************************************/
+#include "SylixOS.h"
+#include "unistd.h"
+#include "pthread.h"
+
+#include "stdlib.h"
+#include "stdio.h"
+#include "string.h"
+
+#include "audioLib.h"
+
+#include "time.h"
+/*********************************************************************************************************
+ 定义
+*********************************************************************************************************/
+#define __AUDIOLIB_TEST_BUFFER_LEN 10 * 1024
+#define __AUDIOLIB_TEST_WAV_FILE "/apps/wo.wav"
+
+#define __AUDIOLIB_TEST_SAMPLE_RATE 8000 /* 采样率 */
+#define __AUDIOLIB_TEST_CHANNELS 2 /* 通道数 */
+#define __AUDIOLIB_TEST_SAMPLE_SIZE 16 /* 采样大小(位数) */
+#define __AUDIOLIB_TEST_FRAME_NUM 4 /* 帧数 */
+/*
+ * 每帧的大小为 320 字节
+ * 由于是双通道,每帧含一个通道的数据大小是 160 字节,
+ * 每个采样的大小是 16bit,每帧含一个通道的采样数是 80 个,
+ * 采样率是 8000,所以每帧的时间是 80/8000 秒 = 10ms
+ */
+#define __AUDIOLIB_TEST_FRAME_SIZE 320 /* 帧大小 */
+/*********************************************************************************************************
+ 全局变量
+*********************************************************************************************************/
+static AUDIO_CAPTURE_HANDLE _G_hCaptureHandle; /* 音频捕捉器句柄 */
+static AUDIO_PLAY_HANDLE _G_hPlayHandle; /* 音频播放器句柄 */
+/*********************************************************************************************************
+** 函数名称: audio_capture_callback
+** 功能描述: 音频捕捉回调
+** 输 入 : arg 注册的回调函数参数
+** data 音频数据
+** len 音频数据长度(字节)
+** 输 出 : NONE
+** 全局变量:
+** 调用模块:
+*********************************************************************************************************/
+static void audio_capture_callback (void *arg, const void *data, size_t len)
+{
+ if (_G_hPlayHandle) {
+ API_AudioPlay(_G_hPlayHandle, data, len); /* 播放音频 */
+ }
+}
+/*********************************************************************************************************
+** 函数名称: audio_lib_test2
+** 功能描述: 音频库测试
+** 输 入 : NONE
+** 输 出 : NONE
+** 全局变量:
+** 调用模块:
+*********************************************************************************************************/
+int audio_lib_test2 (int argc, char **argv)
+{
+ AUDIO_CAPTURE_PARAM captureParam;
+ AUDIO_PLAY_PARAM playParam;
+
+ API_AudioLibInit(); /* 初始化音频库 */
+
+ _G_hCaptureHandle = API_AudioCaptureOpen(); /* 打开音频捕捉器 */
+
+ captureParam.iChannelNum = __AUDIOLIB_TEST_CHANNELS;
+ captureParam.iFrameNum = __AUDIOLIB_TEST_FRAME_NUM;
+ captureParam.iFrameSize = __AUDIOLIB_TEST_FRAME_SIZE;
+ captureParam.iSampleRate = __AUDIOLIB_TEST_SAMPLE_RATE;
+ captureParam.iSampleSize = __AUDIOLIB_TEST_SAMPLE_SIZE;
+
+ API_AudioCaptureSetParam(_G_hCaptureHandle, &captureParam); /* 设置音频捕捉参数 */
+
+ API_AudioCaptureStart(_G_hCaptureHandle,
+ audio_capture_callback,
+ NULL); /* 启动音频捕捉 */
+
+ _G_hPlayHandle = API_AudioPlayOpen(); /* 打开音频播放器 */
+
+ playParam.iChannelNum = __AUDIOLIB_TEST_CHANNELS;
+ playParam.iSampleRate = __AUDIOLIB_TEST_SAMPLE_RATE;
+ playParam.iSampleSize = __AUDIOLIB_TEST_SAMPLE_SIZE;
+
+ API_AudioPlaySetParam(_G_hPlayHandle, &playParam); /* 设置音频播放参数 */
+
+ while (1) {
+ sleep(1);
+ }
+
+ API_AudioCaptureStop(_G_hCaptureHandle); /* 停止音频捕捉 */
+
+ API_AudioCaptureClose(_G_hCaptureHandle); /* 关闭音频捕捉器 */
+
+ API_AudioPlayClose(_G_hPlayHandle); /* 关闭音频播放器 */
+
+ API_AudioLibDeInit(); /* 清理音频库 */
+
+ return (0);
+}
+/*********************************************************************************************************
+ END
+*********************************************************************************************************/
diff --git a/SylixOS/driver/audio/codec/tlv320aic3x/tlv320aic3x.c b/SylixOS/driver/audio/codec/tlv320aic3x/tlv320aic3x.c
index 176e3e9..5704c2a 100644
--- a/SylixOS/driver/audio/codec/tlv320aic3x/tlv320aic3x.c
+++ b/SylixOS/driver/audio/codec/tlv320aic3x/tlv320aic3x.c
@@ -408,53 +408,49 @@ static INT __aic3xSampleRateConfig (PLW_I2C_DEVICE pI2cDev,
UINT16 pllDval = 1920u;
/* Select the configuration for the given sampling rate */
- switch (uiSampleRate / 2) {
- case 4000:
+ switch (uiSampleRate) {
+ case 8000: /* FSref = 48 kHz */
fs = 0xAAu;
break;
- case 8000:
- fs = 0xAAu;
- break;
-
- case 11025:
+ case 11025: /* FSref = 44.1 kHz */
fs = 0x66u;
ref = 0x8Au;
pllJval = 7u;
pllDval = 5264u;
break;
- case 16000:
+ case 16000: /* FSref = 48 kHz */
fs = 0x44u;
break;
- case 22050:
+ case 22050: /* FSref = 44.1 kHz */
fs = 0x22u;
ref = 0x8Au;
pllJval = 7u;
pllDval = 5264u;
break;
- case 24000:
+ case 24000: /* FSref = 48 kHz */
fs = 0x22u;
break;
- case 32000:
+ case 32000: /* FSref = 48 kHz */
fs = 0x11u;
break;
- case 44100:
+ case 44100: /* FSref = 44.1 kHz */
ref = 0x8Au;
fs = 0x00u;
pllJval = 7u;
pllDval = 5264u;
break;
- case 48000:
+ case 48000: /* FSref = 48 kHz */
fs = 0x00u;
break;
- case 96000:
+ case 96000: /* FSref = 48 kHz */
ref = 0x6Au;
fs = 0x00u;
break;
@@ -471,10 +467,10 @@ static INT __aic3xSampleRateConfig (PLW_I2C_DEVICE pI2cDev,
__aic3xCodecRegWrite(pI2cDev, AIC31_P0_REG3, 0x80 | pllPval);
/* use PLL_CLK_IN as MCLK */
- __aic3xCodecRegWrite(pI2cDev, AIC31_P0_REG102, 0x08);
+ __aic3xCodecRegWrite(pI2cDev, AIC31_P0_REG102, 0x02);
/* Use PLL DIV OUT as codec CLK IN */
- __aic3xCodecRegBitClr(pI2cDev, AIC31_P0_REG101, 0x01);
+ __aic3xCodecRegBitClr(pI2cDev, AIC31_P0_REG101, 0x00);
/* Select GPIO to output the divided PLL IN */
__aic3xCodecRegWrite(pI2cDev, AIC31_P0_REG98, 0x20);
diff --git a/SylixOS/driver/audio/dsp/dspDrv.c b/SylixOS/driver/audio/dsp/dspDrv.c
index ac04c65..33a0765 100644
--- a/SylixOS/driver/audio/dsp/dspDrv.c
+++ b/SylixOS/driver/audio/dsp/dspDrv.c
@@ -37,6 +37,10 @@
((iFlags & O_ACCMODE) == O_RDWR))
#define __DSP_CAN_WRITE(iFlags) (((iFlags & O_ACCMODE) == O_WRONLY) || \
((iFlags & O_ACCMODE) == O_RDWR))
+
+#ifndef ALIGN
+#define ALIGN(p, align) (((unsigned long)(p) + (align - 1)) & ~(align - 1))
+#endif
/*********************************************************************************************************
DSP 设备类型定义
*********************************************************************************************************/
@@ -187,8 +191,9 @@ static LONG __dspOpen (PLW_DEV_HDR pDev,
/*
* 分配读写缓冲区
*/
- pDspDev->DSP_pucBlockBuffer = API_VmmDmaAllocAlign(pDspDev->DSP_ulBlockCounter *
- pDspDev->DSP_stBlockSize * 2,
+ pDspDev->DSP_pucBlockBuffer = API_VmmDmaAllocAlign(ALIGN(pDspDev->DSP_ulBlockCounter * \
+ pDspDev->DSP_stBlockSize,
+ LW_CFG_VMM_PAGE_SIZE) * 2,
LW_CFG_VMM_PAGE_SIZE);
if (pDspDev->DSP_pucBlockBuffer == LW_NULL) {
printk(KERN_ERR "__dspOpen(): failed to alloc block buffer!\n");
@@ -198,7 +203,9 @@ static LONG __dspOpen (PLW_DEV_HDR pDev,
pDspDev->DSP_pucReadBlockBuffer = pDspDev->DSP_pucBlockBuffer;
pDspDev->DSP_pucWriteBlockBuffer = pDspDev->DSP_pucBlockBuffer +
- pDspDev->DSP_ulBlockCounter * pDspDev->DSP_stBlockSize;
+ ALIGN(pDspDev->DSP_ulBlockCounter * \
+ pDspDev->DSP_stBlockSize,
+ LW_CFG_VMM_PAGE_SIZE);
/*
* 初始化读写队列
@@ -663,7 +670,8 @@ static INT __dspLstat (PLW_DEV_HDR pDev,
pStat->st_gid = 0;
pStat->st_rdev = 0;
/* 总大小为读写缓冲区大小之和 */
- pStat->st_size = pDspDev->DSP_ulBlockCounter * pDspDev->DSP_stBlockSize * 2;
+ pStat->st_size = ALIGN(pDspDev->DSP_ulBlockCounter * pDspDev->DSP_stBlockSize,
+ LW_CFG_VMM_PAGE_SIZE) * 2;
pStat->st_blksize = pDspDev->DSP_stBlockSize;
pStat->st_blocks = pDspDev->DSP_ulBlockCounter * 2; /* 总块数为读写块数之和 */
pStat->st_atime = pDspDev->DSP_time;
@@ -718,7 +726,8 @@ static INT __dspIoctl (PLW_FD_ENTRY pFdEntry,
pStat->st_gid = 0;
pStat->st_rdev = 0;
/* 总大小为读写缓冲区大小之和 */
- pStat->st_size = pDspDev->DSP_ulBlockCounter * pDspDev->DSP_stBlockSize * 2;
+ pStat->st_size = ALIGN(pDspDev->DSP_ulBlockCounter * pDspDev->DSP_stBlockSize,
+ LW_CFG_VMM_PAGE_SIZE) * 2;
pStat->st_blksize = pDspDev->DSP_stBlockSize;
pStat->st_blocks = pDspDev->DSP_ulBlockCounter * 2; /* 总块数为读写块数之和 */
pStat->st_atime = pDspDev->DSP_time;
@@ -1011,11 +1020,16 @@ static INT __dspIoctl (PLW_FD_ENTRY pFdEntry,
!pDspDev->DSP_bBatchReadStarted &&
!pDspDev->DSP_bBatchWriteStarted) {
- INT i;
+
ulBlockCounter = *pIntData >> 16; /* 块数目 */
- stBlockSize = 1; /* 计算块大小 */
- for (i = 0; i < (*pIntData & 0xFFFF); i++) {
- stBlockSize *= 2;
+ if ((*pIntData & 0xFFFF) <= 16) {
+ INT i;
+ stBlockSize = 1; /* 计算块大小 */
+ for (i = 0; i < (*pIntData & 0xFFFF); i++) {
+ stBlockSize *= 2;
+ }
+ } else {
+ stBlockSize = *pIntData & 0xFFFF;
}
if ((ulBlockCounter <= __DSP_MAX_FRAGMENT_NUM) &&
@@ -1046,7 +1060,8 @@ static INT __dspIoctl (PLW_FD_ENTRY pFdEntry,
/*
* 分配读写缓冲区
*/
- pucBlockBuffer = API_VmmDmaAllocAlign(ulBlockCounter * stBlockSize * 2,
+ pucBlockBuffer = API_VmmDmaAllocAlign(ALIGN(ulBlockCounter * stBlockSize,
+ LW_CFG_VMM_PAGE_SIZE) * 2,
LW_CFG_VMM_PAGE_SIZE);
if (pucBlockBuffer == LW_NULL) {
printk(KERN_ERR "__dspIoctl(): failed to alloc block buffer!\n");
@@ -1075,7 +1090,8 @@ static INT __dspIoctl (PLW_FD_ENTRY pFdEntry,
pDspDev->DSP_pucReadBlockBuffer = pDspDev->DSP_pucBlockBuffer;
pDspDev->DSP_pucWriteBlockBuffer = pDspDev->DSP_pucBlockBuffer +
- pDspDev->DSP_ulBlockCounter * pDspDev->DSP_stBlockSize;
+ ALIGN(pDspDev->DSP_ulBlockCounter * pDspDev->DSP_stBlockSize,
+ LW_CFG_VMM_PAGE_SIZE);
/*
* 初始化读写队列
@@ -1454,7 +1470,8 @@ static INT __dspMmapRead (PLW_FD_ENTRY pFdEntry,
}
if (pMmapArea->DMAP_stLen !=
- pDspDev->DSP_stBlockSize * pDspDev->DSP_ulBlockCounter) { /* mmap 长度不正确 */
+ ALIGN(pDspDev->DSP_stBlockSize * pDspDev->DSP_ulBlockCounter,
+ LW_CFG_VMM_PAGE_SIZE)) { /* mmap 长度不正确 */
_ErrorHandle(EINVAL);
return (PX_ERROR);
}
@@ -1499,7 +1516,8 @@ static INT __dspMmapWrite (PLW_FD_ENTRY pFdEntry,
}
if (pMmapArea->DMAP_stLen !=
- pDspDev->DSP_stBlockSize * pDspDev->DSP_ulBlockCounter) { /* mmap 长度不正确 */
+ ALIGN(pDspDev->DSP_stBlockSize * pDspDev->DSP_ulBlockCounter,
+ LW_CFG_VMM_PAGE_SIZE)) { /* mmap 长度不正确 */
_ErrorHandle(EINVAL);
return (PX_ERROR);
}
@@ -1552,7 +1570,8 @@ static INT __dspMmapReadWrite (PLW_FD_ENTRY pFdEntry,
}
if (pMmapArea->DMAP_stLen !=
- pDspDev->DSP_stBlockSize * pDspDev->DSP_ulBlockCounter * 2) { /* mmap 长度不正确 */
+ ALIGN(pDspDev->DSP_stBlockSize * pDspDev->DSP_ulBlockCounter,
+ LW_CFG_VMM_PAGE_SIZE) * 2) { /* mmap 长度不正确 */
_ErrorHandle(EINVAL);
return (PX_ERROR);
}
diff --git a/SylixOS/driver/audio/dsp/dspDrv.h b/SylixOS/driver/audio/dsp/dspDrv.h
index 9fc0405..e2e62b6 100644
--- a/SylixOS/driver/audio/dsp/dspDrv.h
+++ b/SylixOS/driver/audio/dsp/dspDrv.h
@@ -27,8 +27,8 @@
#define __DSP_DEFAULT_FRAGMENT_NUM (4)
#define __DSP_MAX_FRAGMENT_NUM (32)
-#define __DSP_MIN_FRAGMENT_SIZE (1024)
-#define __DSP_DEFAULT_FRAGMENT_SIZE (8 * 1024)
+#define __DSP_MIN_FRAGMENT_SIZE (128)
+#define __DSP_DEFAULT_FRAGMENT_SIZE (8 * 1024)
#define __DSP_MAX_FRAGMENT_SIZE (64 * 1024)
/*********************************************************************************************************
** 函数名称: dspDrv
diff --git a/SylixOS/driver/mcasp/am335x_mcasp.c b/SylixOS/driver/mcasp/am335x_mcasp.c
index 3566153..5824535 100644
--- a/SylixOS/driver/mcasp/am335x_mcasp.c
+++ b/SylixOS/driver/mcasp/am335x_mcasp.c
@@ -36,10 +36,10 @@
#define __MCASP_CHANNEL_NR (2)
/* Slot size to send/receive data */
-#define __MCASP_DEFAULT_SLOT_SIZE (16)
+#define __MCASP_DEFAULT_SLOT_SIZE (32)
/* Word size to send/receive data. Word size <= Slot size */
-#define __MCASP_DEFAULT_WORD_SIZE (16)
+#define __MCASP_DEFAULT_WORD_SIZE (32)
#define __MCASP_I2S_CHANNELS_NUM (2)
@@ -50,7 +50,7 @@
#define PAR_RX_START (70)
#define PAR_TX_START (PAR_RX_START + __MCASP_DMA_MAX_NODE_NUM)
-#define __MSASP_AUIDO_BUF_SIZE (4096)
+#define __MSASP_AUIDO_BUF_SIZE (512)
/*
** Definitions which are not configurable
@@ -467,8 +467,8 @@ static VOID __am335xMcAspTxDmaInit (__PAM335X_MCASP_CHANNEL pMcAspChannel)
API_QueueInit(&pMcAspChannel->MCASP_txMsgQueue, __DSP_MAX_FRAGMENT_NUM);
- pMcAspChannel->MCASP_pucRxDmaBufferDummy = API_VmmDmaAlloc(__MSASP_AUIDO_BUF_SIZE);
- lib_bzero(pMcAspChannel->MCASP_pucRxDmaBufferDummy, __MSASP_AUIDO_BUF_SIZE);
+ pMcAspChannel->MCASP_pucTxDmaBufferDummy = API_VmmDmaAlloc(__MSASP_AUIDO_BUF_SIZE);
+ lib_bzero(pMcAspChannel->MCASP_pucTxDmaBufferDummy, __MSASP_AUIDO_BUF_SIZE);
for (i = 0; i < __MCASP_DMA_MAX_NODE_NUM; i++) {
pDmaJob = &pMcAspChannel->MCASP_ringTxDmaJob[i];
@@ -483,7 +483,7 @@ static VOID __am335xMcAspTxDmaInit (__PAM335X_MCASP_CHANNEL pMcAspChannel)
pDmaJob->DMAJOB_paramSet.opt = OPT_FIFO_WIDTH | TX_DMA_INT_ENABLE(pMcAspChannel->MCASP_uiTxDmaChannel);
- pDmaJob->DMAJOB_paramSet.srcAddr = (UINT)pMcAspChannel->MCASP_pucRxDmaBufferDummy;
+ pDmaJob->DMAJOB_paramSet.srcAddr = (UINT)pMcAspChannel->MCASP_pucTxDmaBufferDummy;
pDmaJob->DMAJOB_paramSet.destAddr = pMcAspChannel->MCASP_ulDataPhyAddrBase;
pDmaJob->DMAJOB_paramSet.aCnt = pMcAspChannel->MCASP_iBytesPerSample;
@@ -651,8 +651,7 @@ static VOID __am335xMcAspI2SConfigure (__PAM335X_MCASP_CHANNEL pMcAspChannel)
McASPTxFmtI2SSet(pMcAspChannel->MCASP_ulCtrlVirtAddrBase,
__MCASP_DEFAULT_WORD_SIZE, __MCASP_DEFAULT_SLOT_SIZE, MCASP_TX_MODE_DMA);
- pMcAspChannel->MCASP_iBytesPerSample = ((__MCASP_DEFAULT_WORD_SIZE >> 3) *
- __MCASP_I2S_CHANNELS_NUM);
+ pMcAspChannel->MCASP_iBytesPerSample = __MCASP_DEFAULT_WORD_SIZE >> 3;
/* Configure the frame sync. I2S shall work in TDM format with 2 slots */
McASPRxFrameSyncCfg(pMcAspChannel->MCASP_ulCtrlVirtAddrBase, 2, MCASP_RX_FS_WIDTH_WORD,
diff --git a/bspbeaglebone.mk b/bspbeaglebone.mk
new file mode 100644
index 0000000..344c58e
--- /dev/null
+++ b/bspbeaglebone.mk
@@ -0,0 +1,187 @@
+#*********************************************************************************************************
+#
+# 中国软件开源组织
+#
+# 嵌入式实时操作系统
+#
+# SylixOS(TM) LW : long wing
+#
+# Copyright All Rights Reserved
+#
+#--------------文件信息--------------------------------------------------------------------------------
+#
+# 文 件 名: bspok335xs.mk
+#
+# 创 建 人: RealEvo-IDE
+#
+# 文件创建日期: 2016 年 10 月 20 日
+#
+# 描 述: 本文件由 RealEvo-IDE 生成,用于配置 Makefile 功能,请勿手动修改
+#*********************************************************************************************************
+
+#*********************************************************************************************************
+# Clear setting
+#*********************************************************************************************************
+include $(CLEAR_VARS_MK)
+
+#*********************************************************************************************************
+# Target
+#*********************************************************************************************************
+LOCAL_TARGET_NAME := bspbeaglebone.elf
+
+#*********************************************************************************************************
+# Source list
+#*********************************************************************************************************
+LOCAL_SRCS := \
+SylixOS/bsp/startup.S \
+SylixOS/bsp/bspInit.c \
+SylixOS/bsp/bspLib.c \
+SylixOS/bsp/beaglebone/bspBeaglebone.c \
+SylixOS/driver/adc/am335x_adc.c \
+SylixOS/driver/adc/am335x_adc_test.c \
+SylixOS/driver/audio/audioLib.c \
+SylixOS/driver/audio/audioLibTest1.c \
+SylixOS/driver/audio/audioLibTest2.c \
+SylixOS/driver/audio/codec/codecDrv.c \
+SylixOS/driver/audio/codec/tlv320aic3x/tlv320aic3x.c \
+SylixOS/driver/audio/dsp/dspDrv.c \
+SylixOS/driver/audio/mixer/mixerDrv.c \
+SylixOS/driver/audio/oss_test.c \
+SylixOS/driver/audio/queue/queueLib.c \
+SylixOS/driver/beep/beep.c \
+SylixOS/driver/beep/beep_test.c \
+SylixOS/driver/can/am335x_can.c \
+SylixOS/driver/can/am335x_can_test.c \
+SylixOS/driver/can/dcan_frame.c \
+SylixOS/driver/clock/am335x_clock.c \
+SylixOS/driver/clock/am335x_clock_data.c \
+SylixOS/driver/dma/am335x_dma.c \
+SylixOS/driver/dma/am335x_dma_test.c \
+SylixOS/driver/ds1337/ds1337.c \
+SylixOS/driver/ds1337/ds1337_test.c \
+SylixOS/driver/dvfs/dvfs.c \
+SylixOS/driver/ecap/am335x_ecap.c \
+SylixOS/driver/ecap/am335x_ecap_test.c \
+SylixOS/driver/ft5x06/ft5x06.c \
+SylixOS/driver/ft5x06/ft5x06_test.c \
+SylixOS/driver/gpio/am335x_gpio.c \
+SylixOS/driver/gpio/am335x_gpio_test.c \
+SylixOS/driver/i2c/am335x_i2c.c \
+SylixOS/driver/lcd/am335x_lcd.c \
+SylixOS/driver/lcd/am335x_lcd_touch_test.c \
+SylixOS/driver/mcasp/am335x_mcasp.c \
+SylixOS/driver/memory/am335x_nand.c \
+SylixOS/driver/memory/elm/elm.c \
+SylixOS/driver/memory/gpmc/gpmc-nand.c \
+SylixOS/driver/memory/gpmc/gpmc.c \
+SylixOS/driver/memory/memory_port.c \
+SylixOS/driver/memory/nand/omap2.c \
+SylixOS/driver/netif/am335x_cpsw.c \
+SylixOS/driver/netif/cpswif.c \
+SylixOS/driver/netif/netio/netio.c \
+SylixOS/driver/pinmux/mux.c \
+SylixOS/driver/pinmux/mux2420.c \
+SylixOS/driver/pinmux/mux2430.c \
+SylixOS/driver/pinmux/mux33xx.c \
+SylixOS/driver/pinmux/mux34xx.c \
+SylixOS/driver/pinmux/mux44xx.c \
+SylixOS/driver/pinmux/mux_port.c \
+SylixOS/driver/pwm/am335x_pwm.c \
+SylixOS/driver/rtc/am335x_rtc.c \
+SylixOS/driver/rtc/am335x_rtc_test.c \
+SylixOS/driver/sdi/am335x_sdi.c \
+SylixOS/driver/sdi/am335x_sdi_init.c \
+SylixOS/driver/sio/am335x_sio.c \
+SylixOS/driver/sio/am335x_sio_test.c \
+SylixOS/driver/spi/am335x_spi.c \
+SylixOS/driver/spi/am335x_spi_test.c \
+SylixOS/driver/touch/am335x_adc_touch.c \
+SylixOS/driver/touch/am335x_adc_touch_test.c \
+SylixOS/driver/tps65217/tps65217.c \
+SylixOS/driver/usb/am335x_usb_hw_init.c \
+SylixOS/driver/watchdog/am335x_watchdog.c \
+SylixOS/StarterWare/drivers/cpsw.c \
+SylixOS/StarterWare/drivers/dcan.c \
+SylixOS/StarterWare/drivers/dmtimer.c \
+SylixOS/StarterWare/drivers/ecap.c \
+SylixOS/StarterWare/drivers/edma.c \
+SylixOS/StarterWare/drivers/ehrpwm.c \
+SylixOS/StarterWare/drivers/elm.c \
+SylixOS/StarterWare/drivers/gpio_v2.c \
+SylixOS/StarterWare/drivers/gpmc.c \
+SylixOS/StarterWare/drivers/hsi2c.c \
+SylixOS/StarterWare/drivers/hs_mmcsd.c \
+SylixOS/StarterWare/drivers/mailbox.c \
+SylixOS/StarterWare/drivers/mcasp.c \
+SylixOS/StarterWare/drivers/mcspi.c \
+SylixOS/StarterWare/drivers/mdio.c \
+SylixOS/StarterWare/drivers/phy.c \
+SylixOS/StarterWare/drivers/raster.c \
+SylixOS/StarterWare/drivers/rtc.c \
+SylixOS/StarterWare/drivers/tsc_adc.c \
+SylixOS/StarterWare/drivers/uart_irda_cir.c \
+SylixOS/StarterWare/drivers/watchdog.c \
+SylixOS/StarterWare/platform/platform.c \
+SylixOS/StarterWare/system_config/armv7a/am335x/clock.c \
+SylixOS/StarterWare/system_config/armv7a/am335x/device.c \
+SylixOS/StarterWare/system_config/armv7a/am335x/interrupt.c \
+SylixOS/StarterWare/system_config/armv7a/cache.c \
+SylixOS/StarterWare/utils/delay.c \
+SylixOS/StarterWare/utils/perf.c \
+SylixOS/user/main.c
+
+#*********************************************************************************************************
+# Header file search path (eg. LOCAL_INC_PATH := -I"Your hearder files search path")
+#*********************************************************************************************************
+LOCAL_INC_PATH := \
+-I"./SylixOS" \
+-I"./SylixOS/bsp" \
+-I"./SylixOS/StarterWare/include" \
+-I"./SylixOS/StarterWare/include/hw" \
+-I"./SylixOS/StarterWare/include/armv7a" \
+-I"./SylixOS/StarterWare/include/armv7a/am335x" \
+-I"./SylixOS/StarterWare/usblib/include"
+
+#*********************************************************************************************************
+# Pre-defined macro (eg. -DYOUR_MARCO=1)
+#*********************************************************************************************************
+LOCAL_DSYMBOL := \
+-D__BOOT_INRAM=1 \
+-Dam335x \
+-Dgcc \
+-DDMA_MODE \
+-Dbeaglebone
+
+#*********************************************************************************************************
+# Compiler flags
+#*********************************************************************************************************
+LOCAL_CFLAGS :=
+LOCAL_CXXFLAGS :=
+
+#*********************************************************************************************************
+# Depend library (eg. LOCAL_DEPEND_LIB := -la LOCAL_DEPEND_LIB_PATH := -L"Your library search path")
+#*********************************************************************************************************
+LOCAL_DEPEND_LIB :=
+LOCAL_DEPEND_LIB_PATH :=
+
+#*********************************************************************************************************
+# Link script file
+#*********************************************************************************************************
+LOCAL_LD_SCRIPT := SylixOSBSP.ld
+
+#*********************************************************************************************************
+# C++ config
+#*********************************************************************************************************
+LOCAL_USE_CXX := no
+LOCAL_USE_CXX_EXCEPT := no
+
+#*********************************************************************************************************
+# Code coverage config
+#*********************************************************************************************************
+LOCAL_USE_GCOV := no
+
+include $(BSP_MK)
+
+#*********************************************************************************************************
+# End
+#*********************************************************************************************************
diff --git a/bspok335xd.mk b/bspok335xd.mk
new file mode 100644
index 0000000..398bbd6
--- /dev/null
+++ b/bspok335xd.mk
@@ -0,0 +1,187 @@
+#*********************************************************************************************************
+#
+# 中国软件开源组织
+#
+# 嵌入式实时操作系统
+#
+# SylixOS(TM) LW : long wing
+#
+# Copyright All Rights Reserved
+#
+#--------------文件信息--------------------------------------------------------------------------------
+#
+# 文 件 名: bspok335xs.mk
+#
+# 创 建 人: RealEvo-IDE
+#
+# 文件创建日期: 2016 年 10 月 20 日
+#
+# 描 述: 本文件由 RealEvo-IDE 生成,用于配置 Makefile 功能,请勿手动修改
+#*********************************************************************************************************
+
+#*********************************************************************************************************
+# Clear setting
+#*********************************************************************************************************
+include $(CLEAR_VARS_MK)
+
+#*********************************************************************************************************
+# Target
+#*********************************************************************************************************
+LOCAL_TARGET_NAME := bspok335xd.elf
+
+#*********************************************************************************************************
+# Source list
+#*********************************************************************************************************
+LOCAL_SRCS := \
+SylixOS/bsp/startup.S \
+SylixOS/bsp/bspInit.c \
+SylixOS/bsp/bspLib.c \
+SylixOS/bsp/forlinx/bspForlinx.c \
+SylixOS/driver/adc/am335x_adc.c \
+SylixOS/driver/adc/am335x_adc_test.c \
+SylixOS/driver/audio/audioLib.c \
+SylixOS/driver/audio/audioLibTest1.c \
+SylixOS/driver/audio/audioLibTest2.c \
+SylixOS/driver/audio/codec/codecDrv.c \
+SylixOS/driver/audio/codec/tlv320aic3x/tlv320aic3x.c \
+SylixOS/driver/audio/dsp/dspDrv.c \
+SylixOS/driver/audio/mixer/mixerDrv.c \
+SylixOS/driver/audio/oss_test.c \
+SylixOS/driver/audio/queue/queueLib.c \
+SylixOS/driver/beep/beep.c \
+SylixOS/driver/beep/beep_test.c \
+SylixOS/driver/can/am335x_can.c \
+SylixOS/driver/can/am335x_can_test.c \
+SylixOS/driver/can/dcan_frame.c \
+SylixOS/driver/clock/am335x_clock.c \
+SylixOS/driver/clock/am335x_clock_data.c \
+SylixOS/driver/dma/am335x_dma.c \
+SylixOS/driver/dma/am335x_dma_test.c \
+SylixOS/driver/ds1337/ds1337.c \
+SylixOS/driver/ds1337/ds1337_test.c \
+SylixOS/driver/dvfs/dvfs.c \
+SylixOS/driver/ecap/am335x_ecap.c \
+SylixOS/driver/ecap/am335x_ecap_test.c \
+SylixOS/driver/ft5x06/ft5x06.c \
+SylixOS/driver/ft5x06/ft5x06_test.c \
+SylixOS/driver/gpio/am335x_gpio.c \
+SylixOS/driver/gpio/am335x_gpio_test.c \
+SylixOS/driver/i2c/am335x_i2c.c \
+SylixOS/driver/lcd/am335x_lcd.c \
+SylixOS/driver/lcd/am335x_lcd_touch_test.c \
+SylixOS/driver/mcasp/am335x_mcasp.c \
+SylixOS/driver/memory/am335x_nand.c \
+SylixOS/driver/memory/elm/elm.c \
+SylixOS/driver/memory/gpmc/gpmc-nand.c \
+SylixOS/driver/memory/gpmc/gpmc.c \
+SylixOS/driver/memory/memory_port.c \
+SylixOS/driver/memory/nand/omap2.c \
+SylixOS/driver/netif/am335x_cpsw.c \
+SylixOS/driver/netif/cpswif.c \
+SylixOS/driver/netif/netio/netio.c \
+SylixOS/driver/pinmux/mux.c \
+SylixOS/driver/pinmux/mux2420.c \
+SylixOS/driver/pinmux/mux2430.c \
+SylixOS/driver/pinmux/mux33xx.c \
+SylixOS/driver/pinmux/mux34xx.c \
+SylixOS/driver/pinmux/mux44xx.c \
+SylixOS/driver/pinmux/mux_port.c \
+SylixOS/driver/pwm/am335x_pwm.c \
+SylixOS/driver/rtc/am335x_rtc.c \
+SylixOS/driver/rtc/am335x_rtc_test.c \
+SylixOS/driver/sdi/am335x_sdi.c \
+SylixOS/driver/sdi/am335x_sdi_init.c \
+SylixOS/driver/sio/am335x_sio.c \
+SylixOS/driver/sio/am335x_sio_test.c \
+SylixOS/driver/spi/am335x_spi.c \
+SylixOS/driver/spi/am335x_spi_test.c \
+SylixOS/driver/touch/am335x_adc_touch.c \
+SylixOS/driver/touch/am335x_adc_touch_test.c \
+SylixOS/driver/tps65217/tps65217.c \
+SylixOS/driver/usb/am335x_usb_hw_init.c \
+SylixOS/driver/watchdog/am335x_watchdog.c \
+SylixOS/StarterWare/drivers/cpsw.c \
+SylixOS/StarterWare/drivers/dcan.c \
+SylixOS/StarterWare/drivers/dmtimer.c \
+SylixOS/StarterWare/drivers/ecap.c \
+SylixOS/StarterWare/drivers/edma.c \
+SylixOS/StarterWare/drivers/ehrpwm.c \
+SylixOS/StarterWare/drivers/elm.c \
+SylixOS/StarterWare/drivers/gpio_v2.c \
+SylixOS/StarterWare/drivers/gpmc.c \
+SylixOS/StarterWare/drivers/hsi2c.c \
+SylixOS/StarterWare/drivers/hs_mmcsd.c \
+SylixOS/StarterWare/drivers/mailbox.c \
+SylixOS/StarterWare/drivers/mcasp.c \
+SylixOS/StarterWare/drivers/mcspi.c \
+SylixOS/StarterWare/drivers/mdio.c \
+SylixOS/StarterWare/drivers/phy.c \
+SylixOS/StarterWare/drivers/raster.c \
+SylixOS/StarterWare/drivers/rtc.c \
+SylixOS/StarterWare/drivers/tsc_adc.c \
+SylixOS/StarterWare/drivers/uart_irda_cir.c \
+SylixOS/StarterWare/drivers/watchdog.c \
+SylixOS/StarterWare/platform/platform.c \
+SylixOS/StarterWare/system_config/armv7a/am335x/clock.c \
+SylixOS/StarterWare/system_config/armv7a/am335x/device.c \
+SylixOS/StarterWare/system_config/armv7a/am335x/interrupt.c \
+SylixOS/StarterWare/system_config/armv7a/cache.c \
+SylixOS/StarterWare/utils/delay.c \
+SylixOS/StarterWare/utils/perf.c \
+SylixOS/user/main.c
+
+#*********************************************************************************************************
+# Header file search path (eg. LOCAL_INC_PATH := -I"Your hearder files search path")
+#*********************************************************************************************************
+LOCAL_INC_PATH := \
+-I"./SylixOS" \
+-I"./SylixOS/bsp" \
+-I"./SylixOS/StarterWare/include" \
+-I"./SylixOS/StarterWare/include/hw" \
+-I"./SylixOS/StarterWare/include/armv7a" \
+-I"./SylixOS/StarterWare/include/armv7a/am335x" \
+-I"./SylixOS/StarterWare/usblib/include"
+
+#*********************************************************************************************************
+# Pre-defined macro (eg. -DYOUR_MARCO=1)
+#*********************************************************************************************************
+LOCAL_DSYMBOL := \
+-D__BOOT_INRAM=1 \
+-Dam335x \
+-Dgcc \
+-DDMA_MODE \
+-Dok335xd
+
+#*********************************************************************************************************
+# Compiler flags
+#*********************************************************************************************************
+LOCAL_CFLAGS :=
+LOCAL_CXXFLAGS :=
+
+#*********************************************************************************************************
+# Depend library (eg. LOCAL_DEPEND_LIB := -la LOCAL_DEPEND_LIB_PATH := -L"Your library search path")
+#*********************************************************************************************************
+LOCAL_DEPEND_LIB :=
+LOCAL_DEPEND_LIB_PATH :=
+
+#*********************************************************************************************************
+# Link script file
+#*********************************************************************************************************
+LOCAL_LD_SCRIPT := SylixOSBSP.ld
+
+#*********************************************************************************************************
+# C++ config
+#*********************************************************************************************************
+LOCAL_USE_CXX := no
+LOCAL_USE_CXX_EXCEPT := no
+
+#*********************************************************************************************************
+# Code coverage config
+#*********************************************************************************************************
+LOCAL_USE_GCOV := no
+
+include $(BSP_MK)
+
+#*********************************************************************************************************
+# End
+#*********************************************************************************************************
diff --git a/bspok335xs.mk b/bspok335xs.mk
new file mode 100644
index 0000000..a8539f5
--- /dev/null
+++ b/bspok335xs.mk
@@ -0,0 +1,187 @@
+#*********************************************************************************************************
+#
+# 中国软件开源组织
+#
+# 嵌入式实时操作系统
+#
+# SylixOS(TM) LW : long wing
+#
+# Copyright All Rights Reserved
+#
+#--------------文件信息--------------------------------------------------------------------------------
+#
+# 文 件 名: bspok335xs.mk
+#
+# 创 建 人: RealEvo-IDE
+#
+# 文件创建日期: 2016 年 10 月 20 日
+#
+# 描 述: 本文件由 RealEvo-IDE 生成,用于配置 Makefile 功能,请勿手动修改
+#*********************************************************************************************************
+
+#*********************************************************************************************************
+# Clear setting
+#*********************************************************************************************************
+include $(CLEAR_VARS_MK)
+
+#*********************************************************************************************************
+# Target
+#*********************************************************************************************************
+LOCAL_TARGET_NAME := bspok335xs.elf
+
+#*********************************************************************************************************
+# Source list
+#*********************************************************************************************************
+LOCAL_SRCS := \
+SylixOS/bsp/startup.S \
+SylixOS/bsp/bspInit.c \
+SylixOS/bsp/bspLib.c \
+SylixOS/bsp/forlinx/bspForlinx.c \
+SylixOS/driver/adc/am335x_adc.c \
+SylixOS/driver/adc/am335x_adc_test.c \
+SylixOS/driver/audio/audioLib.c \
+SylixOS/driver/audio/audioLibTest1.c \
+SylixOS/driver/audio/audioLibTest2.c \
+SylixOS/driver/audio/codec/codecDrv.c \
+SylixOS/driver/audio/codec/tlv320aic3x/tlv320aic3x.c \
+SylixOS/driver/audio/dsp/dspDrv.c \
+SylixOS/driver/audio/mixer/mixerDrv.c \
+SylixOS/driver/audio/oss_test.c \
+SylixOS/driver/audio/queue/queueLib.c \
+SylixOS/driver/beep/beep.c \
+SylixOS/driver/beep/beep_test.c \
+SylixOS/driver/can/am335x_can.c \
+SylixOS/driver/can/am335x_can_test.c \
+SylixOS/driver/can/dcan_frame.c \
+SylixOS/driver/clock/am335x_clock.c \
+SylixOS/driver/clock/am335x_clock_data.c \
+SylixOS/driver/dma/am335x_dma.c \
+SylixOS/driver/dma/am335x_dma_test.c \
+SylixOS/driver/ds1337/ds1337.c \
+SylixOS/driver/ds1337/ds1337_test.c \
+SylixOS/driver/dvfs/dvfs.c \
+SylixOS/driver/ecap/am335x_ecap.c \
+SylixOS/driver/ecap/am335x_ecap_test.c \
+SylixOS/driver/ft5x06/ft5x06.c \
+SylixOS/driver/ft5x06/ft5x06_test.c \
+SylixOS/driver/gpio/am335x_gpio.c \
+SylixOS/driver/gpio/am335x_gpio_test.c \
+SylixOS/driver/i2c/am335x_i2c.c \
+SylixOS/driver/lcd/am335x_lcd.c \
+SylixOS/driver/lcd/am335x_lcd_touch_test.c \
+SylixOS/driver/mcasp/am335x_mcasp.c \
+SylixOS/driver/memory/am335x_nand.c \
+SylixOS/driver/memory/elm/elm.c \
+SylixOS/driver/memory/gpmc/gpmc-nand.c \
+SylixOS/driver/memory/gpmc/gpmc.c \
+SylixOS/driver/memory/memory_port.c \
+SylixOS/driver/memory/nand/omap2.c \
+SylixOS/driver/netif/am335x_cpsw.c \
+SylixOS/driver/netif/cpswif.c \
+SylixOS/driver/netif/netio/netio.c \
+SylixOS/driver/pinmux/mux.c \
+SylixOS/driver/pinmux/mux2420.c \
+SylixOS/driver/pinmux/mux2430.c \
+SylixOS/driver/pinmux/mux33xx.c \
+SylixOS/driver/pinmux/mux34xx.c \
+SylixOS/driver/pinmux/mux44xx.c \
+SylixOS/driver/pinmux/mux_port.c \
+SylixOS/driver/pwm/am335x_pwm.c \
+SylixOS/driver/rtc/am335x_rtc.c \
+SylixOS/driver/rtc/am335x_rtc_test.c \
+SylixOS/driver/sdi/am335x_sdi.c \
+SylixOS/driver/sdi/am335x_sdi_init.c \
+SylixOS/driver/sio/am335x_sio.c \
+SylixOS/driver/sio/am335x_sio_test.c \
+SylixOS/driver/spi/am335x_spi.c \
+SylixOS/driver/spi/am335x_spi_test.c \
+SylixOS/driver/touch/am335x_adc_touch.c \
+SylixOS/driver/touch/am335x_adc_touch_test.c \
+SylixOS/driver/tps65217/tps65217.c \
+SylixOS/driver/usb/am335x_usb_hw_init.c \
+SylixOS/driver/watchdog/am335x_watchdog.c \
+SylixOS/StarterWare/drivers/cpsw.c \
+SylixOS/StarterWare/drivers/dcan.c \
+SylixOS/StarterWare/drivers/dmtimer.c \
+SylixOS/StarterWare/drivers/ecap.c \
+SylixOS/StarterWare/drivers/edma.c \
+SylixOS/StarterWare/drivers/ehrpwm.c \
+SylixOS/StarterWare/drivers/elm.c \
+SylixOS/StarterWare/drivers/gpio_v2.c \
+SylixOS/StarterWare/drivers/gpmc.c \
+SylixOS/StarterWare/drivers/hsi2c.c \
+SylixOS/StarterWare/drivers/hs_mmcsd.c \
+SylixOS/StarterWare/drivers/mailbox.c \
+SylixOS/StarterWare/drivers/mcasp.c \
+SylixOS/StarterWare/drivers/mcspi.c \
+SylixOS/StarterWare/drivers/mdio.c \
+SylixOS/StarterWare/drivers/phy.c \
+SylixOS/StarterWare/drivers/raster.c \
+SylixOS/StarterWare/drivers/rtc.c \
+SylixOS/StarterWare/drivers/tsc_adc.c \
+SylixOS/StarterWare/drivers/uart_irda_cir.c \
+SylixOS/StarterWare/drivers/watchdog.c \
+SylixOS/StarterWare/platform/platform.c \
+SylixOS/StarterWare/system_config/armv7a/am335x/clock.c \
+SylixOS/StarterWare/system_config/armv7a/am335x/device.c \
+SylixOS/StarterWare/system_config/armv7a/am335x/interrupt.c \
+SylixOS/StarterWare/system_config/armv7a/cache.c \
+SylixOS/StarterWare/utils/delay.c \
+SylixOS/StarterWare/utils/perf.c \
+SylixOS/user/main.c
+
+#*********************************************************************************************************
+# Header file search path (eg. LOCAL_INC_PATH := -I"Your hearder files search path")
+#*********************************************************************************************************
+LOCAL_INC_PATH := \
+-I"./SylixOS" \
+-I"./SylixOS/bsp" \
+-I"./SylixOS/StarterWare/include" \
+-I"./SylixOS/StarterWare/include/hw" \
+-I"./SylixOS/StarterWare/include/armv7a" \
+-I"./SylixOS/StarterWare/include/armv7a/am335x" \
+-I"./SylixOS/StarterWare/usblib/include"
+
+#*********************************************************************************************************
+# Pre-defined macro (eg. -DYOUR_MARCO=1)
+#*********************************************************************************************************
+LOCAL_DSYMBOL := \
+-D__BOOT_INRAM=1 \
+-Dam335x \
+-Dgcc \
+-DDMA_MODE \
+-Dok335xs
+
+#*********************************************************************************************************
+# Compiler flags
+#*********************************************************************************************************
+LOCAL_CFLAGS :=
+LOCAL_CXXFLAGS :=
+
+#*********************************************************************************************************
+# Depend library (eg. LOCAL_DEPEND_LIB := -la LOCAL_DEPEND_LIB_PATH := -L"Your library search path")
+#*********************************************************************************************************
+LOCAL_DEPEND_LIB :=
+LOCAL_DEPEND_LIB_PATH :=
+
+#*********************************************************************************************************
+# Link script file
+#*********************************************************************************************************
+LOCAL_LD_SCRIPT := SylixOSBSP.ld
+
+#*********************************************************************************************************
+# C++ config
+#*********************************************************************************************************
+LOCAL_USE_CXX := no
+LOCAL_USE_CXX_EXCEPT := no
+
+#*********************************************************************************************************
+# Code coverage config
+#*********************************************************************************************************
+LOCAL_USE_GCOV := no
+
+include $(BSP_MK)
+
+#*********************************************************************************************************
+# End
+#*********************************************************************************************************
diff --git a/config.lds b/config.lds
index 77ccb49..84862f5 100644
--- a/config.lds
+++ b/config.lds
@@ -1,6 +1,6 @@
MEMORY
{
TEXT (rx) : ORIGIN = 0x80000000, LENGTH = (6 * 1024 * 1024)
- DATA (rw) : ORIGIN = 0x80000000 + ((6 * 1024 * 1024)), LENGTH = (122 * 1024 * 1024)
+ DATA (rw) : ORIGIN = 0x80000000 + ((6 * 1024 * 1024)), LENGTH = (40 * 1024 * 1024)
}
BOOT_STACK_SIZE = (128 * 1024);
diff --git a/config.mk b/config.mk
index 4ba7098..b607902 100644
--- a/config.mk
+++ b/config.mk
@@ -14,28 +14,33 @@
#
# 创 建 人: RealEvo-IDE
#
-# 文件创建日期: 2016 年06 月06 日
+# 文件创建日期: 2016 年 10 月 20 日
#
# 描 述: 本文件由 RealEvo-IDE 生成,用于配置 Makefile 功能,请勿手动修改
#*********************************************************************************************************
+
#*********************************************************************************************************
# SylixOS Base Project path
#*********************************************************************************************************
-SYLIXOS_BASE_PATH = D:/workspace/sylixos-base
+SYLIXOS_BASE_PATH := D:\RealEvo-Simulator\src\workspace\sylixos-base-a8
#*********************************************************************************************************
# Toolchain prefix
#*********************************************************************************************************
-TOOLCHAIN_PREFIX = arm-sylixos-eabi-
+TOOLCHAIN_PREFIX := arm-sylixos-eabi-
#*********************************************************************************************************
# Debug options (debug or release)
#*********************************************************************************************************
-DEBUG_LEVEL = debug
+DEBUG_LEVEL := debug
#*********************************************************************************************************
# NOTICE: libsylixos, BSP and other kernel modules projects CAN NOT use vfp!
#*********************************************************************************************************
-FPUFLAGS =
-CPUFLAGS = -mcpu=cortex-a8 $(FPUFLAGS)
+FPU_TYPE := disable
+CPU_TYPE := cortex-a8
+
+#*********************************************************************************************************
+# End
+#*********************************************************************************************************