資源簡介
STM32F446 包括IO操作,SPI操作,內部定時器,ADC的DMA方式,DAC的DMA方式,UART的DMA方式,CAN的通用方式。適合STM32F4xx系統

代碼片段和文件信息
/*-----------------------------------------------------------------------------
?*?Name:????ADC_MCBSTM32F400.c
?*?Purpose:?A/D?Converter?interface?for?MCBSTM32F400?evaluation?board
?*?Rev.:????1.0.2
?*----------------------------------------------------------------------------*/
/*?Copyright?(c)?2013?-?2016?ARM?LIMITED
???All?rights?reserved.
???Redistribution?and?use?in?source?and?binary?forms?with?or?without
???modification?are?permitted?provided?that?the?following?conditions?are?met:
???-?Redistributions?of?source?code?must?retain?the?above?copyright
?????notice?this?list?of?conditions?and?the?following?disclaimer.
???-?Redistributions?in?binary?form?must?reproduce?the?above?copyright
?????notice?this?list?of?conditions?and?the?following?disclaimer?in?the
?????documentation?and/or?other?materials?provided?with?the?distribution.
???-?Neither?the?name?of?ARM?nor?the?names?of?its?contributors?may?be?used
?????to?endorse?or?promote?products?derived?from?this?software?without
?????specific?prior?written?permission.
???*
???THIS?SOFTWARE?IS?PROVIDED?BY?THE?COPYRIGHT?HOLDERS?AND?CONTRIBUTORS?“AS?IS“
???AND?ANY?EXPRESS?OR?IMPLIED?WARRANTIES?INCLUDING?BUT?NOT?LIMITED?TO?THE
???IMPLIED?WARRANTIES?OF?MERCHANTABILITY?AND?FITNESS?FOR?A?PARTICULAR?PURPOSE
???ARE?DISCLAIMED.?IN?NO?EVENT?SHALL?COPYRIGHT?HOLDERS?AND?CONTRIBUTORS?BE
???LIABLE?FOR?ANY?DIRECT?INDIRECT?INCIDENTAL?SPECIAL?EXEMPLARY?OR
???CONSEQUENTIAL?DAMAGES?(INCLUDING?BUT?NOT?LIMITED?TO?PROCUREMENT?OF
???SUBSTITUTE?GOODS?OR?SERVICES;?LOSS?OF?USE?DATA?OR?PROFITS;?OR?BUSINESS
???INTERRUPTION)?HOWEVER?CAUSED?AND?ON?ANY?THEORY?OF?LIABILITY?WHETHER?IN
???CONTRACT?STRICT?LIABILITY?OR?TORT?(INCLUDING?NEGLIGENCE?OR?OTHERWISE)
???ARISING?IN?ANY?WAY?OUT?OF?THE?USE?OF?THIS?SOFTWARE?EVEN?IF?ADVISED?OF?THE
???POSSIBILITY?OF?SUCH?DAMAGE.
???---------------------------------------------------------------------------*/
#include?“stm32f4xx_hal.h“
#include?“Board_ADC.h“
#define?ADC_RESOLUTION????????12????????/*?Number?of?A/D?converter?bits???????*/
static?ADC_HandleTypeDef?hadc3;
static?volatile?uint8_t??AD_done;???????/*?AD?conversion?done?flag????????????*/
/**
??\fn??????????int32_t?ADC_Initialize?(void)
??\brief???????Initialize?Analog-to-Digital?Converter
??\returns
???-?\b??0:?function?succeeded
???-?\b?-1:?function?failed
*/
int32_t?ADC_Initialize?(void)?{
??ADC_ChannelConfTypeDef?sConfig;
??GPIO_InitTypeDef?GPIO_InitStruct;
??/*?GPIO?Ports?Clock?Enable?*/
??__HAL_RCC_GPIOF_CLK_ENABLE();
??/*?ADC3?GPIO?Configuration:?PF9?->?ADC3_IN7?*/
??GPIO_InitStruct.Pin?=?GPIO_PIN_9;
??GPIO_InitStruct.Mode?=?GPIO_MODE_ANALOG;
??GPIO_InitStruct.Pull?=?GPIO_NOPULL;
??HAL_GPIO_Init(GPIOF?&GPIO_InitStruct);
??/*?Peripheral?clock?enable?*/
??__HAL_RCC_ADC3_CLK_ENABLE();
??/*?Configure?the?global?features?of?the?ADC
????(Clock?Resolution?Data?Alignment?and?number?of?conversion)?*/
??hadc3.Instance?=?ADC3;
??hadc3.Init.Cloc
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????1787??2015-09-04?13:38??bl
?????文件???????5558??2016-05-30?14:40??bl
?????文件??????15812??2017-08-16?09:15??bl
????.......????168281??2017-08-16?09:37??bl
????.......?????29674??2017-08-15?16:37??bl
????.......????127360??2017-08-16?09:26??bl
?????文件???????3348??2014-07-08?06:42??bl
?????文件???????2821??2014-07-08?06:42??bl
?????文件???????3501??2014-07-08?06:42??bl
?????文件???????4650??2017-03-13?15:42??bl
?????文件???????2084??2015-10-27?12:06??bl
?????文件???????2084??2015-10-27?12:06??bl
?????文件???????2084??2015-10-27?12:06??bl
?????文件???????2084??2015-10-27?12:06??bl
?????文件???????2084??2015-10-27?12:06??bl
?????文件???????1119??2014-09-01?08:38??bl
?????文件????????525??2017-07-05?11:18??bl
?????文件?????820361??2017-08-16?09:35??bl
?????文件???????4330??2017-08-16?09:35??bl
?????文件?????925292??2017-08-16?09:35??bl
?????文件????1086724??2017-08-16?09:35??bl
?????文件???????7875??2017-08-16?09:35??bl
?????文件?????835949??2017-08-16?09:35??bl
?????文件???????4191??2017-08-16?09:35??bl
?????文件?????128007??2017-08-16?09:35??bl
?????文件?????196353??2017-08-16?09:35??bl
?????文件???????1154??2017-08-16?09:35??bl
?????文件?????171883??2017-08-16?09:35??bl
?????文件?????942448??2017-08-16?09:35??bl
?????文件????????479??2017-08-15?16:20??bl
............此處省略130個文件信息
評論
共有 條評論