Merge branch 'master' into developer

This commit is contained in:
sheltonyu 2021-04-13 11:37:46 +08:00 committed by GitHub
commit 46c5ba9225
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4043 changed files with 342071 additions and 460447 deletions

5
.gitattributes vendored

@ -1,3 +1,8 @@
*.c linguist-language=C
*.C linguist-language=C
*.h linguist-language=C
*.H linguist-language=C
* text=auto * text=auto
*.S text *.S text

@ -27,3 +27,4 @@ As part of this pull request, I've considered the following:
- [ ] All modifications to BSP are justified and do not affect other components or BSPs. - [ ] All modifications to BSP are justified and do not affect other components or BSPs.
- [ ] I've commented appropriately where code is tricky. - [ ] I've commented appropriately where code is tricky.
- [ ] Code in this PR is of high quality. - [ ] Code in this PR is of high quality.
- [ ] This PR complies with [RT-Thread code specification](../documentation/coding_style_en.txt)

@ -27,3 +27,4 @@
- [ ] 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或 - [ ] 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或
- [ ] 对难懂代码均提供对应的注释 - [ ] 对难懂代码均提供对应的注释
- [ ] 本拉取/合并请求代码是高质量的 - [ ] 本拉取/合并请求代码是高质量的
- [ ] 本拉取/合并符合[RT-Thread代码规范](../documentation/coding_style_cn.md)

@ -27,3 +27,4 @@
- [ ] 所有變更均有原因及合理的,並且不會影響到其他軟件組件代碼或 - [ ] 所有變更均有原因及合理的,並且不會影響到其他軟件組件代碼或
- [ ] 對難懂代碼均提供對應的註釋 - [ ] 對難懂代碼均提供對應的註釋
- [ ] 本拉取/合並請求代碼是高質量的 - [ ] 本拉取/合並請求代碼是高質量的
- [ ] 本拉取/合並符合[RT-Thread代碼規範](../documentation/coding_style_cn.md)

@ -31,3 +31,4 @@ The following content must not be changed in the submitted PR message. Otherwise
- [ ] 所有变更均有原因及合理的并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP - [ ] 所有变更均有原因及合理的并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP
- [ ] 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky - [ ] 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky
- [ ] 本拉取/合并请求代码是高质量的 Code in this PR is of high quality - [ ] 本拉取/合并请求代码是高质量的 Code in this PR is of high quality
- [ ] 本拉取/合并符合[RT-Thread代码规范](../documentation/coding_style_cn.md) This PR complies with [RT-Thread code specification](../documentation/coding_style_en.txt)

@ -74,7 +74,7 @@ jobs:
- {RTT_BSP: "stm32/stm32f103-dofly-M3S", RTT_TOOL_CHAIN: "sourcery-arm"} - {RTT_BSP: "stm32/stm32f103-dofly-M3S", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "stm32/stm32f103-fire-arbitrary", RTT_TOOL_CHAIN: "sourcery-arm"} - {RTT_BSP: "stm32/stm32f103-fire-arbitrary", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "stm32/stm32f103-hw100k-ibox", RTT_TOOL_CHAIN: "sourcery-arm"} - {RTT_BSP: "stm32/stm32f103-hw100k-ibox", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "stm32/stm32f103-mini-system", RTT_TOOL_CHAIN: "sourcery-arm"} - {RTT_BSP: "stm32/stm32f103-blue-pill", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "stm32/stm32f103-onenet-nbiot", RTT_TOOL_CHAIN: "sourcery-arm"} - {RTT_BSP: "stm32/stm32f103-onenet-nbiot", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "stm32/stm32f103-yf-ufun", RTT_TOOL_CHAIN: "sourcery-arm"} - {RTT_BSP: "stm32/stm32f103-yf-ufun", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "stm32/stm32f107-uc-eval", RTT_TOOL_CHAIN: "sourcery-arm"} - {RTT_BSP: "stm32/stm32f107-uc-eval", RTT_TOOL_CHAIN: "sourcery-arm"}
@ -104,6 +104,7 @@ jobs:
- {RTT_BSP: "stm32/stm32h743-atk-apollo", RTT_TOOL_CHAIN: "sourcery-arm"} - {RTT_BSP: "stm32/stm32h743-atk-apollo", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "stm32/stm32h743-st-nucleo", RTT_TOOL_CHAIN: "sourcery-arm"} - {RTT_BSP: "stm32/stm32h743-st-nucleo", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "stm32/stm32h747-st-discovery", RTT_TOOL_CHAIN: "sourcery-arm"} - {RTT_BSP: "stm32/stm32h747-st-discovery", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "stm32/stm32h750-artpi-h750", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "stm32/stm32l4r9-st-eval", RTT_TOOL_CHAIN: "sourcery-arm"} - {RTT_BSP: "stm32/stm32l4r9-st-eval", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "stm32/stm32l010-st-nucleo", RTT_TOOL_CHAIN: "sourcery-arm"} - {RTT_BSP: "stm32/stm32l010-st-nucleo", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "stm32/stm32l053-st-nucleo", RTT_TOOL_CHAIN: "sourcery-arm"} - {RTT_BSP: "stm32/stm32l053-st-nucleo", RTT_TOOL_CHAIN: "sourcery-arm"}
@ -119,9 +120,9 @@ jobs:
- {RTT_BSP: "stm32/stm32mp157a-st-ev1", RTT_TOOL_CHAIN: "sourcery-arm"} - {RTT_BSP: "stm32/stm32mp157a-st-ev1", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "stm32/stm32wb55-st-nucleo", RTT_TOOL_CHAIN: "sourcery-arm"} - {RTT_BSP: "stm32/stm32wb55-st-nucleo", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "stm32f20x", RTT_TOOL_CHAIN: "sourcery-arm"} - {RTT_BSP: "stm32f20x", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "swm320", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "swm320-lq100", RTT_TOOL_CHAIN: "sourcery-arm"} - {RTT_BSP: "swm320-lq100", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "beaglebone", RTT_TOOL_CHAIN: "sourcery-arm"} - {RTT_BSP: "beaglebone", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "zynq7000", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "zynqmp-r5-axu4ev", RTT_TOOL_CHAIN: "sourcery-arm"} - {RTT_BSP: "zynqmp-r5-axu4ev", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "frdm-k64f", RTT_TOOL_CHAIN: "sourcery-arm"} - {RTT_BSP: "frdm-k64f", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "fh8620", RTT_TOOL_CHAIN: "sourcery-arm"} - {RTT_BSP: "fh8620", RTT_TOOL_CHAIN: "sourcery-arm"}

20
.github/workflows/file_check.yml vendored Normal file

@ -0,0 +1,20 @@
name: Check File Format and License
on: [pull_request]
jobs:
scancode_job:
runs-on: ubuntu-latest
name: Scan code format and license
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@master
with:
python-version: 3.8
- name: Check Format and License
shell: bash
run: |
pip install click chardet PyYaml
python tools/file_check.py check 'https://github.com/RT-Thread/rt-thread' 'master'

3
.gitignore vendored

@ -35,3 +35,6 @@ ncscope.*
#ctag files #ctag files
tags tags
.idea
CMakeLists.txt
cmake-build-debug

9
.ignore_format.yml Normal file

@ -0,0 +1,9 @@
# files format check exclude path, please follow the instructions below to modify;
# If you need to exclude an entire folder, add the folder path in dir_path;
# If you need to exclude a file, add the path to the file in file_path.
file_path:
- bsp/allwinner_tina/libcpu/cpu.c
dir_path:
- tools

1
Jenkinsfile vendored

@ -107,7 +107,6 @@ pipeline {
['stm32f20x', 'sourcery-arm'], ['stm32f20x', 'sourcery-arm'],
['swm320-lq100', 'sourcery-arm'], ['swm320-lq100', 'sourcery-arm'],
['beaglebone', 'sourcery-arm'], ['beaglebone', 'sourcery-arm'],
['zynq7000', 'sourcery-arm'],
['frdm-k64f', 'sourcery-arm'], ['frdm-k64f', 'sourcery-arm'],
['fh8620', 'sourcery-arm'], ['fh8620', 'sourcery-arm'],
['xplorer4330/M4', 'sourcery-arm'], ['xplorer4330/M4', 'sourcery-arm'],

@ -1,11 +1,7 @@
/* /*
* File : application.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006-2014, RT-Thread Development Team
* *
* The license and distribution terms for this file may be * SPDX-License-Identifier: Apache-2.0
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
@ -32,10 +28,10 @@ int rt_application_init()
tid = rt_thread_create("init", tid = rt_thread_create("init",
rt_init_thread_entry, rt_init_thread_entry,
RT_NULL, RT_NULL,
2048, 2048,
RT_THREAD_PRIORITY_MAX/3, RT_THREAD_PRIORITY_MAX/3,
20); 20);
if (tid != RT_NULL) if (tid != RT_NULL)
rt_thread_startup(tid); rt_thread_startup(tid);

@ -1,11 +1,7 @@
/* /*
* File : board.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2009-2014, RT-Thread Develop Team
* *
* The license and distribution terms for this file may be * SPDX-License-Identifier: Apache-2.0
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,11 +1,7 @@
/* /*
* File : board.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2009-2014, RT-Thread Development Team
* *
* The license and distribution terms for this file may be * SPDX-License-Identifier: Apache-2.0
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
@ -18,7 +14,7 @@
#include "cmem7_includes.h" #include "cmem7_includes.h"
//#include "cmem7_retarget.h" //#include "cmem7_retarget.h"
#define SRAM_SIZE 64 // KB #define SRAM_SIZE 64 // KB
#define SRAM_END (0x20000000 + SRAM_SIZE * 1024) #define SRAM_END (0x20000000 + SRAM_SIZE * 1024)
//#define RT_USING_UART0 //#define RT_USING_UART0

@ -1,21 +1,7 @@
/* /*
* File : main.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : board.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : board.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : drv_clock.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : drv_clock.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : drv_gpio.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : drv_gpio.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : drv_sdio.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
@ -47,12 +33,12 @@
struct mmc_xfe_des struct mmc_xfe_des
{ {
rt_uint32_t size; /* block size */ rt_uint32_t size; /* block size */
rt_uint32_t num; /* block num */ rt_uint32_t num; /* block num */
rt_uint8_t *buff; /* buff addr */ rt_uint8_t *buff; /* buff addr */
rt_uint32_t flag; /* write or read or stream */ rt_uint32_t flag; /* write or read or stream */
#define MMC_DATA_WRITE (1 << 0) #define MMC_DATA_WRITE (1 << 0)
#define MMC_DATA_READ (1 << 1) #define MMC_DATA_READ (1 << 1)
#define MMC_DATA_STREAM (1 << 2) #define MMC_DATA_STREAM (1 << 2)
}; };
struct mmc_flag struct mmc_flag

@ -1,21 +1,7 @@
/* /*
* File : drv_sdio.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : drv_uart.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : drv_uart.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : drv_spi.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : drv_spi.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : drv_spi_flash.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
;/* ;/*
; * File : context_iar.S ; * Copyright (c) 2006-2021, RT-Thread Development Team
; * This file is part of RT-Thread RTOS
; * COPYRIGHT (C) 2006, RT-Thread Development Team
; * ; *
; * This program is free software; you can redistribute it and/or modify ; * SPDX-License-Identifier: Apache-2.0
; * it under the terms of the GNU General Public License as published by
; * the Free Software Foundation; either version 2 of the License, or
; * (at your option) any later version.
; *
; * This program is distributed in the hope that it will be useful,
; * but WITHOUT ANY WARRANTY; without even the implied warranty of
; * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; * GNU General Public License for more details.
; *
; * You should have received a copy of the GNU General Public License along
; * with this program; if not, write to the Free Software Foundation, Inc.,
; * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
; * ; *
; * Change Logs: ; * Change Logs:
; * Date Author Notes ; * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : cpu.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : cpuport.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,25 +1,12 @@
/* /*
* File : interrupt.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
* 2018-02-08 RT-Thread the first version * 2018-02-08 RT-Thread the first version
* 2020-03-02 Howard Su Use structure to access registers
*/ */
#include <rthw.h> #include <rthw.h>
@ -38,9 +25,6 @@ static void rt_hw_interrupt_handler(int vector, void *param)
rt_kprintf("Unhandled interrupt %d occured!!!\n", vector); rt_kprintf("Unhandled interrupt %d occured!!!\n", vector);
} }
#define readl(addr) (*(volatile unsigned int *)(addr))
#define writel(value,addr) (*(volatile unsigned int *)(addr) = (value))
/** /**
* This function will initialize hardware interrupt * This function will initialize hardware interrupt
*/ */
@ -63,20 +47,20 @@ void rt_hw_interrupt_init(void)
/* set base_addr reg */ /* set base_addr reg */
INTC->base_addr_reg = 0x00000000; INTC->base_addr_reg = 0x00000000;
/* clear enable */ /* clear enable */
INTC->en_reg0 = 0x00000000; INTC->en_reg[0] = 0x00000000;
INTC->en_reg1 = 0x00000000; INTC->en_reg[1] = 0x00000000;
/* mask interrupt */ /* mask interrupt */
INTC->mask_reg0 = 0xFFFFFFFF; INTC->mask_reg[0] = 0xFFFFFFFF;
INTC->mask_reg1 = 0xFFFFFFFF; INTC->mask_reg[1] = 0xFFFFFFFF;
/* clear pending */ /* clear pending */
INTC->pend_reg0 = 0x00000000; INTC->pend_reg[0] = 0x00000000;
INTC->pend_reg1 = 0x00000000; INTC->pend_reg[1] = 0x00000000;
/* set priority */ /* set priority */
INTC->resp_reg0 = 0x00000000; INTC->resp_reg[0] = 0x00000000;
INTC->resp_reg1 = 0x00000000; INTC->resp_reg[1] = 0x00000000;
/* close fiq interrupt */ /* close fiq interrupt */
INTC->ff_reg0 = 0x00000000; INTC->ff_reg[0] = 0x00000000;
INTC->ff_reg1 = 0x00000000; INTC->ff_reg[1] = 0x00000000;
} }
/** /**
@ -85,20 +69,16 @@ void rt_hw_interrupt_init(void)
*/ */
void rt_hw_interrupt_mask(int vector) void rt_hw_interrupt_mask(int vector)
{ {
rt_uint32_t mask_addr, data; int index;
if ((vector < 0) || (vector > INTERRUPTS_MAX)) if ((vector < 0) || (vector > INTERRUPTS_MAX))
{ {
return; return;
} }
mask_addr = (rt_uint32_t)(&INTC->mask_reg0); index = (vector & 0xE0) != 0;
mask_addr += vector & 0xE0 ? sizeof(rt_uint32_t *) : 0; vector = (vector & 0x1F);
vector &= 0x1F; INTC->mask_reg[index] |= 1 << vector;
data = readl(mask_addr);
data |= 0x1 << vector;
writel(data, mask_addr);
} }
/** /**
@ -108,20 +88,16 @@ void rt_hw_interrupt_mask(int vector)
*/ */
void rt_hw_interrupt_umask(int vector) void rt_hw_interrupt_umask(int vector)
{ {
rt_uint32_t mask_addr, data; int index;
if ((vector < 0) || (vector > INTERRUPTS_MAX)) if ((vector < 0) || (vector > INTERRUPTS_MAX))
{ {
return; return;
} }
mask_addr = (rt_uint32_t)(&INTC->mask_reg0); index = (vector & 0xE0) != 0;
mask_addr += vector & 0xE0 ? sizeof(rt_uint32_t *) : 0; vector = (vector & 0x1F);
vector &= 0x1F; INTC->mask_reg[index] &= ~(1 << vector);
data = readl(mask_addr);
data &= ~(0x1 << vector);
writel(data, mask_addr);
} }
/** /**
@ -136,7 +112,7 @@ rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t handler,
void *param, const char *name) void *param, const char *name)
{ {
rt_isr_handler_t old_handler = RT_NULL; rt_isr_handler_t old_handler = RT_NULL;
rt_uint32_t pend_addr, en_addr, data; int index;
if ((vector < 0) || (vector > INTERRUPTS_MAX)) if ((vector < 0) || (vector > INTERRUPTS_MAX))
{ {
@ -151,19 +127,11 @@ rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t handler,
isr_table[vector].handler = handler; isr_table[vector].handler = handler;
isr_table[vector].param = param; isr_table[vector].param = param;
pend_addr = (rt_uint32_t)(&INTC->pend_reg0); index = (vector & 0xE0) != 0;
en_addr = (rt_uint32_t)(&INTC->en_reg0); vector = (vector & 0x1F);
pend_addr += vector & 0xE0 ? sizeof(rt_uint32_t *) : 0;
en_addr += vector & 0xE0 ? sizeof(rt_uint32_t *) : 0;
vector &= 0x1F; INTC->pend_reg[index] &= ~(0x1 << vector);
data = readl(pend_addr); INTC->en_reg[index] |= 0x1 << vector;
data &= ~(0x1 << vector);
writel(data, pend_addr);
data = readl(en_addr);
data |= 0x1 << vector;
writel(data, en_addr);
return old_handler; return old_handler;
} }
@ -173,7 +141,7 @@ void rt_interrupt_dispatch(rt_uint32_t fiq_irq)
void *param; void *param;
int vector; int vector;
rt_isr_handler_t isr_func; rt_isr_handler_t isr_func;
rt_uint32_t pend_addr, data; int index;
vector = INTC->vector_reg - INTC->base_addr_reg; vector = INTC->vector_reg - INTC->base_addr_reg;
vector = vector >> 2; vector = vector >> 2;
@ -184,13 +152,11 @@ void rt_interrupt_dispatch(rt_uint32_t fiq_irq)
/* jump to fun */ /* jump to fun */
isr_func(vector, param); isr_func(vector, param);
/* clear pend bit */ /* clear pend bit */
pend_addr = (rt_uint32_t)(&INTC->pend_reg0);
pend_addr += vector & 0xE0 ? sizeof(rt_uint32_t *) : 0;
vector &= 0x1F; index = (vector & 0xE0) != 0;
data = readl(pend_addr); vector = (vector & 0x1F);
data &= ~(0x1 << vector);
writel(data, pend_addr); INTC->pend_reg[index] &= ~(0x1 << vector);
#ifdef RT_USING_INTERRUPT_INFO #ifdef RT_USING_INTERRUPT_INFO
isr_table[vector].counter ++; isr_table[vector].counter ++;

@ -1,25 +1,12 @@
/* /*
* File : interrupt.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
* 2018-02-08 RT-Thread the first version * 2018-02-08 RT-Thread the first version
* 2020-03-2 Howard Su Define same regsiters as an array
*/ */
#ifndef __INTERRUPT_H__ #ifndef __INTERRUPT_H__
#define __INTERRUPT_H__ #define __INTERRUPT_H__
@ -74,34 +61,21 @@ struct tina_intc
volatile rt_uint32_t base_addr_reg; /* 0x04 */ volatile rt_uint32_t base_addr_reg; /* 0x04 */
volatile rt_uint32_t reserved0; volatile rt_uint32_t reserved0;
volatile rt_uint32_t nmi_ctrl_reg; /* 0x0C */ volatile rt_uint32_t nmi_ctrl_reg; /* 0x0C */
volatile rt_uint32_t pend_reg0; /* 0x10 */ volatile rt_uint32_t pend_reg[2]; /* 0x10, 0x14 */
volatile rt_uint32_t pend_reg1; /* 0x14 */
volatile rt_uint32_t reserved1[2]; volatile rt_uint32_t reserved1[2];
volatile rt_uint32_t en_reg0; /* 0x20 */ volatile rt_uint32_t en_reg[2]; /* 0x20, 0x24 */
volatile rt_uint32_t en_reg1; /* 0x24 */
volatile rt_uint32_t reserved2[2]; volatile rt_uint32_t reserved2[2];
volatile rt_uint32_t mask_reg0; /* 0x30 */ volatile rt_uint32_t mask_reg[2]; /* 0x30, 0x34 */
volatile rt_uint32_t mask_reg1; /* 0x34 */
volatile rt_uint32_t reserved3[2]; volatile rt_uint32_t reserved3[2];
volatile rt_uint32_t resp_reg0; /* 0x40 */ volatile rt_uint32_t resp_reg[2]; /* 0x40, 0x44 */
volatile rt_uint32_t resp_reg1; /* 0x44 */
volatile rt_uint32_t reserved4[2]; volatile rt_uint32_t reserved4[2];
volatile rt_uint32_t ff_reg0; /* 0x50 */ volatile rt_uint32_t ff_reg[2]; /* 0x50, 0x54 */
volatile rt_uint32_t ff_reg1; /* 0x54 */
volatile rt_uint32_t reserved5[2]; volatile rt_uint32_t reserved5[2];
volatile rt_uint32_t prio_reg0; /* 0x60 */ volatile rt_uint32_t prio_reg[4]; /* 0x60 - 0x6c */
volatile rt_uint32_t prio_reg1; /* 0x64 */
volatile rt_uint32_t prio_reg2; /* 0x68 */
volatile rt_uint32_t prio_reg3; /* 0x6C */
} ; } ;
typedef struct tina_intc *tina_intc_t; typedef struct tina_intc *tina_intc_t;
#define INTC ((tina_intc_t)INTC_BASE_ADDR) #define INTC ((tina_intc_t)INTC_BASE_ADDR)
void rt_hw_interrupt_init(void);
void rt_hw_interrupt_mask(int vector);
void rt_hw_interrupt_umask(int vector);
rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t handler, void *param, const char *name);
#endif /* __INTERRUPT_H__ */ #endif /* __INTERRUPT_H__ */

@ -1,21 +1,7 @@
/* /*
* File : mmu.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : mmu.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : rt_low_level_init.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : stack.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : trap.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,11 +1,7 @@
/* /*
* File : startup.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006, RT-Thread Develop Team
* *
* The license and distribution terms for this file may be * SPDX-License-Identifier: Apache-2.0
* found in the file LICENSE in this distribution or at
* http://openlab.rt-thread.com/license/LICENSE
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : smartconfig_demo.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,11 +1,7 @@
/* /*
* File : board.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2009 RT-Thread Develop Team
* *
* The license and distribution terms for this file may be * SPDX-License-Identifier: Apache-2.0
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,11 +1,7 @@
/* /*
* File : board.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2009, RT-Thread Development Team
* *
* The license and distribution terms for this file may be * SPDX-License-Identifier: Apache-2.0
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : drv_uart.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
@ -125,7 +111,7 @@ static int ameba_uart_getc (struct rt_serial_device *serial)
{ {
struct device_uart* uart = serial->parent.user_data; struct device_uart* uart = serial->parent.user_data;
if(!serial_readable(&uart->serial)) if(!serial_readable(&uart->serial))
return -1; return -1;
/* Receive Data Available */ /* Receive Data Available */
@ -140,13 +126,13 @@ static rt_size_t ameba_uart_dma_transmit (struct rt_serial_device *serial, rt_ui
static void ameba_uart_irq(uint32_t id, SerialIrq event) static void ameba_uart_irq(uint32_t id, SerialIrq event)
{ {
struct rt_serial_device *serial = (struct rt_serial_device *)id; struct rt_serial_device *serial = (struct rt_serial_device *)id;
if(event == RxIrq) if(event == RxIrq)
{ {
rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_IND); rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_IND);
} }
else if(event == TxIrq) else if(event == TxIrq)
{ {
} }
} }
static rt_err_t dbg_configure(struct rt_serial_device *serial, struct serial_configure *cfg); static rt_err_t dbg_configure(struct rt_serial_device *serial, struct serial_configure *cfg);
@ -192,9 +178,9 @@ static rt_err_t dbg_control(struct rt_serial_device *serial, int cmd, void *arg)
case RT_DEVICE_CTRL_SET_INT: case RT_DEVICE_CTRL_SET_INT:
/* install interrupt */ /* install interrupt */
DIAG_UartReInit((IRQ_FUN) dbg_uart_irq_handler); DIAG_UartReInit((IRQ_FUN) dbg_uart_irq_handler);
/* Enable the UART Interrupt */ /* Enable the UART Interrupt */
NVIC_SetPriority(UART_LOG_IRQ, 10); /* this is rom_code_patch */ NVIC_SetPriority(UART_LOG_IRQ, 10); /* this is rom_code_patch */
break; break;
} }

@ -1,21 +1,7 @@
/* /*
* File : drv_uart.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : drv_wifi.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : drv_wifi.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : drv_wlan.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : drv_wlan.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
@ -27,12 +13,12 @@
typedef enum typedef enum
{ {
RTHW_MODE_NONE = 0, RTHW_MODE_NONE = 0,
RTHW_MODE_STA, RTHW_MODE_STA,
RTHW_MODE_AP, RTHW_MODE_AP,
RTHW_MODE_STA_AP, RTHW_MODE_STA_AP,
RTHW_MODE_PROMISC, RTHW_MODE_PROMISC,
RTHW_MODE_P2P RTHW_MODE_P2P
}rthw_mode_t; }rthw_mode_t;
#define SHARED_ENABLED 0x00008000 #define SHARED_ENABLED 0x00008000

@ -1,21 +1,7 @@
/* /*
* File : smartconfig.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : main.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : adc.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
@ -33,14 +19,14 @@ struct rt_messagequeue adcbat_mq;
#define BATTERY_GPIO 35 /* Battery */ #define BATTERY_GPIO 35 /* Battery */
#define BATTERY_ADC_PIN AM_HAL_PIN_35_ADCSE7 #define BATTERY_ADC_PIN AM_HAL_PIN_35_ADCSE7
#define BATTERY_ADC_CHANNEL AM_HAL_ADC_SLOT_CHSEL_SE7 /* BATTERY ADC采集通道 */ #define BATTERY_ADC_CHANNEL AM_HAL_ADC_SLOT_CHSEL_SE7 /* BATTERY ADC采集通道 */
#define BATTERY_ADC_CHANNELNUM 7 /* BATTERY ADC采集通道号 */ #define BATTERY_ADC_CHANNELNUM 7 /* BATTERY ADC采集通道号 */
#define ADC_CTIMER_NUM 3 /* ADC使用定时器 */ #define ADC_CTIMER_NUM 3 /* ADC使用定时器 */
#define ADC_CTIMER_COUNT (2048/512 - 1) #define ADC_CTIMER_COUNT (2048/512 - 1)
#define ADC_CHANNEL_NUM 1 /* ADC采集通道个数 */ #define ADC_CHANNEL_NUM 1 /* ADC采集通道个数 */
#define ADC_SAMPLE_NUM 8 /* ADC采样个数 */ #define ADC_SAMPLE_NUM 8 /* ADC采样个数 */
rt_uint8_t bat_adc_cnt = 0; rt_uint8_t bat_adc_cnt = 0;
static rt_uint8_t am_adcbat_buffer_pool[256]; static rt_uint8_t am_adcbat_buffer_pool[256];

@ -1,21 +1,7 @@
/* /*
* File : adc.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : board.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : board.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : flash.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
@ -77,7 +63,7 @@ static rt_err_t rt_flash_control(rt_device_t dev, int cmd, void *args)
ui32CurrentPage = AM_HAL_FLASH_ADDR2PAGE(erase->addrstart); ui32CurrentPage = AM_HAL_FLASH_ADDR2PAGE(erase->addrstart);
ui32CurrentBlock = AM_HAL_FLASH_ADDR2INST(erase->addrstart); ui32CurrentBlock = AM_HAL_FLASH_ADDR2INST(erase->addrstart);
am_hal_flash_page_erase(AM_HAL_FLASH_PROGRAM_KEY, ui32CurrentBlock, ui32CurrentPage); //µ¥ÉÈÇø²Á³ýÃüÁî am_hal_flash_page_erase(AM_HAL_FLASH_PROGRAM_KEY, ui32CurrentBlock, ui32CurrentPage); //单扇区擦除命令
erase->addrstart += 8192; erase->addrstart += 8192;
} }
} }

@ -1,21 +1,7 @@
/* /*
* File : flash.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : gpio.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : gpio.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File :_i2c.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : i2c.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File :_led.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : led.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File :_pdm.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : pdm.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File :_pwm.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : pwm.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File :_rtc.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
@ -129,12 +115,12 @@ int rt_hw_rtc_init(void)
am_hal_rtc_osc_enable(); am_hal_rtc_osc_enable();
/* register rtc device */ /* register rtc device */
rtc.type = RT_Device_Class_RTC; rtc.type = RT_Device_Class_RTC;
rtc.init = RT_NULL; rtc.init = RT_NULL;
rtc.open = rt_rtc_open; rtc.open = rt_rtc_open;
rtc.close = RT_NULL; rtc.close = RT_NULL;
rtc.read = rt_rtc_read; rtc.read = rt_rtc_read;
rtc.write = RT_NULL; rtc.write = RT_NULL;
rtc.control = rt_rtc_control; rtc.control = rt_rtc_control;
/* no private */ /* no private */

@ -1,21 +1,7 @@
/* /*
* File : rtc.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : smbus.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
@ -42,8 +28,8 @@
#define mSDA_OUT() am_hal_gpio_pin_config(SMBUS_GPIO_SDA, AM_HAL_GPIO_OUTPUT) /* Set SDA as Output */ #define mSDA_OUT() am_hal_gpio_pin_config(SMBUS_GPIO_SDA, AM_HAL_GPIO_OUTPUT) /* Set SDA as Output */
#define mSCL_OUT() am_hal_gpio_pin_config(SMBUS_GPIO_SCL, AM_HAL_GPIO_OUTPUT) /* Set SCL as Output */ #define mSCL_OUT() am_hal_gpio_pin_config(SMBUS_GPIO_SCL, AM_HAL_GPIO_OUTPUT) /* Set SCL as Output */
#define ACK 0 #define ACK 0
#define NACK 1 #define NACK 1
/* SCL keep time */ /* SCL keep time */
static void keep_delay(void) static void keep_delay(void)
@ -128,7 +114,7 @@ static void am_smbus_stop_bit(void)
static rt_uint8_t am_smbus_tx_byte(rt_uint8_t tx_byte) static rt_uint8_t am_smbus_tx_byte(rt_uint8_t tx_byte)
{ {
int i; int i;
rt_uint8_t ack_bit; rt_uint8_t ack_bit;
rt_uint8_t bit_out; rt_uint8_t bit_out;

@ -1,21 +1,7 @@
/* /*
* File : smbus.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : spi.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
@ -180,7 +166,7 @@ static rt_uint32_t xfer(struct rt_spi_device *device, struct rt_spi_message* mes
am_hal_gpio_out_bit_clear(am_spi_cs->chip_select); am_hal_gpio_out_bit_clear(am_spi_cs->chip_select);
} }
// ¶ÁÊý¾Ý // 读数据
if (recv_ptr != RT_NULL) if (recv_ptr != RT_NULL)
{ {
while (u32BytesRemaining) while (u32BytesRemaining)
@ -213,7 +199,7 @@ static rt_uint32_t xfer(struct rt_spi_device *device, struct rt_spi_message* mes
} }
} }
// дÊý¾Ý // 写数据
else else
{ {
while (u32BytesRemaining) while (u32BytesRemaining)

@ -1,21 +1,7 @@
/* /*
* File : spi.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
@ -27,7 +13,7 @@
#include <rtthread.h> #include <rtthread.h>
/* ƬѡÐźŽṹÉùÃ÷ */ /* 片选信号结构声明 */
struct am_spi_cs struct am_spi_cs
{ {
rt_uint32_t chip_select; rt_uint32_t chip_select;

@ -1,21 +1,7 @@
/* /*
* File : uart.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : uart.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,25 +1,11 @@
/* /*
* File : application.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006-2015, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
* 2011-01-13 weety first version * 2011-01-13 weety first version
* 2015-04-27 ArdaFu Port bsp from at91sam9260 to asm9260t * 2015-04-27 ArdaFu Port bsp from at91sam9260 to asm9260t
*/ */

@ -1,21 +1,7 @@
/* /*
* File : board.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009 RT-Thread Develop Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : board.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006, RT-Thread Develop Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : led.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006-2015, RT-Thread Develop Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : led.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : usart.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006-2015, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : interrupt.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : interrupt.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : interrupt.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006-2015, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : interrupt.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : reset.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006-2015, RT-Thread Develop Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : rt_low_level_init.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : rt_low_level_init.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : clock.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
@ -28,269 +14,269 @@
static rt_list_t clocks; static rt_list_t clocks;
struct clk { struct clk {
char name[32]; char name[32];
rt_uint32_t rate_hz; rt_uint32_t rate_hz;
struct clk *parent; struct clk *parent;
rt_list_t node; rt_list_t node;
}; };
static struct clk clk32k = { static struct clk clk32k = {
"clk32k", "clk32k",
AT91_SLOW_CLOCK, AT91_SLOW_CLOCK,
RT_NULL, RT_NULL,
{RT_NULL, RT_NULL}, {RT_NULL, RT_NULL},
}; };
static struct clk main_clk = { static struct clk main_clk = {
"main", "main",
0, 0,
RT_NULL, RT_NULL,
{RT_NULL, RT_NULL}, {RT_NULL, RT_NULL},
}; };
static struct clk plla = { static struct clk plla = {
"plla", "plla",
0, 0,
RT_NULL, RT_NULL,
{RT_NULL, RT_NULL}, {RT_NULL, RT_NULL},
}; };
static struct clk mck = { static struct clk mck = {
"mck", "mck",
0, 0,
RT_NULL, RT_NULL,
{RT_NULL, RT_NULL}, {RT_NULL, RT_NULL},
}; };
static struct clk uhpck = { static struct clk uhpck = {
"uhpck", "uhpck",
0, 0,
RT_NULL, RT_NULL,
{RT_NULL, RT_NULL}, {RT_NULL, RT_NULL},
}; };
static struct clk pllb = { static struct clk pllb = {
"pllb", "pllb",
0, 0,
&main_clk, &main_clk,
{RT_NULL, RT_NULL}, {RT_NULL, RT_NULL},
}; };
static struct clk udpck = { static struct clk udpck = {
"udpck", "udpck",
0, 0,
&pllb, &pllb,
{RT_NULL, RT_NULL}, {RT_NULL, RT_NULL},
}; };
static struct clk *const standard_pmc_clocks[] = { static struct clk *const standard_pmc_clocks[] = {
// four primary clocks // four primary clocks
&clk32k, &clk32k,
&main_clk, &main_clk,
&plla, &plla,
// MCK // MCK
&mck &mck
}; };
// clocks cannot be de-registered no refcounting necessary // clocks cannot be de-registered no refcounting necessary
struct clk *clk_get(const char *id) struct clk *clk_get(const char *id)
{ {
struct clk *clk; struct clk *clk;
rt_list_t *list; rt_list_t *list;
for (list = (&clocks)->next; list != &clocks; list = list->next) for (list = (&clocks)->next; list != &clocks; list = list->next)
{ {
clk = (struct clk *)rt_list_entry(list, struct clk, node); clk = (struct clk *)rt_list_entry(list, struct clk, node);
if (rt_strcmp(id, clk->name) == 0) if (rt_strcmp(id, clk->name) == 0)
return clk; return clk;
} }
return RT_NULL; return RT_NULL;
} }
rt_uint32_t clk_get_rate(struct clk *clk) rt_uint32_t clk_get_rate(struct clk *clk)
{ {
rt_uint32_t rate; rt_uint32_t rate;
for (;;) { for (;;) {
rate = clk->rate_hz; rate = clk->rate_hz;
if (rate || !clk->parent) if (rate || !clk->parent)
break; break;
clk = clk->parent; clk = clk->parent;
} }
return rate; return rate;
} }
static rt_uint32_t at91_pll_rate(struct clk *pll, rt_uint32_t freq, rt_uint32_t reg) static rt_uint32_t at91_pll_rate(struct clk *pll, rt_uint32_t freq, rt_uint32_t reg)
{ {
unsigned mul, div; unsigned mul, div;
div = reg & 0xff; div = reg & 0xff;
mul = (reg >> 16) & 0x7ff; mul = (reg >> 16) & 0x7ff;
if (div && mul) { if (div && mul) {
freq /= div; freq /= div;
freq *= mul + 1; freq *= mul + 1;
} else } else
freq = 0; freq = 0;
return freq; return freq;
} }
static unsigned at91_pll_calc(unsigned main_freq, unsigned out_freq) static unsigned at91_pll_calc(unsigned main_freq, unsigned out_freq)
{ {
unsigned i, div = 0, mul = 0, diff = 1 << 30; unsigned i, div = 0, mul = 0, diff = 1 << 30;
unsigned ret = (out_freq > 155000000) ? 0xbe00 : 0x3e00; unsigned ret = (out_freq > 155000000) ? 0xbe00 : 0x3e00;
//PLL output max 240 MHz (or 180 MHz per errata) //PLL output max 240 MHz (or 180 MHz per errata)
if (out_freq > 240000000) if (out_freq > 240000000)
goto fail; goto fail;
for (i = 1; i < 256; i++) { for (i = 1; i < 256; i++) {
int diff1; int diff1;
unsigned input, mul1; unsigned input, mul1;
// //
// PLL input between 1MHz and 32MHz per spec, but lower // PLL input between 1MHz and 32MHz per spec, but lower
// frequences seem necessary in some cases so allow 100K. // frequences seem necessary in some cases so allow 100K.
// Warning: some newer products need 2MHz min. // Warning: some newer products need 2MHz min.
// //
input = main_freq / i; input = main_freq / i;
if (input < 100000) if (input < 100000)
continue; continue;
if (input > 32000000) if (input > 32000000)
continue; continue;
mul1 = out_freq / input; mul1 = out_freq / input;
if (mul1 > 2048) if (mul1 > 2048)
continue; continue;
if (mul1 < 2) if (mul1 < 2)
goto fail; goto fail;
diff1 = out_freq - input * mul1; diff1 = out_freq - input * mul1;
if (diff1 < 0) if (diff1 < 0)
diff1 = -diff1; diff1 = -diff1;
if (diff > diff1) { if (diff > diff1) {
diff = diff1; diff = diff1;
div = i; div = i;
mul = mul1; mul = mul1;
if (diff == 0) if (diff == 0)
break; break;
} }
} }
if (i == 256 && diff > (out_freq >> 5)) if (i == 256 && diff > (out_freq >> 5))
goto fail; goto fail;
return ret | ((mul - 1) << 16) | div; return ret | ((mul - 1) << 16) | div;
fail: fail:
return 0; return 0;
} }
static rt_uint32_t at91_usb_rate(struct clk *pll, rt_uint32_t freq, rt_uint32_t reg) static rt_uint32_t at91_usb_rate(struct clk *pll, rt_uint32_t freq, rt_uint32_t reg)
{ {
if (pll == &pllb && (reg & AT91_PMC_USB96M)) if (pll == &pllb && (reg & AT91_PMC_USB96M))
return freq / 2; return freq / 2;
else else
return freq; return freq;
} }
// PLLB generated USB full speed clock init // PLLB generated USB full speed clock init
static void at91_pllb_usbfs_clock_init(rt_uint32_t main_clock) static void at91_pllb_usbfs_clock_init(rt_uint32_t main_clock)
{ {
rt_uint32_t at91_pllb_usb_init; rt_uint32_t at91_pllb_usb_init;
// //
// USB clock init: choose 48 MHz PLLB value, // USB clock init: choose 48 MHz PLLB value,
// disable 48MHz clock during usb peripheral suspend. // disable 48MHz clock during usb peripheral suspend.
// //
// REVISIT: assumes MCK doesn't derive from PLLB! // REVISIT: assumes MCK doesn't derive from PLLB!
// //
uhpck.parent = &pllb; uhpck.parent = &pllb;
at91_pllb_usb_init = at91_pll_calc(main_clock, 48000000 * 2) | AT91_PMC_USB96M; at91_pllb_usb_init = at91_pll_calc(main_clock, 48000000 * 2) | AT91_PMC_USB96M;
pllb.rate_hz = at91_pll_rate(&pllb, main_clock, at91_pllb_usb_init); pllb.rate_hz = at91_pll_rate(&pllb, main_clock, at91_pllb_usb_init);
at91_sys_write(AT91_CKGR_PLLBR, 0); at91_sys_write(AT91_CKGR_PLLBR, 0);
udpck.rate_hz = at91_usb_rate(&pllb, pllb.rate_hz, at91_pllb_usb_init); udpck.rate_hz = at91_usb_rate(&pllb, pllb.rate_hz, at91_pllb_usb_init);
uhpck.rate_hz = at91_usb_rate(&pllb, pllb.rate_hz, at91_pllb_usb_init); uhpck.rate_hz = at91_usb_rate(&pllb, pllb.rate_hz, at91_pllb_usb_init);
} }
static struct clk *at91_css_to_clk(unsigned long css) static struct clk *at91_css_to_clk(unsigned long css)
{ {
switch (css) { switch (css) {
case AT91_PMC_CSS_SLOW: case AT91_PMC_CSS_SLOW:
return &clk32k; return &clk32k;
case AT91_PMC_CSS_MAIN: case AT91_PMC_CSS_MAIN:
return &main_clk; return &main_clk;
case AT91_PMC_CSS_PLLA: case AT91_PMC_CSS_PLLA:
return &plla; return &plla;
case AT91_PMC_CSS_PLLB: case AT91_PMC_CSS_PLLB:
return &pllb; return &pllb;
} }
return RT_NULL; return RT_NULL;
} }
#define false 0 #define false 0
#define true 1 #define true 1
int at91_clock_init(rt_uint32_t main_clock) int at91_clock_init(rt_uint32_t main_clock)
{ {
unsigned tmp, freq, mckr; unsigned tmp, freq, mckr;
int i; int i;
int pll_overclock = false; int pll_overclock = false;
// //
// When the bootloader initialized the main oscillator correctly, // When the bootloader initialized the main oscillator correctly,
// there's no problem using the cycle counter. But if it didn't, // there's no problem using the cycle counter. But if it didn't,
// or when using oscillator bypass mode, we must be told the speed // or when using oscillator bypass mode, we must be told the speed
// of the main clock. // of the main clock.
// //
if (!main_clock) { if (!main_clock) {
do { do {
tmp = at91_sys_read(AT91_CKGR_MCFR); tmp = at91_sys_read(AT91_CKGR_MCFR);
} while (!(tmp & AT91_PMC_MAINRDY)); } while (!(tmp & AT91_PMC_MAINRDY));
main_clock = (tmp & AT91_PMC_MAINF) * (AT91_SLOW_CLOCK / 16); main_clock = (tmp & AT91_PMC_MAINF) * (AT91_SLOW_CLOCK / 16);
} }
main_clk.rate_hz = main_clock; main_clk.rate_hz = main_clock;
// report if PLLA is more than mildly overclocked // report if PLLA is more than mildly overclocked
plla.rate_hz = at91_pll_rate(&plla, main_clock, at91_sys_read(AT91_CKGR_PLLAR)); plla.rate_hz = at91_pll_rate(&plla, main_clock, at91_sys_read(AT91_CKGR_PLLAR));
if (plla.rate_hz > 209000000) if (plla.rate_hz > 209000000)
pll_overclock = true; pll_overclock = true;
if (pll_overclock) if (pll_overclock)
;//rt_kprintf("Clocks: PLLA overclocked, %ld MHz\n", plla.rate_hz / 1000000); ;//rt_kprintf("Clocks: PLLA overclocked, %ld MHz\n", plla.rate_hz / 1000000);
at91_pllb_usbfs_clock_init(main_clock); at91_pllb_usbfs_clock_init(main_clock);
// //
// MCK and CPU derive from one of those primary clocks. // MCK and CPU derive from one of those primary clocks.
// For now, assume this parentage won't change. // For now, assume this parentage won't change.
// //
mckr = at91_sys_read(AT91_PMC_MCKR); mckr = at91_sys_read(AT91_PMC_MCKR);
mck.parent = at91_css_to_clk(mckr & AT91_PMC_CSS); mck.parent = at91_css_to_clk(mckr & AT91_PMC_CSS);
freq = mck.parent->rate_hz; freq = mck.parent->rate_hz;
freq /= (1 << ((mckr & AT91_PMC_PRES) >> 2)); // prescale freq /= (1 << ((mckr & AT91_PMC_PRES) >> 2)); // prescale
mck.rate_hz = freq / (1 << ((mckr & AT91_PMC_MDIV) >> 8)); // mdiv mck.rate_hz = freq / (1 << ((mckr & AT91_PMC_MDIV) >> 8)); // mdiv
// Register the PMC's standard clocks // Register the PMC's standard clocks
rt_list_init(&clocks); rt_list_init(&clocks);
for (i = 0; i < ARRAY_SIZE(standard_pmc_clocks); i++) for (i = 0; i < ARRAY_SIZE(standard_pmc_clocks); i++)
rt_list_insert_after(&clocks, &standard_pmc_clocks[i]->node); rt_list_insert_after(&clocks, &standard_pmc_clocks[i]->node);
rt_list_insert_after(&clocks, &pllb.node); rt_list_insert_after(&clocks, &pllb.node);
rt_list_insert_after(&clocks, &uhpck.node); rt_list_insert_after(&clocks, &uhpck.node);
rt_list_insert_after(&clocks, &udpck.node); rt_list_insert_after(&clocks, &udpck.node);
// MCK and CPU clock are "always on" // MCK and CPU clock are "always on"
//clk_enable(&mck); //clk_enable(&mck);
//rt_kprintf("Clocks: CPU %u MHz, master %u MHz, main %u.%03u MHz\n", //rt_kprintf("Clocks: CPU %u MHz, master %u MHz, main %u.%03u MHz\n",
// freq / 1000000, (unsigned) mck.rate_hz / 1000000, // freq / 1000000, (unsigned) mck.rate_hz / 1000000,
// (unsigned) main_clock / 1000000, // (unsigned) main_clock / 1000000,
// ((unsigned) main_clock % 1000000) / 1000); //cause blocked // ((unsigned) main_clock % 1000000) / 1000); //cause blocked
return 0; return 0;
} }
*/ */
@ -298,6 +284,6 @@ int at91_clock_init(rt_uint32_t main_clock)
void rt_hw_clock_init(void) void rt_hw_clock_init(void)
{ {
//at91_clock_init(18432000); //at91_clock_init(18432000);
} }

@ -1,21 +1,7 @@
/* /*
* File : timer0.c * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006-2015, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : timer0.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006-2015, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : interrupt.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

@ -1,21 +1,7 @@
/* /*
* File : interrupt.h * Copyright (c) 2006-2021, RT-Thread Development Team
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify * SPDX-License-Identifier: Apache-2.0
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
@ -50,16 +36,16 @@ typedef struct
volatile rt_uint32_t ISO7816STATUS[4]; volatile rt_uint32_t ISO7816STATUS[4];
} HW_USART_TypeDef; } HW_USART_TypeDef;
#define USART0 ((HW_USART_TypeDef *)UART0_BASE) #define USART0 ((HW_USART_TypeDef *)UART0_BASE)
#define USART1 ((HW_USART_TypeDef *)UART1_BASE) #define USART1 ((HW_USART_TypeDef *)UART1_BASE)
#define USART2 ((HW_USART_TypeDef *)UART2_BASE) #define USART2 ((HW_USART_TypeDef *)UART2_BASE)
#define USART3 ((HW_USART_TypeDef *)UART3_BASE) #define USART3 ((HW_USART_TypeDef *)UART3_BASE)
#define USART4 ((HW_USART_TypeDef *)UART4_BASE) #define USART4 ((HW_USART_TypeDef *)UART4_BASE)
#define USART5 ((HW_USART_TypeDef *)UART5_BASE) #define USART5 ((HW_USART_TypeDef *)UART5_BASE)
#define USART6 ((HW_USART_TypeDef *)UART6_BASE) #define USART6 ((HW_USART_TypeDef *)UART6_BASE)
#define USART7 ((HW_USART_TypeDef *)UART7_BASE) #define USART7 ((HW_USART_TypeDef *)UART7_BASE)
#define USART8 ((HW_USART_TypeDef *)UART8_BASE) #define USART8 ((HW_USART_TypeDef *)UART8_BASE)
#define USART9 ((HW_USART_TypeDef *)UART9_BASE) #define USART9 ((HW_USART_TypeDef *)UART9_BASE)
#define ASM_UART_INTR_RXIS (1UL << 4) #define ASM_UART_INTR_RXIS (1UL << 4)

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2018, RT-Thread Development Team * Copyright (c) 2006-2021, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2018, RT-Thread Development Team * Copyright (c) 2006-2021, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2018, RT-Thread Development Team * Copyright (c) 2006-2021, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2018, RT-Thread Development Team * Copyright (c) 2006-2021, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2018, RT-Thread Development Team * Copyright (c) 2006-2021, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *
@ -28,8 +28,8 @@
//#define DRV_DEBUG //#define DRV_DEBUG
#define LOG_TAG "drv.emac" #define LOG_TAG "drv.emac"
#define ETH_RXBUFNB 4 #define ETH_RXBUFNB 4
#define ETH_TXBUFNB 2 #define ETH_TXBUFNB 2
#define LINK_THREAD_STACK_SIZE 256 #define LINK_THREAD_STACK_SIZE 256
#define LINK_THREAD_PREORITY 21 #define LINK_THREAD_PREORITY 21
@ -173,7 +173,7 @@ void GPIO_Configuration(void)
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
GPIO_Init(GPIOC, &GPIO_InitStructure); GPIO_Init(GPIOC, &GPIO_InitStructure);
/*MII Mode GPIO configuration*/ /*MII Mode GPIO configuration*/
#ifdef MII_MODE #ifdef MII_MODE
/**********************MII Tx Pin Define****************************/ /**********************MII Tx Pin Define****************************/
/* /*
@ -193,7 +193,7 @@ void GPIO_Configuration(void)
GPIO_InitStructure.GPIO_MaxSpeed = GPIO_MaxSpeed_50MHz; GPIO_InitStructure.GPIO_MaxSpeed = GPIO_MaxSpeed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
GPIO_Init(GPIOC, &GPIO_InitStructure); GPIO_Init(GPIOC, &GPIO_InitStructure);
/**********************MII Rx Pin Define****************************/ /**********************MII Rx Pin Define****************************/
#if MII_RX_REMAP /*IO PIN remaped*/ #if MII_RX_REMAP /*IO PIN remaped*/
/* /*
ETH_MII_RX_DV-->PD8 ETH_MII_RX_DV-->PD8
@ -256,7 +256,7 @@ void GPIO_Configuration(void)
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
GPIO_Init(GPIOB, &GPIO_InitStructure); GPIO_Init(GPIOB, &GPIO_InitStructure);
/**********************RMII Rx Pin Define****************************/ /**********************RMII Rx Pin Define****************************/
#if MII_RX_REMAP /*IO PIN remaped*/ #if MII_RX_REMAP /*IO PIN remaped*/
/* /*
ETH_RMII_RX_DV-->PD8 ETH_RMII_RX_DV-->PD8

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2018, RT-Thread Development Team * Copyright (c) 2006-2021, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2018, RT-Thread Development Team * Copyright (c) 2006-2021, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *
@ -160,7 +160,7 @@ int at32_flash_erase(rt_uint32_t addr, size_t size)
addr += FLASH_PAGE_SIZE; addr += FLASH_PAGE_SIZE;
} }
FLASH_Lock(); FLASH_Lock();
__exit: __exit:
if(result != RT_EOK) if(result != RT_EOK)

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2018, RT-Thread Development Team * Copyright (c) 2006-2021, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2018, RT-Thread Development Team * Copyright (c) 2006-2021, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

Some files were not shown because too many files have changed in this diff Show More