资源简介
内容丰富 和STM32相同使用的方法 里面有很多做好GD32F10X的例程 可以进行项目开发
代码片段和文件信息
/**
******************************************************************************
* @file ADC/ADC_DMA/main.c
* @author MCU SD
* @version V2.0.0
* @date 15-Jan-2016
* @brief Main program body.
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include “gd32f1x0.h“
#include
#include
/* Private define ------------------------------------------------------------*/
#ifdef GD32F130_150
#define BOARD_ADC_CHANNEL ADC_CHANNEL_11
#define ADC_GPIO_PIN GPIO_PIN_1
#elif defined GD32F170_190
#define BOARD_ADC_CHANNEL ADC_CHANNEL_10
#define ADC_GPIO_PIN GPIO_PIN_0
#endif
#define ADC_RDTR_Address ((uint32_t)0x4001244C)
/* Private variables ---------------------------------------------------------*/
__IO uint16_t ADCConvertedValue;
ADC_InitPara ADC_InitStructure;
DMA_InitPara DMA_InitStructure;
/* Private function prototypes -----------------------------------------------*/
void RCC_Configuration(void);
void GPIO_Configuration(void);
/* Private functions ---------------------------------------------------------*/
/**
* @brief Main program.
* @param None
* @retval None
*/
int main(void)
{
/* Configure System clocks -----------------------------------------------*/
RCC_Configuration();
/* Configure GPIO ports --------------------------------------------------*/
GPIO_Configuration();
/* Configure DMA1 channel1 -----------------------------------------------*/
DMA_DeInit(DMA1_CHANNEL1);
DMA_InitStructure.DMA_PeripheralbaseAddr = ADC_RDTR_Address;
DMA_InitStructure.DMA_MemorybaseAddr = (uint32_t)&ADCConvertedValue;
DMA_InitStructure.DMA_DIR = DMA_DIR_PERIPHERALSRC;
DMA_InitStructure.DMA_BufferSize = 1;
DMA_InitStructure.DMA_PeripheralInc = DMA_PERIPHERALINC_DISABLE;
DMA_InitStructure.DMA_MemoryInc = DMA_MEMORYINC_DISABLE;
DMA_InitStructure.DMA_PeripheralDataSize = DMA_PERIPHERALDATASIZE_HALFWORD;
DMA_InitStructure.DMA_MemoryDataSize = DMA_MEMORYDATASIZE_HALFWORD;
DMA_InitStructure.DMA_Mode = DMA_MODE_CIRCULAR;
DMA_InitStructure.DMA_Priority = DMA_PRIORITY_HIGH;
DMA_InitStructure.DMA_MTOM = DMA_MEMTOMEM_DISABLE;
DMA_Init(DMA1_CHANNEL1 &DMA_InitStructure);
/* Enable DMA1 channel1 */
DMA_Enable(DMA1_CHANNEL1 ENABLE);
/* Configure ADC ---------------------------------------------------------*/
ADC_InitStructure.ADC_Mode_Scan = DISABLE;
ADC_InitStructure.ADC_Mode_Continuous = ENABLE;
ADC_InitStructure.ADC_Trig_External = ADC_EXTERNAL_TRIGGER_MODE_NONE;
ADC_InitStructure.ADC_Data_Align = ADC_DATAALIGN_RIGHT;
ADC_InitStructure.ADC_Channel_Number = 1;
ADC_Init(&ADC_InitStructure);
/* Configure ADC regular channelx */
ADC_RegularChannel_Config( BOARD_ADC_CHANNEL 1 ADC_SAMPLETIME_239
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-03-26 17:06 固件库\
目录 0 2018-03-30 17:33 固件库\GD32F1x0系列固件库\
目录 0 2018-03-26 17:04 固件库\GD32F1x0系列固件库\GD32F1x0 2.0固件库\
目录 0 2018-03-26 17:04 固件库\GD32F1x0系列固件库\GD32F1x0 2.0固件库\GD32F1x0_Firmware_Library_V2.0.0\
目录 0 2018-03-26 17:04 固件库\GD32F1x0系列固件库\GD32F1x0 2.0固件库\GD32F1x0_Firmware_Library_V2.0.0\GD32F1x0_Firmware_Library_V2.0.0\
目录 0 2018-03-26 17:04 固件库\GD32F1x0系列固件库\GD32F1x0 2.0固件库\GD32F1x0_Firmware_Library_V2.0.0\GD32F1x0_Firmware_Library_V2.0.0\Examples\
目录 0 2018-03-26 17:04 固件库\GD32F1x0系列固件库\GD32F1x0 2.0固件库\GD32F1x0_Firmware_Library_V2.0.0\GD32F1x0_Firmware_Library_V2.0.0\Examples\ADC\
目录 0 2018-03-26 17:04 固件库\GD32F1x0系列固件库\GD32F1x0 2.0固件库\GD32F1x0_Firmware_Library_V2.0.0\GD32F1x0_Firmware_Library_V2.0.0\Examples\ADC\ADC_DMA\
文件 1442 2016-02-23 13:16 固件库\GD32F1x0系列固件库\GD32F1x0 2.0固件库\GD32F1x0_Firmware_Library_V2.0.0\GD32F1x0_Firmware_Library_V2.0.0\Examples\ADC\ADC_DMA\gd32f1x0_conf.h
文件 4185 2016-02-23 13:16 固件库\GD32F1x0系列固件库\GD32F1x0 2.0固件库\GD32F1x0_Firmware_Library_V2.0.0\GD32F1x0_Firmware_Library_V2.0.0\Examples\ADC\ADC_DMA\main.c
文件 1238 2016-02-23 13:16 固件库\GD32F1x0系列固件库\GD32F1x0 2.0固件库\GD32F1x0_Firmware_Library_V2.0.0\GD32F1x0_Firmware_Library_V2.0.0\Examples\ADC\ADC_DMA\readme.txt
目录 0 2018-03-26 17:04 固件库\GD32F1x0系列固件库\GD32F1x0 2.0固件库\GD32F1x0_Firmware_Library_V2.0.0\GD32F1x0_Firmware_Library_V2.0.0\Examples\ADC\ADC_DMA_TwoResolution\
文件 1442 2016-02-23 13:16 固件库\GD32F1x0系列固件库\GD32F1x0 2.0固件库\GD32F1x0_Firmware_Library_V2.0.0\GD32F1x0_Firmware_Library_V2.0.0\Examples\ADC\ADC_DMA_TwoResolution\gd32f1x0_conf.h
文件 2478 2016-02-23 13:16 固件库\GD32F1x0系列固件库\GD32F1x0 2.0固件库\GD32F1x0_Firmware_Library_V2.0.0\GD32F1x0_Firmware_Library_V2.0.0\Examples\ADC\ADC_DMA_TwoResolution\gd32f1x0_it.c
文件 1056 2016-02-23 13:16 固件库\GD32F1x0系列固件库\GD32F1x0 2.0固件库\GD32F1x0_Firmware_Library_V2.0.0\GD32F1x0_Firmware_Library_V2.0.0\Examples\ADC\ADC_DMA_TwoResolution\gd32f1x0_it.h
文件 9202 2016-02-23 13:16 固件库\GD32F1x0系列固件库\GD32F1x0 2.0固件库\GD32F1x0_Firmware_Library_V2.0.0\GD32F1x0_Firmware_Library_V2.0.0\Examples\ADC\ADC_DMA_TwoResolution\main.c
文件 1366 2016-02-23 13:16 固件库\GD32F1x0系列固件库\GD32F1x0 2.0固件库\GD32F1x0_Firmware_Library_V2.0.0\GD32F1x0_Firmware_Library_V2.0.0\Examples\ADC\ADC_DMA_TwoResolution\readme.txt
目录 0 2018-03-26 17:04 固件库\GD32F1x0系列固件库\GD32F1x0 2.0固件库\GD32F1x0_Firmware_Library_V2.0.0\GD32F1x0_Firmware_Library_V2.0.0\Examples\ADC\ADC_Oversampler\
文件 1442 2016-02-23 13:16 固件库\GD32F1x0系列固件库\GD32F1x0 2.0固件库\GD32F1x0_Firmware_Library_V2.0.0\GD32F1x0_Firmware_Library_V2.0.0\Examples\ADC\ADC_Oversampler\gd32f1x0_conf.h
文件 6051 2016-02-23 13:16 固件库\GD32F1x0系列固件库\GD32F1x0 2.0固件库\GD32F1x0_Firmware_Library_V2.0.0\GD32F1x0_Firmware_Library_V2.0.0\Examples\ADC\ADC_Oversampler\main.c
文件 1126 2016-02-23 13:16 固件库\GD32F1x0系列固件库\GD32F1x0 2.0固件库\GD32F1x0_Firmware_Library_V2.0.0\GD32F1x0_Firmware_Library_V2.0.0\Examples\ADC\ADC_Oversampler\readme.txt
目录 0 2018-03-26 17:04 固件库\GD32F1x0系列固件库\GD32F1x0 2.0固件库\GD32F1x0_Firmware_Library_V2.0.0\GD32F1x0_Firmware_Library_V2.0.0\Examples\ADC\ADC_temperature_Vref_Vbat\
文件 1442 2016-02-23 13:16 固件库\GD32F1x0系列固件库\GD32F1x0 2.0固件库\GD32F1x0_Firmware_Library_V2.0.0\GD32F1x0_Firmware_Library_V2.0.0\Examples\ADC\ADC_temperature_Vref_Vbat\gd32f1x0_conf.h
文件 2552 2016-02-23 13:16 固件库\GD32F1x0系列固件库\GD32F1x0 2.0固件库\GD32F1x0_Firmware_Library_V2.0.0\GD32F1x0_Firmware_Library_V2.0.0\Examples\ADC\ADC_temperature_Vref_Vbat\main.c
文件 1093 2016-02-23 13:16 固件库\GD32F1x0系列固件库\GD32F1x0 2.0固件库\GD32F1x0_Firmware_Library_V2.0.0\GD32F1x0_Firmware_Library_V2.0.0\Examples\ADC\ADC_temperature_Vref_Vbat\readme.txt
目录 0 2018-03-26 17:04 固件库\GD32F1x0系列固件库\GD32F1x0 2.0固件库\GD32F1x0_Firmware_Library_V2.0.0\GD32F1x0_Firmware_Library_V2.0.0\Examples\ADC\AnalogWatchdog\
文件 1442 2016-02-23 13:16 固件库\GD32F1x0系列固件库\GD32F1x0 2.0固件库\GD32F1x0_Firmware_Library_V2.0.0\GD32F1x0_Firmware_Library_V2.0.0\Examples\ADC\AnalogWatchdog\gd32f1x0_conf.h
文件 2509 2016-02-23 13:16 固件库\GD32F1x0系列固件库\GD32F1x0 2.0固件库\GD32F1x0_Firmware_Library_V2.0.0\GD32F1x0_Firmware_Library_V2.0.0\Examples\ADC\AnalogWatchdog\gd32f1x0_it.c
文件 1077 2016-02-23 13:16 固件库\GD32F1x0系列固件库\GD32F1x0 2.0固件库\GD32F1x0_Firmware_Library_V2.0.0\GD32F1x0_Firmware_Library_V2.0.0\Examples\ADC\AnalogWatchdog\gd32f1x0_it.h
文件 4214 2016-02-23 13:16 固件库\GD32F1x0系列固件库\GD32F1x0 2.0固件库\GD32F1x0_Firmware_Library_V2.0.0\GD32F1x0_Firmware_Library_V2.0.0\Examples\ADC\AnalogWatchdog\main.c
文件 1159 2016-02-23 13:16 固件库\GD32F1x0系列固件库\GD32F1x0 2.0固件库\GD32F1x0_Firmware_Library_V2.0.0\GD32F1x0_Firmware_Library_V2.0.0\Examples\ADC\AnalogWatchdog\readme.txt
............此处省略3557个文件信息
评论
共有 条评论