|
From: <ak...@us...> - 2008-02-24 22:07:21
|
Revision: 858
http://can.svn.sourceforge.net/can/?rev=858&view=rev
Author: akhe
Date: 2008-02-24 14:07:18 -0800 (Sun, 24 Feb 2008)
Log Message:
-----------
Fixed IAR CAN sample for STR 73x
Modified Paths:
--------------
trunk/firmware/arm/str/cantest_str73x_iar/73x_conf.h
trunk/firmware/arm/str/cantest_str73x_iar/73x_it.c
trunk/firmware/arm/str/cantest_str73x_iar/cantest.dep
trunk/firmware/arm/str/cantest_str73x_iar/cantest.ewd
trunk/firmware/arm/str/cantest_str73x_iar/cantest.ewp
trunk/firmware/arm/str/cantest_str73x_iar/main.c
trunk/firmware/arm/str/cantest_str73x_iar/str73x_lib/source/73x_can.c
trunk/firmware/arm/str/vcp_str75x_iar/project/Virtual Com Port.dep
trunk/firmware/arm/str/vcp_str75x_iar/project/settings/Virtual Com Port.wsdt
Added Paths:
-----------
trunk/firmware/arm/str/cantest_str73x_iar/Kopia av main.c
trunk/firmware/arm/str/cantest_str73x_iar/settings/GettingStarted.cspy.bat
trunk/firmware/arm/str/cantest_str73x_iar/settings/GettingStarted.dbgdt
trunk/firmware/arm/str/cantest_str73x_iar/settings/GettingStarted.dni
trunk/firmware/arm/str/cantest_str73x_iar/settings/GettingStarted.wsdt
trunk/firmware/arm/str/cantest_str73x_iar/settings/cantest..wsdt
trunk/firmware/arm/str/cantest_str73x_iar/settings/cantest.cspy.bat
trunk/firmware/arm/str/cantest_str73x_iar/settings/cantest.dbgdt
trunk/firmware/arm/str/cantest_str73x_iar/settings/cantest.dni
trunk/firmware/arm/str/cantest_str73x_iar/settings/cantest.wsdt
trunk/firmware/arm/str/cantest_str75x_iar/
trunk/firmware/arm/str/cantest_str75x_iar/73x_conf.h
trunk/firmware/arm/str/cantest_str75x_iar/73x_it.c
trunk/firmware/arm/str/cantest_str75x_iar/73x_lcd.c
trunk/firmware/arm/str/cantest_str75x_iar/73x_lcd.h
trunk/firmware/arm/str/cantest_str75x_iar/Readme.txt
trunk/firmware/arm/str/cantest_str75x_iar/Startup/
trunk/firmware/arm/str/cantest_str75x_iar/Startup/73x_init.s
trunk/firmware/arm/str/cantest_str75x_iar/Startup/73x_vect.s
trunk/firmware/arm/str/cantest_str75x_iar/Startup/75x_init.s
trunk/firmware/arm/str/cantest_str75x_iar/Startup/75x_vect.s
trunk/firmware/arm/str/cantest_str75x_iar/cantest.dep
trunk/firmware/arm/str/cantest_str75x_iar/cantest.ewd
trunk/firmware/arm/str/cantest_str75x_iar/cantest.ewp
trunk/firmware/arm/str/cantest_str75x_iar/cantest.eww
trunk/firmware/arm/str/cantest_str75x_iar/linker/
trunk/firmware/arm/str/cantest_str75x_iar/linker/STR73x_FLASH.icf
trunk/firmware/arm/str/cantest_str75x_iar/linker/STR73x_RAM.icf
trunk/firmware/arm/str/cantest_str75x_iar/linker/STR75x_FLASH.icf
trunk/firmware/arm/str/cantest_str75x_iar/linker/STR75x_RAM.icf
trunk/firmware/arm/str/cantest_str75x_iar/linker/STR75x_SMI.icf
trunk/firmware/arm/str/cantest_str75x_iar/main.c
trunk/firmware/arm/str/cantest_str75x_iar/settings/
trunk/firmware/arm/str/cantest_str75x_iar/settings/GettingStarted.cspy.bat
trunk/firmware/arm/str/cantest_str75x_iar/settings/GettingStarted.dbgdt
trunk/firmware/arm/str/cantest_str75x_iar/settings/GettingStarted.dni
trunk/firmware/arm/str/cantest_str75x_iar/settings/GettingStarted.wsdt
trunk/firmware/arm/str/cantest_str75x_iar/settings/cantest..wsdt
trunk/firmware/arm/str/cantest_str75x_iar/settings/cantest.cspy.bat
trunk/firmware/arm/str/cantest_str75x_iar/settings/cantest.dbgdt
trunk/firmware/arm/str/cantest_str75x_iar/settings/cantest.dni
trunk/firmware/arm/str/cantest_str75x_iar/settings/cantest.wsdt
trunk/firmware/arm/str/cantest_str75x_iar/str75x_lib/
trunk/firmware/arm/str/vcp_str75x_iar/Software Driver/alternativ.inf
Modified: trunk/firmware/arm/str/cantest_str73x_iar/73x_conf.h
===================================================================
--- trunk/firmware/arm/str/cantest_str73x_iar/73x_conf.h 2008-02-17 21:39:29 UTC (rev 857)
+++ trunk/firmware/arm/str/cantest_str73x_iar/73x_conf.h 2008-02-24 22:07:18 UTC (rev 858)
@@ -1,9 +1,9 @@
-/******************** (C) COPYRIGHT 2005 STMicroelectronics **********************
+/******************** (C) COPYRIGHT 2005 STMicroelectronics ********************
* File Name : 73x_conf.h
* Author : MCD Application Team
* Date First Issued : 09/27/2005 : V1.0
* Description : Library configuration file
-**********************************************************************************
+********************************************************************************
* History:
* 09/27/2005 : V1.0
**********************************************************************************
@@ -23,12 +23,12 @@
#define DEBUG
-/*************************FLASHR************************/
+/*************************FLASHR*************************/
//#define _FLASHR
-/*************************FLASHPR***********************/
+/*************************FLASHPR************************/
//#define _FLASHPR
/*************************PRCCU*************************/
-//#define _PRCCU
+#define _PRCCU
/*************************ARB***************************/
//#define _ARB
/*************************CFG*************************/
@@ -67,10 +67,10 @@
/*************************WIU*************************/
//#define _WIU
/*************************CAN*************************/
-//#define _CAN
-//#define _CAN0
-//#define _CAN1
-//#define _CAN2
+#define _CAN
+#define _CAN0
+#define _CAN1
+#define _CAN2
/*************************PWM*************************/
//#define _PWM
//#define _PWM0
@@ -104,18 +104,14 @@
/*************************CMU*************************/
#define _CMU
/*************************ADC*************************/
-#define _ADC
+//#define _ADC
/*************************EIC*************************/
#define _EIC
-
-
#define Main_Oscillator 4000000 /* Value of the Main Quartz in Hz*/
#define RC_oscillator 2340000 /* Typical Reset Value of the Internal RC in Hz */
-
#endif /* __73x_CONF_H */
/******************* (C) COPYRIGHT 2005 STMicroelectronics *****END OF FILE****/
-
Modified: trunk/firmware/arm/str/cantest_str73x_iar/73x_it.c
===================================================================
--- trunk/firmware/arm/str/cantest_str73x_iar/73x_it.c 2008-02-17 21:39:29 UTC (rev 857)
+++ trunk/firmware/arm/str/cantest_str73x_iar/73x_it.c 2008-02-24 22:07:18 UTC (rev 858)
@@ -24,18 +24,31 @@
*********************************************************************************/
/* Standard include ------------------------------------------------------------*/
#include "73x_lib.h"
-
-extern u16 Conversion_Value;
-u16 AnalogWatchdog_Result;
-
-
-
/* Include of other module interface headers -----------------------------------*/
/* Local includes --------------------------------------------------------------*/
/* Private typedef -------------------------------------------------------------*/
/* Private define --------------------------------------------------------------*/
+enum {
+ CAN0_TX_MSGOBJ = 0,
+ CAN0_RX_MSGOBJ = 1
+};
+
+enum {
+ CAN1_TX_MSGOBJ = 0,
+ CAN1_RX_MSGOBJ = 1
+};
+
+enum {
+ CAN2_TX_MSGOBJ = 0,
+ CAN2_RX_MSGOBJ = 1
+};
+
/* Private macro ---------------------------------------------------------------*/
/* Private variables -----------------------------------------------------------*/
+extern canmsg RxCan0Msg;
+extern canmsg RxCan1Msg;
+extern canmsg RxCan2Msg;
+
/* Private function prototypes -------------------------------------------------*/
/* Interface functions ---------------------------------------------------------*/
/* Private functions -----------------------------------------------------------*/
@@ -44,9 +57,9 @@
/*******************************************************************************
* Function Name : Undefined_Handler
* Description : This function Undefined instruction exception.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void Undefined_Handler(void)
{
@@ -54,9 +67,9 @@
/*******************************************************************************
* Function Name : FIQ_Handler
* Description : This function handles FIQ exception.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void FIQ_Handler(void)
{
@@ -64,9 +77,9 @@
/*******************************************************************************
* Function Name : SWI_Handler
* Description : This function handles SW exception.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void SWI_Handler(void)
{
@@ -74,9 +87,9 @@
/*******************************************************************************
* Function Name : Prefetch_Handler
* Description : This function handles preftetch abort exception.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void Prefetch_Handler(void)
{
@@ -84,9 +97,9 @@
/*******************************************************************************
* Function Name : Abort_Handler
* Description : This function handles data abort exception.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void Abort_Handler(void)
{
@@ -94,9 +107,9 @@
/*******************************************************************************
* Function Name : PRCCUCMU_IRQHandler
* Description : This function handlesthe PRCCU and the CMU interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void PRCCUCMU_IRQHandler(void)
{
@@ -105,9 +118,9 @@
/*******************************************************************************
* Function Name : EXTIT01_IRQHandler
* Description : This function handles External line1 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void EXTIT01_IRQHandler (void)
{
@@ -116,9 +129,9 @@
/*******************************************************************************
* Function Name : EXTIT02_IRQHandler
* Description : This function handles External line2 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void EXTIT02_IRQHandler (void)
{
@@ -127,9 +140,9 @@
/*******************************************************************************
* Function Name : EXTIT03_IRQHandler
* Description : This function handles External line3 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void EXTIT03_IRQHandler (void)
{
@@ -138,9 +151,9 @@
/*******************************************************************************
* Function Name : EXTIT04_IRQHandler
* Description : This function handles External line 4 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void EXTIT04_IRQHandler (void)
{
@@ -149,9 +162,9 @@
/*******************************************************************************
* Function Name : EXTIT05_IRQHandler
* Description : This function handles External line 5 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void EXTIT05_IRQHandler (void)
{
@@ -160,9 +173,9 @@
/*******************************************************************************
* Function Name : EXTIT06_IRQHandler
* Description : This function handles External line 6 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void EXTIT06_IRQHandler (void)
{
@@ -171,9 +184,9 @@
/*******************************************************************************
* Function Name : EXTIT07_IRQHandler
* Description : This function handles External line7 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void EXTIT07_IRQHandler (void)
{
@@ -182,9 +195,9 @@
/*******************************************************************************
* Function Name : EXTIT08_IRQHandler
* Description : This function handles External line8 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void EXTIT08_IRQHandler (void)
{
@@ -193,9 +206,9 @@
/*******************************************************************************
* Function Name : EXTIT09_IRQHandler
* Description : This function handles External line9 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void EXTIT09_IRQHandler (void)
{
@@ -204,9 +217,9 @@
/*******************************************************************************
* Function Name : EXTIT10_IRQHandler
* Description : This function handles External line10 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void EXTIT10_IRQHandler (void)
{
@@ -215,9 +228,9 @@
/*******************************************************************************
* Function Name : EXTIT11_IRQHandler
* Description : This function handles External line11 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void EXTIT11_IRQHandler (void)
{
@@ -226,9 +239,9 @@
/*******************************************************************************
* Function Name : EXTIT12_IRQHandler
* Description : This function handles External line12 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void EXTIT12_IRQHandler (void)
{
@@ -237,9 +250,9 @@
/*******************************************************************************
* Function Name : EXTIT13_IRQHandler
* Description : This function handles External line13 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void EXTIT13_IRQHandler (void)
{
@@ -248,9 +261,9 @@
/*******************************************************************************
* Function Name : EXTIT14_IRQHandler
* Description : This function handles External line14 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void EXTIT14_IRQHandler (void)
{
@@ -259,9 +272,9 @@
/*******************************************************************************
* Function Name : EXTIT15_IRQHandler
* Description : This function handles External line15 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void EXTIT15_IRQHandler (void)
{
@@ -270,9 +283,9 @@
/*******************************************************************************
* Function Name : DMATRERR_IRQHandler
* Description : This function handles the DMA transfer error interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void DMATRERR_IRQHandler (void)
{
@@ -281,9 +294,9 @@
/*******************************************************************************
* Function Name : TIM1_IRQHandler
* Description : This function handles the TIM1 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void TIM1_IRQHandler (void)
{
@@ -292,9 +305,9 @@
/*******************************************************************************
* Function Name : TIM2_IRQHandler
* Description : This function handles the TIM2 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void TIM2_IRQHandler (void)
{
@@ -303,9 +316,9 @@
/*******************************************************************************
* Function Name : TIM3_IRQHandler
* Description : This function handles the TIM3 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void TIM3_IRQHandler (void)
{
@@ -314,9 +327,9 @@
/*******************************************************************************
* Function Name : TIM4_IRQHandler
* Description : This function handles the TIM4 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void TIM4_IRQHandler (void)
{
@@ -325,9 +338,9 @@
/*******************************************************************************
* Function Name : TB0_IRQHandler
* Description : This function handles the TB0 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void TB0_IRQHandler (void)
{
@@ -336,9 +349,9 @@
/*******************************************************************************
* Function Name : TB1_IRQHandler
* Description : This function handles the TB1 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void TB1_IRQHandler (void)
{
@@ -347,9 +360,9 @@
/*******************************************************************************
* Function Name : TB2_IRQHandler
* Description : This function handles the TB2 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void TB2_IRQHandler (void)
{
@@ -358,9 +371,9 @@
/*******************************************************************************
* Function Name : TIM5_IRQHandler
* Description : This function handles the TIM5 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void TIM5_IRQHandler (void)
{
@@ -369,9 +382,9 @@
/*******************************************************************************
* Function Name : TIM6_IRQHandler
* Description : This function handles the TIM6 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void TIM6_IRQHandler (void)
{
@@ -380,9 +393,9 @@
/*******************************************************************************
* Function Name : TIM7_IRQHandler
* Description : This function handles the TIM7 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void TIM7_IRQHandler (void)
{
@@ -391,9 +404,9 @@
/*******************************************************************************
* Function Name : TIM8_IRQHandler
* Description : This function handles the TIM8 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void TIM8_IRQHandler (void)
{
@@ -402,9 +415,9 @@
/*******************************************************************************
* Function Name : TIM9_IRQHandler
* Description : This function handles the TIM9 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void TIM9_IRQHandler (void)
{
@@ -414,9 +427,9 @@
/*******************************************************************************
* Function Name : UART2_IRQHandler
* Description : This function handles the UART2 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void UART2_IRQHandler (void)
{
@@ -425,9 +438,9 @@
/*******************************************************************************
* Function Name : UART3_IRQHandler
* Description : This function handles the UART3 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void UART3_IRQHandler (void)
{
@@ -437,9 +450,9 @@
/*******************************************************************************
* Function Name : FlashEOP_IRQHandler
* Description : This function handles the FLASH end of program interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void FLASHEOP_IRQHandler (void)
{
@@ -448,9 +461,9 @@
/*******************************************************************************
* Function Name : PWM0_IRQHandler
* Description : This function handles the PWM0 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void PWM0_IRQHandler (void)
{
@@ -459,9 +472,9 @@
/*******************************************************************************
* Function Name : PWM1_IRQHandler
* Description : This function handles the PWM1 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void PWM1_IRQHandler (void)
{
@@ -470,9 +483,9 @@
/*******************************************************************************
* Function Name : PWM2_IRQHandler
* Description : This function handles the PWM2 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void PWM2_IRQHandler (void)
{
@@ -481,9 +494,9 @@
/*******************************************************************************
* Function Name : PWM3_IRQHandler
* Description : This function handles the PWM3 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void PWM3_IRQHandler (void)
{
@@ -492,9 +505,9 @@
/*******************************************************************************
* Function Name : PWM4_IRQHandler
* Description : This function handles the PWM4 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void PWM4_IRQHandler (void)
{
@@ -503,9 +516,9 @@
/*******************************************************************************
* Function Name : PWM5_IRQHandler
* Description : This function handles the PWM5 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void PWM5_IRQHandler (void)
{
@@ -514,9 +527,9 @@
/*******************************************************************************
* Function Name : WIU_IRQHandler
* Description : This function handles the wake-up system interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void WIU_IRQHandler (void)
{
@@ -525,9 +538,9 @@
/*******************************************************************************
* Function Name : WDGWUT_IRQHandler
* Description : This function handles the watchdog and the wakeup timer interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void WDGWUT_IRQHandler (void)
{
@@ -536,9 +549,9 @@
/*******************************************************************************
* Function Name : BSPI0_IRQHandler
* Description : This function handles the BSPI0 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void BSPI0_IRQHandler (void)
{
@@ -547,9 +560,9 @@
/*******************************************************************************
* Function Name : BSPI1_IRQHandler
* Description : This function handles the BSPI1 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void BSPI1_IRQHandler (void)
{
@@ -558,9 +571,9 @@
/*******************************************************************************
* Function Name : BSPI2_IRQHandler
* Description : This function handles the BSPI2 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void BSPI2_IRQHandler (void)
{
@@ -569,9 +582,9 @@
/*******************************************************************************
* Function Name : UART0_IRQHandler
* Description : This function handles the UART0 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void UART0_IRQHandler (void)
{
@@ -580,9 +593,9 @@
/*******************************************************************************
* Function Name : UART1_IRQHandler
* Description : This function handles the UART1 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void UART1_IRQHandler (void)
{
@@ -591,9 +604,9 @@
/*******************************************************************************
* Function Name : I2C0ITERR_IRQHandler
* Description : This function handles the I2C0 and DMA Error Interrupt requests
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void I2C0ITERR_IRQHandler (void)
{
@@ -602,9 +615,9 @@
/*******************************************************************************
* Function Name : I2C1ITERR_IRQHandler
* Description : This function handles the I2C1 and DMA Error Interrupt requests.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void I2C1ITERR_IRQHandler (void)
{
@@ -613,9 +626,9 @@
/*******************************************************************************
* Function Name : I2C0ITDDC_IRQHandler
* Description : This function handles the I2C0 and the General Interrupt requests.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void I2C0ITDDC_IRQHandler (void)
{
@@ -624,9 +637,9 @@
/*******************************************************************************
* Function Name : I2C1ITDDC_IRQHandler
* Description : This function handles the I2C1 and the General Interrupt requests
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void I2C1ITDDC_IRQHandler (void)
{
@@ -635,43 +648,114 @@
/*******************************************************************************
* Function Name : CAN0_IRQHandler
* Description : This function handles the CAN0 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void CAN0_IRQHandler (void)
{
+ u32 msgobj;
+
+
+ if (CAN0->IDR == 0x8000) /* status interrupt */
+ (void)CAN0->SR; /* read the status register to clear */
+ else if ((CAN0->IDR >= 1) && (CAN0->IDR <= 32))
+ {
+ /* Get the message object number that caused the interrupt to occur*/
+ switch (msgobj = CAN0->IDR - 1)
+ {
+ case CAN0_TX_MSGOBJ:
+ GPIO_BitWrite(GPIO0, GPIO_PIN_7 , Bit_SET);
+ CAN_ReleaseTxMessage(CAN0, msgobj);
+ break;
+
+ case CAN0_RX_MSGOBJ:
+ CAN_ReceiveMessage(CAN0, msgobj, FALSE, &RxCan0Msg);
+ CAN_ReleaseRxMessage(CAN0, msgobj);
+ break;
+
+ default:
+ CAN_ReleaseMessage(CAN0, msgobj);
+ }
+ }
}
/*******************************************************************************
* Function Name : CAN1_IRQHandler
* Description : This function handles the CAN1 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void CAN1_IRQHandler (void)
{
+ u32 msgobj;
+
+ if (CAN1->IDR == 0x8000) /*status interrupt*/
+ (void)CAN1->SR; /* read the status register to clear*/
+ else if ((CAN1->IDR >= 1) && (CAN1->IDR <= 32))
+ {
+ /* get the message object number that caused the interrupt to occur*/
+ switch (msgobj = CAN1->IDR - 1)
+ {
+ case CAN1_TX_MSGOBJ:
+ GPIO_BitWrite(GPIO0, GPIO_PIN_9 , Bit_SET);
+ CAN_ReleaseTxMessage(CAN1, msgobj);
+ break;
+
+ case CAN1_RX_MSGOBJ:
+ CAN_ReceiveMessage(CAN1, msgobj, FALSE, &RxCan1Msg);
+ CAN_ReleaseRxMessage(CAN1, msgobj);
+ break;
+
+ default:
+ CAN_ReleaseMessage(CAN1, msgobj);
+ }
+ }
}
/*******************************************************************************
* Function Name : CAN2_IRQHandler
* Description : This function handles the CAN2 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void CAN2_IRQHandler (void)
{
+ u32 msgobj;
+
+
+ if (CAN2->IDR == 0x8000) /* status interrupt*/
+ (void)CAN2->SR; /* read the status register to clear*/
+ else if (CAN2->IDR >= 1 && CAN2->IDR <= 32)
+ {
+ /* get the message object number that caused the interrupt to occur*/
+ switch (msgobj = CAN2->IDR - 1)
+ {
+ case CAN2_TX_MSGOBJ:
+ GPIO_BitWrite(GPIO0, GPIO_PIN_11 , Bit_SET);
+ CAN_ReleaseTxMessage(CAN2, msgobj);
+ break;
+
+ case CAN2_RX_MSGOBJ:
+ CAN_ReceiveMessage(CAN2, msgobj, FALSE, &RxCan2Msg);
+ CAN_ReleaseRxMessage(CAN2, msgobj);
+ break;
+
+ default:
+ CAN_ReleaseMessage(CAN2, msgobj);
+ }
+ }
}
/*******************************************************************************
* Function Name : DMA0_IRQHandler
* Description : This function handles the DMA0 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void DMA0_IRQHandler (void)
{
@@ -680,9 +764,9 @@
/*******************************************************************************
* Function Name : DMA1_IRQHandler
* Description : This function handles the DMA1 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void DMA1_IRQHandler (void)
{
@@ -691,9 +775,9 @@
/*******************************************************************************
* Function Name : DMA2_IRQHandler
* Description : This function handles the DMA2 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void DMA2_IRQHandler (void)
{
@@ -702,9 +786,9 @@
/*******************************************************************************
* Function Name : DMA3_IRQHandler
* Description : This function handles the DMA3 interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void DMA3_IRQHandler (void)
{
@@ -713,28 +797,20 @@
/*******************************************************************************
* Function Name : ADC_IRQHandler
* Description : This function handles the ADC interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void ADC_IRQHandler (void)
{
- Conversion_Value = ADC_GetConversionValue(ADC_CHANNEL0);
- /* Clear EOC Interrupt pending bit */
- ADC_FlagClear (ADC_FLAG_EOC );
- /* Clear the last Analog Watchdog0 comparison result */
- ADC_FlagClear (ADC_FLAG_AnalogWatchdog0_HighThresold | ADC_FLAG_AnalogWatchdog0_LowThresold);
-
- ADC_ConversionCmd (ADC_ConversionStop);
-
}
/*******************************************************************************
* Function Name : RTC_IRQHandler
* Description : This function handles the RTC interrupt request.
-* Input : detail input parameters
-* Output : detail output parameters
-* Return : detail return value
+* Input : None
+* Output : None
+* Return : None
*******************************************************************************/
void RTC_IRQHandler (void)
{
@@ -742,4 +818,3 @@
/******************* (C) COPYRIGHT 2005 STMicroelectronics *****END OF FILE****/
-
Added: trunk/firmware/arm/str/cantest_str73x_iar/Kopia av main.c
===================================================================
--- trunk/firmware/arm/str/cantest_str73x_iar/Kopia av main.c (rev 0)
+++ trunk/firmware/arm/str/cantest_str73x_iar/Kopia av main.c 2008-02-24 22:07:18 UTC (rev 858)
@@ -0,0 +1,509 @@
+/******************** (C) COPYRIGHT 2005 STMicroelectronics **********************
+* File Name : main.c
+* Author : MCD Application Team
+* Date First Issued : 09/27/2005 : V1.0
+* Description : Main program body
+**********************************************************************************
+* History:
+* 09/27/2005 : V1.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.
+*********************************************************************************/
+
+/* Standard include ------------------------------------------------------------*/
+#include "73x_lib.h"
+#include "73x_rtc.h"
+#include "73x_prccu.h"
+#include "73x_can.h"
+#include "73x_lcd.h"
+/* Include of other module interface headers -----------------------------------*/
+/* Local includes --------------------------------------------------------------*/
+/* Private typedef -------------------------------------------------------------*/
+/* Private define --------------------------------------------------------------*/
+/* Private macro ---------------------------------------------------------------*/
+/* Private variables -----------------------------------------------------------*/
+u16 Conversion_Value = 0;
+u8 buffer[11] = "ADC: ";
+
+/* Peripherals Init Structures */
+GPIO_InitTypeDef GPIO0_InitStructure;
+GPIO_InitTypeDef GPIO3_InitStructure;
+ADC_InitTypeDef ADC_InitStructure;
+CMU_InitTypeDef CMU_InitStructure;
+RTC_InitTypeDef RTC_InitStructure;
+
+/* Private function prototypes -------------------------------------------------*/
+unsigned int millier(unsigned int val){
+ return((val/1000) + 0x30);
+}
+unsigned int centaine(unsigned int val){
+ unsigned int valCopy;
+ valCopy = val % 1000;
+ return((valCopy/100) + 0x30);
+}
+unsigned int dixaine(unsigned int val){
+ unsigned int valCopy;
+ valCopy = val % 100;
+ return((valCopy/10) + 0x30);
+}
+unsigned int unite(unsigned int val){
+ unsigned int valCopy;
+ valCopy = val % 100;
+ return((valCopy%10) + 0x30);
+}
+
+void MCLK_Config (void);
+unsigned int get1000Digit( unsigned int val );
+unsigned int get100Digit( unsigned int val );
+unsigned int get10Digit( unsigned int val );
+unsigned int get1Digit( unsigned int val );
+
+GPIO_InitTypeDef CAN0_RX;
+GPIO_InitTypeDef CAN0_TX;
+GPIO_InitTypeDef CAN1_RX;
+GPIO_InitTypeDef CAN1_TX;
+GPIO_InitTypeDef CAN2_RX;
+GPIO_InitTypeDef CAN2_TX;
+GPIO_InitTypeDef Led_Config;
+
+// buffer for receive messages
+canmsg RxCan0Msg;
+
+// array of pre-defined transmit messages
+canmsg TxCan0Msg[ 2 ] = {
+ { CAN_STD_ID,
+ 0x123,
+ 4,
+ { 0x01, 0x02, 0x04, 0x08 } },
+ { CAN_EXT_ID,
+ 0x12345678,
+ 8,
+ { 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 } }
+};
+
+// buffer for receive messages
+canmsg RxCan1Msg;
+
+// array of pre-defined transmit messages
+canmsg TxCan1Msg[2] = {
+ { CAN_STD_ID, 0x123, 4, { 0x01, 0x02, 0x04, 0x08 } },
+ { CAN_EXT_ID, 0x12345678, 8, { 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 } }
+};
+
+// buffer for receive messages
+canmsg RxCan2Msg;
+
+// array of pre-defined transmit messages
+canmsg TxCan2Msg[2] = {
+ { CAN_STD_ID, 0x123, 4, { 0x01, 0x02, 0x04, 0x08 } },
+ { CAN_EXT_ID, 0x12345678, 8, { 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 } }
+};
+
+// used message object numbers
+enum {
+ CAN0_TX_MSGOBJ = 0,
+ CAN0_RX_MSGOBJ = 1
+};
+enum {
+ CAN1_TX_MSGOBJ = 0,
+ CAN1_RX_MSGOBJ = 1
+};
+enum {
+ CAN2_TX_MSGOBJ = 0,
+ CAN2_RX_MSGOBJ = 1
+};
+
+
+// define the LEDs
+#define LD1 GPIO_PIN_0
+#define LD2 GPIO_PIN_1
+#define LD3 GPIO_PIN_2
+#define LD4 GPIO_PIN_3
+#define LD5 GPIO_PIN_4
+#define LD6 GPIO_PIN_5
+#define LD7 GPIO_PIN_6
+#define LD8 GPIO_PIN_7
+#define LD9 GPIO_PIN_8
+#define LD10 GPIO_PIN_9
+#define LD11 GPIO_PIN_10
+#define LD12 GPIO_PIN_11
+#define LD13 GPIO_PIN_12
+#define LD14 GPIO_PIN_13
+#define LD15 GPIO_PIN_14
+#define LD16 GPIO_PIN_15
+
+int main(void)
+{
+u32 CPIO_Value;
+#ifdef DEBUG
+ debug();
+#endif
+
+/*-------------------------------------GPIO0 --------------------------------*/
+ /* GPIO0 Clock Enable */
+ CFG_PeripheralClockConfig(CFG_CLK_GPIO0, ENABLE);
+
+ /* GPIO0 Configuration */
+ GPIO0_InitStructure.GPIO_Mode = GPIO_Mode_OUT_PP;
+ GPIO0_InitStructure.GPIO_Pins = GPIO_PIN_ALL ;
+ GPIO_Init (GPIO0, &GPIO0_InitStructure);
+
+/*-----------------------------------GPIO3 ----------------------------------*/
+ /* GPIO3 Clock Enable */
+ CFG_PeripheralClockConfig(CFG_CLK_GPIO3, ENABLE);
+
+ /* GPIO3 Configuration */
+ GPIO3_InitStructure.GPIO_Mode = GPIO_Mode_HI_AIN_TRI;
+ GPIO3_InitStructure.GPIO_Pins = GPIO_PIN_ALL ;
+ GPIO_Init (GPIO3, &GPIO3_InitStructure);
+
+/*-----------------------------------EIC-------------------------------------*/
+ /* EIC Clock Enable */
+ CFG_PeripheralClockConfig(CFG_CLK_EIC, ENABLE);
+ /* EIC Config */
+ EIC_IRQChannelPriorityConfig( ADC_IRQChannel, 1);
+ EIC_IRQChannelConfig( ADC_IRQChannel , ENABLE );
+ EIC_IRQCmd(ENABLE);
+
+/*---------------------------------CMU---------------------------------------*/
+ /* CMU Initialization */
+ CMU_DeInit( );
+ CMU_StructInit(&CMU_InitStructure);
+ /* Enable the external oscillator */
+ CMU_InitStructure.CMU_CKSEL0 = CMU_CKSEL0_CKOSC;
+ CMU_Init(&CMU_InitStructure);
+ /* Disable DIV2 */
+ PRCCU->CFR &= 0x7FFF;
+
+/*---------------------------------ADC---------------------------------------*/
+ /* ADC Clock Enable */
+ CFG_PeripheralClockConfig(CFG_CLK_ADC, ENABLE);
+
+ /* ADC Configuration */
+ ADC_DeInit ();
+ ADC_StructInit(&ADC_InitStructure);
+ ADC_InitStructure.ADC_Calibration = ADC_Calibration_ON;
+ ADC_InitStructure.ADC_CalibAverage = ADC_CalibAverage_Enable;
+ ADC_InitStructure.ADC_AutoClockOff = ADC_AutoClockOff_Disable ;
+ ADC_InitStructure.ADC_ConversionMode = ADC_ConversionMode_Scan ;
+ ADC_InitStructure.ADC_SamplingPrescaler = 0x2;
+ ADC_InitStructure.ADC_ConversionPrescaler = 0x4;
+ ADC_InitStructure.ADC_FirstChannel = ADC_CHANNEL0 ;
+ ADC_InitStructure.ADC_ChannelNumber = 1;
+ ADC_Init (&ADC_InitStructure);
+
+
+ /* EOC interrupt Enable */
+ ADC_ITConfig(ADC_IT_EOC, ENABLE);
+ /* Enable ADC */
+ ADC_Cmd(ENABLE);
+
+ /*---------------------------------RTC---------------------------------------*/
+ // (clock:0-->9) fOSC=4Mhz/RTCP=(2,4,8,16,32,64,128,256,512,1024)
+ // -->EXTCLK=(4M,2M,1M,500K,250K,125K,62.5K,31.25K,15.625K,7.812K)
+
+ // RTC Clock Enable
+ CFG_PeripheralClockConfig( CFG_CLK_RTC , ENABLE );
+
+ // RTC Interrupt Config
+ RTC_ITConfig( RTC_IT_SEC | RTC_IT_ALA | RTC_IT_OV, ENABLE );
+
+ // RTC Configuration
+ RTC_InitStructure.RTC_Alarm = 6; // 0xFFFFFFFF;
+ RTC_InitStructure.RTC_Counter = 0; // 0xFFFFFFFA;
+ // configure RTC=1S ( RCK=1000000/64=CKL32=15625Hz )
+ // 8MHz/64 = 125000 = 0x1E848
+ RTC_InitStructure.RTC_Prescaler = 0x3D09; // == 15625
+ //RTC_InitStructure.RTC_Prescaler = 0x1E848; // 0x3D09; // == 15625
+
+ RTC_Init( &RTC_InitStructure );
+
+ /*---------------------------------CAN---------------------------------------*/
+ CFG_PeripheralClockConfig( CFG_CLK_CAN0, ENABLE );
+ CFG_PeripheralClockConfig( CFG_CLK_CAN1, ENABLE );
+
+ CFG_PeripheralClockConfig( CFG_CLK_GPIO0, ENABLE );
+ CFG_PeripheralClockConfig( CFG_CLK_GPIO1, ENABLE );
+ CFG_PeripheralClockConfig( CFG_CLK_GPIO2, ENABLE );
+ CFG_PeripheralClockConfig( CFG_CLK_GPIO6, ENABLE );
+
+ CAN0_RX.GPIO_Mode = GPIO_Mode_IN_TRI_TTL;
+ CAN0_RX.GPIO_Pins = GPIO_PIN_14;
+ GPIO_Init( GPIO1, &CAN0_RX );
+
+ CAN0_TX.GPIO_Mode = GPIO_Mode_AF_PP;
+ CAN0_TX.GPIO_Pins = GPIO_PIN_15;
+ GPIO_Init( GPIO1, &CAN0_TX );
+
+ CAN1_RX.GPIO_Mode = GPIO_Mode_IN_TRI_TTL;
+ CAN1_RX.GPIO_Pins = GPIO_PIN_1;
+ GPIO_Init( GPIO2, &CAN1_RX );
+
+ CAN1_TX.GPIO_Mode = GPIO_Mode_AF_PP;
+ CAN1_TX.GPIO_Pins = GPIO_PIN_2;
+ GPIO_Init( GPIO2, &CAN1_TX );
+
+ CAN_InitTypeDef CANInit = { 0x0, CAN_BITRATE_500K };
+
+ // initialize the CAN at a standard bitrate, interrupts disabled
+ CAN_Init( CAN0, &CANInit );
+
+ // configure the message objects
+ CAN_EnterInitMode( CAN0, CAN_CR_CCE );
+ CAN_InvalidateAllMsgObj( CAN0 );
+ CAN_SetTxMsgObj( CAN0, CAN0_TX_MSGOBJ, CAN_STD_ID );
+ CAN_SetRxMsgObj( CAN0, CAN0_RX_MSGOBJ, CAN_STD_ID, 0, CAN_LAST_STD_ID, TRUE );
+ CAN_LeaveInitMode( CAN0 );
+
+
+ /*---------------------------------LCD---------------------------------------*/
+
+ /* LCD Configuration */
+ LCD_Init();
+ LCD_LineClear(1);
+ LCD_LineClear(2);
+ LCD_SetPosCur(1,1);
+ /* Display some text on LCD: Line 1 */
+ LCD_SendStringByStep("STR730 CANTEST", 1, 1);
+ LCD_Wait (40000);
+ LCD_SetPosCur(2,1);
+ /* Display "ADC:" message on LCD: Line 2 */
+ LCD_SendStringByStep(buffer,2, 1);
+
+ while(1)
+ {
+ // send a pre-defined data frame
+ CAN_SendMessage( CAN0, CAN0_TX_MSGOBJ, &TxCan0Msg[0] );
+
+ // wait until end of transmission
+ CAN_WaitEndOfTx( CAN0 );
+
+ // release the TX message object
+ CAN_ReleaseTxMessage(CAN0, CAN0_TX_MSGOBJ);
+
+ // Check for a data frame
+ if ( CAN_ReceiveMessage( CAN0, CAN0_RX_MSGOBJ, FALSE, &RxCan0Msg ) ) {
+
+ // Test Received Msg
+ if ( ( RxCan0Msg.IdType == CAN_STD_ID ) &&
+ ( RxCan0Msg.Id == 0x321) &&
+ ( RxCan0Msg.Dlc == 4 ) &&
+ ( RxCan0Msg.Data[ 0 ] == 0x01 ) &&
+ ( RxCan0Msg.Data[ 1 ] == 0x02 ) &&
+ ( RxCan0Msg.Data[ 2 ] == 0x04 ) &&
+ ( RxCan0Msg.Data[ 3 ] == 0x08 ) ){
+
+
+
+ }
+
+ // Release the RX message object
+ CAN_ReleaseRxMessage(CAN0, CAN0_RX_MSGOBJ);
+
+ } // Received frame
+
+
+ /* Start ADC conversion */
+ ADC_ConversionCmd (ADC_ConversionStart);
+ buffer[8] = unite(Conversion_Value);
+ buffer[7] = dixaine(Conversion_Value);
+ buffer[6] = centaine(Conversion_Value);
+ buffer[5] = millier(Conversion_Value);
+ buffer[9] = 0;
+ /* Display ADC conversion Value on LCD */
+ LCD_SendStringByStep(&buffer[5],2, 5);
+ CPIO_Value = 0;
+
+ for(u32 i = (u32)((float)Conversion_Value/60); i; i--)
+ {
+ CPIO_Value <<= 1;
+ CPIO_Value |= 1;
+ }
+ GPIO_WordWrite(GPIO0,CPIO_Value);
+
+ }
+ }
+
+////////////////////////////////////////////////////////////////////////////////
+// get1000Digit
+//
+
+unsigned int get1000Digit( unsigned int val )
+{
+ return ( ( val / 1000 ) + 0x30 );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// get100Digit
+//
+
+unsigned int get100Digit( unsigned int val )
+{
+ unsigned int valCopy;
+ valCopy = val % 1000;
+ return ( (valCopy / 100 ) + 0x30 );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// get10Digit
+//
+
+unsigned int get10Digit( unsigned int val )
+{
+ unsigned int valCopy;
+ valCopy = val % 100;
+ return ( ( valCopy / 10 ) + 0x30 );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// get1Digit
+//
+
+unsigned int get1Digit( unsigned int val )
+{
+ unsigned int valCopy;
+ valCopy = val % 100;
+ return ( ( valCopy % 10 ) + 0x30 );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// wait
+//
+
+void wait( void )
+{
+ u32 i;
+
+ for (i=100000L; i!=0 ; i-- ) {}
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// MCLK_Config
+//
+
+void MCLK_Config (void)
+{
+
+ PRCCU_InitTypeDef Clock;
+ CMU_InitTypeDef ClockInit;
+
+ ClockInit.CMU_RCOscControl = 0x0D; // RC OSC Adjust
+ ClockInit.CMU_EndCountValue = 0x0F; //
+ ClockInit.CMU_FreqRef_High = 0xFF; //
+ ClockInit.CMU_FreqRef_Low = 0xFE; //
+
+ ClockInit.CMU_CKSEL0 = CMU_CKSEL0_CKOSC; // Clock for CLOCK1 (4MHz)
+ ClockInit.CMU_CKSEL1 = CMU_CKSEL1_CKPLL; // Clock for Freq. Meter (8MHz)
+ ClockInit.CMU_CKSEL2 = CMU_CKSEL2_CKOSC; // Clock to drive CMU logic
+
+ CMU_Lock( DISABLE );
+ CMU_Init( &ClockInit );
+
+ // Init. Power Reset Clock unit
+ // 4 MHz * 12 / 6 = 8 MHz = CLOCK2
+ Clock.PRCCU_DIV2 = DISABLE;
+ Clock.PRCCU_MCLKSRC_SRC = PRCCU_MCLKSRC_PLL; // Use PLL in
+ Clock.PRCCU_PLLDIV = PRCCU_PLLDIV_6;
+ Clock.PRCCU_PLLMUL = PRCCU_PLLMUL_12;
+
+ PRCCU_Init( &Clock );
+ PRCCU_SetExtClkDiv(4);
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Modified: trunk/firmware/arm/str/cantest_str73x_iar/cantest.dep
===================================================================
--- trunk/firmware/arm/str/cantest_str73x_iar/cantest.dep 2008-02-17 21:39:29 UTC (rev 857)
+++ trunk/firmware/arm/str/cantest_str73x_iar/cantest.dep 2008-02-24 22:07:18 UTC (rev 858)
@@ -2,320 +2,302 @@
<project>
<fileVersion>2</fileVersion>
- <fileChecksum>1441629299</fileChecksum>
+ <fileChecksum>632056546</fileChecksum>
<configuration>
<name>Debug</name>
<outputs>
- <file>$TOOLKIT_DIR$\inc\DLib_Product.h</file>
- <file>$PROJ_DIR$\Debug\Obj\73x_eic.o</file>
- <file>$PROJ_DIR$\Debug\Obj\73x_it.pbi</file>
- <file>$PROJ_DIR$\Debug\Obj\73x_lcd.o</file>
- <file>$TOOLKIT_DIR$\lib\dl4t_tl_in.a</file>
+ <file>$PROJ_DIR$\str73x_lib\source\73x_cfg.c</file>
+ <file>$PROJ_DIR$\str73x_lib\include\73x_gpio.h</file>
+ <file>$TOOLKIT_DIR$\inc\DLib_Product_string.h</file>
+ <file>$PROJ_DIR$\str73x_lib\source\73x_prccu.c</file>
+ <file>$PROJ_DIR$\Debug\Obj\73x_rtc.o</file>
<file>$PROJ_DIR$\Debug\Obj\main.o</file>
- <file>$TOOLKIT_DIR$\lib\shs_l.a</file>
+ <file>$PROJ_DIR$\Debug\Obj\73x_cmu.pbi</file>
+ <file>$PROJ_DIR$\Debug\Obj\73x_can.pbi</file>
+ <file>$PROJ_DIR$\Startup\73x_init.s</file>
+ <file>$PROJ_DIR$\str73x_lib\source\73x_adc.c</file>
+ <file>$PROJ_DIR$\str73x_lib\source\73x_lib.c</file>
+ <file>$PROJ_DIR$\str73x_lib\include\73x_cmu.h</file>
+ <file>$PROJ_DIR$\Debug\Obj\73x_prccu.o</file>
+ <file>$PROJ_DIR$\str73x_lib\include\73x_type.h</file>
<file>$PROJ_DIR$\Debug\Obj\73x_cfg.pbi</file>
- <file>$PROJ_DIR$\Debug\Obj\73x_cmu.pbi</file>
- <file>$TOOLKIT_DIR$\inc\DLib_Threads.h</file>
- <file>$PROJ_DIR$\Debug\Obj\main.pbi</file>
- <file>$PROJ_DIR$\str73x_lib\include\73x_rtc.h</file>
- <file>$PROJ_DIR$\Debug\Obj\73x_lib.pbi</file>
- <file>$TOOLKIT_DIR$\inc\DLib_Config_Normal.h</file>
- <file>$PROJ_DIR$\Debug\Obj\73x_lcd.pbi</file>
<file>$PROJ_DIR$\str73x_lib\include\73x_can.h</file>
+ <file>$TOOLKIT_DIR$\inc\DLib_Defaults.h</file>
<file>$PROJ_DIR$\str73x_lib\include\73x_adc.h</file>
- <file>$PROJ_DIR$\str73x_lib\include\73x_cmu.h</file>
+ <file>$PROJ_DIR$\Debug\Obj\73x_can.o</file>
+ <file>$PROJ_DIR$\str73x_lib\include\73x_lib.h</file>
<file>$PROJ_DIR$\Debug\Obj\73x_it.o</file>
- <file>$PROJ_DIR$\str73x_lib\source\73x_can.c</file>
- <file>$PROJ_DIR$\str73x_lib\include\73x_map.h</file>
+ <file>$PROJ_DIR$\main.c</file>
+ <file>$PROJ_DIR$\73x_lcd.h</file>
+ <file>$PROJ_DIR$\Debug\Obj\73x_eic.o</file>
+ <file>$PROJ_DIR$\str73x_lib\include\73x_eic.h</file>
+ <file>$TOOLKIT_DIR$\lib\rt4t_al.a</file>
+ <file>$TOOLKIT_DIR$\inc\xencoding_limits.h</file>
+ <file>$PROJ_DIR$\73x_it.c</file>
+ <file>$PROJ_DIR$\str73x_lib\source\73x_cmu.c</file>
+ <file>$PROJ_DIR$\Debug\Obj\73x_vect.o</file>
+ <file>$PROJ_DIR$\str73x_lib\source\73x_gpio.c</file>
+ <file>$PROJ_DIR$\Debug\Obj\73x_rtc.pbi</file>
+ <file>$PROJ_DIR$\Debug\Obj\73x_lcd.pbi</file>
+ <file>$PROJ_DIR$\Debug\Obj\main.pbi</file>
+ <file>$TOOLKIT_DIR$\inc\ycheck.h</file>
+ <file>$PROJ_DIR$\Debug\Obj\cantest.pbd</file>
+ <file>$TOOLKIT_DIR$\lib\shs_l.a</file>
<file>$PROJ_DIR$\Debug\Obj\73x_adc.pbi</file>
+ <file>$PROJ_DIR$\str73x_lib\source\73x_eic.c</file>
+ <file>$TOOLKIT_DIR$\lib\dl4t_tl_in.a</file>
+ <file>$TOOLKIT_DIR$\inc\DLib_Product.h</file>
+ <file>$TOOLKIT_DIR$\inc\DLib_Config_Normal.h</file>
+ <file>$PROJ_DIR$\Startup\73x_vect.s</file>
<file>$PROJ_DIR$\Debug\Obj\73x_cmu.o</file>
- <file>$PROJ_DIR$\str73x_lib\include\73x_type.h</file>
- <file>$TOOLKIT_DIR$\inc\yvals.h</file>
- <file>$TOOLKIT_DIR$\inc\DLib_Product_string.h</file>
- <file>$PROJ_DIR$\Debug\Obj\73x_eic.pbi</file>
- <file>$PROJ_DIR$\Debug\Exe\cant...
[truncated message content] |