mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-19 09:38:32 -04:00
First version under SVN is V4.0.1
This commit is contained in:
parent
243393860c
commit
b6df57c7e3
918 changed files with 269038 additions and 0 deletions
75
Demo/ARM7_STR71x_IAR/FreeRTOSConfig.h
Normal file
75
Demo/ARM7_STR71x_IAR/FreeRTOSConfig.h
Normal file
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS distribution.
|
||||
|
||||
FreeRTOS is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
FreeRTOS is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with FreeRTOS; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
A special exception to the GPL can be applied should you wish to distribute
|
||||
a combined work that includes FreeRTOS, without being obliged to provide
|
||||
the source code for any proprietary components. See the licensing section
|
||||
of http://www.FreeRTOS.org for full details of how and when the exception
|
||||
can be applied.
|
||||
|
||||
***************************************************************************
|
||||
See http://www.FreeRTOS.org for documentation, latest information, license
|
||||
and contact details. Please ensure to read the configuration and relevant
|
||||
port sections of the online documentation.
|
||||
***************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef FREERTOS_CONFIG_H
|
||||
#define FREERTOS_CONFIG_H
|
||||
|
||||
/*-----------------------------------------------------------
|
||||
* Application specific definitions.
|
||||
*
|
||||
* These definitions should be adjusted for your particular hardware and
|
||||
* application requirements.
|
||||
*
|
||||
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
|
||||
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
|
||||
*----------------------------------------------------------*/
|
||||
|
||||
#define configUSE_PREEMPTION 1
|
||||
#define configUSE_IDLE_HOOK 0
|
||||
#define configUSE_TICK_HOOK 0
|
||||
#define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 48000000 )
|
||||
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
|
||||
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 )
|
||||
#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 100 )
|
||||
#define configTOTAL_HEAP_SIZE ( ( size_t ) 20480 )
|
||||
#define configMAX_TASK_NAME_LEN ( 16 )
|
||||
#define configUSE_TRACE_FACILITY 0
|
||||
#define configUSE_16_BIT_TICKS 0
|
||||
#define configIDLE_SHOULD_YIELD 1
|
||||
|
||||
/* Co-routine definitions. */
|
||||
#define configUSE_CO_ROUTINES 0
|
||||
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
|
||||
|
||||
/* Set the following definitions to 1 to include the API function, or zero
|
||||
to exclude the API function. */
|
||||
|
||||
#define INCLUDE_vTaskPrioritySet 1
|
||||
#define INCLUDE_uxTaskPriorityGet 1
|
||||
#define INCLUDE_vTaskDelete 0
|
||||
#define INCLUDE_vTaskCleanUpResources 0
|
||||
#define INCLUDE_vTaskSuspend 1
|
||||
#define INCLUDE_vTaskDelayUntil 1
|
||||
#define INCLUDE_vTaskDelay 1
|
||||
|
||||
|
||||
#endif /* FREERTOS_CONFIG_H */
|
157
Demo/ARM7_STR71x_IAR/Library/71x_lib.c
Normal file
157
Demo/ARM7_STR71x_IAR/Library/71x_lib.c
Normal file
|
@ -0,0 +1,157 @@
|
|||
/******************** (C) COPYRIGHT 2003 STMicroelectronics ********************
|
||||
* File Name : 71x_lib.c
|
||||
* Author : MCD Application Team
|
||||
* Date First Issued : 05/16/2003
|
||||
* Description : Peripherals pointers initialization
|
||||
********************************************************************************
|
||||
* History:
|
||||
* 30/11/2004 : V2.0
|
||||
* 14/07/2004 : V1.3
|
||||
* 01/01/2004 : V1.2
|
||||
*******************************************************************************
|
||||
THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH
|
||||
CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
|
||||
AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
|
||||
OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
|
||||
OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
|
||||
CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
||||
*******************************************************************************/
|
||||
#define EXT
|
||||
|
||||
#include "71x_map.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
extern u32 T0TIMI_Addr;
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : debug
|
||||
* Description : Initialize the pointers to peripherals
|
||||
* Input : none
|
||||
* Output : none
|
||||
* Return : none
|
||||
*******************************************************************************/
|
||||
void debug(void)
|
||||
{
|
||||
#ifdef _ADC12
|
||||
ADC12 = (ADC12_TypeDef *)ADC12_BASE;
|
||||
#endif
|
||||
|
||||
#ifdef _APB
|
||||
#ifdef _APB1
|
||||
APB1 = (APB_TypeDef *)APB1_BASE;
|
||||
#endif
|
||||
#ifdef _APB2
|
||||
APB2 = (APB_TypeDef *)APB2_BASE;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _BSPI
|
||||
#ifdef _BSPI0
|
||||
BSPI0 = (BSPI_TypeDef *)BSPI0_BASE;
|
||||
#endif
|
||||
#ifdef _BSPI1
|
||||
BSPI1 = (BSPI_TypeDef *)BSPI1_BASE;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _CAN
|
||||
CAN = (CAN_TypeDef *)CAN_BASE;
|
||||
#endif
|
||||
|
||||
#ifdef _EIC
|
||||
EIC = (EIC_TypeDef *)EIC_BASE;
|
||||
#endif
|
||||
|
||||
#ifdef _EMI
|
||||
EMI = (EMI_TypeDef *)EMI_BASE;
|
||||
#endif
|
||||
|
||||
#ifdef _FLASH
|
||||
FLASHR = (FLASHR_TypeDef *)FLASHR_BASE;
|
||||
FLASHPR = (FLASHPR_TypeDef *)FLASHPR_BASE;
|
||||
#endif
|
||||
|
||||
#ifdef _GPIO
|
||||
#ifdef _GPIO0
|
||||
GPIO0 = (GPIO_TypeDef *)GPIO0_BASE;
|
||||
#endif
|
||||
#ifdef _GPIO1
|
||||
GPIO1 = (GPIO_TypeDef *)GPIO1_BASE;
|
||||
#endif
|
||||
#ifdef _GPIO2
|
||||
GPIO2 = (GPIO_TypeDef *)GPIO2_BASE;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _I2C
|
||||
#ifdef _I2C0
|
||||
I2C0 = (I2C_TypeDef *)I2C0_BASE;
|
||||
#endif
|
||||
#ifdef _I2C1
|
||||
I2C1 = (I2C_TypeDef *)I2C1_BASE;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _PCU
|
||||
PCU = (PCU_TypeDef *)PCU_BASE;
|
||||
#endif
|
||||
|
||||
#ifdef _RCCU
|
||||
RCCU = (RCCU_TypeDef *)RCCU_BASE;
|
||||
#endif
|
||||
|
||||
#ifdef _RTC
|
||||
RTC = (RTC_TypeDef *)RTC_BASE;
|
||||
#endif
|
||||
|
||||
#ifdef _TIM
|
||||
#ifdef _TIM0
|
||||
TIM0 = (TIM_TypeDef *)TIM0_BASE;
|
||||
#endif
|
||||
#ifdef _TIM1
|
||||
TIM1 = (TIM_TypeDef *)TIM1_BASE;
|
||||
#endif
|
||||
#ifdef _TIM2
|
||||
TIM2 = (TIM_TypeDef *)TIM2_BASE;
|
||||
#endif
|
||||
#ifdef _TIM3
|
||||
TIM3 = (TIM_TypeDef *)TIM3_BASE;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _UART
|
||||
#ifdef _UART0
|
||||
UART0 = (UART_TypeDef *)UART0_BASE;
|
||||
#endif
|
||||
#ifdef _UART1
|
||||
UART1 = (UART_TypeDef *)UART1_BASE;
|
||||
#endif
|
||||
#ifdef _UART2
|
||||
UART2 = (UART_TypeDef *)UART2_BASE;
|
||||
#endif
|
||||
#ifdef _UART3
|
||||
UART3 = (UART_TypeDef *)UART3_BASE;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _USB
|
||||
USB = (USB_TypeDef *)USB_BASE;
|
||||
#endif
|
||||
|
||||
#ifdef _WDG
|
||||
WDG = (WDG_TypeDef *)WDG_BASE;
|
||||
#endif
|
||||
|
||||
#ifdef _XTI
|
||||
XTI = (XTI_TypeDef *)XTI_BASE;
|
||||
#endif
|
||||
|
||||
#ifdef _IRQVectors
|
||||
IRQVectors = (IRQVectors_TypeDef *)&T0TIMI_Addr;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* DEBUG */
|
||||
|
||||
/******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/
|
114
Demo/ARM7_STR71x_IAR/Library/gpio.c
Normal file
114
Demo/ARM7_STR71x_IAR/Library/gpio.c
Normal file
|
@ -0,0 +1,114 @@
|
|||
/******************** (C) COPYRIGHT 2003 STMicroelectronics ********************
|
||||
* File Name : gpio.c
|
||||
* Author : MCD Application Team
|
||||
* Date First Issued : 06/08/2003
|
||||
* Description : This file provides all the GPIO software functions
|
||||
********************************************************************************
|
||||
* History:
|
||||
* 30/11/2004 : V2.0
|
||||
* 14/07/2004 : V1.3
|
||||
* 01/01/2004 : V1.2
|
||||
*******************************************************************************
|
||||
THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH
|
||||
CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
|
||||
AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
|
||||
OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
|
||||
OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
|
||||
CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
||||
*******************************************************************************/
|
||||
|
||||
#include "gpio.h"
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : GPIO_Config
|
||||
* Description : Configure the GPIO port pins
|
||||
* Input 1 : GPIOx (x can be 0,1 or 2) the desired port
|
||||
* Input 2 : Port_Pins : pins placements
|
||||
* Input 3 : Pins Mode
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void GPIO_Config (GPIO_TypeDef *GPIOx, u16 Port_Pins, GpioPinMode_TypeDef GPIO_Mode)
|
||||
{
|
||||
switch (GPIO_Mode)
|
||||
{
|
||||
case GPIO_HI_AIN_TRI:
|
||||
GPIOx->PC0&=~Port_Pins;
|
||||
GPIOx->PC1&=~Port_Pins;
|
||||
GPIOx->PC2&=~Port_Pins;
|
||||
break;
|
||||
|
||||
case GPIO_IN_TRI_TTL:
|
||||
GPIOx->PC0|=Port_Pins;
|
||||
GPIOx->PC1&=~Port_Pins;
|
||||
GPIOx->PC2&=~Port_Pins;
|
||||
break;
|
||||
|
||||
case GPIO_IN_TRI_CMOS:
|
||||
GPIOx->PC0&=~Port_Pins;
|
||||
GPIOx->PC1|=Port_Pins;
|
||||
GPIOx->PC2&=~Port_Pins;
|
||||
break;
|
||||
|
||||
case GPIO_IPUPD_WP:
|
||||
GPIOx->PC0|=Port_Pins;
|
||||
GPIOx->PC1|=Port_Pins;
|
||||
GPIOx->PC2&=~Port_Pins;
|
||||
break;
|
||||
|
||||
case GPIO_OUT_OD:
|
||||
GPIOx->PC0&=~Port_Pins;
|
||||
GPIOx->PC1&=~Port_Pins;
|
||||
GPIOx->PC2|=Port_Pins;
|
||||
break;
|
||||
|
||||
case GPIO_OUT_PP:
|
||||
GPIOx->PC0|=Port_Pins;
|
||||
GPIOx->PC1&=~Port_Pins;
|
||||
GPIOx->PC2|=Port_Pins;
|
||||
break;
|
||||
|
||||
case GPIO_AF_OD:
|
||||
GPIOx->PC0&=~Port_Pins;
|
||||
GPIOx->PC1|=Port_Pins;
|
||||
GPIOx->PC2|=Port_Pins;
|
||||
break;
|
||||
|
||||
case GPIO_AF_PP:
|
||||
GPIOx->PC0|=Port_Pins;
|
||||
GPIOx->PC1|=Port_Pins;
|
||||
GPIOx->PC2|=Port_Pins;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : GPIO_BitWrite
|
||||
* Description : Set or reset the selected port pin
|
||||
* Input 1 : Selected GPIO port
|
||||
* Input 2 : Pin number
|
||||
* Input 3 : bit value
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void GPIO_BitWrite(GPIO_TypeDef *GPIOx, u8 Port_Pin, u8 Port_Val)
|
||||
{
|
||||
if (Port_Val&0x01) GPIOx->PD |= 1<<Port_Pin; else GPIOx->PD &= ~(1<<Port_Pin);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : GPIO_ByteWrite
|
||||
* Description : Write byte value to the selected PD register
|
||||
* Input 1 : Selected GPIO port
|
||||
* Input 2 : GPIO_MSB or GPIO_LSB
|
||||
* Input 3 : Byte value
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void GPIO_ByteWrite(GPIO_TypeDef *GPIOx, u8 Port_Byte, u8 Port_Val)
|
||||
{
|
||||
GPIOx->PD = Port_Byte ? (GPIOx->PD&0x00FF) | ((u16)Port_Val<<8)
|
||||
: (GPIOx->PD&0xFF00) | Port_Val;
|
||||
}
|
||||
|
||||
/******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/
|
91
Demo/ARM7_STR71x_IAR/Library/include/71x_conf.h
Normal file
91
Demo/ARM7_STR71x_IAR/Library/include/71x_conf.h
Normal file
|
@ -0,0 +1,91 @@
|
|||
/******************** (C) COPYRIGHT 2003 STMicroelectronics ********************
|
||||
* File Name : 71x_conf.h
|
||||
* Author : MCD Application Team
|
||||
* Date First Issued : 16/05/2003
|
||||
* Description : Library configuration for the ADC12 example
|
||||
********************************************************************************
|
||||
* History:
|
||||
* 16/05/2003 : Created
|
||||
* 30/11/2004 : V2.0
|
||||
*******************************************************************************
|
||||
THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH
|
||||
CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
|
||||
AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
|
||||
OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
|
||||
OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
|
||||
CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
||||
*******************************************************************************/
|
||||
#ifndef __71x_CONF_H
|
||||
#define __71x_CONF_H
|
||||
|
||||
|
||||
/* Comment the line below to put the library in release mode */
|
||||
//#define DEBUG
|
||||
|
||||
//#define inline inline
|
||||
|
||||
//#define USE_SERIAL_PORT
|
||||
//#define USE_UART0
|
||||
|
||||
// Main Oscillator Frequency value = 4 Mhz
|
||||
#define RCCU_Main_Osc 4000000
|
||||
|
||||
/* Comment the lines below corresponding to unwanted peripherals */
|
||||
//#define _ADC12
|
||||
|
||||
//#define _APB
|
||||
//#define _APB1
|
||||
//#define _APB2
|
||||
|
||||
//#define _BSPI
|
||||
//#define _BSPI0
|
||||
//#define _BSPI1
|
||||
|
||||
//#define _CAN
|
||||
|
||||
//#define _EIC
|
||||
|
||||
//#define _EMI
|
||||
|
||||
//#define _FLASH
|
||||
|
||||
#define _GPIO
|
||||
#define _GPIO0
|
||||
#define _GPIO1
|
||||
#define _GPIO2
|
||||
|
||||
//#define _I2C
|
||||
//#define _I2C0
|
||||
//#define _I2C1
|
||||
|
||||
#define _PCU
|
||||
|
||||
#define _RCCU
|
||||
|
||||
//#define _RTC
|
||||
|
||||
#define _TIM
|
||||
#define _TIM0
|
||||
//#define _TIM1
|
||||
//#define _TIM2
|
||||
//#define _TIM3
|
||||
|
||||
//#define _UART
|
||||
//#define _UART0
|
||||
//#define _UART1
|
||||
//#define _UART2
|
||||
//#define _UART3
|
||||
|
||||
//#define _USB
|
||||
|
||||
//#define _WDG
|
||||
|
||||
//#define _XTI
|
||||
|
||||
|
||||
//#define _IRQVectors
|
||||
|
||||
|
||||
#endif /* __71x_CONF_H */
|
||||
|
||||
/******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/
|
61
Demo/ARM7_STR71x_IAR/Library/include/71x_it.h
Normal file
61
Demo/ARM7_STR71x_IAR/Library/include/71x_it.h
Normal file
|
@ -0,0 +1,61 @@
|
|||
/******************** (C) COPYRIGHT 2003 STMicroelectronics ********************
|
||||
* File Name : 71x_it.h
|
||||
* Author : MCD Application Team
|
||||
* Date First Issued : 05/16/2003
|
||||
* Description : Interrupt handlers
|
||||
********************************************************************************
|
||||
* History:
|
||||
* 30/11/2004 : V2.0
|
||||
* 14/07/2004 : V1.3
|
||||
* 01/01/2004 : V1.2
|
||||
*******************************************************************************
|
||||
THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH
|
||||
CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
|
||||
AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
|
||||
OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
|
||||
OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
|
||||
CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef _71x_IT_H
|
||||
#define _71x_IT_H
|
||||
|
||||
#include "71x_lib.h"
|
||||
|
||||
|
||||
void Undefined_Handler (void);
|
||||
void FIQ_Handler (void);
|
||||
void SWI_Handler (void);
|
||||
void Prefetch_Handler (void);
|
||||
void Abort_Handler (void);
|
||||
void T0TIMI_IRQHandler (void);
|
||||
void FLASH_IRQHandler (void);
|
||||
void RCCU_IRQHandler (void);
|
||||
void RTC_IRQHandler (void);
|
||||
void WDG_IRQHandler (void);
|
||||
void XTI_IRQHandler (void);
|
||||
void USBHP_IRQHandler (void);
|
||||
void I2C0ITERR_IRQHandler(void);
|
||||
void I2C1ITERR_IRQHandler(void);
|
||||
void UART0_IRQHandler (void);
|
||||
void UART1_IRQHandler (void);
|
||||
void UART2_IRQHandler (void);
|
||||
void UART3_IRQHandler (void);
|
||||
void BSPI0_IRQHandler (void);
|
||||
void BSPI1_IRQHandler (void);
|
||||
void I2C0_IRQHandler (void);
|
||||
void I2C1_IRQHandler (void);
|
||||
void CAN_IRQHandler (void);
|
||||
void ADC12_IRQHandler (void);
|
||||
void T1TIMI_IRQHandler (void);
|
||||
void T2TIMI_IRQHandler (void);
|
||||
void T3TIMI_IRQHandler (void);
|
||||
void HDLC_IRQHandler (void);
|
||||
void USBLP_IRQHandler (void);
|
||||
void T0TOI_IRQHandler (void);
|
||||
void T0OC1_IRQHandler (void);
|
||||
void T0OC2_IRQHandler (void);
|
||||
|
||||
#endif /* _71x_IT_H */
|
||||
|
||||
/******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/
|
99
Demo/ARM7_STR71x_IAR/Library/include/71x_lib.h
Normal file
99
Demo/ARM7_STR71x_IAR/Library/include/71x_lib.h
Normal file
|
@ -0,0 +1,99 @@
|
|||
/******************** (C) COPYRIGHT 2003 STMicroelectronics ********************
|
||||
* File Name : 71x_lib.h
|
||||
* Author : MCD Application Team
|
||||
* Date First Issued : 05/16/2003
|
||||
* Description : Global include for all peripherals
|
||||
********************************************************************************
|
||||
* 30/11/2004 : V2.0
|
||||
* 14/07/2004 : V1.3
|
||||
* 01/01/2004 : V1.2
|
||||
*******************************************************************************
|
||||
THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH
|
||||
CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
|
||||
AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
|
||||
OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
|
||||
OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
|
||||
CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
||||
*******************************************************************************/
|
||||
#ifndef __71x_LIB_H
|
||||
#define __71x_LIB_H
|
||||
|
||||
#include "71x_map.h"
|
||||
#include "71x_conf.h"
|
||||
|
||||
|
||||
#ifdef _ADC12
|
||||
#include "adc12.h"
|
||||
#endif
|
||||
|
||||
#ifdef _APB
|
||||
#include "apb.h"
|
||||
#endif
|
||||
|
||||
#ifdef _BSPI
|
||||
#include "bspi.h"
|
||||
#endif
|
||||
|
||||
#ifdef _CAN
|
||||
#include "can.h"
|
||||
#endif
|
||||
|
||||
#ifdef _EIC
|
||||
#include "eic.h"
|
||||
#endif
|
||||
|
||||
#ifdef _EMI
|
||||
#include "emi.h"
|
||||
#endif
|
||||
|
||||
#ifdef _FLASH
|
||||
#include "flash.h"
|
||||
#endif
|
||||
|
||||
#ifdef _GPIO
|
||||
#include "gpio.h"
|
||||
#endif
|
||||
|
||||
#ifdef _I2C
|
||||
#include "i2c.h"
|
||||
#endif
|
||||
|
||||
#ifdef _PCU
|
||||
#include "pcu.h"
|
||||
#endif
|
||||
|
||||
#ifdef _RCCU
|
||||
#include "rccu.h"
|
||||
#endif
|
||||
|
||||
#ifdef _RTC
|
||||
#include "rtc.h"
|
||||
#endif
|
||||
|
||||
#ifdef _TIM
|
||||
#include "tim.h"
|
||||
#endif
|
||||
|
||||
#ifdef _UART
|
||||
#include "uart.h"
|
||||
#endif
|
||||
|
||||
#ifdef _USB
|
||||
#endif
|
||||
|
||||
#ifdef _WDG
|
||||
#include "wdg.h"
|
||||
#endif
|
||||
|
||||
#ifdef _XTI
|
||||
#include "xti.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
void debug(void);
|
||||
#endif
|
||||
|
||||
#endif /* __71x_LIB_H */
|
||||
|
||||
/******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/
|
610
Demo/ARM7_STR71x_IAR/Library/include/71x_map.h
Normal file
610
Demo/ARM7_STR71x_IAR/Library/include/71x_map.h
Normal file
|
@ -0,0 +1,610 @@
|
|||
/******************** (C) COPYRIGHT 2003 STMicroelectronics ********************
|
||||
* File Name : 71x_map.h
|
||||
* Author : MCD Application Team
|
||||
* Date First Issued : 05/16/2003
|
||||
* Description : Peripherals memory mapping and registers structures
|
||||
********************************************************************************
|
||||
* History:
|
||||
* 30/11/2004 : V2.0
|
||||
* 14/07/2004 : V1.3
|
||||
* 01/01/2004 : V1.2
|
||||
*******************************************************************************
|
||||
THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH
|
||||
CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
|
||||
AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
|
||||
OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
|
||||
OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
|
||||
CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef __71x_map_H
|
||||
#define __71x_map_H
|
||||
|
||||
#ifndef EXT
|
||||
#define EXT extern
|
||||
#endif
|
||||
|
||||
#include "71x_conf.h"
|
||||
#include "71x_type.h"
|
||||
|
||||
|
||||
/* IP registers structures */
|
||||
|
||||
typedef volatile struct
|
||||
{
|
||||
vu16 DATA0;
|
||||
vu16 EMPTY1[3];
|
||||
vu16 DATA1;
|
||||
vu16 EMPTY2[3];
|
||||
vu16 DATA2;
|
||||
vu16 EMPTY3[3];
|
||||
vu16 DATA3;
|
||||
vu16 EMPTY4[3];
|
||||
vu16 CSR;
|
||||
vu16 EMPTY5[7];
|
||||
vu16 CPR;
|
||||
} ADC12_TypeDef;
|
||||
|
||||
typedef volatile struct
|
||||
{
|
||||
vu32 CKDIS;
|
||||
vu32 SWRES;
|
||||
} APB_TypeDef;
|
||||
|
||||
typedef volatile struct
|
||||
{
|
||||
vu16 RXR;
|
||||
vu16 EMPTY1;
|
||||
vu16 TXR;
|
||||
vu16 EMPTY2;
|
||||
vu16 CSR1;
|
||||
vu16 EMPTY3;
|
||||
vu16 CSR2;
|
||||
vu16 EMPTY4;
|
||||
vu16 CLK;
|
||||
} BSPI_TypeDef;
|
||||
|
||||
typedef volatile struct
|
||||
{
|
||||
vu16 CRR;
|
||||
vu16 EMPTY1;
|
||||
vu16 CMR;
|
||||
vu16 EMPTY2;
|
||||
vu16 M1R;
|
||||
vu16 EMPTY3;
|
||||
vu16 M2R;
|
||||
vu16 EMPTY4;
|
||||
vu16 A1R;
|
||||
vu16 EMPTY5;
|
||||
vu16 A2R;
|
||||
vu16 EMPTY6;
|
||||
vu16 MCR;
|
||||
vu16 EMPTY7;
|
||||
vu16 DA1R;
|
||||
vu16 EMPTY8;
|
||||
vu16 DA2R;
|
||||
vu16 EMPTY9;
|
||||
vu16 DB1R;
|
||||
vu16 EMPTY10;
|
||||
vu16 DB2R;
|
||||
vu16 EMPTY11[27];
|
||||
} CAN_MsgObj_TypeDef;
|
||||
|
||||
typedef volatile struct
|
||||
{
|
||||
vu16 CR;
|
||||
vu16 EMPTY1;
|
||||
vu16 SR;
|
||||
vu16 EMPTY2;
|
||||
vu16 ERR;
|
||||
vu16 EMPTY3;
|
||||
vu16 BTR;
|
||||
vu16 EMPTY4;
|
||||
vu16 IDR;
|
||||
vu16 EMPTY5;
|
||||
vu16 TESTR;
|
||||
vu16 EMPTY6;
|
||||
vu16 BRPR;
|
||||
vu16 EMPTY7[3];
|
||||
CAN_MsgObj_TypeDef sMsgObj[2];
|
||||
vu16 EMPTY8[16];
|
||||
vu16 TR1R;
|
||||
vu16 EMPTY9;
|
||||
vu16 TR2R;
|
||||
vu16 EMPTY10[13];
|
||||
vu16 ND1R;
|
||||
vu16 EMPTY11;
|
||||
vu16 ND2R;
|
||||
vu16 EMPTY12[13];
|
||||
vu16 IP1R;
|
||||
vu16 EMPTY13;
|
||||
vu16 IP2R;
|
||||
vu16 EMPTY14[13];
|
||||
vu16 MV1R;
|
||||
vu16 EMPTY15;
|
||||
vu16 MV2R;
|
||||
vu16 EMPTY16;
|
||||
} CAN_TypeDef;
|
||||
|
||||
typedef volatile struct
|
||||
{
|
||||
vu32 ICR;
|
||||
vu32 CICR;
|
||||
vu32 CIPR;
|
||||
vu32 EMPTY1[3];
|
||||
vu32 IVR;
|
||||
vu32 FIR;
|
||||
vu32 IER;
|
||||
vu32 EMPTY2[7];
|
||||
vu32 IPR;
|
||||
vu32 EMPTY3[7];
|
||||
vu32 SIR[32];
|
||||
} EIC_TypeDef;
|
||||
|
||||
typedef volatile struct
|
||||
{
|
||||
vu16 BCON0;
|
||||
vu16 EMPTY1;
|
||||
vu16 BCON1;
|
||||
vu16 EMPTY2;
|
||||
vu16 BCON2;
|
||||
vu16 EMPTY3;
|
||||
vu16 BCON3;
|
||||
vu16 EMPTY4;
|
||||
} EMI_TypeDef;
|
||||
|
||||
typedef volatile struct
|
||||
{
|
||||
vu32 CR0;
|
||||
vu32 CR1;
|
||||
vu32 DR0;
|
||||
vu32 DR1;
|
||||
vu32 AR;
|
||||
vu32 ER;
|
||||
} FLASHR_TypeDef;
|
||||
|
||||
typedef volatile struct
|
||||
{
|
||||
vu32 NVWPAR;
|
||||
vu32 EMPTY;
|
||||
vu32 NVAPR0;
|
||||
vu32 NVAPR1;
|
||||
} FLASHPR_TypeDef;
|
||||
|
||||
typedef volatile struct
|
||||
{
|
||||
vu16 PC0;
|
||||
vu16 EMPTY1;
|
||||
vu16 PC1;
|
||||
vu16 EMPTY2;
|
||||
vu16 PC2;
|
||||
vu16 EMPTY3;
|
||||
vu16 PD;
|
||||
vu16 EMPTY4;
|
||||
} GPIO_TypeDef;
|
||||
|
||||
typedef volatile struct
|
||||
{
|
||||
vu8 CR;
|
||||
vu8 EMPTY1[3];
|
||||
vu8 SR1;
|
||||
vu8 EMPTY2[3];
|
||||
vu8 SR2;
|
||||
vu8 EMPTY3[3];
|
||||
vu8 CCR;
|
||||
vu8 EMPTY4[3];
|
||||
vu8 OAR1;
|
||||
vu8 EMPTY5[3];
|
||||
vu8 OAR2;
|
||||
vu8 EMPTY6[3];
|
||||
vu8 DR;
|
||||
vu8 EMPTY7[3];
|
||||
vu8 ECCR;
|
||||
} I2C_TypeDef;
|
||||
|
||||
typedef volatile struct
|
||||
{
|
||||
vu32 CCR;
|
||||
vu32 EMPTY1;
|
||||
vu32 CFR;
|
||||
vu32 EMPTY2[3];
|
||||
vu32 PLL1CR;
|
||||
vu32 PER;
|
||||
vu32 SMR;
|
||||
} RCCU_TypeDef;
|
||||
|
||||
typedef volatile struct
|
||||
{
|
||||
vu16 MDIVR;
|
||||
vu16 EMPTY1;
|
||||
vu16 PDIVR;
|
||||
vu16 EMPTY2;
|
||||
vu16 RSTR;
|
||||
vu16 EMPTY3;
|
||||
vu16 PLL2CR;
|
||||
vu16 EMPTY4;
|
||||
vu16 BOOTCR;
|
||||
vu16 EMPTY5;
|
||||
vu16 PWRCR;
|
||||
} PCU_TypeDef;
|
||||
|
||||
typedef volatile struct
|
||||
{
|
||||
vu16 CRH;
|
||||
vu16 EMPTY1;
|
||||
vu16 CRL;
|
||||
vu16 EMPTY2;
|
||||
vu16 PRLH;
|
||||
vu16 EMPTY3;
|
||||
vu16 PRLL;
|
||||
vu16 EMPTY4;
|
||||
vu16 DIVH;
|
||||
vu16 EMPTY5;
|
||||
vu16 DIVL;
|
||||
vu16 EMPTY6;
|
||||
vu16 CNTH;
|
||||
vu16 EMPTY7;
|
||||
vu16 CNTL;
|
||||
vu16 EMPTY8;
|
||||
vu16 ALRH;
|
||||
vu16 EMPTY9;
|
||||
vu16 ALRL;
|
||||
} RTC_TypeDef;
|
||||
|
||||
typedef volatile struct
|
||||
{
|
||||
vu16 ICAR;
|
||||
vu16 EMPTY1;
|
||||
vu16 ICBR;
|
||||
vu16 EMPTY2;
|
||||
vu16 OCAR;
|
||||
vu16 EMPTY3;
|
||||
vu16 OCBR;
|
||||
vu16 EMPTY4;
|
||||
vu16 CNTR;
|
||||
vu16 EMPTY5;
|
||||
vu16 CR1;
|
||||
vu16 EMPTY6;
|
||||
vu16 CR2;
|
||||
vu16 EMPTY7;
|
||||
vu16 SR;
|
||||
} TIM_TypeDef;
|
||||
|
||||
typedef volatile struct
|
||||
{
|
||||
vu16 BR;
|
||||
vu16 EMPTY1;
|
||||
vu16 TxBUFR;
|
||||
vu16 EMPTY2;
|
||||
vu16 RxBUFR;
|
||||
vu16 EMPTY3;
|
||||
vu16 CR;
|
||||
vu16 EMPTY4;
|
||||
vu16 IER;
|
||||
vu16 EMPTY5;
|
||||
vu16 SR;
|
||||
vu16 EMPTY6;
|
||||
vu16 GTR;
|
||||
vu16 EMPTY7;
|
||||
vu16 TOR;
|
||||
vu16 EMPTY8;
|
||||
vu16 TxRSTR;
|
||||
vu16 EMPTY9;
|
||||
vu16 RxRSTR;
|
||||
} UART_TypeDef;
|
||||
|
||||
typedef volatile struct
|
||||
{
|
||||
vu32 EP0R;
|
||||
vu32 EP1R;
|
||||
vu32 EP2R;
|
||||
vu32 EP3R;
|
||||
vu32 EP4R;
|
||||
vu32 EP5R;
|
||||
vu32 EP6R;
|
||||
vu32 EP7R;
|
||||
vu32 EP8R;
|
||||
vu32 EP9R;
|
||||
vu32 EP10R;
|
||||
vu32 EP11R;
|
||||
vu32 EP12R;
|
||||
vu32 EP13R;
|
||||
vu32 EP14R;
|
||||
vu32 EP15R;
|
||||
vu32 CNTR;
|
||||
vu32 ISTR;
|
||||
vu32 FNR;
|
||||
vu32 DADDR;
|
||||
vu32 BTABLE;
|
||||
} USB_TypeDef;
|
||||
|
||||
typedef volatile struct
|
||||
{
|
||||
vu16 CR;
|
||||
vu16 EMPTY1;
|
||||
vu16 PR;
|
||||
vu16 EMPTY2;
|
||||
vu16 VR;
|
||||
vu16 EMPTY3;
|
||||
vu16 CNT;
|
||||
vu16 EMPTY4;
|
||||
vu16 SR;
|
||||
vu16 EMPTY5;
|
||||
vu16 MR;
|
||||
vu16 EMPTY6;
|
||||
vu16 KR;
|
||||
} WDG_TypeDef;
|
||||
|
||||
typedef volatile struct
|
||||
{
|
||||
vu8 SR;
|
||||
vu8 EMPTY1[7];
|
||||
vu8 CTRL;
|
||||
vu8 EMPTY2[3];
|
||||
vu8 MRH;
|
||||
vu8 EMPTY3[3];
|
||||
vu8 MRL;
|
||||
vu8 EMPTY4[3];
|
||||
vu8 TRH;
|
||||
vu8 EMPTY5[3];
|
||||
vu8 TRL;
|
||||
vu8 EMPTY6[3];
|
||||
vu8 PRH;
|
||||
vu8 EMPTY7[3];
|
||||
vu8 PRL;
|
||||
} XTI_TypeDef;
|
||||
|
||||
|
||||
/* IRQ vectors */
|
||||
typedef volatile struct
|
||||
{
|
||||
vu32 T0TIMI_IRQHandler;
|
||||
vu32 FLASH_IRQHandler;
|
||||
vu32 RCCU_IRQHandler;
|
||||
vu32 RTC_IRQHandler;
|
||||
vu32 WDG_IRQHandler;
|
||||
vu32 XTI_IRQHandler;
|
||||
vu32 USBHP_IRQHandler;
|
||||
vu32 I2C0ITERR_IRQHandler;
|
||||
vu32 I2C1ITERR_IRQHandler;
|
||||
vu32 UART0_IRQHandler;
|
||||
vu32 UART1_IRQHandler;
|
||||
vu32 UART2_IRQHandler;
|
||||
vu32 UART3_IRQHandler;
|
||||
vu32 BSPI0_IRQHandler;
|
||||
vu32 BSPI1_IRQHandler;
|
||||
vu32 I2C0_IRQHandler;
|
||||
vu32 I2C1_IRQHandler;
|
||||
vu32 CAN_IRQHandler;
|
||||
vu32 ADC12_IRQHandler;
|
||||
vu32 T1TIMI_IRQHandler;
|
||||
vu32 T2TIMI_IRQHandler;
|
||||
vu32 T3TIMI_IRQHandler;
|
||||
vu32 EMPTY1[3];
|
||||
vu32 HDLC_IRQHandler;
|
||||
vu32 USBLP_IRQHandler;
|
||||
vu32 EMPTY2[2];
|
||||
vu32 T0TOI_IRQHandler;
|
||||
vu32 T0OC1_IRQHandler;
|
||||
vu32 T0OC2_IRQHandler;
|
||||
} IRQVectors_TypeDef;
|
||||
|
||||
/*===================================================================*/
|
||||
|
||||
/* Memory mapping */
|
||||
|
||||
#define RAM_BASE 0x20000000
|
||||
|
||||
#define FLASHR_BASE 0x40100000
|
||||
#define FLASHPR_BASE 0x4010DFB0
|
||||
|
||||
#define EXTMEM_BASE 0x60000000
|
||||
#define RCCU_BASE 0xA0000000
|
||||
#define PCU_BASE 0xA0000040
|
||||
#define APB1_BASE 0xC0000000
|
||||
#define APB2_BASE 0xE0000000
|
||||
#define EIC_BASE 0xFFFFF800
|
||||
|
||||
#define I2C0_BASE (APB1_BASE + 0x1000)
|
||||
#define I2C1_BASE (APB1_BASE + 0x2000)
|
||||
#define UART0_BASE (APB1_BASE + 0x4000)
|
||||
#define UART1_BASE (APB1_BASE + 0x5000)
|
||||
#define UART2_BASE (APB1_BASE + 0x6000)
|
||||
#define UART3_BASE (APB1_BASE + 0x7000)
|
||||
#define CAN_BASE (APB1_BASE + 0x9000)
|
||||
#define BSPI0_BASE (APB1_BASE + 0xA000)
|
||||
#define BSPI1_BASE (APB1_BASE + 0xB000)
|
||||
#define USB_BASE (APB1_BASE + 0x8800)
|
||||
|
||||
#define XTI_BASE (APB2_BASE + 0x101C)
|
||||
#define GPIO0_BASE (APB2_BASE + 0x3000)
|
||||
#define GPIO1_BASE (APB2_BASE + 0x4000)
|
||||
#define GPIO2_BASE (APB2_BASE + 0x5000)
|
||||
#define ADC12_BASE (APB2_BASE + 0x7000)
|
||||
#define TIM0_BASE (APB2_BASE + 0x9000)
|
||||
#define TIM1_BASE (APB2_BASE + 0xA000)
|
||||
#define TIM2_BASE (APB2_BASE + 0xB000)
|
||||
#define TIM3_BASE (APB2_BASE + 0xC000)
|
||||
#define RTC_BASE (APB2_BASE + 0xD000)
|
||||
#define WDG_BASE (APB2_BASE + 0xE000)
|
||||
|
||||
#define EMI_BASE (EXTMEM_BASE + 0x0C000000)
|
||||
|
||||
/*===================================================================*/
|
||||
|
||||
/* IP data access */
|
||||
|
||||
#ifndef DEBUG
|
||||
#define ADC12 ((ADC12_TypeDef *)ADC12_BASE)
|
||||
|
||||
#define APB1 ((APB_TypeDef *)APB1_BASE)
|
||||
#define APB2 ((APB_TypeDef *)APB2_BASE+0x10)
|
||||
|
||||
#define BSPI0 ((BSPI_TypeDef *)BSPI0_BASE)
|
||||
#define BSPI1 ((BSPI_TypeDef *)BSPI1_BASE)
|
||||
|
||||
#define CAN ((CAN_TypeDef *)CAN_BASE)
|
||||
|
||||
#define EIC ((EIC_TypeDef *)EIC_BASE)
|
||||
|
||||
#define EMI ((EMI_TypeDef *)EMI_BASE)
|
||||
|
||||
#define FLASHR ((FLASHR_TypeDef *)FLASHR_BASE)
|
||||
#define FLASHPR ((FLASHPR_TypeDef *)FLASHPR_BASE)
|
||||
|
||||
#define GPIO0 ((GPIO_TypeDef *)GPIO0_BASE)
|
||||
#define GPIO1 ((GPIO_TypeDef *)GPIO1_BASE)
|
||||
#define GPIO2 ((GPIO_TypeDef *)GPIO2_BASE)
|
||||
|
||||
#define I2C0 ((I2C_TypeDef *)I2C0_BASE)
|
||||
#define I2C1 ((I2C_TypeDef *)I2C1_BASE)
|
||||
|
||||
#define PCU ((PCU_TypeDef *)PCU_BASE)
|
||||
|
||||
#define RCCU ((RCCU_TypeDef *)RCCU_BASE)
|
||||
|
||||
#define RTC ((RTC_TypeDef *)RTC_BASE)
|
||||
|
||||
#define TIM0 ((TIM_TypeDef *)TIM0_BASE)
|
||||
#define TIM1 ((TIM_TypeDef *)TIM1_BASE)
|
||||
#define TIM2 ((TIM_TypeDef *)TIM2_BASE)
|
||||
#define TIM3 ((TIM_TypeDef *)TIM3_BASE)
|
||||
|
||||
#define UART0 ((UART_TypeDef *)UART0_BASE)
|
||||
#define UART1 ((UART_TypeDef *)UART1_BASE)
|
||||
#define UART2 ((UART_TypeDef *)UART2_BASE)
|
||||
#define UART3 ((UART_TypeDef *)UART3_BASE)
|
||||
|
||||
#define USB ((USB_TypeDef *)USB_BASE)
|
||||
|
||||
#define WDG ((WDG_TypeDef *)WDG_BASE)
|
||||
|
||||
#define XTI ((XTI_TypeDef *)XTI_BASE)
|
||||
|
||||
#define IRQVectors ((IRQVectors_TypeDef *)&T0TIMI_Addr)
|
||||
|
||||
#else /* DEBUG */
|
||||
|
||||
#ifdef _ADC12
|
||||
EXT ADC12_TypeDef *ADC12;
|
||||
#endif
|
||||
|
||||
#ifdef _APB
|
||||
#ifdef _APB1
|
||||
EXT APB_TypeDef *APB1;
|
||||
#endif
|
||||
#ifdef _APB2
|
||||
EXT APB_TypeDef *APB2;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _BSPI
|
||||
#ifdef _BSPI0
|
||||
EXT BSPI_TypeDef *BSPI0;
|
||||
#endif
|
||||
#ifdef _BSPI1
|
||||
EXT BSPI_TypeDef *BSPI1;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _CAN
|
||||
EXT CAN_TypeDef *CAN;
|
||||
#endif
|
||||
|
||||
#ifdef _EIC
|
||||
EXT EIC_TypeDef *EIC;
|
||||
#endif
|
||||
|
||||
#ifdef _EMI
|
||||
EXT EMI_TypeDef *EMI;
|
||||
#endif
|
||||
|
||||
#ifdef _FLASH
|
||||
EXT FLASHR_TypeDef *FLASHR;
|
||||
EXT FLASHPR_TypeDef *FLASHPR;
|
||||
#endif
|
||||
|
||||
#ifdef _GPIO
|
||||
#ifdef _GPIO0
|
||||
EXT GPIO_TypeDef *GPIO0;
|
||||
#endif
|
||||
#ifdef _GPIO1
|
||||
EXT GPIO_TypeDef *GPIO1;
|
||||
#endif
|
||||
#ifdef _GPIO2
|
||||
EXT GPIO_TypeDef *GPIO2;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _I2C
|
||||
#ifdef _I2C0
|
||||
EXT I2C_TypeDef *I2C0;
|
||||
#endif
|
||||
#ifdef _I2C1
|
||||
EXT I2C_TypeDef *I2C1;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _PCU
|
||||
EXT PCU_TypeDef *PCU;
|
||||
#endif
|
||||
|
||||
#ifdef _RCCU
|
||||
EXT RCCU_TypeDef *RCCU;
|
||||
#endif
|
||||
|
||||
#ifdef _RTC
|
||||
EXT RTC_TypeDef *RTC;
|
||||
#endif
|
||||
|
||||
#ifdef _TIM
|
||||
#ifdef _TIM0
|
||||
EXT TIM_TypeDef *TIM0;
|
||||
#endif
|
||||
#ifdef _TIM1
|
||||
EXT TIM_TypeDef *TIM1;
|
||||
#endif
|
||||
#ifdef _TIM2
|
||||
EXT TIM_TypeDef *TIM2;
|
||||
#endif
|
||||
#ifdef _TIM3
|
||||
EXT TIM_TypeDef *TIM3;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _UART
|
||||
#ifdef _UART0
|
||||
EXT UART_TypeDef *UART0;
|
||||
#endif
|
||||
#ifdef _UART1
|
||||
EXT UART_TypeDef *UART1;
|
||||
#endif
|
||||
#ifdef _UART2
|
||||
EXT UART_TypeDef *UART2;
|
||||
#endif
|
||||
#ifdef _UART3
|
||||
EXT UART_TypeDef *UART3;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _USB
|
||||
EXT USB_TypeDef *USB;
|
||||
#endif
|
||||
|
||||
#ifdef _WDG
|
||||
EXT WDG_TypeDef *WDG;
|
||||
#endif
|
||||
|
||||
#ifdef _XTI
|
||||
EXT XTI_TypeDef *XTI;
|
||||
#endif
|
||||
|
||||
#ifdef _IRQVectors
|
||||
EXT IRQVectors_TypeDef *IRQVectors;
|
||||
#endif
|
||||
|
||||
#endif /* DEBUG */
|
||||
|
||||
#endif /* __71x_map_H */
|
||||
|
||||
/******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/
|
50
Demo/ARM7_STR71x_IAR/Library/include/71x_type.h
Normal file
50
Demo/ARM7_STR71x_IAR/Library/include/71x_type.h
Normal file
|
@ -0,0 +1,50 @@
|
|||
/******************** (C) COPYRIGHT 2003 STMicroelectronics ********************
|
||||
* File Name : 71x_type.h
|
||||
* Author : MCD Application Team
|
||||
* Date First Issued : 05/16/2003
|
||||
* Description : Common data types
|
||||
********************************************************************************
|
||||
* History:
|
||||
* 30/11/2004 : V2.0
|
||||
* 14/07/2004 : V1.3
|
||||
* 01/01/2004 : V1.2
|
||||
*******************************************************************************
|
||||
THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH
|
||||
CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
|
||||
AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
|
||||
OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
|
||||
OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
|
||||
CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
||||
*******************************************************************************/
|
||||
#ifndef _71x_type_H
|
||||
#define _71x_type_H
|
||||
|
||||
typedef unsigned long u32;
|
||||
typedef unsigned short u16;
|
||||
typedef unsigned char u8;
|
||||
|
||||
typedef signed long s32;
|
||||
typedef signed short s16;
|
||||
typedef signed char s8;
|
||||
|
||||
typedef volatile unsigned long vu32;
|
||||
typedef volatile unsigned short vu16;
|
||||
typedef volatile unsigned char vu8;
|
||||
|
||||
typedef volatile signed long vs32;
|
||||
typedef volatile signed short vs16;
|
||||
typedef volatile signed char vs8;
|
||||
|
||||
/*===================================================================*/
|
||||
typedef enum { FALSE = 0, TRUE = !FALSE } bool;
|
||||
/*===================================================================*/
|
||||
typedef enum { RESET = 0, SET = !RESET } FlagStatus;
|
||||
/*===================================================================*/
|
||||
typedef enum { DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
|
||||
/*===================================================================*/
|
||||
typedef enum { INDIRECT = 0, DIRECT = !INDIRECT} RegisterAccess;
|
||||
/*===================================================================*/
|
||||
|
||||
#endif /* _71x_type_H */
|
||||
|
||||
/******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/
|
199
Demo/ARM7_STR71x_IAR/Library/include/eic.h
Normal file
199
Demo/ARM7_STR71x_IAR/Library/include/eic.h
Normal file
|
@ -0,0 +1,199 @@
|
|||
/******************** (C) COPYRIGHT 2003 STMicroelectronics ********************
|
||||
* File Name : eic.h
|
||||
* Author : MCD Application Team
|
||||
* Date First Issued : 25/06/2003
|
||||
* Description : This file contains all the functions prototypes for the
|
||||
* EIC software library.
|
||||
********************************************************************************
|
||||
* History:
|
||||
* 30/11/2004 : V2.0
|
||||
* 14/07/2004 : V1.3
|
||||
* 01/01/2004 : V1.2
|
||||
*******************************************************************************
|
||||
THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH
|
||||
CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
|
||||
AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
|
||||
OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
|
||||
OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
|
||||
CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
||||
*******************************************************************************/
|
||||
#ifndef __eic_H
|
||||
#define __eic_H
|
||||
|
||||
#include "71x_map.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
T0TIMI_IRQChannel = 0,
|
||||
FLASH_IRQChannel = 1,
|
||||
RCCU_IRQChannel = 2,
|
||||
RTC_IRQChannel = 3,
|
||||
WDG_IRQChannel = 4,
|
||||
XTI_IRQChannel = 5,
|
||||
USBHP_IRQChannel = 6,
|
||||
I2C0ITERR_IRQChannel = 7,
|
||||
I2C1ITERR_IRQChannel = 8,
|
||||
UART0_IRQChannel = 9,
|
||||
UART1_IRQChannel = 10,
|
||||
UART2_IRQChannel = 11,
|
||||
UART3_IRQChannel = 12,
|
||||
SPI0_IRQChannel = 13,
|
||||
SPI1_IRQChannel = 14,
|
||||
I2C0_IRQChannel = 15,
|
||||
I2C1_IRQChannel = 16,
|
||||
CAN_IRQChannel = 17,
|
||||
ADC_IRQChannel = 18,
|
||||
T1TIMI_IRQChannel = 19,
|
||||
T2TIMI_IRQChannel = 20,
|
||||
T3TIMI_IRQChannel = 21,
|
||||
HDLC_IRQChannel = 25,
|
||||
USBLP_IRQChannel = 26,
|
||||
T0TOI_IRQChannel = 29,
|
||||
T0OC1_IRQChannel = 30,
|
||||
T0OC2_IRQChannel = 31
|
||||
} IRQChannel_TypeDef;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
T0TIMI_FIQChannel = 0x00000001,
|
||||
WDG_FIQChannel = 0x00000002,
|
||||
WDGT0TIMI_FIQChannels = 0x00000003
|
||||
} FIQChannel_TypeDef;
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : EIC_Init
|
||||
* Description : Initialise the EIC using the load PC instruction
|
||||
* (PC = PC +offset)
|
||||
* Input : None
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void EIC_Init(void);
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : EIC_IRQConfig
|
||||
* Description : Enable or Disable IRQ interrupts
|
||||
* Input 1 : New status : can be ENABLE or DISABLE
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void EIC_IRQConfig(FunctionalState NewState)
|
||||
{
|
||||
if (NewState==ENABLE) EIC->ICR |= 0x0001; else EIC->ICR &= ~0x0001;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : EIC_FIQConfig
|
||||
* Description : Enable or Disable FIQ interrupts
|
||||
* Input 1 : New status : can be ENABLE or DISABLE
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void EIC_FIQConfig(FunctionalState NewState)
|
||||
{
|
||||
if (NewState==ENABLE) EIC->ICR |= 0x0002; else EIC->ICR &= ~0x0002;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : EIC_IRQChannelConfig
|
||||
* Description : Configure the IRQ Channel
|
||||
* Input 1 : IRQ channel name
|
||||
* Input 2 : Channel New status : can be ENABLE or DISABLE
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void EIC_IRQChannelConfig(IRQChannel_TypeDef IRQChannel, FunctionalState NewState)
|
||||
{
|
||||
if (NewState==ENABLE) EIC->IER |= 0x0001 << IRQChannel;
|
||||
else EIC->IER &= ~(0x0001 << IRQChannel);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : EIC_FIQChannelConfig
|
||||
* Description : Configure the FIQ Channel
|
||||
* Input 1 : FIQ channel name
|
||||
* Input 2 : Channel New status : can be ENABLE or DISABLE
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void EIC_FIQChannelConfig(FIQChannel_TypeDef FIQChannel,
|
||||
FunctionalState NewState)
|
||||
{
|
||||
if (NewState==ENABLE) EIC->FIR |= FIQChannel;
|
||||
else EIC->FIR &= ~FIQChannel;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : EIC_IRQChannelPriorityConfig
|
||||
* Description : Configure the selected IRQ channel priority
|
||||
* Input 1 : IRQ channel name
|
||||
* Input 2 : IRQ channel priority
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void EIC_IRQChannelPriorityConfig(IRQChannel_TypeDef IRQChannel, u8 Priority)
|
||||
{
|
||||
EIC->SIR[IRQChannel] = (EIC->SIR[IRQChannel]&0xFFFF0000) | (u16)Priority & 0x000F;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : EIC_CurrentPriorityLevelConfig
|
||||
* Description : Change the current priority level of the srved IRQ routine
|
||||
* Input 1 : New priority
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void EIC_CurrentPriorityLevelConfig(u8 NewPriorityLevel);
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : EIC_CurrentPriorityLevelValue
|
||||
* Description : Return the current priority level of the current served IRQ
|
||||
* routine
|
||||
* Input : None
|
||||
* Output : None
|
||||
* Return : The current priority level
|
||||
*******************************************************************************/
|
||||
inline u8 EIC_CurrentPriorityLevelValue(void)
|
||||
{
|
||||
return EIC->CIPR & 0xF;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : EIC_CurrentIRQChannelValue
|
||||
* Description : Return the current served IRQ channel number
|
||||
* Input 0 : None
|
||||
* Output : None
|
||||
* Return : The current served IRQ channel number
|
||||
*******************************************************************************/
|
||||
inline IRQChannel_TypeDef EIC_CurrentIRQChannelValue(void)
|
||||
{
|
||||
return (IRQChannel_TypeDef)(EIC->CICR & 0x1F);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : EIC_CurrentFIQChannelValue
|
||||
* Description : Return the current served FIQ channel number
|
||||
* Input : None
|
||||
* Output : None
|
||||
* Return : The current served FIQ channel number
|
||||
*******************************************************************************/
|
||||
inline FIQChannel_TypeDef EIC_CurrentFIQChannelValue(void)
|
||||
{
|
||||
return (FIQChannel_TypeDef)((EIC->FIR >> 2) & 0x0003);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : EIC_FIPendingBitClear
|
||||
* Description : Clear the FIQ pending bit
|
||||
* Input 1 : FIQ channel
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void EIC_FIQPendingBitClear(FIQChannel_TypeDef FIQChannel)
|
||||
{
|
||||
EIC->FIR = (EIC->FIR & 0x0003) | (FIQChannel << 2);
|
||||
}
|
||||
|
||||
#endif /* __eic_H */
|
||||
|
||||
/******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/
|
126
Demo/ARM7_STR71x_IAR/Library/include/gpio.h
Normal file
126
Demo/ARM7_STR71x_IAR/Library/include/gpio.h
Normal file
|
@ -0,0 +1,126 @@
|
|||
/******************** (C) COPYRIGHT 2003 STMicroelectronics ********************
|
||||
* File Name : gpio.h
|
||||
* Author : MCD Application Team
|
||||
* Date First Issued : 08/06/2003
|
||||
* Description : This file contains all the functions prototypes for the
|
||||
* GPIO software library.
|
||||
********************************************************************************
|
||||
* History:
|
||||
* 30/11/2004 : V2.0
|
||||
* 14/07/2004 : V1.3
|
||||
* 01/01/2004 : V1.2
|
||||
*******************************************************************************
|
||||
THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH
|
||||
CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
|
||||
AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
|
||||
OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
|
||||
OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
|
||||
CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
||||
*******************************************************************************/
|
||||
#ifndef __gpio_H
|
||||
#define __gpio_H
|
||||
|
||||
#include "71x_map.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GPIO_HI_AIN_TRI,
|
||||
GPIO_IN_TRI_TTL,
|
||||
GPIO_IN_TRI_CMOS,
|
||||
GPIO_IPUPD_WP,
|
||||
GPIO_OUT_OD,
|
||||
GPIO_OUT_PP,
|
||||
GPIO_AF_OD,
|
||||
GPIO_AF_PP
|
||||
} GpioPinMode_TypeDef;
|
||||
|
||||
#define GPIO_LSB 0x00
|
||||
#define GPIO_MSB 0x08
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : GPIO_Config
|
||||
* Description : Configure the GPIO port pins
|
||||
* Input 1 : GPIOx (x can be 0,1 or 2) the desired port
|
||||
* Input 2 : Port_Pins : pins placements
|
||||
* Input 3 : Pins Mode
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void GPIO_Config (GPIO_TypeDef *GPIOx, u16 Port_Pins, GpioPinMode_TypeDef GPIO_Mode);
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : GPIO_BitRead
|
||||
* Description : Read the desired port pin value
|
||||
* Input 1 : Selected GPIO port
|
||||
* Input 2 : Pin number
|
||||
* Output : None
|
||||
* Return : The selected pin value
|
||||
*******************************************************************************/
|
||||
inline u8 GPIO_BitRead(GPIO_TypeDef *GPIOx, u8 Port_Pin)
|
||||
{
|
||||
return (GPIOx->PD >> Port_Pin) & 0x0001;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : GPIO_ByteRead
|
||||
* Description : Read the desired port Byte value
|
||||
* Input 1 : Selected GPIO port
|
||||
* Input 2 : GPIO_MSB or GPIO_LSB
|
||||
* Output : None
|
||||
* Return : The GPIO_MSB or GPIO_LSB of the selected PD register
|
||||
*******************************************************************************/
|
||||
inline u8 GPIO_ByteRead(GPIO_TypeDef *GPIOx, u8 Port_Byte)
|
||||
{
|
||||
return (u8)(GPIOx->PD >> Port_Byte);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : GPIO_WordRead
|
||||
* Description : Read the desired port word value
|
||||
* Input 1 : Selected GPIO port
|
||||
* Output : None
|
||||
* Return : The selected PD register value
|
||||
*******************************************************************************/
|
||||
inline u16 GPIO_WordRead(GPIO_TypeDef *GPIOx)
|
||||
{
|
||||
return GPIOx->PD;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : GPIO_BitWrite
|
||||
* Description : Set or reset the selected port pin
|
||||
* Input 1 : Selected GPIO port
|
||||
* Input 2 : Pin number
|
||||
* Input 3 : bit value
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void GPIO_BitWrite(GPIO_TypeDef *GPIOx, u8 Port_Pin, u8 Port_Val);
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : GPIO_ByteWrite
|
||||
* Description : Write byte value to the selected PD register
|
||||
* Input 1 : Selected GPIO port
|
||||
* Input 2 : GPIO_MSB or GPIO_LSB
|
||||
* Input 3 : Byte value
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void GPIO_ByteWrite(GPIO_TypeDef *GPIOx, u8 Port_Byte, u8 Port_Val);
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : GPIO_WordWrite
|
||||
* Description : Write word value to the selected PD register
|
||||
* Input 1 : Selected GPIO port
|
||||
* Input 2 : Value
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void GPIO_WordWrite(GPIO_TypeDef *GPIOx, u16 Port_Val)
|
||||
{
|
||||
GPIOx->PD = Port_Val;
|
||||
}
|
||||
|
||||
#endif /* __gpio_H */
|
||||
|
||||
/******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/
|
193
Demo/ARM7_STR71x_IAR/Library/include/pcu.h
Normal file
193
Demo/ARM7_STR71x_IAR/Library/include/pcu.h
Normal file
|
@ -0,0 +1,193 @@
|
|||
/******************** (C) COPYRIGHT 2003 STMicroelectronics ********************
|
||||
* File Name : pcu.h
|
||||
* Author : MCD Application Team
|
||||
* Date First Issued : 30/05/2003
|
||||
* Description : This file contains all the functions prototypes for the
|
||||
* PCU software library.
|
||||
********************************************************************************
|
||||
* History:
|
||||
* 30/11/2004 : V2.0
|
||||
* 14/07/2004 : V1.3
|
||||
* 01/01/2004 : V1.2
|
||||
*******************************************************************************
|
||||
THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH
|
||||
CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
|
||||
AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
|
||||
OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
|
||||
OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
|
||||
CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
||||
*******************************************************************************/
|
||||
#ifndef __PCU_H
|
||||
#define __PCU_H
|
||||
|
||||
#include "71x_map.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
PCU_WREN = 0x8000,
|
||||
PCU_VROK = 0x1000
|
||||
} PCU_Flags;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
PCU_STABLE,
|
||||
PCU_UNSTABLE
|
||||
} PCU_VR_Status;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
PCU_MVR = 0x0008,
|
||||
PCU_LPR = 0x0020
|
||||
} PCU_VR;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
WFI_CLOCK2_16,
|
||||
WFI_EXTERNAL
|
||||
} WFI_CLOCKS;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
PCU_SLOW,
|
||||
PCU_STOP,
|
||||
PCU_STANDBY
|
||||
} LPM_MODES;
|
||||
|
||||
|
||||
// VR_OK : Voltage Regulator OK
|
||||
#define PCU_VROK_Mask 0x1000
|
||||
|
||||
// Main Voltage Regulator
|
||||
#define PCU_MVR_Mask 0x0008
|
||||
|
||||
// Low Power Voltage Regulator
|
||||
#define PCU_LPR_Mask 0x0020
|
||||
|
||||
// PCU register Write Enable Bit
|
||||
#define PCU_WREN_Mask 0x8000
|
||||
|
||||
// Low Voltage Detector
|
||||
#define PCU_LVD_Mask 0x0100
|
||||
|
||||
// Power Down Flag
|
||||
#define PCU_PWRDWN_Mask 0x0040
|
||||
|
||||
// WFI Mode Clock Selection Bit
|
||||
#define PCU_WFI_CKSEL_Mask 0x00000002
|
||||
|
||||
// Halt Mode Enable Bit
|
||||
#define PCU_EN_HALT_Mask 0x00000800
|
||||
|
||||
// Halt Mode Flag
|
||||
#define PCU_HALT_Mask 0x0002
|
||||
|
||||
// Stop Mode Enable Bit
|
||||
#define PCU_STOP_EN_Mask 0x00000400
|
||||
|
||||
// Low Power Regulator in Wait For interrupt Mode
|
||||
#define PCU_LPRWFI_Mask 0x0020
|
||||
|
||||
// Low Power Mode in Wait For interrupt Mode
|
||||
#define PCU_LPOWFI_Mask 0x00000001
|
||||
|
||||
// Software Reset Enable
|
||||
#define PCU_SRESEN_Mask 0x00000001
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : PCU_MVRStatus
|
||||
* Description : This routine is used to check the Main Voltage Regulator
|
||||
* : NewState.
|
||||
* Input : None
|
||||
* Return : STABLE, UNSTABLE
|
||||
*******************************************************************************/
|
||||
inline PCU_VR_Status PCU_MVRStatus ( void )
|
||||
{
|
||||
return (PCU->PWRCR & PCU_VROK_Mask) == 0x00 ? PCU_UNSTABLE : PCU_STABLE;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : PCU_FlagStatus
|
||||
* Description : This routine is used to return the PCU register flag
|
||||
* Input 1 : The flag to get
|
||||
* Return : RESET, SET
|
||||
*******************************************************************************/
|
||||
inline FlagStatus PCU_FlagStatus ( PCU_Flags Xflag )
|
||||
{
|
||||
return ( PCU->PWRCR & Xflag ) == 0x00 ? RESET : SET;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : PCU_VRConfig
|
||||
* Description : This routine is used to configure PCU voltage regultors
|
||||
* Input 1 : MVR : Main voltage Regulator
|
||||
LPR : Low Power Regulator
|
||||
* Input 2 : ENABLE : Enable the Voltage Regulator
|
||||
DISABLE: Disable ( ByPass ) the VR
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void PCU_VRConfig ( PCU_VR xVR, FunctionalState NewState );
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : PCU_VRStatus
|
||||
* Description : This routine is used to get the PCU voltage regultors status
|
||||
* Input : MVR : Main voltage Regulator
|
||||
LPR : Low Power Regulator
|
||||
* Return : ENABLE : Enable the Voltage Regulator
|
||||
DISABLE: Disable ( ByPass ) the VR
|
||||
*******************************************************************************/
|
||||
inline FunctionalState PCU_VRStatus ( PCU_VR xVR )
|
||||
{
|
||||
return ( PCU->PWRCR & xVR ) == 0 ? ENABLE : DISABLE;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : PCU_LVDDisable
|
||||
* Description : This routine is used to disable the Low Voltage Detector.
|
||||
* Input : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void PCU_LVDDisable ( void )
|
||||
{
|
||||
PCU->PWRCR |= PCU_WREN_Mask; // Unlock Power Control Register
|
||||
PCU->PWRCR |= PCU_LVD_Mask; // Set the LVD DIS Flag
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : PCU_LVDStatus
|
||||
* Description : This routine is used to get the LVD NewState.
|
||||
* Input : None
|
||||
* Return : ENABLE, DISABLE
|
||||
*******************************************************************************/
|
||||
inline FunctionalState PCU_LVDStatus ( void )
|
||||
{
|
||||
return ( PCU->PWRCR & PCU_LVD_Mask ) == 0 ? ENABLE : DISABLE;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : PCU_WFIEnter
|
||||
* Description : This routine is used to force the Device to enter in WFI mode
|
||||
* Input 1 : CLOCK2_16 : Clock2_16 as system clock for WFI mode
|
||||
* EXTERNAL : external clock as system clock for WFI mode
|
||||
* Input 2 : ENABLE : Enable Low Power Regulator during Wait For Interrupt Mode
|
||||
* DISABLE: Disable Low Power Regulator during Wait For Interrupt Mode
|
||||
* Input 3 : ENABLE : Enable Low Power Mode during Wait For Interrupt Mode
|
||||
* DISABLE: Disable Low Power Mode during Wait For Interrupt Mode
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void PCU_WFIEnter ( WFI_CLOCKS Xclock, FunctionalState Xlpr, FunctionalState Xlpm );
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : PCU_LPMEnter
|
||||
* Description : This routine is used to force the Device to enter low
|
||||
* power mode
|
||||
* Input : SLOW : Slow Mode
|
||||
STOP : Stop Mode
|
||||
HALT : Halt Mode
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void PCU_LPMEnter ( LPM_MODES Xmode);
|
||||
|
||||
#endif // __PCU_H
|
||||
|
||||
/******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/
|
319
Demo/ARM7_STR71x_IAR/Library/include/rccu.h
Normal file
319
Demo/ARM7_STR71x_IAR/Library/include/rccu.h
Normal file
|
@ -0,0 +1,319 @@
|
|||
/******************** (C) COPYRIGHT 2003 STMicroelectronics ********************
|
||||
* File Name : rccu.h
|
||||
* Author : MCD Application Team
|
||||
* Date First Issued : 28/07/2003
|
||||
* Description : This file contains all the functions prototypes for the
|
||||
* RCCU software library.
|
||||
********************************************************************************
|
||||
* History:
|
||||
* 30/11/2004 : V2.0
|
||||
* 14/07/2004 : V1.3
|
||||
* 01/01/2004 : V1.2
|
||||
*******************************************************************************
|
||||
THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH
|
||||
CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
|
||||
AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
|
||||
OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
|
||||
OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
|
||||
CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef __RCCU_H
|
||||
#define __RCCU_H
|
||||
|
||||
#include "71x_map.h"
|
||||
|
||||
typedef enum {
|
||||
RCCU_DEFAULT=0x00,
|
||||
RCCU_RCLK_2 =0x01,
|
||||
RCCU_RCLK_4 =0x02,
|
||||
RCCU_RCLK_8 =0x03
|
||||
} RCCU_Clock_Div;
|
||||
|
||||
typedef enum {
|
||||
RCCU_PLL1_Output,
|
||||
RCCU_CLOCK2_16,
|
||||
RCCU_CLOCK2,
|
||||
RCCU_RTC_CLOCK
|
||||
} RCCU_RCLK_Clocks;
|
||||
|
||||
|
||||
typedef enum {
|
||||
RCCU_PLL1_Mul_12=0x01,
|
||||
RCCU_PLL1_Mul_16=0x03,
|
||||
RCCU_PLL1_Mul_20=0x00,
|
||||
RCCU_PLL1_Mul_24=0x02
|
||||
} RCCU_PLL1_Mul;
|
||||
|
||||
typedef enum {
|
||||
RCCU_PLL2_Mul_12=0x01,
|
||||
RCCU_PLL2_Mul_16=0x03,
|
||||
RCCU_PLL2_Mul_20=0x00,
|
||||
RCCU_PLL2_Mul_28=0x02
|
||||
} RCCU_PLL2_Mul;
|
||||
|
||||
typedef enum {
|
||||
RCCU_Div_1=0x00,
|
||||
RCCU_Div_2=0x01,
|
||||
RCCU_Div_3=0x02,
|
||||
RCCU_Div_4=0x03,
|
||||
RCCU_Div_5=0x04,
|
||||
RCCU_Div_6=0x05,
|
||||
RCCU_Div_7=0x06
|
||||
} RCCU_PLL_Div;
|
||||
|
||||
typedef enum {
|
||||
RCCU_PLL2_Output = 0x01,
|
||||
RCCU_USBCK = 0x00
|
||||
} RCCU_USB_Clocks;
|
||||
|
||||
typedef enum {
|
||||
RCCU_CLK2,
|
||||
RCCU_RCLK,
|
||||
RCCU_MCLK,
|
||||
RCCU_PCLK,
|
||||
RCCU_FCLK
|
||||
} RCCU_Clocks;
|
||||
|
||||
typedef enum {
|
||||
RCCU_PLL1_LOCK_IT = 0x0080,
|
||||
RCCU_CKAF_IT = 0x0100,
|
||||
RCCU_CK2_16_IT = 0x0200,
|
||||
RCCU_STOP_IT = 0x0400
|
||||
} RCCU_Interrupts;
|
||||
|
||||
typedef enum {
|
||||
RCCU_PLL1_LOCK = 0x0002,
|
||||
RCCU_CKAF_ST = 0x0004,
|
||||
RCCU_PLL1_LOCK_I = 0x0800,
|
||||
RCCU_CKAF_I = 0x1000,
|
||||
RCCU_CK2_16_I = 0x2000,
|
||||
RCCU_STOP_I = 0x4000
|
||||
} RCCU_Flags;
|
||||
|
||||
typedef enum {
|
||||
RCCU_ExternalReset = 0x00000000,
|
||||
RCCU_SoftwareReset = 0x00000020,
|
||||
RCCU_WDGReset = 0x00000040,
|
||||
RCCU_RTCAlarmReset = 0x00000080,
|
||||
RCCU_LVDReset = 0x00000200,
|
||||
RCCU_WKPReset = 0x00000400
|
||||
}RCCU_ResetSources;
|
||||
|
||||
|
||||
#define RCCU_Div2_Mask 0x00008000
|
||||
#define RCCU_Div2_Index 0x0F
|
||||
#define RCCU_FACT_Mask 0x0003
|
||||
|
||||
#define RCCU_FACT1_Mask 0x0003
|
||||
|
||||
#define RCCU_FACT2_Mask 0x0300
|
||||
#define RCCU_FACT2_Index 0x08
|
||||
|
||||
#define RCCU_MX_Mask 0x00000030
|
||||
#define RCCU_MX_Index 0x04
|
||||
|
||||
#define RCCU_DX_Mask 0x00000007
|
||||
|
||||
#define RCCU_FREEN_Mask 0x00000080
|
||||
|
||||
#define RCCU_CSU_CKSEL_Mask 0x00000001
|
||||
|
||||
#define RCCU_CK2_16_Mask 0x00000008
|
||||
|
||||
#define RCCU_CKAF_SEL_Mask 0x00000004
|
||||
|
||||
#define RCCU_LOCK_Mask 0x00000002
|
||||
|
||||
#define RCCU_USBEN_Mask 0x0100
|
||||
#define RCCU_USBEN_Index 0x08
|
||||
#define RCCU_ResetSources_Mask 0x000006E0
|
||||
|
||||
// RTC Oscillator Frequency value = 32 768 Hz
|
||||
#define RCCU_RTC_Osc 32768
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : RCCU_Div2Config
|
||||
* Description : Enables/Disables the clock division by two
|
||||
* Input : NewState : ENABLE or DISABLE
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void RCCU_Div2Config ( FunctionalState NewState )
|
||||
{
|
||||
if (NewState == ENABLE) RCCU->CFR |= RCCU_Div2_Mask;
|
||||
else RCCU->CFR &= ~RCCU_Div2_Mask;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : RCCU_Div2Status
|
||||
* Description : Gets the Div2 Flag status
|
||||
* Input : None
|
||||
* Input : FlagStatus
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline FlagStatus RCCU_Div2Status ( void )
|
||||
{
|
||||
return (RCCU->CFR & RCCU_Div2_Mask) == 0 ? RESET : SET;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : RCCU_MCLKConfig
|
||||
* Description : Selects the division factor for RCLK to obtain the
|
||||
* MCLK clock for the CPU
|
||||
* Input : New_Clock : RCCU_DEFAULT, RCCU_RCLK_2, RCCU_RCLK_4, RCCU_RCLK_8
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void RCCU_MCLKConfig ( RCCU_Clock_Div New_Clock )
|
||||
{
|
||||
PCU->MDIVR = ( PCU->MDIVR & ~RCCU_FACT_Mask ) | New_Clock;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : RCCU_FCLKConfig
|
||||
* Description : Selects the division factor for RCLK to obtain the
|
||||
* FCLK clock for the APB1 fast peripherals (PCLK1).
|
||||
* Input : New_Clock : RCCU_DEFAULT, RCCU_RCLK_2,
|
||||
* RCCU_RCLK_4, RCCU_RCLK_8
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void RCCU_FCLKConfig ( RCCU_Clock_Div New_Clock )
|
||||
{
|
||||
PCU->PDIVR = ( PCU->PDIVR & ~RCCU_FACT1_Mask ) | New_Clock;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : RCCU_PCLKConfig
|
||||
* Description : Selects the division factor for RCLK to obtain the
|
||||
* PCLK clock for the APB2 peripherals (PCLK2).
|
||||
* Input : New_Clock : RCCU_DEFAULT, RCCU_RCLK_2,
|
||||
* RCCU_RCLK_4, RCCU_RCLK_8
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void RCCU_PCLKConfig ( RCCU_Clock_Div New_Clock )
|
||||
{
|
||||
PCU->PDIVR =(PCU->PDIVR & ~RCCU_FACT2_Mask)|(New_Clock << RCCU_FACT2_Index);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : RCCU_PLL1Config
|
||||
* Description : Configures the PLL1 div & mul factors.
|
||||
* Input : New_Mul : RCCU_Mul_12, RCCU_Mul_16, RCCU_Mul_20, RCCU_Mul_28
|
||||
* : New_Div : RCCU_Div_1, RCCU_Div_2, RCCU_Div_3,
|
||||
* RCCU_Div_4, RCCU_Div_5, RCCU_Div_6, RCCU_Div_7
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void RCCU_PLL1Config ( RCCU_PLL1_Mul New_Mul, RCCU_PLL_Div New_Div );
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : RCCU_PLL2Config
|
||||
* Description : Configures the PLL2 div & mul factors.
|
||||
* Input : New_Mul : RCCU_Mul_12, RCCU_Mul_16, RCCU_Mul_20, RCCU_Mul_28
|
||||
* : New_Div : RCCU_Div_1, RCCU_Div_2, RCCU_Div_3, RCCU_Div_4,
|
||||
* RCCU_Div_5, RCCU_Div_6, RCCU_Div_7
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void RCCU_PLL2Config ( RCCU_PLL2_Mul New_Mul, RCCU_PLL_Div New_Div );
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : RCCU_RCLKSourceConfig
|
||||
* Description : Selects the RCLK source clock
|
||||
* Input : New_Clock : RCCU_PLL1_OutPut, RCCU_CLOCK2_16, RCCU_CLOCK2
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void RCCU_RCLKSourceConfig ( RCCU_RCLK_Clocks New_Clock );
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : RCCU_RCLKClockSource
|
||||
* Description : Returns the current RCLK source clock
|
||||
* Input : None
|
||||
* Return : RCCU_PLL1_Output, RCCU_CLOCK2_16, RCCU_CLOCK2
|
||||
*******************************************************************************/
|
||||
RCCU_RCLK_Clocks RCCU_RCLKClockSource ( void );
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : RCCU_USBCLKConfig
|
||||
* Description : Selects the USB source clock
|
||||
* Input : New_Clock : RCCU_PLL2_Output, RCCU_USBCK
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void RCCU_USBCLKConfig ( RCCU_USB_Clocks New_Clock )
|
||||
{
|
||||
PCU->PLL2CR = (PCU->PLL2CR & ~RCCU_USBEN_Mask)|(New_Clock << RCCU_USBEN_Index);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : RCCU_USBClockSource
|
||||
* Description : Gets the USB source clock
|
||||
* Input : None
|
||||
* Return : RCCU_USB_Clocks
|
||||
*******************************************************************************/
|
||||
RCCU_USB_Clocks RCCU_USBClockSource ( void );
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : RCCU_FrequencyValue
|
||||
* Description : Calculates & Returns any internal RCCU clock freuqency
|
||||
* passed in parametres
|
||||
* Input : RCCU_Clocks : RCCU_CLK2, RCCU_RCLK, RCCU_MCLK,
|
||||
* RCCU_PCLK, RCCU_FCLK
|
||||
* Return : u32
|
||||
*******************************************************************************/
|
||||
u32 RCCU_FrequencyValue ( RCCU_Clocks Internal_Clk );
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : RCCU_ITConfig
|
||||
* Description : Configures the RCCU interrupts
|
||||
* Input : RCCU interrupts : RCCU_CK2_16_IT, RCCU_CKAF_IT,
|
||||
* RCCU_PLL1_LOCK_IT
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void RCCU_ITConfig ( RCCU_Interrupts RCCU_IT, FunctionalState NewState)
|
||||
{
|
||||
if (NewState == ENABLE) RCCU->CCR |= RCCU_IT; else RCCU->CCR &= ~RCCU_IT;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : RCCU_FlagStatus
|
||||
* Description : Checks the RCCU clock flag register status
|
||||
* Input : RCCU Flags : RCCU_CK2_16, RCCU_CKAF, RCCU_PLL1_LOCK
|
||||
* Return : FlagStatus : SET or RESET
|
||||
*******************************************************************************/
|
||||
inline FlagStatus RCCU_FlagStatus ( RCCU_Flags RCCU_flag )
|
||||
{
|
||||
return (RCCU->CFR & RCCU_flag) == 0 ? RESET : SET;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : RCCU_FlagClear
|
||||
* Description : Clears a specified flag in the RCCU registers
|
||||
* Input : RCCU Flags : RCCU_CK2_16, RCCU_CKAF, RCCU_PLL1_LOCK
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void RCCU_FlagClear ( RCCU_Interrupts RCCU_IT )
|
||||
{
|
||||
RCCU->CFR |= RCCU_IT;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : RCCU_ResetSources
|
||||
* Description : Return the source of the system reset
|
||||
* Input : None
|
||||
* Return : The reset source
|
||||
*******************************************************************************/
|
||||
inline RCCU_ResetSources RCCU_ResetSource ()
|
||||
{
|
||||
|
||||
switch(RCCU->CFR & RCCU_ResetSources_Mask)
|
||||
{
|
||||
case 0x00000020: return RCCU_SoftwareReset;
|
||||
case 0x00000040: return RCCU_WDGReset;
|
||||
case 0x00000080: return RCCU_RTCAlarmReset;
|
||||
case 0x00000200: return RCCU_LVDReset;
|
||||
case 0x00000400: return RCCU_WKPReset;
|
||||
default : return RCCU_ExternalReset;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __RCCU_H
|
||||
|
||||
/******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/
|
345
Demo/ARM7_STR71x_IAR/Library/include/tim.h
Normal file
345
Demo/ARM7_STR71x_IAR/Library/include/tim.h
Normal file
|
@ -0,0 +1,345 @@
|
|||
/******************** (C) COPYRIGHT 2003 STMicroelectronics ********************
|
||||
* File Name : tim.h
|
||||
* Author : MCD Application Team
|
||||
* Date First Issued : 08/09/2003
|
||||
* Description : This file contains all the functions prototypes for the
|
||||
* TIM software library.
|
||||
********************************************************************************
|
||||
* History:
|
||||
* 30/11/2004 : V2.0
|
||||
* 14/07/2004 : V1.3
|
||||
* 01/01/2004 : V1.2
|
||||
*******************************************************************************
|
||||
THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH
|
||||
CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
|
||||
AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
|
||||
OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
|
||||
OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
|
||||
CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef __TIM_H
|
||||
#define __TIM_H
|
||||
|
||||
#include "71x_map.h"
|
||||
|
||||
typedef enum { TIM_EXTERNAL,
|
||||
TIM_INTERNAL
|
||||
} TIM_Clocks;
|
||||
|
||||
typedef enum { TIM_RISING,
|
||||
TIM_FALLING
|
||||
} TIM_Clock_Edges;
|
||||
|
||||
typedef enum { TIM_CHANNEL_A,
|
||||
TIM_CHANNEL_B
|
||||
} TIM_Channels;
|
||||
|
||||
typedef enum { TIM_WITH_IT,
|
||||
TIM_WITHOUT_IT
|
||||
} TIM_IT_Mode;
|
||||
|
||||
typedef enum { TIM_TIMING,
|
||||
TIM_WAVE
|
||||
} TIM_OC_Modes;
|
||||
|
||||
typedef enum { TIM_HIGH,
|
||||
TIM_LOW
|
||||
} TIM_Logic_Levels;
|
||||
|
||||
typedef enum { TIM_START,
|
||||
TIM_STOP,
|
||||
TIM_CLEAR
|
||||
} TIM_CounterOperations;
|
||||
|
||||
typedef enum { TIM_ICFA = 0x8000,
|
||||
TIM_OCFA = 0x4000,
|
||||
TIM_TOF = 0x2000,
|
||||
TIM_ICFB = 0x1000,
|
||||
TIM_OCFB = 0x0800
|
||||
} TIM_Flags;
|
||||
|
||||
typedef struct { u16 Pulse;
|
||||
u16 Period;
|
||||
} PWMI_parameters;
|
||||
|
||||
#define TIM_ECKEN_Mask 0x0001
|
||||
#define TIM_EXEDG_Mask 0x0002
|
||||
|
||||
#define TIM_IEDGA_Mask 0x0004
|
||||
#define TIM_IEDGB_Mask 0x0008
|
||||
|
||||
#define TIM_PWM_Mask 0x0010
|
||||
|
||||
#define TIM_OMP_Mask 0x0020
|
||||
|
||||
#define TIM_OCAE_Mask 0x0040
|
||||
#define TIM_OCBE_Mask 0x0080
|
||||
|
||||
#define TIM_OLVLA_Mask 0x0100
|
||||
#define TIM_OLVLB_Mask 0x0200
|
||||
|
||||
#define TIM_FOLVA_Mask 0x0400
|
||||
#define TIM_FOLVB_Mask 0x0800
|
||||
|
||||
#define TIM_PWMI_Mask 0x4000
|
||||
|
||||
#define TIM_EN_Mask 0x8000
|
||||
|
||||
#define TIM_OCBIE_mask 0x0800
|
||||
#define TIM_ICBIE_Mask 0x1000
|
||||
#define TIM_TOE_Mask 0x2000
|
||||
#define TIM_ICAIE_Mask 0x8000
|
||||
#define TIM_OCAIE_mask 0x4000
|
||||
|
||||
#define TIM_ICA_IT 0x8000 // Input Capture Channel A
|
||||
#define TIM_OCA_IT 0x4000 // Output Compare Channel A
|
||||
#define TIM_TO_IT 0x2000 // Timer OverFlow
|
||||
#define TIM_ICB_IT 0x1000 // Input Capture Channel B
|
||||
#define TIM_OCB_IT 0x0800 // Input Capture Channel A
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : TIM_Init
|
||||
* Description : This routine is used to Initialize the TIM peripheral
|
||||
* Input : TIM Timer to Initialize
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void TIM_Init( TIM_TypeDef *TIMx );
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : TIM_ClockSourceConfig
|
||||
* Description : This routine is used to configure the TIM clock source
|
||||
* Input : (1) TIM Timer
|
||||
* : (2) TIM_Clocks : Specifies the TIM source clock
|
||||
* - TIM_INTERNAL : The TIM is clocked by the APB2 frequency
|
||||
* divided by the prescaler value.
|
||||
* - TIM_EXTERNAL : The TIM is clocked by an external Clock
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void TIM_ClockSourceConfig ( TIM_TypeDef *TIMx, TIM_Clocks Xclock )
|
||||
{
|
||||
if (Xclock==TIM_EXTERNAL) TIMx->CR1|=TIM_ECKEN_Mask; else TIMx->CR1&=~TIM_ECKEN_Mask;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : TIM_ClockSourceValue
|
||||
* Description : This routine is used to get the TIM clock source
|
||||
* Input : TIM Timer
|
||||
* Return : TIM_Clocks : Specifies the TIM source clock
|
||||
* - TIM_INTERNAL : The TIM is clocked by the APB2 frequency
|
||||
* divided by the prescaler value.
|
||||
* - TIM_EXTERNAL : The TIM is clocked by an external Clock
|
||||
*******************************************************************************/
|
||||
inline TIM_Clocks TIM_ClockSourceValue ( TIM_TypeDef *TIMx )
|
||||
{
|
||||
return ( TIMx->CR1 & TIM_ECKEN_Mask) == 0 ? TIM_INTERNAL : TIM_EXTERNAL;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : TIM_PrescalerConfig
|
||||
* Description : This routine is used to configure the TIM prescaler value
|
||||
* ( using an internal clock )
|
||||
* Input : (1) TIM Timer
|
||||
* : (2) Prescaler ( u8 )
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void TIM_PrescalerConfig ( TIM_TypeDef *TIMx, u8 Xprescaler )
|
||||
{
|
||||
TIMx->CR2 = ( TIMx->CR2 & 0xFF00 ) | Xprescaler;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : TIM_PrescalerValue
|
||||
* Description : This routine is used to get the TIM prescaler value
|
||||
* ( when using using an internal clock )
|
||||
* Input : TIM Timer
|
||||
* Return : Prescaler ( u8 )
|
||||
*******************************************************************************/
|
||||
inline u8 TIM_PrescalerValue ( TIM_TypeDef *TIMx )
|
||||
{
|
||||
return TIMx->CR2 & 0x00FF;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : TIM_ClockLevelConfig
|
||||
* Description : This routine is used to configure the TIM clock level
|
||||
* ( using an external clock )
|
||||
* Input : TIM Timer
|
||||
* : TIM_Clock_Edges : Specifies the active adge of the external clock
|
||||
* - TIM_RISING : The rising edge
|
||||
* - TIM_FALLING : The falling edge
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void TIM_ClockLevelConfig ( TIM_TypeDef *TIMx, TIM_Clock_Edges Xedge )
|
||||
{
|
||||
if (Xedge == TIM_RISING) TIMx->CR1 |= TIM_EXEDG_Mask; else TIMx->CR1 &= ~TIM_EXEDG_Mask;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : TIM_ClockLevelValue
|
||||
* Description : This routine is used to get the TIM clock level
|
||||
* Input : TIM Timer
|
||||
* Output : TIM_Clock_Edges : Specifies the active adge of the external clock
|
||||
* - TIM_RISING : The rising edge
|
||||
* - TIM_FALLING : The falling edge
|
||||
*******************************************************************************/
|
||||
inline TIM_Clock_Edges TIM_ClockLevelValue ( TIM_TypeDef *TIMx )
|
||||
{
|
||||
return ( TIMx->CR1 & TIM_EXEDG_Mask ) == 0 ? TIM_FALLING : TIM_RISING;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : TIM_ICAPModeConfig
|
||||
* Description : This routine is used to configure the input capture feature
|
||||
* Input : (1) TIM Timer
|
||||
* : (2) Input Capture Channel ( Channel_A or Channel_B )
|
||||
* : (3) Active Edge : Rising edge or Falling edge.
|
||||
* Output : None
|
||||
*******************************************************************************/
|
||||
void TIM_ICAPModeConfig ( TIM_TypeDef *TIMx,
|
||||
TIM_Channels Xchannel,
|
||||
TIM_Clock_Edges Xedge );
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : TIM_ICAPValue
|
||||
* Description : This routine is used to get the Input Capture value
|
||||
* Input : (1) TIM Timer
|
||||
* : (2) Input Capture Channel ( Channel_A or Channel_B )
|
||||
* Output : None
|
||||
*******************************************************************************/
|
||||
inline u16 TIM_ICAPValue ( TIM_TypeDef *TIMx, TIM_Channels Xchannel )
|
||||
{
|
||||
return Xchannel == TIM_CHANNEL_A ? TIMx->ICAR : TIMx->ICBR;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : TIM_OCMPModeConfig
|
||||
* Description : This routine is used to configure the output compare feature
|
||||
* Input : (1) TIM Timer
|
||||
* : (2) OCMP Channel ( Channel_A or Channel_B )
|
||||
* : (3) Pulse Length
|
||||
* : (4) OC_Mode : output wave, or only timing.
|
||||
* : (5) Level : Rising edge or Falling edge after the ==
|
||||
* Output : None
|
||||
*******************************************************************************/
|
||||
void TIM_OCMPModeConfig ( TIM_TypeDef *TIMx,
|
||||
TIM_Channels Xchannel,
|
||||
u16 XpulseLength,
|
||||
TIM_OC_Modes Xmode,
|
||||
TIM_Logic_Levels Xlevel );
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : TIM_OPModeConfig
|
||||
* Description : This routine is used to configure the one pulse mode
|
||||
* Input : (1) TIM Timer
|
||||
* : (3) XpulseLength : Length of the pulse
|
||||
* : (4) Level1 : Level during the pulse
|
||||
* : (5) Level2 : Level after the pulse
|
||||
* : (6) Activation Edge : High or Low on ICAP A
|
||||
* Output : None
|
||||
*******************************************************************************/
|
||||
void TIM_OPModeConfig ( TIM_TypeDef *TIMx,
|
||||
u16 XpulseLength,
|
||||
TIM_Logic_Levels XLevel1,
|
||||
TIM_Logic_Levels XLevel2,
|
||||
TIM_Clock_Edges Xedge );
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : TIM_PWMOModeConfig
|
||||
* Description : This routine is used to configure the PWM in output mode
|
||||
* Input : (1) TIM Timer
|
||||
* : (2) DutyCycle : u16
|
||||
* : (3) Level 1 : During the Duty Cycle
|
||||
* : (4) Level 2 : During the after the pulse
|
||||
* : (5) Full period : u16
|
||||
* Output : None
|
||||
*******************************************************************************/
|
||||
void TIM_PWMOModeConfig ( TIM_TypeDef *TIMx,
|
||||
u16 XDutyCycle,
|
||||
TIM_Logic_Levels XLevel1,
|
||||
u16 XFullperiod,
|
||||
TIM_Logic_Levels XLevel2
|
||||
);
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : TIM_PWMInputConfig
|
||||
* Description : This routine is used to configure the PWM in input mode
|
||||
* Input : (1) TIM Timer
|
||||
* : (2) First Activation Edge
|
||||
* Output : None
|
||||
*******************************************************************************/
|
||||
void TIM_PWMIModeConfig ( TIM_TypeDef *TIMx, TIM_Clock_Edges Xedge );
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : TIM_PWMIValue
|
||||
* Description : This routine is used to get the PWMI values
|
||||
* Input : (1) TIM Timer
|
||||
* Output : PWMI_parameters : - u16 Dyty cycle
|
||||
- u16 Full period
|
||||
*******************************************************************************/
|
||||
PWMI_parameters TIM_PWMIValue (TIM_TypeDef *TIMx );
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : TIM_CounterConfig
|
||||
* Description : This routine is used to start/stop and clear the selected
|
||||
* timer counter
|
||||
* Input : (1) TIM Timer
|
||||
* : (2) TIM_CounterOperations
|
||||
TIM_START Enables or resumes the counter
|
||||
* TIM_STOP Stops the TIM counter
|
||||
* TIM_CLEAR Set the TIM counter value to FFFCh
|
||||
* Output : None
|
||||
*******************************************************************************/
|
||||
void TIM_CounterConfig ( TIM_TypeDef *TIMx, TIM_CounterOperations Xoperation );
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : TIM_ITConfig
|
||||
* Description : This routine is used to configure the TIM IT
|
||||
* Input : (1) TIM Timer
|
||||
* : (2) TIM interrupt
|
||||
* : (2) ENABLE / DISABLE
|
||||
* Output : None
|
||||
*******************************************************************************/
|
||||
inline void TIM_ITConfig ( TIM_TypeDef *TIMx, u16 New_IT, FunctionalState NewState )
|
||||
{
|
||||
if (NewState == ENABLE) TIMx->CR2 |= New_IT; else TIMx->CR2 &= ~New_IT;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : TIM_FlagStatus
|
||||
* Description : This routine is used to check whether a Flag is Set.
|
||||
* Input : (1) TIM Timer
|
||||
* : (2) The TIM FLag
|
||||
* Output : Flag NewState
|
||||
*******************************************************************************/
|
||||
inline FlagStatus TIM_FlagStatus ( TIM_TypeDef *TIMx, TIM_Flags Xflag )
|
||||
{
|
||||
return (TIMx->SR & Xflag) == 0 ? RESET : SET;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : TIM_FlagClear
|
||||
* Description : This routine is used to clear Flags.
|
||||
* Input : (1) TIM Timer
|
||||
* : (2) The TIM FLag
|
||||
* Output : None
|
||||
*******************************************************************************/
|
||||
inline void TIM_FlagClear ( TIM_TypeDef *TIMx, TIM_Flags Xflag )
|
||||
{
|
||||
TIMx->SR &= ~Xflag;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : TIM_CounterValue
|
||||
* Description : This routine returns the timer counter value.
|
||||
* Input : TIM Timer
|
||||
* Output : The counter value
|
||||
*******************************************************************************/
|
||||
inline u16 TIM_CounterValue(TIM_TypeDef *TIMx)
|
||||
{
|
||||
return TIMx->CNTR;
|
||||
}
|
||||
#endif // __TIM_H
|
||||
|
||||
/******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/
|
390
Demo/ARM7_STR71x_IAR/Library/include/uart.h
Normal file
390
Demo/ARM7_STR71x_IAR/Library/include/uart.h
Normal file
|
@ -0,0 +1,390 @@
|
|||
/******************** (C) COPYRIGHT 2003 STMicroelectronics ********************
|
||||
* File Name : uart.h
|
||||
* Author : MCD Application Team
|
||||
* Date First Issued : 16/05/2003
|
||||
* Description : This file contains all the functions prototypes for the
|
||||
* UART software library.
|
||||
********************************************************************************
|
||||
* History:
|
||||
* 30/11/2004 : V2.0
|
||||
* 14/07/2004 : V1.3
|
||||
* 01/01/2004 : V1.2
|
||||
*******************************************************************************
|
||||
THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH
|
||||
CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
|
||||
AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
|
||||
OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
|
||||
OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
|
||||
CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
||||
*******************************************************************************/
|
||||
#ifndef _UART_H
|
||||
#define _UART_H
|
||||
|
||||
#include "71x_map.h"
|
||||
#include "rccu.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
UART_RxFIFO,
|
||||
UART_TxFIFO
|
||||
} UARTFIFO_TypeDef;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
UART_EVEN_PARITY = 0x0000,
|
||||
UART_ODD_PARITY = 0x0020,
|
||||
UART_NO_PARITY
|
||||
} UARTParity_TypeDef;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
UART_0_5_StopBits = 0x00,
|
||||
UART_1_StopBits = 0x08,
|
||||
UART_1_5_StopBits = 0x10,
|
||||
UART_2_StopBits = 0x18
|
||||
} UARTStopBits_TypeDef;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
UARTM_8D = 0x01,
|
||||
UARTM_7D_P = 0x03,
|
||||
UARTM_9D = 0x04,
|
||||
UARTM_8D_W = 0x05,
|
||||
UARTM_8D_P = 0x07
|
||||
} UARTMode_TypeDef;
|
||||
|
||||
|
||||
#define DUMMY 0
|
||||
|
||||
// UART flags definition
|
||||
#define UART_TxFull 0x0200
|
||||
#define UART_RxHalfFull 0x0100
|
||||
#define UART_TimeOutIdle 0x0080
|
||||
#define UART_TimeOutNotEmpty 0x0040
|
||||
#define UART_OverrunError 0x0020
|
||||
#define UART_FrameError 0x0010
|
||||
#define UART_ParityError 0x0008
|
||||
#define UART_TxHalfEmpty 0x0004
|
||||
#define UART_TxEmpty 0x0002
|
||||
#define UART_RxBufFull 0x0001
|
||||
|
||||
// CR regiter bit definition
|
||||
#define UART_FIFOEnableBit 10
|
||||
#define UART_RxEnableBit 8
|
||||
#define UART_RunBit 7
|
||||
#define UART_LoopBackBit 6
|
||||
#define UART_ParityOddBit 5
|
||||
#define UART_StopBits 3
|
||||
|
||||
// Stop bits definition
|
||||
#define UART_05StopBits 0x00
|
||||
#define UART_1StopBit (0x01<<3)
|
||||
#define UART_15StopBits (0x02<<3)
|
||||
#define UART_2StopBits (0x03<<3)
|
||||
|
||||
// Modes definition
|
||||
#define UART_8BitsData 0x01
|
||||
#define UART_7BitsData 0x03
|
||||
#define UART_9BitsData 0x04
|
||||
#define UART_8BitsDataWakeUp 0x05
|
||||
#define UART_8BitsDataParity 0x07
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_Init
|
||||
* Description : This function initializes the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void UART_Init(UART_TypeDef *UARTx);
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_ModeConfig
|
||||
* Description : This function configures the mode of the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : The UART mode
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void UART_ModeConfig(UART_TypeDef *UARTx, UARTMode_TypeDef UART_Mode)
|
||||
{
|
||||
UARTx->CR = (UARTx->CR&0xFFF8)|(u16)UART_Mode;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_BaudRateConfig
|
||||
* Description : This function configures the baud rate of the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : The baudrate value
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void UART_BaudRateConfig(UART_TypeDef *UARTx, u32 BaudRate);
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_ParityConfig
|
||||
* Description : This function configures the data parity of the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : The parity type
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void UART_ParityConfig(UART_TypeDef *UARTx, UARTParity_TypeDef Parity)
|
||||
{
|
||||
UARTx->CR = (UARTx->CR&0xFFDF)|(u16)Parity;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_StopBitsConfig
|
||||
* Description : This function configures the number of stop bits of the
|
||||
* selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : The number of stop bits
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void UART_StopBitsConfig(UART_TypeDef *UARTx, UARTStopBits_TypeDef StopBits)
|
||||
{
|
||||
UARTx->CR = (UARTx->CR&0xFFE7)|(u16)StopBits;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_Config
|
||||
* Description : This function configures the baudrate, the mode, the data
|
||||
* parity and the number of stop bits of the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : The baudrate value
|
||||
* Input 3 : The parity type
|
||||
* Input 4 : The number of stop bits
|
||||
* Input 5 : The UART mode
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void UART_Config(UART_TypeDef *UARTx, u32 BaudRate, UARTParity_TypeDef Parity,
|
||||
UARTStopBits_TypeDef StopBits, UARTMode_TypeDef Mode);
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_ItConfig
|
||||
* Description : This function enables or disables the interrupts of the
|
||||
* selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : The new interrupt flag
|
||||
* Input 3 : ENABLE or DISABLE
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void UART_ItConfig(UART_TypeDef *UARTx, u16 UART_Flag, FunctionalState NewState);
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_FifoConfig
|
||||
* Description : This function enables or disables the Rx and Tx FIFOs of
|
||||
* the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : ENABLE or DISABLE
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void UART_FifoConfig(UART_TypeDef *UARTx, FunctionalState NewState);
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_FifoReset
|
||||
* Description : This function resets the Rx and the Tx FIFOs of the
|
||||
* selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : RxFIFO or TxFIFO
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void UART_FifoReset(UART_TypeDef *UARTx, UARTFIFO_TypeDef FIFO);
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_LoopBackConfig
|
||||
* Description : This function enables or disables the loop back mode of
|
||||
* the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : ENABLE or DISABLE
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void UART_LoopBackConfig(UART_TypeDef *UARTx, FunctionalState NewState);
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_TimeOutPeriodConfig
|
||||
* Description : This function configure the Time Out Period.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : The time-out period value
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void UART_TimeOutPeriodConfig(UART_TypeDef *UARTx, u16 TimeOutPeriod)
|
||||
{
|
||||
UARTx->TOR = TimeOutPeriod;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_GuardTimeConfig
|
||||
* Description : This function configure the Guard Time.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : The guard time value
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void UART_GuardTimeConfig(UART_TypeDef *UARTx, u16 GuardTime)
|
||||
{
|
||||
UARTx->GTR = GuardTime;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_RxConfig
|
||||
* Description : This function enable and disable the UART data reception.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : ENABLE or DISABLE
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void UART_RxConfig(UART_TypeDef *UARTx, FunctionalState NewState);
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_OnOffConfig
|
||||
* Description : This function sets On/Off the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : ENABLE or DISABLE
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void UART_OnOffConfig(UART_TypeDef *UARTx, FunctionalState NewState);
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_ByteSend
|
||||
* Description : This function sends a data byte to the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : A pointer to the data byte to send
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void UART_ByteSend(UART_TypeDef *UARTx, u8 *Data);
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_9BitByteSend
|
||||
* Description : This function sends a 9 bits data byte to the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : A pointer to the data to send
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void UART_9BitByteSend(UART_TypeDef *UARTx, u16 *Data);
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_DataSend
|
||||
* Description : This function sends several data bytes to the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : A pointer to the data to send
|
||||
* Input 3 : The data length in bytes
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void UART_DataSend(UART_TypeDef *UARTx, u8 *Data, u8 DataLength);
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_9BitDataSend
|
||||
* Description : This function sends several 9 bits data bytes to the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : A pointer to the data to send
|
||||
* Input 3 : The data length
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void UART_9BitDataSend(UART_TypeDef *UARTx, u16 *Data, u8 DataLength);
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_StringSend
|
||||
* Description : This function sends a string to the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : A pointer to the string to send
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void UART_StringSend(UART_TypeDef *UARTx, u8 *String);
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_ByteReceive
|
||||
* Description : This function gets a data byte from the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : A pointer to the buffer where the data will be stored
|
||||
* Input 3 : The time-out period
|
||||
* Output : The received data
|
||||
* Return : The UARTx.SR register contents
|
||||
*******************************************************************************/
|
||||
u16 UART_ByteReceive(UART_TypeDef *UARTx, u8 *Data, u8 TimeOut);
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_9BitByteReceive
|
||||
* Description : This function gets a 9 bits data byte from the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : A pointer to the buffer where the data will be stored
|
||||
* Input 3 : The time-out period value
|
||||
* Output : The received data
|
||||
* Return : The UARTx.SR register contents
|
||||
*******************************************************************************/
|
||||
u16 UART_9BitByteReceive(UART_TypeDef *UARTx, u16 *Data, u8 TimeOut);
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_DataReceive
|
||||
* Description : This function gets 8 bits data bytes from the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : A pointer to the buffer where the data will be stored
|
||||
* Input 3 : The data length
|
||||
* Input 4 : The time-out period value
|
||||
* Output : The received data
|
||||
* Return : The UARTx.SR register contents
|
||||
*******************************************************************************/
|
||||
u16 UART_DataReceive(UART_TypeDef *UARTx, u8 *Data, u8 DataLength, u8 TimeOut);
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_9BitDataReceive
|
||||
* Description : This function gets 9 bits data bytes from the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : A pointer to the buffer where the data will be stored
|
||||
* Input 3 : The data length
|
||||
* Input 4 : The time-out value
|
||||
* Output : The received data
|
||||
* Return : The UARTx.SR register contents
|
||||
*******************************************************************************/
|
||||
u16 UART_9BitDataReceive(UART_TypeDef *UARTx, u16 *Data, u8 DataLength, u8 TimeOut);
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_StringReceive
|
||||
* Description : This function gets 8 bits data bytes from the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : A pointer to the buffer where the string will be stored
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
u16 UART_StringReceive(UART_TypeDef *UARTx, u8 *Data);
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_FlagStatus
|
||||
* Description : This function gets the flags status of the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline u16 UART_FlagStatus(UART_TypeDef *UARTx)
|
||||
{
|
||||
return UARTx->SR;
|
||||
}
|
||||
|
||||
#ifdef USE_SERIAL_PORT
|
||||
/*******************************************************************************
|
||||
* Function Name : sendchar
|
||||
* Description : This function sends a character to the selected UART.
|
||||
* Input 1 : A pointer to the character to send.
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void sendchar( char *ch );
|
||||
#endif /* USE_SERIAL_PORT */
|
||||
|
||||
#endif /* _UART_H */
|
||||
|
||||
/******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/
|
129
Demo/ARM7_STR71x_IAR/Library/include/wdg.h
Normal file
129
Demo/ARM7_STR71x_IAR/Library/include/wdg.h
Normal file
|
@ -0,0 +1,129 @@
|
|||
/******************** (C) COPYRIGHT 2003 STMicroelectronics ********************
|
||||
* File Name : wdg.h
|
||||
* Author : MCD Application Team
|
||||
* Date First Issued : 25/08/2003
|
||||
* Description : This file contains all the functions prototypes for the
|
||||
* WDG software library.
|
||||
********************************************************************************
|
||||
* History:
|
||||
* 30/11/2004 : V2.0
|
||||
* 14/07/2004 : V1.3
|
||||
* 01/01/2004 : V1.2
|
||||
*******************************************************************************
|
||||
THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH
|
||||
CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
|
||||
AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
|
||||
OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
|
||||
OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
|
||||
CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
||||
*******************************************************************************/
|
||||
#ifndef __WDG_H
|
||||
#define __WDG_H
|
||||
|
||||
#include "71x_map.h"
|
||||
#include "rccu.h"
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : WDG_Enable
|
||||
* Description : Enable the Watchdog Mode
|
||||
* Input : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void WDG_Enable ( void )
|
||||
{
|
||||
WDG->CR |= 0x01;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : WDG_CntRefresh
|
||||
* Description : Refresh and update the WDG counter to avoid a system reset.
|
||||
* Input : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void WDG_CntRefresh ( void )
|
||||
{
|
||||
//write the first value in the key register
|
||||
WDG->KR = 0xA55A;
|
||||
//write the consecutive value
|
||||
WDG->KR = 0x5AA5;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : WDG_PrescalerConfig
|
||||
* Description : Set the counter prescaler value.
|
||||
* Divide the counter clock by (Prescaler + 1)
|
||||
* Input : Prescaler data value (8 bit)
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void WDG_PrescalerConfig ( u8 Prescaler )
|
||||
{
|
||||
WDG->PR = Prescaler;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : WDG_CntReloadUpdate
|
||||
* Description : Update the counter pre-load value.
|
||||
* Input : Pre-load data value (16 bit)
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void WDG_CntReloadUpdate ( u16 PreLoadValue )
|
||||
{
|
||||
WDG->VR = PreLoadValue;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : WDG_PeriodValueConfig
|
||||
* Description : Set the prescaler and counter reload value based on the
|
||||
* time needed
|
||||
* Input : Amount of time (us) needed, peripheral clock2 value
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void WDG_PeriodValueConfig ( u32 Time );
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : WDG_CntOnOffConfig
|
||||
* Description : Start or stop the free auto-reload timer to countdown.
|
||||
* Input : ENABLE or DISABLE
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void WDG_CntOnOffConfig ( FunctionalState NewState )
|
||||
{
|
||||
if (NewState == ENABLE) WDG->CR |= 0x0002; else WDG->CR &= ~0x0002;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : WDG_ECITConfig
|
||||
* Description : Enable or Disable the end of count interrupt
|
||||
* Input : ENABLE or DISABLE
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void WDG_ECITConfig (FunctionalState NewState)
|
||||
{
|
||||
if (NewState == ENABLE) WDG->MR |= 0x0001; else WDG->MR &= ~0x0001;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : WDG_ECFlagClear
|
||||
* Description : Clear the end of count flag
|
||||
* Input : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
inline void WDG_ECFlagClear ( void )
|
||||
{
|
||||
WDG->SR = 0x0000;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : WDG_ECStatus
|
||||
* Description : Return the end of count status
|
||||
* Input : None
|
||||
* Return : NewState value
|
||||
*******************************************************************************/
|
||||
inline u16 WDG_ECStatus ( void )
|
||||
{
|
||||
return WDG->SR;
|
||||
}
|
||||
|
||||
#endif // __WDG_H
|
||||
|
||||
/******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/
|
183
Demo/ARM7_STR71x_IAR/Library/rccu.c
Normal file
183
Demo/ARM7_STR71x_IAR/Library/rccu.c
Normal file
|
@ -0,0 +1,183 @@
|
|||
/******************** (C) COPYRIGHT 2003 STMicroelectronics ********************
|
||||
* File Name : rccu.c
|
||||
* Author : MCD Application Team
|
||||
* Date First Issued : 07/28/2003
|
||||
* Description : This file provides all the RCCU software functions
|
||||
********************************************************************************
|
||||
* History:
|
||||
* 30/11/2004 : V2.0
|
||||
* 14/07/2004 : V1.3
|
||||
* 01/01/2004 : V1.2
|
||||
*******************************************************************************
|
||||
THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH
|
||||
CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
|
||||
AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
|
||||
OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
|
||||
OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
|
||||
CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
||||
*******************************************************************************/
|
||||
#include "rccu.h"
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : RCCU_PLL1Config
|
||||
* Description : Configures the PLL1 div & mul factors.
|
||||
* Input : New_Mul ( RCCU_PLL1_Mul_12, RCCU_PLL1_Mul_16, RCCU_PLL1_Mul_20,
|
||||
* RCCU_PLL1_Mul_24 )
|
||||
* : New_Div ( RCCU_Div_1, RCCU_Div_2, RCCU_Div_3, RCCU_Div_4,
|
||||
* RCCU_Div_5, RCCU_Div_6, RCCU_Div_7)
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void RCCU_PLL1Config ( RCCU_PLL1_Mul New_Mul, RCCU_PLL_Div New_Div )
|
||||
{
|
||||
u32 Tmp = ( RCCU->PLL1CR & ~RCCU_MX_Mask ) | ( New_Mul << RCCU_MX_Index );
|
||||
RCCU->PLL1CR = ( Tmp & ~RCCU_DX_Mask ) | New_Div | 0x40;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : RCCU_PLL2Config
|
||||
* Description : Configures the PLL2 div & mul factors.
|
||||
* Input : New_Mul ( RCCU_PLL2_Mul_12, RCCU_PLL2_Mul_16, RCCU_PLL2_Mul_20,
|
||||
* RCCU_Mul_PLL2_28 )
|
||||
* : New_Div ( RCCU_Div_1, RCCU_Div_2, RCCU_Div_3, RCCU_Div_4,
|
||||
* RCCU_Div_5, RCCU_Div_6, RCCU_Div_7)
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void RCCU_PLL2Config ( RCCU_PLL2_Mul New_Mul, RCCU_PLL_Div New_Div )
|
||||
{
|
||||
u32 Tmp = ( PCU->PLL2CR & ~RCCU_MX_Mask ) | ( New_Mul << RCCU_MX_Index );
|
||||
PCU->PLL2CR = ( Tmp & ~RCCU_DX_Mask ) | ( New_Div | RCCU_FREEN_Mask );
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : RCCU_RCLKSourceConfig
|
||||
* Description : Selects the RCLK source clock
|
||||
* Input : New_Clock ( RCCU_PLL1_Output, RCCU_CLOCK2_16, RCCU_CLOCK2 )
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void RCCU_RCLKSourceConfig ( RCCU_RCLK_Clocks New_Clock )
|
||||
{
|
||||
switch ( New_Clock )
|
||||
{
|
||||
case RCCU_CLOCK2 :{// Resets the CSU_Cksel bit in clk_flag
|
||||
RCCU->CFR &= ~RCCU_CSU_CKSEL_Mask;
|
||||
// Set the CK2_16 Bit in the CFR
|
||||
RCCU->CFR |= RCCU_CK2_16_Mask;
|
||||
// Deselect The CKAF
|
||||
RCCU->CCR &= ~RCCU_CKAF_SEL_Mask;
|
||||
// switch off the PLL1
|
||||
RCCU->PLL1CR=((RCCU->PLL1CR & ~RCCU_DX_Mask)\
|
||||
|0x00000003) & ~RCCU_FREEN_Mask;
|
||||
break;}
|
||||
case RCCU_CLOCK2_16 :{// ReSet the CK2_16 Bit in the CFR
|
||||
RCCU->CFR &= ~RCCU_CK2_16_Mask;
|
||||
// Deselect The CKAF
|
||||
RCCU->CCR &= ~RCCU_CKAF_SEL_Mask;
|
||||
// switch off the PLL1
|
||||
RCCU->PLL1CR=((RCCU->PLL1CR & ~RCCU_DX_Mask)\
|
||||
|0x00000003) & ~RCCU_FREEN_Mask;
|
||||
break;}
|
||||
case RCCU_PLL1_Output:{// Set the CK2_16 Bit in the CFR
|
||||
RCCU->CFR = RCCU->CFR | RCCU_CK2_16_Mask;
|
||||
// Waits the PLL1 to lock if DX bits are different from '111'
|
||||
// If all DX bit are set the PLL lock flag in meaningless
|
||||
if (( RCCU->PLL1CR & 0x0007 ) != 7)
|
||||
while(!(RCCU->CFR & RCCU_LOCK_Mask));
|
||||
// Deselect The CKAF
|
||||
RCCU->CCR &= ~RCCU_CKAF_SEL_Mask;
|
||||
// Select The CSU_CKSEL
|
||||
RCCU->CFR |= RCCU_CSU_CKSEL_Mask;
|
||||
break;}
|
||||
case RCCU_RTC_CLOCK : {RCCU->CCR |= 0x04;
|
||||
break;}
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : RCCU_RCLKClockSource
|
||||
* Description : Returns the current RCLK source clock
|
||||
* Input : None
|
||||
* Return : RCCU_PLL1_Output, RCCU_CLOCK2_16, RCCU_CLOCK2, RCCU_RTC_CLOCK
|
||||
*******************************************************************************/
|
||||
RCCU_RCLK_Clocks RCCU_RCLKClockSource ( void )
|
||||
{
|
||||
if ((RCCU->CCR & 0x04)==0x04)
|
||||
return RCCU_RTC_CLOCK;
|
||||
|
||||
else if ((RCCU->CFR & RCCU_CK2_16_Mask)==0)
|
||||
return RCCU_CLOCK2_16;
|
||||
|
||||
else if (RCCU->CFR & RCCU_CSU_CKSEL_Mask)
|
||||
return RCCU_PLL1_Output;
|
||||
|
||||
else
|
||||
return RCCU_CLOCK2;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : RCCU_USBClockSource
|
||||
* Description : Gets the RCLK source clock
|
||||
* Input : None
|
||||
* Return : RCCU_USB_Clocks ( RCCU_PLL2_Output, RCCU_USBCK )
|
||||
*******************************************************************************/
|
||||
RCCU_USB_Clocks RCCU_USBClockSource ( void )
|
||||
{
|
||||
if ((PCU->PLL2CR & RCCU_USBEN_Mask ) >> RCCU_USBEN_Index == 1 )
|
||||
return RCCU_PLL2_Output;
|
||||
else return RCCU_USBCK;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : RCCU_FrequencyValue
|
||||
* Description : Calculates & Returns any internal RCCU clock frequency
|
||||
* passed in parametres
|
||||
* Input : RCCU_Clocks ( RCCU_CLK2, RCCU_RCLK, RCCU_MCLK, RCCU_PCLK, RCCU_FCLK )
|
||||
* Return : u32
|
||||
*******************************************************************************/
|
||||
u32 RCCU_FrequencyValue ( RCCU_Clocks Internal_Clk )
|
||||
{
|
||||
u32 Tmp;
|
||||
u8 Div, Mul;
|
||||
RCCU_RCLK_Clocks CurrentRCLK;
|
||||
|
||||
Tmp = ( RCCU_Div2Status() == SET )? RCCU_Main_Osc / 2 : RCCU_Main_Osc;
|
||||
|
||||
if ( Internal_Clk == RCCU_CLK2 )
|
||||
{
|
||||
Div = 1;
|
||||
Mul = 1;
|
||||
}
|
||||
else
|
||||
{ CurrentRCLK = RCCU_RCLKClockSource ();
|
||||
switch ( CurrentRCLK ){
|
||||
case RCCU_CLOCK2_16 : Div = 16;
|
||||
Mul = 1;
|
||||
break;
|
||||
case RCCU_CLOCK2 : Div = 1;
|
||||
Mul = 1;
|
||||
break;
|
||||
case RCCU_PLL1_Output :{Mul=(RCCU->PLL1CR & RCCU_MX_Mask ) >> RCCU_MX_Index;
|
||||
switch ( Mul )
|
||||
{case 0: Mul = 20; break;
|
||||
case 1: Mul = 12; break;
|
||||
case 2: Mul = 28; break;
|
||||
case 3: Mul = 16; break;
|
||||
}
|
||||
Div = ( RCCU->PLL1CR & RCCU_DX_Mask ) + 1;
|
||||
break;}
|
||||
case RCCU_RTC_CLOCK : Mul = 1;
|
||||
Div = 1;
|
||||
Tmp = RCCU_RTC_Osc;
|
||||
break;}}
|
||||
|
||||
switch ( Internal_Clk ){
|
||||
case RCCU_MCLK :{Div <<= PCU->MDIVR & RCCU_FACT_Mask;
|
||||
break;}
|
||||
case RCCU_PCLK :{Div <<=(PCU->PDIVR & RCCU_FACT2_Mask ) >> RCCU_FACT2_Index;
|
||||
break;}
|
||||
case RCCU_FCLK :{Div <<= PCU->PDIVR & 0x3;
|
||||
break;}}
|
||||
|
||||
return (Tmp * Mul) / Div;
|
||||
}
|
||||
|
||||
/******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/
|
365
Demo/ARM7_STR71x_IAR/Library/uart.c
Normal file
365
Demo/ARM7_STR71x_IAR/Library/uart.c
Normal file
|
@ -0,0 +1,365 @@
|
|||
/******************** (C) COPYRIGHT 2003 STMicroelectronics ********************
|
||||
* File Name : uart.c
|
||||
* Author : MCD Application Team
|
||||
* Date First Issued : 06/08/2003
|
||||
* Description : This file provides all the UART software functions
|
||||
********************************************************************************
|
||||
* History:
|
||||
* 30/11/2004 : V2.0
|
||||
* 14/07/2004 : V1.3
|
||||
* 01/01/2004 : V1.2
|
||||
*******************************************************************************
|
||||
THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH
|
||||
CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
|
||||
AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
|
||||
OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
|
||||
OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
|
||||
CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
||||
*******************************************************************************/
|
||||
|
||||
#include "uart.h"
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_Init
|
||||
* Description : This function initializes the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void UART_Init(UART_TypeDef *UARTx)
|
||||
{
|
||||
UARTx->IER = 0x00;
|
||||
UARTx->CR = 0x00;
|
||||
(void)UARTx->RxBUFR;
|
||||
UARTx->RxRSTR = 0xFFFF;
|
||||
UARTx->TxRSTR = 0xFFFF;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_BaudRateConfig
|
||||
* Description : This function configures the baud rate of the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : The baudrate value
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void UART_BaudRateConfig(UART_TypeDef *UARTx, u32 BaudRate)
|
||||
{
|
||||
UARTx->BR = (u16)(RCCU_FrequencyValue(RCCU_FCLK)/(16*BaudRate));
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_Config
|
||||
* Description : This function configures the baudrate, the mode, the data
|
||||
* parity and the number of stop bits of the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : The baudrate value
|
||||
* Input 3 : The parity type
|
||||
* Input 4 : The number of stop bits
|
||||
* Input 5 : The UART mode
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void UART_Config(UART_TypeDef *UARTx, u32 BaudRate, UARTParity_TypeDef Parity,
|
||||
UARTStopBits_TypeDef StopBits, UARTMode_TypeDef Mode)
|
||||
{
|
||||
UART_ModeConfig(UARTx, Mode);
|
||||
UART_BaudRateConfig(UARTx, BaudRate);
|
||||
UART_ParityConfig(UARTx, Parity);
|
||||
UART_StopBitsConfig(UARTx, StopBits);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_ItConfig
|
||||
* Description : This function enables or disables the interrupts of the
|
||||
* selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : The new interrupt flag
|
||||
* Input 3 : ENABLE or DISABLE
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void UART_ItConfig(UART_TypeDef *UARTx, u16 UART_Flag, FunctionalState NewState)
|
||||
{
|
||||
if (NewState==ENABLE) UARTx->IER|=UART_Flag; else UARTx->IER&=~UART_Flag;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_FifoConfig
|
||||
* Description : This function enables or disables the Rx and Tx FIFOs of
|
||||
* the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : ENABLE or DISABLE
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void UART_FifoConfig(UART_TypeDef *UARTx, FunctionalState NewState)
|
||||
{
|
||||
if (NewState==ENABLE) UARTx->CR|=0x0400; else UARTx->CR&=~0x0400;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_FifoReset
|
||||
* Description : This function resets the Rx and the Tx FIFOs of the
|
||||
* selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : UART_RxFIFO or UART_TxFIFO
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void UART_FifoReset(UART_TypeDef *UARTx, UARTFIFO_TypeDef FIFO)
|
||||
{
|
||||
if (FIFO==UART_RxFIFO) UARTx->RxRSTR=0xFFFF; else UARTx->TxRSTR=0xFFFF;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_LoopBackConfig
|
||||
* Description : This function enables or disables the loop back mode of
|
||||
* the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : ENABLE or DISABLE
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void UART_LoopBackConfig(UART_TypeDef *UARTx, FunctionalState NewState)
|
||||
{
|
||||
if (NewState==ENABLE) UARTx->CR|=0x0040; else UARTx->CR&=~0x0040;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_RxConfig
|
||||
* Description : This function enables or disables the UART data reception.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : ENABLE or DISABLE
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void UART_RxConfig(UART_TypeDef *UARTx, FunctionalState NewState)
|
||||
{
|
||||
if (NewState==ENABLE) UARTx->CR|=0x0100; else UARTx->CR&=~0x0100;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_OnOffConfig
|
||||
* Description : This function sets On/Off the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : ENABLE or DISABLE
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void UART_OnOffConfig(UART_TypeDef *UARTx, FunctionalState NewState)
|
||||
{
|
||||
if (NewState==ENABLE) UARTx->CR|=0x0080; else UARTx->CR&=~0x0080;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_ByteSend
|
||||
* Description : This function sends a data byte to the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : A pointer to the data byte to send
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void UART_ByteSend(UART_TypeDef *UARTx, u8 *Data)
|
||||
{
|
||||
if (UARTx->CR & (0x0001<<UART_FIFOEnableBit))// if FIFO ENABLED
|
||||
while((UARTx->SR & UART_TxFull)); // while the UART_TxFIFO contain 16 characters.
|
||||
else // if FIFO DISABLED
|
||||
while (!(UARTx->SR & UART_TxEmpty)); // while the transmit shift register not empty
|
||||
UARTx->TxBUFR = *Data;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_9BitByteSend
|
||||
* Description : This function sends a 9 bits data byte to the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : A pointer to the data to send
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void UART_9BitByteSend(UART_TypeDef *UARTx, u16 *Data)
|
||||
{
|
||||
if(UARTx->CR & (0x0001<<UART_FIFOEnableBit))// if FIFO ENABLED
|
||||
while((UARTx->SR & UART_TxFull)); // while the UART_TxFIFO contain 16 characters.
|
||||
else // if FIFO DISABLED
|
||||
while (!(UARTx->SR & UART_TxEmpty)); // while the transmit shift register not empty
|
||||
UARTx->TxBUFR = *Data;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_DataSend
|
||||
* Description : This function sends several data bytes to the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : A pointer to the data to send
|
||||
* Input 3 : The data length in bytes
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void UART_DataSend(UART_TypeDef *UARTx, u8 *Data, u8 DataLength)
|
||||
{
|
||||
while(DataLength--)
|
||||
{
|
||||
UART_ByteSend(UARTx,Data);
|
||||
Data++;
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_9BitDataSend
|
||||
* Description : This function sends several 9 bits data bytes to the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : A pointer to the data to send
|
||||
* Input 3 : The data length
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void UART_9BitDataSend(UART_TypeDef *UARTx, u16 *Data, u8 DataLength)
|
||||
{
|
||||
while(DataLength--)
|
||||
{
|
||||
UART_9BitByteSend(UARTx,Data);
|
||||
Data++;
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_StringSend
|
||||
* Description : This function sends a string to the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : A pointer to the string to send
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void UART_StringSend(UART_TypeDef *UARTx, u8 *String)
|
||||
{
|
||||
u8 *Data=String;
|
||||
while(*Data != '\0')
|
||||
UART_ByteSend(UARTx, Data++);
|
||||
*Data='\0';
|
||||
UART_ByteSend(UARTx, Data);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_ByteReceive
|
||||
* Description : This function gets a data byte from the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : A pointer to the buffer where the data will be stored
|
||||
* Input 3 : The time-out period
|
||||
* Output : The received data
|
||||
* Return : The UARTx.SR register contents
|
||||
*******************************************************************************/
|
||||
u16 UART_ByteReceive(UART_TypeDef *UARTx, u8 *Data, u8 TimeOut)
|
||||
{
|
||||
u16 wStatus;
|
||||
UARTx->TOR=TimeOut;// reload the Timeout counter
|
||||
while (!((wStatus=UARTx->SR) & (UART_TimeOutIdle|UART_RxHalfFull|UART_RxBufFull)));// while the UART_RxFIFO is empty and no Timeoutidle
|
||||
*Data = (u8)UARTx->RxBUFR; // then read the Receive Buffer Register
|
||||
return wStatus;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_9BitByteReceive
|
||||
* Description : This function gets a 9 bits data byte from the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : A pointer to the buffer where the data will be stored
|
||||
* Input 3 : The time-out period value
|
||||
* Output : The received data
|
||||
* Return : The UARTx.SR register contents
|
||||
*******************************************************************************/
|
||||
u16 UART_9BitByteReceive(UART_TypeDef *UARTx, u16 *Data, u8 TimeOut)
|
||||
{
|
||||
u16 wStatus;
|
||||
UARTx->TOR=TimeOut;// reload the Timeout counter
|
||||
while (!((wStatus=UARTx->SR) & (UART_TimeOutIdle|UART_RxHalfFull|UART_RxBufFull)));// while the UART_RxFIFO is empty and no Timeoutidle
|
||||
*Data = (u16)UARTx->RxBUFR; // then read the RxBUFR
|
||||
return wStatus;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_DataReceive
|
||||
* Description : This function gets 8 bits data bytes from the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : A pointer to the buffer where the data will be stored
|
||||
* Input 3 : The data length
|
||||
* Input 4 : The time-out period value
|
||||
* Output : The received data
|
||||
* Return : The UARTx.SR register contents
|
||||
*******************************************************************************/
|
||||
u16 UART_DataReceive(UART_TypeDef *UARTx, u8 *Data, u8 DataLength, u8 TimeOut)
|
||||
{
|
||||
u16 wStatus;
|
||||
while(DataLength--)
|
||||
wStatus=UART_ByteReceive(UARTx,Data++,TimeOut);
|
||||
return wStatus;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_9BitDataReceive
|
||||
* Description : This function gets 9 bits data bytes from the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : A pointer to the buffer where the data will be stored
|
||||
* Input 3 : The data length
|
||||
* Input 4 : The time-out value
|
||||
* Output : The received data
|
||||
* Return : The UARTx.SR register contents
|
||||
*******************************************************************************/
|
||||
u16 UART_9BitDataReceive(UART_TypeDef *UARTx, u16 *Data, u8 DataLength, u8 TimeOut)
|
||||
{
|
||||
u16 wStatus;
|
||||
while(DataLength--)
|
||||
wStatus=UART_9BitByteReceive(UARTx,Data++,TimeOut);
|
||||
return wStatus;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : UART_StringReceive
|
||||
* Description : This function gets 8 bits data bytes from the selected UART.
|
||||
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
|
||||
* Input 2 : A pointer to the buffer where the string will be stored
|
||||
* Output : The received string
|
||||
* Return : The UARTx.SR register contents
|
||||
*******************************************************************************/
|
||||
u16 UART_StringReceive(UART_TypeDef *UARTx, u8 *Data)
|
||||
{
|
||||
u8 *pSTRING=Data;
|
||||
u16 wStatus;
|
||||
do
|
||||
{
|
||||
while (!((wStatus=UARTx->SR) & (UART_RxHalfFull|UART_RxBufFull)));// while the UART_RxFIFO is empty and no Timeoutidle
|
||||
*(pSTRING++) = (u8)UARTx->RxBUFR; // then read the RxBUFR
|
||||
} while((*(pSTRING - 1)!=0x0D)&(*(pSTRING - 1)!='\0'));
|
||||
*(pSTRING - 1)='\0';
|
||||
return wStatus;
|
||||
}
|
||||
|
||||
#ifdef USE_SERIAL_PORT
|
||||
/*******************************************************************************
|
||||
* Function Name : sendchar
|
||||
* Description : This function sends a character to the selected UART.
|
||||
* Input 1 : A pointer to the character to send.
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void sendchar( char *ch )
|
||||
{
|
||||
#ifdef USE_UART0
|
||||
#define UARTx UART0
|
||||
#endif /* Use_UART0 */
|
||||
|
||||
#ifdef USE_UART1
|
||||
#define UARTx UART1
|
||||
#endif /* Use_UART1 */
|
||||
|
||||
#ifdef USE_UART2
|
||||
#define UARTx UART2
|
||||
#endif /* Use_UART2 */
|
||||
|
||||
#ifdef USE_UART3
|
||||
#define UARTx UART3
|
||||
#endif /* Use_UART3 */
|
||||
|
||||
UART_ByteSend(UARTx,(u8 *)ch);
|
||||
}
|
||||
#endif /* USE_SERIAL_PORT */
|
||||
|
||||
/******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/
|
83
Demo/ARM7_STR71x_IAR/Library/wdg.c
Normal file
83
Demo/ARM7_STR71x_IAR/Library/wdg.c
Normal file
|
@ -0,0 +1,83 @@
|
|||
/******************** (C) COPYRIGHT 2003 STMicroelectronics ********************
|
||||
* File Name : WDG.c
|
||||
* Author : MCD Application Team
|
||||
* Date First Issued : 10/24/2003
|
||||
* Description : This file provides all the WDG software functions
|
||||
********************************************************************************
|
||||
* History:
|
||||
* 30/11/2004 : V2.0
|
||||
* 14/07/2004 : V1.3
|
||||
* 01/01/2004 : V1.2
|
||||
*******************************************************************************
|
||||
THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH
|
||||
CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
|
||||
AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
|
||||
OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
|
||||
OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
|
||||
CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
||||
*******************************************************************************/
|
||||
|
||||
#include "wdg.h"
|
||||
|
||||
#ifndef abs
|
||||
#define abs(x) ((x)>0 ? (x) : -(x))
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : FindFactors
|
||||
* Description : Search for the best (a,b) values that fit n = a*b
|
||||
* with the following constraints: 1<=a<=256, 1<=b<=65536
|
||||
* Input 1 : n: the number to decompose
|
||||
* Input/Output 2 : a: a pointer to the first factor
|
||||
* Input/Output 3 : b: a pointer to the second factor
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
static void FindFactors(unsigned long n, unsigned int *a, unsigned long *b)
|
||||
{
|
||||
unsigned long b0;
|
||||
unsigned int a0;
|
||||
long err, err_min=n;
|
||||
|
||||
*a = a0 = ((n-1)/65536ul) + 1;
|
||||
*b = b0 = n / *a;
|
||||
|
||||
for (; *a <= 256; (*a)++)
|
||||
{
|
||||
*b = n / *a;
|
||||
err = (long)*a * (long)*b - (long)n;
|
||||
if (abs(err) > (*a / 2))
|
||||
{
|
||||
(*b)++;
|
||||
err = (long)*a * (long)*b - (long)n;
|
||||
}
|
||||
if (abs(err) < abs(err_min))
|
||||
{
|
||||
err_min = err;
|
||||
a0 = *a;
|
||||
b0 = *b;
|
||||
if (err == 0) break;
|
||||
}
|
||||
}
|
||||
|
||||
*a = a0;
|
||||
*b = b0;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : WDG_PeriodValueConfig
|
||||
* Description : Set the prescaler and counter reload value
|
||||
* Input : Amount of time (us) needed
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void WDG_PeriodValueConfig ( u32 Time )
|
||||
{
|
||||
unsigned int a;
|
||||
unsigned long n, b;
|
||||
|
||||
n = Time * (RCCU_FrequencyValue(RCCU_PCLK) / 1000000);
|
||||
FindFactors(n, &a, &b);
|
||||
WDG->PR = a - 1;
|
||||
WDG->VR = b - 1;
|
||||
}
|
||||
|
||||
/******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/
|
107
Demo/ARM7_STR71x_IAR/ParTest/ParTest.c
Normal file
107
Demo/ARM7_STR71x_IAR/ParTest/ParTest.c
Normal file
|
@ -0,0 +1,107 @@
|
|||
/*
|
||||
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS distribution.
|
||||
|
||||
FreeRTOS is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
FreeRTOS is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with FreeRTOS; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
A special exception to the GPL can be applied should you wish to distribute
|
||||
a combined work that includes FreeRTOS, without being obliged to provide
|
||||
the source code for any proprietary components. See the licensing section
|
||||
of http://www.FreeRTOS.org for full details of how and when the exception
|
||||
can be applied.
|
||||
|
||||
***************************************************************************
|
||||
See http://www.FreeRTOS.org for documentation, latest information, license
|
||||
and contact details. Please ensure to read the configuration and relevant
|
||||
port sections of the online documentation.
|
||||
***************************************************************************
|
||||
*/
|
||||
|
||||
/* Library includes. */
|
||||
#include "GPIO.h"
|
||||
|
||||
/* Scheduler includes. */
|
||||
#include "FreeRTOS.h"
|
||||
|
||||
/* Demo application includes. */
|
||||
#include "partest.h"
|
||||
|
||||
/*-----------------------------------------------------------
|
||||
* Simple parallel port IO routines for the LED's - which are
|
||||
* connected to the second nibble of GPIO port 1.
|
||||
*-----------------------------------------------------------*/
|
||||
|
||||
#define partstLED_3 0x0080
|
||||
#define partstLED_2 0x0040
|
||||
#define partstLED_1 0x0020
|
||||
#define partstLED_0 0x0010
|
||||
#define partstON_BOARD 0x0100 /* The LED built onto the KickStart board. */
|
||||
|
||||
#define partstALL_LEDs ( partstLED_0 | partstLED_1 | partstLED_2 | partstLED_3 | partstON_BOARD )
|
||||
|
||||
#define partstFIRST_LED_BIT 4
|
||||
|
||||
/* This demo application uses files that are common to all port demo
|
||||
applications. These files assume 6 LED's are available, whereas I have
|
||||
only 5 (including the LED built onto the development board). To prevent
|
||||
two tasks trying to use the same LED a bit of remapping is performed.
|
||||
The ComTest tasks will try and use LED's 6 and 7. LED 6 is ignored and
|
||||
has no effect, LED 7 is mapped to LED3. The LED usage is described in
|
||||
the port documentation available from the FreeRTOS.org WEB site. */
|
||||
#define partstCOM_TEST_LED 7
|
||||
#define partstRX_CHAR_LED 3
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vParTestInitialise( void )
|
||||
{
|
||||
/* Configure the bits used to flash LED's on port 1 as output. */
|
||||
GPIO_Config(GPIO1, partstALL_LEDs, GPIO_OUT_OD);
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue )
|
||||
{
|
||||
if( uxLED == partstCOM_TEST_LED )
|
||||
{
|
||||
/* Remap as described above. */
|
||||
uxLED = partstRX_CHAR_LED;
|
||||
}
|
||||
|
||||
/* Adjust the LED value to map to the port pins actually being used,
|
||||
then write the required value to the port. */
|
||||
uxLED += partstFIRST_LED_BIT;
|
||||
GPIO_BitWrite( GPIO1, uxLED, !xValue );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vParTestToggleLED( unsigned portBASE_TYPE uxLED )
|
||||
{
|
||||
if( uxLED == partstCOM_TEST_LED )
|
||||
{
|
||||
/* Remap as described above. */
|
||||
uxLED = partstRX_CHAR_LED;
|
||||
}
|
||||
|
||||
/* Adjust the LED value to map to the port pins actually being used,
|
||||
then write the opposite value to the current state to the port pin. */
|
||||
uxLED += partstFIRST_LED_BIT;
|
||||
GPIO_BitWrite(GPIO1, uxLED, ~GPIO_BitRead( GPIO1, uxLED ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
866
Demo/ARM7_STR71x_IAR/RTOSDemo.dep
Normal file
866
Demo/ARM7_STR71x_IAR/RTOSDemo.dep
Normal file
|
@ -0,0 +1,866 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
||||
<project>
|
||||
<fileVersion>2</fileVersion>
|
||||
<configuration>
|
||||
<name>Debug</name>
|
||||
<outputs>
|
||||
<file>$PROJ_DIR$\..\Common\Minimal\comtest.c</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\tasks.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\serial.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\71x_lib.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\wdg.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\semtest.r79</file>
|
||||
<file>$TOOLKIT_DIR$\inc\string.h</file>
|
||||
<file>$TOOLKIT_DIR$\inc\ysizet.h</file>
|
||||
<file>$PROJ_DIR$\..\Common\include\comtest.h</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\BlockQ.pbi</file>
|
||||
<file>$PROJ_DIR$\..\Common\include\dynamic.h</file>
|
||||
<file>$PROJ_DIR$\Library\include\71x_map.h</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\list.r79</file>
|
||||
<file>$PROJ_DIR$\Library\include\eic.h</file>
|
||||
<file>$TOOLKIT_DIR$\inc\xencoding_limits.h</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\list.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\ParTest.r79</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\BlockQ.r79</file>
|
||||
<file>$TOOLKIT_DIR$\inc\yvals.h</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\main.r79</file>
|
||||
<file>$PROJ_DIR$\..\Common\include\partest.h</file>
|
||||
<file>$PROJ_DIR$\Library\include\rccu.h</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\portasm.r79</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\portable\IAR\STR71x\ISR_Support.h</file>
|
||||
<file>$PROJ_DIR$\..\Common\include\PollQ.h</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\cstartup.r79</file>
|
||||
<file>$TOOLKIT_DIR$\inc\DLib_Threads.h</file>
|
||||
<file>$PROJ_DIR$\FreeRTOSConfig.h</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\dynamic.pbi</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\include\FreeRTOS.h</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\heap_2.r79</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\queue.r79</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\include\queue.h</file>
|
||||
<file>$TOOLKIT_DIR$\inc\stdlib.h</file>
|
||||
<file>$PROJ_DIR$\Library\include\wdg.h</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\serialISR.r79</file>
|
||||
<file>$TOOLKIT_DIR$\lib\dl4tptinl8n.h</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\heap_2.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\integer.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\rccu.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\uart.r79</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\port.pbi</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\include\croutine.h</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\queue.pbi</file>
|
||||
<file>$TOOLKIT_DIR$\inc\DLib_Defaults.h</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\port.r79</file>
|
||||
<file>$TOOLKIT_DIR$\inc\stddef.h</file>
|
||||
<file>$PROJ_DIR$\..\Common\include\comtest2.h</file>
|
||||
<file>$PROJ_DIR$\Library\include\71x_conf.h</file>
|
||||
<file>$TOOLKIT_DIR$\inc\stdio.h</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\serial.r79</file>
|
||||
<file>$PROJ_DIR$\..\Common\include\BlockQ.h</file>
|
||||
<file>$PROJ_DIR$\..\Common\include\integer.h</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\comtest.r79</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\71x_lib.r79</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\main.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\dynamic.r79</file>
|
||||
<file>$PROJ_DIR$\Library\include\gpio.h</file>
|
||||
<file>$TOOLKIT_DIR$\inc\DLib_Product.h</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\tasks.r79</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\include\semphr.h</file>
|
||||
<file>$TOOLKIT_DIR$\inc\intrinsic.h</file>
|
||||
<file>$PROJ_DIR$\Library\include\uart.h</file>
|
||||
<file>$PROJ_DIR$\Debug\Exe\RTOSDemo.sim</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\flash.r79</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\integer.r79</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\PollQ.r79</file>
|
||||
<file>$PROJ_DIR$\Debug\Exe\RTOSDemo.d79</file>
|
||||
<file>$TOOLKIT_DIR$\lib\dl4tptinl8n.r79</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\include\task.h</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\uart.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\gpio.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\flash.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\vect.r79</file>
|
||||
<file>$PROJ_DIR$\..\Common\include\serial.h</file>
|
||||
<file>$PROJ_DIR$\..\Common\include\flash.h</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\rccu.r79</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\ParTest.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\PollQ.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\semtest.pbi</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\include\projdefs.h</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\include\list.h</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\comtest.pbi</file>
|
||||
<file>$PROJ_DIR$\Library\include\71x_type.h</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\gpio.r79</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\include\portable.h</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\portable\IAR\STR71x\portmacro.h</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\wdg.r79</file>
|
||||
<file>$PROJ_DIR$\..\Common\include\semtest.h</file>
|
||||
<file>$PROJ_DIR$\cstartup.s79</file>
|
||||
<file>$PROJ_DIR$\lnkarm.xcl</file>
|
||||
<file>$PROJ_DIR$\vect.s79</file>
|
||||
<file>$PROJ_DIR$\..\Common\Minimal\BlockQ.c</file>
|
||||
<file>$PROJ_DIR$\serial\serialISR.s79</file>
|
||||
<file>$PROJ_DIR$\Library\rccu.c</file>
|
||||
<file>$PROJ_DIR$\Library\uart.c</file>
|
||||
<file>$PROJ_DIR$\Library\wdg.c</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\list.c</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\portable\IAR\STR71x\port.c</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\portable\IAR\STR71x\portasm.s79</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\queue.c</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\tasks.c</file>
|
||||
<file>$PROJ_DIR$\..\Common\Minimal\flash.c</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\portable\MemMang\heap_2.c</file>
|
||||
<file>$PROJ_DIR$\..\Common\Minimal\dynamic.c</file>
|
||||
<file>$PROJ_DIR$\..\Common\Minimal\integer.c</file>
|
||||
<file>$PROJ_DIR$\main.c</file>
|
||||
<file>$PROJ_DIR$\ParTest\ParTest.c</file>
|
||||
<file>$PROJ_DIR$\..\Common\Minimal\PollQ.c</file>
|
||||
<file>$PROJ_DIR$\..\Common\Minimal\semtest.c</file>
|
||||
<file>$PROJ_DIR$\serial\serial.c</file>
|
||||
<file>$PROJ_DIR$\Library\gpio.c</file>
|
||||
<file>$PROJ_DIR$\Library\71x_lib.c</file>
|
||||
</outputs>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\Common\Minimal\comtest.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 53</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 82</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 33 18 44 36 58 14 26 7 29 46 80 27 85 86 61 69 81 74 8 20</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>[ROOT_NODE]</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>XLINK</name>
|
||||
<file> 67 63</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\Debug\Exe\RTOSDemo.d79</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>XLINK</name>
|
||||
<file> 63</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>XLINK</name>
|
||||
<file> 90 54 17 16 66 53 25 56 64 84 30 65 12 19 45 22 31 76 5 50 35 59 40 73 87 68</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\cstartup.s79</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>AARM</name>
|
||||
<file> 25</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\vect.s79</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>AARM</name>
|
||||
<file> 73</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>AARM</name>
|
||||
<file> 27</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\Common\Minimal\BlockQ.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 17</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 9</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 33 18 44 36 58 14 26 7 29 46 80 27 85 86 61 69 81 32 51</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\serial\serialISR.s79</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>AARM</name>
|
||||
<file> 35</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>AARM</name>
|
||||
<file> 23</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\Library\rccu.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 76</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 39</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 21 11 48 83</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\Library\uart.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 40</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 70</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 62 11 48 83 21</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\Library\wdg.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 87</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 4</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 34 11 48 83 21</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\Source\list.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 12</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 15</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 33 18 44 36 58 14 26 7 29 46 80 27 85 86 61 81</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\Source\portable\IAR\STR71x\port.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 45</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 41</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 34 11 48 83 21 13 33 18 44 36 58 14 26 7 29 46 80 27 85 86 61 69 81</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\Source\portable\IAR\STR71x\portasm.s79</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>AARM</name>
|
||||
<file> 22</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>AARM</name>
|
||||
<file> 23</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\Source\queue.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 31</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 43</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 33 18 44 36 58 14 26 7 6 29 46 80 27 85 86 61 69 81 42</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\Source\tasks.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 59</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 1</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 49 18 44 36 58 14 26 7 33 6 29 46 80 27 85 86 61 69 81</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\Common\Minimal\flash.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 64</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 72</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 33 18 44 36 58 14 26 7 29 46 80 27 85 86 61 69 81 20 75</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\Source\portable\MemMang\heap_2.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 30</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 37</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 33 18 44 36 58 14 26 7 29 46 80 27 85 86 61 69 81</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\Common\Minimal\dynamic.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 56</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 28</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 33 18 44 36 58 14 26 7 29 46 80 27 85 86 61 69 81 60 32 10</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\Common\Minimal\integer.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 65</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 38</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 33 18 44 36 58 14 26 7 29 46 80 27 85 86 61 69 81 52</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\main.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 19</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 55</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 21 11 48 83 34 29 46 18 44 36 58 14 26 7 80 27 85 86 61 69 81 75 52 24 51 88 10 20 47</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\ParTest\ParTest.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 16</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 77</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 57 11 48 83 29 46 18 44 36 58 14 26 7 80 27 85 86 61 20</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\Common\Minimal\PollQ.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 66</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 78</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 33 18 44 36 58 14 26 7 29 46 80 27 85 86 61 69 81 32 24</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\Common\Minimal\semtest.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 5</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 79</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 33 18 44 36 58 14 26 7 29 46 80 27 85 86 61 69 81 60 32 88</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\serial\serial.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 50</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 2</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 62 11 48 83 21 57 13 29 46 18 44 36 58 14 26 7 80 27 85 86 61 32 74</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\Library\gpio.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 84</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 71</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 57 11 48 83</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\Library\71x_lib.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 54</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 3</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 11 48 83</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
</configuration>
|
||||
<configuration>
|
||||
<name>Release</name>
|
||||
<outputs>
|
||||
<file>$PROJ_DIR$\Release\Obj\dynamic.r79</file>
|
||||
<file>$PROJ_DIR$\Release\Obj\list.r79</file>
|
||||
<file>$PROJ_DIR$\Release\Obj\wdg.r79</file>
|
||||
<file>$PROJ_DIR$\Release\Obj\ParTest.r79</file>
|
||||
<file>$PROJ_DIR$\Release\Obj\71x_lib.r79</file>
|
||||
<file>$PROJ_DIR$\..\Common\Minimal\comtest.c</file>
|
||||
<file>$PROJ_DIR$\Release\Obj\cstartup.r79</file>
|
||||
<file>$PROJ_DIR$\Release\Obj\uart.r79</file>
|
||||
<file>$PROJ_DIR$\Release\Obj\vect.r79</file>
|
||||
<file>$PROJ_DIR$\Release\Obj\portasm.r79</file>
|
||||
<file>$PROJ_DIR$\Release\Obj\heap_2.r79</file>
|
||||
<file>$PROJ_DIR$\Release\Obj\tasks.r79</file>
|
||||
<file>$PROJ_DIR$\Release\Obj\BlockQ.r79</file>
|
||||
<file>$PROJ_DIR$\Release\Obj\integer.r79</file>
|
||||
<file>$PROJ_DIR$\Release\Obj\rccu.r79</file>
|
||||
<file>$PROJ_DIR$\Release\Obj\PollQ.r79</file>
|
||||
<file>$PROJ_DIR$\Release\Obj\flash.r79</file>
|
||||
<file>$PROJ_DIR$\Release\Obj\main.r79</file>
|
||||
<file>$PROJ_DIR$\Release\Obj\gpio.r79</file>
|
||||
<file>$PROJ_DIR$\Release\Obj\semtest.r79</file>
|
||||
<file>$PROJ_DIR$\Release\Exe\RTOSDemo.d79</file>
|
||||
<file>$PROJ_DIR$\Release\Obj\serialISR.r79</file>
|
||||
<file>$PROJ_DIR$\Release\Obj\port.r79</file>
|
||||
<file>$PROJ_DIR$\Release\Obj\comtest.r79</file>
|
||||
<file>$PROJ_DIR$\Release\Obj\serial.r79</file>
|
||||
<file>$PROJ_DIR$\Release\Obj\queue.r79</file>
|
||||
<file>$PROJ_DIR$\cstartup.s79</file>
|
||||
<file>$PROJ_DIR$\vect.s79</file>
|
||||
<file>$PROJ_DIR$\..\Common\Minimal\BlockQ.c</file>
|
||||
<file>$PROJ_DIR$\serial\serialISR.s79</file>
|
||||
<file>$PROJ_DIR$\Library\rccu.c</file>
|
||||
<file>$PROJ_DIR$\Library\uart.c</file>
|
||||
<file>$PROJ_DIR$\Library\wdg.c</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\list.c</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\portable\IAR\STR71x\port.c</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\portable\IAR\STR71x\portasm.s79</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\queue.c</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\tasks.c</file>
|
||||
<file>$PROJ_DIR$\..\Common\Minimal\flash.c</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\portable\MemMang\heap_2.c</file>
|
||||
<file>$PROJ_DIR$\..\Common\Minimal\dynamic.c</file>
|
||||
<file>$PROJ_DIR$\..\Common\Minimal\integer.c</file>
|
||||
<file>$PROJ_DIR$\main.c</file>
|
||||
<file>$PROJ_DIR$\ParTest\ParTest.c</file>
|
||||
<file>$PROJ_DIR$\..\Common\Minimal\PollQ.c</file>
|
||||
<file>$PROJ_DIR$\..\Common\Minimal\semtest.c</file>
|
||||
<file>$PROJ_DIR$\serial\serial.c</file>
|
||||
<file>$PROJ_DIR$\Library\gpio.c</file>
|
||||
<file>$PROJ_DIR$\Library\71x_lib.c</file>
|
||||
</outputs>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\Common\Minimal\comtest.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 23</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>[ROOT_NODE]</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>XLINK</name>
|
||||
<file> 20</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\cstartup.s79</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>AARM</name>
|
||||
<file> 6</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\vect.s79</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>AARM</name>
|
||||
<file> 8</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\Common\Minimal\BlockQ.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 12</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\serial\serialISR.s79</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>AARM</name>
|
||||
<file> 21</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\Library\rccu.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 14</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\Library\uart.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 7</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\Library\wdg.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 2</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\Source\list.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 1</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\Source\portable\IAR\STR71x\port.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 22</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\Source\portable\IAR\STR71x\portasm.s79</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>AARM</name>
|
||||
<file> 9</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\Source\queue.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 25</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\Source\tasks.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 11</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\Common\Minimal\flash.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 16</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\Source\portable\MemMang\heap_2.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 10</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\Common\Minimal\dynamic.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 0</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\Common\Minimal\integer.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 13</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\main.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 17</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\ParTest\ParTest.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 3</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\Common\Minimal\PollQ.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 15</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\Common\Minimal\semtest.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 19</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\serial\serial.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 24</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\Library\gpio.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 18</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\Library\71x_lib.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 4</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<forcedrebuild>
|
||||
<name>[MULTI_TOOL]</name>
|
||||
<tool>XLINK</tool>
|
||||
</forcedrebuild>
|
||||
</configuration>
|
||||
</project>
|
||||
|
||||
|
913
Demo/ARM7_STR71x_IAR/RTOSDemo.ewd
Normal file
913
Demo/ARM7_STR71x_IAR/RTOSDemo.ewd
Normal file
|
@ -0,0 +1,913 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
||||
<project>
|
||||
<fileVersion>1</fileVersion>
|
||||
<configuration>
|
||||
<name>Debug</name>
|
||||
<toolchain>
|
||||
<name>ARM</name>
|
||||
</toolchain>
|
||||
<debug>1</debug>
|
||||
<settings>
|
||||
<name>C-SPY</name>
|
||||
<archiveVersion>2</archiveVersion>
|
||||
<data>
|
||||
<version>12</version>
|
||||
<wantNonLocal>1</wantNonLocal>
|
||||
<debug>1</debug>
|
||||
<option>
|
||||
<name>CInput</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CEndian</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CProcessor</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCVariant</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>MacOverride</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>MacFile</name>
|
||||
<state></state>
|
||||
</option>
|
||||
<option>
|
||||
<name>MemOverride</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>MemFile</name>
|
||||
<state>$TOOLKIT_DIR$\CONFIG\iostr712.ddf</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>RunToEnable</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>RunToName</name>
|
||||
<state>main</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CExtraOptionsCheck</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CExtraOptions</name>
|
||||
<state></state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CFpuProcessor</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDDFArgumentProducer</name>
|
||||
<state></state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDownloadSuppressDownload</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDownloadVerifyAll</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDownloadFlashDownload</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDownloadFlashOverride</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDownloadFlashLoader</name>
|
||||
<state>$TOOLKIT_DIR$\config\flashloader\ST\FlashSTR71xF.d79</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDownloadFlashLoaderSlave</name>
|
||||
<state></state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCProductVersion</name>
|
||||
<state>4.20A</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDynDriverList</name>
|
||||
<state>JLINK_ID</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCLastSavedByProductVersion</name>
|
||||
<state>4.20A</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDownloadFlashLoaderArgs</name>
|
||||
<state></state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDownloadFlashBaseAddrOverride</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDownloadFlashBaseAddr</name>
|
||||
<state></state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDownloadAttachToProgram</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
</data>
|
||||
</settings>
|
||||
<settings>
|
||||
<name>ARMSIM_ID</name>
|
||||
<archiveVersion>2</archiveVersion>
|
||||
<data>
|
||||
<version>0</version>
|
||||
<wantNonLocal>1</wantNonLocal>
|
||||
<debug>1</debug>
|
||||
<option>
|
||||
<name>OCSimDriverInfo</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
</data>
|
||||
</settings>
|
||||
<settings>
|
||||
<name>ANGEL_ID</name>
|
||||
<archiveVersion>2</archiveVersion>
|
||||
<data>
|
||||
<version>0</version>
|
||||
<wantNonLocal>1</wantNonLocal>
|
||||
<debug>1</debug>
|
||||
<option>
|
||||
<name>CCAngelHeartbeat</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CAngelCommunication</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CAngelCommBaud</name>
|
||||
<version>0</version>
|
||||
<state>3</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CAngelCommPort</name>
|
||||
<version>0</version>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>ANGELTCPIP</name>
|
||||
<state>aaa.bbb.ccc.ddd</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>DoAngelLogfile</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>AngelLogFile</name>
|
||||
<state>$TOOLKIT_DIR$\cspycomm.log</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDriverInfo</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
</data>
|
||||
</settings>
|
||||
<settings>
|
||||
<name>IARROM_ID</name>
|
||||
<archiveVersion>2</archiveVersion>
|
||||
<data>
|
||||
<version>0</version>
|
||||
<wantNonLocal>1</wantNonLocal>
|
||||
<debug>1</debug>
|
||||
<option>
|
||||
<name>CRomLogFileCheck</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CRomLogFileEditB</name>
|
||||
<state>$TOOLKIT_DIR$\cspycomm.log</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CRomCommunication</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CRomCommPort</name>
|
||||
<version>0</version>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CRomCommBaud</name>
|
||||
<version>0</version>
|
||||
<state>7</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDriverInfo</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
</data>
|
||||
</settings>
|
||||
<settings>
|
||||
<name>JLINK_ID</name>
|
||||
<archiveVersion>2</archiveVersion>
|
||||
<data>
|
||||
<version>1</version>
|
||||
<wantNonLocal>1</wantNonLocal>
|
||||
<debug>1</debug>
|
||||
<option>
|
||||
<name>JLinkSpeed</name>
|
||||
<state>32</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCJLinkHWReset</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCJLinkTRSTReset</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCDoJlinkMultiTarget</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCJLinkMultiTarget</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCJLinkDoLogfile</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCJLinkLogFile</name>
|
||||
<state>$TOOLKIT_DIR$\cspycomm.log</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCJLinkHWResetDelay</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCJLinkSpeedRadio</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDriverInfo</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>JLinkInitialSpeed</name>
|
||||
<state>4000</state>
|
||||
</option>
|
||||
</data>
|
||||
</settings>
|
||||
<settings>
|
||||
<name>MACRAIGOR_ID</name>
|
||||
<archiveVersion>2</archiveVersion>
|
||||
<data>
|
||||
<version>1</version>
|
||||
<wantNonLocal>1</wantNonLocal>
|
||||
<debug>1</debug>
|
||||
<option>
|
||||
<name>jtag</name>
|
||||
<version>0</version>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>EmuSpeed</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>TCPIP</name>
|
||||
<state>aaa.bbb.ccc.ddd</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>DoLogfile</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>LogFile</name>
|
||||
<state>$TOOLKIT_DIR$\cspycomm.log</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>DoEmuMultiTarget</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>EmuMultiTarget</name>
|
||||
<state>0@ARM7TDMI</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>EmuHWReset</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CEmuCommBaud</name>
|
||||
<version>0</version>
|
||||
<state>4</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CEmuCommPort</name>
|
||||
<version>0</version>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>jtago</name>
|
||||
<version>0</version>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDriverInfo</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>UnusedAddr</name>
|
||||
<state>0x00800000</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCMacraigorHWResetDelay</name>
|
||||
<state></state>
|
||||
</option>
|
||||
</data>
|
||||
</settings>
|
||||
<settings>
|
||||
<name>RDI_ID</name>
|
||||
<archiveVersion>2</archiveVersion>
|
||||
<data>
|
||||
<version>1</version>
|
||||
<wantNonLocal>1</wantNonLocal>
|
||||
<debug>1</debug>
|
||||
<option>
|
||||
<name>CRDIDriverDll</name>
|
||||
<state>Browse to your RDI driver</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CRDILogFileCheck</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CRDILogFileEdit</name>
|
||||
<state>$TOOLKIT_DIR$\cspycomm.log</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCRDIHWReset</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCRDICatchReset</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCRDICatchUndef</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCRDICatchSWI</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCRDICatchData</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCRDICatchPrefetch</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCRDICatchIRQ</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCRDICatchFIQ</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCRDIUseETM</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDriverInfo</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
</data>
|
||||
</settings>
|
||||
<settings>
|
||||
<name>THIRDPARTY_ID</name>
|
||||
<archiveVersion>2</archiveVersion>
|
||||
<data>
|
||||
<version>0</version>
|
||||
<wantNonLocal>1</wantNonLocal>
|
||||
<debug>1</debug>
|
||||
<option>
|
||||
<name>CThirdPartyDriverDll</name>
|
||||
<state>Browse to your third-party driver</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CThirdPartyLogFileCheck</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CThirdPartyLogFileEditB</name>
|
||||
<state>$TOOLKIT_DIR$\cspycomm.log</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDriverInfo</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
</data>
|
||||
</settings>
|
||||
<debuggerPlugins>
|
||||
<plugin>
|
||||
<file>$EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ewplugin</file>
|
||||
<loadFlag>1</loadFlag>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<file>$EW_DIR$\common\plugins\Profiling\Profiling.ewplugin</file>
|
||||
<loadFlag>1</loadFlag>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<file>$EW_DIR$\common\plugins\Trace\Trace.ewplugin</file>
|
||||
<loadFlag>1</loadFlag>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<file>$TOOLKIT_DIR$\plugins\rtos\CMX\CMXArmPlugin.ewplugin</file>
|
||||
<loadFlag>0</loadFlag>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<file>$TOOLKIT_DIR$\plugins\rtos\CMX\CMXTinyArmPlugin.ewplugin</file>
|
||||
<loadFlag>0</loadFlag>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<file>$TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ewplugin</file>
|
||||
<loadFlag>0</loadFlag>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<file>$TOOLKIT_DIR$\plugins\rtos\OSE\OseEpsilonPlugin.ewplugin</file>
|
||||
<loadFlag>0</loadFlag>
|
||||
</plugin>
|
||||
</debuggerPlugins>
|
||||
</configuration>
|
||||
<configuration>
|
||||
<name>Release</name>
|
||||
<toolchain>
|
||||
<name>ARM</name>
|
||||
</toolchain>
|
||||
<debug>0</debug>
|
||||
<settings>
|
||||
<name>C-SPY</name>
|
||||
<archiveVersion>2</archiveVersion>
|
||||
<data>
|
||||
<version>12</version>
|
||||
<wantNonLocal>1</wantNonLocal>
|
||||
<debug>0</debug>
|
||||
<option>
|
||||
<name>CInput</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CEndian</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CProcessor</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCVariant</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>MacOverride</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>MacFile</name>
|
||||
<state></state>
|
||||
</option>
|
||||
<option>
|
||||
<name>MemOverride</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>MemFile</name>
|
||||
<state>$TOOLKIT_DIR$\CONFIG\iostr712.ddf</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>RunToEnable</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>RunToName</name>
|
||||
<state>main</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CExtraOptionsCheck</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CExtraOptions</name>
|
||||
<state></state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CFpuProcessor</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDDFArgumentProducer</name>
|
||||
<state></state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDownloadSuppressDownload</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDownloadVerifyAll</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDownloadFlashDownload</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDownloadFlashOverride</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDownloadFlashLoader</name>
|
||||
<state>$TOOLKIT_DIR$\config\flashloader\ST\FlashSTR71xF.d79</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDownloadFlashLoaderSlave</name>
|
||||
<state></state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCProductVersion</name>
|
||||
<state>4.20A</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDynDriverList</name>
|
||||
<state>JLINK_ID</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCLastSavedByProductVersion</name>
|
||||
<state>4.20A</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDownloadFlashLoaderArgs</name>
|
||||
<state></state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDownloadFlashBaseAddrOverride</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDownloadFlashBaseAddr</name>
|
||||
<state></state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDownloadAttachToProgram</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
</data>
|
||||
</settings>
|
||||
<settings>
|
||||
<name>ARMSIM_ID</name>
|
||||
<archiveVersion>2</archiveVersion>
|
||||
<data>
|
||||
<version>0</version>
|
||||
<wantNonLocal>1</wantNonLocal>
|
||||
<debug>0</debug>
|
||||
<option>
|
||||
<name>OCSimDriverInfo</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
</data>
|
||||
</settings>
|
||||
<settings>
|
||||
<name>ANGEL_ID</name>
|
||||
<archiveVersion>2</archiveVersion>
|
||||
<data>
|
||||
<version>0</version>
|
||||
<wantNonLocal>1</wantNonLocal>
|
||||
<debug>0</debug>
|
||||
<option>
|
||||
<name>CCAngelHeartbeat</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CAngelCommunication</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CAngelCommBaud</name>
|
||||
<version>0</version>
|
||||
<state>3</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CAngelCommPort</name>
|
||||
<version>0</version>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>ANGELTCPIP</name>
|
||||
<state>aaa.bbb.ccc.ddd</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>DoAngelLogfile</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>AngelLogFile</name>
|
||||
<state>$TOOLKIT_DIR$\cspycomm.log</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDriverInfo</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
</data>
|
||||
</settings>
|
||||
<settings>
|
||||
<name>IARROM_ID</name>
|
||||
<archiveVersion>2</archiveVersion>
|
||||
<data>
|
||||
<version>0</version>
|
||||
<wantNonLocal>1</wantNonLocal>
|
||||
<debug>0</debug>
|
||||
<option>
|
||||
<name>CRomLogFileCheck</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CRomLogFileEditB</name>
|
||||
<state>$TOOLKIT_DIR$\cspycomm.log</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CRomCommunication</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CRomCommPort</name>
|
||||
<version>0</version>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CRomCommBaud</name>
|
||||
<version>0</version>
|
||||
<state>7</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDriverInfo</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
</data>
|
||||
</settings>
|
||||
<settings>
|
||||
<name>JLINK_ID</name>
|
||||
<archiveVersion>2</archiveVersion>
|
||||
<data>
|
||||
<version>1</version>
|
||||
<wantNonLocal>1</wantNonLocal>
|
||||
<debug>0</debug>
|
||||
<option>
|
||||
<name>JLinkSpeed</name>
|
||||
<state>32</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCJLinkHWReset</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCJLinkTRSTReset</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCDoJlinkMultiTarget</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCJLinkMultiTarget</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCJLinkDoLogfile</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCJLinkLogFile</name>
|
||||
<state>$TOOLKIT_DIR$\cspycomm.log</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCJLinkHWResetDelay</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCJLinkSpeedRadio</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDriverInfo</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>JLinkInitialSpeed</name>
|
||||
<state>4000</state>
|
||||
</option>
|
||||
</data>
|
||||
</settings>
|
||||
<settings>
|
||||
<name>MACRAIGOR_ID</name>
|
||||
<archiveVersion>2</archiveVersion>
|
||||
<data>
|
||||
<version>1</version>
|
||||
<wantNonLocal>1</wantNonLocal>
|
||||
<debug>0</debug>
|
||||
<option>
|
||||
<name>jtag</name>
|
||||
<version>0</version>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>EmuSpeed</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>TCPIP</name>
|
||||
<state>aaa.bbb.ccc.ddd</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>DoLogfile</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>LogFile</name>
|
||||
<state>$TOOLKIT_DIR$\cspycomm.log</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>DoEmuMultiTarget</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>EmuMultiTarget</name>
|
||||
<state>0@ARM7TDMI</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>EmuHWReset</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CEmuCommBaud</name>
|
||||
<version>0</version>
|
||||
<state>4</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CEmuCommPort</name>
|
||||
<version>0</version>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>jtago</name>
|
||||
<version>0</version>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDriverInfo</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>UnusedAddr</name>
|
||||
<state>0x00800000</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCMacraigorHWResetDelay</name>
|
||||
<state></state>
|
||||
</option>
|
||||
</data>
|
||||
</settings>
|
||||
<settings>
|
||||
<name>RDI_ID</name>
|
||||
<archiveVersion>2</archiveVersion>
|
||||
<data>
|
||||
<version>1</version>
|
||||
<wantNonLocal>1</wantNonLocal>
|
||||
<debug>0</debug>
|
||||
<option>
|
||||
<name>CRDIDriverDll</name>
|
||||
<state>Browse to your RDI driver</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CRDILogFileCheck</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CRDILogFileEdit</name>
|
||||
<state>$TOOLKIT_DIR$\cspycomm.log</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCRDIHWReset</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCRDICatchReset</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCRDICatchUndef</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCRDICatchSWI</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCRDICatchData</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCRDICatchPrefetch</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCRDICatchIRQ</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCRDICatchFIQ</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCRDIUseETM</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDriverInfo</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
</data>
|
||||
</settings>
|
||||
<settings>
|
||||
<name>THIRDPARTY_ID</name>
|
||||
<archiveVersion>2</archiveVersion>
|
||||
<data>
|
||||
<version>0</version>
|
||||
<wantNonLocal>1</wantNonLocal>
|
||||
<debug>0</debug>
|
||||
<option>
|
||||
<name>CThirdPartyDriverDll</name>
|
||||
<state>Browse to your third-party driver</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CThirdPartyLogFileCheck</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CThirdPartyLogFileEditB</name>
|
||||
<state>$TOOLKIT_DIR$\cspycomm.log</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDriverInfo</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
</data>
|
||||
</settings>
|
||||
<debuggerPlugins>
|
||||
<plugin>
|
||||
<file>$EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ewplugin</file>
|
||||
<loadFlag>1</loadFlag>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<file>$EW_DIR$\common\plugins\Profiling\Profiling.ewplugin</file>
|
||||
<loadFlag>1</loadFlag>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<file>$EW_DIR$\common\plugins\Trace\Trace.ewplugin</file>
|
||||
<loadFlag>1</loadFlag>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<file>$TOOLKIT_DIR$\plugins\rtos\CMX\CMXArmPlugin.ewplugin</file>
|
||||
<loadFlag>0</loadFlag>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<file>$TOOLKIT_DIR$\plugins\rtos\CMX\CMXTinyArmPlugin.ewplugin</file>
|
||||
<loadFlag>0</loadFlag>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<file>$TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ewplugin</file>
|
||||
<loadFlag>0</loadFlag>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<file>$TOOLKIT_DIR$\plugins\rtos\OSE\OseEpsilonPlugin.ewplugin</file>
|
||||
<loadFlag>0</loadFlag>
|
||||
</plugin>
|
||||
</debuggerPlugins>
|
||||
</configuration>
|
||||
</project>
|
||||
|
||||
|
1733
Demo/ARM7_STR71x_IAR/RTOSDemo.ewp
Normal file
1733
Demo/ARM7_STR71x_IAR/RTOSDemo.ewp
Normal file
File diff suppressed because it is too large
Load diff
10
Demo/ARM7_STR71x_IAR/RTOSDemo.eww
Normal file
10
Demo/ARM7_STR71x_IAR/RTOSDemo.eww
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
||||
<workspace>
|
||||
<project>
|
||||
<path>$WS_DIR$\RTOSDemo.ewp</path>
|
||||
</project>
|
||||
<batchBuild/>
|
||||
</workspace>
|
||||
|
||||
|
212
Demo/ARM7_STR71x_IAR/cstartup.s79
Normal file
212
Demo/ARM7_STR71x_IAR/cstartup.s79
Normal file
|
@ -0,0 +1,212 @@
|
|||
;-----------------------------------------------------------------------------
|
||||
; This file contains the startup code used by the ICCARM C compiler.
|
||||
;
|
||||
; The modules in this file are included in the libraries, and may be replaced
|
||||
; by any user-defined modules that define the PUBLIC symbol _program_start or
|
||||
; a user defined start symbol.
|
||||
; To override the cstartup defined in the library, simply add your modified
|
||||
; version to the workbench project.
|
||||
;
|
||||
; All code in the modules (except ?RESET) will be placed in the ICODE segment.
|
||||
;
|
||||
; $Revision: 1.1 $
|
||||
;
|
||||
;-----------------------------------------------------------------------------
|
||||
|
||||
;
|
||||
; Naming covention of labels in this file:
|
||||
;
|
||||
; ?xxx - External labels only accessed from assembler.
|
||||
; __xxx - External labels accessed from or defined in C.
|
||||
; xxx - Labels local to one module (note: this file contains
|
||||
; several modules).
|
||||
; main - The starting point of the user program.
|
||||
;
|
||||
|
||||
;---------------------------------------------------------------
|
||||
; Macros and definitions for the whole file
|
||||
;---------------------------------------------------------------
|
||||
|
||||
|
||||
; --- Standard definitions of mode bits and interrupt (I & F) flags in PSRs
|
||||
|
||||
|
||||
|
||||
Mode_USR DEFINE 0x10
|
||||
Mode_FIQ DEFINE 0x11
|
||||
Mode_IRQ DEFINE 0x12
|
||||
Mode_SVC DEFINE 0x13
|
||||
Mode_ABT DEFINE 0x17
|
||||
Mode_UNDEF DEFINE 0x1B
|
||||
Mode_SYS DEFINE 0x1F ; available on ARM Arch 4 and later
|
||||
|
||||
I_Bit DEFINE 0x80 ; when I bit is set, IRQ is disabled
|
||||
F_Bit DEFINE 0x40 ; when F bit is set, FIQ is disabled
|
||||
|
||||
|
||||
; --- System memory locations
|
||||
|
||||
RAM_Base DEFINE 0x20000000
|
||||
RAM_Limit DEFINE 0x20010000
|
||||
SRAM_Base DEFINE 0x60000000
|
||||
|
||||
SVC_Stack DEFINE RAM_Limit ; 512 byte SVC stack at
|
||||
; top of memory - used by kernel.
|
||||
IRQ_Stack DEFINE SVC_Stack-512 ; followed by IRQ stack
|
||||
USR_Stack DEFINE IRQ_Stack-512 ; followed by USR stack. Tasks run in
|
||||
; system mode but task stacks are allocated
|
||||
; when the task is created.
|
||||
FIQ_Stack DEFINE USR_Stack-8 ; followed by FIQ stack
|
||||
ABT_Stack DEFINE FIQ_Stack-8 ; followed by ABT stack
|
||||
UNDEF_Stack DEFINE ABT_Stack-8 ; followed by UNDEF stack
|
||||
|
||||
EIC_Base_addr DEFINE 0xFFFFF800 ; EIC base address
|
||||
ICR_off_addr DEFINE 0x00 ; Interrupt Control register offset
|
||||
CIPR_off_addr DEFINE 0x08 ; Current Interrupt Priority Register offset
|
||||
IVR_off_addr DEFINE 0x18 ; Interrupt Vector Register offset
|
||||
FIR_off_addr DEFINE 0x1C ; Fast Interrupt Register offset
|
||||
IER_off_addr DEFINE 0x20 ; Interrupt Enable Register offset
|
||||
IPR_off_addr DEFINE 0x40 ; Interrupt Pending Bit Register offset
|
||||
SIR0_off_addr DEFINE 0x60 ; Source Interrupt Register 0
|
||||
|
||||
EMI_Base_addr DEFINE 0x6C000000 ; EMI base address
|
||||
BCON0_off_addr DEFINE 0x00 ; Bank 0 configuration register offset
|
||||
BCON1_off_addr DEFINE 0x04 ; Bank 1 configuration register offset
|
||||
BCON2_off_addr DEFINE 0x08 ; Bank 2 configuration register offset
|
||||
BCON3_off_addr DEFINE 0x0C ; Bank 3 configuration register offset
|
||||
|
||||
GPIO2_Base_addr DEFINE 0xE0005000 ; GPIO2 base address
|
||||
PC0_off_addr DEFINE 0x00 ; Port Configuration Register 0 offset
|
||||
PC1_off_addr DEFINE 0x04 ; Port Configuration Register 1 offset
|
||||
PC2_off_addr DEFINE 0x08 ; Port Configuration Register 2 offset
|
||||
PD_off_addr DEFINE 0x0C ; Port Data Register offset
|
||||
|
||||
CPM_Base_addr DEFINE 0xA0000040 ; CPM Base Address
|
||||
BOOTCONF_off_addr DEFINE 0x10 ; CPM - Boot Configuration Register
|
||||
FLASH_mask DEFINE 0x0000 ; to remap FLASH at 0x0
|
||||
RAM_mask DEFINE 0x0002 ; to remap RAM at 0x0
|
||||
EXTMEM_mask DEFINE 0x0003 ; to remap EXTMEM at 0x0
|
||||
|
||||
;---------------------------------------------------------------
|
||||
; ?RESET
|
||||
; Reset Vector.
|
||||
; Normally, segment INTVEC is linked at address 0.
|
||||
; For debugging purposes, INTVEC may be placed at other
|
||||
; addresses.
|
||||
; A debugger that honors the entry point will start the
|
||||
; program in a normal way even if INTVEC is not at address 0.
|
||||
;---------------------------------------------------------------
|
||||
|
||||
MODULE ?RESET
|
||||
COMMON INTVEC:CODE:NOROOT(2)
|
||||
PUBLIC __program_start
|
||||
EXTERN ?cstartup
|
||||
CODE32 ; Always ARM mode after reset
|
||||
|
||||
__program_start
|
||||
ldr pc,=?cstartup ; Absolute jump can reach 4 GByte
|
||||
b ?cstartup ; Relative branch allows remap, limited to 32 MByte
|
||||
|
||||
LTORG
|
||||
ENDMOD
|
||||
|
||||
|
||||
;---------------------------------------------------------------
|
||||
; ?CSTARTUP
|
||||
;---------------------------------------------------------------
|
||||
MODULE ?CSTARTUP
|
||||
|
||||
; RSEG IRQ_STACK:DATA(2)
|
||||
; RSEG SVC_STACK:DATA:NOROOT(2)
|
||||
; RSEG CSTACK:DATA(2)
|
||||
RSEG ICODE:CODE:NOROOT(2)
|
||||
PUBLIC ?cstartup
|
||||
EXTERN ?main
|
||||
|
||||
|
||||
|
||||
|
||||
CODE32
|
||||
?cstartup
|
||||
|
||||
|
||||
NOP ; Wait for OSC stabilization
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
|
||||
|
||||
/* Setup a stack for each mode - note that this only sets up a usable stack
|
||||
for system/user, SWI and IRQ modes. Also each mode is setup with
|
||||
interrupts initially disabled. */
|
||||
msr CPSR_c, #Mode_UNDEF|I_Bit|F_Bit /* Undefined Instruction Mode */
|
||||
LDR SP, =UNDEF_Stack
|
||||
|
||||
msr CPSR_c, #Mode_ABT|I_Bit|F_Bit /* Abort Mode */
|
||||
LDR SP, =ABT_Stack
|
||||
|
||||
msr CPSR_c, #Mode_FIQ|I_Bit|F_Bit /* FIQ Mode */
|
||||
LDR SP, =FIQ_Stack
|
||||
|
||||
msr CPSR_c, #Mode_IRQ|I_Bit|F_Bit /* IRQ Mode */
|
||||
LDR SP, =IRQ_Stack
|
||||
|
||||
msr CPSR_c, #Mode_SVC|I_Bit|F_Bit /* Supervisor Mode */
|
||||
LDR SP, =SVC_Stack
|
||||
|
||||
msr CPSR_c, #Mode_SYS|I_Bit|F_Bit /* System Mode */
|
||||
LDR SP, =USR_Stack
|
||||
|
||||
/* We want to start in supervisor mode. Operation will switch to system
|
||||
mode when the first task starts. */
|
||||
msr CPSR_c, #Mode_SVC|I_Bit|F_Bit
|
||||
|
||||
|
||||
IMPORT T0TIMI_Addr
|
||||
|
||||
EIC_INIT
|
||||
LDR r3, =EIC_Base_addr
|
||||
LDR r4, =0x00000000
|
||||
STR r4, [r3, #ICR_off_addr] ; Disable FIQ and IRQ
|
||||
STR r4, [r3, #IER_off_addr] ; Disable all channels interrupts
|
||||
LDR r4, =0xFFFFFFFF
|
||||
STR r4, [r3, #IPR_off_addr] ; Clear all IRQ pending bits
|
||||
LDR r4, =0x0C
|
||||
STR r4, [r3, #FIR_off_addr] ; Disable FIQ channels and clear FIQ pending bits
|
||||
LDR r4, =0x00000000
|
||||
STR r4, [r3, #CIPR_off_addr] ; Reset the current priority register
|
||||
LDR r4, =0xE59F0000
|
||||
STR r4, [r3, #IVR_off_addr] ; Write the LDR pc,pc,#offset instruction code in IVR[31:16]
|
||||
LDR r2, =32 ; 32 Channel to initialize
|
||||
LDR r0, =T0TIMI_Addr ; Read the address of the IRQs address table
|
||||
LDR r1, =0x00000FFF
|
||||
AND r0,r0,r1
|
||||
LDR r5, =SIR0_off_addr ; Read SIR0 address
|
||||
SUB r4,r0,#8 ; subtract 8 for prefetch
|
||||
LDR r1, =0xF7E8 ; add the offset to the 0x00000000 address(IVR address + 7E8 = 0x00000000)
|
||||
; 0xF7E8 used to complete the LDR pc,pc,#offset opcode
|
||||
ADD r1,r4,r1 ; compute the jump offset
|
||||
EIC_INI MOV r4, r1, LSL #16 ; Left shift the result
|
||||
STR r4, [r3, r5] ; Store the result in SIRx register
|
||||
ADD r1, r1, #4 ; Next IRQ address
|
||||
ADD r5, r5, #4 ; Next SIR
|
||||
SUBS r2, r2, #1 ; Decrement the number of SIR registers to initialize
|
||||
BNE EIC_INI ; If more then continue
|
||||
|
||||
|
||||
ldr r0,=?main
|
||||
bx r0
|
||||
|
||||
LTORG
|
||||
|
||||
ENDMOD
|
||||
|
||||
|
||||
END
|
||||
|
||||
|
201
Demo/ARM7_STR71x_IAR/lnkarm.xcl
Normal file
201
Demo/ARM7_STR71x_IAR/lnkarm.xcl
Normal file
|
@ -0,0 +1,201 @@
|
|||
//*************************************************************************
|
||||
// XLINK command file template for EWARM/ICCARM
|
||||
//
|
||||
// Usage: xlink -f lnkarm <your_object_file(s)>
|
||||
// -s <program start label> <C/C++ runtime library>
|
||||
//
|
||||
// $Revision: 1.1 $
|
||||
//*************************************************************************
|
||||
|
||||
// Code memory in flash
|
||||
-DROMSTART=0x00000000
|
||||
-DROMEND=0x0003FFFF
|
||||
-DVECSTART=ROMSTART
|
||||
|
||||
// Data memory
|
||||
-DRAMSTART=0x20000000
|
||||
-DRAMEND=0x2000FFFF
|
||||
|
||||
|
||||
//*************************************************************************
|
||||
// In this file it is assumed that the system has the following
|
||||
// memory layout:
|
||||
//
|
||||
// Exception vectors [0x000000--0x00001F] RAM or ROM
|
||||
// ROMSTART--ROMEND [0x008000--0x0FFFFF] ROM (or other non-volatile memory)
|
||||
// RAMSTART--RAMEND [0x100000--0x7FFFFF] RAM (or other read/write memory)
|
||||
//
|
||||
// -------------
|
||||
// Code segments - may be placed anywhere in memory.
|
||||
// -------------
|
||||
//
|
||||
// INTVEC -- Exception vector table.
|
||||
// SWITAB -- Software interrupt vector table.
|
||||
// ICODE -- Startup (cstartup) and exception code.
|
||||
// DIFUNCT -- Dynamic initialization vectors used by C++.
|
||||
// CODE -- Compiler generated code.
|
||||
// CODE_I -- Compiler generated code declared __ramfunc (executes in RAM)
|
||||
// CODE_ID -- Initializer for CODE_I (ROM).
|
||||
//
|
||||
// -------------
|
||||
// Data segments - may be placed anywhere in memory.
|
||||
// -------------
|
||||
//
|
||||
// CSTACK -- The stack used by C/C++ programs (system and user mode).
|
||||
// IRQ_STACK -- The stack used by IRQ service routines.
|
||||
// SVC_STACK -- The stack used in supervisor mode
|
||||
// (Define other exception stacks as needed for
|
||||
// FIQ, ABT, UND).
|
||||
// HEAP -- The heap used by malloc and free in C and new and
|
||||
// delete in C++.
|
||||
// INITTAB -- Table containing addresses and sizes of segments that
|
||||
// need to be initialized at startup (by cstartup).
|
||||
// CHECKSUM -- The linker places checksum byte(s) in this segment,
|
||||
// when the -J linker command line option is used.
|
||||
// DATA_y -- Data objects.
|
||||
//
|
||||
// Where _y can be one of:
|
||||
//
|
||||
// _AN -- Holds uninitialized located objects, i.e. objects with
|
||||
// an absolute location given by the @ operator or the
|
||||
// #pragma location directive. Since these segments
|
||||
// contain objects which already have a fixed address,
|
||||
// they should not be mentioned in this linker command
|
||||
// file.
|
||||
// _C -- Constants (ROM).
|
||||
// _I -- Initialized data (RAM).
|
||||
// _ID -- The original content of _I (copied to _I by cstartup) (ROM).
|
||||
// _N -- Uninitialized data (RAM).
|
||||
// _Z -- Zero initialized data (RAM).
|
||||
//
|
||||
// Note: Be sure to use end values for the defined address ranges.
|
||||
// Otherwise, the linker may allocate space outside the
|
||||
// intended memory range.
|
||||
//*************************************************************************
|
||||
|
||||
|
||||
//************************************************
|
||||
// Inform the linker about the CPU family used.
|
||||
//************************************************
|
||||
|
||||
-carm
|
||||
|
||||
//*************************************************************************
|
||||
// Segment placement - General information
|
||||
//
|
||||
// All numbers in the segment placement command lines below are interpreted
|
||||
// as hexadecimal unless they are immediately preceded by a '.', which
|
||||
// denotes decimal notation.
|
||||
//
|
||||
// When specifying the segment placement using the -P instead of the -Z
|
||||
// option, the linker is free to split each segment into its segment parts
|
||||
// and randomly place these parts within the given ranges in order to
|
||||
// achieve a more efficient memory usage. One disadvantage, however, is
|
||||
// that it is not possible to find the start or end address (using
|
||||
// the assembler operators .sfb./.sfe.) of a segment which has been split
|
||||
// and reformed.
|
||||
//
|
||||
// When generating an output file which is to be used for programming
|
||||
// external ROM/Flash devices, the -M linker option is very useful
|
||||
// (see xlink.pdf for details).
|
||||
//*************************************************************************
|
||||
|
||||
|
||||
//*************************************************************************
|
||||
// Read-only segments mapped to ROM.
|
||||
//*************************************************************************
|
||||
|
||||
//************************************************
|
||||
// Address range for reset and exception
|
||||
// vectors (INTVEC).
|
||||
// The vector area is 32 bytes,
|
||||
// an additional 32 bytes is allocated for the
|
||||
// constant table used by ldr PC in cstartup.s79.
|
||||
//************************************************
|
||||
|
||||
-Z(CODE)INTVEC=VECSTART:+0x940
|
||||
|
||||
//************************************************
|
||||
// Startup code and exception routines (ICODE).
|
||||
//************************************************
|
||||
|
||||
-Z(CODE)ICODE,DIFUNCT=ROMSTART-ROMEND
|
||||
-Z(CODE)SWITAB=ROMSTART-ROMEND
|
||||
|
||||
//************************************************
|
||||
// Code segments may be placed anywhere.
|
||||
//************************************************
|
||||
|
||||
-Z(CODE)CODE=ROMSTART-ROMEND
|
||||
|
||||
//************************************************
|
||||
// Original ROM location for __ramfunc code copied
|
||||
// to and executed from RAM.
|
||||
//************************************************
|
||||
|
||||
-Z(CONST)CODE_ID=ROMSTART-ROMEND
|
||||
|
||||
//************************************************
|
||||
// Various constants and initializers.
|
||||
//************************************************
|
||||
|
||||
-Z(CONST)INITTAB,DATA_ID,DATA_C=ROMSTART-ROMEND
|
||||
-Z(CONST)CHECKSUM=ROMSTART-ROMEND
|
||||
|
||||
|
||||
//*************************************************************************
|
||||
// Read/write segments mapped to RAM.
|
||||
//*************************************************************************
|
||||
|
||||
//************************************************
|
||||
// Data segments.
|
||||
//************************************************
|
||||
|
||||
-Z(DATA)DATA_I,DATA_Z,DATA_N=RAMSTART-RAMEND
|
||||
|
||||
//************************************************
|
||||
// __ramfunc code copied to and executed from RAM.
|
||||
//************************************************
|
||||
|
||||
-Z(DATA)CODE_I=RAMSTART-RAMEND
|
||||
|
||||
//************************************************
|
||||
// ICCARM produces code for __ramfunc functions in
|
||||
// CODE_I segments. The -Q XLINK command line
|
||||
// option redirects XLINK to emit the code in the
|
||||
// CODE_ID segment instead, but to keep symbol and
|
||||
// debug information associated with the CODE_I
|
||||
// segment, where the code will execute.
|
||||
//************************************************
|
||||
|
||||
-QCODE_I=CODE_ID
|
||||
|
||||
//*************************************************************************
|
||||
// Stack and heap segments.
|
||||
//*************************************************************************
|
||||
|
||||
//-D_CSTACK_SIZE=400
|
||||
// -D_SVC_STACK_SIZE=10
|
||||
//-D_IRQ_STACK_SIZE=500
|
||||
//-D_HEAP_SIZE=4
|
||||
|
||||
//-Z(DATA)CSTACK+_CSTACK_SIZE=RAMSTART-RAMEND
|
||||
//-Z(DATA)SVC_STACK+_SVC_STACK_SIZE=RAMSTART-RAMEND
|
||||
//-Z(DATA)IRQ_STACK+_IRQ_STACK_SIZE,HEAP+_HEAP_SIZE=RAMSTART-RAMEND
|
||||
|
||||
//*************************************************************************
|
||||
// ELF/DWARF support.
|
||||
//
|
||||
// Uncomment the line "-Felf" below to generate ELF/DWARF output.
|
||||
// Available format specifiers are:
|
||||
//
|
||||
// "-yn": Suppress DWARF debug output
|
||||
// "-yp": Multiple ELF program sections
|
||||
// "-yas": Format suitable for debuggers from ARM Ltd (also sets -p flag)
|
||||
//
|
||||
// "-Felf" and the format specifiers can also be supplied directly as
|
||||
// command line options, or selected from the Xlink Output tab in the
|
||||
// IAR Embedded Workbench.
|
||||
//*************************************************************************
|
||||
|
||||
// -Felf
|
246
Demo/ARM7_STR71x_IAR/main.c
Normal file
246
Demo/ARM7_STR71x_IAR/main.c
Normal file
|
@ -0,0 +1,246 @@
|
|||
/*
|
||||
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS distribution.
|
||||
|
||||
FreeRTOS is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
FreeRTOS is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with FreeRTOS; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
A special exception to the GPL can be applied should you wish to distribute
|
||||
a combined work that includes FreeRTOS, without being obliged to provide
|
||||
the source code for any proprietary components. See the licensing section
|
||||
of http://www.FreeRTOS.org for full details of how and when the exception
|
||||
can be applied.
|
||||
|
||||
***************************************************************************
|
||||
See http://www.FreeRTOS.org for documentation, latest information, license
|
||||
and contact details. Please ensure to read the configuration and relevant
|
||||
port sections of the online documentation.
|
||||
***************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
NOTE : Tasks run in system mode and the scheduler runs in Supervisor mode.
|
||||
The processor MUST be in supervisor mode when vTaskStartScheduler is
|
||||
called. The demo applications included in the FreeRTOS.org download switch
|
||||
to supervisor mode prior to main being called. If you are not using one of
|
||||
these demo application projects then ensure Supervisor mode is used.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Creates all the demo application tasks, then starts the scheduler. The WEB
|
||||
* documentation provides more details of the demo application tasks.
|
||||
*
|
||||
* Main.c also creates a task called "Check". This only executes every three
|
||||
* seconds but has the highest priority so is guaranteed to get processor time.
|
||||
* Its main function is to check that all the other tasks are still operational.
|
||||
* Each task (other than the "flash" tasks) maintains a unique count that is
|
||||
* incremented each time the task successfully completes its function. Should
|
||||
* any error occur within such a task the count is permanently halted. The
|
||||
* check task inspects the count of each task to ensure it has changed since
|
||||
* the last time the check task executed. If all the count variables have
|
||||
* changed all the tasks are still executing error free, and the check task
|
||||
* toggles the onboard LED. Should any task contain an error at any time
|
||||
* the LED toggle rate will change from 3 seconds to 500ms.
|
||||
*
|
||||
*/
|
||||
|
||||
/* Library includes. */
|
||||
#include "RCCU.h"
|
||||
#include "wdg.h"
|
||||
|
||||
/* Scheduler includes. */
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
|
||||
/* Demo application includes. */
|
||||
#include "flash.h"
|
||||
#include "integer.h"
|
||||
#include "PollQ.h"
|
||||
#include "BlockQ.h"
|
||||
#include "semtest.h"
|
||||
#include "dynamic.h"
|
||||
#include "partest.h"
|
||||
#include "comtest2.h"
|
||||
|
||||
/* Priorities for the demo application tasks. */
|
||||
#define mainLED_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )
|
||||
#define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 2 )
|
||||
#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + 4 )
|
||||
#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 )
|
||||
#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 )
|
||||
#define mainCOM_TEST_PRIORITY ( tskIDLE_PRIORITY + 2 )
|
||||
|
||||
/* Constants required by the 'Check' task. */
|
||||
#define mainNO_ERROR_FLASH_PERIOD ( ( portTickType ) 3000 / portTICK_RATE_MS )
|
||||
#define mainERROR_FLASH_PERIOD ( ( portTickType ) 500 / portTICK_RATE_MS )
|
||||
#define mainCHECK_TASK_LED ( 4 )
|
||||
|
||||
/* Constants for the ComTest tasks. */
|
||||
#define mainCOM_TEST_BAUD_RATE ( ( unsigned portLONG ) 115200 )
|
||||
#define mainCOM_TEST_LED ( 6 ) /* The LED built onto the kickstart board. */
|
||||
|
||||
/*
|
||||
* The task that executes at the highest priority and calls
|
||||
* prvCheckOtherTasksAreStillRunning(). See the description at the top
|
||||
* of the file.
|
||||
*/
|
||||
static void vErrorChecks( void *pvParameters );
|
||||
|
||||
/*
|
||||
* Configure the processor for use with the IAR STR71x demo board. This
|
||||
* just sets the PLL for the required frequency.
|
||||
*/
|
||||
static void prvSetupHardware( void );
|
||||
|
||||
/*
|
||||
* Checks that all the demo application tasks are still executing without error
|
||||
* - as described at the top of the file. Called by vErrorChecks().
|
||||
*/
|
||||
static portLONG prvCheckOtherTasksAreStillRunning( void );
|
||||
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
* Starts all the other tasks, then starts the scheduler.
|
||||
*/
|
||||
void main( void )
|
||||
{
|
||||
/* Setup any hardware that has not already been configured by the low
|
||||
level init routines. */
|
||||
prvSetupHardware();
|
||||
|
||||
/* Initialise the LED outputs for use by the demo application tasks. */
|
||||
vParTestInitialise();
|
||||
|
||||
/* Start all the standard demo application tasks. */
|
||||
vStartIntegerMathTasks( tskIDLE_PRIORITY );
|
||||
vStartLEDFlashTasks( mainLED_TASK_PRIORITY );
|
||||
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
|
||||
vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
|
||||
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
|
||||
vStartDynamicPriorityTasks();
|
||||
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );
|
||||
|
||||
/* Start the check task - which is defined in this file. */
|
||||
xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
|
||||
|
||||
/* Start the scheduler.
|
||||
|
||||
NOTE : Tasks run in system mode and the scheduler runs in Supervisor mode.
|
||||
The processor MUST be in supervisor mode when vTaskStartScheduler is
|
||||
called. The demo applications included in the FreeRTOS.org download switch
|
||||
to supervisor mode prior to main being called. If you are not using one of
|
||||
these demo application projects then ensure Supervisor mode is used here. */
|
||||
|
||||
vTaskStartScheduler();
|
||||
|
||||
/* We should never get here as control is now taken by the scheduler. */
|
||||
return;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvSetupHardware( void )
|
||||
{
|
||||
/* Setup the PLL to generate a 48MHz clock from the 4MHz CLK. */
|
||||
|
||||
/* Turn of the div by two. */
|
||||
RCCU_Div2Config( DISABLE );
|
||||
|
||||
/* 48MHz = ( 4MHz * 12 ) / 1 */
|
||||
RCCU_PLL1Config( RCCU_PLL1_Mul_12, RCCU_Div_1 );
|
||||
RCCU_RCLKSourceConfig( RCCU_PLL1_Output );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void vErrorChecks( void *pvParameters )
|
||||
{
|
||||
portTickType xDelayPeriod = mainNO_ERROR_FLASH_PERIOD;
|
||||
portTickType xLastWakeTime;
|
||||
|
||||
/* The parameters are not used in this task. */
|
||||
( void ) pvParameters;
|
||||
|
||||
/* Initialise xLastWakeTime to ensure the first call to vTaskDelayUntil()
|
||||
functions correctly. */
|
||||
xLastWakeTime = xTaskGetTickCount();
|
||||
|
||||
/* Cycle for ever, delaying then checking all the other tasks are still
|
||||
operating without error. If an error is detected then the delay period
|
||||
is decreased from mainNO_ERROR_FLASH_PERIOD to mainERROR_FLASH_PERIOD so
|
||||
the on board LED flash rate will increase. */
|
||||
|
||||
for( ;; )
|
||||
{
|
||||
/* Delay until it is time to execute again. The delay period is
|
||||
shorter following an error so the LED flashes faster. */
|
||||
vTaskDelayUntil( &xLastWakeTime, xDelayPeriod );
|
||||
|
||||
/* Check all the standard demo application tasks are executing without
|
||||
error. */
|
||||
if( prvCheckOtherTasksAreStillRunning() != pdPASS )
|
||||
{
|
||||
/* An error has been detected in one of the tasks - flash faster. */
|
||||
xDelayPeriod = mainERROR_FLASH_PERIOD;
|
||||
}
|
||||
|
||||
vParTestToggleLED( mainCHECK_TASK_LED );
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static portLONG prvCheckOtherTasksAreStillRunning( void )
|
||||
{
|
||||
portLONG lReturn = ( portLONG ) pdPASS;
|
||||
|
||||
/* Check all the demo tasks (other than the flash tasks) to ensure
|
||||
that they are all still running, and that none of them have detected
|
||||
an error. */
|
||||
|
||||
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
|
||||
{
|
||||
lReturn = ( portLONG ) pdFAIL;
|
||||
}
|
||||
|
||||
if( xArePollingQueuesStillRunning() != pdTRUE )
|
||||
{
|
||||
lReturn = ( portLONG ) pdFAIL;
|
||||
}
|
||||
|
||||
if( xAreSemaphoreTasksStillRunning() != pdTRUE )
|
||||
{
|
||||
lReturn = ( portLONG ) pdFAIL;
|
||||
}
|
||||
|
||||
if( xAreBlockingQueuesStillRunning() != pdTRUE )
|
||||
{
|
||||
lReturn = ( portLONG ) pdFAIL;
|
||||
}
|
||||
|
||||
if( xAreComTestTasksStillRunning() != pdTRUE )
|
||||
{
|
||||
lReturn = ( portLONG ) pdFAIL;
|
||||
}
|
||||
|
||||
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
|
||||
{
|
||||
lReturn = ( portLONG ) pdFAIL;
|
||||
}
|
||||
|
||||
return lReturn;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
242
Demo/ARM7_STR71x_IAR/serial/serial.c
Normal file
242
Demo/ARM7_STR71x_IAR/serial/serial.c
Normal file
|
@ -0,0 +1,242 @@
|
|||
/*
|
||||
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS distribution.
|
||||
|
||||
FreeRTOS is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
FreeRTOS is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with FreeRTOS; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
A special exception to the GPL can be applied should you wish to distribute
|
||||
a combined work that includes FreeRTOS, without being obliged to provide
|
||||
the source code for any proprietary components. See the licensing section
|
||||
of http://www.FreeRTOS.org for full details of how and when the exception
|
||||
can be applied.
|
||||
|
||||
***************************************************************************
|
||||
See http://www.FreeRTOS.org for documentation, latest information, license
|
||||
and contact details. Please ensure to read the configuration and relevant
|
||||
port sections of the online documentation.
|
||||
***************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR UART0.
|
||||
*/
|
||||
|
||||
/* Library includes. */
|
||||
#include "uart.h"
|
||||
#include "gpio.h"
|
||||
#include "eic.h"
|
||||
|
||||
/* Scheduler includes. */
|
||||
#include "FreeRTOS.h"
|
||||
#include "queue.h"
|
||||
|
||||
/* Demo application includes. */
|
||||
#include "serial.h"
|
||||
|
||||
#define UART0_Rx_Pin ( 0x0001<< 8 )
|
||||
#define UART0_Tx_Pin ( 0x0001<< 9 )
|
||||
|
||||
#define serINVALID_QUEUE ( ( xQueueHandle ) 0 )
|
||||
#define serNO_BLOCK ( ( portTickType ) 0 )
|
||||
|
||||
/* Macros to turn on and off the Tx empty interrupt. */
|
||||
#define serINTERRUPT_ON() UART0->IER |= UART_TxHalfEmpty
|
||||
#define serINTERRUPT_OFF() UART0->IER &= ~UART_TxHalfEmpty
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* Queues used to hold received characters, and characters waiting to be
|
||||
transmitted. */
|
||||
static xQueueHandle xRxedChars;
|
||||
static xQueueHandle xCharsForTx;
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* Interrupt entry point written in the assembler file serialISR.s79. */
|
||||
extern void vSerialISREntry( void );
|
||||
|
||||
/* The interrupt service routine - called from the assembly entry point. */
|
||||
__arm void vSerialISR( void );
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
* See the serial2.h header file.
|
||||
*/
|
||||
xComPortHandle xSerialPortInitMinimal( unsigned portLONG ulWantedBaud, unsigned portBASE_TYPE uxQueueLength )
|
||||
{
|
||||
xComPortHandle xReturn;
|
||||
|
||||
/* Create the queues used to hold Rx and Tx characters. */
|
||||
xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );
|
||||
xCharsForTx = xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );
|
||||
|
||||
/* If the queues were created correctly then setup the serial port
|
||||
hardware. */
|
||||
if( ( xRxedChars != serINVALID_QUEUE ) && ( xCharsForTx != serINVALID_QUEUE ) )
|
||||
{
|
||||
portENTER_CRITICAL();
|
||||
{
|
||||
/* Setup the UART port pins. */
|
||||
GPIO_Config( GPIO0, UART0_Tx_Pin, GPIO_AF_PP );
|
||||
GPIO_Config( GPIO0, UART0_Rx_Pin, GPIO_IN_TRI_CMOS );
|
||||
|
||||
/* Configure the UART. */
|
||||
UART_OnOffConfig( UART0, ENABLE );
|
||||
UART_FifoConfig( UART0, DISABLE );
|
||||
UART_FifoReset( UART0, UART_RxFIFO );
|
||||
UART_FifoReset( UART0, UART_TxFIFO );
|
||||
UART_LoopBackConfig(UART0, DISABLE );
|
||||
UART_Config( UART0, ulWantedBaud, UART_NO_PARITY, UART_1_StopBits, UARTM_8D );
|
||||
UART_RxConfig( UART0, ENABLE );
|
||||
|
||||
/* Configure the IEC for the UART interrupts. */
|
||||
EIC_IRQChannelPriorityConfig( UART0_IRQChannel, 1 );
|
||||
EIC_IRQChannelConfig( UART0_IRQChannel, ENABLE );
|
||||
EIC_IRQConfig( ENABLE );
|
||||
UART_ItConfig( UART0, UART_RxBufFull, ENABLE );
|
||||
}
|
||||
portEXIT_CRITICAL();
|
||||
}
|
||||
else
|
||||
{
|
||||
xReturn = ( xComPortHandle ) 0;
|
||||
}
|
||||
|
||||
/* This demo file only supports a single port but we have to return
|
||||
something to comply with the standard demo header file. */
|
||||
return xReturn;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed portCHAR *pcRxedChar, portTickType xBlockTime )
|
||||
{
|
||||
/* The port handle is not required as this driver only supports one port. */
|
||||
( void ) pxPort;
|
||||
|
||||
/* Get the next character from the buffer. Return false if no characters
|
||||
are available, or arrive before xBlockTime expires. */
|
||||
if( xQueueReceive( xRxedChars, pcRxedChar, xBlockTime ) )
|
||||
{
|
||||
return pdTRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return pdFALSE;
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vSerialPutString( xComPortHandle pxPort, const signed portCHAR * const pcString, unsigned portSHORT usStringLength )
|
||||
{
|
||||
signed portCHAR *pxNext;
|
||||
|
||||
/* A couple of parameters that this port does not use. */
|
||||
( void ) usStringLength;
|
||||
( void ) pxPort;
|
||||
|
||||
/* NOTE: This implementation does not handle the queue being full as no
|
||||
block time is used! */
|
||||
|
||||
/* The port handle is not required as this driver only supports UART0. */
|
||||
( void ) pxPort;
|
||||
|
||||
/* Send each character in the string, one at a time. */
|
||||
pxNext = ( signed portCHAR * ) pcString;
|
||||
while( *pxNext )
|
||||
{
|
||||
xSerialPutChar( pxPort, *pxNext, serNO_BLOCK );
|
||||
pxNext++;
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed portCHAR cOutChar, portTickType xBlockTime )
|
||||
{
|
||||
/* Place the character in the queue of characters to be transmitted. */
|
||||
if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) != pdPASS )
|
||||
{
|
||||
return pdFAIL;
|
||||
}
|
||||
|
||||
/* Turn on the Tx interrupt so the ISR will remove the character from the
|
||||
queue and send it. This does not need to be in a critical section as
|
||||
if the interrupt has already removed the character the next interrupt
|
||||
will simply turn off the Tx interrupt again. */
|
||||
serINTERRUPT_ON();
|
||||
|
||||
return pdPASS;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vSerialClose( xComPortHandle xPort )
|
||||
{
|
||||
/* Not supported as not required by the demo application. */
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* Serial port ISR. This can cause a context switch so is not defined as a
|
||||
standard ISR using the __irq keyword. Instead a wrapper function is defined
|
||||
within serialISR.s79 which in turn calls this function. See the port
|
||||
documentation on the FreeRTOS.org website for more information. */
|
||||
__arm void vSerialISR( void )
|
||||
{
|
||||
unsigned portSHORT usStatus;
|
||||
signed portCHAR cChar;
|
||||
portBASE_TYPE xTaskWokenByTx = pdFALSE, xTaskWokenByPost = pdFALSE;
|
||||
|
||||
/* What caused the interrupt? */
|
||||
usStatus = UART_FlagStatus( UART0 );
|
||||
|
||||
if( usStatus & UART_TxHalfEmpty )
|
||||
{
|
||||
/* The interrupt was caused by the THR becoming empty. Are there any
|
||||
more characters to transmit? */
|
||||
if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xTaskWokenByTx ) == pdTRUE )
|
||||
{
|
||||
/* A character was retrieved from the queue so can be sent to the
|
||||
THR now. */
|
||||
UART0->TxBUFR = cChar;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Queue empty, nothing to send so turn off the Tx interrupt. */
|
||||
serINTERRUPT_OFF();
|
||||
}
|
||||
}
|
||||
|
||||
if( usStatus & UART_RxBufFull )
|
||||
{
|
||||
/* The interrupt was caused by a character being received. Grab the
|
||||
character from the RHR and place it in the queue of received
|
||||
characters. */
|
||||
cChar = UART0->RxBUFR;
|
||||
xTaskWokenByPost = xQueueSendFromISR( xRxedChars, &cChar, xTaskWokenByPost );
|
||||
}
|
||||
|
||||
/* If a task was woken by either a character being received or a character
|
||||
being transmitted then we may need to switch to another task. */
|
||||
portEND_SWITCHING_ISR( ( xTaskWokenByPost || xTaskWokenByTx ) );
|
||||
|
||||
/* End the interrupt in the EIC. */
|
||||
portCLEAR_EIC();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
24
Demo/ARM7_STR71x_IAR/serial/serialISR.s79
Normal file
24
Demo/ARM7_STR71x_IAR/serial/serialISR.s79
Normal file
|
@ -0,0 +1,24 @@
|
|||
RSEG ICODE:CODE
|
||||
CODE32
|
||||
|
||||
EXTERN vSerialISR
|
||||
PUBLIC vSerialISREntry
|
||||
|
||||
; Wrapper for the serial port interrupt service routine. This can cause a
|
||||
; context switch so requires an assembly wrapper.
|
||||
|
||||
; Defines the portSAVE_CONTEXT and portRESTORE_CONTEXT macros.
|
||||
#include "ISR_Support.h"
|
||||
|
||||
vSerialISREntry:
|
||||
|
||||
portSAVE_CONTEXT ; Save the context of the current task.
|
||||
|
||||
bl vSerialISR ; Call the ISR routine.
|
||||
|
||||
portRESTORE_CONTEXT ; Restore the context of the current task -
|
||||
; which may be different to the task that
|
||||
; was interrupted.
|
||||
|
||||
END
|
||||
|
81
Demo/ARM7_STR71x_IAR/settings/RTOSDemo.dbgdt
Normal file
81
Demo/ARM7_STR71x_IAR/settings/RTOSDemo.dbgdt
Normal file
|
@ -0,0 +1,81 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
||||
<Project>
|
||||
<Desktop>
|
||||
<Static>
|
||||
<Workspace>
|
||||
<ColumnWidths>
|
||||
|
||||
|
||||
|
||||
|
||||
<Column0>129</Column0><Column1>27</Column1><Column2>27</Column2><Column3>27</Column3></ColumnWidths>
|
||||
</Workspace>
|
||||
<Disassembly>
|
||||
<PreferedWindows>
|
||||
|
||||
|
||||
|
||||
|
||||
<Position>2</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows/></PreferedWindows>
|
||||
|
||||
|
||||
|
||||
<MixedMode>1</MixedMode><CodeCovEnabled>0</CodeCovEnabled><CodeCovShow>0</CodeCovShow></Disassembly>
|
||||
<Debug-Log/>
|
||||
<Build>
|
||||
|
||||
|
||||
|
||||
|
||||
<ColumnWidth0>20</ColumnWidth0><ColumnWidth1>1153</ColumnWidth1><ColumnWidth2>307</ColumnWidth2><ColumnWidth3>76</ColumnWidth3></Build>
|
||||
<Register><PreferedWindows><Position>2</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows/></PreferedWindows></Register><Breakpoints/></Static>
|
||||
<Windows>
|
||||
|
||||
|
||||
<Wnd2>
|
||||
<Tabs>
|
||||
<Tab>
|
||||
<Identity>TabID-24393-22702</Identity>
|
||||
<TabName>Workspace</TabName>
|
||||
<Factory>Workspace</Factory>
|
||||
<Session>
|
||||
|
||||
<NodeDict><ExpandedNode>RTOSDemo</ExpandedNode><ExpandedNode>RTOSDemo/Demo Source</ExpandedNode><ExpandedNode>RTOSDemo/RTOS Source</ExpandedNode><ExpandedNode>RTOSDemo/System Files</ExpandedNode><ExpandedNode>RTOSDemo/System Files/vect.s79</ExpandedNode></NodeDict></Session>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
<SelectedTab>0</SelectedTab></Wnd2><Wnd3>
|
||||
<Tabs>
|
||||
<Tab>
|
||||
<Identity>TabID-13122-22708</Identity>
|
||||
<TabName>Debug Log</TabName>
|
||||
<Factory>Debug-Log</Factory>
|
||||
<Session/>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<Identity>TabID-23870-22711</Identity>
|
||||
<TabName>Build</TabName>
|
||||
<Factory>Build</Factory>
|
||||
<Session/>
|
||||
</Tab>
|
||||
<Tab><Identity>TabID-19116-28152</Identity><TabName>Breakpoints</TabName><Factory>Breakpoints</Factory><Session/></Tab></Tabs>
|
||||
|
||||
<SelectedTab>0</SelectedTab></Wnd3><Wnd0><Tabs><Tab><Identity>TabID-10243-6871</Identity><TabName>Register</TabName><Factory>Register</Factory><Session><REG1>0</REG1><REG2>0</REG2><Group>0</Group><States>1</States><State0>CPSR</State0></Session></Tab></Tabs><SelectedTab>0</SelectedTab></Wnd0></Windows>
|
||||
<Editor>
|
||||
|
||||
|
||||
|
||||
|
||||
<Pane/><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
|
||||
<Positions>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<Top><Row0><Sizes><Toolbar-0084c368><key>iaridepm1</key></Toolbar-0084c368><Toolbar-011f0628><key>debuggergui1</key></Toolbar-011f0628></Sizes></Row0></Top><Left><Row0><Sizes><Wnd2><Rect><Top>-2</Top><Left>-2</Left><Bottom>853</Bottom><Right>203</Right><x>-2</x><y>-2</y><xscreen>125</xscreen><yscreen>125</yscreen><sizeHorzCX>78125</sizeHorzCX><sizeHorzCY>111706</sizeHorzCY><sizeVertCX>128124</sizeVertCX><sizeVertCY>764075</sizeVertCY></Rect></Wnd2></Sizes></Row0></Left><Right><Row0><Sizes><Wnd0><Rect><Top>-2</Top><Left>-2</Left><Bottom>853</Bottom><Right>447</Right><x>-2</x><y>-2</y><xscreen>200</xscreen><yscreen>200</yscreen><sizeHorzCX>125000</sizeHorzCX><sizeHorzCY>178731</sizeHorzCY><sizeVertCX>280625</sizeVertCX><sizeVertCY>764075</sizeVertCY></Rect></Wnd0></Sizes></Row0></Right><Bottom><Row0><Sizes><Wnd3><Rect><Top>-2</Top><Left>-2</Left><Bottom>219</Bottom><Right>1602</Right><x>-2</x><y>-2</y><xscreen>1604</xscreen><yscreen>221</yscreen><sizeHorzCX>1002500</sizeHorzCX><sizeHorzCY>197497</sizeHorzCY><sizeVertCX>78125</sizeVertCX><sizeVertCY>111706</sizeVertCY></Rect></Wnd3></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>
|
||||
</Desktop>
|
||||
</Project>
|
||||
|
||||
|
23
Demo/ARM7_STR71x_IAR/settings/RTOSDemo.dni
Normal file
23
Demo/ARM7_STR71x_IAR/settings/RTOSDemo.dni
Normal file
|
@ -0,0 +1,23 @@
|
|||
[DisAssemblyWindow]
|
||||
NumStates=_ 1
|
||||
State 1=_ 1
|
||||
[JLinkDriver]
|
||||
WatchVectorCatch=_ 0
|
||||
WatchCond=_ 0
|
||||
Watch0=_ 0 "0x00000000" 0 "0x00000000" 0 "0x00000000" 0 "0x00000000" 0 0 0 0
|
||||
Watch1=_ 0 "0x00000000" 0 "0x00000000" 0 "0x00000000" 0 "0x00000000" 0 0 0 0
|
||||
[Low Level]
|
||||
Pipeline mode=0
|
||||
Initialized=0
|
||||
[Disassemble mode]
|
||||
mode=0
|
||||
[Breakpoints]
|
||||
Bp0=_ "Code" "{E:\Dev\FreeRTOS\Source\portable\IAR\STR71x\port.c}.240.4@1" 1 0 0 0 "" 0 ""
|
||||
Count=1
|
||||
[Log file]
|
||||
LoggingEnabled=_ 0
|
||||
LogFile=_ ""
|
||||
Category=_ 0
|
||||
[TermIOLog]
|
||||
LoggingEnabled=_ 0
|
||||
LogFile=_ ""
|
75
Demo/ARM7_STR71x_IAR/settings/RTOSDemo.wsdt
Normal file
75
Demo/ARM7_STR71x_IAR/settings/RTOSDemo.wsdt
Normal file
|
@ -0,0 +1,75 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
||||
<Workspace>
|
||||
<ConfigDictionary>
|
||||
|
||||
<CurrentConfigs><Project>RTOSDemo/Debug</Project></CurrentConfigs></ConfigDictionary>
|
||||
<Desktop>
|
||||
<Static>
|
||||
<Workspace>
|
||||
<ColumnWidths>
|
||||
|
||||
|
||||
|
||||
|
||||
<Column0>227</Column0><Column1>27</Column1><Column2>27</Column2><Column3>27</Column3></ColumnWidths>
|
||||
</Workspace>
|
||||
<Build>
|
||||
|
||||
|
||||
|
||||
|
||||
<ColumnWidth0>20</ColumnWidth0><ColumnWidth1>1153</ColumnWidth1><ColumnWidth2>307</ColumnWidth2><ColumnWidth3>76</ColumnWidth3></Build>
|
||||
<TerminalIO/>
|
||||
<Profiling/>
|
||||
<Debug-Log/>
|
||||
<CodeCoveragePlugin/><Breakpoints/></Static>
|
||||
<Windows>
|
||||
|
||||
|
||||
<Wnd2>
|
||||
<Tabs>
|
||||
<Tab>
|
||||
<Identity>TabID-14962-21036</Identity>
|
||||
<TabName>Workspace</TabName>
|
||||
<Factory>Workspace</Factory>
|
||||
<Session>
|
||||
|
||||
<NodeDict><ExpandedNode>RTOSDemo</ExpandedNode><ExpandedNode>RTOSDemo/source</ExpandedNode></NodeDict></Session>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
<SelectedTab>0</SelectedTab></Wnd2><Wnd3>
|
||||
<Tabs>
|
||||
<Tab>
|
||||
<Identity>TabID-24623-22493</Identity>
|
||||
<TabName>Build</TabName>
|
||||
<Factory>Build</Factory>
|
||||
<Session/>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<Identity>TabID-13645-22698</Identity>
|
||||
<TabName>Debug Log</TabName>
|
||||
<Factory>Debug-Log</Factory>
|
||||
<Session/>
|
||||
</Tab>
|
||||
<Tab><Identity>TabID-25855-25419</Identity><TabName>Breakpoints</TabName><Factory>Breakpoints</Factory><Session/></Tab></Tabs>
|
||||
|
||||
<SelectedTab>0</SelectedTab></Wnd3></Windows>
|
||||
<Editor>
|
||||
|
||||
|
||||
|
||||
|
||||
<Pane><Tab><Factory>TextEditor</Factory><Filename>E:\Dev\FreeRTOS\Demo\ARM7_STR71x_IAR\main.c</Filename><XPos>0</XPos><YPos>98</YPos><SelStart>4693</SelStart><SelEnd>4693</SelEnd></Tab><ActiveTab>0</ActiveTab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
|
||||
<Positions>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<Top><Row0><Sizes><Toolbar-0084c368><key>iaridepm1</key></Toolbar-0084c368></Sizes></Row0><Row1><Sizes><Toolbar-011f0628><key>debuggergui1</key></Toolbar-011f0628></Sizes></Row1></Top><Left><Row0><Sizes><Wnd2><Rect><Top>-2</Top><Left>-2</Left><Bottom>675</Bottom><Right>301</Right><x>-2</x><y>-2</y><xscreen>21</xscreen><yscreen>21</yscreen><sizeHorzCX>13125</sizeHorzCX><sizeHorzCY>18766</sizeHorzCY><sizeVertCX>189375</sizeVertCX><sizeVertCY>605004</sizeVertCY></Rect></Wnd2></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd3><Rect><Top>-2</Top><Left>-2</Left><Bottom>397</Bottom><Right>1602</Right><x>-2</x><y>-2</y><xscreen>1604</xscreen><yscreen>399</yscreen><sizeHorzCX>1002500</sizeHorzCX><sizeHorzCY>356568</sizeHorzCY><sizeVertCX>13125</sizeVertCX><sizeVertCY>18766</sizeVertCY></Rect></Wnd3></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>
|
||||
</Desktop>
|
||||
</Workspace>
|
||||
|
||||
|
127
Demo/ARM7_STR71x_IAR/vect.s79
Normal file
127
Demo/ARM7_STR71x_IAR/vect.s79
Normal file
|
@ -0,0 +1,127 @@
|
|||
#include "FreeRTOSConfig.h"
|
||||
|
||||
IVR_ADDR DEFINE 0xFFFFF818
|
||||
|
||||
;*******************************************************************************
|
||||
; Import the Reset_Handler address from 71x_init.s
|
||||
;*******************************************************************************
|
||||
|
||||
IMPORT __program_start
|
||||
|
||||
;*******************************************************************************
|
||||
; Import exception handlers
|
||||
;*******************************************************************************
|
||||
|
||||
IMPORT vPortYieldProcessor ; FreeRTOS SWI handler
|
||||
|
||||
;*******************************************************************************
|
||||
; Import IRQ handlers from 71x_it.c
|
||||
;*******************************************************************************
|
||||
|
||||
IMPORT vPortNonPreemptiveTick ; Cooperative FreeRTOS tick handler
|
||||
IMPORT vPortPreemptiveTickISR ; Preemptive FreeRTOS tick handler
|
||||
IMPORT vSerialISREntry ; Demo serial port handler
|
||||
|
||||
;*******************************************************************************
|
||||
; Export Peripherals IRQ handlers table address
|
||||
;*******************************************************************************
|
||||
|
||||
CODE32
|
||||
|
||||
|
||||
LDR PC, Reset_Addr
|
||||
LDR PC, Undefined_Addr
|
||||
LDR PC, SWI_Addr
|
||||
LDR PC, Prefetch_Addr
|
||||
LDR PC, Abort_Addr
|
||||
NOP ; Reserved vector
|
||||
LDR PC, =IVR_ADDR
|
||||
LDR PC, FIQ_Addr
|
||||
|
||||
|
||||
|
||||
;*******************************************************************************
|
||||
; Exception handlers address table
|
||||
;*******************************************************************************
|
||||
|
||||
Reset_Addr DCD __program_start
|
||||
Undefined_Addr DCD UndefinedHandler
|
||||
SWI_Addr DCD vPortYieldProcessor
|
||||
Prefetch_Addr DCD PrefetchAbortHandler
|
||||
Abort_Addr DCD DataAbortHandler
|
||||
DCD 0 ; Reserved vector
|
||||
IRQ_Addr DCD IRQHandler
|
||||
FIQ_Addr DCD FIQHandler
|
||||
|
||||
;*******************************************************************************
|
||||
; Peripherals IRQ handlers address table
|
||||
;*******************************************************************************
|
||||
|
||||
EXPORT T0TIMI_Addr
|
||||
|
||||
T0TIMI_Addr DCD DefaultISR
|
||||
FLASH_Addr DCD DefaultISR
|
||||
RCCU_Addr DCD DefaultISR
|
||||
RTC_Addr DCD DefaultISR
|
||||
#if configUSE_PREEMPTION == 0
|
||||
WDG_Addr DCD vPortNonPreemptiveTick ; Tick ISR if the cooperative scheduler is used.
|
||||
#else
|
||||
WDG_Addr DCD vPortPreemptiveTickISR ; Tick ISR if the preemptive scheduler is used.
|
||||
#endif
|
||||
XTI_Addr DCD DefaultISR
|
||||
USBHP_Addr DCD DefaultISR
|
||||
I2C0ITERR_Addr DCD DefaultISR
|
||||
I2C1ITERR_ADDR DCD DefaultISR
|
||||
UART0_Addr DCD vSerialISREntry
|
||||
UART1_Addr DCD DefaultISR
|
||||
UART2_ADDR DCD DefaultISR
|
||||
UART3_ADDR DCD DefaultISR
|
||||
BSPI0_ADDR DCD DefaultISR
|
||||
BSPI1_Addr DCD DefaultISR
|
||||
I2C0_Addr DCD DefaultISR
|
||||
I2C1_Addr DCD DefaultISR
|
||||
CAN_Addr DCD DefaultISR
|
||||
ADC12_Addr DCD DefaultISR
|
||||
T1TIMI_Addr DCD DefaultISR
|
||||
T2TIMI_Addr DCD DefaultISR
|
||||
T3TIMI_Addr DCD DefaultISR
|
||||
DCD 0 ; reserved
|
||||
DCD 0 ; reserved
|
||||
DCD 0 ; reserved
|
||||
HDLC_Addr DCD DefaultISR
|
||||
USBLP_Addr DCD DefaultISR
|
||||
DCD 0 ; reserved
|
||||
DCD 0 ; reserved
|
||||
T0TOI_Addr DCD DefaultISR
|
||||
T0OC1_Addr DCD DefaultISR
|
||||
T0OC2_Addr DCD DefaultISR
|
||||
|
||||
|
||||
;*******************************************************************************
|
||||
; Exception Handlers
|
||||
;*******************************************************************************
|
||||
|
||||
|
||||
UndefinedHandler
|
||||
b UndefinedHandler
|
||||
|
||||
PrefetchAbortHandler
|
||||
b PrefetchAbortHandler
|
||||
|
||||
DataAbortHandler
|
||||
b DataAbortHandler
|
||||
|
||||
IRQHandler
|
||||
b DefaultISR
|
||||
|
||||
FIQHandler
|
||||
b FIQHandler
|
||||
|
||||
DefaultISR
|
||||
b DefaultISR
|
||||
|
||||
|
||||
|
||||
LTORG
|
||||
|
||||
END
|
Loading…
Add table
Add a link
Reference in a new issue