資源簡介
心率讀取顯示,時間顯示,溫度顯示,藍牙通信

代碼片段和文件信息
#include?“adc.h“
/*?Private?typedef?-----------------------------------------------------------*/
/*?Private?define?------------------------------------------------------------*/
#define?ADC1_DR_Address????????????????0x40012440
__IO?uint16_t?RegularConvData_Tab;
void?ADC1_DMA_Init(void)
{
??ADC_InitTypeDef?????ADC_InitStruct;
??DMA_InitTypeDef?????DMA_InitStruct;
GPIO_InitTypeDef????GPIO_InitStruct;
??/*?ADC1?DeInit?*/??
??ADC_DeInit(ADC1);
/*?Enable??GPIOA?clock?*/
??RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA?ENABLE);
??/*?ADC1?Periph?clock?enable?*/
??RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1?ENABLE);
??/*?DMA1?clock?enable?*/
??RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA1??ENABLE);
??/*?Configure?PA.01??as?analog?input?*/
??GPIO_InitStruct.GPIO_Pin?=?GPIO_Pin_0;
??GPIO_InitStruct.GPIO_Mode?=?GPIO_Mode_AN;
GPIO_InitStruct.GPIO_PuPd?=?GPIO_PuPd_NOPULL?;
??GPIO_Init(GPIOA?&GPIO_InitStruct); //?PC1??甌2??殍?????
?
??/*?DMA1?Channel1?Config?*/
??DMA_DeInit(DMA1_Channel1);
??DMA_InitStruct.DMA_PeripheralbaseAddr?=?(uint32_t)ADC1_DR_Address;
??DMA_InitStruct.DMA_MemorybaseAddr?=?(uint32_t)&RegularConvData_Tab;
??DMA_InitStruct.DMA_DIR?=?DMA_DIR_PeripheralSRC;
??DMA_InitStruct.DMA_BufferSize?=4;
??DMA_InitStruct.DMA_PeripheralInc?=?DMA_PeripheralInc_Disable;
??DMA_InitStruct.DMA_MemoryInc?=?DMA_MemoryInc_Enable;
??DMA_InitStruct.DMA_PeripheralDataSize?=?DMA_PeripheralDataSize_HalfWord;
??DMA_InitStruct.DMA_MemoryDataSize?=?DMA_MemoryDataSize_HalfWord;
??DMA_InitStruct.DMA_Mode?=?DMA_Mode_Circular;
??DMA_InitStruct.DMA_Priority?=?DMA_Priority_High;
??DMA_InitStruct.DMA_M2M?=?DMA_M2M_Disable;
??DMA_Init(DMA1_Channel1?&DMA_InitStruct);
??
??/*?DMA1?Channel1?enable?*/
??DMA_Cmd(DMA1_Channel1?ENABLE);
??
//???/*?ADC?DMA?request?in?circular?mode?*/
??ADC_DMARequestModeConfig(ADC1?ADC_DMAMode_Circular);
??
??/*?Enable?ADC_DMA?*/
??ADC_DMACmd(ADC1?ENABLE);??
??
??/*?Initialize?ADC?structure?*/
??ADC_StructInit(&ADC_InitStruct);
??
??/*?Configure?the?ADC1?in?continous?mode?withe?a?resolutuion?equal?to?12?bits??*/
??ADC_InitStruct.ADC_Resolution?=?ADC_Resolution_12b;
??ADC_InitStruct.ADC_ContinuousConvMode?=?ENABLE;?
??ADC_InitStruct.ADC_ExternalTrigConvEdge?=?ADC_ExternalTrigConvEdge_None;
??ADC_InitStruct.ADC_DataAlign?=?ADC_DataAlign_Right;
??ADC_InitStruct.ADC_ScanDirection?=?ADC_ScanDirection_Backward;
??ADC_Init(ADC1?&ADC_InitStruct);?
?
//???/*?Convert?the?ADC1?temperature?sensor??with?55.5?Cycles?as?sampling?time?*/?
//???ADC_ChannelConfig(ADC1?ADC_Channel_TempSensor??ADC_SampleTime_55_5Cycles);??
//???ADC_TempSensorCmd(ENABLE);
??
??/*?Convert?the?ADC1?Vref??with?55.5?Cycles?as?sampling?time?*/?
??ADC_ChannelConfig(ADC1?ADC_Channel_0??ADC_SampleTime_55_5Cycles);?
//???ADC_VrefintCmd(ENABLE);
??
??/*?ADC?Calibration?*/
??ADC_GetCalibrationFactor(ADC1);
???ADC_DMACmd(ADC1?ENABLE);
??/*?Enable?ADC1?*/
??ADC_Cmd(ADC1?ENABLE);?????
??
??/*?Wait?the?ADCEN?fal
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????3147??2018-01-23?11:18??001\driver\adc.c
?????文件????????113??2018-01-23?11:19??001\driver\adc.h
?????文件???????5160??2018-02-02?14:47??001\driver\algorithm.h
?????文件???????6539??2018-02-09?15:57??001\driver\ble.c
?????文件????????632??2018-02-02?14:49??001\driver\ble.h
?????文件???????2430??2018-02-02?14:56??001\driver\key.c
?????文件????????108??2018-01-23?11:24??001\driver\key.h
?????文件???????4949??2018-02-02?14:51??001\driver\max30102.c
?????文件????????328??2018-02-02?14:54??001\driver\max30102.h
?????文件??????10569??2018-01-23?11:25??001\driver\oled.c
?????文件??????42513??2018-01-23?11:26??001\driver\oled.h
?????文件??????19520??2012-04-25?11:09??001\lib\inc\stm32f0xx_adc.h
?????文件??????12353??2012-04-25?11:09??001\lib\inc\stm32f0xx_cec.h
?????文件??????10385??2012-04-25?11:09??001\lib\inc\stm32f0xx_comp.h
?????文件???????3680??2012-04-25?11:09??001\lib\inc\stm32f0xx_crc.h
?????文件???????7138??2012-04-25?11:09??001\lib\inc\stm32f0xx_dac.h
?????文件???????3892??2012-04-25?11:09??001\lib\inc\stm32f0xx_dbgmcu.h
?????文件??????14207??2012-04-25?11:09??001\lib\inc\stm32f0xx_dma.h
?????文件???????8617??2012-04-25?11:09??001\lib\inc\stm32f0xx_exti.h
?????文件??????10957??2012-04-25?11:09??001\lib\inc\stm32f0xx_flash.h
?????文件??????13174??2012-04-25?11:09??001\lib\inc\stm32f0xx_gpio.h
?????文件??????18136??2012-04-25?11:09??001\lib\inc\stm32f0xx_i2c.h
?????文件???????4531??2012-04-25?11:09??001\lib\inc\stm32f0xx_iwdg.h
?????文件???????4413??2012-04-25?11:09??001\lib\inc\stm32f0xx_misc.h
?????文件???????5909??2012-04-25?11:09??001\lib\inc\stm32f0xx_pwr.h
?????文件??????20615??2012-04-25?11:09??001\lib\inc\stm32f0xx_rcc.h
?????文件??????35039??2012-04-25?11:09??001\lib\inc\stm32f0xx_rtc.h
?????文件??????22351??2012-04-25?11:09??001\lib\inc\stm32f0xx_spi.h
?????文件???????9166??2012-04-25?11:09??001\lib\inc\stm32f0xx_syscfg.h
?????文件??????51670??2012-04-25?11:09??001\lib\inc\stm32f0xx_tim.h
............此處省略255個文件信息
- 上一篇:松下切換臺使用手冊
- 下一篇:hadoop dll winutils 各種版本
評論
共有 條評論