未验证 提交 fb61c796 编写于 作者: S stevetong459 提交者: GitHub

本次PR涉及①BSP驱动新增②F103库更新③GCC、IAR适配及MDK更新④README文件及由更新驱动引起的脚本改动。 (#5638)

* 本次提交包括①BSP驱动新增②F103库更新③GCC、IAR适配及MDK更新④README文件及由更新驱动引起的脚本改动。
详情如下:
一、BSP驱动新增
这是本次PR的主要目的,现新增了如下BSP驱动:
ADC、DAC、RTC、PWM、HWTIMER、I2C、SPI和WDT等八个驱动文件。
二、F103库更新:
本次提交使用2022年3月初极海官网发布的最新F103库,主要增加了版权声明、USB驱动及其他代码调整。
三、编译器适配:
1、新增GCC编译支持,在ENV工具下编译能成功且输出的bin文件能够使开发板闪灯。
2、新增IAR工程支持。
3、由F103的SDK更新,MDK的工程也进行了相应更新。
四、其他
1、README文件做了修改,加入了scons编译后的jlink下载说明和官网链接。
2、Kconfig、SConscript脚本根据驱动更新做了修改。

* 格式化代码(AStyle + Formatting)

* 增加BSP APM版权声明

* 在ci添加当前bsp的路径,以能够验证gcc能否正常编译

* 路径的“\”改为“/”
上级 ffae7a26
......@@ -31,6 +31,7 @@ jobs:
legs:
- {RTT_BSP: "acm32f0x0-nucleo", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "CME_M7", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "apm32/apm32f103xe-minibroard", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "apollo2", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "asm9260t", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "at91sam9260", RTT_TOOL_CHAIN: "sourcery-arm"}
......
......@@ -20,6 +20,33 @@ Path:
- bsp/acm32f0x0-nucleo/libraries
### apm32
bsp 列表:
- apm32f103xe-minibroard
------
License: GEEHY SOFTWARE PACKAGE LICENSE
Copyright: Copyright (C) 2020-2022 Geehy Semiconductor
Path:
- bsp\apm32\libraries\APM32F10x_Library\APM32F10x_StdPeriphDriver
- bsp\apm32\libraries\APM32F10x_Library\Device
- bsp\apm32\libraries\APM32F10x_Library\USB_Device_Lib
------
License: bsd-new
Copyright (c) 2009-2018 Arm Limited
Path:
- bsp\apm32\libraries\APM32F10x_Library\CMSIS\Include
### apollo2
License: bsd-new
......
......@@ -17,17 +17,18 @@ APM32F103ZE MINI BOARD,采用标准JTAG/SWD调试接口,引出了全部的IO
![board](figures/APM32F103ZE.png)
- 有关开发板和芯片的详情可至极海官网查阅。[官网开发板链接 ](https://www.geehy.com/support/apm32?id=192)
该开发板常用 **板载资源** 如下:
- MCU:APM32F103C8T6,主频 96MHz,512KB FLASH ,128KB RAM
- MCU:APM32F103ZET6,主频 96MHz,512KB FLASH ,128KB RAM
- 外部 RAM:无
- 外部 FLASH:无
- 常用外设
- LED:2个,(黄色,PE5/PE6)
- 按键:2个,K1(兼具唤醒功能,PA0),K2(PC13)
- 常用接口:RS232转串口、USB SLAVE
- 常用接口:RS232转串口、USB SLAVE
- 调试接口:标准 JTAG/SWD
......@@ -42,6 +43,14 @@ APM32F103ZE MINI BOARD,采用标准JTAG/SWD调试接口,引出了全部的IO
| **片上外设** | **支持情况** | **备注** |
| GPIO | 支持 | PA0, PA1... PG15 ---> PIN: 0, 1...143 |
| UART | 支持 | UART1/2 |
| ADC | 支持 | ADC1/2/3 |
| DAC | 支持 | DAC1 |
| RTC | 支持 | |
| TMR | 支持 | TMR1/2/3/4/5/6/7/8 |
| PWM | 支持 | TMR3 ->CH1/2 |
| I2C | 支持 | 软件I2C |
| SPI | 支持 | SPI1/2/3 |
| WDT | 支持 | IWDT |
## 使用说明
......@@ -57,11 +66,28 @@ APM32F103ZE MINI BOARD,采用标准JTAG/SWD调试接口,引出了全部的IO
使用数据线连接开发板到 PC,打开电源开关。
#### 编译下载
- 方式一:MDK
双击 project.uvprojx 文件,打开 MDK5 工程,编译并下载程序到开发板。
双击 project.uvprojx 文件,打开 MDK5 工程,编译并下载程序到开发板。
> 工程默认配置使用 J-Link 仿真器下载程序,在通过 J-Link 连接开发板的基础上,点击下载按钮即可下载程序到开发板
- 方式二:J-Flash下载
通过ENV工具的scons指令或MDK编译出bin文件后,再使用J-Flash工具将bin文件下载至开发板即可,大致步骤如下:
##### 1、建立J-Flash工程
![board](figures/JFlash_leader_01.png)
##### 2、连接开发板
![board](figures/JFlash_leader_02.png)
##### 3、将bin文件拖至工程,起始地址设为0x8000000
![board](figures/JFlash_leader_03.png)
##### 4、点击下载
![board](figures/JFlash_leader_04.png)
#### 运行结果
下载程序成功之后,系统会自动运行,LED 闪烁
......@@ -71,7 +97,7 @@ APM32F103ZE MINI BOARD,采用标准JTAG/SWD调试接口,引出了全部的IO
```bash
\ | /
- RT - Thread Operating System
/ | \ 4.0.4 build Aug 20 2021
/ | \ 4.1.0 build Aug 20 2021
2006 - 2021 Copyright by rt-thread team
msh >
```
......@@ -81,4 +107,6 @@ msh >
## 联系人信息
-[abbbcc ](https://gitee.com/abbbcc)
\ No newline at end of file
-[abbbcc ](https://gitee.com/abbbcc)
-[stevetong459 ](https://github.com/stevetong459)
......@@ -24,6 +24,155 @@ menu "On-chip Peripheral Drivers"
default y
endif
menuconfig BSP_USING_ADC
bool "Enable ADC"
default n
select RT_USING_ADC
if BSP_USING_ADC
config BSP_USING_ADC1
bool "Enable ADC1"
default n
config BSP_USING_ADC2
bool "Enable ADC2"
default n
config BSP_USING_ADC3
bool "Enable ADC3"
default n
endif
menuconfig BSP_USING_DAC
bool "Enable DAC"
default n
select RT_USING_DAC
if BSP_USING_DAC
config BSP_USING_DAC1
bool "Enable DAC1"
default n
endif
menuconfig BSP_USING_ONCHIP_RTC
bool "Enable RTC"
select RT_USING_RTC
default n
if BSP_USING_ONCHIP_RTC
choice
prompt "Select clock source"
default BSP_RTC_USING_LSE
config BSP_RTC_USING_LSE
bool "RTC USING LSE"
config BSP_RTC_USING_LSI
bool "RTC USING LSI"
endchoice
endif
menuconfig BSP_USING_I2C1
bool "Enable I2C1 BUS (software simulation)"
default n
select RT_USING_I2C
select RT_USING_I2C_BITOPS
select RT_USING_PIN
if BSP_USING_I2C1
config BSP_I2C1_SCL_PIN
int "i2c1 scl pin number"
range 0 63
default 22
config BSP_I2C1_SDA_PIN
int "I2C1 sda pin number"
range 0 63
default 23
endif
menuconfig BSP_USING_SPI
bool "Enable SPI"
default n
select RT_USING_SPI
if BSP_USING_SPI
config BSP_USING_SPI1
bool "Enable SPI1"
default n
config BSP_USING_SPI2
bool "Enable SPI2"
default n
config BSP_USING_SPI3
bool "Enable SPI3"
default n
endif
menuconfig BSP_USING_TMR
bool "Enable Timer"
default n
select RT_USING_HWTIMER
if BSP_USING_TMR
config BSP_USING_TMR1
bool "Enable TMR1"
default n
config BSP_USING_TMR2
bool "Enable TMR2"
default n
config BSP_USING_TMR3
bool "Enable TMR3"
default n
config BSP_USING_TMR4
bool "Enable TMR4"
default n
config BSP_USING_TMR5
bool "Enable TMR5"
default n
config BSP_USING_TMR6
bool "Enable TMR6"
default n
config BSP_USING_TMR7
bool "Enable TMR7"
default n
config BSP_USING_TMR8
bool "Enable TMR8"
default n
endif
menuconfig BSP_USING_PWM
bool "Enable PWM"
default n
select RT_USING_PWM
if BSP_USING_PWM
menuconfig BSP_USING_PWM3
bool "Enable timer3 output pwm"
default n
if BSP_USING_PWM3
config BSP_USING_PWM3_CH1
bool "Enable PWM3 channel1"
default n
config BSP_USING_PWM3_CH2
bool "Enable PWM3 channel2"
default n
config BSP_USING_PWM3_CH3
bool "Enable PWM3 channel3"
default n
config BSP_USING_PWM3_CH4
bool "Enable PWM3 channel4"
default n
endif
endif
config BSP_USING_WDT
bool "Enable Watchdog Timer"
select RT_USING_WDT
default n
endmenu
endmenu
......@@ -16,9 +16,15 @@ path = [cwd]
startup_path_prefix = SDK_LIB
if rtconfig.CROSS_TOOL == 'keil':
src += [startup_path_prefix + '/APM32F10x_Library/Device/Geehy/APM32F10x/Source/ARM/startup_apm32f10x_hd.s']
src += [startup_path_prefix + '/APM32F10x_Library/Device/Geehy/APM32F10x/Source/arm/startup_apm32f10x_hd.s']
if rtconfig.CROSS_TOOL == 'iar':
src += [startup_path_prefix + '/APM32F10x_Library/Device/Geehy/APM32F10x/Source/iar/startup_apm32f10x_hd.s']
if rtconfig.CROSS_TOOL == 'gcc':
src += [startup_path_prefix + '/APM32F10x_Library/Device/Geehy/APM32F10x/Source/gcc/startup_apm32f10x_hd.s']
# You can select chips from the list above
CPPDEFINES = ['APM32F103xE']
CPPDEFINES = ['APM32F10X_HD']
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
Return('group')
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
* Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
......@@ -13,15 +13,15 @@
void apm32_usart_init(void)
{
GPIO_Config_T GPIO_ConfigStruct;
#ifdef BSP_USING_UART1
RCM_EnableAPB2PeriphClock((RCM_APB2_PERIPH_T)(RCM_APB2_PERIPH_GPIOA | RCM_APB2_PERIPH_USART1));
GPIO_ConfigStruct.mode = GPIO_MODE_AF_PP;
GPIO_ConfigStruct.pin = GPIO_PIN_9;
GPIO_ConfigStruct.speed = GPIO_SPEED_50MHz;
GPIO_Config(GPIOA, &GPIO_ConfigStruct);
GPIO_ConfigStruct.mode = GPIO_MODE_IN_PU;
GPIO_ConfigStruct.pin = GPIO_PIN_10;
GPIO_ConfigStruct.speed = GPIO_SPEED_50MHz;
......@@ -31,12 +31,12 @@ void apm32_usart_init(void)
#ifdef BSP_USING_UART2
RCM_EnableAPB2PeriphClock(RCM_APB2_PERIPH_GPIOA);
RCM_EnableAPB1PeriphClock(RCM_APB1_PERIPH_USART2);
GPIO_ConfigStruct.mode = GPIO_MODE_AF_PP;
GPIO_ConfigStruct.pin = GPIO_PIN_2;
GPIO_ConfigStruct.speed = GPIO_SPEED_50MHz;
GPIO_Config(GPIOA, &GPIO_ConfigStruct);
GPIO_ConfigStruct.mode = GPIO_MODE_IN_PU;
GPIO_ConfigStruct.pin = GPIO_PIN_3;
GPIO_ConfigStruct.speed = GPIO_SPEED_50MHz;
......
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
* Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2020-08-20 Abbcc first version
* Date Author Notes
* 2020-08-20 Abbcc first version
* 2022-03-04 stevetong459 Add head file of new driver
*/
#ifndef __BOARD_H__
......@@ -21,6 +22,27 @@
#include "apm32f10x_eint.h"
#include "apm32f10x_usart.h"
#if defined(RT_USING_ADC)
#include "apm32f10x_adc.h"
#endif
#if defined(RT_USING_DAC)
#include "apm32f10x_dac.h"
#endif
#if defined(RT_USING_RTC)
#include "apm32f10x_rtc.h"
#include "apm32f10x_pmu.h"
#endif
#if defined(RT_USING_SPI)
#include "apm32f10x_spi.h"
#endif
#if defined(RT_USING_HWTIMER) || defined(RT_USING_PWM)
#include "apm32f10x_tmr.h"
#endif
#if defined(RT_USING_WDT)
#include "apm32f10x_iwdt.h"
#include "apm32f10x_wwdt.h"
#endif
#include "drv_common.h"
#include "drv_gpio.h"
......
/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x08000000;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x08000000;
define symbol __ICFEDIT_region_ROM_end__ = 0x0807FFFF;
define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
define symbol __ICFEDIT_region_RAM_end__ = 0x2001FFFF;
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__ = 0x0400;
define symbol __ICFEDIT_size_heap__ = 0x0000;
/**** End of ICF editor section. ###ICF###*/
define memory mem with size = 4G;
define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
initialize by copy { readwrite };
do not initialize { section .noinit };
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
place in ROM_region { readonly };
place in RAM_region { readwrite, last block CSTACK};
/*
* linker script for APM32F10x with GNU ld
*/
/* Program Entry, set to mark it as "used" and avoid gc */
MEMORY
{
CODE (rx) : ORIGIN = 0x08000000, LENGTH = 512k /* 512KB flash */
DATA (rw) : ORIGIN = 0x20000000, LENGTH = 128k /* 128KB sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x200;
SECTIONS
{
.text :
{
. = ALIGN(4);
_stext = .;
KEEP(*(.isr_vector)) /* Startup code */
. = ALIGN(4);
*(.text) /* remaining code */
*(.text.*) /* remaining code */
*(.rodata) /* read-only data (constants) */
*(.rodata*)
*(.glue_7)
*(.glue_7t)
*(.gnu.linkonce.t*)
/* section information for finsh shell */
. = ALIGN(4);
__fsymtab_start = .;
KEEP(*(FSymTab))
__fsymtab_end = .;
. = ALIGN(4);
__vsymtab_start = .;
KEEP(*(VSymTab))
__vsymtab_end = .;
. = ALIGN(4);
/* section information for initial. */
. = ALIGN(4);
__rt_init_start = .;
KEEP(*(SORT(.rti_fn*)))
__rt_init_end = .;
. = ALIGN(4);
. = ALIGN(4);
_etext = .;
} > CODE = 0
/* .ARM.exidx is sorted, so has to go in its own output section. */
__exidx_start = .;
.ARM.exidx :
{
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
/* This is used by the startup in order to initialize the .data secion */
_sidata = .;
} > CODE
__exidx_end = .;
/* .data section which is used for initialized data */
.data : AT (_sidata)
{
. = ALIGN(4);
/* This is used by the startup in order to initialize the .data secion */
_sdata = . ;
*(.data)
*(.data.*)
*(.gnu.linkonce.d*)
. = ALIGN(4);
/* This is used by the startup in order to initialize the .data secion */
_edata = . ;
} >DATA
.stack :
{
. = . + _system_stack_size;
. = ALIGN(4);
_estack = .;
} >DATA
__bss_start = .;
.bss :
{
. = ALIGN(4);
/* This is used by the startup in order to initialize the .bss secion */
_sbss = .;
*(.bss)
*(.bss.*)
*(COMMON)
. = ALIGN(4);
/* This is used by the startup in order to initialize the .bss secion */
_ebss = . ;
*(.bss.init)
} > DATA
__bss_end = .;
_end = .;
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
/* DWARF debug sections.
* Symbols in the DWARF debugging sections are relative to the beginning
* of the section so we begin them at 0. */
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
}
此差异已折叠。
<?xml version="1.0" encoding="iso-8859-1"?>
<workspace>
<project>
<path>$WS_DIR$\project.ewp</path>
</project>
<batchBuild/>
</workspace>
此差异已折叠。
......@@ -13,7 +13,7 @@
<TargetCommonOption>
<Device>APM32F103ZE</Device>
<Vendor>Geehy</Vendor>
<PackID>Geehy.APM32F1xx_DFP.1.0.7</PackID>
<PackID>Geehy.APM32F1xx_DFP.1.0.8</PackID>
<PackURL>https://www.geehy.com/uploads/tool/</PackURL>
<Cpu>IRAM(0x20000000,0x00020000) IROM(0x08000000,0x00080000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec />
......@@ -182,7 +182,6 @@
<uocXRam>0</uocXRam>
<RvdsVP>0</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
......@@ -334,9 +333,9 @@
<v6Rtti>0</v6Rtti>
<VariousControls>
<MiscControls />
<Define>USE_STDPERIPH_DRIVER, __RTTHREAD__, APM32F103xE, RT_USING_ARM_LIBC, __CLK_TCK=RT_TICK_PER_SECOND</Define>
<Define>USE_STDPERIPH_DRIVER, APM32F10X_HD, __RTTHREAD__, RT_USING_ARM_LIBC, __CLK_TCK=RT_TICK_PER_SECOND</Define>
<Undefine />
<IncludePath>applications;..\..\..\components\libc\compilers\common;..\..\..\components\libc\compilers\common\extension;..\..\..\libcpu\arm\common;..\..\..\libcpu\arm\cortex-m3;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;board;..\libraries\Drivers;..\libraries\Drivers\config;..\..\..\components\finsh;.;..\..\..\include;..\libraries\APM32F10x_Library\Device\Geehy\APM32F10x\Include;..\libraries\APM32F10x_Library\APM32F10x_StdPeriphDriver\inc;..\libraries\APM32F10x_Library\CMSIS\Include;..\..\..\components\libc\posix\io\poll;..\..\..\components\libc\posix\io\stdio;..\..\..\components\libc\posix\ipc;..\..\..\examples\utest\testcases\kernel</IncludePath>
<IncludePath>applications;..\..\..\components\libc\compilers\common;..\..\..\components\libc\compilers\common\nogcc;..\..\..\libcpu\arm\common;..\..\..\libcpu\arm\cortex-m3;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;board;..\libraries\Drivers;..\libraries\Drivers\config;..\..\..\components\finsh;.;..\..\..\include;..\libraries\APM32F10x_Library\Device\Geehy\APM32F10x\Include;..\libraries\APM32F10x_Library\APM32F10x_StdPeriphDriver\inc;..\libraries\APM32F10x_Library\CMSIS\Include;..\..\..\components\libc\posix\io\poll;..\..\..\components\libc\posix\ipc;..\..\..\examples\utest\testcases\kernel</IncludePath>
</VariousControls>
</Cads>
<Aads>
......@@ -349,7 +348,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>0</uSurpInc>
<useXO>0</useXO>
<ClangAsOpt>4</ClangAsOpt>
<uClangAs>0</uClangAs>
<VariousControls>
<MiscControls />
<Define />
......@@ -391,9 +390,9 @@
<GroupName>Compiler</GroupName>
<Files>
<File>
<FileName>syscalls.c</FileName>
<FileName>libc_syms.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\components\libc\compilers\armlibc\syscalls.c</FilePath>
<FilePath>..\..\..\components\libc\compilers\armlibc\libc_syms.c</FilePath>
</File>
</Files>
<Files>
......@@ -405,9 +404,9 @@
</Files>
<Files>
<File>
<FileName>stdlib.c</FileName>
<FileName>syscalls.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\components\libc\compilers\common\stdlib.c</FilePath>
<FilePath>..\..\..\components\libc\compilers\armlibc\syscalls.c</FilePath>
</File>
</Files>
<Files>
......@@ -417,6 +416,13 @@
<FilePath>..\..\..\components\libc\compilers\common\time.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>stdlib.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\components\libc\compilers\common\stdlib.c</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>CPU</GroupName>
......@@ -429,16 +435,16 @@
</Files>
<Files>
<File>
<FileName>div0.c</FileName>
<FileName>backtrace.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\libcpu\arm\common\div0.c</FilePath>
<FilePath>..\..\..\libcpu\arm\common\backtrace.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>backtrace.c</FileName>
<FileName>div0.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\libcpu\arm\common\backtrace.c</FilePath>
<FilePath>..\..\..\libcpu\arm\common\div0.c</FilePath>
</File>
</Files>
<Files>
......@@ -460,65 +466,65 @@
<GroupName>DeviceDrivers</GroupName>
<Files>
<File>
<FileName>completion.c</FileName>
<FileName>pin.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\components\drivers\ipc\completion.c</FilePath>
<FilePath>..\..\..\components\drivers\misc\pin.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>ringbuffer.c</FileName>
<FileName>serial.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\components\drivers\ipc\ringbuffer.c</FilePath>
<FilePath>..\..\..\components\drivers\serial\serial.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>waitqueue.c</FileName>
<FileName>ringbuffer.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\components\drivers\ipc\waitqueue.c</FilePath>
<FilePath>..\..\..\components\drivers\src\ringbuffer.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>dataqueue.c</FileName>
<FileName>pipe.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\components\drivers\ipc\dataqueue.c</FilePath>
<FilePath>..\..\..\components\drivers\src\pipe.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>pipe.c</FileName>
<FileName>ringblk_buf.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\components\drivers\ipc\pipe.c</FilePath>
<FilePath>..\..\..\components\drivers\src\ringblk_buf.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>workqueue.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\components\drivers\ipc\workqueue.c</FilePath>
<FilePath>..\..\..\components\drivers\src\workqueue.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>ringblk_buf.c</FileName>
<FileName>dataqueue.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\components\drivers\ipc\ringblk_buf.c</FilePath>
<FilePath>..\..\..\components\drivers\src\dataqueue.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>pin.c</FileName>
<FileName>waitqueue.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\components\drivers\misc\pin.c</FilePath>
<FilePath>..\..\..\components\drivers\src\waitqueue.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>serial.c</FileName>
<FileName>completion.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\components\drivers\serial\serial.c</FilePath>
<FilePath>..\..\..\components\drivers\src\completion.c</FilePath>
</File>
</Files>
</Group>
......@@ -526,16 +532,16 @@
<GroupName>Drivers</GroupName>
<Files>
<File>
<FileName>startup_apm32f10x_hd.s</FileName>
<FileType>2</FileType>
<FilePath>..\libraries\APM32F10x_Library\Device\Geehy\APM32F10x\Source\ARM\startup_apm32f10x_hd.s</FilePath>
<FileName>board.c</FileName>
<FileType>1</FileType>
<FilePath>board\board.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>board.c</FileName>
<FileType>1</FileType>
<FilePath>board\board.c</FilePath>
<FileName>startup_apm32f10x_hd.s</FileName>
<FileType>2</FileType>
<FilePath>..\libraries\APM32F10x_Library\Device\Geehy\APM32F10x\Source\arm\startup_apm32f10x_hd.s</FilePath>
</File>
</Files>
<Files>
......@@ -588,93 +594,93 @@
<GroupName>Kernel</GroupName>
<Files>
<File>
<FileName>clock.c</FileName>
<FileName>thread.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\src\clock.c</FilePath>
<FilePath>..\..\..\src\thread.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>kservice.c</FileName>
<FileName>mempool.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\src\kservice.c</FilePath>
<FilePath>..\..\..\src\mempool.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>scheduler.c</FileName>
<FileName>timer.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\src\scheduler.c</FilePath>
<FilePath>..\..\..\src\timer.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>ipc.c</FileName>
<FileName>object.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\src\ipc.c</FilePath>
<FilePath>..\..\..\src\object.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>mem.c</FileName>
<FileName>clock.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\src\mem.c</FilePath>
<FilePath>..\..\..\src\clock.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>device.c</FileName>
<FileName>scheduler.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\src\device.c</FilePath>
<FilePath>..\..\..\src\scheduler.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>mempool.c</FileName>
<FileName>ipc.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\src\mempool.c</FilePath>
<FilePath>..\..\..\src\ipc.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>components.c</FileName>
<FileName>mem.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\src\components.c</FilePath>
<FilePath>..\..\..\src\mem.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>thread.c</FileName>
<FileName>device.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\src\thread.c</FilePath>
<FilePath>..\..\..\src\device.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>object.c</FileName>
<FileName>kservice.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\src\object.c</FilePath>
<FilePath>..\..\..\src\kservice.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>idle.c</FileName>
<FileName>irq.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\src\idle.c</FilePath>
<FilePath>..\..\..\src\irq.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>timer.c</FileName>
<FileName>components.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\src\timer.c</FilePath>
<FilePath>..\..\..\src\components.c</FilePath>
</File>
</Files>
<Files>
<File>
<FileName>irq.c</FileName>
<FileName>idle.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\src\irq.c</FilePath>
<FilePath>..\..\..\src\idle.c</FilePath>
</File>
</Files>
</Group>
......
此差异已折叠。
<?xml version="1.0" encoding="iso-8859-1"?>
<workspace>
<project>
<path>$WS_DIR$\template.ewp</path>
</project>
<batchBuild/>
</workspace>
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd">
<SchemaVersion>1.0</SchemaVersion>
<Header>### uVision Project, (C) Keil Software</Header>
<Extensions>
<cExt>*.c</cExt>
<aExt>*.s*; *.src; *.a*</aExt>
<oExt>*.obj; *.o</oExt>
<lExt>*.lib</lExt>
<tExt>*.txt; *.h; *.inc</tExt>
<pExt>*.plm</pExt>
<CppX>*.cpp</CppX>
<nMigrate>0</nMigrate>
</Extensions>
<DaveTm>
<dwLowDateTime>0</dwLowDateTime>
<dwHighDateTime>0</dwHighDateTime>
</DaveTm>
<Target>
<TargetName>rt-thread</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<TargetOption>
<CLKADS>12000000</CLKADS>
<OPTTT>
<gFlags>1</gFlags>
<BeepAtEnd>1</BeepAtEnd>
<RunSim>0</RunSim>
<RunTarget>1</RunTarget>
<RunAbUc>0</RunAbUc>
</OPTTT>
<OPTHX>
<HexSelection>1</HexSelection>
<FlashByte>65535</FlashByte>
<HexRangeLowAddress>0</HexRangeLowAddress>
<HexRangeHighAddress>0</HexRangeHighAddress>
<HexOffset>0</HexOffset>
</OPTHX>
<OPTLEX>
<PageWidth>79</PageWidth>
<PageLength>66</PageLength>
<TabStop>8</TabStop>
<ListingPath>.\build\keil\List\</ListingPath>
</OPTLEX>
<ListingPage>
<CreateCListing>1</CreateCListing>
<CreateAListing>1</CreateAListing>
<CreateLListing>1</CreateLListing>
<CreateIListing>0</CreateIListing>
<AsmCond>1</AsmCond>
<AsmSymb>1</AsmSymb>
<AsmXref>0</AsmXref>
<CCond>1</CCond>
<CCode>0</CCode>
<CListInc>0</CListInc>
<CSymb>0</CSymb>
<LinkerCodeListing>0</LinkerCodeListing>
</ListingPage>
<OPTXL>
<LMap>1</LMap>
<LComments>1</LComments>
<LGenerateSymbols>1</LGenerateSymbols>
<LLibSym>1</LLibSym>
<LLines>1</LLines>
<LLocSym>1</LLocSym>
<LPubSym>1</LPubSym>
<LXref>0</LXref>
<LExpSel>0</LExpSel>
</OPTXL>
<OPTFL>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<IsCurrentTarget>1</IsCurrentTarget>
</OPTFL>
<CpuCode>0</CpuCode>
<DebugOpt>
<uSim>0</uSim>
<uTrg>1</uTrg>
<sLdApp>1</sLdApp>
<sGomain>1</sGomain>
<sRbreak>1</sRbreak>
<sRwatch>1</sRwatch>
<sRmem>1</sRmem>
<sRfunc>1</sRfunc>
<sRbox>1</sRbox>
<tLdApp>1</tLdApp>
<tGomain>1</tGomain>
<tRbreak>1</tRbreak>
<tRwatch>1</tRwatch>
<tRmem>1</tRmem>
<tRfunc>0</tRfunc>
<tRbox>1</tRbox>
<tRtrace>1</tRtrace>
<sRSysVw>1</sRSysVw>
<tRSysVw>1</tRSysVw>
<sRunDeb>0</sRunDeb>
<sLrtime>0</sLrtime>
<bEvRecOn>1</bEvRecOn>
<bSchkAxf>0</bSchkAxf>
<bTchkAxf>0</bTchkAxf>
<nTsel>4</nTsel>
<sDll></sDll>
<sDllPa></sDllPa>
<sDlgDll></sDlgDll>
<sDlgPa></sDlgPa>
<sIfile></sIfile>
<tDll></tDll>
<tDllPa></tDllPa>
<tDlgDll></tDlgDll>
<tDlgPa></tDlgPa>
<tIfile></tIfile>
<pMon>Segger\JL2CM3.dll</pMon>
</DebugOpt>
<TargetDriverDllRegistry>
<SetRegEntry>
<Number>0</Number>
<Key>JL2CM3</Key>
<Name>-U59701291 -O78 -S2 -ZTIFSpeedSel5000 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(4) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO7 -FD20000000 -FC1000 -FN1 -FF0APM32F10x_512.FLM -FS08000000 -FL080000 -FP0($$Device:APM32F103ZE$Flash\APM32F10x_512.FLM)</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>UL2CM3</Key>
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0APM32F10x_512 -FS08000000 -FL080000 -FP0($$Device:APM32F103ZE$Flash\APM32F10x_512.FLM))</Name>
</SetRegEntry>
</TargetDriverDllRegistry>
<Breakpoint/>
<Tracepoint>
<THDelay>0</THDelay>
</Tracepoint>
<DebugFlag>
<trace>0</trace>
<periodic>0</periodic>
<aLwin>0</aLwin>
<aCover>0</aCover>
<aSer1>0</aSer1>
<aSer2>0</aSer2>
<aPa>0</aPa>
<viewmode>0</viewmode>
<vrSel>0</vrSel>
<aSym>0</aSym>
<aTbox>0</aTbox>
<AscS1>0</AscS1>
<AscS2>0</AscS2>
<AscS3>0</AscS3>
<aSer3>0</aSer3>
<eProf>0</eProf>
<aLa>0</aLa>
<aPa1>0</aPa1>
<AscS4>0</AscS4>
<aSer4>0</aSer4>
<StkLoc>0</StkLoc>
<TrcWin>0</TrcWin>
<newCpu>0</newCpu>
<uProt>0</uProt>
</DebugFlag>
<LintExecutable></LintExecutable>
<LintConfigFile></LintConfigFile>
<bLintAuto>0</bLintAuto>
<bAutoGenD>0</bAutoGenD>
<LntExFlags>0</LntExFlags>
<pMisraName></pMisraName>
<pszMrule></pszMrule>
<pSingCmds></pSingCmds>
<pMultCmds></pMultCmds>
<pMisraNamep></pMisraNamep>
<pszMrulep></pszMrulep>
<pSingCmdsp></pSingCmdsp>
<pMultCmdsp></pMultCmdsp>
</TargetOption>
</Target>
<Group>
<GroupName>Source Group 1</GroupName>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
</Group>
</ProjectOpt>
......@@ -16,7 +16,7 @@
<TargetCommonOption>
<Device>APM32F103ZE</Device>
<Vendor>Geehy</Vendor>
<PackID>Geehy.APM32F1xx_DFP.1.0.7</PackID>
<PackID>Geehy.APM32F1xx_DFP.1.0.8</PackID>
<PackURL>https://www.geehy.com/uploads/tool/</PackURL>
<Cpu>IRAM(0x20000000,0x00020000) IROM(0x08000000,0x00080000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
......@@ -185,7 +185,6 @@
<uocXRam>0</uocXRam>
<RvdsVP>0</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
......@@ -352,7 +351,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>0</uSurpInc>
<useXO>0</useXO>
<ClangAsOpt>4</ClangAsOpt>
<uClangAs>0</uClangAs>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
......
......@@ -3,21 +3,35 @@
*
* @brief This file contains all the functions prototypes for the ADC firmware library
*
* @version V1.0.1
* @version V1.0.2
*
* @date 2021-03-23
* @date 2022-01-05
*
* @attention
*
* Copyright (C) 2020-2022 Geehy Semiconductor
*
* You may not use this file except in compliance with the
* GEEHY COPYRIGHT NOTICE (GEEHY SOFTWARE PACKAGE LICENSE).
*
* The program is only for reference, which is distributed in the hope
* that it will be usefull and instructional for customers to develop
* their software. Unless required by applicable law or agreed to in
* writing, the program is distributed on an "AS IS" BASIS, WITHOUT
* ANY WARRANTY OR CONDITIONS OF ANY KIND, either express or implied.
* See the GEEHY SOFTWARE PACKAGE LICENSE for the governing permissions
* and limitations under the License.
*/
#ifndef __APM32F10X_ADC_H
#define __APM32F10X_ADC_H
#include "apm32f10x.h"
#ifdef __cplusplus
extern "C" {
extern "C" {
#endif
#include "apm32f10x.h"
/** @addtogroup Peripherals_Library Standard Peripheral Library
@{
*/
......@@ -62,7 +76,7 @@ typedef enum
ADC_EXT_TRIG_CONV_None = ((uint32_t)0x000E0000),
ADC_EXT_TRIG_CONV_TMR3_CC1 = ((uint32_t)0x00000000),
ADC_EXT_TRIG_CONV_TMR2_CC3 = ((uint32_t)0x00030000),
ADC_EXT_TRIG_CONV_TMR2_CC3 = ((uint32_t)0x00020000),
ADC_EXT_TRIG_CONV_TMR8_CC1 = ((uint32_t)0x00060000),
ADC_EXT_TRIG_CONV_TMR8_TRGO = ((uint32_t)0x00080000),
ADC_EXT_TRIG_CONV_TMR5_CC1 = ((uint32_t)0x000A0000),
......@@ -110,15 +124,15 @@ typedef enum
*/
typedef enum
{
ADC_SAMPLE_TIME_1_5 = ((uint8_t)0x00),
ADC_SAMPLE_TIME_7_5 = ((uint8_t)0x01),
ADC_SAMPLE_TIME_13_5 = ((uint8_t)0x02),
ADC_SAMPLE_TIME_28_5 = ((uint8_t)0x03),
ADC_SAMPLE_TIME_41_5 = ((uint8_t)0x04),
ADC_SAMPLE_TIME_55_5 = ((uint8_t)0x05),
ADC_SAMPLE_TIME_71_5 = ((uint8_t)0x06),
ADC_SAMPLE_TIME_239_5 = ((uint8_t)0x07)
} ADC_SAMPLE_TIME_T;
ADC_SAMPLETIME_1CYCLES5 = ((uint8_t)0x00),
ADC_SAMPLETIME_7CYCLES5 = ((uint8_t)0x01),
ADC_SAMPLETIME_13CYCLES5 = ((uint8_t)0x02),
ADC_SAMPLETIME_28CYCLES5 = ((uint8_t)0x03),
ADC_SAMPLETIME_41CYCLES5 = ((uint8_t)0x04),
ADC_SAMPLETIME_55CYCLES5 = ((uint8_t)0x05),
ADC_SAMPLETIME_71CYCLES5 = ((uint8_t)0x06),
ADC_SAMPLETIME_239CYCLES5 = ((uint8_t)0x07)
} ADC_SAMPLETIME_T;
/**
* @brief ADC external trigger sources for injected channels conversion
......@@ -246,80 +260,80 @@ typedef struct
*/
/** ADC reset and common configuration */
void ADC_Reset(ADC_T* adc);
void ADC_Config(ADC_T* adc, ADC_Config_T* adcConfig);
void ADC_ConfigStructInit(ADC_Config_T* adcConfig);
void ADC_ConfigRegularChannel(ADC_T* adc, uint8_t channel,uint8_t rank, uint8_t sampleTime);
void ADC_Enable(ADC_T* adc);
void ADC_Disable(ADC_T* adc);
void ADC_Reset(ADC_T *adc);
void ADC_Config(ADC_T *adc, ADC_Config_T *adcConfig);
void ADC_ConfigStructInit(ADC_Config_T *adcConfig);
void ADC_ConfigRegularChannel(ADC_T *adc, uint8_t channel, uint8_t rank, uint8_t sampleTime);
void ADC_Enable(ADC_T *adc);
void ADC_Disable(ADC_T *adc);
/** ADC for DMA */
void ADC_EnableDMA(ADC_T* adc);
void ADC_DisableDMA(ADC_T* adc);
void ADC_EnableDMA(ADC_T *adc);
void ADC_DisableDMA(ADC_T *adc);
/** ADC Calibration */
void ADC_ResetCalibration(ADC_T* adc);
uint8_t ADC_ReadResetCalibrationStatus(ADC_T* adc);
void ADC_StartCalibration(ADC_T* adc);
uint8_t ADC_ReadCalibrationStartFlag(ADC_T* adc);
void ADC_ResetCalibration(ADC_T *adc);
uint8_t ADC_ReadResetCalibrationStatus(ADC_T *adc);
void ADC_StartCalibration(ADC_T *adc);
uint8_t ADC_ReadCalibrationStartFlag(ADC_T *adc);
/** ADC software start conversion */
void ADC_EnableSoftwareStartConv(ADC_T* adc);
void ADC_DisableSoftwareStartConv(ADC_T* adc);
uint8_t ADC_ReadSoftwareStartConvStatus(ADC_T* adc);
void ADC_EnableSoftwareStartConv(ADC_T *adc);
void ADC_DisableSoftwareStartConv(ADC_T *adc);
uint8_t ADC_ReadSoftwareStartConvStatus(ADC_T *adc);
/** ADC Discontinuous mode */
void ADC_ConfigDiscModeChannel(ADC_T* adc, uint8_t number);
void ADC_EnableDiscMode(ADC_T* adc);
void ADC_DisableDiscMode(ADC_T* adc);
void ADC_ConfigDiscMode(ADC_T *adc, uint8_t number);
void ADC_EnableDiscMode(ADC_T *adc);
void ADC_DisableDiscMode(ADC_T *adc);
/** ADC External trigger conversion */
void ADC_EnableExternalTrigConv(ADC_T* adc);
void ADC_DisableExternalTrigConv(ADC_T* adc);
void ADC_EnableExternalTrigConv(ADC_T *adc);
void ADC_DisableExternalTrigConv(ADC_T *adc);
/** ADC Conversion result */
uint16_t ADC_ReadConversionValue(ADC_T* adc);
uint32_t ADC_ReadDualModeConversionValue(ADC_T* adc);
uint16_t ADC_ReadConversionValue(ADC_T *adc);
uint32_t ADC_ReadDualModeConversionValue(ADC_T *adc);
/** ADC Automatic injected group */
void ADC_EnableInjectedConv(ADC_T* adc);
void ADC_DisableInjectedConv(ADC_T* adc);
void ADC_EnableInjectedDiscMode(ADC_T* adc);
void ADC_DisableInjectedDiscMode(ADC_T* adc);
void ADC_EnableAutoInjectedConv(ADC_T *adc);
void ADC_DisableAutoInjectedConv(ADC_T *adc);
void ADC_EnableInjectedDiscMode(ADC_T *adc);
void ADC_DisableInjectedDiscMode(ADC_T *adc);
/** ADC External trigger for injected channels conversion */
void ADC_ConfigExternalTrigInjectedConv(ADC_T* adc, ADC_EXT_TRIG_INJEC_CONV_T extTrigInjecConv);
void ADC_EnableExternalTrigInjectedConv(ADC_T* adc);
void ADC_DisableExternalTrigInjectedConv(ADC_T* adc);
void ADC_ConfigExternalTrigInjectedConv(ADC_T *adc, ADC_EXT_TRIG_INJEC_CONV_T extTrigInjecConv);
void ADC_EnableExternalTrigInjectedConv(ADC_T *adc);
void ADC_DisableExternalTrigInjectedConv(ADC_T *adc);
/** ADC Start of the injected channels conversion */
void ADC_EnableSoftwareStartInjectedConv(ADC_T* adc);
void ADC_DisableSoftwareStartInjectedConv(ADC_T* adc);
uint8_t ADC_ReadSoftwareStartInjectedConvStatus(ADC_T* adc);
void ADC_EnableSoftwareStartInjectedConv(ADC_T *adc);
void ADC_DisableSoftwareStartInjectedConv(ADC_T *adc);
uint8_t ADC_ReadSoftwareStartInjectedConvStatus(ADC_T *adc);
/** ADC injected channel */
void ADC_ConfigInjectedChannel(ADC_T* adc, uint8_t channel, uint8_t rank, uint8_t sampleTime);
void ADC_ConfigInjectedSequencerLength(ADC_T* adc, uint8_t length);
void ADC_ConfigInjectedOffset(ADC_T* adc, ADC_INJEC_CHANNEL_T channel, uint16_t offSet);
uint16_t ADC_ReadInjectedConversionValue(ADC_T* adc, ADC_INJEC_CHANNEL_T channel);
void ADC_ConfigInjectedChannel(ADC_T *adc, uint8_t channel, uint8_t rank, uint8_t sampleTime);
void ADC_ConfigInjectedSequencerLength(ADC_T *adc, uint8_t length);
void ADC_ConfigInjectedOffset(ADC_T *adc, ADC_INJEC_CHANNEL_T channel, uint16_t offSet);
uint16_t ADC_ReadInjectedConversionValue(ADC_T *adc, ADC_INJEC_CHANNEL_T channel);
/** ADC analog watchdog */
void ADC_EnableAnalogWatchdog(ADC_T* adc, uint32_t analogWatchdog);
void ADC_DisableAnalogWatchdog(ADC_T* adc);
void ADC_ConfigAnalogWatchdogThresholds(ADC_T* adc, uint16_t highThreshold, uint16_t lowThreshold);
void ADC_ConfigAnalogWatchdogSingleChannel(ADC_T* adc, uint8_t channel);
void ADC_EnableAnalogWatchdog(ADC_T *adc, uint32_t analogWatchdog);
void ADC_DisableAnalogWatchdog(ADC_T *adc);
void ADC_ConfigAnalogWatchdogThresholds(ADC_T *adc, uint16_t highThreshold, uint16_t lowThreshold);
void ADC_ConfigAnalogWatchdogSingleChannel(ADC_T *adc, uint8_t channel);
/** ADC temperature sensor */
void ADC_EnableTempSensorVrefint(ADC_T* adc);
void ADC_DisableTempSensorVrefint(ADC_T* adc);
void ADC_EnableTempSensorVrefint(ADC_T *adc);
void ADC_DisableTempSensorVrefint(ADC_T *adc);
/** Interrupt and flag */
void ADC_EnableInterrupt(ADC_T* adc, uint16_t interrupt);
void ADC_DisableInterrupt(ADC_T* adc, uint16_t interrupt);
uint8_t ADC_ReadStatusFlag(ADC_T* adc, ADC_FLAG_T flag);
void ADC_ClearStatusFlag(ADC_T* adc, uint8_t flag);
uint8_t ADC_ReadIntFlag(ADC_T* adc, ADC_INT_T interrupt);
void ADC_ClearIntFlag(ADC_T* adc, uint16_t interrupt);
void ADC_EnableInterrupt(ADC_T *adc, uint16_t interrupt);
void ADC_DisableInterrupt(ADC_T *adc, uint16_t interrupt);
uint8_t ADC_ReadStatusFlag(ADC_T *adc, ADC_FLAG_T flag);
void ADC_ClearStatusFlag(ADC_T *adc, uint8_t flag);
uint8_t ADC_ReadIntFlag(ADC_T *adc, ADC_INT_T flag);
void ADC_ClearIntFlag(ADC_T *adc, uint16_t flag);
/**@} end of group ADC_Fuctions*/
/**@} end of group ADC_Driver*/
......
......@@ -3,21 +3,35 @@
*
* @brief This file contains all the functions prototypes for the BAKPR firmware library.
*
* @version V1.0.1
* @version V1.0.2
*
* @date 2021-03-23
* @date 2022-01-05
*
* @attention
*
* Copyright (C) 2020-2022 Geehy Semiconductor
*
* You may not use this file except in compliance with the
* GEEHY COPYRIGHT NOTICE (GEEHY SOFTWARE PACKAGE LICENSE).
*
* The program is only for reference, which is distributed in the hope
* that it will be usefull and instructional for customers to develop
* their software. Unless required by applicable law or agreed to in
* writing, the program is distributed on an "AS IS" BASIS, WITHOUT
* ANY WARRANTY OR CONDITIONS OF ANY KIND, either express or implied.
* See the GEEHY SOFTWARE PACKAGE LICENSE for the governing permissions
* and limitations under the License.
*/
#ifndef __APM32F10X_BAKPR_H
#define __APM32F10X_BAKPR_H
#include "apm32f10x.h"
#ifdef __cplusplus
extern "C" {
#endif
#include "apm32f10x.h"
/** @addtogroup Peripherals_Library Standard Peripheral Library
@{
*/
......@@ -125,7 +139,7 @@ uint8_t BAKPR_ReadIntFlag(void);
void BAKPR_ClearIntFlag(void);
/**@} end of group BAKPR_Fuctions*/
/**@} end of group BAKPR_Driver */
/**@} end of group BAKPR_Driver*/
/**@} end of group Peripherals_Library*/
#ifdef __cplusplus
......
/*!
* @file apm32f10x_can.h
* @file apm32f10x_can.h
*
* @brief This file contains all the functions prototypes for the CAN firmware library
* @brief This file contains all the functions prototypes for the CAN firmware library
*
* @version V1.0.1
* @version V1.0.2
*
* @date 2021-03-23
* @date 2022-01-05
*
* @attention
*
* Copyright (C) 2020-2022 Geehy Semiconductor
*
* You may not use this file except in compliance with the
* GEEHY COPYRIGHT NOTICE (GEEHY SOFTWARE PACKAGE LICENSE).
*
* The program is only for reference, which is distributed in the hope
* that it will be usefull and instructional for customers to develop
* their software. Unless required by applicable law or agreed to in
* writing, the program is distributed on an "AS IS" BASIS, WITHOUT
* ANY WARRANTY OR CONDITIONS OF ANY KIND, either express or implied.
* See the GEEHY SOFTWARE PACKAGE LICENSE for the governing permissions
* and limitations under the License.
*/
#ifndef __APM32F10X_CAN_H
#define __APM32F10X_CAN_H
#include "apm32f10x.h"
#ifdef __cplusplus
extern "C" {
#endif
#include "apm32f10x.h"
/** @addtogroup Peripherals_Library Standard Peripheral Library
@{
*/
......@@ -35,10 +49,10 @@ extern "C" {
*/
typedef enum
{
CAN_MODE_NORMAL = ((uint8_t)00), //!< normal mode
CAN_MODE_LOOPBACK = ((uint8_t)01), //!< loopback mode
CAN_MODE_SILENT = ((uint8_t)02), //!< silent mode
CAN_MODE_SILENT_LOOPBACK = ((uint8_t)03), //!< loopback combined with silent mode
CAN_MODE_NORMAL = ((uint8_t)0x00), //!< normal mode
CAN_MODE_LOOPBACK = ((uint8_t)0x01), //!< loopback mode
CAN_MODE_SILENT = ((uint8_t)0x02), //!< silent mode
CAN_MODE_SILENT_LOOPBACK = ((uint8_t)0x03) //!< loopback combined with silent mode
} CAN_MODE_T;
/**
......@@ -46,10 +60,10 @@ typedef enum
*/
typedef enum
{
CAN_SJW_1 = ((uint8_t)00), //!< 1 time quantum
CAN_SJW_2 = ((uint8_t)01), //!< 2 time quantum
CAN_SJW_3 = ((uint8_t)02), //!< 3 time quantum
CAN_SJW_4 = ((uint8_t)03) //!< 4 time quantum
CAN_SJW_1 = ((uint8_t)0x00), //!< 1 time quantum
CAN_SJW_2 = ((uint8_t)0x01), //!< 2 time quantum
CAN_SJW_3 = ((uint8_t)0x02), //!< 3 time quantum
CAN_SJW_4 = ((uint8_t)0x03) //!< 4 time quantum
} CAN_SJW_T;
/**
......@@ -87,7 +101,7 @@ typedef enum
CAN_TIME_SEGMENT2_5 = (uint8_t)0x04, //!< 5 time quanta
CAN_TIME_SEGMENT2_6 = (uint8_t)0x05, //!< 6 time quanta
CAN_TIME_SEGMENT2_7 = (uint8_t)0x06, //!< 7 time quanta
CAN_TIME_SEGMENT2_8 = (uint8_t)0x07, //!< 8 time quanta
CAN_TIME_SEGMENT2_8 = (uint8_t)0x07 //!< 8 time quanta
} CAN_TIME_SEGMENT2_T;
/**
......@@ -96,7 +110,7 @@ typedef enum
typedef enum
{
CAN_FILTER_FIFO_0 = ((uint8_t)0x00), //!< filter FIFO 0
CAN_FILTER_FIFO_1 = ((uint8_t)0x01), //!< filter FIFO 1
CAN_FILTER_FIFO_1 = ((uint8_t)0x01) //!< filter FIFO 1
} CAN_FILTER_FIFO_T;
/**
......@@ -104,8 +118,8 @@ typedef enum
*/
typedef enum
{
CAN_FILTER_MODE_IDMASK = ((uint8_t)00), //!< identifier/mask mode
CAN_FILTER_MODE_IDLIST = ((uint8_t)01) //!< identifier list mode
CAN_FILTER_MODE_IDMASK = ((uint8_t)0x00),//!< identifier/mask mode
CAN_FILTER_MODE_IDLIST = ((uint8_t)0x01) //!< identifier list mode
} CAN_FILTER_MODE_T;
/**
......@@ -114,7 +128,7 @@ typedef enum
typedef enum
{
CAN_FILTER_SCALE_16BIT = ((uint8_t)0x00), //!< Two 16-bit filters
CAN_FILTER_SCALE_32BIT = ((uint8_t)0x01), //!< One 32-bit filter
CAN_FILTER_SCALE_32BIT = ((uint8_t)0x01) //!< One 32-bit filter
} CAN_FILTER_SCALE_T;
/**
......@@ -142,7 +156,7 @@ typedef enum
{
CAN_TX_MAILBIX_0 = ((uint8_t)0x00), //!< Tx mailbox0
CAN_TX_MAILBIX_1 = ((uint8_t)0x01), //!< Tx mailbox1
CAN_TX_MAILBIX_2 = ((uint8_t)0x02), //!< Tx mailbox2
CAN_TX_MAILBIX_2 = ((uint8_t)0x02) //!< Tx mailbox2
} CAN_TX_MAILBIX_T;
/**
......@@ -151,7 +165,7 @@ typedef enum
typedef enum
{
CAN_RX_FIFO_0 = ((uint8_t)0x00), //!< receive FIFO 0
CAN_RX_FIFO_1 = ((uint8_t)0x01), //!< receive FIFO 1
CAN_RX_FIFO_1 = ((uint8_t)0x01) //!< receive FIFO 1
} CAN_RX_FIFO_T;
/**
......@@ -159,9 +173,9 @@ typedef enum
*/
typedef enum
{
CAN_OPERATING_MODE_INIT = ((uint8_t)00), //!< Initialization mode
CAN_OPERATING_MODE_NORMAL = ((uint8_t)01), //!< Normal mode
CAN_OPERATING_MODE_SLEEP = ((uint8_t)02), //!< sleep mode
CAN_OPERATING_MODE_INIT = ((uint8_t)0x00), //!< Initialization mode
CAN_OPERATING_MODE_NORMAL = ((uint8_t)0x01), //!< Normal mode
CAN_OPERATING_MODE_SLEEP = ((uint8_t)0x02) //!< sleep mode
} CAN_OPERATING_MODE_T;
/**
......@@ -223,7 +237,6 @@ typedef enum
*/
typedef struct
{
uint8_t timeTrigComMode; //!< Enable or disable the time triggered communication mode.
uint8_t autoBusOffManage; //!< Enable or disable the automatic bus-off management.
uint8_t autoWakeUpMode; //!< Enable or disable the automatic wake-up mode.
uint8_t nonAutoRetran; //!< Enable or disable the non-automatic retransmission mode.
......@@ -249,7 +262,7 @@ typedef struct
CAN_RTXR_T remoteTxReq;
uint8_t dataLengthCode;//!< Specifies the data length code. It can be 0 to 8.
uint8_t data[8]; //!< Specifies the data to be transmitted. It can be 0 to 0xFF.
} CAN_TX_MESSAGE_T;
} CAN_TxMessage_T;
/**
* @brief CAN Rx message structure definition
......@@ -263,7 +276,7 @@ typedef struct
uint8_t dataLengthCode; //!< Specifies the data length code. It can be 0 to 8.
uint8_t data[8]; //!< Specifies the data to be transmitted. It can be 0 to 0xFF.
uint8_t filterMatchIndex;//!< Specifies the filter match index. It can be 0 to 0xFF.
} CAN_RX_MESSAGE_T;
} CAN_RxMessage_T;
/**
* @brief CAN filter config structure definition
......@@ -279,7 +292,7 @@ typedef struct
CAN_FILTER_FIFO_T filterFIFO;
CAN_FILTER_MODE_T filterMode;
CAN_FILTER_SCALE_T filterScale;
} CAN_FILTER_CONFIG_T;
} CAN_FilterConfig_T;
/**@} end of group CAN_Structure*/
......@@ -289,45 +302,44 @@ typedef struct
*/
/** CAN reset and configuration */
void CAN_Reset(CAN_T* can);
uint8_t CAN_Config(CAN_T* can, CAN_Config_T* canConfig);
void CAN_ConfigFilter(CAN_T* can, CAN_FILTER_CONFIG_T* filterConfig);
void CAN_ConfigStructInit(CAN_Config_T* canConfig);
void CAN_EnableDBGFreeze(CAN_T* can);
void CAN_DisableDBGFreeze(CAN_T* can);
void CAN_EnableTTCComMode(CAN_T* can);
void CAN_DisableTTCComMode(CAN_T* can);
void CAN_Reset(CAN_T *can);
uint8_t CAN_Config(CAN_T *can, CAN_Config_T *canConfig);
void CAN_ConfigFilter(CAN_T *can, CAN_FilterConfig_T *filterConfig);
void CAN_ConfigStructInit(CAN_Config_T *canConfig);
void CAN_EnableDBGFreeze(CAN_T *can);
void CAN_DisableDBGFreeze(CAN_T *can);
void CAN_SlaveStartBank(CAN_T *can, uint8_t bankNum);
/** CAN frames transmit */
uint8_t CAN_TxMessage(CAN_T* can, CAN_TX_MESSAGE_T* TxMessage);
uint8_t CAN_TxMessageStatus(CAN_T* can, CAN_TX_MAILBIX_T TxMailbox);
void CAN_CancelTxMailbox(CAN_T* can, CAN_TX_MAILBIX_T TxMailbox);
uint8_t CAN_TxMessage(CAN_T *can, CAN_TxMessage_T *TxMessage);
uint8_t CAN_TxMessageStatus(CAN_T *can, CAN_TX_MAILBIX_T TxMailbox);
void CAN_CancelTxMailbox(CAN_T *can, CAN_TX_MAILBIX_T TxMailbox);
/** CAN frames receive */
void CAN_RxMessage(CAN_T* can, CAN_RX_FIFO_T FIFONumber, CAN_RX_MESSAGE_T* RxMessage);
void CAN_ReleaseFIFO(CAN_T* can, CAN_RX_FIFO_T FIFONumber);
uint8_t CAN_PendingMessage(CAN_T* can, CAN_RX_FIFO_T FIFONumber);
void CAN_RxMessage(CAN_T *can, CAN_RX_FIFO_T FIFONumber, CAN_RxMessage_T *RxMessage);
void CAN_ReleaseFIFO(CAN_T *can, CAN_RX_FIFO_T FIFONumber);
uint8_t CAN_PendingMessage(CAN_T *can, CAN_RX_FIFO_T FIFONumber);
/** CAN operation modes */
uint8_t CAN_OperatingMode(CAN_T* can, CAN_OPERATING_MODE_T operatingMode);
uint8_t CAN_SleepMode(CAN_T* can);
uint8_t CAN_WakeUpMode(CAN_T* can);
uint8_t CAN_OperatingMode(CAN_T *can, CAN_OPERATING_MODE_T operatingMode);
uint8_t CAN_SleepMode(CAN_T *can);
uint8_t CAN_WakeUpMode(CAN_T *can);
/** CAN bus error management */
uint8_t CAN_ReadLastErrorCode(CAN_T* can);
uint8_t CAN_ReadRxErrorCounter(CAN_T* can);
uint8_t CAN_ReadLSBTxErrorCounter(CAN_T* can);
uint8_t CAN_ReadLastErrorCode(CAN_T *can);
uint8_t CAN_ReadRxErrorCounter(CAN_T *can);
uint8_t CAN_ReadLSBTxErrorCounter(CAN_T *can);
/** CAN interrupt and flag */
void CAN_EnableInterrupt(CAN_T* can, uint32_t interrupt);
void CAN_DisableInterrupt(CAN_T* can, uint32_t interrupt);
uint8_t CAN_ReadStatusFlag(CAN_T* can, CAN_FLAG_T flag);
void CAN_ClearStatusFlag(CAN_T* can, CAN_FLAG_T flag);
uint8_t CAN_ReadIntFlag(CAN_T* can, CAN_INT_T flag);
void CAN_ClearIntFlag(CAN_T* can, CAN_INT_T flag);
void CAN_EnableInterrupt(CAN_T *can, uint32_t interrupt);
void CAN_DisableInterrupt(CAN_T *can, uint32_t interrupt);
uint8_t CAN_ReadStatusFlag(CAN_T *can, CAN_FLAG_T flag);
void CAN_ClearStatusFlag(CAN_T *can, CAN_FLAG_T flag);
uint8_t CAN_ReadIntFlag(CAN_T *can, CAN_INT_T flag);
void CAN_ClearIntFlag(CAN_T *can, CAN_INT_T flag);
/**@} end of group CAN_Fuctions*/
/**@} end of group CAN_Driver */
/**@} end of group CAN_Driver*/
/**@} end of group Peripherals_Library*/
#ifdef __cplusplus
......
/*!
* @file apm32f10x_crc.h
* @file apm32f10x_crc.h
*
* @brief This file contains all the functions prototypes for the CRC firmware library
* @brief This file contains all the functions prototypes for the CRC firmware library
*
* @version V1.0.1
* @version V1.0.2
*
* @date 2021-03-23
* @date 2022-01-05
*
* @attention
*
* Copyright (C) 2020-2022 Geehy Semiconductor
*
* You may not use this file except in compliance with the
* GEEHY COPYRIGHT NOTICE (GEEHY SOFTWARE PACKAGE LICENSE).
*
* The program is only for reference, which is distributed in the hope
* that it will be usefull and instructional for customers to develop
* their software. Unless required by applicable law or agreed to in
* writing, the program is distributed on an "AS IS" BASIS, WITHOUT
* ANY WARRANTY OR CONDITIONS OF ANY KIND, either express or implied.
* See the GEEHY SOFTWARE PACKAGE LICENSE for the governing permissions
* and limitations under the License.
*/
#ifndef __APM32F10X_CRC_H
#define __APM32F10X_CRC_H
#include "apm32f10x.h"
#ifdef __cplusplus
extern "C" {
#endif
#include "apm32f10x.h"
/** @addtogroup Peripherals_Library Standard Peripheral Library
@{
*/
......@@ -41,7 +55,7 @@ void CRC_WriteIDRegister(uint8_t inData);
uint8_t CRC_ReadIDRegister(void);
/**@} end of group CRC_Fuctions*/
/**@} end of group CRC_Driver */
/**@} end of group CRC_Driver*/
/**@} end of group Peripherals_Library*/
#ifdef __cplusplus
......
......@@ -3,21 +3,35 @@
*
* @brief This file contains all the functions prototypes for the DAC firmware library
*
* @version V1.0.1
* @version V1.0.2
*
* @date 2021-03-23
* @date 2022-01-05
*
* @attention
*
* Copyright (C) 2020-2022 Geehy Semiconductor
*
* You may not use this file except in compliance with the
* GEEHY COPYRIGHT NOTICE (GEEHY SOFTWARE PACKAGE LICENSE).
*
* The program is only for reference, which is distributed in the hope
* that it will be usefull and instructional for customers to develop
* their software. Unless required by applicable law or agreed to in
* writing, the program is distributed on an "AS IS" BASIS, WITHOUT
* ANY WARRANTY OR CONDITIONS OF ANY KIND, either express or implied.
* See the GEEHY SOFTWARE PACKAGE LICENSE for the governing permissions
* and limitations under the License.
*/
#ifndef __APM32F10X_DAC_H
#define __APM32F10X_DAC_H
#include "apm32f10x.h"
#ifdef __cplusplus
extern "C" {
extern "C" {
#endif
#include "apm32f10x.h"
/** @addtogroup Peripherals_Library Standard Peripheral Library
@{
*/
......@@ -37,7 +51,7 @@ typedef enum
{
DAC_CHANNEL_1 = 0x00000000,
DAC_CHANNEL_2 = 0x00000010
}DAC_CHANNEL_T;
} DAC_CHANNEL_T;
/**
* @brief DAC trigger selection
......@@ -53,7 +67,7 @@ typedef enum
DAC_TRIGGER_TMR4_TRGO = 0x0000002C,
DAC_TRIGGER_EINT9 = 0x00000034,
DAC_TRIGGER_SOFT = 0x0000003C
}DAC_TRIGGER_T;
} DAC_TRIGGER_T;
/**
* @brief DAC wave generation
......@@ -63,7 +77,7 @@ typedef enum
DAC_WAVE_GENERATION_NONE = 0x00000000,
DAC_WAVE_GENERATION_NOISE = 0x00000040,
DAC_WAVE_GENERATION_TRIANGLE = 0x00000080
}DAC_WAVE_GENERATION_T;
} DAC_WAVE_GENERATION_T;
/**
* @brief DAC channelx mask/amplitude selector
......@@ -71,31 +85,31 @@ typedef enum
typedef enum
{
DAC_LFSR_MASK_BIT11_1 = 0x00000000, //!< Mask bit[11:1] of LFSR for noise wave generation
DAC_LFSR_MASK_BIT11_2 = 0x00001000, //!< Mask bit[11:2] of LFSR for noise wave generation
DAC_LFSR_MASK_BIT11_3 = 0x00002000, //!< Mask bit[11:3] of LFSR for noise wave generation
DAC_LFSR_MASK_BIT11_4 = 0x00003000, //!< Mask bit[11:4] of LFSR for noise wave generation
DAC_LFSR_MASK_BIT11_5 = 0x00004000, //!< Mask bit[11:5] of LFSR for noise wave generation
DAC_LFSR_MASK_BIT11_6 = 0x00005000, //!< Mask bit[11:6] of LFSR for noise wave generation
DAC_LFSR_MASK_BIT11_7 = 0x00006000, //!< Mask bit[11:7] of LFSR for noise wave generation
DAC_LFSR_MASK_BIT11_8 = 0x00007000, //!< Mask bit[11:8] of LFSR for noise wave generation
DAC_LFSR_MASK_BIT11_9 = 0x00008000, //!< Mask bit[11:9] of LFSR for noise wave generation
DAC_LFSR_MASK_BIT11_10 = 0x00009000, //!< Mask bit[11:10] of LFSR for noise wave generation
DAC_LFSR_MASK_BIT11 = 0x0000A000, //!< Mask bit11 of LFSR for noise wave generation
DAC_LFSR_MASK_NONE = 0x0000B000, //!< Mask none bit of LFSR for noise wave generation
DAC_LFSR_MASK_BIT11_2 = 0x00000100, //!< Mask bit[11:2] of LFSR for noise wave generation
DAC_LFSR_MASK_BIT11_3 = 0x00000200, //!< Mask bit[11:3] of LFSR for noise wave generation
DAC_LFSR_MASK_BIT11_4 = 0x00000300, //!< Mask bit[11:4] of LFSR for noise wave generation
DAC_LFSR_MASK_BIT11_5 = 0x00000400, //!< Mask bit[11:5] of LFSR for noise wave generation
DAC_LFSR_MASK_BIT11_6 = 0x00000500, //!< Mask bit[11:6] of LFSR for noise wave generation
DAC_LFSR_MASK_BIT11_7 = 0x00000600, //!< Mask bit[11:7] of LFSR for noise wave generation
DAC_LFSR_MASK_BIT11_8 = 0x00000700, //!< Mask bit[11:8] of LFSR for noise wave generation
DAC_LFSR_MASK_BIT11_9 = 0x00000800, //!< Mask bit[11:9] of LFSR for noise wave generation
DAC_LFSR_MASK_BIT11_10 = 0x00000900, //!< Mask bit[11:10] of LFSR for noise wave generation
DAC_LFSR_MASK_BIT11 = 0x00000A00, //!< Mask bit11 of LFSR for noise wave generation
DAC_LFSR_MASK_NONE = 0x00000B00, //!< Mask none bit of LFSR for noise wave generation
DAC_TRIANGLE_AMPLITUDE_1 = 0x00000000, //!< Triangle amplitude equal to 1
DAC_TRIANGLE_AMPLITUDE_3 = 0x00001000, //!< Triangle amplitude equal to 3
DAC_TRIANGLE_AMPLITUDE_7 = 0x00002000, //!< Triangle amplitude equal to 7
DAC_TRIANGLE_AMPLITUDE_15 = 0x00003000, //!< Triangle amplitude equal to 15
DAC_TRIANGLE_AMPLITUDE_31 = 0x00004000, //!< Triangle amplitude equal to 31
DAC_TRIANGLE_AMPLITUDE_63 = 0x00005000, //!< Triangle amplitude equal to 63
DAC_TRIANGLE_AMPLITUDE_127 = 0x00006000, //!< Triangle amplitude equal to 127
DAC_TRIANGLE_AMPLITUDE_255 = 0x00007000, //!< Triangle amplitude equal to 255
DAC_TRIANGLE_AMPLITUDE_511 = 0x00008000, //!< Triangle amplitude equal to 511
DAC_TRIANGLE_AMPLITUDE_1023 = 0x00009000, //!< Triangle amplitude equal to 1023
DAC_TRIANGLE_AMPLITUDE_2047 = 0x0000A000, //!< Triangle amplitude equal to 2047
DAC_TRIANGLE_AMPLITUDE_4095 = 0x0000B000 //!< Triangle amplitude equal to 4095
}DAC_MASK_AMPLITUDE_SEL_T;
DAC_TRIANGLE_AMPLITUDE_3 = 0x00000100, //!< Triangle amplitude equal to 3
DAC_TRIANGLE_AMPLITUDE_7 = 0x00000200, //!< Triangle amplitude equal to 7
DAC_TRIANGLE_AMPLITUDE_15 = 0x00000300, //!< Triangle amplitude equal to 15
DAC_TRIANGLE_AMPLITUDE_31 = 0x00000400, //!< Triangle amplitude equal to 31
DAC_TRIANGLE_AMPLITUDE_63 = 0x00000500, //!< Triangle amplitude equal to 63
DAC_TRIANGLE_AMPLITUDE_127 = 0x00000600, //!< Triangle amplitude equal to 127
DAC_TRIANGLE_AMPLITUDE_255 = 0x00000700, //!< Triangle amplitude equal to 255
DAC_TRIANGLE_AMPLITUDE_511 = 0x00000800, //!< Triangle amplitude equal to 511
DAC_TRIANGLE_AMPLITUDE_1023 = 0x00000900, //!< Triangle amplitude equal to 1023
DAC_TRIANGLE_AMPLITUDE_2047 = 0x00000A00, //!< Triangle amplitude equal to 2047
DAC_TRIANGLE_AMPLITUDE_4095 = 0x00000B00 //!< Triangle amplitude equal to 4095
} DAC_MASK_AMPLITUDE_SEL_T;
/**
* @brief DAC output buffer
......@@ -104,7 +118,7 @@ typedef enum
{
DAC_OUTPUT_BUFFER_ENBALE = 0x00000000,
DAC_OUTPUT_BUFFER_DISABLE = 0x00000002
}DAC_OUTPUT_BUFFER_T;
} DAC_OUTPUT_BUFFER_T;
/**
* @brief DAC data align
......@@ -114,7 +128,7 @@ typedef enum
DAC_ALIGN_12BIT_R = 0x00000000,
DAC_ALIGN_12BIT_L = 0x00000004,
DAC_ALIGN_8BIT_R = 0x00000008
}DAC_ALIGN_T;
} DAC_ALIGN_T;
/**@} end of group DAC_Enumerations*/
......@@ -132,7 +146,7 @@ typedef struct
DAC_OUTPUT_BUFFER_T outputBuffer;
DAC_WAVE_GENERATION_T waveGeneration;
DAC_MASK_AMPLITUDE_SEL_T maskAmplitudeSelect;
}DAC_ConfigStruct_T;
} DAC_Config_T;
/**@} end of group DAC_Structure*/
......@@ -143,8 +157,8 @@ typedef struct
/** DAC Reset and Configuration */
void DAC_Reset(void);
void DAC_Config(uint32_t channel, DAC_ConfigStruct_T* configStruct);
void DAC_ConfigStructInit(DAC_ConfigStruct_T* configStruct);
void DAC_Config(uint32_t channel, DAC_Config_T *dacConfig);
void DAC_ConfigStructInit(DAC_Config_T *dacConfig);
void DAC_Enable(DAC_CHANNEL_T channel);
void DAC_Disable(DAC_CHANNEL_T channel);
......@@ -171,7 +185,7 @@ void DAC_ConfigDualChannelData(DAC_ALIGN_T align, uint16_t data2, uint16_t data1
uint16_t DAC_ReadDataOutputValue(DAC_CHANNEL_T channel);
/**@} end of group DAC_Fuctions*/
/**@} end of group DAC_Driver */
/**@} end of group DAC_Driver*/
/**@} end of group Peripherals_Library*/
#ifdef __cplusplus
......
......@@ -3,21 +3,35 @@
*
* @brief This file contains all the functions prototypes for the DBUGMCU firmware library
*
* @version V1.0.1
* @version V1.0.2
*
* @date 2021-03-23
* @date 2022-01-05
*
* @attention
*
* Copyright (C) 2020-2022 Geehy Semiconductor
*
* You may not use this file except in compliance with the
* GEEHY COPYRIGHT NOTICE (GEEHY SOFTWARE PACKAGE LICENSE).
*
* The program is only for reference, which is distributed in the hope
* that it will be usefull and instructional for customers to develop
* their software. Unless required by applicable law or agreed to in
* writing, the program is distributed on an "AS IS" BASIS, WITHOUT
* ANY WARRANTY OR CONDITIONS OF ANY KIND, either express or implied.
* See the GEEHY SOFTWARE PACKAGE LICENSE for the governing permissions
* and limitations under the License.
*/
#ifndef __APM32F10X_DBGMCU_H
#define __APM32F10X_DBGMCU_H
#include "apm32f10x.h"
#ifdef __cplusplus
extern "C" {
extern "C" {
#endif
#include "apm32f10x.h"
/** @addtogroup Peripherals_Library Standard Peripheral Library
@{
*/
......@@ -73,7 +87,7 @@ void DBGMCU_Enable(uint32_t periph);
void DBGMCU_Disable(uint32_t periph);
/**@} end of group DBGMCU_Fuctions*/
/**@} end of group DBGMCU_Driver */
/**@} end of group DBGMCU_Driver*/
/**@} end of group Peripherals_Library*/
#ifdef __cplusplus
......
......@@ -23,9 +23,9 @@
*/
#if defined ( __ICCARM__ )
#pragma system_include /* treat file as system include file for MISRA check */
#pragma system_include /* treat file as system include file for MISRA check */
#elif defined (__clang__)
#pragma clang system_header /* treat file as system include file */
#pragma clang system_header /* treat file as system include file */
#endif
#ifndef __CMSIS_VERSION_H
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册