Changed permissions; updated DAC src
This commit is contained in:
parent
e7b8823c4f
commit
00e45fdb63
|
@ -1,81 +0,0 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file IO_Toggle/stm32f0xx_conf.h
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.0
|
||||
* @date 23-March-2012
|
||||
* @brief Library configuration file.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT 2012 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at:
|
||||
*
|
||||
* http://www.st.com/software_license_agreement_liberty_v2
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __STM32F0XX_CONF_H
|
||||
#define __STM32F0XX_CONF_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
/* Comment the line below to disable peripheral header file inclusion */
|
||||
#include "stm32f0xx_adc.h"
|
||||
#include "stm32f0xx_cec.h"
|
||||
#include "stm32f0xx_crc.h"
|
||||
#include "stm32f0xx_comp.h"
|
||||
#include "stm32f0xx_dac.h"
|
||||
#include "stm32f0xx_dbgmcu.h"
|
||||
#include "stm32f0xx_dma.h"
|
||||
#include "stm32f0xx_exti.h"
|
||||
#include "stm32f0xx_flash.h"
|
||||
#include "stm32f0xx_gpio.h"
|
||||
#include "stm32f0xx_syscfg.h"
|
||||
#include "stm32f0xx_i2c.h"
|
||||
#include "stm32f0xx_iwdg.h"
|
||||
#include "stm32f0xx_pwr.h"
|
||||
#include "stm32f0xx_rcc.h"
|
||||
#include "stm32f0xx_rtc.h"
|
||||
#include "stm32f0xx_spi.h"
|
||||
#include "stm32f0xx_tim.h"
|
||||
#include "stm32f0xx_usart.h"
|
||||
#include "stm32f0xx_wwdg.h"
|
||||
#include "stm32f0xx_misc.h" /* High level functions for NVIC and SysTick (add-on to CMSIS functions) */
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
/* Uncomment the line below to expanse the "assert_param" macro in the
|
||||
Standard Peripheral Library drivers code */
|
||||
/* #define USE_FULL_ASSERT 1 */
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
#ifdef USE_FULL_ASSERT
|
||||
|
||||
/**
|
||||
* @brief The assert_param macro is used for function's parameters check.
|
||||
* @param expr: If expr is false, it calls assert_failed function which reports
|
||||
* the name of the source file and the source line number of the call
|
||||
* that failed. If expr is true, it returns no value.
|
||||
* @retval None
|
||||
*/
|
||||
#define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
|
||||
/* Exported functions ------------------------------------------------------- */
|
||||
void assert_failed(uint8_t* file, uint32_t line);
|
||||
#else
|
||||
#define assert_param(expr) ((void)0)
|
||||
#endif /* USE_FULL_ASSERT */
|
||||
|
||||
#endif /* __STM32F0XX_CONF_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|
@ -10,7 +10,7 @@ CFLAGS += -mlittle-endian -mthumb -mcpu=cortex-m0 -march=armv6s-m
|
|||
CFLAGS += -ffreestanding -nostdlib
|
||||
CFLAGS += -Iinc -Iinc/core -Iinc/peripherals
|
||||
|
||||
#SRCS = stm32f0_discovery.c
|
||||
SRCS = stm32f0_discovery.c
|
||||
SRCS = stm32f0xx_adc.c stm32f0xx_cec.c stm32f0xx_comp.c stm32f0xx_crc.c \
|
||||
stm32f0xx_dac.c stm32f0xx_dbgmcu.c stm32f0xx_dma.c stm32f0xx_exti.c \
|
||||
stm32f0xx_flash.c stm32f0xx_gpio.c stm32f0xx_i2c.c stm32f0xx_iwdg.c \
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
******************************************************************************
|
||||
* @file stm32f0xx_dac.c
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.0
|
||||
* @date 23-March-2012
|
||||
* @version V1.0.1
|
||||
* @date 20-April-2012
|
||||
* @brief This file provides firmware functions to manage the following
|
||||
* functionalities of the Digital-to-Analog Converter (DAC) peripheral:
|
||||
* + DAC channel configuration: trigger, output buffer, data format
|
||||
|
@ -98,6 +98,7 @@
|
|||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32f0xx_dac.h"
|
||||
#include "stm32f0xx_rcc.h"
|
||||
|
||||
/** @addtogroup STM32F0xx_StdPeriph_Driver
|
||||
* @{
|
||||
|
@ -161,7 +162,6 @@ void DAC_DeInit(void)
|
|||
* @arg DAC_Channel_1: DAC Channel1 selected
|
||||
* @param DAC_InitStruct: pointer to a DAC_InitTypeDef structure that
|
||||
* contains the configuration information for the specified DAC channel.
|
||||
*
|
||||
* @retval None
|
||||
*/
|
||||
void DAC_Init(uint32_t DAC_Channel, DAC_InitTypeDef* DAC_InitStruct)
|
||||
|
@ -194,7 +194,7 @@ void DAC_Init(uint32_t DAC_Channel, DAC_InitTypeDef* DAC_InitStruct)
|
|||
|
||||
/**
|
||||
* @brief Fills each DAC_InitStruct member with its default value.
|
||||
* @param DAC_InitStruct : pointer to a DAC_InitTypeDef structure which will
|
||||
* @param DAC_InitStruct: pointer to a DAC_InitTypeDef structure which will
|
||||
* be initialized.
|
||||
* @retval None
|
||||
*/
|
||||
|
@ -214,8 +214,7 @@ void DAC_StructInit(DAC_InitTypeDef* DAC_InitStruct)
|
|||
* @arg DAC_Channel_1: DAC Channel1 selected
|
||||
* @param NewState: new state of the DAC channel.
|
||||
* This parameter can be: ENABLE or DISABLE.
|
||||
* @note When the DAC channel is enabled the trigger source can no more
|
||||
* be modified.
|
||||
* @note When the DAC channel is enabled the trigger source can no more be modified.
|
||||
* @retval None
|
||||
*/
|
||||
void DAC_Cmd(uint32_t DAC_Channel, FunctionalState NewState)
|
||||
|
@ -270,7 +269,7 @@ void DAC_SoftwareTriggerCmd(uint32_t DAC_Channel, FunctionalState NewState)
|
|||
* @arg DAC_Align_8b_R: 8bit right data alignment selected
|
||||
* @arg DAC_Align_12b_L: 12bit left data alignment selected
|
||||
* @arg DAC_Align_12b_R: 12bit right data alignment selected
|
||||
* @param Data : Data to be loaded in the selected data holding register.
|
||||
* @param Data: Data to be loaded in the selected data holding register.
|
||||
* @retval None
|
||||
*/
|
||||
void DAC_SetChannel1Data(uint32_t DAC_Align, uint16_t Data)
|
||||
|
@ -334,7 +333,7 @@ uint16_t DAC_GetDataOutputValue(uint32_t DAC_Channel)
|
|||
* @arg DAC_Channel_1: DAC Channel1 selected
|
||||
* @param NewState: new state of the selected DAC channel DMA request.
|
||||
* This parameter can be: ENABLE or DISABLE.
|
||||
* The DAC channel1 is mapped on DMA1 channel3 which must be already configured.
|
||||
* @note The DAC channel1 is mapped on DMA1 channel3 which must be already configured.
|
||||
* @retval None
|
||||
*/
|
||||
void DAC_DMACmd(uint32_t DAC_Channel, FunctionalState NewState)
|
||||
|
|
|
@ -4,11 +4,12 @@
|
|||
* @author MCD Application Team
|
||||
* @version V1.0.0
|
||||
* @date 23-March-2012
|
||||
* @brief STM32F0xx Devices vector table for RIDE7 toolchain.
|
||||
* @brief STM32F0xx Devices vector table for Atollic toolchain.
|
||||
* This module performs:
|
||||
* - Set the initial SP
|
||||
* - Set the initial PC == Reset_Handler,
|
||||
* - Set the vector table entries with the exceptions ISR address
|
||||
* - Configure the clock system
|
||||
* - Branches to main in the C library (which eventually
|
||||
* calls main()).
|
||||
* After Reset the Cortex-M0 processor is in Thread mode,
|
||||
|
@ -67,6 +68,8 @@ defined in linker script */
|
|||
.weak Reset_Handler
|
||||
.type Reset_Handler, %function
|
||||
Reset_Handler:
|
||||
ldr r0, =_estack
|
||||
mov sp, r0 /* set stack pointer */
|
||||
|
||||
/* Copy the data segment initializers from flash to SRAM */
|
||||
movs r1, #0
|
||||
|
@ -89,17 +92,26 @@ LoopCopyDataInit:
|
|||
/* Zero fill the bss segment. */
|
||||
FillZerobss:
|
||||
movs r3, #0
|
||||
str r3, [r2], #4
|
||||
str r3, [r2]
|
||||
adds r2, r2, #4
|
||||
|
||||
|
||||
LoopFillZerobss:
|
||||
ldr r3, = _ebss
|
||||
cmp r2, r3
|
||||
bcc FillZerobss
|
||||
|
||||
/* Call the clock system intitialization function.*/
|
||||
bl SystemInit
|
||||
/* Call static constructors */
|
||||
bl __libc_init_array
|
||||
/* Call the application's entry point.*/
|
||||
bl main
|
||||
bx lr
|
||||
|
||||
LoopForever:
|
||||
b LoopForever
|
||||
|
||||
|
||||
.size Reset_Handler, .-Reset_Handler
|
||||
|
||||
/**
|
||||
|
@ -108,19 +120,20 @@ LoopFillZerobss:
|
|||
* the system state for examination by a debugger.
|
||||
*
|
||||
* @param None
|
||||
* @retval None
|
||||
* @retval : None
|
||||
*/
|
||||
.section .text.Default_Handler,"ax",%progbits
|
||||
Default_Handler:
|
||||
Infinite_Loop:
|
||||
b Infinite_Loop
|
||||
.size Default_Handler, .-Default_Handler
|
||||
/*******************************************************************************
|
||||
/******************************************************************************
|
||||
*
|
||||
* The minimal vector table for a Cortex M0. Note that the proper constructs
|
||||
* must be placed on this to ensure that it ends up at physical address
|
||||
* 0x0000.0000.
|
||||
*******************************************************************************/
|
||||
*
|
||||
******************************************************************************/
|
||||
.section .isr_vector,"a",%progbits
|
||||
.type g_pfnVectors, %object
|
||||
.size g_pfnVectors, .-g_pfnVectors
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "stm32f4xx_conf.h"
|
||||
#include "stm32f0xx_conf.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
#include "stm32f4xx_conf.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
||||
//#elif CONFIG_STM32F0_DISCOVERY
|
||||
//
|
||||
//#define GPIOC 0x48000800 /* port C */
|
||||
//#define GPIOC_MODER (GPIOC + 0x00) /* port mode register */
|
||||
//#define LED_PORT_ODR (GPIOC + 0x14) /* port output data register */
|
||||
//
|
||||
//#define LED_BLUE (1 << 8) /* port C, pin 8 */
|
||||
//#define LED_GREEN (1 << 9) /* port C, pin 9 */
|
||||
//#define LED_ORANGE 0
|
||||
//#define LED_RED 0
|
||||
|
||||
GPIOC->MODER = (1 << 16);
|
||||
|
||||
while(1) GPIOC->ODR ^= (1 << 16);
|
||||
|
||||
}
|
Loading…
Reference in New Issue