• 大小: 7.86MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-11-03
  • 语言: 其他
  • 标签: STM32F446  STm32F407  

资源简介

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  blinky\Abstract.txt

     文件       5558  2016-05-30 14:40  blinky\ADC_MCBSTM32F400.c

     文件      15812  2017-08-16 09:15  blinky\blinky.c

    .......    168281  2017-08-16 09:37  blinky\blinky.uvguix.Administrator

    .......     29674  2017-08-15 16:37  blinky\blinky.uvoptx

    .......    127360  2017-08-16 09:26  blinky\blinky.uvprojx

     文件       3348  2014-07-08 06:42  blinky\Board_ADC.h

     文件       2821  2014-07-08 06:42  blinky\Board_Buttons.h

     文件       3501  2014-07-08 06:42  blinky\Board_LED.h

     文件       4650  2017-03-13 15:42  blinky\Buttons_MCBSTM32F400.c

     文件       2084  2015-10-27 12:06  blinky\DebugConfig\STM32F407_Flash_STM32F407IGHx.dbgconf

     文件       2084  2015-10-27 12:06  blinky\DebugConfig\STM32F407_Flash_STM32F407VETx.dbgconf

     文件       2084  2015-10-27 12:06  blinky\DebugConfig\STM32F407_Flash_STM32F446RCTx.dbgconf

     文件       2084  2015-10-27 12:06  blinky\DebugConfig\STM32F407_RAM_STM32F407IGHx.dbgconf

     文件       2084  2015-10-27 12:06  blinky\DebugConfig\STM32F407_RAM_STM32F446RCTx.dbgconf

     文件       1119  2014-09-01 08:38  blinky\Debug_RAM.ini

     文件        525  2017-07-05 11:18  blinky\edit_高速机.prj

     文件     820361  2017-08-16 09:35  blinky\Flash\adc_mcbstm32f400.crf

     文件       4330  2017-08-16 09:35  blinky\Flash\adc_mcbstm32f400.d

     文件     925292  2017-08-16 09:35  blinky\Flash\adc_mcbstm32f400.o

     文件    1086724  2017-08-16 09:35  blinky\Flash\blinky.axf

     文件       7875  2017-08-16 09:35  blinky\Flash\blinky.build_log.htm

     文件     835949  2017-08-16 09:35  blinky\Flash\blinky.crf

     文件       4191  2017-08-16 09:35  blinky\Flash\blinky.d

     文件     128007  2017-08-16 09:35  blinky\Flash\blinky.hex

     文件     196353  2017-08-16 09:35  blinky\Flash\blinky.htm

     文件       1154  2017-08-16 09:35  blinky\Flash\blinky.lnp

     文件     171883  2017-08-16 09:35  blinky\Flash\blinky.map

     文件     942448  2017-08-16 09:35  blinky\Flash\blinky.o

     文件        479  2017-08-15 16:20  blinky\Flash\blinky.sct

............此处省略130个文件信息

评论

共有 条评论