delete the CMSIS from components and add the CMSIS

and add the CMSIS in some specific BSP
This commit is contained in:
tyustli
2019-03-26 13:58:33 +08:00
parent 4b6c732cd7
commit 1be90253d0
84 changed files with 63140 additions and 13839 deletions
@@ -1,93 +0,0 @@
/* ----------------------------------------------------------------------
* Copyright (C) 2010-2013 ARM Limited. All rights reserved.
*
* $Date: 17. January 2013
* $Revision: V1.4.1
*
* Project: CMSIS DSP Library
* Title: arm_common_tables.h
*
* Description: This file has extern declaration for common tables like Bitreverse, reciprocal etc which are used across different functions
*
* Target Processor: Cortex-M4/Cortex-M3
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* - Neither the name of ARM LIMITED nor the names of its contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* -------------------------------------------------------------------- */
#ifndef _ARM_COMMON_TABLES_H
#define _ARM_COMMON_TABLES_H
#include "arm_math.h"
extern const uint16_t armBitRevTable[1024];
extern const q15_t armRecipTableQ15[64];
extern const q31_t armRecipTableQ31[64];
extern const q31_t realCoefAQ31[1024];
extern const q31_t realCoefBQ31[1024];
extern const float32_t twiddleCoef_16[32];
extern const float32_t twiddleCoef_32[64];
extern const float32_t twiddleCoef_64[128];
extern const float32_t twiddleCoef_128[256];
extern const float32_t twiddleCoef_256[512];
extern const float32_t twiddleCoef_512[1024];
extern const float32_t twiddleCoef_1024[2048];
extern const float32_t twiddleCoef_2048[4096];
extern const float32_t twiddleCoef_4096[8192];
#define twiddleCoef twiddleCoef_4096
extern const q31_t twiddleCoefQ31[6144];
extern const q15_t twiddleCoefQ15[6144];
extern const float32_t twiddleCoef_rfft_32[32];
extern const float32_t twiddleCoef_rfft_64[64];
extern const float32_t twiddleCoef_rfft_128[128];
extern const float32_t twiddleCoef_rfft_256[256];
extern const float32_t twiddleCoef_rfft_512[512];
extern const float32_t twiddleCoef_rfft_1024[1024];
extern const float32_t twiddleCoef_rfft_2048[2048];
extern const float32_t twiddleCoef_rfft_4096[4096];
#define ARMBITREVINDEXTABLE__16_TABLE_LENGTH ((uint16_t)20 )
#define ARMBITREVINDEXTABLE__32_TABLE_LENGTH ((uint16_t)48 )
#define ARMBITREVINDEXTABLE__64_TABLE_LENGTH ((uint16_t)56 )
#define ARMBITREVINDEXTABLE_128_TABLE_LENGTH ((uint16_t)208 )
#define ARMBITREVINDEXTABLE_256_TABLE_LENGTH ((uint16_t)440 )
#define ARMBITREVINDEXTABLE_512_TABLE_LENGTH ((uint16_t)448 )
#define ARMBITREVINDEXTABLE1024_TABLE_LENGTH ((uint16_t)1800)
#define ARMBITREVINDEXTABLE2048_TABLE_LENGTH ((uint16_t)3808)
#define ARMBITREVINDEXTABLE4096_TABLE_LENGTH ((uint16_t)4032)
extern const uint16_t armBitRevIndexTable16[ARMBITREVINDEXTABLE__16_TABLE_LENGTH];
extern const uint16_t armBitRevIndexTable32[ARMBITREVINDEXTABLE__32_TABLE_LENGTH];
extern const uint16_t armBitRevIndexTable64[ARMBITREVINDEXTABLE__64_TABLE_LENGTH];
extern const uint16_t armBitRevIndexTable128[ARMBITREVINDEXTABLE_128_TABLE_LENGTH];
extern const uint16_t armBitRevIndexTable256[ARMBITREVINDEXTABLE_256_TABLE_LENGTH];
extern const uint16_t armBitRevIndexTable512[ARMBITREVINDEXTABLE_512_TABLE_LENGTH];
extern const uint16_t armBitRevIndexTable1024[ARMBITREVINDEXTABLE1024_TABLE_LENGTH];
extern const uint16_t armBitRevIndexTable2048[ARMBITREVINDEXTABLE2048_TABLE_LENGTH];
extern const uint16_t armBitRevIndexTable4096[ARMBITREVINDEXTABLE4096_TABLE_LENGTH];
#endif /* ARM_COMMON_TABLES_H */
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-20
View File
@@ -1,20 +0,0 @@
if ARCH_ARM_CORTEX_M
menu "ARM CMSIS"
config RT_USING_CMSIS_OS
bool "Using CMSIS RTOS API"
default n
help
Enable CMSIS RTOS API, which is implemented above RT-Thread.
config RT_USING_RTT_CMSIS
bool "Using CMSIS Header files in RT-Thread"
default n
help
Use CMSIS header files in RT-Thread/components/CMSIS. Otherwise, use the
CMSIS header files in BSP.
endmenu
endif
-37
View File
@@ -1,37 +0,0 @@
* -------------------------------------------------------------------
* Copyright (C) 2011-2012 ARM Limited. All rights reserved.
*
* Date: 07 March 2012
* Revision: V3.01
*
* Project: Cortex Microcontroller Software Interface Standard (CMSIS)
* Title: Release Note for CMSIS
*
* -------------------------------------------------------------------
NOTE - Open the index.html file to access CMSIS documentation
The Cortex Microcontroller Software Interface Standard (CMSIS) provides a single standard across all
Cortex-Mx processor series vendors. It enables code re-use and code sharing across software projects
and reduces time-to-market for new embedded applications.
CMSIS is released under the terms of the end user license agreement ("CMSIS END USER LICENCE AGREEMENT.pdf").
Any user of the software package is bound to the terms and conditions of the end user license agreement.
You will find the following sub-directories:
Documentation - Contains CMSIS documentation.
DSP_Lib - MDK project files, Examples and source files etc.. to build the
CMSIS DSP Software Library for Cortex-M0, Cortex-M3, Cortex-M4 processors.
Include - CMSIS Core Support and CMSIS DSP Include Files.
Lib - CMSIS DSP Libraries.
RTOS - CMSIS RTOS API template header file.
SVD - CMSIS SVD Schema files and Conversion Utility.
-8
View File
@@ -1,8 +0,0 @@
from building import *
cwd = GetCurrentDir()
src = Glob('*.c')
CPPPATH = [cwd]
group = DefineGroup('CMSIS_OS', src, depend = ['RT_USING_CMSIS_OS'], CPPPATH = CPPPATH)
Return('group')
File diff suppressed because it is too large Load Diff
-380
View File
@@ -1,380 +0,0 @@
#include "cmsis_os.h"
// Kernel Control Public API
/// Start the RTOS Kernel with executing the specified thread
osStatus osKernelStart(void)
{
rt_system_scheduler_start();
return osOK;
}
/// Check if the RTOS kernel is already started
int32_t osKernelRunning(void)
{
return (rt_thread_self() != RT_NULL) ? 1 : 0;
}
// Thread Public API
/// Create a thread and add it to Active Threads and set it to state READY
osThreadId osThreadCreate(osThreadDef_t *thread_def, void *argument)
{
osThreadId thread;
int size;
size = thread_def->stack_size;
if (size == 0)
{
size = 4096;
}
thread = rt_thread_create(thread_def->name, thread_def->entry, argument, size, thread_def->priority, thread_def->tick);
if (thread != RT_NULL)
rt_thread_startup(thread);
return thread;
}
/// Return the thread ID of the current running thread
osThreadId osThreadGetId(void)
{
return rt_thread_self();
}
/// Terminate execution of a thread and remove it from ActiveThreads
osStatus osThreadTerminate(osThreadId thread_id)
{
rt_err_t result;
result = rt_thread_delete(thread_id);
if (result == RT_EOK)
return osOK;
else
return osErrorOS;
}
/// Pass control to next thread that is in state READY
osStatus osThreadYield(void)
{
rt_err_t result;
result = rt_thread_yield();
if (result == RT_EOK)
return osOK;
else
return osErrorOS;
}
/// Change prority of an active thread
osStatus osThreadSetPriority(osThreadId thread_id, osPriority priority)
{
rt_err_t result;
if (thread_id == RT_NULL)
return osErrorOS;
if (priority < osPriorityIdle || priority > osPriorityRealtime)
return osErrorPriority;
result = rt_thread_control(thread_id, RT_THREAD_CTRL_CHANGE_PRIORITY, &priority);
if (result == RT_EOK)
return osOK;
else
return osErrorOS;
}
/// Get current prority of an active thread
osPriority osThreadGetPriority(osThreadId thread_id)
{
if (thread_id == RT_NULL)
return osPriorityError;
if ((osPriority)thread_id->current_priority < osPriorityIdle || (osPriority)thread_id->current_priority > osPriorityRealtime)
return osPriorityError;
return thread_id->current_priority;
}
// Generic Wait API
/// Wait for Timeout (Time Delay)
osStatus osDelay(uint32_t millisec)
{
rt_err_t result;
rt_tick_t ticks;
ticks = rt_tick_from_millisecond(millisec);
result = rt_thread_delay(ticks);
if (result == RT_EOK)
return osOK;
else
return osErrorOS;
}
/// Wait for Signal, Message, Mail, or Timeout
osEvent osWait(uint32_t millisec)
{
rt_err_t result;
rt_tick_t ticks;
ticks = rt_tick_from_millisecond(millisec);
result = rt_thread_delay(ticks);
/*
if (result == RT_EOK)
return osOK;
else
return osErrorOS;
*/
}
// Timer Management Public API
/// Create timer
osTimerId osTimerCreate(osTimerDef_t *timer_def, os_timer_type type, void *argument)
{
uint8_t flag = RT_TIMER_FLAG_SOFT_TIMER;
if (type == osTimerPeriodic)
{
flag |= RT_TIMER_FLAG_PERIODIC;
}
return rt_timer_create(timer_def->name, timer_def->timeout, argument, timer_def->time, flag);
}
/// Start or restart timer
osStatus osTimerStart(osTimerId timer_id, uint32_t millisec)
{
rt_err_t result;
rt_tick_t ticks;
ticks = rt_tick_from_millisecond(millisec);
rt_timer_control(timer_id, RT_TIMER_CTRL_SET_TIME, &ticks);
result = rt_timer_start(timer_id);
if (result == RT_EOK)
return osOK;
else
return osErrorOS;
}
/// Stop timer
osStatus osTimerStop(osTimerId timer_id)
{
rt_err_t result;
result = rt_timer_stop(timer_id);
if (result == RT_EOK)
return osOK;
else
return osErrorOS;
}
// Mutex Public API
/// Create and Initialize a Mutex object
osMutexId osMutexCreate(osMutexDef_t *mutex_def)
{
return rt_mutex_create(mutex_def->name, mutex_def->flag);
}
/// Wait until a Mutex becomes available
osStatus osMutexWait(osMutexId mutex_id, uint32_t millisec)
{
rt_err_t result;
rt_tick_t ticks;
ticks = rt_tick_from_millisecond(millisec);
result = rt_mutex_take(mutex_id, ticks);
if (result == RT_EOK)
return osOK;
else
return osErrorOS;
}
/// Release a Mutex that was obtained with osMutexWait
osStatus osMutexRelease(osMutexId mutex_id)
{
rt_err_t result;
result = rt_mutex_release(mutex_id);
if (result == RT_EOK)
return osOK;
else
return osErrorOS;
}
osStatus osMutexDelete (osMutexId mutex_id)
{
rt_err_t result;
result = rt_mutex_delete(mutex_id);
if (result == RT_EOK)
return osOK;
else
return osErrorOS;
}
// Semaphore Public API
/// Create and Initialize a Semaphore object
osSemaphoreId osSemaphoreCreate(osSemaphoreDef_t *semaphore_def, int32_t count)
{
return rt_sem_create(semaphore_def->name, count, semaphore_def->flag);
}
/// Wait until a Semaphore becomes available
int32_t osSemaphoreWait(osSemaphoreId semaphore_id, uint32_t millisec)
{
rt_tick_t ticks;
if (semaphore_id == RT_NULL)
return -1;
ticks = rt_tick_from_millisecond(millisec);
rt_sem_take(semaphore_id, ticks);
return semaphore_id->value;
}
/// Release a Semaphore
osStatus osSemaphoreRelease(osSemaphoreId semaphore_id)
{
rt_err_t result;
result = rt_sem_release(semaphore_id);
if (result == RT_EOK)
return osOK;
else
return osErrorOS;
}
// Memory Management Public API
/// Create and Initialize memory pool
osPoolId osPoolCreate(osPoolDef_t *pool_def)
{
return rt_mp_create(pool_def->name, pool_def->block_count, pool_def->block_size);
}
/// Allocate a memory block from a memory pool
void *osPoolAlloc(osPoolId pool_id)
{
return rt_mp_alloc(pool_id, 0);
}
/// Allocate a memory block from a memory pool and set memory block to zero
void *osPoolCAlloc(osPoolId pool_id)
{
return RT_NULL;
}
/// Return an allocated memory block back to a specific memory pool
osStatus osPoolFree(osPoolId pool_id, void *block)
{
rt_mp_free(block);
return osOK;
}
// Message Queue Management Public API
/// Create and Initialize Message Queue
osMessageQId osMessageCreate(osMessageQDef_t *queue_def, osThreadId thread_id)
{
return rt_mq_create(queue_def->name, queue_def->msg_size, queue_def->max_msgs, queue_def->flag);
}
/// Put a Message to a Queue
osStatus osMessagePut(osMessageQId queue_id, uint32_t info, uint32_t millisec)
{
rt_err_t result;
result = rt_mq_send(queue_id, &info, 4);
if (result == RT_EOK)
return osOK;
else
return osErrorOS;
}
/// Get a Message or Wait for a Message from a Queue
osEvent osMessageGet(osMessageQId queue_id, uint32_t millisec)
{
osEvent event;
rt_err_t result;
rt_tick_t ticks;
ticks = rt_tick_from_millisecond(millisec);
result = rt_mq_recv(queue_id, &event.value, 4, ticks);
if (result == RT_EOK)
{
event.status = osEventMessage;
}
else
{
event.status = osEventTimeout;
}
return event;
}
// Mail Queue Management Public API
/// Create and Initialize mail queue
osMailQId osMailCreate(osMailQDef_t *queue_def, osThreadId thread_id)
{
return RT_NULL;
}
/// Allocate a memory block from a mail
void *osMailAlloc(osMailQId queue_id, uint32_t millisec)
{
return RT_NULL;
}
/// Allocate a memory block from a mail and set memory block to zero
void *osMailCAlloc(osMailQId queue_id, uint32_t millisec)
{
return RT_NULL;
}
/// Free a memory block from a mail
osStatus osMailFree(osMailQId queue_id, void *mail)
{
return osErrorOS;
}
/// Put a mail to a queue
osStatus osMailPut(osMailQId queue_id, void *mail)
{
return osErrorOS;
}
/// Get a mail from a queue
osEvent osMailGet(osMailQId queue_id, uint32_t millisec)
{
osEvent ret;
if (queue_id == NULL) {
ret.status = osErrorParameter;
return ret;
}
ret = osMessageGet(*((void **)queue_id), millisec);
if (ret.status == osEventMessage) ret.status = osEventMail;
return ret;
}
-14
View File
@@ -1,14 +0,0 @@
# for module compiling
import os
from building import *
cwd = GetCurrentDir()
objs = []
list = os.listdir(cwd)
for d in list:
path = os.path.join(cwd, d)
if os.path.isfile(os.path.join(path, 'SConscript')):
objs = objs + SConscript(os.path.join(d, 'SConscript'))
Return('objs')
-2
View File
@@ -37,8 +37,6 @@ source "$RTT_DIR/components/vbus/Kconfig"
source "$RTT_DIR/components/utilities/Kconfig"
source "$RTT_DIR/components/CMSIS/Kconfig"
source "$RTT_DIR/components/lwp/Kconfig"
endmenu