Add STM32 Primer demo. Remove the .lock file from the Eclipse demos.
parent
e8ddef1d93
commit
48b4870c7e
@ -0,0 +1,93 @@
|
|||||||
|
/*
|
||||||
|
FreeRTOS.org V4.6.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||||
|
|
||||||
|
This file is part of the FreeRTOS.org distribution.
|
||||||
|
|
||||||
|
FreeRTOS.org 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.org 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.org; 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.org, 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.
|
||||||
|
|
||||||
|
Also see http://www.SafeRTOS.com a version that has been certified for use
|
||||||
|
in safety critical systems, plus commercial licensing, development and
|
||||||
|
support options.
|
||||||
|
***************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef FREERTOS_CONFIG_H
|
||||||
|
#define FREERTOS_CONFIG_H
|
||||||
|
|
||||||
|
/* Library includes. */
|
||||||
|
#include "stm32f10x_lib.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 1
|
||||||
|
#define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 72000000 )
|
||||||
|
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
|
||||||
|
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 )
|
||||||
|
#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 128 )
|
||||||
|
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 17 * 1024 ) )
|
||||||
|
#define configMAX_TASK_NAME_LEN ( 16 )
|
||||||
|
#define configUSE_TRACE_FACILITY 0
|
||||||
|
#define configUSE_16_BIT_TICKS 0
|
||||||
|
#define configIDLE_SHOULD_YIELD 1
|
||||||
|
#define configUSE_MUTEXES 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 1
|
||||||
|
#define INCLUDE_vTaskCleanUpResources 0
|
||||||
|
#define INCLUDE_vTaskSuspend 1
|
||||||
|
#define INCLUDE_vTaskDelayUntil 1
|
||||||
|
#define INCLUDE_vTaskDelay 1
|
||||||
|
|
||||||
|
/* This is the raw value as per the Cortex-M3 NVIC. Values can be 255
|
||||||
|
(lowest) to 0 (1?) (highest). */
|
||||||
|
#define configKERNEL_INTERRUPT_PRIORITY 255
|
||||||
|
|
||||||
|
/* This is the value being used as per the ST library which permits 16
|
||||||
|
priority values, 0 to 15. This must correspond to the
|
||||||
|
configKERNEL_INTERRUPT_PRIORITY setting. Here 15 corresponds to the lowest
|
||||||
|
NVIC value of 255. */
|
||||||
|
#define configLIBRARY_KERNEL_INTERRUPT_PRIORITY 15
|
||||||
|
|
||||||
|
#endif /* FREERTOS_CONFIG_H */
|
||||||
|
|
@ -0,0 +1,121 @@
|
|||||||
|
/*
|
||||||
|
FreeRTOS.org V4.6.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||||
|
|
||||||
|
This file is part of the FreeRTOS.org distribution.
|
||||||
|
|
||||||
|
FreeRTOS.org 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.org 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.org; 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.org, 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.
|
||||||
|
|
||||||
|
Also see http://www.SafeRTOS.com a version that has been certified for use
|
||||||
|
in safety critical systems, plus commercial licensing, development and
|
||||||
|
support options.
|
||||||
|
***************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*-----------------------------------------------------------
|
||||||
|
* Simple parallel port IO routines.
|
||||||
|
*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
/* FreeRTOS.org includes. */
|
||||||
|
#include "FreeRTOS.h"
|
||||||
|
#include "task.h"
|
||||||
|
#include "partest.h"
|
||||||
|
|
||||||
|
#define partstMAX_OUTPUT_LED ( 2 )
|
||||||
|
#define partstFIRST_LED GPIO_Pin_8
|
||||||
|
|
||||||
|
static unsigned portSHORT usOutputValue = 0;
|
||||||
|
|
||||||
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
void vParTestInitialise( void )
|
||||||
|
{
|
||||||
|
GPIO_InitTypeDef GPIO_InitStructure;
|
||||||
|
|
||||||
|
/* Enable LED GPIO clock. */
|
||||||
|
RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOB, ENABLE );
|
||||||
|
|
||||||
|
/* Configure LED pins as output push-pull. */
|
||||||
|
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8 | GPIO_Pin_9 ;
|
||||||
|
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
|
||||||
|
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||||
|
|
||||||
|
GPIO_Init( GPIOB, &GPIO_InitStructure );
|
||||||
|
}
|
||||||
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue )
|
||||||
|
{
|
||||||
|
unsigned portSHORT usBit;
|
||||||
|
|
||||||
|
vTaskSuspendAll();
|
||||||
|
{
|
||||||
|
if( uxLED < partstMAX_OUTPUT_LED )
|
||||||
|
{
|
||||||
|
usBit = partstFIRST_LED << uxLED;
|
||||||
|
|
||||||
|
if( xValue == pdFALSE )
|
||||||
|
{
|
||||||
|
usBit ^= ( unsigned portSHORT ) 0xffff;
|
||||||
|
usOutputValue &= usBit;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
usOutputValue |= usBit;
|
||||||
|
}
|
||||||
|
|
||||||
|
GPIO_Write( GPIOB, usOutputValue );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xTaskResumeAll();
|
||||||
|
}
|
||||||
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
void vParTestToggleLED( unsigned portBASE_TYPE uxLED )
|
||||||
|
{
|
||||||
|
unsigned portSHORT usBit;
|
||||||
|
|
||||||
|
vTaskSuspendAll();
|
||||||
|
{
|
||||||
|
if( uxLED < partstMAX_OUTPUT_LED )
|
||||||
|
{
|
||||||
|
usBit = partstFIRST_LED << uxLED;
|
||||||
|
|
||||||
|
if( usOutputValue & usBit )
|
||||||
|
{
|
||||||
|
usOutputValue &= ~usBit;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
usOutputValue |= usBit;
|
||||||
|
}
|
||||||
|
|
||||||
|
GPIO_Write( GPIOB, usOutputValue );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xTaskResumeAll();
|
||||||
|
}
|
||||||
|
/*-----------------------------------------------------------*/
|
||||||
|
|
@ -0,0 +1,577 @@
|
|||||||
|
<!-- DWF2XML 0.01.29 - Raisonance Dwarf information extractor -->
|
||||||
|
<aoffile Header="RTOSDemo" Path="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\RTOSDemo.elf">
|
||||||
|
<Def>
|
||||||
|
<Col Header="DeclFile" Desc="File"/>
|
||||||
|
<Col Header="Type" Desc="Type"/>
|
||||||
|
<Col Header="Header" Desc="Name"/>
|
||||||
|
</Def>
|
||||||
|
<type Header="u16" Icon="1" Type="type" Desc=": unsigned int" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="37" Pointer="No"/>
|
||||||
|
<type Header="GPIOSpeed_TypeDef" Icon="1" Type="type" Desc=": unsigned char" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_gpio.h" DeclLine="36" Pointer="No"/>
|
||||||
|
<type Header="GPIOMode_TypeDef" Icon="1" Type="type" Desc=": unsigned char" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_gpio.h" DeclLine="51" Pointer="No"/>
|
||||||
|
<type Header="GPIO_InitTypeDef" Icon="1" Type="type" Desc=": struct " DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_gpio.h" DeclLine="64" Pointer="No"/>
|
||||||
|
<func Header="LED_Set" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\led.c" DeclLine="201"/>
|
||||||
|
<func Header="LED_Handler_hw" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\led.c" DeclLine="93"/>
|
||||||
|
<func Header="LED_Handler" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\led.c" DeclLine="73"/>
|
||||||
|
<func Header="LED_Init" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\led.c" DeclLine="46"/>
|
||||||
|
<variable Header="dummy_var" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\circle.h" DeclLine="77" Pointer="No"/>
|
||||||
|
<variable Header="Application_Pointer_Mgr" Icon="2" Type="variable" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\circle.h" DeclLine="429" Pointer="No"/>
|
||||||
|
<variable Header="GreenLED_Counter" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\led.c" DeclLine="19" Pointer="No"/>
|
||||||
|
<variable Header="RedLED_Counter" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\led.c" DeclLine="20" Pointer="No"/>
|
||||||
|
<variable Header="GreenLED_mode" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\led.c" DeclLine="21" Pointer="No"/>
|
||||||
|
<variable Header="RedLED_mode" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\led.c" DeclLine="22" Pointer="No"/>
|
||||||
|
<variable Header="GreenLED_newmode" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\led.c" DeclLine="23" Pointer="No"/>
|
||||||
|
<variable Header="RedLED_newmode" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\led.c" DeclLine="24" Pointer="No"/>
|
||||||
|
<variable Header="HalfPeriod_LF" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\led.c" DeclLine="25" Pointer="No"/>
|
||||||
|
<variable Header="HalfPeriod_HF" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\led.c" DeclLine="26" Pointer="No"/>
|
||||||
|
<variable Header="Period_LF" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\led.c" DeclLine="27" Pointer="No"/>
|
||||||
|
<variable Header="Period_HF" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\led.c" DeclLine="28" Pointer="No"/>
|
||||||
|
<func Header="Reset_Handler" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\crt0_STM32x.c" DeclLine="188"/>
|
||||||
|
<variable Header="g_pfnVectors" Icon="2" Type="variable" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\crt0_STM32x.c" DeclLine="110" Pointer="No"/>
|
||||||
|
<type Header="s16" Icon="1" Type="type" Desc=": int" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="29" Pointer="No"/>
|
||||||
|
<type Header="u32" Icon="1" Type="type" Desc=": unsigned long" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="36" Pointer="No"/>
|
||||||
|
<type Header="u16" Icon="1" Type="type" Desc=": unsigned int" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="37" Pointer="No"/>
|
||||||
|
<type Header="u8" Icon="1" Type="type" Desc=": unsigned char" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="38" Pointer="No"/>
|
||||||
|
<type Header="GPIO_TypeDef" Icon="1" Type="type" Desc=": struct " DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_map.h" DeclLine="208" Pointer="No"/>
|
||||||
|
<type Header="GPIOSpeed_TypeDef" Icon="1" Type="type" Desc=": unsigned char" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_gpio.h" DeclLine="36" Pointer="No"/>
|
||||||
|
<type Header="GPIOMode_TypeDef" Icon="1" Type="type" Desc=": unsigned char" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_gpio.h" DeclLine="51" Pointer="No"/>
|
||||||
|
<type Header="GPIO_InitTypeDef" Icon="1" Type="type" Desc=": struct " DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_gpio.h" DeclLine="64" Pointer="No"/>
|
||||||
|
<type Header="BitAction" Icon="1" Type="type" Desc=": unsigned char" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_gpio.h" DeclLine="70" Pointer="No"/>
|
||||||
|
<type Header="TIM_TimeBaseInitTypeDef" Icon="1" Type="type" Desc=": struct " DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_tim.h" DeclLine="38" Pointer="No"/>
|
||||||
|
<type Header="TIM_OCInitTypeDef" Icon="1" Type="type" Desc=": struct " DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_tim.h" DeclLine="47" Pointer="No"/>
|
||||||
|
<type Header="DataConfigMode_TypeDef" Icon="1" Type="type" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.h" DeclLine="26" Pointer="No"/>
|
||||||
|
<type Header="Rotate_H12_V_Match_TypeDef" Icon="1" Type="type" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\circle.h" DeclLine="101" Pointer="No"/>
|
||||||
|
<func Header="LCD_DataLinesWrite" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="202"/>
|
||||||
|
<func Header="LCD_SetBackLight" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="1053"/>
|
||||||
|
<func Header="LCD_SetBackLightOff" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="1076"/>
|
||||||
|
<func Header="LCD_SetBackLightOn" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="1092"/>
|
||||||
|
<func Header="LCD_GetBackLight" Icon="3" Type="func" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="1110"/>
|
||||||
|
<func Header="LCD_SetRotateScreen" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="1129"/>
|
||||||
|
<func Header="LCD_GetRotateScreen" Icon="3" Type="func" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="1148"/>
|
||||||
|
<func Header="LCD_GetScreenOrientation" Icon="3" Type="func" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="1186"/>
|
||||||
|
<func Header="LCD_CtrlLinesWrite" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="255"/>
|
||||||
|
<func Header="LCD_SendLCDData" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="707"/>
|
||||||
|
<func Header="LCD_SendLCDCmd" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="679"/>
|
||||||
|
<func Header="LCD_SetRect_For_Cmd" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="1028"/>
|
||||||
|
<func Header="LCD_DrawPixel" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="901"/>
|
||||||
|
<func Header="LCD_FillRect" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="777"/>
|
||||||
|
<func Header="LCD_DrawRect" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="873"/>
|
||||||
|
<func Header="LCD_SetScreenOrientation" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="1166"/>
|
||||||
|
<func Header="LCD_DisplayChar" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="1004"/>
|
||||||
|
<func Header="LCD_DataLinesConfig" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="167"/>
|
||||||
|
<func Header="LCD_ReadLCDData" Icon="3" Type="func" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="734"/>
|
||||||
|
<func Header="LCD_RectRead" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="934"/>
|
||||||
|
<func Header="LCD_GetPixel" Icon="3" Type="func" Desc=": unsigned int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="973"/>
|
||||||
|
<func Header="LCD_Handler" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="651"/>
|
||||||
|
<func Header="LCD_Init" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="613"/>
|
||||||
|
<variable Header="TIM_TimeBaseStructure" Icon="2" Type="variable" Desc=": struct " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="28" Pointer="No"/>
|
||||||
|
<variable Header="TIM_OCInitStructure" Icon="2" Type="variable" Desc=": struct " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="29" Pointer="No"/>
|
||||||
|
<variable Header="HandlerDivider" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="30" Pointer="No"/>
|
||||||
|
<variable Header="AsciiDotsTable" Icon="2" Type="variable" Desc=": unsigned char[1330]" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="42" Pointer="No"/>
|
||||||
|
<variable Header="dummy_var" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\circle.h" DeclLine="77" Pointer="No"/>
|
||||||
|
<variable Header="Application_Pointer_Mgr" Icon="2" Type="variable" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\circle.h" DeclLine="429" Pointer="No"/>
|
||||||
|
<variable Header="Current_CCR_BackLightStart" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="32" Pointer="No"/>
|
||||||
|
<variable Header="OrientationOffsetX" Icon="2" Type="variable" Desc=": long[4]" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="139" Pointer="No"/>
|
||||||
|
<variable Header="OrientationOffsetY" Icon="2" Type="variable" Desc=": long[4]" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\lcd.c" DeclLine="140" Pointer="No"/>
|
||||||
|
<type Header="s32" Icon="1" Type="type" Desc=": long" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="28" Pointer="No"/>
|
||||||
|
<type Header="s16" Icon="1" Type="type" Desc=": int" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="29" Pointer="No"/>
|
||||||
|
<type Header="u32" Icon="1" Type="type" Desc=": unsigned long" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="36" Pointer="No"/>
|
||||||
|
<type Header="u16" Icon="1" Type="type" Desc=": unsigned int" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="37" Pointer="No"/>
|
||||||
|
<type Header="u8" Icon="1" Type="type" Desc=": unsigned char" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="38" Pointer="No"/>
|
||||||
|
<type Header="GPIOSpeed_TypeDef" Icon="1" Type="type" Desc=": unsigned char" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_gpio.h" DeclLine="36" Pointer="No"/>
|
||||||
|
<type Header="GPIOMode_TypeDef" Icon="1" Type="type" Desc=": unsigned char" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_gpio.h" DeclLine="51" Pointer="No"/>
|
||||||
|
<type Header="GPIO_InitTypeDef" Icon="1" Type="type" Desc=": struct " DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_gpio.h" DeclLine="64" Pointer="No"/>
|
||||||
|
<type Header="RCC_ClocksTypeDef" Icon="1" Type="type" Desc=": struct " DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_rcc.h" DeclLine="37" Pointer="No"/>
|
||||||
|
<type Header="tHandler" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\scheduler.h" DeclLine="75" Pointer="No"/>
|
||||||
|
<func Header="_int2str" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\Util.c" DeclLine="56"/>
|
||||||
|
<func Header="delay_unit" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\Util.c" DeclLine="116"/>
|
||||||
|
<func Header="UTIL_GetBat" Icon="3" Type="func" Desc=": unsigned int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\Util.c" DeclLine="138"/>
|
||||||
|
<func Header="UTIL_GetTemp" Icon="3" Type="func" Desc=": unsigned int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\Util.c" DeclLine="167"/>
|
||||||
|
<func Header="UTIL_SetTempMode" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\Util.c" DeclLine="202"/>
|
||||||
|
<func Header="UTIL_uint2str" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\Util.c" DeclLine="251"/>
|
||||||
|
<func Header="UTIL_int2str" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\Util.c" DeclLine="273"/>
|
||||||
|
<func Header="UTIL_GetPll" Icon="3" Type="func" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\Util.c" DeclLine="372"/>
|
||||||
|
<func Header="UTIL_GetVersion" Icon="3" Type="func" Desc=": unsigned char CODE*" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\Util.c" DeclLine="390"/>
|
||||||
|
<func Header="UTIL_ReadBackupRegister" Icon="3" Type="func" Desc=": unsigned int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\Util.c" DeclLine="410"/>
|
||||||
|
<func Header="UTIL_WriteBackupRegister" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\Util.c" DeclLine="429"/>
|
||||||
|
<func Header="UTIL_SetIrqHandler" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\Util.c" DeclLine="449"/>
|
||||||
|
<type Header="tHandler" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\scheduler.h" DeclLine="75" Pointer="No"/>
|
||||||
|
<type Header="tHandler" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\scheduler.h" DeclLine="75" Pointer="No"/>
|
||||||
|
<func Header="UTIL_GetIrqHandler" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\Util.c" DeclLine="471"/>
|
||||||
|
<func Header="UTIL_SetSchHandler" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\Util.c" DeclLine="499"/>
|
||||||
|
<type Header="tHandler" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\scheduler.h" DeclLine="75" Pointer="No"/>
|
||||||
|
<type Header="tHandler" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\scheduler.h" DeclLine="75" Pointer="No"/>
|
||||||
|
<func Header="UTIL_GetSchHandler" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\Util.c" DeclLine="524"/>
|
||||||
|
<func Header="UTIL_SetPll" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\Util.c" DeclLine="291"/>
|
||||||
|
<func Header="UTIL_GetUsb" Icon="3" Type="func" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\Util.c" DeclLine="223"/>
|
||||||
|
<type Header="tHandler" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\scheduler.h" DeclLine="75" Pointer="No"/>
|
||||||
|
<type Header="tHandler" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\scheduler.h" DeclLine="75" Pointer="No"/>
|
||||||
|
<variable Header="CurrentSpeed" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\Util.c" DeclLine="25" Pointer="No"/>
|
||||||
|
<variable Header="dummy_var" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\circle.h" DeclLine="77" Pointer="No"/>
|
||||||
|
<variable Header="RCC_ClockFreq" Icon="2" Type="variable" Desc=": struct " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\Util.c" DeclLine="28" Pointer="No"/>
|
||||||
|
<variable Header="fTemperatureInFahrenheit" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\Util.c" DeclLine="30" Pointer="No"/>
|
||||||
|
<variable Header="Application_Pointer_Mgr" Icon="2" Type="variable" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\circle.h" DeclLine="429" Pointer="No"/>
|
||||||
|
<variable Header="dummycounter" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\Util.c" DeclLine="29" Pointer="No"/>
|
||||||
|
<type Header="s16" Icon="1" Type="type" Desc=": int" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="29" Pointer="No"/>
|
||||||
|
<type Header="u32" Icon="1" Type="type" Desc=": unsigned long" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="36" Pointer="No"/>
|
||||||
|
<type Header="u16" Icon="1" Type="type" Desc=": unsigned int" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="37" Pointer="No"/>
|
||||||
|
<type Header="u8" Icon="1" Type="type" Desc=": unsigned char" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="38" Pointer="No"/>
|
||||||
|
<type Header="Rotate_H12_V_Match_TypeDef" Icon="1" Type="type" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\circle.h" DeclLine="101" Pointer="No"/>
|
||||||
|
<func Header="DRAW_SetCharMagniCoeff" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="218"/>
|
||||||
|
<func Header="DRAW_GetCharMagniCoeff" Icon="3" Type="func" Desc=": unsigned int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="236"/>
|
||||||
|
<func Header="DRAW_GetTextColor" Icon="3" Type="func" Desc=": unsigned int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="254"/>
|
||||||
|
<func Header="DRAW_SetTextColor" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="272"/>
|
||||||
|
<func Header="DRAW_GetBGndColor" Icon="3" Type="func" Desc=": unsigned int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="290"/>
|
||||||
|
<func Header="DRAW_SetBGndColor" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="308"/>
|
||||||
|
<func Header="DRAW_SetDefaultColor" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="414"/>
|
||||||
|
<func Header="DRAW_Line" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="476"/>
|
||||||
|
<func Header="DRAW_DisplayStringWithMode" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="129"/>
|
||||||
|
<func Header="DRAW_DisplayStringInverted" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="397"/>
|
||||||
|
<func Header="DRAW_DisplayString" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="373"/>
|
||||||
|
<func Header="DRAW_DisplayTemp" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="437"/>
|
||||||
|
<func Header="DRAW_SetImage" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="335"/>
|
||||||
|
<func Header="DRAW_Init" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="178"/>
|
||||||
|
<variable Header="CharMagniCoeff" Icon="2" Type="variable" Desc=": unsigned int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="28" Pointer="No"/>
|
||||||
|
<variable Header="BGndColor" Icon="2" Type="variable" Desc=": unsigned int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="29" Pointer="No"/>
|
||||||
|
<variable Header="TextColor" Icon="2" Type="variable" Desc=": unsigned int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="30" Pointer="No"/>
|
||||||
|
<variable Header="dummy_var" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\circle.h" DeclLine="77" Pointer="No"/>
|
||||||
|
<variable Header="fDisplayTime" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="32" Pointer="No"/>
|
||||||
|
<variable Header="Application_Pointer_Mgr" Icon="2" Type="variable" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\circle.h" DeclLine="429" Pointer="No"/>
|
||||||
|
<variable Header="BatState" Icon="2" Type="variable" Desc=": unsigned int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="33" Pointer="No"/>
|
||||||
|
<variable Header="OldBatState" Icon="2" Type="variable" Desc=": unsigned int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="34" Pointer="No"/>
|
||||||
|
<variable Header="OldTHH" Icon="2" Type="variable" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="35" Pointer="No"/>
|
||||||
|
<variable Header="OldTMM" Icon="2" Type="variable" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="36" Pointer="No"/>
|
||||||
|
<variable Header="OldTSS" Icon="2" Type="variable" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="37" Pointer="No"/>
|
||||||
|
<variable Header="OldTemp" Icon="2" Type="variable" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="38" Pointer="No"/>
|
||||||
|
<variable Header="xBat" Icon="2" Type="variable" Desc=": unsigned int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="39" Pointer="No"/>
|
||||||
|
<variable Header="yBat" Icon="2" Type="variable" Desc=": unsigned int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="40" Pointer="No"/>
|
||||||
|
<variable Header="widthBat" Icon="2" Type="variable" Desc=": unsigned int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="41" Pointer="No"/>
|
||||||
|
<variable Header="heightBat" Icon="2" Type="variable" Desc=": unsigned int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="42" Pointer="No"/>
|
||||||
|
<variable Header="UsbState" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="43" Pointer="No"/>
|
||||||
|
<variable Header="OldUsbState" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="43" Pointer="No"/>
|
||||||
|
<variable Header="rotate_counter" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="47" Pointer="No"/>
|
||||||
|
<variable Header="previous_H12" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="48" Pointer="No"/>
|
||||||
|
<variable Header="previous_previous_H12" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="49" Pointer="No"/>
|
||||||
|
<variable Header="H12" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="50" Pointer="No"/>
|
||||||
|
<variable Header="CurrentScreenOrientation" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="51" Pointer="No"/>
|
||||||
|
<variable Header="CurrentRotateScreen" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\draw.c" DeclLine="52" Pointer="No"/>
|
||||||
|
<type Header="s32" Icon="1" Type="type" Desc=": long" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="28" Pointer="No"/>
|
||||||
|
<type Header="s16" Icon="1" Type="type" Desc=": int" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="29" Pointer="No"/>
|
||||||
|
<type Header="u32" Icon="1" Type="type" Desc=": unsigned long" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="36" Pointer="No"/>
|
||||||
|
<type Header="u16" Icon="1" Type="type" Desc=": unsigned int" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="37" Pointer="No"/>
|
||||||
|
<type Header="u8" Icon="1" Type="type" Desc=": unsigned char" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="38" Pointer="No"/>
|
||||||
|
<type Header="GPIOSpeed_TypeDef" Icon="1" Type="type" Desc=": unsigned char" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_gpio.h" DeclLine="36" Pointer="No"/>
|
||||||
|
<type Header="GPIOMode_TypeDef" Icon="1" Type="type" Desc=": unsigned char" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_gpio.h" DeclLine="51" Pointer="No"/>
|
||||||
|
<type Header="GPIO_InitTypeDef" Icon="1" Type="type" Desc=": struct " DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_gpio.h" DeclLine="64" Pointer="No"/>
|
||||||
|
<type Header="SPI_InitTypeDef" Icon="1" Type="type" Desc=": struct " DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_spi.h" DeclLine="42" Pointer="No"/>
|
||||||
|
<type Header="Rotate_H12_V_Match_TypeDef" Icon="1" Type="type" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\circle.h" DeclLine="101" Pointer="No"/>
|
||||||
|
<type Header="tMEMS_Info" Icon="1" Type="type" Desc=": struct " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\circle.h" DeclLine="124" Pointer="No"/>
|
||||||
|
<func Header="MEMS_GetPosition" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="523"/>
|
||||||
|
<func Header="MEMS_GetRotation" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="542"/>
|
||||||
|
<func Header="MEMS_SetNeutral" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="584"/>
|
||||||
|
<func Header="MEMS_GetInfo" Icon="3" Type="func" Desc=": struct CODE*" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="603"/>
|
||||||
|
<func Header="MEMS_SendByte" Icon="3" Type="func" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="236"/>
|
||||||
|
<func Header="MEMS_ChipSelect" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="215"/>
|
||||||
|
<func Header="MEMS_ReadID" Icon="3" Type="func" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="482"/>
|
||||||
|
<func Header="MEMS_ReadOutXY" Icon="3" Type="func" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="138"/>
|
||||||
|
<func Header="MEMS_Handler" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="381"/>
|
||||||
|
<func Header="MEMS_Init" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="266"/>
|
||||||
|
<variable Header="dummy_var" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\circle.h" DeclLine="77" Pointer="No"/>
|
||||||
|
<variable Header="MEMS_Info" Icon="2" Type="variable" Desc=": struct " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="37" Pointer="No"/>
|
||||||
|
<variable Header="Application_Pointer_Mgr" Icon="2" Type="variable" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\circle.h" DeclLine="429" Pointer="No"/>
|
||||||
|
<variable Header="TestingActive" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="38" Pointer="No"/>
|
||||||
|
<variable Header="StartingFromResetOrShockCounter" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="39" Pointer="No"/>
|
||||||
|
<variable Header="TimeCounterForDoubleClick" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="40" Pointer="No"/>
|
||||||
|
<variable Header="TimeLastShock" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="41" Pointer="No"/>
|
||||||
|
<variable Header="Gradient2" Icon="2" Type="variable" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="44" Pointer="No"/>
|
||||||
|
<variable Header="N_filtering" Icon="2" Type="variable" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="47" Pointer="No"/>
|
||||||
|
<variable Header="GradX" Icon="2" Type="variable" Desc=": int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="50" Pointer="No"/>
|
||||||
|
<variable Header="GradY" Icon="2" Type="variable" Desc=": int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="51" Pointer="No"/>
|
||||||
|
<variable Header="GradZ" Icon="2" Type="variable" Desc=": int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="52" Pointer="No"/>
|
||||||
|
<variable Header="fMovePtrX" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="59" Pointer="No"/>
|
||||||
|
<variable Header="iMovePtrX" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="60" Pointer="No"/>
|
||||||
|
<variable Header="tMovePtrX" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="61" Pointer="No"/>
|
||||||
|
<variable Header="fMovePtrY" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="62" Pointer="No"/>
|
||||||
|
<variable Header="iMovePtrY" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="63" Pointer="No"/>
|
||||||
|
<variable Header="tMovePtrY" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="64" Pointer="No"/>
|
||||||
|
<variable Header="fMovePtrZ" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="65" Pointer="No"/>
|
||||||
|
<variable Header="iMovePtrZ" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="66" Pointer="No"/>
|
||||||
|
<variable Header="tMovePtrZ" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="67" Pointer="No"/>
|
||||||
|
<variable Header="XInit" Icon="2" Type="variable" Desc=": int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="69" Pointer="No"/>
|
||||||
|
<variable Header="YInit" Icon="2" Type="variable" Desc=": int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="70" Pointer="No"/>
|
||||||
|
<variable Header="ZInit" Icon="2" Type="variable" Desc=": int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\mems.c" DeclLine="71" Pointer="No"/>
|
||||||
|
<type Header="u32" Icon="1" Type="type" Desc=": unsigned long" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="36" Pointer="No"/>
|
||||||
|
<type Header="u16" Icon="1" Type="type" Desc=": unsigned int" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="37" Pointer="No"/>
|
||||||
|
<type Header="u8" Icon="1" Type="type" Desc=": unsigned char" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="38" Pointer="No"/>
|
||||||
|
<type Header="GPIOSpeed_TypeDef" Icon="1" Type="type" Desc=": unsigned char" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_gpio.h" DeclLine="36" Pointer="No"/>
|
||||||
|
<type Header="GPIOMode_TypeDef" Icon="1" Type="type" Desc=": unsigned char" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_gpio.h" DeclLine="51" Pointer="No"/>
|
||||||
|
<type Header="GPIO_InitTypeDef" Icon="1" Type="type" Desc=": struct " DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_gpio.h" DeclLine="64" Pointer="No"/>
|
||||||
|
<type Header="RCC_ClocksTypeDef" Icon="1" Type="type" Desc=": struct " DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_rcc.h" DeclLine="37" Pointer="No"/>
|
||||||
|
<type Header="TIM_TimeBaseInitTypeDef" Icon="1" Type="type" Desc=": struct " DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_tim.h" DeclLine="38" Pointer="No"/>
|
||||||
|
<type Header="TIM_OCInitTypeDef" Icon="1" Type="type" Desc=": struct " DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_tim.h" DeclLine="47" Pointer="No"/>
|
||||||
|
<func Header="BUZZER_GetMode" Icon="3" Type="func" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\buzzer.c" DeclLine="358"/>
|
||||||
|
<func Header="BUZZER_SetFrequency" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\buzzer.c" DeclLine="195"/>
|
||||||
|
<func Header="PlayMusic" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\buzzer.c" DeclLine="104"/>
|
||||||
|
<func Header="BUZZER_SetMode" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\buzzer.c" DeclLine="376"/>
|
||||||
|
<func Header="BUZZER_PlayMusic" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\buzzer.c" DeclLine="464"/>
|
||||||
|
<func Header="BUZZER_Handler" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\buzzer.c" DeclLine="291"/>
|
||||||
|
<func Header="BUZZER_Init" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\buzzer.c" DeclLine="231"/>
|
||||||
|
<variable Header="TIM_TimeBaseStructure" Icon="2" Type="variable" Desc=": struct " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\buzzer.c" DeclLine="54" Pointer="No"/>
|
||||||
|
<variable Header="TIM_OCInitStructure" Icon="2" Type="variable" Desc=": struct " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\buzzer.c" DeclLine="55" Pointer="No"/>
|
||||||
|
<variable Header="dummy_var" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\circle.h" DeclLine="77" Pointer="No"/>
|
||||||
|
<variable Header="Application_Pointer_Mgr" Icon="2" Type="variable" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\circle.h" DeclLine="429" Pointer="No"/>
|
||||||
|
<variable Header="octave" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\buzzer.c" DeclLine="26" Pointer="No"/>
|
||||||
|
<variable Header="note" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\buzzer.c" DeclLine="43" Pointer="No"/>
|
||||||
|
<variable Header="buzz_counter" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\buzzer.c" DeclLine="52" Pointer="No"/>
|
||||||
|
<variable Header="buzz_in_progress" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\buzzer.c" DeclLine="53" Pointer="No"/>
|
||||||
|
<variable Header="CCR_Val" Icon="2" Type="variable" Desc=": unsigned int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\buzzer.c" DeclLine="56" Pointer="No"/>
|
||||||
|
<variable Header="Buzzer_Mode" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\buzzer.c" DeclLine="57" Pointer="No"/>
|
||||||
|
<variable Header="Buzzer_Counter" Icon="2" Type="variable" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\buzzer.c" DeclLine="58" Pointer="No"/>
|
||||||
|
<variable Header="CurrentMelody" Icon="2" Type="variable" Desc=": unsigned char CODE*" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\buzzer.c" DeclLine="61" Pointer="Yes"/>
|
||||||
|
<variable Header="CurrentMelodySTART" Icon="2" Type="variable" Desc=": unsigned char CODE*" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\buzzer.c" DeclLine="62" Pointer="Yes"/>
|
||||||
|
<variable Header="DefaultOctave" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\buzzer.c" DeclLine="63" Pointer="No"/>
|
||||||
|
<variable Header="DefaultDuration" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\buzzer.c" DeclLine="64" Pointer="No"/>
|
||||||
|
<variable Header="DefaultBeats" Icon="2" Type="variable" Desc=": unsigned int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\buzzer.c" DeclLine="65" Pointer="No"/>
|
||||||
|
<variable Header="Note_Freq" Icon="2" Type="variable" Desc=": unsigned int[16]" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\buzzer.c" DeclLine="67" Pointer="No"/>
|
||||||
|
<type Header="s32" Icon="1" Type="type" Desc=": long" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="28" Pointer="No"/>
|
||||||
|
<type Header="s16" Icon="1" Type="type" Desc=": int" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="29" Pointer="No"/>
|
||||||
|
<type Header="u32" Icon="1" Type="type" Desc=": unsigned long" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="36" Pointer="No"/>
|
||||||
|
<type Header="u16" Icon="1" Type="type" Desc=": unsigned int" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="37" Pointer="No"/>
|
||||||
|
<type Header="u8" Icon="1" Type="type" Desc=": unsigned char" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="38" Pointer="No"/>
|
||||||
|
<type Header="tMEMS_Info" Icon="1" Type="type" Desc=": struct " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\circle.h" DeclLine="124" Pointer="No"/>
|
||||||
|
<type Header="tPointer_Info" Icon="1" Type="type" Desc=": struct " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\circle.h" DeclLine="194" Pointer="No"/>
|
||||||
|
<type Header="tAppPtrMgr" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\circle.h" DeclLine="226" Pointer="No"/>
|
||||||
|
<func Header="POINTER_SetCurrentPointer" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="351"/>
|
||||||
|
<func Header="POINTER_GetCurrentAngleStart" Icon="3" Type="func" Desc=": unsigned int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="376"/>
|
||||||
|
<func Header="POINTER_SetCurrentAngleStart" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="394"/>
|
||||||
|
<func Header="POINTER_GetCurrentSpeedOnAngle" Icon="3" Type="func" Desc=": unsigned int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="412"/>
|
||||||
|
<func Header="POINTER_SetCurrentSpeedOnAngle" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="430"/>
|
||||||
|
<func Header="POINTER_SetCurrentAreaStore" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="453"/>
|
||||||
|
<func Header="POINTER_GetMode" Icon="3" Type="func" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="532"/>
|
||||||
|
<func Header="POINTER_GetState" Icon="3" Type="func" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="550"/>
|
||||||
|
<func Header="POINTER_SetRect" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="573"/>
|
||||||
|
<func Header="POINTER_SetRectScreen" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="615"/>
|
||||||
|
<func Header="POINTER_GetPos" Icon="3" Type="func" Desc=": unsigned int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="634"/>
|
||||||
|
<func Header="POINTER_SetPos" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="655"/>
|
||||||
|
<func Header="POINTER_SetApplication_Pointer_Mgr" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="845"/>
|
||||||
|
<type Header="tAppPtrMgr" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\circle.h" DeclLine="226" Pointer="No"/>
|
||||||
|
<func Header="POINTER_SetColor" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="863"/>
|
||||||
|
<func Header="POINTER_GetColor" Icon="3" Type="func" Desc=": unsigned int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="881"/>
|
||||||
|
<func Header="POINTER_GetInfo" Icon="3" Type="func" Desc=": struct CODE*" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="899"/>
|
||||||
|
<func Header="POINTER_Restore" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="806"/>
|
||||||
|
<func Header="POINTER_Draw" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="682"/>
|
||||||
|
<func Header="POINTER_Save" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="759"/>
|
||||||
|
<func Header="POINTER_SetMode" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="473"/>
|
||||||
|
<func Header="POINTER_Init" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="289"/>
|
||||||
|
<func Header="POINTER_Handler" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="315"/>
|
||||||
|
<variable Header="dummy_var" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\circle.h" DeclLine="77" Pointer="No"/>
|
||||||
|
<variable Header="POINTER_Info" Icon="2" Type="variable" Desc=": struct " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="58" Pointer="No"/>
|
||||||
|
<variable Header="BallPointerBmp" Icon="2" Type="variable" Desc=": unsigned char[7]" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="39" Pointer="No"/>
|
||||||
|
<variable Header="CurrentPointerBmp" Icon="2" Type="variable" Desc=": unsigned char CODE*" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="44" Pointer="Yes"/>
|
||||||
|
<variable Header="CurrentPointerColor" Icon="2" Type="variable" Desc=": unsigned int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="50" Pointer="No"/>
|
||||||
|
<variable Header="Application_Pointer_Mgr" Icon="2" Type="variable" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\circle.h" DeclLine="429" Pointer="No"/>
|
||||||
|
<variable Header="locbuf" Icon="2" Type="variable" Desc=": unsigned char[7]" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="40" Pointer="No"/>
|
||||||
|
<variable Header="DefaultAreaStore" Icon="2" Type="variable" Desc=": unsigned char[98]" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="41" Pointer="No"/>
|
||||||
|
<variable Header="CurrentPointerWidth" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="45" Pointer="No"/>
|
||||||
|
<variable Header="CurrentPointerHeight" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="46" Pointer="No"/>
|
||||||
|
<variable Header="CurrentSpeedOnAngle" Icon="2" Type="variable" Desc=": unsigned int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="47" Pointer="No"/>
|
||||||
|
<variable Header="CurrentAngleStart" Icon="2" Type="variable" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="48" Pointer="No"/>
|
||||||
|
<variable Header="ptrAreaStore" Icon="2" Type="variable" Desc=": unsigned char CODE*" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="49" Pointer="Yes"/>
|
||||||
|
<variable Header="Pointer_Mode" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="51" Pointer="No"/>
|
||||||
|
<variable Header="Pointer_State" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="52" Pointer="No"/>
|
||||||
|
<variable Header="OUT_X" Icon="2" Type="variable" Desc=": int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="54" Pointer="No"/>
|
||||||
|
<variable Header="OUT_Y" Icon="2" Type="variable" Desc=": int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\pointer.c" DeclLine="55" Pointer="No"/>
|
||||||
|
<type Header="portTickType" Icon="1" Type="type" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Source\portable\GCC\ARM_CM3\portmacro.h" DeclLine="74" Pointer="No"/>
|
||||||
|
<type Header="xQueueHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\Queue.h" DeclLine="43" Pointer="No"/>
|
||||||
|
<type Header="xLCDMessage" Icon="1" Type="type" Desc=": struct " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\main.c" DeclLine="158" Pointer="No"/>
|
||||||
|
<func Header="starting_delay" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\main.c" DeclLine="460"/>
|
||||||
|
<func Header="vApplicationTickHook" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\main.c" DeclLine="358"/>
|
||||||
|
<func Header="main" Icon="3" Type="func" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\main.c" DeclLine="215"/>
|
||||||
|
<func Header="prvFlashTask" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\main.c" DeclLine="443"/>
|
||||||
|
<func Header="prvLCDTask" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\main.c" DeclLine="251"/>
|
||||||
|
<func Header="prvCheckTask" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\main.c" DeclLine="301"/>
|
||||||
|
<variable Header="dummy_var" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\circle.h" DeclLine="77" Pointer="No"/>
|
||||||
|
<variable Header="Application_Pointer_Mgr" Icon="2" Type="variable" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ST_Code\circle.h" DeclLine="429" Pointer="No"/>
|
||||||
|
<variable Header="pucImage" Icon="2" Type="variable" Desc=": unsigned int[3312]" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\bitmap.h" DeclLine="42" Pointer="No"/>
|
||||||
|
<type Header="xQueueHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\Queue.h" DeclLine="43" Pointer="No"/>
|
||||||
|
<variable Header="xLCDQueue" Icon="2" Type="variable" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\main.c" DeclLine="210" Pointer="No"/>
|
||||||
|
<type Header="u16" Icon="1" Type="type" Desc=": unsigned int" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="37" Pointer="No"/>
|
||||||
|
<type Header="GPIOSpeed_TypeDef" Icon="1" Type="type" Desc=": unsigned char" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_gpio.h" DeclLine="36" Pointer="No"/>
|
||||||
|
<type Header="GPIOMode_TypeDef" Icon="1" Type="type" Desc=": unsigned char" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_gpio.h" DeclLine="51" Pointer="No"/>
|
||||||
|
<type Header="GPIO_InitTypeDef" Icon="1" Type="type" Desc=": struct " DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_gpio.h" DeclLine="64" Pointer="No"/>
|
||||||
|
<func Header="vParTestToggleLED" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ParTest\ParTest.c" DeclLine="97"/>
|
||||||
|
<func Header="vParTestSetLED" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ParTest\ParTest.c" DeclLine="70"/>
|
||||||
|
<func Header="vParTestInitialise" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ParTest\ParTest.c" DeclLine="54"/>
|
||||||
|
<variable Header="usOutputValue" Icon="2" Type="variable" Desc=": unsigned int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\ParTest\ParTest.c" DeclLine="49" Pointer="No"/>
|
||||||
|
<type Header="u16" Icon="1" Type="type" Desc=": unsigned int" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="37" Pointer="No"/>
|
||||||
|
<type Header="u8" Icon="1" Type="type" Desc=": unsigned char" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="38" Pointer="No"/>
|
||||||
|
<type Header="FunctionalState" Icon="1" Type="type" Desc=": unsigned char" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="56" Pointer="No"/>
|
||||||
|
<type Header="NVIC_InitTypeDef" Icon="1" Type="type" Desc=": struct " DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_nvic.h" DeclLine="37" Pointer="No"/>
|
||||||
|
<type Header="TIM_TimeBaseInitTypeDef" Icon="1" Type="type" Desc=": struct " DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stm32f10x_tim.h" DeclLine="38" Pointer="No"/>
|
||||||
|
<func Header="vTimer2IntHandler" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\timertest.c" DeclLine="127"/>
|
||||||
|
<func Header="vSetupTimerTest" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\timertest.c" DeclLine="81"/>
|
||||||
|
<variable Header="usMaxJitter" Icon="2" Type="variable" Desc=": unsigned int" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\timertest.c" DeclLine="76" Pointer="No"/>
|
||||||
|
<type Header="__gnuc_va_list" Icon="1" Type="type" Desc=": " DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stdarg.h" DeclLine="43" Pointer="No"/>
|
||||||
|
<type Header="__gnuc_va_list" Icon="1" Type="type" Desc=": " DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stdarg.h" DeclLine="43" Pointer="No"/>
|
||||||
|
<type Header="va_list" Icon="1" Type="type" Desc=": " DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stdarg.h" DeclLine="110" Pointer="No"/>
|
||||||
|
<func Header="printchar" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\printf-stdarg.c" DeclLine="32"/>
|
||||||
|
<func Header="prints" Icon="3" Type="func" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\printf-stdarg.c" DeclLine="46"/>
|
||||||
|
<func Header="printi" Icon="3" Type="func" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\printf-stdarg.c" DeclLine="79"/>
|
||||||
|
<func Header="print" Icon="3" Type="func" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\printf-stdarg.c" DeclLine="122"/>
|
||||||
|
<type Header="__gnuc_va_list" Icon="1" Type="type" Desc=": " DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stdarg.h" DeclLine="43" Pointer="No"/>
|
||||||
|
<type Header="va_list" Icon="1" Type="type" Desc=": " DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stdarg.h" DeclLine="110" Pointer="No"/>
|
||||||
|
<func Header="snprintf" Icon="3" Type="func" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\printf-stdarg.c" DeclLine="203"/>
|
||||||
|
<type Header="__gnuc_va_list" Icon="1" Type="type" Desc=": " DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stdarg.h" DeclLine="43" Pointer="No"/>
|
||||||
|
<type Header="va_list" Icon="1" Type="type" Desc=": " DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stdarg.h" DeclLine="110" Pointer="No"/>
|
||||||
|
<func Header="sprintf" Icon="3" Type="func" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\printf-stdarg.c" DeclLine="194"/>
|
||||||
|
<type Header="__gnuc_va_list" Icon="1" Type="type" Desc=": " DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stdarg.h" DeclLine="43" Pointer="No"/>
|
||||||
|
<type Header="va_list" Icon="1" Type="type" Desc=": " DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stdarg.h" DeclLine="110" Pointer="No"/>
|
||||||
|
<func Header="printf" Icon="3" Type="func" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\CORTEX_STM32F103_Primer_GCC\printf-stdarg.c" DeclLine="186"/>
|
||||||
|
<type Header="__gnuc_va_list" Icon="1" Type="type" Desc=": " DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stdarg.h" DeclLine="43" Pointer="No"/>
|
||||||
|
<type Header="va_list" Icon="1" Type="type" Desc=": " DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stdarg.h" DeclLine="110" Pointer="No"/>
|
||||||
|
<type Header="xTaskHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\task.h" DeclLine="68" Pointer="No"/>
|
||||||
|
<type Header="xQueueHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\queue.h" DeclLine="43" Pointer="No"/>
|
||||||
|
<type Header="xQueueHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\queue.h" DeclLine="43" Pointer="No"/>
|
||||||
|
<type Header="xSemaphoreHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\semphr.h" DeclLine="42" Pointer="No"/>
|
||||||
|
<func Header="xAreGenericQueueTasksStillRunning" Icon="3" Type="func" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\GenQTest.c" DeclLine="513"/>
|
||||||
|
<func Header="vStartGenericQueueTasks" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\GenQTest.c" DeclLine="116"/>
|
||||||
|
<type Header="xQueueHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\queue.h" DeclLine="43" Pointer="No"/>
|
||||||
|
<type Header="xQueueHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\queue.h" DeclLine="43" Pointer="No"/>
|
||||||
|
<type Header="xSemaphoreHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\semphr.h" DeclLine="42" Pointer="No"/>
|
||||||
|
<func Header="prvMediumPriorityMutexTask" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\GenQTest.c" DeclLine="468"/>
|
||||||
|
<func Header="prvHighPriorityMutexTask" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\GenQTest.c" DeclLine="484"/>
|
||||||
|
<type Header="xQueueHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\queue.h" DeclLine="43" Pointer="No"/>
|
||||||
|
<type Header="xSemaphoreHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\semphr.h" DeclLine="42" Pointer="No"/>
|
||||||
|
<func Header="prvLowPriorityMutexTask" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\GenQTest.c" DeclLine="370"/>
|
||||||
|
<type Header="xQueueHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\queue.h" DeclLine="43" Pointer="No"/>
|
||||||
|
<type Header="xSemaphoreHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\semphr.h" DeclLine="42" Pointer="No"/>
|
||||||
|
<func Header="prvSendFrontAndBackTest" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\GenQTest.c" DeclLine="142"/>
|
||||||
|
<type Header="xQueueHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\queue.h" DeclLine="43" Pointer="No"/>
|
||||||
|
<variable Header="xErrorDetected" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\GenQTest.c" DeclLine="99" Pointer="No"/>
|
||||||
|
<variable Header="ulLoopCounter" Icon="2" Type="variable" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\GenQTest.c" DeclLine="103" Pointer="No"/>
|
||||||
|
<variable Header="ulLoopCounter2" Icon="2" Type="variable" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\GenQTest.c" DeclLine="104" Pointer="No"/>
|
||||||
|
<variable Header="ulGuardedVariable" Icon="2" Type="variable" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\GenQTest.c" DeclLine="107" Pointer="No"/>
|
||||||
|
<type Header="xTaskHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\task.h" DeclLine="68" Pointer="No"/>
|
||||||
|
<variable Header="xHighPriorityMutexTask" Icon="2" Type="variable" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\GenQTest.c" DeclLine="111" Pointer="No"/>
|
||||||
|
<type Header="xTaskHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\task.h" DeclLine="68" Pointer="No"/>
|
||||||
|
<variable Header="xMediumPriorityMutexTask" Icon="2" Type="variable" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\GenQTest.c" DeclLine="111" Pointer="No"/>
|
||||||
|
<type Header="portTickType" Icon="1" Type="type" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Source\portable\GCC\ARM_CM3\portmacro.h" DeclLine="74" Pointer="No"/>
|
||||||
|
<type Header="xQueueHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\queue.h" DeclLine="43" Pointer="No"/>
|
||||||
|
<type Header="xQueueHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\queue.h" DeclLine="43" Pointer="No"/>
|
||||||
|
<type Header="xBlockingQueueParameters" Icon="1" Type="type" Desc=": struct BLOCKING_QUEUE_PARAMETERS" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\BlockQ.c" DeclLine="89" Pointer="No"/>
|
||||||
|
<func Header="xAreBlockingQueuesStillRunning" Icon="3" Type="func" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\BlockQ.c" DeclLine="261"/>
|
||||||
|
<func Header="vStartBlockingQueueTasks" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\BlockQ.c" DeclLine="110"/>
|
||||||
|
<func Header="vBlockingQueueProducer" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\BlockQ.c" DeclLine="192"/>
|
||||||
|
<func Header="vBlockingQueueConsumer" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\BlockQ.c" DeclLine="223"/>
|
||||||
|
<variable Header="sBlockingConsumerCount" Icon="2" Type="variable" Desc=": int[3]" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\BlockQ.c" DeclLine="101" Pointer="No"/>
|
||||||
|
<variable Header="sBlockingProducerCount" Icon="2" Type="variable" Desc=": int[3]" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\BlockQ.c" DeclLine="105" Pointer="No"/>
|
||||||
|
<type Header="portTickType" Icon="1" Type="type" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Source\portable\GCC\ARM_CM3\portmacro.h" DeclLine="74" Pointer="No"/>
|
||||||
|
<type Header="xTaskHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\task.h" DeclLine="68" Pointer="No"/>
|
||||||
|
<type Header="xQueueHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\queue.h" DeclLine="43" Pointer="No"/>
|
||||||
|
<func Header="xAreBlockTimeTestTasksStillRunning" Icon="3" Type="func" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\blocktim.c" DeclLine="449"/>
|
||||||
|
<func Header="vCreateBlockTimeTasks" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\blocktim.c" DeclLine="86"/>
|
||||||
|
<func Header="vSecondaryBlockTimeTestTask" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\blocktim.c" DeclLine="353"/>
|
||||||
|
<func Header="vPrimaryBlockTimeTestTask" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\blocktim.c" DeclLine="97"/>
|
||||||
|
<type Header="xQueueHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\queue.h" DeclLine="43" Pointer="No"/>
|
||||||
|
<variable Header="xTestQueue" Icon="2" Type="variable" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\blocktim.c" DeclLine="65" Pointer="No"/>
|
||||||
|
<type Header="xTaskHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\task.h" DeclLine="68" Pointer="No"/>
|
||||||
|
<variable Header="xSecondary" Icon="2" Type="variable" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\blocktim.c" DeclLine="69" Pointer="No"/>
|
||||||
|
<variable Header="xPrimaryCycles" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\blocktim.c" DeclLine="72" Pointer="No"/>
|
||||||
|
<variable Header="xSecondaryCycles" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\blocktim.c" DeclLine="72" Pointer="No"/>
|
||||||
|
<variable Header="xErrorOccurred" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\blocktim.c" DeclLine="73" Pointer="No"/>
|
||||||
|
<variable Header="xRunIndicator" Icon="2" Type="variable" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\blocktim.c" DeclLine="77" Pointer="No"/>
|
||||||
|
<type Header="xTaskHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\task.h" DeclLine="68" Pointer="No"/>
|
||||||
|
<type Header="xQueueHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\queue.h" DeclLine="43" Pointer="No"/>
|
||||||
|
<func Header="xAreQueuePeekTasksStillRunning" Icon="3" Type="func" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\QPeek.c" DeclLine="404"/>
|
||||||
|
<func Header="vStartQueuePeekTasks" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\QPeek.c" DeclLine="91"/>
|
||||||
|
<type Header="xQueueHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\queue.h" DeclLine="43" Pointer="No"/>
|
||||||
|
<func Header="prvMediumPriorityPeekTask" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\QPeek.c" DeclLine="272"/>
|
||||||
|
<type Header="xQueueHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\queue.h" DeclLine="43" Pointer="No"/>
|
||||||
|
<func Header="prvHighPriorityPeekTask" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\QPeek.c" DeclLine="217"/>
|
||||||
|
<type Header="xQueueHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\queue.h" DeclLine="43" Pointer="No"/>
|
||||||
|
<func Header="prvHighestPriorityPeekTask" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\QPeek.c" DeclLine="108"/>
|
||||||
|
<type Header="xQueueHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\queue.h" DeclLine="43" Pointer="No"/>
|
||||||
|
<func Header="prvLowPriorityPeekTask" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\QPeek.c" DeclLine="313"/>
|
||||||
|
<type Header="xQueueHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\queue.h" DeclLine="43" Pointer="No"/>
|
||||||
|
<variable Header="xErrorDetected" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\QPeek.c" DeclLine="80" Pointer="No"/>
|
||||||
|
<variable Header="ulLoopCounter" Icon="2" Type="variable" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\QPeek.c" DeclLine="84" Pointer="No"/>
|
||||||
|
<type Header="xTaskHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\task.h" DeclLine="68" Pointer="No"/>
|
||||||
|
<variable Header="xMediumPriorityTask" Icon="2" Type="variable" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\QPeek.c" DeclLine="87" Pointer="No"/>
|
||||||
|
<type Header="xTaskHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\task.h" DeclLine="68" Pointer="No"/>
|
||||||
|
<variable Header="xHighPriorityTask" Icon="2" Type="variable" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\QPeek.c" DeclLine="87" Pointer="No"/>
|
||||||
|
<type Header="xTaskHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\task.h" DeclLine="68" Pointer="No"/>
|
||||||
|
<variable Header="xHighestPriorityTask" Icon="2" Type="variable" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\QPeek.c" DeclLine="87" Pointer="No"/>
|
||||||
|
<type Header="xQueueHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\queue.h" DeclLine="43" Pointer="No"/>
|
||||||
|
<func Header="xArePollingQueuesStillRunning" Icon="3" Type="func" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\PollQ.c" DeclLine="197"/>
|
||||||
|
<func Header="vStartPolledQueueTasks" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\PollQ.c" DeclLine="98"/>
|
||||||
|
<type Header="xQueueHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\queue.h" DeclLine="43" Pointer="No"/>
|
||||||
|
<func Header="vPolledQueueProducer" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\PollQ.c" DeclLine="111"/>
|
||||||
|
<func Header="vPolledQueueConsumer" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\PollQ.c" DeclLine="150"/>
|
||||||
|
<variable Header="xPollingConsumerCount" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\PollQ.c" DeclLine="93" Pointer="No"/>
|
||||||
|
<variable Header="xPollingProducerCount" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\PollQ.c" DeclLine="93" Pointer="No"/>
|
||||||
|
<type Header="pdTASK_CODE" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\projdefs.h" DeclLine="41" Pointer="No"/>
|
||||||
|
<type Header="portTickType" Icon="1" Type="type" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Source\portable\GCC\ARM_CM3\portmacro.h" DeclLine="74" Pointer="No"/>
|
||||||
|
<type Header="xListItem" Icon="1" Type="type" Desc=": struct xLIST_ITEM" DeclFile="C:\E\Dev\FreeRTOS\Source\include\list.h" DeclLine="89" Pointer="No"/>
|
||||||
|
<type Header="xMiniListItem" Icon="1" Type="type" Desc=": struct xMINI_LIST_ITEM" DeclFile="C:\E\Dev\FreeRTOS\Source\include\list.h" DeclLine="97" Pointer="No"/>
|
||||||
|
<type Header="xList" Icon="1" Type="type" Desc=": struct xLIST" DeclFile="C:\E\Dev\FreeRTOS\Source\include\list.h" DeclLine="107" Pointer="No"/>
|
||||||
|
<type Header="xTaskHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\task.h" DeclLine="68" Pointer="No"/>
|
||||||
|
<type Header="xTimeOutType" Icon="1" Type="type" Desc=": struct xTIME_OUT" DeclFile="C:\E\Dev\FreeRTOS\Source\include\task.h" DeclLine="77" Pointer="No"/>
|
||||||
|
<type Header="tskTCB" Icon="1" Type="type" Desc=": struct tskTaskControlBlock" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="271" Pointer="No"/>
|
||||||
|
<func Header="prvIsTaskSuspended" Icon="3" Type="func" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="1004"/>
|
||||||
|
<func Header="vTaskSwitchContext" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="1476"/>
|
||||||
|
<func Header="vTaskSetTimeOutState" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="1616"/>
|
||||||
|
<func Header="xTaskCheckForTimeOut" Icon="3" Type="func" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="1623"/>
|
||||||
|
<func Header="vTaskMissedYield" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="1662"/>
|
||||||
|
<func Header="vTaskPriorityDisinherit" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="2011"/>
|
||||||
|
<type Header="xTaskHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\task.h" DeclLine="68" Pointer="No"/>
|
||||||
|
<type Header="xTaskHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\task.h" DeclLine="68" Pointer="No"/>
|
||||||
|
<type Header="xTaskHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\task.h" DeclLine="68" Pointer="No"/>
|
||||||
|
<func Header="vTaskPriorityInherit" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="1980"/>
|
||||||
|
<type Header="xTaskHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\task.h" DeclLine="68" Pointer="No"/>
|
||||||
|
<func Header="xTaskRemoveFromEventList" Icon="3" Type="func" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="1569"/>
|
||||||
|
<func Header="xTaskResumeFromISR" Icon="3" Type="func" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="1074"/>
|
||||||
|
<type Header="xTaskHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\task.h" DeclLine="68" Pointer="No"/>
|
||||||
|
<type Header="xTaskHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\task.h" DeclLine="68" Pointer="No"/>
|
||||||
|
<func Header="xTaskGetCurrentTaskHandle" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="1934"/>
|
||||||
|
<type Header="xTaskHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\task.h" DeclLine="68" Pointer="No"/>
|
||||||
|
<func Header="uxTaskGetNumberOfTasks" Icon="3" Type="func" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="1260"/>
|
||||||
|
<func Header="xTaskGetTickCount" Icon="3" Type="func" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="1245"/>
|
||||||
|
<func Header="vTaskSuspendAll" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="1159"/>
|
||||||
|
<func Header="uxTaskPriorityGet" Icon="3" Type="func" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="843"/>
|
||||||
|
<type Header="xTaskHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\task.h" DeclLine="68" Pointer="No"/>
|
||||||
|
<func Header="vTaskPlaceOnEventList" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="1499"/>
|
||||||
|
<func Header="vTaskIncrementTick" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="1369"/>
|
||||||
|
<func Header="xTaskResumeAll" Icon="3" Type="func" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="1167"/>
|
||||||
|
<func Header="vTaskResume" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="1034"/>
|
||||||
|
<type Header="xTaskHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\task.h" DeclLine="68" Pointer="No"/>
|
||||||
|
<func Header="vTaskSuspend" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="963"/>
|
||||||
|
<type Header="xTaskHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\task.h" DeclLine="68" Pointer="No"/>
|
||||||
|
<func Header="vTaskPrioritySet" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="865"/>
|
||||||
|
<type Header="xTaskHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\task.h" DeclLine="68" Pointer="No"/>
|
||||||
|
<func Header="vTaskDelay" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="784"/>
|
||||||
|
<func Header="vTaskDelayUntil" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="709"/>
|
||||||
|
<func Header="vTaskDelete" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="649"/>
|
||||||
|
<type Header="xTaskHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\task.h" DeclLine="68" Pointer="No"/>
|
||||||
|
<func Header="vTaskEndScheduler" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="1148"/>
|
||||||
|
<func Header="prvIdleTask" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="1678"/>
|
||||||
|
<func Header="xTaskCreate" Icon="3" Type="func" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="528"/>
|
||||||
|
<type Header="pdTASK_CODE" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\projdefs.h" DeclLine="41" Pointer="No"/>
|
||||||
|
<type Header="xTaskHandle" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\task.h" DeclLine="68" Pointer="No"/>
|
||||||
|
<func Header="vTaskStartScheduler" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="1111"/>
|
||||||
|
<variable Header="pxReadyTasksLists" Icon="2" Type="variable" Desc=": struct xLIST[5]" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="279" Pointer="No"/>
|
||||||
|
<variable Header="xDelayedTaskList1" Icon="2" Type="variable" Desc=": struct xLIST" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="280" Pointer="No"/>
|
||||||
|
<variable Header="xDelayedTaskList2" Icon="2" Type="variable" Desc=": struct xLIST" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="281" Pointer="No"/>
|
||||||
|
<variable Header="pxDelayedTaskList" Icon="2" Type="variable" Desc=": struct xLIST CODE*" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="282" Pointer="Yes"/>
|
||||||
|
<variable Header="pxOverflowDelayedTaskList" Icon="2" Type="variable" Desc=": struct xLIST CODE*" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="283" Pointer="Yes"/>
|
||||||
|
<variable Header="xPendingReadyList" Icon="2" Type="variable" Desc=": struct xLIST" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="284" Pointer="No"/>
|
||||||
|
<variable Header="xTasksWaitingTermination" Icon="2" Type="variable" Desc=": struct xLIST" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="288" Pointer="No"/>
|
||||||
|
<variable Header="uxTasksDeleted" Icon="2" Type="variable" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="289" Pointer="No"/>
|
||||||
|
<variable Header="xSuspendedTaskList" Icon="2" Type="variable" Desc=": struct xLIST" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="295" Pointer="No"/>
|
||||||
|
<variable Header="uxCurrentNumberOfTasks" Icon="2" Type="variable" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="300" Pointer="No"/>
|
||||||
|
<variable Header="xTickCount" Icon="2" Type="variable" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="301" Pointer="No"/>
|
||||||
|
<variable Header="uxTopUsedPriority" Icon="2" Type="variable" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="302" Pointer="No"/>
|
||||||
|
<variable Header="uxTopReadyPriority" Icon="2" Type="variable" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="303" Pointer="No"/>
|
||||||
|
<variable Header="xSchedulerRunning" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="304" Pointer="No"/>
|
||||||
|
<variable Header="uxSchedulerSuspended" Icon="2" Type="variable" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="305" Pointer="No"/>
|
||||||
|
<variable Header="uxMissedTicks" Icon="2" Type="variable" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="306" Pointer="No"/>
|
||||||
|
<variable Header="xMissedYield" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="307" Pointer="No"/>
|
||||||
|
<variable Header="xNumOfOverflows" Icon="2" Type="variable" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="308" Pointer="No"/>
|
||||||
|
<variable Header="pxCurrentTCB" Icon="2" Type="variable" Desc=": struct tskTaskControlBlock CODE*" DeclFile="C:\E\Dev\FreeRTOS\Source\tasks.c" DeclLine="275" Pointer="Yes"/>
|
||||||
|
<type Header="portTickType" Icon="1" Type="type" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Source\portable\GCC\ARM_CM3\portmacro.h" DeclLine="74" Pointer="No"/>
|
||||||
|
<type Header="xListItem" Icon="1" Type="type" Desc=": struct xLIST_ITEM" DeclFile="C:\E\Dev\FreeRTOS\Source\include\list.h" DeclLine="89" Pointer="No"/>
|
||||||
|
<type Header="xMiniListItem" Icon="1" Type="type" Desc=": struct xMINI_LIST_ITEM" DeclFile="C:\E\Dev\FreeRTOS\Source\include\list.h" DeclLine="97" Pointer="No"/>
|
||||||
|
<type Header="xList" Icon="1" Type="type" Desc=": struct xLIST" DeclFile="C:\E\Dev\FreeRTOS\Source\include\list.h" DeclLine="107" Pointer="No"/>
|
||||||
|
<func Header="vListInitialise" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\list.c" DeclLine="94"/>
|
||||||
|
<func Header="vListInitialiseItem" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\list.c" DeclLine="114"/>
|
||||||
|
<func Header="vListInsertEnd" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\list.c" DeclLine="121"/>
|
||||||
|
<func Header="vListInsert" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\list.c" DeclLine="144"/>
|
||||||
|
<func Header="vListRemove" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\list.c" DeclLine="185"/>
|
||||||
|
<type Header="size_t" Icon="1" Type="type" Desc=": unsigned long" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stddef.h" DeclLine="213" Pointer="No"/>
|
||||||
|
<type Header="portTickType" Icon="1" Type="type" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Source\portable\GCC\ARM_CM3\portmacro.h" DeclLine="74" Pointer="No"/>
|
||||||
|
<type Header="xListItem" Icon="1" Type="type" Desc=": struct xLIST_ITEM" DeclFile="C:\E\Dev\FreeRTOS\Source\include\list.h" DeclLine="89" Pointer="No"/>
|
||||||
|
<type Header="xMiniListItem" Icon="1" Type="type" Desc=": struct xMINI_LIST_ITEM" DeclFile="C:\E\Dev\FreeRTOS\Source\include\list.h" DeclLine="97" Pointer="No"/>
|
||||||
|
<type Header="xList" Icon="1" Type="type" Desc=": struct xLIST" DeclFile="C:\E\Dev\FreeRTOS\Source\include\list.h" DeclLine="107" Pointer="No"/>
|
||||||
|
<type Header="xTimeOutType" Icon="1" Type="type" Desc=": struct xTIME_OUT" DeclFile="C:\E\Dev\FreeRTOS\Source\include\task.h" DeclLine="77" Pointer="No"/>
|
||||||
|
<type Header="xQUEUE" Icon="1" Type="type" Desc=": struct QueueDefinition" DeclFile="C:\E\Dev\FreeRTOS\Source\queue.c" DeclLine="124" Pointer="No"/>
|
||||||
|
<type Header="xQueueHandle" Icon="1" Type="type" Desc=": struct QueueDefinition CODE*" DeclFile="C:\E\Dev\FreeRTOS\Source\queue.c" DeclLine="132" Pointer="Yes"/>
|
||||||
|
<func Header="vQueueDelete" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\queue.c" DeclLine="713"/>
|
||||||
|
<func Header="uxQueueMessagesWaiting" Icon="3" Type="func" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Source\queue.c" DeclLine="701"/>
|
||||||
|
<func Header="prvCopyDataFromQueue" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\queue.c" DeclLine="757"/>
|
||||||
|
<func Header="xQueueReceiveFromISR" Icon="3" Type="func" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Source\queue.c" DeclLine="653"/>
|
||||||
|
<func Header="prvUnlockQueue" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\queue.c" DeclLine="771"/>
|
||||||
|
<func Header="xQueueGenericReceive" Icon="3" Type="func" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Source\queue.c" DeclLine="519"/>
|
||||||
|
<func Header="prvCopyDataToQueue" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\queue.c" DeclLine="720"/>
|
||||||
|
<func Header="xQueueGenericSendFromISR" Icon="3" Type="func" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Source\queue.c" DeclLine="477"/>
|
||||||
|
<func Header="xQueueGenericSend" Icon="3" Type="func" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Source\queue.c" DeclLine="300"/>
|
||||||
|
<func Header="xQueueCreateMutex" Icon="3" Type="func" Desc=": struct QueueDefinition CODE*" DeclFile="C:\E\Dev\FreeRTOS\Source\queue.c" DeclLine="260"/>
|
||||||
|
<func Header="xQueueCreate" Icon="3" Type="func" Desc=": struct QueueDefinition CODE*" DeclFile="C:\E\Dev\FreeRTOS\Source\queue.c" DeclLine="210"/>
|
||||||
|
<type Header="pdTASK_CODE" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\projdefs.h" DeclLine="41" Pointer="No"/>
|
||||||
|
<func Header="pxPortInitialiseStack" Icon="3" Type="func" Desc=": unsigned long CODE*" DeclFile="C:\E\Dev\FreeRTOS\Source\portable\GCC\ARM_CM3\port.c" DeclLine="111"/>
|
||||||
|
<type Header="pdTASK_CODE" Icon="1" Type="type" Desc=": " DeclFile="C:\E\Dev\FreeRTOS\Source\include\projdefs.h" DeclLine="41" Pointer="No"/>
|
||||||
|
<func Header="prvSetPSP" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\portable\GCC\ARM_CM3\port.c" DeclLine="129"/>
|
||||||
|
<func Header="prvSetMSP" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\portable\GCC\ARM_CM3\port.c" DeclLine="136"/>
|
||||||
|
<func Header="vPortEndScheduler" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\portable\GCC\ARM_CM3\port.c" DeclLine="169"/>
|
||||||
|
<func Header="vPortYieldFromISR" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\portable\GCC\ARM_CM3\port.c" DeclLine="176"/>
|
||||||
|
<func Header="vPortEnterCritical" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\portable\GCC\ARM_CM3\port.c" DeclLine="187"/>
|
||||||
|
<func Header="vPortExitCritical" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\portable\GCC\ARM_CM3\port.c" DeclLine="194"/>
|
||||||
|
<func Header="xPortPendSVHandler" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\portable\GCC\ARM_CM3\port.c" DeclLine="204"/>
|
||||||
|
<func Header="xPortSysTickHandler" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\portable\GCC\ARM_CM3\port.c" DeclLine="251"/>
|
||||||
|
<func Header="xPortStartScheduler" Icon="3" Type="func" Desc=": long" DeclFile="C:\E\Dev\FreeRTOS\Source\portable\GCC\ARM_CM3\port.c" DeclLine="146"/>
|
||||||
|
<func Header="vPortIncrementTick" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\portable\GCC\ARM_CM3\port.c" DeclLine="317"/>
|
||||||
|
<func Header="vPortSwitchContext" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\portable\GCC\ARM_CM3\port.c" DeclLine="309"/>
|
||||||
|
<variable Header="ulKernelPriority" Icon="2" Type="variable" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Source\portable\GCC\ARM_CM3\port.c" DeclLine="82" Pointer="No"/>
|
||||||
|
<variable Header="uxCriticalNesting" Icon="2" Type="variable" Desc=": unsigned long" DeclFile="C:\E\Dev\FreeRTOS\Source\portable\GCC\ARM_CM3\port.c" DeclLine="86" Pointer="No"/>
|
||||||
|
<type Header="size_t" Icon="1" Type="type" Desc=": unsigned long" DeclFile="C:\devtools\Raisonance\Ride\Lib\ARM\include\stddef.h" DeclLine="213" Pointer="No"/>
|
||||||
|
<type Header="xBlockLink" Icon="1" Type="type" Desc=": struct A_BLOCK_LINK" DeclFile="C:\E\Dev\FreeRTOS\Source\portable\MemMang\heap_2.c" DeclLine="86" Pointer="No"/>
|
||||||
|
<func Header="vPortFree" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\portable\MemMang\heap_2.c" DeclLine="223"/>
|
||||||
|
<func Header="pvPortMalloc" Icon="3" Type="func" Desc=": void" DeclFile="C:\E\Dev\FreeRTOS\Source\portable\MemMang\heap_2.c" DeclLine="145"/>
|
||||||
|
<variable Header="xHeap" Icon="2" Type="variable" Desc=": struct xRTOS_HEAP" DeclFile="C:\E\Dev\FreeRTOS\Source\portable\MemMang\heap_2.c" DeclLine="78" Pointer="No"/>
|
||||||
|
<variable Header="xStart" Icon="2" Type="variable" Desc=": struct A_BLOCK_LINK" DeclFile="C:\E\Dev\FreeRTOS\Source\portable\MemMang\heap_2.c" DeclLine="93" Pointer="No"/>
|
||||||
|
<variable Header="xEnd" Icon="2" Type="variable" Desc=": struct A_BLOCK_LINK" DeclFile="C:\E\Dev\FreeRTOS\Source\portable\MemMang\heap_2.c" DeclLine="93" Pointer="No"/>
|
||||||
|
<type Header="clock_t" Icon="1" Type="type" Desc=": unsigned long" DeclFile="c:\program files\raisonance\ride\arm-gcc\arm-none-eabi\include\sys\types.h" DeclLine="104" Pointer="No"/>
|
||||||
|
<type Header="time_t" Icon="1" Type="type" Desc=": long" DeclFile="c:\program files\raisonance\ride\arm-gcc\arm-none-eabi\include\sys\types.h" DeclLine="109" Pointer="No"/>
|
||||||
|
<type Header="caddr_t" Icon="1" Type="type" Desc=": unsigned char CODE*" DeclFile="c:\program files\raisonance\ride\arm-gcc\arm-none-eabi\include\sys\types.h" DeclLine="126" Pointer="Yes"/>
|
||||||
|
<type Header="ino_t" Icon="1" Type="type" Desc=": unsigned int" DeclFile="c:\program files\raisonance\ride\arm-gcc\arm-none-eabi\include\sys\types.h" DeclLine="133" Pointer="No"/>
|
||||||
|
<type Header="dev_t" Icon="1" Type="type" Desc=": int" DeclFile="c:\program files\raisonance\ride\arm-gcc\arm-none-eabi\include\sys\types.h" DeclLine="166" Pointer="No"/>
|
||||||
|
<type Header="off_t" Icon="1" Type="type" Desc=": long" DeclFile="c:\program files\raisonance\ride\arm-gcc\arm-none-eabi\include\sys\types.h" DeclLine="171" Pointer="No"/>
|
||||||
|
<type Header="uid_t" Icon="1" Type="type" Desc=": unsigned int" DeclFile="c:\program files\raisonance\ride\arm-gcc\arm-none-eabi\include\sys\types.h" DeclLine="173" Pointer="No"/>
|
||||||
|
<type Header="gid_t" Icon="1" Type="type" Desc=": unsigned int" DeclFile="c:\program files\raisonance\ride\arm-gcc\arm-none-eabi\include\sys\types.h" DeclLine="174" Pointer="No"/>
|
||||||
|
<type Header="mode_t" Icon="1" Type="type" Desc=": unsigned long" DeclFile="c:\program files\raisonance\ride\arm-gcc\arm-none-eabi\include\sys\types.h" DeclLine="195" Pointer="No"/>
|
||||||
|
<type Header="nlink_t" Icon="1" Type="type" Desc=": unsigned int" DeclFile="c:\program files\raisonance\ride\arm-gcc\arm-none-eabi\include\sys\types.h" DeclLine="200" Pointer="No"/>
|
||||||
|
<type Header="suseconds_t" Icon="1" Type="type" Desc=": long" DeclFile="c:\program files\raisonance\ride\arm-gcc\arm-none-eabi\include\sys\types.h" DeclLine="263" Pointer="No"/>
|
||||||
|
<type Header="poslog" Icon="1" Type="type" Desc=": struct " DeclFile="C:\Program Files\Raisonance\Ride\lib\ARM\io_putchar\syscalls.c" DeclLine="83" Pointer="No"/>
|
||||||
|
<func Header="_read" Icon="3" Type="func" Desc=": long" DeclFile="C:\Program Files\Raisonance\Ride\lib\ARM\io_putchar\syscalls.c" DeclLine="173"/>
|
||||||
|
<func Header="_lseek" Icon="3" Type="func" Desc=": long" DeclFile="C:\Program Files\Raisonance\Ride\lib\ARM\io_putchar\syscalls.c" DeclLine="180"/>
|
||||||
|
<func Header="_open" Icon="3" Type="func" Desc=": long" DeclFile="C:\Program Files\Raisonance\Ride\lib\ARM\io_putchar\syscalls.c" DeclLine="203"/>
|
||||||
|
<func Header="_close" Icon="3" Type="func" Desc=": long" DeclFile="C:\Program Files\Raisonance\Ride\lib\ARM\io_putchar\syscalls.c" DeclLine="208"/>
|
||||||
|
<func Header="_exit" Icon="3" Type="func" Desc=": void" DeclFile="C:\Program Files\Raisonance\Ride\lib\ARM\io_putchar\syscalls.c" DeclLine="213"/>
|
||||||
|
<func Header="_kill" Icon="3" Type="func" Desc=": long" DeclFile="C:\Program Files\Raisonance\Ride\lib\ARM\io_putchar\syscalls.c" DeclLine="219"/>
|
||||||
|
<func Header="_fstat" Icon="3" Type="func" Desc=": long" DeclFile="C:\Program Files\Raisonance\Ride\lib\ARM\io_putchar\syscalls.c" DeclLine="247"/>
|
||||||
|
<func Header="_stat" Icon="3" Type="func" Desc=": long" DeclFile="C:\Program Files\Raisonance\Ride\lib\ARM\io_putchar\syscalls.c" DeclLine="253"/>
|
||||||
|
<func Header="_link" Icon="3" Type="func" Desc=": long" DeclFile="C:\Program Files\Raisonance\Ride\lib\ARM\io_putchar\syscalls.c" DeclLine="259"/>
|
||||||
|
<func Header="_unlink" Icon="3" Type="func" Desc=": long" DeclFile="C:\Program Files\Raisonance\Ride\lib\ARM\io_putchar\syscalls.c" DeclLine="264"/>
|
||||||
|
<func Header="_raise" Icon="3" Type="func" Desc=": void" DeclFile="C:\Program Files\Raisonance\Ride\lib\ARM\io_putchar\syscalls.c" DeclLine="269"/>
|
||||||
|
<func Header="_getpid" Icon="3" Type="func" Desc=": long" DeclFile="C:\Program Files\Raisonance\Ride\lib\ARM\io_putchar\syscalls.c" DeclLine="274"/>
|
||||||
|
<func Header="_gettimeofday" Icon="3" Type="func" Desc=": long" DeclFile="C:\Program Files\Raisonance\Ride\lib\ARM\io_putchar\syscalls.c" DeclLine="279"/>
|
||||||
|
<func Header="_times" Icon="3" Type="func" Desc=": unsigned long" DeclFile="C:\Program Files\Raisonance\Ride\lib\ARM\io_putchar\syscalls.c" DeclLine="304"/>
|
||||||
|
<func Header="isatty" Icon="3" Type="func" Desc=": long" DeclFile="C:\Program Files\Raisonance\Ride\lib\ARM\io_putchar\syscalls.c" DeclLine="322"/>
|
||||||
|
<func Header="_rename" Icon="3" Type="func" Desc=": long" DeclFile="C:\Program Files\Raisonance\Ride\lib\ARM\io_putchar\syscalls.c" DeclLine="336"/>
|
||||||
|
<func Header="_system" Icon="3" Type="func" Desc=": long" DeclFile="C:\Program Files\Raisonance\Ride\lib\ARM\io_putchar\syscalls.c" DeclLine="328"/>
|
||||||
|
<func Header="_write" Icon="3" Type="func" Desc=": long" DeclFile="C:\Program Files\Raisonance\Ride\lib\ARM\io_putchar\syscalls.c" DeclLine="189"/>
|
||||||
|
<func Header="_sbrk" Icon="3" Type="func" Desc=": unsigned char CODE*" DeclFile="C:\Program Files\Raisonance\Ride\lib\ARM\io_putchar\syscalls.c" DeclLine="224"/>
|
||||||
|
<variable Header="stack_ptr" Icon="2" Type="variable" Desc=": unsigned char CODE*" DeclFile="C:\Program Files\Raisonance\Ride\lib\ARM\io_putchar\syscalls.c" DeclLine="53" Pointer="Yes"/>
|
||||||
|
<type Header="u32" Icon="1" Type="type" Desc=": unsigned long" DeclFile="C:\Program Files\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="36" Pointer="No"/>
|
||||||
|
<type Header="u16" Icon="1" Type="type" Desc=": unsigned int" DeclFile="C:\Program Files\Raisonance\Ride\Lib\ARM\include\stm32f10x_type.h" DeclLine="37" Pointer="No"/>
|
||||||
|
<type Header="GPIOSpeed_TypeDef" Icon="1" Type="type" Desc=": unsigned char" DeclFile="C:\Program Files\Raisonance\Ride\Lib\ARM\include\stm32f10x_gpio.h" DeclLine="36" Pointer="No"/>
|
||||||
|
<type Header="GPIOMode_TypeDef" Icon="1" Type="type" Desc=": unsigned char" DeclFile="C:\Program Files\Raisonance\Ride\Lib\ARM\include\stm32f10x_gpio.h" DeclLine="51" Pointer="No"/>
|
||||||
|
<type Header="GPIO_InitTypeDef" Icon="1" Type="type" Desc=": struct " DeclFile="C:\Program Files\Raisonance\Ride\Lib\ARM\include\stm32f10x_gpio.h" DeclLine="64" Pointer="No"/>
|
||||||
|
<type Header="USART_InitTypeDef" Icon="1" Type="type" Desc=": struct " DeclFile="C:\Program Files\Raisonance\Ride\Lib\ARM\include\stm32f10x_usart.h" DeclLine="43" Pointer="No"/>
|
||||||
|
<func Header="__io_SetMainOscFreq" Icon="3" Type="func" Desc=": void" DeclFile="C:\Program Files\Raisonance\Ride\lib\ARM\io_putchar\STM32F10X_IO_putchar.c" DeclLine="29"/>
|
||||||
|
<func Header="__io_init" Icon="3" Type="func" Desc=": void" DeclFile="C:\Program Files\Raisonance\Ride\lib\ARM\io_putchar\STM32F10X_IO_putchar.c" DeclLine="35"/>
|
||||||
|
<func Header="__io_getchar" Icon="3" Type="func" Desc=": long" DeclFile="C:\Program Files\Raisonance\Ride\lib\ARM\io_putchar\STM32F10X_IO_putchar.c" DeclLine="122"/>
|
||||||
|
<func Header="getchar" Icon="3" Type="func" Desc=": long" DeclFile="C:\Program Files\Raisonance\Ride\lib\ARM\io_putchar\STM32F10X_IO_putchar.c" DeclLine="142"/>
|
||||||
|
<func Header="__io_putchar" Icon="3" Type="func" Desc=": void" DeclFile="C:\Program Files\Raisonance\Ride\lib\ARM\io_putchar\STM32F10X_IO_putchar.c" DeclLine="94"/>
|
||||||
|
<func Header="putchar" Icon="3" Type="func" Desc=": long" DeclFile="C:\Program Files\Raisonance\Ride\lib\ARM\io_putchar\STM32F10X_IO_putchar.c" DeclLine="116"/>
|
||||||
|
<variable Header="__io_init_done" Icon="2" Type="variable" Desc=": unsigned char" DeclFile="C:\Program Files\Raisonance\Ride\lib\ARM\io_putchar\STM32F10X_IO_putchar.c" DeclLine="23" Pointer="No"/>
|
||||||
|
<variable Header="__io_Main_Osc" Icon="2" Type="variable" Desc=": unsigned long" DeclFile="C:\Program Files\Raisonance\Ride\lib\ARM\io_putchar\STM32F10X_IO_putchar.c" DeclLine="25" Pointer="No"/>
|
||||||
|
</aoffile>
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,108 @@
|
|||||||
|
|
||||||
|
<ApplicationBuild Header="RTOSDemo" Extern=".\RTOSDemo.rapp" Path=".\RTOSDemo.rapp" OutputFile=".\RTOSDemo.elf" sate="98" >
|
||||||
|
<Group Header="ST_Library" Marker="-1" OutputFile="" sate="96" >
|
||||||
|
<NodeC Path=".\ST_Code\led.c" Header="led.c" Marker="-1" OutputFile=".\led.o" sate="0" >
|
||||||
|
<Options> </Options>
|
||||||
|
|
||||||
|
</NodeC>
|
||||||
|
<NodeC Path=".\ST_Code\crt0_STM32x.c" Header="crt0_STM32x.c" Marker="-1" OutputFile=".\crt0_STM32x.o" sate="0" >
|
||||||
|
<Options> </Options>
|
||||||
|
|
||||||
|
</NodeC>
|
||||||
|
<NodeC Path=".\ST_Code\lcd.c" Header="lcd.c" Marker="-1" OutputFile=".\lcd.o" sate="0" >
|
||||||
|
<Options> </Options>
|
||||||
|
|
||||||
|
</NodeC>
|
||||||
|
<NodeC Path=".\ST_Code\Util.c" Header="Util.c" Marker="-1" OutputFile=".\Util.o" sate="0" >
|
||||||
|
<Options> </Options>
|
||||||
|
|
||||||
|
</NodeC>
|
||||||
|
<NodeC Path=".\ST_Code\draw.c" Header="draw.c" Marker="-1" OutputFile=".\draw.o" sate="0" >
|
||||||
|
<Options> </Options>
|
||||||
|
|
||||||
|
</NodeC>
|
||||||
|
<NodeC Path=".\ST_Code\mems.c" Header="mems.c" Marker="-1" OutputFile=".\mems.o" sate="0" />
|
||||||
|
<NodeH Path=".\ST_Code\stm32f10x_conf.h" Header="stm32f10x_conf.h" Marker="-1" OutputFile="" sate="0" />
|
||||||
|
<NodeC Path=".\ST_Code\buzzer.c" Header="buzzer.c" Marker="-1" OutputFile=".\buzzer.o" sate="0" />
|
||||||
|
<NodeC Path=".\ST_Code\pointer.c" Header="pointer.c" Marker="-1" OutputFile=".\pointer.o" sate="0" />
|
||||||
|
|
||||||
|
</Group>
|
||||||
|
<Group Header="Demo_Source" Marker="-1" OutputFile="" sate="96" >
|
||||||
|
<NodeC Path=".\main.c" Header="main.c" Marker="-1" OutputFile=".\main.o" sate="0" />
|
||||||
|
<NodeC Path=".\ParTest\ParTest.c" Header="ParTest.c" Marker="-1" OutputFile=".\ParTest.o" sate="0" />
|
||||||
|
<NodeH Path=".\FreeRTOSConfig.h" Header="FreeRTOSConfig.h" Marker="-1" OutputFile="" sate="0" />
|
||||||
|
<NodeC Path=".\timertest.c" Header="timertest.c" Marker="-1" OutputFile=".\timertest.o" sate="0" />
|
||||||
|
<NodeC Path=".\printf-stdarg.c" Header="printf-stdarg.c" Marker="-1" OutputFile=".\printf-stdarg.o" sate="0" >
|
||||||
|
<Options/>
|
||||||
|
|
||||||
|
</NodeC>
|
||||||
|
<NodeC Path="..\Common\Minimal\GenQTest.c" Header="GenQTest.c" Marker="-1" OutputFile=".\GenQTest.o" sate="0" />
|
||||||
|
<NodeC Path="..\Common\Minimal\BlockQ.c" Header="BlockQ.c" Marker="-1" OutputFile=".\BlockQ.o" sate="0" />
|
||||||
|
<NodeC Path="..\Common\Minimal\blocktim.c" Header="blocktim.c" Marker="-1" OutputFile=".\blocktim.o" sate="0" />
|
||||||
|
<NodeC Path="..\Common\Minimal\QPeek.c" Header="QPeek.c" Marker="-1" OutputFile=".\QPeek.o" sate="0" />
|
||||||
|
<NodeC Path="..\Common\Minimal\PollQ.c" Header="PollQ.c" Marker="-1" OutputFile=".\PollQ.o" sate="0" />
|
||||||
|
|
||||||
|
</Group>
|
||||||
|
<Group Header="FreeRTOS.org_Source" Marker="-1" OutputFile="" sate="96" >
|
||||||
|
<NodeC Path="..\..\Source\tasks.c" Header="tasks.c" Marker="-1" OutputFile=".\tasks.o" sate="0" >
|
||||||
|
<Options/>
|
||||||
|
|
||||||
|
</NodeC>
|
||||||
|
<NodeC Path="..\..\Source\list.c" Header="list.c" Marker="-1" OutputFile=".\list.o" sate="0" >
|
||||||
|
<Options/>
|
||||||
|
|
||||||
|
</NodeC>
|
||||||
|
<NodeC Path="..\..\Source\queue.c" Header="queue.c" Marker="-1" OutputFile=".\queue.o" sate="0" >
|
||||||
|
<Options/>
|
||||||
|
|
||||||
|
</NodeC>
|
||||||
|
<NodeC Path="..\..\Source\portable\GCC\ARM_CM3\port.c" Header="port.c" Marker="-1" OutputFile=".\port.o" sate="0" />
|
||||||
|
<NodeC Path="..\..\Source\portable\MemMang\heap_2.c" Header="heap_2.c" Marker="-1" OutputFile=".\heap_2.o" sate="0" />
|
||||||
|
|
||||||
|
</Group>
|
||||||
|
<Options>
|
||||||
|
<Config Header="Standard" >
|
||||||
|
<Set Header="ApplicationBuild" >
|
||||||
|
<Section Header="General" >
|
||||||
|
<Property Header="TargetFamily" Value="ARM" />
|
||||||
|
|
||||||
|
</Section>
|
||||||
|
<Section Header="Directories" >
|
||||||
|
<Property Header="IncDir" Value="$(ApplicationDir)\..\..\Source\include;$(ApplicationDir)\..\Common\include;$(ApplicationDir)\ST_Code;$(RkitLib)\ARM\include;." Removable="1" />
|
||||||
|
|
||||||
|
</Section>
|
||||||
|
|
||||||
|
</Set>
|
||||||
|
<Set Header="Target" >
|
||||||
|
<Section Header="ProcessorARM" >
|
||||||
|
<Property Header="Processor" Value="STM32F103RBT6" />
|
||||||
|
|
||||||
|
</Section>
|
||||||
|
<Section Header="ToolSetARM" >
|
||||||
|
<Property Header="BuildToolSetARM" Value="ARM\\GNU.config" Removable="1" />
|
||||||
|
|
||||||
|
</Section>
|
||||||
|
|
||||||
|
</Set>
|
||||||
|
<Set Header="LD" >
|
||||||
|
<Section Header="Startup" >
|
||||||
|
<Property Header="DEFAULTSTARTUP" Value="No" Removable="1" />
|
||||||
|
<Property Header="File" Value="" Removable="1" />
|
||||||
|
|
||||||
|
</Section>
|
||||||
|
|
||||||
|
</Set>
|
||||||
|
<Set Header="GCC" >
|
||||||
|
<Section Header="Defines" >
|
||||||
|
<Property Header="Defines" Value="GCC_ARMCM3" Removable="1" />
|
||||||
|
|
||||||
|
</Section>
|
||||||
|
<Section Header="OPTIMIZE" >
|
||||||
|
<Property Header="Optimize" Value="-O1" Removable="1" />
|
||||||
|
|
||||||
|
</Section>
|
||||||
|
|
||||||
|
</Set>
|
||||||
|
</Config>
|
||||||
|
</Options>
|
||||||
|
</ApplicationBuild>
|
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
<Project Header="Project 'RTOSDemo'" Path=".\RTOSDemo.rprj" Project="Yes" OutputFile="" sate="96" ActiveApp="RTOSDemo" >
|
||||||
|
<ApplicationBuild Header="RTOSDemo" Extern=".\RTOSDemo.rapp" Path=".\RTOSDemo.rapp" OutputFile=".\RTOSDemo.elf" sate="98" ></ApplicationBuild>
|
||||||
|
</Project>
|
@ -0,0 +1,528 @@
|
|||||||
|
/********************* (C) COPYRIGHT 2007 RAISONANCE S.A.S. *******************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @file Util.c
|
||||||
|
* @brief Various utilities for STM32 CircleOS.
|
||||||
|
* @author RT
|
||||||
|
* @date 07/2007
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "circle.h"
|
||||||
|
#include "adc.h"
|
||||||
|
|
||||||
|
/// @cond Internal
|
||||||
|
|
||||||
|
/* Private defines -----------------------------------------------------------*/
|
||||||
|
#define GPIO_USB_PIN GPIO_Pin_1
|
||||||
|
#define GPIOx_USB GPIOA
|
||||||
|
#define OsVersion "V 1.7" /*!< CircleOS version string. */
|
||||||
|
|
||||||
|
/* Private typedef -----------------------------------------------------------*/
|
||||||
|
enum eSpeed CurrentSpeed;
|
||||||
|
|
||||||
|
/* Private variables ---------------------------------------------------------*/
|
||||||
|
RCC_ClocksTypeDef RCC_ClockFreq;
|
||||||
|
int dummycounter = 0;
|
||||||
|
u8 fTemperatureInFahrenheit = 0; /*!< 1 : Fahrenheit, 0 : Celcius (default). */
|
||||||
|
|
||||||
|
/* Private function prototypes -----------------------------------------------*/
|
||||||
|
static void _int2str( char* ptr, s32 X, u16 digit, int flagunsigned, int fillwithzero );
|
||||||
|
|
||||||
|
/* Private functions ---------------------------------------------------------*/
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* _int2str
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Translate a 32 bit word into a string.
|
||||||
|
*
|
||||||
|
* @param[in,out] ptr A pointer to a string large enough to contain
|
||||||
|
* the translated 32 bit word.
|
||||||
|
* @param[in] X The 32 bit word to translate.
|
||||||
|
* @param[in] digit The amount of digits wanted in the result string.
|
||||||
|
* @param[in] flagunsigned Is the input word unsigned?
|
||||||
|
* @param[in] fillwithzero Fill with zeros or spaces.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
static void _int2str( char* ptr, s32 X, u16 digit, int flagunsigned, int fillwithzero )
|
||||||
|
{
|
||||||
|
u8 c;
|
||||||
|
u8 fFirst = 0;
|
||||||
|
u8 fNeg = 0;
|
||||||
|
u32 DIG = 1;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for( i = 1; i < digit; i++ )
|
||||||
|
{
|
||||||
|
DIG *= 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !flagunsigned && ( X < 0 ) )
|
||||||
|
{
|
||||||
|
fNeg = 1;
|
||||||
|
X = -X;
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 r = X;
|
||||||
|
|
||||||
|
for( i = 0; i < digit; i++, DIG /= 10 )
|
||||||
|
{
|
||||||
|
c = (r/DIG);
|
||||||
|
r -= (c*DIG);
|
||||||
|
|
||||||
|
if( fillwithzero || fFirst || c || ( i == ( digit - 1 ) ) )
|
||||||
|
{
|
||||||
|
if( ( fFirst == 0 ) && !flagunsigned )
|
||||||
|
{
|
||||||
|
*ptr++ = fNeg ? '-' : ' ';
|
||||||
|
}
|
||||||
|
|
||||||
|
*ptr++ = c + 0x30;
|
||||||
|
fFirst = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*ptr++ = ' ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
*ptr++ = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Public functions for CircleOS ---------------------------------------------*/
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* delay_unit
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Called by starting_delay().
|
||||||
|
*
|
||||||
|
* @note Not in main.c to avoid inlining.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void delay_unit( void )
|
||||||
|
{
|
||||||
|
dummycounter++;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @endcond
|
||||||
|
|
||||||
|
/* Public functions ----------------------------------------------------------*/
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* UTIL_GetBat
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Return the batterie tension in mV.
|
||||||
|
*
|
||||||
|
* @return Batterie tension in mV.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
u16 UTIL_GetBat( void )
|
||||||
|
{
|
||||||
|
#ifdef _ADC
|
||||||
|
u16 vbat;
|
||||||
|
|
||||||
|
// Measure VBAT
|
||||||
|
vbat = ADC_ConvertedValue[0]; //*( (u16*)ADC1_DR_Address ); // <=== note changed
|
||||||
|
vbat = vbat & 0xFFF;
|
||||||
|
vbat = ( vbat * VDD_VOLTAGE_MV ) / 0x1000;
|
||||||
|
|
||||||
|
return vbat;
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* UTIL_GetTemp
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Return the Temperature: degrees / 10, Celcius or Fahrenheit.
|
||||||
|
*
|
||||||
|
* @return The temperature (C or F) (averaging of several channels).
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
u16 UTIL_GetTemp( void )
|
||||||
|
{
|
||||||
|
s32 temp;
|
||||||
|
s16 *p=&ADC_ConvertedValue[1]; //intent; point to first of 8 results from same source - use a short name for it!
|
||||||
|
|
||||||
|
// Measure temp
|
||||||
|
//temp = ADC_ConvertedValue[1];//*( (u16*)ADC1_DR_Address );
|
||||||
|
temp = (p[0]+p[1]+p[2]+p[3]+p[4]+p[5]+p[6]+p[7])/8; //take avg of burst of 8 temp reads. may only help reject hi freq noise a bit
|
||||||
|
//will not help reduce mains ripple because conversions are SO FAST!!
|
||||||
|
temp = temp & 0xFFF;
|
||||||
|
temp = ( temp * VDD_VOLTAGE_MV ) / 0x1000; //finds mV
|
||||||
|
temp = (((1400-temp)*100000)/448)+25000; //gives approx temp x 1000 degrees C
|
||||||
|
|
||||||
|
//Fahrenheit = 32 + 9 / 5 * Celsius
|
||||||
|
if ( fTemperatureInFahrenheit )
|
||||||
|
{
|
||||||
|
temp = 32000 + (9 * temp) / 5 ;
|
||||||
|
}
|
||||||
|
|
||||||
|
return temp / 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* UTIL_SetTempMode
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Set the temperature mode (F/C)
|
||||||
|
*
|
||||||
|
* @param[in] mode 0: Celcius, 1: Fahrenheit
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void UTIL_SetTempMode ( int mode )
|
||||||
|
{
|
||||||
|
fTemperatureInFahrenheit = mode;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* UTIL_GetUsb
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Return the USB connexion state.
|
||||||
|
*
|
||||||
|
* @return The USB connexion state.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
u8 UTIL_GetUsb( void )
|
||||||
|
{
|
||||||
|
GPIO_InitStructure.GPIO_Pin = GPIO_USB_PIN;
|
||||||
|
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
|
||||||
|
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||||
|
|
||||||
|
GPIO_Init( GPIOx_USB, &GPIO_InitStructure );
|
||||||
|
|
||||||
|
return ( GPIO_ReadInputDataBit( GPIOx_USB, GPIO_USB_PIN ) == Bit_SET );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* UTIL_uint2str
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Convert an <b>unsigned</b> integer into a string.
|
||||||
|
*
|
||||||
|
* @param [out] ptr The output string.
|
||||||
|
* @param [in] X The unsigned value to convert.
|
||||||
|
* @param [in] digit The number of digits in the output string.
|
||||||
|
* @param [in] fillwithzero \li 0 fill with blanks.
|
||||||
|
* \li 1 fill with zeros.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/********************************************************************************/
|
||||||
|
void UTIL_uint2str( char* ptr, u32 X, u16 digit, int fillwithzero )
|
||||||
|
{
|
||||||
|
_int2str( ptr, X, digit, 1, fillwithzero);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* UTIL_int2str
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Convert a <b>signed</b> integer into a string.
|
||||||
|
*
|
||||||
|
* @param [out] ptr The output string.
|
||||||
|
* @param [in] X The unsigned value to convert.
|
||||||
|
* @param [in] digit The number of digits in the output string.
|
||||||
|
* @param [in] fillwithzero \li 0 fill with blanks.
|
||||||
|
* \li 1 fill with zeros.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void UTIL_int2str( char* ptr, s32 X, u16 digit, int fillwithzero )
|
||||||
|
{
|
||||||
|
_int2str( ptr, X, digit, 0, fillwithzero);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* UTIL_SetPll
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Set clock frequency (lower to save energy)
|
||||||
|
*
|
||||||
|
* @param [in] speed New clock speed from very low to very fast.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void UTIL_SetPll( enum eSpeed speed )
|
||||||
|
{
|
||||||
|
/* Select PLL as system clock source */
|
||||||
|
RCC_SYSCLKConfig( RCC_SYSCLKSource_HSI );
|
||||||
|
|
||||||
|
/* Enable PLL */
|
||||||
|
RCC_PLLCmd( DISABLE );
|
||||||
|
|
||||||
|
if( ( speed < SPEED_VERY_LOW ) || ( speed > SPEED_VERY_HIGH ) )
|
||||||
|
{
|
||||||
|
speed = SPEED_MEDIUM;
|
||||||
|
}
|
||||||
|
|
||||||
|
CurrentSpeed = speed;
|
||||||
|
|
||||||
|
switch( speed )
|
||||||
|
{
|
||||||
|
// 18 MHz
|
||||||
|
case SPEED_VERY_LOW :
|
||||||
|
/* PLLCLK = 6MHz * 3 = 18 MHz */
|
||||||
|
RCC_PLLConfig( RCC_PLLSource_HSE_Div2, RCC_PLLMul_3 );
|
||||||
|
break;
|
||||||
|
|
||||||
|
// 24MHz
|
||||||
|
case SPEED_LOW :
|
||||||
|
/* PLLCLK = 12MHz * 2 = 24 MHz */
|
||||||
|
RCC_PLLConfig( RCC_PLLSource_HSE_Div1, RCC_PLLMul_2 );
|
||||||
|
break;
|
||||||
|
|
||||||
|
// 36MHz
|
||||||
|
case SPEED_MEDIUM :
|
||||||
|
default :
|
||||||
|
/* PLLCLK = 12MHz * 3 = 36 MHz */
|
||||||
|
RCC_PLLConfig( RCC_PLLSource_HSE_Div1, RCC_PLLMul_3 );
|
||||||
|
break;
|
||||||
|
|
||||||
|
// 48MHz
|
||||||
|
case SPEED_HIGH :
|
||||||
|
/* PLLCLK = 12MHz * 4 = 48 MHz */
|
||||||
|
RCC_PLLConfig( RCC_PLLSource_HSE_Div1, RCC_PLLMul_4 );
|
||||||
|
break;
|
||||||
|
|
||||||
|
// 72MHz
|
||||||
|
case SPEED_VERY_HIGH :
|
||||||
|
/* PLLCLK = 12MHz * 6 = 72 MHz */
|
||||||
|
RCC_PLLConfig( RCC_PLLSource_HSE_Div1, RCC_PLLMul_6 );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Enable PLL */
|
||||||
|
RCC_PLLCmd( ENABLE );
|
||||||
|
|
||||||
|
/* Wait till PLL is ready */
|
||||||
|
while( RCC_GetFlagStatus( RCC_FLAG_PLLRDY ) == RESET )
|
||||||
|
{ ; }
|
||||||
|
|
||||||
|
/* Select PLL as system clock source */
|
||||||
|
RCC_SYSCLKConfig( RCC_SYSCLKSource_PLLCLK );
|
||||||
|
|
||||||
|
/* Wait till PLL is used as system clock source */
|
||||||
|
while( RCC_GetSYSCLKSource() != 0x08 )
|
||||||
|
{ ; }
|
||||||
|
|
||||||
|
/* This function fills a RCC_ClocksTypeDef structure with the current frequencies
|
||||||
|
of different on chip clocks (for debug purpose) */
|
||||||
|
RCC_GetClocksFreq( &RCC_ClockFreq );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* UTIL_GetPll
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Get clock frequency
|
||||||
|
*
|
||||||
|
* @return Current clock speed from very low to very fast.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
enum eSpeed UTIL_GetPll( void )
|
||||||
|
{
|
||||||
|
return CurrentSpeed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* UTIL_GetVersion
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Get CircleOS version.
|
||||||
|
*
|
||||||
|
* @return A pointer to a string containing the CircleOS version.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
const char* UTIL_GetVersion( void )
|
||||||
|
{
|
||||||
|
return OsVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* UTIL_ReadBackupRegister
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Reads data from the specified Data Backup Register.
|
||||||
|
*
|
||||||
|
* @param[in] BKP_DR Specifies the Data Backup Register. This parameter can be BKP_DRx where x:[1, 10]
|
||||||
|
*
|
||||||
|
* @return The content of the specified Data Backup Register.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
u16 UTIL_ReadBackupRegister( u16 BKP_DR )
|
||||||
|
{
|
||||||
|
return (*(vu16 *)( BKP_BASE + 4 * BKP_DR ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* UTIL_WriteBackupRegister
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Writes data to the specified Data Backup Register.
|
||||||
|
*
|
||||||
|
* @param[in] BKP_DR Specifies the Data Backup Register. This parameter can be BKP_DRx where x:[1, 10]
|
||||||
|
* @param[in] Data The data to write.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/********************************************************************************/
|
||||||
|
void UTIL_WriteBackupRegister( u16 BKP_DR, u16 Data )
|
||||||
|
{
|
||||||
|
*(vu16 *)( BKP_BASE + 4 * BKP_DR ) = Data;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* UTIL_SetIrqHandler
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Redirect an IRQ handler.
|
||||||
|
*
|
||||||
|
* @param[in] Offs Address in the NVIC table
|
||||||
|
* @param[in] pHDL Pointer to the handler.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/********************************************************************************/
|
||||||
|
void UTIL_SetIrqHandler( int Offs, tHandler pHDL )
|
||||||
|
{
|
||||||
|
if ( (Offs >= 8) && (Offs<0x100) )
|
||||||
|
*(tHandler *)( CIRCLEOS_RAM_BASE + Offs ) = pHDL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* UTIL_GetIrqHandler
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Get the current IRQ handler.
|
||||||
|
* Since (V1.6) the vector table is relocated in RAM, the vectors can be easily modified
|
||||||
|
* by the applications.
|
||||||
|
*
|
||||||
|
* @param[in] Offs Address in the NVIC table
|
||||||
|
* @return A pointer to the current handler.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/********************************************************************************/
|
||||||
|
tHandler UTIL_GetIrqHandler( int Offs )
|
||||||
|
{
|
||||||
|
if ( (Offs >= 8) && (Offs<0x100) )
|
||||||
|
return *(tHandler *)( CIRCLEOS_RAM_BASE + Offs );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* UTIL_SetSchHandler
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Redirect a SCHEDULER handler.
|
||||||
|
* Set the current SCHEDULER handler. With UTIL_GetSchHandler(), these functions
|
||||||
|
* allow to take the control of the different handler. You can:
|
||||||
|
* - replace them (get-Set)by your own handler
|
||||||
|
* - disable a handler: UTIL_SetSchHandler(Ix,0);
|
||||||
|
* - create a new handler (using the unused handlers).
|
||||||
|
* See scheduler.c to understand further...
|
||||||
|
*
|
||||||
|
* @param[in] Ix ID if the SCH Handler
|
||||||
|
* @param[in] pHDL Pointer to the handler.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/********************************************************************************/
|
||||||
|
void UTIL_SetSchHandler( enum eSchHandler Ix, tHandler pHDL )
|
||||||
|
{
|
||||||
|
if (Ix<SCH_HDL_MAX)
|
||||||
|
SchHandler[Ix] = pHDL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* UTIL_GetSchHandler
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Get the current SCHEDULER handler. With UTIL_SetSchHandler(), these functions
|
||||||
|
* allow to take the control of the different handler. You can:
|
||||||
|
* - replace them (get-Set)by your own handler
|
||||||
|
* - disable a handler: UTIL_SetSchHandler(Ix,0);
|
||||||
|
* - create a new handler (using the unused handlers).
|
||||||
|
* See scheduler.c to understand further...
|
||||||
|
*
|
||||||
|
* @param[in] Ix ID is the SCH Handler
|
||||||
|
* @return A pointer to the current handler.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/********************************************************************************/
|
||||||
|
tHandler UTIL_GetSchHandler( enum eSchHandler Ix )
|
||||||
|
{
|
||||||
|
if ( Ix<SCH_HDL_MAX )
|
||||||
|
return SchHandler [Ix] ;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,18 @@
|
|||||||
|
/********************* (C) COPYRIGHT 2007 RAISONANCE S.A.S. *******************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @file adc.h
|
||||||
|
* @brief ADC initialization header file.
|
||||||
|
* @author FL
|
||||||
|
* @date 07/2007
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion ---------------------------------------*/
|
||||||
|
#ifndef __ADC_H
|
||||||
|
#define __ADC_H
|
||||||
|
|
||||||
|
#define ADC1_DR_Address ((u32)0x4001244C)
|
||||||
|
|
||||||
|
#endif /*__ADC_H */
|
@ -0,0 +1,554 @@
|
|||||||
|
/********************* (C) COPYRIGHT 2007 RAISONANCE S.A.S. *******************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @file buzzer.c
|
||||||
|
* @brief Buzzer dedicated functions with RTTTL format support.
|
||||||
|
* @author IB
|
||||||
|
* @date 07/2007
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "circle.h"
|
||||||
|
|
||||||
|
/// @cond Internal
|
||||||
|
|
||||||
|
/* Private typedef -----------------------------------------------------------*/
|
||||||
|
|
||||||
|
/*! Octaves */
|
||||||
|
enum eOctave {
|
||||||
|
OCT_440 = 0, /*!< o = 5 */
|
||||||
|
OCT_880 = 1, /*!< o = 6 */
|
||||||
|
OCT_1760 = 2, /*!< o = 7 */
|
||||||
|
OCT_3520 = 3, /*!< o = 8 */
|
||||||
|
OCT_7040 = 4 /*!< o = 9 */
|
||||||
|
} octave;
|
||||||
|
|
||||||
|
/*! Notes */
|
||||||
|
enum eNotes {
|
||||||
|
NOTE_PAUSE = 0, /*!< P */
|
||||||
|
NOTE_LA = 1, /*!< A */
|
||||||
|
NOTE_LA_H = 8+1, /*!< A# */
|
||||||
|
NOTE_SI = 2, /*!< B */
|
||||||
|
NOTE_DO = 3, /*!< C */
|
||||||
|
NOTE_DO_H = 8+3, /*!< C# */
|
||||||
|
NOTE_RE = 4, /*!< D */
|
||||||
|
NOTE_RE_H = 8+4, /*!< D# */
|
||||||
|
NOTE_MI = 5, /*!< E */
|
||||||
|
NOTE_FA = 6, /*!< F */
|
||||||
|
NOTE_FA_H = 8+6, /*!< F# */
|
||||||
|
NOTE_SOL = 7, /*!< G */
|
||||||
|
NOTE_SOL_H = 8+7 /*!< G# */
|
||||||
|
} note;
|
||||||
|
|
||||||
|
/* Private define ------------------------------------------------------------*/
|
||||||
|
#define BUZZER_SHORTBEEP_DURATION 100
|
||||||
|
#define BUZZER_LONGBEEP_DURATION 1000
|
||||||
|
#define RTTTL_SEP ':'
|
||||||
|
|
||||||
|
/* Private macro -------------------------------------------------------------*/
|
||||||
|
/* Private variables ---------------------------------------------------------*/
|
||||||
|
int buzz_counter = 0;
|
||||||
|
int buzz_in_progress = 0;
|
||||||
|
static TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
|
||||||
|
static TIM_OCInitTypeDef TIM_OCInitStructure;
|
||||||
|
u16 CCR_Val = 0x2EE0;
|
||||||
|
enum BUZZER_mode Buzzer_Mode = BUZZER_UNDEF;
|
||||||
|
u32 Buzzer_Counter = 0;
|
||||||
|
|
||||||
|
// For the melody.
|
||||||
|
const u8* CurrentMelody = 0;
|
||||||
|
const u8* CurrentMelodySTART = 0;
|
||||||
|
u8 DefaultOctave = OCT_880;
|
||||||
|
u8 DefaultDuration = 4;
|
||||||
|
u16 DefaultBeats = 63;
|
||||||
|
|
||||||
|
u16 Note_Freq [16] = {
|
||||||
|
0, //pause
|
||||||
|
440, //A=LA
|
||||||
|
494, //B=SI
|
||||||
|
524, //C=DO
|
||||||
|
588, //D=RE
|
||||||
|
660, //E=MI
|
||||||
|
698, //F=FA
|
||||||
|
784, //G=SOL
|
||||||
|
0, // "8+n" for "NOTE#"
|
||||||
|
466, //A#=LA#
|
||||||
|
0,
|
||||||
|
544, //C#=DO#
|
||||||
|
622, //D#=RE#
|
||||||
|
0,
|
||||||
|
740, //F#=FA#
|
||||||
|
830 //G#=SOL#
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Private function prototypes -----------------------------------------------*/
|
||||||
|
static void PlayMusic( void );
|
||||||
|
static void BUZZER_SetFrequency( u16 freq );
|
||||||
|
|
||||||
|
/* Private functions ---------------------------------------------------------*/
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* PlayMusic
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Play the next note of the current melody.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
static void PlayMusic( void )
|
||||||
|
{
|
||||||
|
u8 duration = DefaultDuration;
|
||||||
|
u8 c;
|
||||||
|
|
||||||
|
// Discard blank characters
|
||||||
|
while ( *CurrentMelody == ' ')
|
||||||
|
{
|
||||||
|
CurrentMelody++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check whether a duration is present.
|
||||||
|
if ( (*CurrentMelody > '0') && (*CurrentMelody < '9') )
|
||||||
|
{
|
||||||
|
duration = *CurrentMelody++ - '0';
|
||||||
|
|
||||||
|
if ( (*CurrentMelody > '0') && (*CurrentMelody < '9') )
|
||||||
|
{
|
||||||
|
duration *= 10;
|
||||||
|
duration += (*CurrentMelody++ - '0');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Buzzer_Counter = ( (32/duration) * 256L * 32L) / DefaultBeats;
|
||||||
|
Buzzer_Counter*= (RCC_ClockFreq.SYSCLK_Frequency / 12000000L); //Adapt to HCLK1
|
||||||
|
|
||||||
|
//read the note
|
||||||
|
c = *CurrentMelody++;
|
||||||
|
|
||||||
|
if ( (c >= 'a') && (c <= 'z') )
|
||||||
|
{
|
||||||
|
c+=('A'-'a');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( c == 'P' )
|
||||||
|
{
|
||||||
|
note = NOTE_PAUSE;
|
||||||
|
}
|
||||||
|
else if ( (c >= 'A') && (c <= 'G') )
|
||||||
|
{
|
||||||
|
note = (c - 'A') + NOTE_LA;
|
||||||
|
|
||||||
|
if ( *CurrentMelody == '#' )
|
||||||
|
{
|
||||||
|
note|=0x8;
|
||||||
|
CurrentMelody++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
octave = DefaultOctave;
|
||||||
|
c = *CurrentMelody;
|
||||||
|
|
||||||
|
if ( (c>= '5') && (c<= '8') )
|
||||||
|
{
|
||||||
|
octave = OCT_440 + (c-'5');
|
||||||
|
CurrentMelody++;
|
||||||
|
}
|
||||||
|
|
||||||
|
BUZZER_SetFrequency ( (Note_Freq [ note ] * (1<<octave)));
|
||||||
|
|
||||||
|
//discard delimiter and ignore special duration
|
||||||
|
while ( (c = *CurrentMelody++) != 0 )
|
||||||
|
{
|
||||||
|
if ( c==',')
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( *(CurrentMelody-1)==0 )
|
||||||
|
{
|
||||||
|
CurrentMelody = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( c == 0 )
|
||||||
|
{
|
||||||
|
BUZZER_SetMode ( BUZZER_OFF );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************************
|
||||||
|
*
|
||||||
|
* BUZZER_SetFrequency
|
||||||
|
*
|
||||||
|
************************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Set the buzzer frequency
|
||||||
|
*
|
||||||
|
* @param[in] freq New frequency.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/********************************************************************************/
|
||||||
|
void BUZZER_SetFrequency ( u16 freq )
|
||||||
|
{
|
||||||
|
/* Calculate the frequency (depend on the PCLK1 clock value) */
|
||||||
|
CCR_Val = (RCC_ClockFreq.PCLK1_Frequency / freq);
|
||||||
|
|
||||||
|
TIM_TimeBaseStructure.TIM_Period = CCR_Val * 2;
|
||||||
|
TIM_TimeBaseStructure.TIM_Prescaler = 0x0;
|
||||||
|
TIM_TimeBaseStructure.TIM_ClockDivision = 0x0;
|
||||||
|
TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
|
||||||
|
|
||||||
|
TIM_TimeBaseInit( TIM3, &TIM_TimeBaseStructure );
|
||||||
|
|
||||||
|
/* Output Compare Toggle Mode configuration: Channel3 */
|
||||||
|
TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1;
|
||||||
|
TIM_OCInitStructure.TIM_Channel = TIM_Channel_3;
|
||||||
|
TIM_OCInitStructure.TIM_Pulse = CCR_Val;
|
||||||
|
|
||||||
|
TIM_OCInit( TIM3, &TIM_OCInitStructure );
|
||||||
|
TIM_OC3PreloadConfig( TIM3, TIM_OCPreload_Enable );
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Public functions for CircleOS ---------------------------------------------*/
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* BUZZER_Init
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Buzzer Initialization
|
||||||
|
*
|
||||||
|
* @attention This function must <b>NOT</b> be called by the user.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void BUZZER_Init( void )
|
||||||
|
{
|
||||||
|
GPIO_InitTypeDef GPIO_InitStructure;
|
||||||
|
|
||||||
|
/* Enable GPIOB clock */
|
||||||
|
RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOB, ENABLE );
|
||||||
|
|
||||||
|
/* GPIOB Configuration: TIM3 3in Output */
|
||||||
|
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0;
|
||||||
|
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
|
||||||
|
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||||
|
|
||||||
|
GPIO_Init( GPIOB, &GPIO_InitStructure );
|
||||||
|
|
||||||
|
/* TIM3 Configuration ------------------------------------------------------*/
|
||||||
|
/* TIM3CLK = 18 MHz, Prescaler = 0x0, TIM3 counter clock = 18 MHz */
|
||||||
|
/* CC update rate = TIM3 counter clock / (2* CCR_Val) ~= 750 Hz */
|
||||||
|
|
||||||
|
/* Enable TIM3 clock */
|
||||||
|
RCC_APB1PeriphClockCmd( RCC_APB1Periph_TIM3, ENABLE );
|
||||||
|
TIM_DeInit( TIM3 );
|
||||||
|
TIM_TimeBaseStructInit( &TIM_TimeBaseStructure );
|
||||||
|
TIM_OCStructInit( &TIM_OCInitStructure );
|
||||||
|
|
||||||
|
/* Time base configuration */
|
||||||
|
TIM_TimeBaseStructure.TIM_Period = 0xFFFF;
|
||||||
|
TIM_TimeBaseStructure.TIM_Prescaler = 0x0;
|
||||||
|
TIM_TimeBaseStructure.TIM_ClockDivision = 0x0;
|
||||||
|
TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
|
||||||
|
|
||||||
|
TIM_TimeBaseInit( TIM3, &TIM_TimeBaseStructure );
|
||||||
|
|
||||||
|
/* Output Compare Toggle Mode configuration: Channel3 */
|
||||||
|
TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_Toggle;
|
||||||
|
TIM_OCInitStructure.TIM_Channel = TIM_Channel_3;
|
||||||
|
TIM_OCInitStructure.TIM_Pulse = CCR_Val;
|
||||||
|
|
||||||
|
TIM_OCInit( TIM3, &TIM_OCInitStructure );
|
||||||
|
TIM_OC3PreloadConfig( TIM3, TIM_OCPreload_Disable );
|
||||||
|
BUZZER_SetFrequency( 440 );
|
||||||
|
|
||||||
|
/* Enable TIM3 IT */
|
||||||
|
TIM_ITConfig( TIM3, TIM_IT_CC3, ENABLE );
|
||||||
|
|
||||||
|
Buzzer_Mode = BUZZER_OFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* BUZZER_Handler
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Called by the CircleOS scheduler to manage Buzzer tasks.
|
||||||
|
*
|
||||||
|
* @attention This function must <b>NOT</b> be called by the user.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void BUZZER_Handler( void )
|
||||||
|
{
|
||||||
|
int fSetOFF = 0;
|
||||||
|
|
||||||
|
if ( Buzzer_Mode == BUZZER_PLAYMUSIC )
|
||||||
|
{
|
||||||
|
if ( Buzzer_Counter == 0 )
|
||||||
|
{
|
||||||
|
PlayMusic();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Buzzer_Counter--;
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if ( Buzzer_Mode == BUZZER_SHORTBEEP )
|
||||||
|
{
|
||||||
|
if ( Buzzer_Counter++ == (BUZZER_SHORTBEEP_DURATION) )
|
||||||
|
{
|
||||||
|
Buzzer_Mode = BUZZER_OFF;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( Buzzer_Counter == (BUZZER_SHORTBEEP_DURATION/2) )
|
||||||
|
{
|
||||||
|
fSetOFF = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( Buzzer_Mode == BUZZER_LONGBEEP )
|
||||||
|
{
|
||||||
|
if ( Buzzer_Counter++ == (BUZZER_LONGBEEP_DURATION) )
|
||||||
|
{
|
||||||
|
Buzzer_Mode = BUZZER_OFF;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( Buzzer_Counter > (BUZZER_LONGBEEP_DURATION/2) )
|
||||||
|
{
|
||||||
|
fSetOFF = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( fSetOFF == 1 )
|
||||||
|
{
|
||||||
|
TIM_Cmd(TIM3, DISABLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @endcond
|
||||||
|
|
||||||
|
/* Public functions ----------------------------------------------------------*/
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* BUZZER_GetMode
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Get the current buzzer mode.
|
||||||
|
*
|
||||||
|
* @return Current buzzer mode.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
enum BUZZER_mode BUZZER_GetMode( void )
|
||||||
|
{
|
||||||
|
return Buzzer_Mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* BUZZER_SetMode
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Set new buzzer mode
|
||||||
|
*
|
||||||
|
* @param[in] mode New buzzer mode.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void BUZZER_SetMode( enum BUZZER_mode mode )
|
||||||
|
{
|
||||||
|
Buzzer_Mode = mode;
|
||||||
|
Buzzer_Counter = 0;
|
||||||
|
|
||||||
|
switch ( mode )
|
||||||
|
{
|
||||||
|
case BUZZER_PLAYMUSIC :
|
||||||
|
PlayMusic(); //start melody
|
||||||
|
/* no break */
|
||||||
|
|
||||||
|
case BUZZER_LONGBEEP :
|
||||||
|
case BUZZER_SHORTBEEP :
|
||||||
|
case BUZZER_ON :
|
||||||
|
TIM_Cmd( TIM3, ENABLE );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case BUZZER_OFF :
|
||||||
|
TIM_Cmd( TIM3, DISABLE );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* BUZZER_PlayMusic
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Plays the provided melody that follows the RTTTL Format.
|
||||||
|
*
|
||||||
|
* Official Specification
|
||||||
|
* @verbatim
|
||||||
|
<ringing-tones-text-transfer-language> :=
|
||||||
|
<name> <sep> [<defaults>] <sep> <note-command>+
|
||||||
|
<name> := <char>+ ; maximum name length 10 characters
|
||||||
|
<sep> := ":"
|
||||||
|
<defaults> :=
|
||||||
|
<def-note-duration> |
|
||||||
|
<def-note-scale> |
|
||||||
|
<def-beats>
|
||||||
|
<def-note-duration> := "d=" <duration>
|
||||||
|
<def-note-scale> := "o=" <scale>
|
||||||
|
<def-beats> := "b=" <beats-per-minute>
|
||||||
|
<beats-per-minute> := 25,28,...,900 ; decimal value
|
||||||
|
; If not specified, defaults are
|
||||||
|
;
|
||||||
|
; 4 = duration
|
||||||
|
; 6 = scale
|
||||||
|
; 63 = beats-per-minute
|
||||||
|
<note-command> :=
|
||||||
|
[<duration>] <note> [<scale>] [<special-duration>] <delimiter>
|
||||||
|
<duration> :=
|
||||||
|
"1" | ; Full 1/1 note
|
||||||
|
"2" | ; 1/2 note
|
||||||
|
"4" | ; 1/4 note
|
||||||
|
"8" | ; 1/8 note
|
||||||
|
"16" | ; 1/16 note
|
||||||
|
"32" | ; 1/32 note
|
||||||
|
<note> :=
|
||||||
|
"P" | ; pause
|
||||||
|
"C" |
|
||||||
|
"C#" |
|
||||||
|
"D" |
|
||||||
|
"D#" |
|
||||||
|
"E" |
|
||||||
|
"F" |
|
||||||
|
"F#" |
|
||||||
|
"G" |
|
||||||
|
"G#" |
|
||||||
|
"A" |
|
||||||
|
"A#" |
|
||||||
|
"B"
|
||||||
|
<scale> :=
|
||||||
|
"5" | ; Note A is 440Hz
|
||||||
|
"6" | ; Note A is 880Hz
|
||||||
|
"7" | ; Note A is 1.76 kHz
|
||||||
|
"8" ; Note A is 3.52 kHz
|
||||||
|
<special-duration> :=
|
||||||
|
"." ; Dotted note
|
||||||
|
<delimiter> := ","
|
||||||
|
@endverbatim
|
||||||
|
*
|
||||||
|
* @param[in] melody New melody to play on buzzer.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void BUZZER_PlayMusic (const u8 *melody )
|
||||||
|
{
|
||||||
|
u8 c;
|
||||||
|
u8 default_id = 0;
|
||||||
|
u16 default_val = 0;
|
||||||
|
|
||||||
|
DefaultOctave = OCT_880; // Default for the default Octave.
|
||||||
|
DefaultDuration = 4; // Default for the default Duration.
|
||||||
|
DefaultBeats = 63;
|
||||||
|
CurrentMelody = melody;
|
||||||
|
CurrentMelodySTART = melody;
|
||||||
|
|
||||||
|
while( *CurrentMelody != RTTTL_SEP )
|
||||||
|
{
|
||||||
|
if( *CurrentMelody == 0 )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Discard the melody name.
|
||||||
|
CurrentMelody++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now read the defaults if any.
|
||||||
|
for( ++CurrentMelody; *CurrentMelody != RTTTL_SEP; CurrentMelody++ )
|
||||||
|
{
|
||||||
|
if( *CurrentMelody == 0 )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Discard any blank.
|
||||||
|
while ( *CurrentMelody == ' ' )
|
||||||
|
{
|
||||||
|
CurrentMelody++;
|
||||||
|
}
|
||||||
|
|
||||||
|
c = *CurrentMelody;
|
||||||
|
|
||||||
|
if ( c == RTTTL_SEP )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( (c >= 'a') && (c <= 'z') )
|
||||||
|
{
|
||||||
|
c+=('A'-'a');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( (c >= 'A') && (c <= 'Z') )
|
||||||
|
{
|
||||||
|
default_id = c;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( (c >= '0') && (c <= '9') )
|
||||||
|
{
|
||||||
|
default_val *= 10;
|
||||||
|
default_val += (c-'0');
|
||||||
|
c = * (CurrentMelody + 1 );
|
||||||
|
|
||||||
|
if ( (c >= '0') && (c <= '9') )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( default_id == 'D' )
|
||||||
|
{
|
||||||
|
DefaultDuration = default_val;
|
||||||
|
}
|
||||||
|
else if ( default_id == 'O' )
|
||||||
|
{
|
||||||
|
DefaultOctave = default_val - 5;
|
||||||
|
|
||||||
|
if ( DefaultOctave > OCT_7040 )
|
||||||
|
DefaultOctave = OCT_440;
|
||||||
|
}
|
||||||
|
else if ( default_id == 'B' )
|
||||||
|
{
|
||||||
|
DefaultBeats = default_val;
|
||||||
|
|
||||||
|
if ( ( DefaultBeats == 0 ) || ( DefaultBeats > 500 ) )
|
||||||
|
DefaultBeats = 63;
|
||||||
|
}
|
||||||
|
|
||||||
|
default_val = 0;
|
||||||
|
default_id = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
BUZZER_SetMode( BUZZER_PLAYMUSIC );
|
||||||
|
}
|
@ -0,0 +1,431 @@
|
|||||||
|
/********************* (C) COPYRIGHT 2007 RAISONANCE S.A.S. *******************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @file circle.h
|
||||||
|
* @brief General header for the CircleOS project.
|
||||||
|
* @author FL
|
||||||
|
* @date 07/2007
|
||||||
|
* @version 1.5
|
||||||
|
*
|
||||||
|
* It contains the list of the utilities functions organized by sections
|
||||||
|
* (MEMS, LCD, POINTER, ...)
|
||||||
|
*
|
||||||
|
* @date 10/2007
|
||||||
|
* @version 1.5 types of OutX_F64 and OutX_F256 changed to u32 (same for Y and Z)
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
#include "scheduler.h"
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef __CIRCLE_H
|
||||||
|
#define __CIRCLE_H
|
||||||
|
|
||||||
|
//-------------------------------- General -------------------------------------
|
||||||
|
/* Defines ------------------------------------------------------------------*/
|
||||||
|
#define VDD_VOLTAGE_MV 3300 //Voltage (mV) of the STM32
|
||||||
|
#define FA_TABLE 0x8006000
|
||||||
|
#define TIM2 ((TIM_TypeDef *) TIM2_BASE)
|
||||||
|
#define CIRCLEOS_RAM_BASE 0x20004000
|
||||||
|
|
||||||
|
/* Variables ----------------------------------------------------------------*/
|
||||||
|
extern GPIO_InitTypeDef GPIO_InitStructure;
|
||||||
|
|
||||||
|
/* Utilities -----------------------------------------------------------------*/
|
||||||
|
void UTIL_uint2str( char *ptr , u32 X, u16 digit, int fillwithzero );
|
||||||
|
void UTIL_int2str( char *ptr , s32 X, u16 digit, int fillwithzero );
|
||||||
|
u16 UTIL_ReadBackupRegister( u16 BKP_DR );
|
||||||
|
void UTIL_WriteBackupRegister( u16 BKP_DR, u16 Data );
|
||||||
|
u16 UTIL_GetBat( void );
|
||||||
|
u8 UTIL_GetUsb( void );
|
||||||
|
u16 UTIL_GetTemp ( void ) ;
|
||||||
|
void UTIL_SetTempMode ( int mode );
|
||||||
|
//typedef void (*tHandler) ( void );
|
||||||
|
void UTIL_SetIrqHandler ( int , tHandler );
|
||||||
|
tHandler UTIL_GetIrqHandler ( int );
|
||||||
|
extern u16 ADC_ConvertedValue[17];
|
||||||
|
|
||||||
|
|
||||||
|
extern enum eSpeed
|
||||||
|
{
|
||||||
|
SPEED_VERY_LOW = 1,
|
||||||
|
SPEED_LOW = 2,
|
||||||
|
SPEED_MEDIUM = 3,
|
||||||
|
SPEED_HIGH = 4,
|
||||||
|
SPEED_VERY_HIGH = 5
|
||||||
|
} CurrentSpeed;
|
||||||
|
|
||||||
|
enum eSchHandler
|
||||||
|
{
|
||||||
|
LED_SCHHDL_ID = 0,
|
||||||
|
BUTTON_SCHHDL_ID = 1,
|
||||||
|
BUZZER_SCHHDL_ID = 2,
|
||||||
|
MENU_SCHHDL_ID = 3,
|
||||||
|
POINTER_SCHHDL_ID = 4,
|
||||||
|
LCD_SCHHDL_ID = 5,
|
||||||
|
DRAW_SCHHDL_ID = 6,
|
||||||
|
RTC_SCHHDL_ID = 7,
|
||||||
|
|
||||||
|
UNUSED0_SCHHDL_ID = 8,
|
||||||
|
UNUSED1_SCHHDL_ID = 9,
|
||||||
|
UNUSED2_SCHHDL_ID = 10,
|
||||||
|
UNUSED3_SCHHDL_ID = 11,
|
||||||
|
UNUSED4_SCHHDL_ID = 12,
|
||||||
|
UNUSED5_SCHHDL_ID = 13,
|
||||||
|
UNUSED6_SCHHDL_ID = 14,
|
||||||
|
UNUSED7_SCHHDL_ID = 15
|
||||||
|
} dummy_var ; //for doxygen
|
||||||
|
|
||||||
|
void UTIL_SetSchHandler ( enum eSchHandler , tHandler );
|
||||||
|
tHandler UTIL_GetSchHandler ( enum eSchHandler );
|
||||||
|
#define NULL_SCHHDL (0)
|
||||||
|
#define LAST_SCHHDL ((tHandler)(-1))
|
||||||
|
|
||||||
|
|
||||||
|
void UTIL_SetPll( enum eSpeed speed );
|
||||||
|
const char* UTIL_GetVersion( void );
|
||||||
|
enum eSpeed UTIL_GetPll( void );
|
||||||
|
extern RCC_ClocksTypeDef RCC_ClockFreq;
|
||||||
|
extern u8 fTemperatureInFahrenheit; /*!< 1 : Fahrenheit, 0 : Celcius (default). */
|
||||||
|
|
||||||
|
|
||||||
|
//--------------------------------- MEMS ------------------------------------
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
V12=0,
|
||||||
|
V3=1,
|
||||||
|
V6=2,
|
||||||
|
V9=3
|
||||||
|
} Rotate_H12_V_Match_TypeDef;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
s16 OutX ;
|
||||||
|
s16 OutX_F4 ;
|
||||||
|
s16 OutX_F16 ;
|
||||||
|
s32 OutX_F64 ;
|
||||||
|
s32 OutX_F256 ;
|
||||||
|
s16 OutY ;
|
||||||
|
s16 OutY_F4 ;
|
||||||
|
s16 OutY_F16 ;
|
||||||
|
s32 OutY_F64 ;
|
||||||
|
s32 OutY_F256 ;
|
||||||
|
s16 OutZ ;
|
||||||
|
s16 OutZ_F4 ;
|
||||||
|
s16 OutZ_F16 ;
|
||||||
|
s32 OutZ_F64 ;
|
||||||
|
s32 OutZ_F256 ;
|
||||||
|
s16 Shocked ;
|
||||||
|
s16 RELATIVE_X ;
|
||||||
|
s16 RELATIVE_Y ;
|
||||||
|
s16 DoubleClick ;
|
||||||
|
} tMEMS_Info;
|
||||||
|
|
||||||
|
extern tMEMS_Info MEMS_Info;
|
||||||
|
|
||||||
|
/* Exported functions --------------------------------------------------------*/
|
||||||
|
void MEMS_Init(void);
|
||||||
|
void MEMS_Handler(void);
|
||||||
|
void MEMS_GetPosition(s16 * pX, s16* pY);
|
||||||
|
void MEMS_SetNeutral( void );
|
||||||
|
void MEMS_GetRotation(Rotate_H12_V_Match_TypeDef * H12);
|
||||||
|
tMEMS_Info* MEMS_GetInfo (void);
|
||||||
|
u8 MEMS_ReadID(void);
|
||||||
|
|
||||||
|
//---------------------------------- LED -------------------------------------
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
enum LED_mode { LED_UNDEF = -1, LED_OFF = 0, LED_ON = 1, LED_BLINKING_LF = 2, LED_BLINKING_HF = 3 };
|
||||||
|
enum LED_id { LED_GREEN = 0, LED_RED = 1};
|
||||||
|
|
||||||
|
/* Exported functions --------------------------------------------------------*/
|
||||||
|
void LED_Init (void);
|
||||||
|
void LED_Handler_hw ( enum LED_id id );
|
||||||
|
void LED_Handler ( void );
|
||||||
|
void LED_Set ( enum LED_id id, enum LED_mode mode );
|
||||||
|
|
||||||
|
//-------------------------------- ADC --------------------------------------
|
||||||
|
|
||||||
|
/* Exported functions --------------------------------------------------------*/
|
||||||
|
void ADConverter_Init (void);
|
||||||
|
|
||||||
|
|
||||||
|
//==============================================================================
|
||||||
|
//-------------------------------- SHUTDOWN ---------------------------------
|
||||||
|
/* Exported functions --------------------------------------------------------*/
|
||||||
|
void SHUTDOWN_Action (void);
|
||||||
|
|
||||||
|
//-------------------------------- BUTTON -----------------------------------
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
enum BUTTON_mode { BUTTON_DISABLED = -1, BUTTON_ONOFF = 0,
|
||||||
|
BUTTON_ONOFF_FORMAIN = 1, BUTTON_WITHCLICK = 2 };
|
||||||
|
enum BUTTON_state { BUTTON_UNDEF = -1, BUTTON_RELEASED = 0, BUTTON_PUSHED = 1,
|
||||||
|
BUTTON_PUSHED_FORMAIN = 2 , BUTTON_CLICK = 3, BUTTON_DBLCLICK = 4 };
|
||||||
|
|
||||||
|
/* Exported functions -------------------------------------------------------*/
|
||||||
|
void BUTTON_Init (void);
|
||||||
|
void BUTTON_Handler(void);
|
||||||
|
enum BUTTON_state BUTTON_GetState();
|
||||||
|
void BUTTON_SetMode( enum BUTTON_mode mode);
|
||||||
|
enum BUTTON_mode BUTTON_GetMode ( void ) ;
|
||||||
|
void BUTTON_WaitForRelease();
|
||||||
|
|
||||||
|
//-------------------------------- POINTER ----------------------------------
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
enum POINTER_mode { POINTER_UNDEF = -1, POINTER_OFF = 0, POINTER_ON = 1, POINTER_MENU = 2, POINTER_APPLICATION = 3, POINTER_RESTORE_LESS = 4 };
|
||||||
|
enum POINTER_state { POINTER_S_UNDEF = -1, POINTER_S_DISABLED = 0, POINTER_S_ENABLED = 1 };
|
||||||
|
|
||||||
|
/* Exported defines ----------------------------------------------------------*/
|
||||||
|
#define POINTER_WIDTH 7
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
s16 xPos ;
|
||||||
|
s16 yPos ;
|
||||||
|
s16 shift_PosX ;
|
||||||
|
s16 shift_PosY ;
|
||||||
|
s16 X_PosMin ;
|
||||||
|
s16 Y_PosMin ;
|
||||||
|
s16 X_PosMax ;
|
||||||
|
s16 Y_PosMax ;
|
||||||
|
} tPointer_Info;
|
||||||
|
|
||||||
|
extern tPointer_Info POINTER_Info ;
|
||||||
|
|
||||||
|
/* Exported vars -------------------------------------------------------------*/
|
||||||
|
extern unsigned char *BallPointerBmpSize;
|
||||||
|
extern unsigned char BallPointerBmp [POINTER_WIDTH], *CurrentPointerBmp,*CurrentPointerSize;
|
||||||
|
extern u16 CurrentPointerColor;
|
||||||
|
extern u16 BallColor;
|
||||||
|
extern s16 POINTER_X_PosMin;
|
||||||
|
extern s16 POINTER_Y_PosMin;
|
||||||
|
extern s16 POINTER_X_PosMax;
|
||||||
|
extern s16 POINTER_Y_PosMax;
|
||||||
|
extern unsigned char PointerAreaStore [2*POINTER_WIDTH*POINTER_WIDTH];
|
||||||
|
|
||||||
|
/* Exported functions --------------------------------------------------------*/
|
||||||
|
extern void POINTER_Init ( void ) ;
|
||||||
|
void POINTER_Handler(void);
|
||||||
|
u16 POINTER_GetCurrentAngleStart ( void );
|
||||||
|
void POINTER_SetCurrentAngleStart ( u16 );
|
||||||
|
u16 POINTER_GetCurrentSpeedOnAngle ( void );
|
||||||
|
void POINTER_SetCurrentSpeedOnAngle ( u16 newspeed );
|
||||||
|
void POINTER_SetMode( enum POINTER_mode mode);
|
||||||
|
void POINTER_SetCurrentPointer( unsigned char width, unsigned char height, unsigned char *bmp);
|
||||||
|
enum POINTER_state POINTER_GetState(void);
|
||||||
|
void POINTER_Draw (u8 Line, u8 Column, u8 Width, u8 Height, u8 *Bmp);
|
||||||
|
void POINTER_SetRect ( s16 x, s16 y, s16 width, s16 height ); //Restrict the move of the pointer to a rectangle
|
||||||
|
void POINTER_SetRectScreen ( void ); //Remove any space restriction for the pointer moves.
|
||||||
|
void POINTER_Save (u8 Line, u8 Column, u8 Width, u8 Height);
|
||||||
|
void POINTER_Restore (u8 Line, u8 Column, u8 Width, u8 Height);
|
||||||
|
u16 POINTER_GetPos(void); //Return the poistion of the cursor (x=lower byte, y = upperbyte)
|
||||||
|
void POINTER_SetPos ( u16 x, u16 y );
|
||||||
|
typedef void (*tAppPtrMgr) ( int , int );
|
||||||
|
void POINTER_SetApplication_Pointer_Mgr( tAppPtrMgr mgr );
|
||||||
|
tPointer_Info* POINTER_GetInfo ( void );
|
||||||
|
u16 POINTER_GetColor ( void ) ;
|
||||||
|
void POINTER_SetColor ( u16 color );
|
||||||
|
enum POINTER_mode POINTER_GetMode( void );
|
||||||
|
void POINTER_SetCurrentAreaStore ( u8 *ptr );
|
||||||
|
void LCD_SetRotateScreen ( u8 RotateScreen);
|
||||||
|
u8 LCD_GetRotateScreen ();
|
||||||
|
void LCD_SetScreenOrientation (Rotate_H12_V_Match_TypeDef ScreenOrientation);
|
||||||
|
Rotate_H12_V_Match_TypeDef LCD_GetScreenOrientation ();
|
||||||
|
|
||||||
|
//---------------------------------- LCD -----------------------------------
|
||||||
|
|
||||||
|
/* Exported defines ----------------------------------------------------------*/
|
||||||
|
//RGB is 16-bit coded as G2G1G0B4 B3B2B1B0 R4R3R2R1 R0G5G4G3
|
||||||
|
#define RGB_MAKE(xR,xG,xB) ( ( (xG&0x07)<<13 ) + ( (xG)>>5 ) + \
|
||||||
|
( ((xB)>>3) << 8 ) + \
|
||||||
|
( ((xR)>>3) << 3 ) )
|
||||||
|
#define RGB_RED 0x00F8
|
||||||
|
#define RGB_BLACK 0x0000
|
||||||
|
#define RGB_WHITE 0xffff
|
||||||
|
#define RGB_BLUE 0x1F00
|
||||||
|
#define RGB_GREEN 0xE007
|
||||||
|
#define RGB_YELLOW (RGB_GREEN|RGB_RED)
|
||||||
|
#define RGB_MAGENTA (RGB_BLUE|RGB_RED)
|
||||||
|
#define RGB_LIGHTBLUE (RGB_BLUE|RGB_GREEN)
|
||||||
|
#define RGB_ORANGE (RGB_RED | 0xE001) //green/2 + red
|
||||||
|
#define RGB_PINK (RGB_MAGENTA | 0xE001) //green/2 + magenta
|
||||||
|
|
||||||
|
// SCREEN Infos
|
||||||
|
#define SCREEN_WIDTH 128
|
||||||
|
#define SCREEN_HEIGHT 128
|
||||||
|
#define CHIP_SCREEN_WIDTH 132
|
||||||
|
#define CHIP_SCREEN_HEIGHT 132
|
||||||
|
|
||||||
|
// Characters Infos
|
||||||
|
#define CHAR_WIDTH 7
|
||||||
|
#define CHAR_HEIGHT 14
|
||||||
|
|
||||||
|
// PWM rates.
|
||||||
|
#define BACKLIGHTMIN 0x1000 /*!< Minimal PWM rate. */
|
||||||
|
#define DEFAULT_CCR_BACKLIGHTSTART 0x8000 /*!< Default PWM rate. */
|
||||||
|
|
||||||
|
/* Exported vars -------------------------------------------------------------*/
|
||||||
|
extern Rotate_H12_V_Match_TypeDef Screen_Orientation;
|
||||||
|
extern int rotate_screen;
|
||||||
|
|
||||||
|
/* Exported functions --------------------------------------------------------*/
|
||||||
|
void LCD_Init(void);
|
||||||
|
void LCD_Handler(void);
|
||||||
|
void LCD_SetRect_For_Cmd( s16 x, s16 y, s16 width, s16 height );
|
||||||
|
u16 LCD_GetPixel( u8 x, u8 y );
|
||||||
|
void LCD_DrawPixel( u8 x, u8 y, u16 Pixel );
|
||||||
|
void LCD_SendLCDCmd( u8 Cmd );
|
||||||
|
void LCD_SendLCDData( u8 Data );
|
||||||
|
u32 LCD_ReadLCDData( void );
|
||||||
|
void LCD_FillRect( u16 x, u16 y, u16 width, u16 height, u16 color );
|
||||||
|
void LCD_DrawRect( u16 x, u16 y, u16 width, u16 height, u16 color );
|
||||||
|
void LCD_DisplayChar( u8 x, u8 y, u8 Ascii, u16 TextColor, u16 BGndColor, u16 CharMagniCoeff );
|
||||||
|
void LCD_RectRead( u16 x, u16 y, u16 width, u16 height, u8* bmp );
|
||||||
|
void LCD_SetBackLight (u32 newBacklightStart);
|
||||||
|
u32 LCD_GetBackLight ( void );
|
||||||
|
void LCD_SetBackLightOff( void );
|
||||||
|
void LCD_SetBackLightOn( void );
|
||||||
|
|
||||||
|
#include "lcd.h"
|
||||||
|
|
||||||
|
//---------------------------------- DRAW ----------------------------------
|
||||||
|
|
||||||
|
/* Exported functions --------------------------------------------------------*/
|
||||||
|
void DRAW_Init(void);
|
||||||
|
void DRAW_Clear(void);
|
||||||
|
void DRAW_Handler(void);
|
||||||
|
void DRAW_SetDefaultColor (void);
|
||||||
|
void DRAW_SetImage(const u16 *imageptr, u8 x, u8 y, u8 width, u8 height);
|
||||||
|
void DRAW_SetImageBW(const u8 *imageptr, u8 x, u8 y, u8 width, u8 height);
|
||||||
|
void DRAW_SetLogoBW(void);
|
||||||
|
void DRAW_DisplayVbat(u8 x, u8 y);
|
||||||
|
void DRAW_DisplayTime(u8 x, u8 y);
|
||||||
|
void DRAW_DisplayTemp(u8 x, u8 y);
|
||||||
|
void DRAW_DisplayString( u8 x, u8 y, const u8 *ptr, u8 len );
|
||||||
|
void DRAW_DisplayStringInverted( u8 x, u8 y, const u8 *ptr, u8 len );
|
||||||
|
u16 DRAW_GetCharMagniCoeff(void);
|
||||||
|
void DRAW_SetCharMagniCoeff(u16 Coeff);
|
||||||
|
u16 DRAW_GetTextColor(void);
|
||||||
|
void DRAW_SetTextColor(u16 Color);
|
||||||
|
u16 DRAW_GetBGndColor(void);
|
||||||
|
void DRAW_SetBGndColor(u16 Color);
|
||||||
|
void DRAW_Batt( void );
|
||||||
|
void DRAW_Line (s16 x1, s16 y1, s16 x2, s16 y2, u16 color );
|
||||||
|
|
||||||
|
/* Exported vars -------------------------------------------------------------*/
|
||||||
|
extern int fDisplayTime;
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------- BUZZER -----------------------------------
|
||||||
|
|
||||||
|
/* Exported defines ----------------------------------------------------------*/
|
||||||
|
#define BUZZER_BEEP BUZZER_SHORTBEEP
|
||||||
|
|
||||||
|
/* Exported type def ---------------------------------------------------------*/
|
||||||
|
enum BUZZER_mode { BUZZER_UNDEF = -1, BUZZER_OFF = 0, BUZZER_ON = 1,
|
||||||
|
BUZZER_SHORTBEEP = 2, BUZZER_LONGBEEP = 3, BUZZER_PLAYMUSIC = 4 };
|
||||||
|
|
||||||
|
/* Exported type functions ---------------------------------------------------*/
|
||||||
|
void BUZZER_Init(void);
|
||||||
|
void BUZZER_Handler(void);
|
||||||
|
void BUZZER_SetMode( enum BUZZER_mode mode);
|
||||||
|
enum BUZZER_mode BUZZER_GetMode( void );
|
||||||
|
void BUZZER_PlayMusic (const u8 *melody );
|
||||||
|
|
||||||
|
//--------------------------------- MENU -----------------------------------
|
||||||
|
|
||||||
|
/* Exported defines ----------------------------------------------------------*/
|
||||||
|
#define MENU_MAXITEM 6
|
||||||
|
#define APP_VOID ((tMenuItem *)(-1))
|
||||||
|
#define MAX_APP_MENU_SIZE 10
|
||||||
|
#define MAXAPP 64
|
||||||
|
#define MAX_MENUAPP_SIZE 3
|
||||||
|
#define REMOVE_MENU 0x01
|
||||||
|
#define APP_MENU 0x02
|
||||||
|
|
||||||
|
enum MENU_code { MENU_LEAVE = 0, MENU_CONTINUE = 1, MENU_REFRESH = 2,
|
||||||
|
MENU_CHANGE = 3, MENU_CONTINUE_COMMAND = 4};
|
||||||
|
|
||||||
|
/* Exported type def ---------------------------------------------------------*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
const char *Text;
|
||||||
|
enum MENU_code (*Fct_Init) ( void );
|
||||||
|
enum MENU_code (*Fct_Manage)( void );
|
||||||
|
int fMenuFlag;
|
||||||
|
} tMenuItem;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned fdispTitle : 1;
|
||||||
|
const char *Title;
|
||||||
|
int NbItems;
|
||||||
|
int LgMax;
|
||||||
|
int XPos, YPos;
|
||||||
|
int XSize, YSize;
|
||||||
|
unsigned int SelectedItem;
|
||||||
|
tMenuItem Items[MENU_MAXITEM];
|
||||||
|
} tMenu;
|
||||||
|
|
||||||
|
/* Exported vars -------------------------------------------------------------*/
|
||||||
|
extern tMenu MainMenu, *CurrentMenu;
|
||||||
|
extern tMenuItem *CurrentCommand;
|
||||||
|
extern int BGndColor_Menu;
|
||||||
|
extern int TextColor_Menu;
|
||||||
|
|
||||||
|
/* Exported type functions ---------------------------------------------------*/
|
||||||
|
enum MENU_code fColor ( void ) ;
|
||||||
|
void MENU_Set ( tMenu *mptr );
|
||||||
|
void MENU_Handler ( void ) ;
|
||||||
|
extern enum MENU_code MENU_Quit ( void );
|
||||||
|
void MENU_Remove ( void ) ;
|
||||||
|
void MENU_Question ( char *str, int *answer );
|
||||||
|
void MENU_Print ( char *str );
|
||||||
|
enum MENU_code MENU_SetLevel_Ini( void );
|
||||||
|
enum MENU_code MENU_SetLevel_Mgr( u32 *value, u32 value_range [] ) ;
|
||||||
|
void MENU_ClearCurrentCommand( void );
|
||||||
|
void MENU_SetLevelTitle(u8* title);
|
||||||
|
void MENU_SetTextColor ( int TextColor );
|
||||||
|
int MENU_GetTextColor ( void );
|
||||||
|
void MENU_SetBGndColor ( int BGndColor );
|
||||||
|
int MENU_GetBGndColor ( void );
|
||||||
|
extern enum MENU_code fQuit ( void ) ;
|
||||||
|
void MENU_ClearCurrentMenu(void);
|
||||||
|
|
||||||
|
//-------------------------------- BACKLIGHT --------------------------------
|
||||||
|
|
||||||
|
/* Exported type functions ---------------------------------------------------*/
|
||||||
|
void BackLight_Configuration (void);
|
||||||
|
void ManageBackLight (void);
|
||||||
|
void BackLight_Change (void);
|
||||||
|
|
||||||
|
//-------------------------------- RTC --------------------------------------
|
||||||
|
|
||||||
|
/* Exported type functions ---------------------------------------------------*/
|
||||||
|
void RTC_Init(void);
|
||||||
|
void RTC_SetTime (u32 THH, u32 TMM, u32 TSS);
|
||||||
|
void RTC_GetTime (u32 * THH, u32 * TMM, u32 * TSS);
|
||||||
|
void RTC_DisplayTime ( void );
|
||||||
|
|
||||||
|
//Backup registers
|
||||||
|
#define BKP_SYS1 1
|
||||||
|
#define BKP_SYS2 2
|
||||||
|
#define BKP_SYS3 3
|
||||||
|
#define BKP_SYS4 4
|
||||||
|
#define BKP_SYS5 5
|
||||||
|
#define BKP_SYS6 6
|
||||||
|
#define BKP_USER1 7
|
||||||
|
#define BKP_USER2 8
|
||||||
|
#define BKP_USER3 9
|
||||||
|
#define BKP_USER4 10
|
||||||
|
|
||||||
|
#define BKP_PLL (BKP_SYS2)
|
||||||
|
#define BKP_BKLIGHT (BKP_SYS3)
|
||||||
|
|
||||||
|
//--------------------------------- Application --------------------------------
|
||||||
|
void (*Application_Pointer_Mgr) ( int sposX, int sposY);
|
||||||
|
|
||||||
|
#endif /*__CIRCLE_H */
|
@ -0,0 +1,679 @@
|
|||||||
|
/********************* (C) COPYRIGHT 2007 RAISONANCE S.A.S. *******************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @file circle_api.h
|
||||||
|
* @brief General header for the STM32-circle projects.
|
||||||
|
* @author FL
|
||||||
|
* @date 07/2007
|
||||||
|
* @version 1.2
|
||||||
|
* @date 10/2007
|
||||||
|
* @version 1.5 types of OutX_F64 and OutX_F256 changed to u32 (same for Y and Z)
|
||||||
|
* @date 10/2007
|
||||||
|
* @version 1.6 Add the IRQ handler replacement
|
||||||
|
*
|
||||||
|
* It contains the list of the utilities functions organized by sections
|
||||||
|
* (MEMS, LCD, POINTER, ...)
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* Use this header with version 1.5 or later of the OS.
|
||||||
|
*
|
||||||
|
* For a complete documentation on the CircleOS, please go to:
|
||||||
|
* http://www.stm32circle.com
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
|
||||||
|
#include "stm32f10x_lib.h"
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef __CIRCLE_API_H
|
||||||
|
#define __CIRCLE_API_H
|
||||||
|
|
||||||
|
//-------------------------------- General -------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @enum eSpeed
|
||||||
|
* @brief Clock speeds.
|
||||||
|
*
|
||||||
|
* Available clock speeds.
|
||||||
|
**/
|
||||||
|
extern enum eSpeed
|
||||||
|
{
|
||||||
|
SPEED_VERY_LOW = 1,
|
||||||
|
SPEED_LOW = 2,
|
||||||
|
SPEED_MEDIUM = 3,
|
||||||
|
SPEED_HIGH = 4,
|
||||||
|
SPEED_VERY_HIGH = 5
|
||||||
|
} CurrentSpeed;
|
||||||
|
enum eSchHandler
|
||||||
|
{
|
||||||
|
LED_SCHHDL_ID = 0,
|
||||||
|
BUTTON_SCHHDL_ID = 1,
|
||||||
|
BUZZER_SCHHDL_ID = 2,
|
||||||
|
MENU_SCHHDL_ID = 3,
|
||||||
|
POINTER_SCHHDL_ID = 4,
|
||||||
|
LCD_SCHHDL_ID = 5,
|
||||||
|
DRAW_SCHHDL_ID = 6,
|
||||||
|
RTC_SCHHDL_ID = 7,
|
||||||
|
|
||||||
|
UNUSED0_SCHHDL_ID = 8,
|
||||||
|
UNUSED1_SCHHDL_ID = 9,
|
||||||
|
UNUSED2_SCHHDL_ID = 10,
|
||||||
|
UNUSED3_SCHHDL_ID = 11,
|
||||||
|
UNUSED4_SCHHDL_ID = 12,
|
||||||
|
UNUSED5_SCHHDL_ID = 13,
|
||||||
|
UNUSED6_SCHHDL_ID = 14,
|
||||||
|
UNUSED7_SCHHDL_ID = 15
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/// @cond Internal
|
||||||
|
|
||||||
|
extern RCC_ClocksTypeDef RCC_ClockFreq;
|
||||||
|
|
||||||
|
/* Typedefs ------------------------------------------------------------------*/
|
||||||
|
typedef u32 (*tCircleFunc0 ) (void);
|
||||||
|
typedef u32 (*tCircleFunc1 ) (u32 param1);
|
||||||
|
typedef u32 (*tCircleFunc2 ) (u32 param1, u32 param2);
|
||||||
|
typedef u32 (*tCircleFunc3 ) (u32 param1, u32 param2, u32 param3);
|
||||||
|
typedef u32 (*tCircleFunc4 ) (u32 param1, u32 param2, u32 param3, u32 param4);
|
||||||
|
typedef u32 (*tCircleFunc5 ) (u32 param1, u32 param2, u32 param3, u32 param4, u32 param5);
|
||||||
|
typedef u32 (*tCircleFunc6 ) (u32 param1, u32 param2, u32 param3, u32 param4, u32 param5, u32 param6);
|
||||||
|
|
||||||
|
extern tCircleFunc0 (*ptrCircle_API) [];
|
||||||
|
|
||||||
|
/* Defines -------------------------------------------------------------------*/
|
||||||
|
#define Circle_API (*ptrCircle_API)
|
||||||
|
|
||||||
|
#define POINTER_ID 0x00
|
||||||
|
#define DRAW_ID 0x20
|
||||||
|
#define LCD_ID 0x40
|
||||||
|
#define LED_ID 0x60
|
||||||
|
#define MEMS_ID 0x70
|
||||||
|
#define BUTTON_ID 0x80
|
||||||
|
#define BUZZER_ID 0x90
|
||||||
|
#define MENU_ID 0xA0
|
||||||
|
#define UTIL_ID 0xB0
|
||||||
|
#define RTC_ID 0xC0
|
||||||
|
|
||||||
|
// UTIL functions definition.
|
||||||
|
#define UTIL_SET_PLL_ID (UTIL_ID + 0) // Set clock frequency.
|
||||||
|
#define UTIL_GET_PLL_ID (UTIL_ID + 1) // Get clock frequency.
|
||||||
|
#define UTIL_UINT2STR_ID (UTIL_ID + 2) // Convert an unsigned integer into a string.
|
||||||
|
#define UTIL_INT2STR_ID (UTIL_ID + 3) // Convert a signed integer into a string.
|
||||||
|
#define UTIL_GET_VERSION_ID (UTIL_ID + 4) // Get CircleOS version.
|
||||||
|
#define UTIL_READ_BACKUPREGISTER_ID (UTIL_ID + 5) // Reads data from the specified Data Backup Register.
|
||||||
|
#define UTIL_WRITE_BACKUPREGISTER_ID (UTIL_ID + 6) // Writes data to the specified Data Backup Register.
|
||||||
|
#define UTIL_GET_BAT_ID (UTIL_ID + 7) // Return the batterie tension in mV.
|
||||||
|
#define UTIL_GET_USB_ID (UTIL_ID + 8) // Return the USB connexion state.
|
||||||
|
#define UTIL_SET_IRQ_HANDLER_ID (UTIL_ID + 9) // Replace an irq handler
|
||||||
|
#define UTIL_GET_IRQ_HANDLER_ID (UTIL_ID + 10) // Get the current irq handler
|
||||||
|
#define UTIL_SET_SCH_HANDLER_ID (UTIL_ID + 11) // Replace an irq handler
|
||||||
|
#define UTIL_GET_SCH_HANDLER_ID (UTIL_ID + 12) // Get the current irq handler
|
||||||
|
#define UTIL_GET_TEMP_ID (UTIL_ID + 13) // Return the temperature (1/100 C)
|
||||||
|
#define UTIL_SET_TEMPMODE_ID (UTIL_ID + 14) // Set the temperature mode (0: mCelcius, 1: mFahrenheit
|
||||||
|
typedef void (*tHandler) (void);
|
||||||
|
|
||||||
|
// Prototypes.
|
||||||
|
#define UTIL_SetPll(a) ((tCircleFunc1)(Circle_API [UTIL_SET_PLL_ID])) ((u32)(a)) // void UTIL_SetPll( enum eSpeed speed );
|
||||||
|
#define UTIL_GetPll() (u32) (((tCircleFunc0)(Circle_API [UTIL_GET_PLL_ID])) ()) // enum eSpeed UTIL_GetPll( void );
|
||||||
|
#define UTIL_uint2str(a,b,c,d) ((tCircleFunc4)(Circle_API [UTIL_UINT2STR_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d)) // void uint2str( char* ptr , u32 X, u16 digit, int fillwithzero );
|
||||||
|
#define UTIL_int2str(a,b,c,d) ((tCircleFunc4)(Circle_API [UTIL_INT2STR_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d)) // void int2str( char* ptr , s32 X, u16 digit, int fillwithzero );
|
||||||
|
#define UTIL_GetVersion() (u32) (((tCircleFunc0)(Circle_API [UTIL_GET_VERSION_ID])) ()) // char* UTIL_GetVersion( void );
|
||||||
|
#define UTIL_ReadBackupRegister(a) (u32) (((tCircleFunc1)(Circle_API [UTIL_READ_BACKUPREGISTER_ID])) ((u32)(a))) // u16 UTIL_ReadBackupRegister( u16 BKP_DR );
|
||||||
|
#define UTIL_WriteBackupRegister(a,b) ((tCircleFunc2)(Circle_API [UTIL_WRITE_BACKUPREGISTER_ID])) ((u32)(a),(u32)(b)) // void UTIL_WriteBackupRegister( u16 BKP_DR, u16 Data );
|
||||||
|
#define UTIL_GetBat() (u32) (((tCircleFunc0)(Circle_API [UTIL_GET_BAT_ID])) ()) // u16 UTIL_GetBat( void );
|
||||||
|
#define UTIL_GetUsb() (u32) (((tCircleFunc0)(Circle_API [UTIL_GET_USB_ID])) ()) // u8 UTIL_GetUsb( void );
|
||||||
|
#define UTIL_SetIrqHandler(a,b) (((tCircleFunc2)(Circle_API [UTIL_SET_IRQ_HANDLER_ID])) ((int)a,(tHandler)b)) // void UTIL_SetIrqHandler ( int , tHandler );
|
||||||
|
#define UTIL_GetIrqHandler(a) (u32) (((tCircleFunc1)(Circle_API [UTIL_GET_IRQ_HANDLER_ID])) ((int)a)) // tHandler* UTIL_GetIrqHandler ( int );
|
||||||
|
#define UTIL_SetSchHandler(a,b) (((tCircleFunc2)(Circle_API [UTIL_SET_SCH_HANDLER_ID])) ((int)a,(tHandler)b)) // void UTIL_SetSchHandler ( int , tHandler );
|
||||||
|
#define UTIL_GetSchHandler(a) (u32) (((tCircleFunc1)(Circle_API [UTIL_GET_SCH_HANDLER_ID])) ((int)a)) // tHandler* UTIL_GetSchHandler ( int );
|
||||||
|
#define UTIL_GetTemp() (u32) (((tCircleFunc0)(Circle_API [UTIL_GET_TEMP_ID])) ()) // u16 UTIL_GetTemp( void );
|
||||||
|
#define UTIL_SetTempMode(a) (((tCircleFunc1)(Circle_API [UTIL_SET_TEMPMODE_ID])) ((int)a)) // void UTIL_SetTempMode( int mode );
|
||||||
|
|
||||||
|
/// @endcond
|
||||||
|
|
||||||
|
//--------------------------------- MEMS ------------------------------------
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @enum Rotate_H12_V_Match_TypeDef
|
||||||
|
* @brief The 4 possible rotations.
|
||||||
|
*
|
||||||
|
* The 4 possible MEM rotations.
|
||||||
|
**/
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
V12 = 0, /*!< No rotation. */
|
||||||
|
V3 = 1, /*!< Rotation to the right.*/
|
||||||
|
V6 = 2, /*!< Rotation to the left. */
|
||||||
|
V9 = 3 /*!< Half a rotation. */
|
||||||
|
} Rotate_H12_V_Match_TypeDef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @struct tMEMS_Info
|
||||||
|
* @brief MEMS state description.
|
||||||
|
**/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
s16 OutX; /*!< MEMS X position. */
|
||||||
|
s16 OutX_F4; /*!< MEMS X position filtered on 4 values. */
|
||||||
|
s16 OutX_F16; /*!< MEMS X position filtered on 16 values. */
|
||||||
|
s32 OutX_F64; /*!< MEMS X position filtered on 64 values. */
|
||||||
|
s32 OutX_F256; /*!< MEMS X position filtered on 256 values. */
|
||||||
|
s16 OutY; /*!< MEMS Y position. */
|
||||||
|
s16 OutY_F4; /*!< MEMS Y position filtered on 4 values. */
|
||||||
|
s16 OutY_F16; /*!< MEMS Y position filtered on 16 values. */
|
||||||
|
s32 OutY_F64; /*!< MEMS Y position filtered on 64 values. */
|
||||||
|
s32 OutY_F256; /*!< MEMS Y position filtered on 256 values. */
|
||||||
|
s16 OutZ; /*!< MEMS Z position. */
|
||||||
|
s16 OutZ_F4; /*!< MEMS Z position filtered on 4 values. */
|
||||||
|
s16 OutZ_F16; /*!< MEMS Z position filtered on 16 values. */
|
||||||
|
s32 OutZ_F64; /*!< MEMS Z position filtered on 64 values. */
|
||||||
|
s32 OutZ_F256; /*!< MEMS Z position filtered on 256 values. */
|
||||||
|
s16 Shocked; /*!< MEMS shock counter (incremented...) */
|
||||||
|
s16 RELATIVE_X; /*!< MEMS relative X position. */
|
||||||
|
s16 RELATIVE_Y; /*!< MEMS relative Y position. */
|
||||||
|
s16 DoubleClick; /*!< MEMS DoubleClick counter(incremented...)*/
|
||||||
|
} tMEMS_Info;
|
||||||
|
|
||||||
|
/// @cond Internal
|
||||||
|
|
||||||
|
/* Exported defines ----------------------------------------------------------*/
|
||||||
|
|
||||||
|
// MEMS functions definition
|
||||||
|
#define MEMS_GET_POSITION_ID (MEMS_ID + 0) // Return the current (relative) Mems information
|
||||||
|
#define MEMS_GET_ROTATION_ID (MEMS_ID + 1) // Return the current screen orientation of the circle
|
||||||
|
#define MEMS_SET_NEUTRAL_ID (MEMS_ID + 2) // Set the current position as "neutral position"
|
||||||
|
#define MEMS_GET_INFO_ID (MEMS_ID + 3) // Return Mems informations
|
||||||
|
|
||||||
|
// Prototypes
|
||||||
|
#define MEMS_GetPosition(a,b) ((tCircleFunc2)(Circle_API [MEMS_GET_POSITION_ID])) ((u32)(a),(u32)(b)) // void MEMS_GetPosition(s16 * pX, s16* pY);
|
||||||
|
#define MEMS_GetRotation(a) ((tCircleFunc1)(Circle_API [MEMS_GET_ROTATION_ID])) ((u32)(a)) // void MEMS_GetRotation(Rotate_H12_V_Match_TypeDef * H12);
|
||||||
|
#define MEMS_SetNeutral() ((tCircleFunc0)(Circle_API [MEMS_GET_ROTATION_ID])) () // void MEMS_SetNeutral( void );
|
||||||
|
#define MEMS_GetInfo() ( (tMEMS_Info*) (((tCircleFunc0)(Circle_API [MEMS_GET_INFO_ID])) ())) // tMEMS_Info* MEMS_GetInfo (void)
|
||||||
|
|
||||||
|
/// @endcond
|
||||||
|
|
||||||
|
//-------------------------------- POINTER ----------------------------------
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @enum POINTER_mode
|
||||||
|
* @brief Available pointer modes.
|
||||||
|
*
|
||||||
|
* Description of all the available pointer modes in CircleOS.
|
||||||
|
**/
|
||||||
|
enum POINTER_mode
|
||||||
|
{
|
||||||
|
POINTER_UNDEF = -1, /*!< Pointer's mode is unknown! */
|
||||||
|
POINTER_OFF = 0, /*!< Pointer isn't managed and displayed. */
|
||||||
|
POINTER_ON = 1, /*!< Pointer mode used in main screen. */
|
||||||
|
POINTER_MENU = 2, /*!< Pointer management is used to select item menu (but pointer isn't displayed). */
|
||||||
|
POINTER_APPLICATION = 3, /*!< The managment of pointer depend of extern application. */
|
||||||
|
POINTER_RESTORE_LESS = 4 /*!< The background isn't restored (to go faster). */
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @enum POINTER_state
|
||||||
|
* @brief The different pointer modes.
|
||||||
|
*
|
||||||
|
* Despite beeing in a undefined state, the pointer can be disabled or enable.
|
||||||
|
**/
|
||||||
|
enum POINTER_state
|
||||||
|
{
|
||||||
|
POINTER_S_UNDEF = -1, /*!< Pointer state is unknown! */
|
||||||
|
POINTER_S_DISABLED = 0, /*!< Pointer is disabled. */
|
||||||
|
POINTER_S_ENABLED = 1 /*!< Pointer is enabled. */
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @struct tPointer_Info
|
||||||
|
* @brief Pointer position description.
|
||||||
|
**/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
s16 xPos; /*!< X position of pointer. */
|
||||||
|
s16 yPos; /*!< Y position of pointer. */
|
||||||
|
s16 shift_PosX; /*!< Pointer speed on X axis. */
|
||||||
|
s16 shift_PosY; /*!< Pointer speed on Y axis */
|
||||||
|
s16 X_PosMin; /*!< Minimum position on X axis. */
|
||||||
|
s16 Y_PosMin; /*!< Minimum position on Y axis. */
|
||||||
|
s16 X_PosMax; /*!< Maximum position on X axis. */
|
||||||
|
s16 Y_PosMax; /*!< Maximum position on Y axis. */
|
||||||
|
} tPointer_Info;
|
||||||
|
|
||||||
|
/// @cond Internal
|
||||||
|
|
||||||
|
/* Exported defines ---------------------------------------------------------*/
|
||||||
|
#define POINTER_WIDTH 7
|
||||||
|
|
||||||
|
// POINTER functions definition
|
||||||
|
#define POINTER_SET_RECT_ID (POINTER_ID + 0) // Set new limits for the move of the pointer
|
||||||
|
#define POINTER_SETRECTSCREEN_ID (POINTER_ID + 1) // Remove any space restriction for the pointer moves.
|
||||||
|
#define POINTER_GETCURRENTANGLESTART_ID (POINTER_ID + 2) // Return the current minimum angle to move pointer
|
||||||
|
#define POINTER_SETCURRENTANGLESTART_ID (POINTER_ID + 3) // Set the current minimum angle to move pointer
|
||||||
|
#define POINTER_GETCURRENTSPEEDONANGLE_ID (POINTER_ID + 4) // Return the ratio speed / angle
|
||||||
|
#define POINTER_SETCURRENTSPEEDONANGLE_ID (POINTER_ID + 5) // Set the ratio speed / angle
|
||||||
|
#define POINTER_SETMODE_ID (POINTER_ID + 6) // Change the current mode of the pointer management
|
||||||
|
#define POINTER_GETMODE_ID (POINTER_ID + 7) // Return the current mode of the pointer management
|
||||||
|
#define POINTER_SETCURRENTPOINTER_ID (POINTER_ID + 8) // Set the dimention and bitmap of pointer
|
||||||
|
#define POINTER_GETSTATE_ID (POINTER_ID + 9) // Return the current state
|
||||||
|
#define POINTER_DRAW_ID (POINTER_ID + 10) // Draw a pointer
|
||||||
|
#define POINTER_SAVE_ID (POINTER_ID + 11) // Save the background of the pointer
|
||||||
|
#define POINTER_RESTORE_ID (POINTER_ID + 12) // Restore the background of the pointer
|
||||||
|
#define POINTER_GETPOSITION_ID (POINTER_ID + 13) // Return the poistion of the cursor (x=lower byte, y = upperbyte)
|
||||||
|
#define POINTER_SETPOSITION_ID (POINTER_ID + 14) // Force the position of the pointer in the screen
|
||||||
|
#define POINTER_SETAPPLICATION_POINTER_MGR_ID (POINTER_ID + 15) // Set the application pointer manager
|
||||||
|
#define POINTER_SETCOLOR_ID (POINTER_ID + 16) // Set pointer color
|
||||||
|
#define POINTER_GETCOLOR_ID (POINTER_ID + 17) // Return pointer color
|
||||||
|
#define POINTER_GETINFO_ID (POINTER_ID + 18) // Return pointer informations
|
||||||
|
#define POINTER_SET_CURRENT_AREASTORE_ID (POINTER_ID + 19) // Change the current storage area
|
||||||
|
|
||||||
|
// Prototypes
|
||||||
|
#define POINTER_SetRect(a,b,c,d) ((tCircleFunc4)(Circle_API [POINTER_SET_RECT_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d)) //void POINTER_SetRect ( s16 x, s16 y, s16 width, s16 height ); //Restrict the move of the pointer to a rectangle
|
||||||
|
#define POINTER_SetRectScreen() ((tCircleFunc0)(Circle_API [POINTER_SETRECTSCREEN_ID])) () //void POINTER_SetRectScreen ( void );
|
||||||
|
#define POINTER_GetCurrentAngleStart() (u16) (((tCircleFunc0)(Circle_API [POINTER_GETCURRENTANGLESTART_ID])) ()) //u16 POINTER_GetCurrentAngleStart ( void );
|
||||||
|
#define POINTER_SetCurrentAngleStart(a) ((tCircleFunc1)(Circle_API [POINTER_SETCURRENTANGLESTART_ID])) ((u32)(a)) //void POINTER_SetCurrentAngleStart ( u16 );
|
||||||
|
#define POINTER_GetCurrentSpeedOnAngle() (u16) (((tCircleFunc0)(Circle_API [POINTER_GETCURRENTSPEEDONANGLE_ID])) ()) //u16 POINTER_GetCurrentSpeedOnAngle ( void );
|
||||||
|
#define POINTER_SetCurrentSpeedOnAngle(a) ((tCircleFunc1)(Circle_API [POINTER_SETCURRENTSPEEDONANGLE_ID])) ((u32)(a)) //void POINTER_SetCurrentSpeedOnAngle ( u16 newspeed );
|
||||||
|
#define POINTER_SetMode(a) ((tCircleFunc1)(Circle_API [POINTER_SETMODE_ID])) ((u32)(a)) //void POINTER_SetMode( enum POINTER_mode mode);
|
||||||
|
#define POINTER_GetMode() (enum POINTER_mode) (((tCircleFunc0)(Circle_API [POINTER_GETMODE_ID])) ()) //enum POINTER_mode POINTER_GetMode( void );
|
||||||
|
#define POINTER_SetCurrentPointer(a,b,c) ((tCircleFunc3)(Circle_API [POINTER_SETCURRENTPOINTER_ID])) ((u32)(a),(u32)(b),(u32)(c)) //void POINTER_SetCurrentPointer( unsigned char width, unsigned char height, unsigned char *bmp);
|
||||||
|
#define POINTER_GetState() (enum POINTER_state) (((tCircleFunc0)(Circle_API [POINTER_GETSTATE_ID])) ()) //enum POINTER_state POINTER_GetState(void);
|
||||||
|
#define POINTER_Draw(a,b,c,d,e) ((tCircleFunc5)(Circle_API [POINTER_DRAW_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d),(u32)(e)) //void POINTER_Draw (u8 Line, u8 Column, u8 Width, u8 Height, u8 *Bmp);
|
||||||
|
#define POINTER_Save(a,b,c,d) ((tCircleFunc4)(Circle_API [POINTER_SAVE_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d)) //void POINTER_Save (u8 Line, u8 Column, u8 Width, u8 Height);
|
||||||
|
#define POINTER_Restore(a,b,c,d) ((tCircleFunc4)(Circle_API [POINTER_RESTORE_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d)) //void POINTER_Restore (u8 Line, u8 Column, u8 Width, u8 Height);
|
||||||
|
#define POINTER_GetPos() (u16) (((tCircleFunc0)(Circle_API [POINTER_GETPOSITION_ID])) ()) //u16 POINTER_GetPos(void);
|
||||||
|
#define POINTER_SetPos(a,b) ((tCircleFunc2)(Circle_API [POINTER_SETPOSITION_ID])) ((u32)(a),(u32)(b)) //void POINTER_SetPos ( u16 x, u16 y );
|
||||||
|
#define POINTER_SetApplication_Pointer_Mgr(a) ((tCircleFunc1)(Circle_API [POINTER_SETAPPLICATION_POINTER_MGR_ID])) ((u32)(a)) //void POINTER_SetApplication_Pointer_Mgr( tAppPtrMgr mgr );
|
||||||
|
#define POINTER_SetColor(a) ((tCircleFunc1)(Circle_API [POINTER_SETCOLOR_ID])) ((u32)(a)) //void POINTER_SetColor ( u16 color )
|
||||||
|
#define POINTER_GetColor() (u16) (((tCircleFunc0)(Circle_API [POINTER_GETCOLOR_ID])) ()) //u16 POINTER_GetColor ( void )
|
||||||
|
#define POINTER_GetInfo() (tPointer_Info*) (((tCircleFunc0)(Circle_API [POINTER_GETINFO_ID])) ()) //tPointer_Info* POINTER_GetInfo ( void )
|
||||||
|
#define POINTER_SetCurrentAreaStore(a) ((tCircleFunc1)(Circle_API [POINTER_SET_CURRENT_AREASTORE_ID])) ((u32)(a)) //void POINTER_SetCurrentAreaStore ( u8 *ptr )
|
||||||
|
|
||||||
|
/// @endcond
|
||||||
|
|
||||||
|
//-------------------------------- BUTTON -----------------------------------
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @enum BUTTON_mode
|
||||||
|
* @brief Available button modes.
|
||||||
|
*
|
||||||
|
* List of all the available button mode in the CircleOS.
|
||||||
|
**/
|
||||||
|
enum BUTTON_mode
|
||||||
|
{
|
||||||
|
BUTTON_DISABLED = -1, /*!< No action on the button is detected. */
|
||||||
|
BUTTON_ONOFF = 0, /*!< Detect ON/OFF pression type. */
|
||||||
|
BUTTON_ONOFF_FORMAIN = 1, /*!< Special mode for main screen. */
|
||||||
|
BUTTON_WITHCLICK = 2 /*!< Currently unused. */
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @enum BUTTON_state
|
||||||
|
* @brief CircleOS button states.
|
||||||
|
*
|
||||||
|
* Description of the button states provided by CircleOS.
|
||||||
|
**/
|
||||||
|
enum BUTTON_state
|
||||||
|
{
|
||||||
|
BUTTON_UNDEF = -1, /*!< Undefined state. */
|
||||||
|
BUTTON_RELEASED = 0, /*!< Button is released. */
|
||||||
|
BUTTON_PUSHED = 1, /*!< Button was just pushed. */
|
||||||
|
BUTTON_PUSHED_FORMAIN = 2, /*!< Same as BUTTON_PUSHED when button mode is BUTTON_ONOFF_FORMAIN. */
|
||||||
|
BUTTON_CLICK = 3, /*!< Currently unused. */
|
||||||
|
BUTTON_DBLCLICK = 4 /*!< Currently unused. */
|
||||||
|
};
|
||||||
|
|
||||||
|
/// @cond Internal
|
||||||
|
|
||||||
|
/* Exported defines ----------------------------------------------------------*/
|
||||||
|
|
||||||
|
// BUTTON functions definition
|
||||||
|
#define BUTTON_GETSTATE_ID (BUTTON_ID + 0) // Return state of button
|
||||||
|
#define BUTTON_SETMODE_ID (BUTTON_ID + 1) // Set button mode
|
||||||
|
#define BUTTON_GETMODE_ID (BUTTON_ID + 2) // Return button mode
|
||||||
|
#define BUTTON_WAITFORRELEASE_ID (BUTTON_ID + 3) // Disable temporarily any new button event
|
||||||
|
|
||||||
|
// Prototypes
|
||||||
|
#define BUTTON_GetState() (enum BUTTON_state) (((tCircleFunc0)(Circle_API [BUTTON_GETSTATE_ID])) ()) // enum BUTTON_state BUTTON_GetState(void);
|
||||||
|
#define BUTTON_SetMode(a); ((tCircleFunc1)(Circle_API [BUTTON_SETMODE_ID])) ((u32)(a)) // void BUTTON_SetMode( enum BUTTON_mode mode);
|
||||||
|
#define BUTTON_GetMode(); (enum BUTTON_mode) (((tCircleFunc0)(Circle_API [BUTTON_GETMODE_ID])) ()) // enum BUTTON_mode BUTTON_GetMode ( void ) ;
|
||||||
|
#define BUTTON_WaitForRelease() ((tCircleFunc0)(Circle_API [BUTTON_WAITFORRELEASE_ID])) () // void BUTTON_WaitForRelease(void);
|
||||||
|
|
||||||
|
/// @endcond
|
||||||
|
|
||||||
|
//---------------------------------- LCD -----------------------------------
|
||||||
|
|
||||||
|
/* Exported defines ----------------------------------------------------------*/
|
||||||
|
|
||||||
|
// RGB is 16-bit coded as G2G1G0B4 B3B2B1B0 R4R3R2R1 R0G5G4G3
|
||||||
|
#define RGB_MAKE(xR,xG,xB) ( ( (xG&0x07)<<13 ) + ( (xG)>>5 ) + \
|
||||||
|
( ((xB)>>3) << 8 ) + \
|
||||||
|
( ((xR)>>3) << 3 ) ) /*!< Macro to make a LCD compatible color format from RGB. */
|
||||||
|
|
||||||
|
#define RGB_RED 0x00F8 /*!< Predefined color. */
|
||||||
|
#define RGB_BLACK 0x0000 /*!< Predefined color. */
|
||||||
|
#define RGB_WHITE 0xffff /*!< Predefined color. */
|
||||||
|
#define RGB_BLUE 0x1F00 /*!< Predefined color. */
|
||||||
|
#define RGB_GREEN 0xE007 /*!< Predefined color. */
|
||||||
|
#define RGB_YELLOW (RGB_GREEN|RGB_RED) /*!< Predefined color. */
|
||||||
|
#define RGB_MAGENTA (RGB_BLUE|RGB_RED) /*!< Predefined color. */
|
||||||
|
#define RGB_LIGHTBLUE (RGB_BLUE|RGB_GREEN) /*!< Predefined color. */
|
||||||
|
#define RGB_ORANGE (RGB_RED | 0xE001) /*!< Predefined color ( Green/2 + red ). */
|
||||||
|
#define RGB_PINK (RGB_MAGENTA | 0xE001) /*!< Predefined color ( Green/2 + magenta ). */
|
||||||
|
|
||||||
|
// PWM rates.
|
||||||
|
#define BACKLIGHTMIN 0x1000 /*!< Minimal PWM rate. */
|
||||||
|
#define DEFAULT_CCR_BACKLIGHTSTART 0x8000 /*!< Default PWM rate. */
|
||||||
|
|
||||||
|
// SCREEN Infos
|
||||||
|
#define SCREEN_WIDTH 128 /*!< Width of visible screen in pixels. */
|
||||||
|
#define SCREEN_HEIGHT 128 /*!< Height of visible screen in pixels. */
|
||||||
|
#define CHIP_SCREEN_WIDTH 132 /*!< Width of screen driven by LCD controller in pixels. */
|
||||||
|
#define CHIP_SCREEN_HEIGHT 132 /*!< Height of screen driven by LCD controller in pixels. */
|
||||||
|
|
||||||
|
// Characters Infos
|
||||||
|
#define CHAR_WIDTH 7 /*!< Width of a character. */
|
||||||
|
#define CHAR_HEIGHT 14 /*!< Height of a character. */
|
||||||
|
|
||||||
|
/// @cond Internal
|
||||||
|
|
||||||
|
// LCD functions definition
|
||||||
|
#define LCD_SETRECTFORCMD_ID (LCD_ID + 0) // Define the rectangle (for the next command to be applied)
|
||||||
|
#define LCD_GETPIXEL_ID (LCD_ID + 1) // Read the value of one pixel
|
||||||
|
#define LCD_DRAWPIXEL_ID (LCD_ID + 2) // Draw a Graphic image on slave LCD.
|
||||||
|
#define LCD_SENDLCDCMD_ID (LCD_ID + 3) // Send one byte command to LCD LCD.
|
||||||
|
#define LCD_SENDLCDDATA_ID (LCD_ID + 4) // Display one byte data to LCD LCD.
|
||||||
|
#define LCD_READLCDDATA_ID (LCD_ID + 5) // Read LCD byte data displayed on LCD LCD.
|
||||||
|
#define LCD_FILLRECT_ID (LCD_ID + 6) // Fill a rectangle with one color
|
||||||
|
#define LCD_DRAWRECT_ID (LCD_ID + 7) // Draw a rectangle with one color
|
||||||
|
#define LCD_DISPLAYCHAR_ID (LCD_ID + 8) // Display one character
|
||||||
|
#define LCD_RECTREAD_ID (LCD_ID + 9) // Save a rectangle of the monitor RAM
|
||||||
|
#define LCD_SETBACKLIGHT_ID (LCD_ID + 10) // Modify the PWM rate
|
||||||
|
#define LCD_GETBACKLIGHT_ID (LCD_ID + 11) // Return the PWM rate
|
||||||
|
#define LCD_SETROTATESCREEN_ID (LCD_ID + 12) // Enable/Disable screen rotation
|
||||||
|
#define LCD_GETROTATESCREEN_ID (LCD_ID + 13) // Return screen rotation mode
|
||||||
|
#define LCD_SETSCREENORIENTATION_ID (LCD_ID + 14) // Set screen orientation
|
||||||
|
#define LCD_GETSCREENORIENTATION_ID (LCD_ID + 15) // Return screen orientation
|
||||||
|
#define LCD_SETBACKLIGHT_OFF_ID (LCD_ID + 16) // Switch the LCD back light off.
|
||||||
|
#define LCD_SETBACKLIGHT_ON_ID (LCD_ID + 17) // Switch the LCD back light on.
|
||||||
|
|
||||||
|
// Prototypes
|
||||||
|
#define LCD_SetRect_For_Cmd(a,b,c,d) ((tCircleFunc4)(Circle_API [LCD_SETRECTFORCMD_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d)) //void LCD_SetRect_For_Cmd ( s16 x, s16 y, s16 width, s16 height)
|
||||||
|
#define LCD_GetPixel(a,b) (u16) (((tCircleFunc2)(Circle_API [LCD_GETPIXEL_ID])) ((u32)(a),(u32)(b))) //u16 LCD_GetPixel (u8 x, u8 y)
|
||||||
|
#define LCD_DrawPixel(a,b,c) ((tCircleFunc3)(Circle_API [LCD_DRAWPIXEL_ID])) ((u32)(a),(u32)(b),(u32)(c)) //void LCD_SetPixel (u8 x, u8 y, u16 Pixel) ;
|
||||||
|
#define LCD_SendLCDCmd(a) ((tCircleFunc1)(Circle_API [LCD_SENDLCDCMD_ID])) ((u32)(a)) //void LCD_SendLCDCmd(u8 Cmd);
|
||||||
|
#define LCD_SendLCDData(a) ((tCircleFunc1)(Circle_API [LCD_SENDLCDDATA_ID])) ((u32)(a)) //void LCD_SendLCDData(u8 Data);
|
||||||
|
#define LCD_ReadLCDData() (u32) (((tCircleFunc0)(Circle_API [LCD_READLCDDATA_ID])) ()) //u32 LCD_ReadLCDData(void);
|
||||||
|
#define LCD_FillRect(a,b,c,d,e) ((tCircleFunc5)(Circle_API [LCD_FILLRECT_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d),(u32)(e)) //void LCD_FillRect ( u16 x, u16 y, u16 width, u16 height, u16 color );
|
||||||
|
#define LCD_DrawRect(a,b,c,d,e) ((tCircleFunc5)(Circle_API [LCD_DRAWRECT_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d),(u32)(e)) //void LCD_DrawRect ( u16 x, u16 y, u16 width, u16 height, u16 color );
|
||||||
|
#define LCD_DisplayChar(a,b,c,d,e,f) ((tCircleFunc6)(Circle_API [LCD_DISPLAYCHAR_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d),(u32)(e),(u32)(f)) //void LCD_DisplayChar(u8 x, u8 y, u8 Ascii, u16 TextColor, u16 BGndColor, u16 CharMagniCoeff);
|
||||||
|
#define LCD_RectRead(a,b,c,d,e) ((tCircleFunc5)(Circle_API [LCD_RECTREAD_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d),(u32)(e)) //void LCD_RectRead ( u16 x, u16 y, u16 width, u16 height, u8* bmp );
|
||||||
|
#define LCD_SetBackLight(a) ((tCircleFunc1)(Circle_API [LCD_SETBACKLIGHT_ID])) ((u32)(a)) //void LCD_SetBackLight(u32 newBaclightStart);
|
||||||
|
#define LCD_GetBackLight() (u32) (((tCircleFunc0)(Circle_API [LCD_GETBACKLIGHT_ID])) ()) //u32 LCD_GetBackLight(void);
|
||||||
|
#define LCD_SetRotateScreen(a) ((tCircleFunc1)(Circle_API [LCD_SETROTATESCREEN_ID])) ((u32)(a)) //void LCD_SetRotateScreen ( u8 RotateScreen)
|
||||||
|
#define LCD_GetRotateScreen() (u32) (((tCircleFunc0)(Circle_API [LCD_GETROTATESCREEN_ID])) ()) //u8 LCD_GetRotateScreen (void)
|
||||||
|
#define LCD_SetScreenOrientation(a) ((tCircleFunc1)(Circle_API [LCD_SETSCREENORIENTATION_ID])) ((u32)(a)) //void LCD_SetScreenOrientation (Rotate_H12_V_Match_TypeDef ScreenOrientation)
|
||||||
|
#define LCD_GetScreenOrientation() (u32) (((tCircleFunc0)(Circle_API [LCD_GETSCREENORIENTATION_ID])) ()) //Rotate_H12_V_Match_TypeDef LCD_GetScreenOrientation (void)
|
||||||
|
#define LCD_SetBackLightOff() ((tCircleFunc0)(Circle_API [LCD_SETBACKLIGHT_OFF_ID])) ()
|
||||||
|
#define LCD_SetBackLightOn() ((tCircleFunc0)(Circle_API [LCD_SETBACKLIGHT_ON_ID])) ()
|
||||||
|
|
||||||
|
/// @endcond
|
||||||
|
|
||||||
|
//---------------------------------- DRAW ----------------------------------
|
||||||
|
|
||||||
|
/// @cond Internal
|
||||||
|
|
||||||
|
/* Exported defines ----------------------------------------------------------*/
|
||||||
|
|
||||||
|
// DRAW functions definition
|
||||||
|
#define DRAW_SETDEFAULTCOLOR_ID (DRAW_ID + 0) // Reset colors (bgnd + text)
|
||||||
|
#define DRAW_CLEAR_ID (DRAW_ID + 1) // Clear the LCD display
|
||||||
|
#define DRAW_SETIMAGE_ID (DRAW_ID + 2) // Draw a colored image
|
||||||
|
#define DRAW_SETIMAGEBW_ID (DRAW_ID + 3) // Draw a black and white image
|
||||||
|
#define DRAW_SETLOGOBW_ID (DRAW_ID + 4) // Draw logo
|
||||||
|
#define DRAW_DISPLAYVBAT_ID (DRAW_ID + 5) // Display the voltage of battery in ascii
|
||||||
|
#define DRAW_DISPLAYTIME_ID (DRAW_ID + 6) // Display time in ascii
|
||||||
|
#define DRAW_DISPLAYSTRING_ID (DRAW_ID + 7) // Display a 17char max string of characters
|
||||||
|
#define DRAW_DISPLAYSTRINGINVERTED_ID (DRAW_ID + 8) // Display a 17char max string of characters with inverted colors
|
||||||
|
#define DRAW_GETCHARMAGNICOEFF_ID (DRAW_ID + 9) // Return the magnifying value for the characters
|
||||||
|
#define DRAW_SETCHARMAGNICOEFF_ID (DRAW_ID + 10) // Set the magnifying value for the characters
|
||||||
|
#define DRAW_GETTEXTCOLOR_ID (DRAW_ID + 11) // Return the current text color
|
||||||
|
#define DRAW_SETTEXTCOLOR_ID (DRAW_ID + 12) // Set the current text color
|
||||||
|
#define DRAW_GETBGNDCOLOR_ID (DRAW_ID + 13) // Return the current background color
|
||||||
|
#define DRAW_SETBGNDCOLOR_ID (DRAW_ID + 14) // Set the current background color
|
||||||
|
#define DRAW_LINE_ID (DRAW_ID + 15) // Draw a Line between (using Bresenham algorithm)
|
||||||
|
|
||||||
|
//Prototypes
|
||||||
|
#define DRAW_SetDefaultColor() ((tCircleFunc0)(Circle_API [DRAW_SETDEFAULTCOLOR_ID])) () //void DRAW_SetDefaultColor (void);
|
||||||
|
#define DRAW_Clear() ((tCircleFunc0)(Circle_API [DRAW_CLEAR_ID])) () //void DRAW_Clear(void);
|
||||||
|
#define DRAW_SetImage(a,b,c,d,e) ((tCircleFunc5)(Circle_API [DRAW_SETIMAGE_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d),(u32)(e)) //void DRAW_SetImage(const u16 *imageptr, u8 x, u8 y, u8 width, u8 height);
|
||||||
|
#define DRAW_SetImageBW(a,b,c,d,e) ((tCircleFunc5)(Circle_API [DRAW_SETIMAGEBW_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d),(u32)(e)) //void DRAW_SetImageBW(const u8 *imageptr, u8 x, u8 y, u8 width, u8 height);
|
||||||
|
#define DRAW_SetLogoBW() ((tCircleFunc0)(Circle_API [DRAW_SETLOGOBW_ID])) () //void DRAW_SetLogoBW(void);
|
||||||
|
#define DRAW_DisplayVbat(a,b) ((tCircleFunc2)(Circle_API [DRAW_DISPLAYVBAT_ID])) ((u32)(a),(u32)(b)) //void DRAW_DisplayVbat(u8 x, u8 y);
|
||||||
|
#define DRAW_DisplayTime(a,b) ((tCircleFunc2)(Circle_API [DRAW_DISPLAYTIME_ID])) ((u32)(a),(u32)(b)) //void DRAW_DisplayTime(u8 x, u8 y);
|
||||||
|
#define DRAW_DisplayString(a,b,c,d) ((tCircleFunc4)(Circle_API [DRAW_DISPLAYSTRING_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d)) //void DRAW_DisplayString( u8 x, u8 y, u8 *ptr, u8 len );
|
||||||
|
#define DRAW_DisplayStringInverted(a,b,c,d) ((tCircleFunc4)(Circle_API [DRAW_DISPLAYSTRINGINVERTED_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d)) //void DRAW_DisplayStringInverted( u8 x, u8 y, u8 *ptr, u8 len );
|
||||||
|
#define DRAW_GetCharMagniCoeff() (u16) (((tCircleFunc0)(Circle_API [DRAW_GETCHARMAGNICOEFF_ID])) ()) //u16 DRAW_GetCharMagniCoeff(void);
|
||||||
|
#define DRAW_SetCharMagniCoeff(a) ((tCircleFunc1)(Circle_API [DRAW_SETCHARMAGNICOEFF_ID])) ((u32)(a)) //void DRAW_SetCharMagniCoeff(u16 Coeff);
|
||||||
|
#define DRAW_GetTextColor() (u16) (((tCircleFunc0)(Circle_API [DRAW_GETTEXTCOLOR_ID])) ()) //u16 DRAW_GetTextColor(void);
|
||||||
|
#define DRAW_SetTextColor(a) ((tCircleFunc1)(Circle_API [DRAW_SETTEXTCOLOR_ID])) ((u32)(a)) //void DRAW_SetTextColor(u16 Color);
|
||||||
|
#define DRAW_GetBGndColor() (u16) (((tCircleFunc0)(Circle_API [DRAW_GETBGNDCOLOR_ID])) ()) //u16 DRAW_GetBGndColor(void);
|
||||||
|
#define DRAW_SetBGndColor(a) ((tCircleFunc1)(Circle_API [DRAW_SETBGNDCOLOR_ID])) ((u32)(a)) //void DRAW_SetBGndColor(u16 Color);
|
||||||
|
#define DRAW_Line(a,b,c,d,e) ((tCircleFunc5)(Circle_API [DRAW_LINE_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d),(u32)(e)) //void DRAW_Line(s16 x1, s16 y1, s16 x2, s16 y2, u16 color );
|
||||||
|
/// @endcond
|
||||||
|
|
||||||
|
//-------------------------------- BUZZER -----------------------------------
|
||||||
|
|
||||||
|
/* Exported type def ---------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @enum BUZZER_mode
|
||||||
|
* @brief CircleOS buzzer modes.
|
||||||
|
*
|
||||||
|
* Without the undefined mode, the CircleOS provides 5 modes for its buzzer.
|
||||||
|
**/
|
||||||
|
enum BUZZER_mode
|
||||||
|
{
|
||||||
|
BUZZER_UNDEF = -1, /*!< undefined mode for buzzer */
|
||||||
|
BUZZER_OFF = 0, /*!< The buzzer is put off. */
|
||||||
|
BUZZER_ON = 1, /*!< The buzzer is put on. */
|
||||||
|
BUZZER_SHORTBEEP = 2, /*!< Make buzzer to bip for a short time */
|
||||||
|
BUZZER_LONGBEEP = 3, /*!< Make buzzer to bip for a long time */
|
||||||
|
BUZZER_PLAYMUSIC = 4 /*!< Make buzzer to play a music */
|
||||||
|
};
|
||||||
|
|
||||||
|
/// @cond Internal
|
||||||
|
|
||||||
|
/* Exported defines ----------------------------------------------------------*/
|
||||||
|
#define BUZZER_BEEP BUZZER_SHORTBEEP
|
||||||
|
|
||||||
|
// BUZZER functions definition
|
||||||
|
#define BUZZER_SETMODE_ID (BUZZER_ID + 0) // Set new buzzer mode
|
||||||
|
#define BUZZER_GETMODE_ID (BUZZER_ID + 1) // Get the current buzzer mode.
|
||||||
|
#define BUZZER_PLAY_MUSIC_ID (BUZZER_ID + 2) // Plays the provided melody that follows the RTTTL Format.
|
||||||
|
|
||||||
|
// Prototypes
|
||||||
|
#define BUZZER_SetMode(a) ((tCircleFunc1)(Circle_API [BUZZER_SETMODE_ID])) ((u32)(a)) //void BUZZER_SetMode( enum BUZZER_mode mode);
|
||||||
|
#define BUZZER_GetMode() (enum BUZZER_mode) (((tCircleFunc0)(Circle_API [BUZZER_GETMODE_ID])) ()) //enum BUZZER_mode BUZZER_GetMode( void );
|
||||||
|
#define BUZZER_PlayMusic(a) ((tCircleFunc1)(Circle_API [BUZZER_PLAY_MUSIC_ID])) ((u32)(a)) //void BUZZER_PlayMusic (const u8 *melody );
|
||||||
|
|
||||||
|
/// @endcond
|
||||||
|
|
||||||
|
//--------------------------------- MENU -----------------------------------
|
||||||
|
|
||||||
|
/* Exported defines ----------------------------------------------------------*/
|
||||||
|
#define REMOVE_MENU 0x01 /*!< Menu flag: remove menu when item selected. */
|
||||||
|
#define APP_MENU 0x02 /*!< Menu flag: item is an application. */
|
||||||
|
#define MENU_MAXITEM 8 /*!< Maximum number of item in a menu. */
|
||||||
|
|
||||||
|
/* Exported type def ---------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @struct tMenuItem
|
||||||
|
* @brief Menu item description.
|
||||||
|
**/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
const char* Text; /*!< Name of Item displayed in menu */
|
||||||
|
enum MENU_code (*Fct_Init) ( void ); /*!< First function launched if item is selected. */
|
||||||
|
enum MENU_code (*Fct_Manage)( void ); /*!< Second function launched after a "return MENU_CONTINU_COMMAND" in the first function */
|
||||||
|
int fRemoveMenu; /*!< Flag to know if remove menu at end */
|
||||||
|
} tMenuItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @struct tMenu
|
||||||
|
* @brief Menu description.
|
||||||
|
**/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned fdispTitle: 1; /*!< Display title is set. */
|
||||||
|
const char* Title; /*!< Menu title. */
|
||||||
|
int NbItems; /*!< Number of items in the menu ( must be <= MENU_MAXITEM ) */
|
||||||
|
int LgMax; /*!< Unused. */
|
||||||
|
int XPos; /*!< X position of menu bottom-left corner. */
|
||||||
|
int YPos; /*!< Y position of menu bottom-left corner. */
|
||||||
|
int XSize; /*!< Unused. */
|
||||||
|
int YSize; /*!< Unused. */
|
||||||
|
unsigned int SelectedItem; /*!< ID of selected item (0 for first item, 1 for second item, ...) */
|
||||||
|
tMenuItem Items[MENU_MAXITEM]; /*!< Items of menu. */
|
||||||
|
} tMenu;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @enum MENU_code
|
||||||
|
* @brief Application return values.
|
||||||
|
*
|
||||||
|
* List of all the codes available for CircleOS application return values.
|
||||||
|
**/
|
||||||
|
enum MENU_code
|
||||||
|
{
|
||||||
|
MENU_LEAVE = 0, /*!< Leave application. */
|
||||||
|
MENU_CONTINUE = 1, /*!< Continue application. */
|
||||||
|
MENU_REFRESH = 2, /*!< Refresh current menu. */
|
||||||
|
MENU_CHANGE = 3, /*!< Change current menu. */
|
||||||
|
MENU_CONTINUE_COMMAND = 4 /*!< Sent by Ini functions.*/
|
||||||
|
};
|
||||||
|
|
||||||
|
/// @cond Internal
|
||||||
|
|
||||||
|
/* Exported defines ----------------------------------------------------------*/
|
||||||
|
|
||||||
|
// MENU functions definition
|
||||||
|
#define MENU_SET_ID (MENU_ID + 0) // Display a menu
|
||||||
|
#define MENU_REMOVE_ID (MENU_ID + 1) // Remove the current menu, DRAW_Clear and set pointer mode to "POINTER_ON".
|
||||||
|
#define MENU_QUESTION_ID (MENU_ID + 2) // Dedicated menu for ask question and yes/no responses
|
||||||
|
#define MENU_PRINT_ID (MENU_ID + 3) // Display a popup menu with a string.
|
||||||
|
#define MENU_CLEAR_CURRENT_COMMAND_ID (MENU_ID + 4) // Set CurrentCommand to 0
|
||||||
|
#define MENU_SET_LEVELTITLE_ID (MENU_ID + 5) // Set the title of level menu managed by MENU_SetLevel_Mgr.
|
||||||
|
#define MENU_SET_TEXTCOLOR_ID (MENU_ID + 6) // Set the color used for text menu.
|
||||||
|
#define MENU_GET_TEXTCOLOR_ID (MENU_ID + 7) // Return the color used for text menu.
|
||||||
|
#define MENU_SET_BGNDCOLOR_ID (MENU_ID + 8) // Set the background color used for menu.
|
||||||
|
#define MENU_GET_BGNDCOLOR_ID (MENU_ID + 9) // Return the background color used for menu.
|
||||||
|
#define MENU_QUIT_ID (MENU_ID + 10) // Leave the current menu (stand for "cancel" and do a DRAW_Clear)
|
||||||
|
#define MENU_SET_LEVELINI_ID (MENU_ID + 11) // Initialise a generic function to set a avalue in the range of [0,4]
|
||||||
|
#define MENU_CLEAR_CURRENT_MENU_ID (MENU_ID + 12) // Set CurrentMenu to 0
|
||||||
|
#define MENU_SET_LEVEL_MGR_ID (MENU_ID + 13) // Generic function to set a avalue in the range of [0,4] (handling of the control)
|
||||||
|
|
||||||
|
// Prototypes
|
||||||
|
#define MENU_Set(a) ((tCircleFunc1)(Circle_API [MENU_SET_ID])) ((u32)(a)) //void MENU_Set ( tMenu *mptr );
|
||||||
|
#define MENU_Remove() ((tCircleFunc0)(Circle_API [MENU_REMOVE_ID])) () //void MENU_Remove ( void ) ;
|
||||||
|
#define MENU_Question(a,b) ((tCircleFunc2)(Circle_API [MENU_QUESTION_ID])) ((u32)(a),(u32)(b)) //void MENU_Question ( char *str, int *answer );
|
||||||
|
#define MENU_Print(a) ((tCircleFunc1)(Circle_API [MENU_PRINT_ID])) ((u32)(a)) //void MENU_Print ( char *str );
|
||||||
|
#define MENU_ClearCurrentCommand() ((tCircleFunc0)(Circle_API [MENU_CLEAR_CURRENT_COMMAND_ID])) () //void MENU_ClearCurrentCommand(void)
|
||||||
|
#define MENU_SetLevelTitle(a) ((tCircleFunc1)(Circle_API [MENU_SET_LEVELTITLE_ID])) ((u32)(a)) //void MENU_SetLevelTitle(u8* title)
|
||||||
|
#define MENU_SetTextColor(a) ((tCircleFunc1)(Circle_API [MENU_SET_TEXTCOLOR_ID])) ((u32)(a)) //void MENU_SetTextColor ( int TextColor )
|
||||||
|
#define MENU_GetTextColor() (u32) (((tCircleFunc0)(Circle_API [MENU_GET_TEXTCOLOR_ID])) ()) //int MENU_GetTextColor ( void )
|
||||||
|
#define MENU_SetBGndColor(a) ((tCircleFunc1)(Circle_API [MENU_SET_BGNDCOLOR_ID])) ((u32)(a)) //void MENU_SetBGndColor ( int BGndColor )
|
||||||
|
#define MENU_GetBGndColor() (u32) (((tCircleFunc0)(Circle_API [MENU_GET_BGNDCOLOR_ID])) ()) //int MENU_GetBGndColor ( void )
|
||||||
|
#define MENU_Quit() (enum MENU_code) (((tCircleFunc0)(Circle_API [MENU_QUIT_ID])) ()) //enum MENU_code MENU_Quit ( void )
|
||||||
|
#define MENU_SetLevel_Ini() (enum MENU_code) (((tCircleFunc0)(Circle_API [MENU_SET_LEVELINI_ID])) ()) //enum MENU_code MENU_SetLevel_Ini ( void )
|
||||||
|
#define MENU_ClearCurrentMenu() ((tCircleFunc0)(Circle_API [MENU_CLEAR_CURRENT_MENU_ID])) () //void MENU_ClearCurrentMenu(void)
|
||||||
|
#define MENU_SetLevel_Mgr(a,b) (enum MENU_code) ((tCircleFunc2)(Circle_API [MENU_SET_LEVEL_MGR_ID])) ((u32)(a),(u32)(b)) //enum MENU_code MENU_SetLevel_Mgr ( u32 *value, u32 value_range [] )
|
||||||
|
|
||||||
|
/// @endcond
|
||||||
|
|
||||||
|
//---------------------------------- LED -------------------------------------
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @enum LED_mode
|
||||||
|
* @brief LED modes.
|
||||||
|
*
|
||||||
|
* LEDs may be on, off or blinking slowly or fastly!
|
||||||
|
**/
|
||||||
|
enum LED_mode
|
||||||
|
{
|
||||||
|
LED_UNDEF = -1, /*!< Undefined led mode. */
|
||||||
|
LED_OFF = 0, /*!< Put off the led. */
|
||||||
|
LED_ON = 1, /*!< Put on the led. */
|
||||||
|
LED_BLINKING_LF = 2, /*!< Slow blinking led mode. */
|
||||||
|
LED_BLINKING_HF = 3 /*!< Fast blinking led mode. */
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @enum LED_id
|
||||||
|
* @brief Available LEDs.
|
||||||
|
*
|
||||||
|
* List of all the available LEDs.
|
||||||
|
**/
|
||||||
|
enum LED_id
|
||||||
|
{
|
||||||
|
LED_GREEN = 0, /*!< Green led id. */
|
||||||
|
LED_RED = 1 /*!< Red led id. */
|
||||||
|
};
|
||||||
|
|
||||||
|
/// @cond Internal
|
||||||
|
|
||||||
|
/* Exported defines ----------------------------------------------------------*/
|
||||||
|
|
||||||
|
// LED functions definition
|
||||||
|
#define LED_SET_ID (LED_ID + 0) // Set a specified LED in a specified mode.
|
||||||
|
|
||||||
|
// Prototypes
|
||||||
|
#define LED_Set(a,b) ((tCircleFunc2)(Circle_API [LED_SET_ID])) ((u32)(a),(u32)(b)) //void LED_Set ( enum LED_id id, enum LED_mode mode ) //void LED_Set ( enum LED_id id, enum LED_mode mode );
|
||||||
|
|
||||||
|
/// @endcond
|
||||||
|
|
||||||
|
//-------------------------------- RTC --------------------------------------
|
||||||
|
|
||||||
|
/* Exported defines ----------------------------------------------------------*/
|
||||||
|
|
||||||
|
// Backup registers
|
||||||
|
#define BKP_SYS1 1 /*!< Backup register reserved for OS */
|
||||||
|
#define BKP_SYS2 2 /*!< Backup register reserved for OS */
|
||||||
|
#define BKP_SYS3 3 /*!< Backup register reserved for OS */
|
||||||
|
#define BKP_SYS4 4 /*!< Backup register reserved for OS */
|
||||||
|
#define BKP_SYS5 5 /*!< Backup register reserved for OS */
|
||||||
|
#define BKP_SYS6 6 /*!< Backup register reserved for OS */
|
||||||
|
|
||||||
|
#define BKP_USER1 7 /*!< Backup available for users application */
|
||||||
|
#define BKP_USER2 8 /*!< Backup available for users application */
|
||||||
|
#define BKP_USER3 9 /*!< Backup available for users application */
|
||||||
|
#define BKP_USER4 10 /*!< Backup available for users application */
|
||||||
|
|
||||||
|
/// @cond Internal
|
||||||
|
|
||||||
|
//RTC functions definition
|
||||||
|
#define RTC_SET_TIME_ID (RTC_ID + 0) // Set current time.
|
||||||
|
#define RTC_GET_TIME_ID (RTC_ID + 1) // Return current time.
|
||||||
|
#define RTC_DISPLAY_TIME_ID (RTC_ID + 2) // Display current time on the 6th line at column 0.
|
||||||
|
|
||||||
|
// Prototypes
|
||||||
|
#define RTC_SetTime(a,b,c) ((tCircleFunc3)(Circle_API [RTC_SET_TIME_ID])) ((u32)(a),(u32)(b),(u32)(c)) //void RTC_SetTime (u32 THH, u32 TMM, u32 TSS);
|
||||||
|
#define RTC_GetTime(a,b,c) ((tCircleFunc3)(Circle_API [RTC_GET_TIME_ID])) ((u32)(a),(u32)(b),(u32)(c)) //void RTC_GetTime (u32 * THH, u32 * TMM, u32 * TSS);
|
||||||
|
#define RTC_DisplayTime() ((tCircleFunc0)(Circle_API [RTC_DISPLAY_TIME_ID])) () //void RTC_DisplayTime ( void );
|
||||||
|
|
||||||
|
/// @endcond
|
||||||
|
|
||||||
|
//--------------------------------- Application -------------------------------
|
||||||
|
typedef void (*tAppPtrMgr) ( int , int );
|
||||||
|
|
||||||
|
#endif /*__CIRCLE_API_H */
|
@ -0,0 +1,217 @@
|
|||||||
|
/******************** (C) COPYRIGHT 2007 STMicroelectronics ********************
|
||||||
|
* File Name : stm32f10x_vector.c
|
||||||
|
* Author : MCD Tools Team
|
||||||
|
* Date First Issued : 05/14/2007
|
||||||
|
* Description : This file contains the vector table for STM32F10x.
|
||||||
|
* After Reset the Cortex-M3 processor is in Thread mode,
|
||||||
|
* priority is Privileged, and the Stack is set to Main.
|
||||||
|
********************************************************************************
|
||||||
|
* History:
|
||||||
|
* 05/14/2007: V0.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.
|
||||||
|
*******************************************************************************/
|
||||||
|
|
||||||
|
/* Includes ----------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
void NMIException(void);
|
||||||
|
void HardFaultException(void);
|
||||||
|
void MemManageException(void);
|
||||||
|
void BusFaultException(void);
|
||||||
|
void UsageFaultException(void);
|
||||||
|
void DebugMonitor(void);
|
||||||
|
void SVCHandler(void);
|
||||||
|
void PendSVC(void);
|
||||||
|
void SysTickHandler(void);
|
||||||
|
void WWDG_IRQHandler(void);
|
||||||
|
void PVD_IRQHandler(void);
|
||||||
|
void TAMPER_IRQHandler(void);
|
||||||
|
void RTC_IRQHandler(void);
|
||||||
|
void FLASH_IRQHandler(void);
|
||||||
|
void RCC_IRQHandler(void);
|
||||||
|
void EXTI0_IRQHandler(void);
|
||||||
|
void EXTI1_IRQHandler(void);
|
||||||
|
void EXTI2_IRQHandler(void);
|
||||||
|
void EXTI3_IRQHandler(void);
|
||||||
|
void EXTI4_IRQHandler(void);
|
||||||
|
void DMAChannel1_IRQHandler(void);
|
||||||
|
void DMAChannel2_IRQHandler(void);
|
||||||
|
void DMAChannel3_IRQHandler(void);
|
||||||
|
void DMAChannel4_IRQHandler(void);
|
||||||
|
void DMAChannel5_IRQHandler(void);
|
||||||
|
void DMAChannel6_IRQHandler(void);
|
||||||
|
void DMAChannel7_IRQHandler(void);
|
||||||
|
void ADC_IRQHandler(void);
|
||||||
|
void USB_HP_CAN_TX_IRQHandler(void);
|
||||||
|
void USB_LP_CAN_RX0_IRQHandler(void);
|
||||||
|
void CAN_RX1_IRQHandler(void);
|
||||||
|
void CAN_SCE_IRQHandler(void);
|
||||||
|
void EXTI9_5_IRQHandler(void);
|
||||||
|
void TIM1_BRK_IRQHandler(void);
|
||||||
|
void TIM1_UP_IRQHandler(void);
|
||||||
|
void TIM1_TRG_COM_IRQHandler(void);
|
||||||
|
void TIM1_CC_IRQHandler(void);
|
||||||
|
void TIM2_IRQHandler(void);
|
||||||
|
void TIM3_IRQHandler(void);
|
||||||
|
void TIM4_IRQHandler(void);
|
||||||
|
void I2C1_EV_IRQHandler(void);
|
||||||
|
void I2C1_ER_IRQHandler(void);
|
||||||
|
void I2C2_EV_IRQHandler(void);
|
||||||
|
void I2C2_ER_IRQHandler(void);
|
||||||
|
void SPI1_IRQHandler(void);
|
||||||
|
void SPI2_IRQHandler(void);
|
||||||
|
void USART1_IRQHandler(void);
|
||||||
|
void USART2_IRQHandler(void);
|
||||||
|
void USART3_IRQHandler(void);
|
||||||
|
void EXTI15_10_IRQHandler(void);
|
||||||
|
void RTCAlarm_IRQHandler(void);
|
||||||
|
void USBWakeUp_IRQHandler(void);
|
||||||
|
|
||||||
|
|
||||||
|
/* Exported types --------------------------------------------------------------*/
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
extern unsigned long _etext;
|
||||||
|
extern unsigned long _sidata; /* start address for the initialization values of the .data section. defined in linker script */
|
||||||
|
extern unsigned long _sdata; /* start address for the .data section. defined in linker script */
|
||||||
|
extern unsigned long _edata; /* end address for the .data section. defined in linker script */
|
||||||
|
|
||||||
|
extern unsigned long _sbss; /* start address for the .bss section. defined in linker script */
|
||||||
|
extern unsigned long _ebss; /* end address for the .bss section. defined in linker script */
|
||||||
|
|
||||||
|
extern void _estack; /* init value for the stack pointer. defined in linker script */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Private typedef -----------------------------------------------------------*/
|
||||||
|
/* function prototypes ------------------------------------------------------*/
|
||||||
|
void Reset_Handler(void) __attribute__((__interrupt__));
|
||||||
|
extern int main(void);
|
||||||
|
extern void xPortPendSVHandler(void);
|
||||||
|
extern void xPortSysTickHandler(void);
|
||||||
|
extern void vTimer2IntHandler( void );
|
||||||
|
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
*
|
||||||
|
* The minimal vector table for a Cortex M3. Note that the proper constructs
|
||||||
|
* must be placed on this to ensure that it ends up at physical address
|
||||||
|
* 0x0000.0000.
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
__attribute__ ((section(".isr_vector")))
|
||||||
|
void (* const g_pfnVectors[])(void) =
|
||||||
|
{
|
||||||
|
&_estack, // The initial stack pointer
|
||||||
|
Reset_Handler, // The reset handler
|
||||||
|
NMIException,
|
||||||
|
HardFaultException,
|
||||||
|
MemManageException,
|
||||||
|
BusFaultException,
|
||||||
|
UsageFaultException,
|
||||||
|
0, 0, 0, 0, /* Reserved */
|
||||||
|
SVCHandler,
|
||||||
|
DebugMonitor,
|
||||||
|
0, /* Reserved */
|
||||||
|
xPortPendSVHandler,
|
||||||
|
xPortSysTickHandler,
|
||||||
|
WWDG_IRQHandler,
|
||||||
|
PVD_IRQHandler,
|
||||||
|
TAMPER_IRQHandler,
|
||||||
|
RTC_IRQHandler,
|
||||||
|
FLASH_IRQHandler,
|
||||||
|
RCC_IRQHandler,
|
||||||
|
EXTI0_IRQHandler,
|
||||||
|
EXTI1_IRQHandler,
|
||||||
|
EXTI2_IRQHandler,
|
||||||
|
EXTI3_IRQHandler,
|
||||||
|
EXTI4_IRQHandler,
|
||||||
|
DMAChannel1_IRQHandler,
|
||||||
|
DMAChannel2_IRQHandler,
|
||||||
|
DMAChannel3_IRQHandler,
|
||||||
|
DMAChannel4_IRQHandler,
|
||||||
|
DMAChannel5_IRQHandler,
|
||||||
|
DMAChannel6_IRQHandler,
|
||||||
|
DMAChannel7_IRQHandler,
|
||||||
|
ADC_IRQHandler,
|
||||||
|
USB_HP_CAN_TX_IRQHandler,
|
||||||
|
USB_LP_CAN_RX0_IRQHandler,
|
||||||
|
CAN_RX1_IRQHandler,
|
||||||
|
CAN_SCE_IRQHandler,
|
||||||
|
EXTI9_5_IRQHandler,
|
||||||
|
TIM1_BRK_IRQHandler,
|
||||||
|
TIM1_UP_IRQHandler,
|
||||||
|
TIM1_TRG_COM_IRQHandler,
|
||||||
|
TIM1_CC_IRQHandler,
|
||||||
|
vTimer2IntHandler,
|
||||||
|
TIM3_IRQHandler,
|
||||||
|
TIM4_IRQHandler,
|
||||||
|
I2C1_EV_IRQHandler,
|
||||||
|
I2C1_ER_IRQHandler,
|
||||||
|
I2C2_EV_IRQHandler,
|
||||||
|
I2C2_ER_IRQHandler,
|
||||||
|
SPI1_IRQHandler,
|
||||||
|
SPI2_IRQHandler,
|
||||||
|
USART1_IRQHandler,
|
||||||
|
USART2_IRQHandler,
|
||||||
|
USART3_IRQHandler,
|
||||||
|
EXTI15_10_IRQHandler,
|
||||||
|
RTCAlarm_IRQHandler,
|
||||||
|
USBWakeUp_IRQHandler,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
(unsigned long)0xF108F85F //this is a workaround for boot in RAM mode.
|
||||||
|
};
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
* Function Name : Reset_Handler
|
||||||
|
* Description : This is the code that gets called when the processor first starts execution
|
||||||
|
* following a reset event. Only the absolutely necessary set is performed,
|
||||||
|
* after which the application supplied main() routine is called.
|
||||||
|
* Input :
|
||||||
|
* Output :
|
||||||
|
* Return :
|
||||||
|
*******************************************************************************/
|
||||||
|
void Reset_Handler(void)
|
||||||
|
{
|
||||||
|
unsigned long *pulSrc, *pulDest;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Copy the data segment initializers from flash to SRAM.
|
||||||
|
//
|
||||||
|
pulSrc = &_sidata;
|
||||||
|
for(pulDest = &_sdata; pulDest < &_edata; )
|
||||||
|
{
|
||||||
|
*(pulDest++) = *(pulSrc++);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Zero fill the bss segment.
|
||||||
|
//
|
||||||
|
for(pulDest = &_sbss; pulDest < &_ebss; )
|
||||||
|
{
|
||||||
|
*(pulDest++) = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Call the application's entry point.
|
||||||
|
//
|
||||||
|
main();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/********************* (C) COPYRIGHT 2007 STMicroelectronics *****END OF FILE****/
|
||||||
|
|
||||||
|
|
@ -0,0 +1,545 @@
|
|||||||
|
/********************* (C) COPYRIGHT 2007 RAISONANCE S.A.S. *******************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @file draw.c
|
||||||
|
* @brief Various utilities for drawings (characters, ..)
|
||||||
|
* @author FL
|
||||||
|
* @author IB
|
||||||
|
* @date 07/2007
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "circle.h"
|
||||||
|
|
||||||
|
/// @cond Internal
|
||||||
|
|
||||||
|
/* Private define ------------------------------------------------------------*/
|
||||||
|
#define V9_MADCTRVAL 0x90
|
||||||
|
#define V12_MADCTRVAL 0x30
|
||||||
|
#define V3_MADCTRVAL 0x50
|
||||||
|
#define V6_MADCTRVAL 0xF0
|
||||||
|
|
||||||
|
#define ROTATE_DIVISER 500
|
||||||
|
|
||||||
|
/* Private variables ---------------------------------------------------------*/
|
||||||
|
|
||||||
|
static u16 CharMagniCoeff = 1; /*!< Current character magnify coefficient. */
|
||||||
|
static u16 BGndColor; /*!< Current background color. */
|
||||||
|
static u16 TextColor; /*!< Current text color. */
|
||||||
|
|
||||||
|
int fDisplayTime = 0;
|
||||||
|
u16 BatState;
|
||||||
|
u16 OldBatState;
|
||||||
|
u32 OldTHH;
|
||||||
|
u32 OldTMM;
|
||||||
|
u32 OldTSS;
|
||||||
|
u32 OldTemp; //FL071107
|
||||||
|
u16 xBat;
|
||||||
|
u16 yBat;
|
||||||
|
u16 widthBat;
|
||||||
|
u16 heightBat;
|
||||||
|
u8 UsbState,OldUsbState;
|
||||||
|
static int divider_coord = 0;
|
||||||
|
|
||||||
|
// Screen orientation management
|
||||||
|
int rotate_counter = 0;
|
||||||
|
Rotate_H12_V_Match_TypeDef previous_H12 = V9;
|
||||||
|
Rotate_H12_V_Match_TypeDef previous_previous_H12 = V9;
|
||||||
|
Rotate_H12_V_Match_TypeDef H12;
|
||||||
|
Rotate_H12_V_Match_TypeDef CurrentScreenOrientation;
|
||||||
|
int CurrentRotateScreen = 1;
|
||||||
|
|
||||||
|
extern s16 XInit;
|
||||||
|
extern s16 YInit;
|
||||||
|
|
||||||
|
/* Private functions ---------------------------------------------------------*/
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* vbattoa
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* This function convert an u16 in ascii radix 10
|
||||||
|
*
|
||||||
|
* @param[out] ptr A pointer to a string where the converted value will be put.
|
||||||
|
* @param[in] X The value to convert.
|
||||||
|
*
|
||||||
|
* @see DRAW_DisplayVbat
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
static void vbattoa( char* ptr, u16 X )
|
||||||
|
{
|
||||||
|
u8 c;
|
||||||
|
u16 r = 0;
|
||||||
|
|
||||||
|
// 1 000 digit
|
||||||
|
c = ((X-r)/1000);
|
||||||
|
r = r + (c*1000);
|
||||||
|
*ptr++ = c + 0x30;
|
||||||
|
|
||||||
|
// dot
|
||||||
|
*ptr++ = '.';
|
||||||
|
|
||||||
|
// 100 digit
|
||||||
|
c = ((X-r)/100);
|
||||||
|
r = r + (c*100);
|
||||||
|
*ptr++ = c + 0x30;
|
||||||
|
|
||||||
|
// 10 digit
|
||||||
|
c = ((X-r)/10);
|
||||||
|
r = r + (c*10);
|
||||||
|
*ptr++ = c + 0x30;
|
||||||
|
|
||||||
|
// Volt
|
||||||
|
*ptr++ = 'V';
|
||||||
|
*ptr++ = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* DRAW_DisplayStringWithMode
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* This function is used to display a 17char max string of
|
||||||
|
* characters on the LCD display on the selected line.
|
||||||
|
* Note:
|
||||||
|
* this function is the user interface to use the LCD driver.
|
||||||
|
*
|
||||||
|
* @param[in] x The horizontal screen coordinate where to draw the string.
|
||||||
|
* @param[in] y The vertical screen coordinate where to draw the string.
|
||||||
|
* @param[in] ptr Pointer to string to display.
|
||||||
|
* @param[in] len String size.
|
||||||
|
* @param[in] mode Display mode: 0 normal, 1 inverted colors.
|
||||||
|
*
|
||||||
|
* @warning The (0x0) point in on the low left corner.
|
||||||
|
*
|
||||||
|
* @see DRAW_DisplayString
|
||||||
|
* @see DRAW_DisplayStringInverted
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
static void DRAW_DisplayStringWithMode( u8 x, u8 y, const u8* ptr, u8 len, int mode )
|
||||||
|
{
|
||||||
|
u8 ref_x = x, i = 0;
|
||||||
|
|
||||||
|
/* Send the string character by character on LCD */
|
||||||
|
while ((*ptr!=0)&&(i<18))
|
||||||
|
{
|
||||||
|
/* Display one character on LCD */
|
||||||
|
LCD_DisplayChar( ref_x, y, *ptr, mode ? BGndColor : TextColor, mode ? TextColor : BGndColor, CharMagniCoeff );
|
||||||
|
|
||||||
|
/* Increment the column position by 7 */
|
||||||
|
ref_x+= (7*CharMagniCoeff);
|
||||||
|
|
||||||
|
/* Point on the next character */
|
||||||
|
ptr++;
|
||||||
|
|
||||||
|
/* Increment the character counter */
|
||||||
|
i++;
|
||||||
|
/* If we reach the maximum Line character */
|
||||||
|
}
|
||||||
|
|
||||||
|
while ( i < len )
|
||||||
|
{
|
||||||
|
/* Display one character on LCD */
|
||||||
|
LCD_DisplayChar( ref_x, y, ' ', mode ? BGndColor : TextColor, mode ? TextColor : BGndColor, CharMagniCoeff );
|
||||||
|
|
||||||
|
/* Increment the column position by 7 */
|
||||||
|
ref_x += ( 7 * CharMagniCoeff );
|
||||||
|
|
||||||
|
/* Increment the character counter */
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Public functions for CircleOS ---------------------------------------------*/
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* DRAW_Init
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Initialize GUI drawing. Called at CircleOS startup.
|
||||||
|
*
|
||||||
|
* @attention This function must <b>NOT</b> be called by the user.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void DRAW_Init( void )
|
||||||
|
{
|
||||||
|
LCD_Init();
|
||||||
|
#ifdef _MEMS
|
||||||
|
MEMS_GetRotation( &CurrentScreenOrientation );
|
||||||
|
#endif
|
||||||
|
LCD_SetScreenOrientation( CurrentScreenOrientation );
|
||||||
|
|
||||||
|
xBat = 98;
|
||||||
|
yBat = 3;
|
||||||
|
OldBatState = 10;
|
||||||
|
OldTSS = 100;
|
||||||
|
OldTMM = 100;
|
||||||
|
OldTHH = 100;
|
||||||
|
OldTemp = -1;
|
||||||
|
|
||||||
|
// Clear LCD and draw black and white logo
|
||||||
|
DRAW_SetDefaultColor();
|
||||||
|
LCD_FillRect( 0, 0, CHIP_SCREEN_WIDTH, CHIP_SCREEN_HEIGHT, BGndColor );
|
||||||
|
// POINTER_Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Public functions ----------------------------------------------------------*/
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* DRAW_SetCharMagniCoeff
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Set the magnifying value for the characters (should be 1 or 2)
|
||||||
|
*
|
||||||
|
* @param[in] Coeff The new magnifying coefficent.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void DRAW_SetCharMagniCoeff( u16 Coeff )
|
||||||
|
{
|
||||||
|
CharMagniCoeff = Coeff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
*
|
||||||
|
* DRAW_GetCharMagniCoeff
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Return the current magnifying value for the characters
|
||||||
|
*
|
||||||
|
* @return Current magnifying value.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
u16 DRAW_GetCharMagniCoeff( void )
|
||||||
|
{
|
||||||
|
return CharMagniCoeff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
*
|
||||||
|
* DRAW_GetTextColor
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Return current text color.
|
||||||
|
*
|
||||||
|
* @return The current RGB color used to draw text.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
u16 DRAW_GetTextColor( void )
|
||||||
|
{
|
||||||
|
return TextColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* DRAW_SetTextColor
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Set current text color.
|
||||||
|
*
|
||||||
|
* @param[in] Color The new RGB color used when drawing text.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void DRAW_SetTextColor( u16 Color )
|
||||||
|
{
|
||||||
|
TextColor = Color ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* DRAW_GetBGndColor
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Return current background color.
|
||||||
|
*
|
||||||
|
* @return The current RGB color used for the background.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
u16 DRAW_GetBGndColor( void )
|
||||||
|
{
|
||||||
|
return BGndColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* DRAW_SetBGndColor
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Set current background color
|
||||||
|
*
|
||||||
|
* @param[in] Color The new RGB color for background.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void DRAW_SetBGndColor(u16 Color)
|
||||||
|
{
|
||||||
|
BGndColor = Color;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* DRAW_SetImage
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* The provided bitmap is made width * height 2 byte words. Each 2 byte word contains
|
||||||
|
* the RGB color of a pixel.
|
||||||
|
*
|
||||||
|
* @brief Draw a color bitmap at the provided coordinates.
|
||||||
|
* @param[in] imageptr A pointer to an array of width * height 2 byte words.
|
||||||
|
* @param[in] x The horizontal coordinate of the low left corner of the bitmap.
|
||||||
|
* @param[in] y The vertical coordinate of the low left corner of the bitmap.
|
||||||
|
* @param[in] width The bitmap width.
|
||||||
|
* @param[in] height The bitmap height.
|
||||||
|
*
|
||||||
|
* @warning The (0x0) point in on the low left corner.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void DRAW_SetImage( const u16* imageptr, u8 x, u8 y, u8 width, u8 height )
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
// Select screen area to access.
|
||||||
|
LCD_SetRect_For_Cmd( x, y, width, height );
|
||||||
|
|
||||||
|
// Send command to write data on the LCD screen.
|
||||||
|
LCD_SendLCDCmd(ST7637_RAMWR);
|
||||||
|
|
||||||
|
for( i = 0; i < ( width * height ); i++ )
|
||||||
|
{
|
||||||
|
LCD_SendLCDData( imageptr[ i ] & 0xff );
|
||||||
|
LCD_SendLCDData( ( imageptr[ i ] >> 8 ) & 0xff );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* DRAW_DisplayString
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* This function is used to display a 17 character max string of
|
||||||
|
* characters on the LCD display at the provided coordinates.
|
||||||
|
*
|
||||||
|
* @param[in] x The horizontal coordinate of the displayed string.
|
||||||
|
* @param[in] y The vertical coordinate of the display string.
|
||||||
|
* @param[in] *ptr Pointer to the string to display on LCD.
|
||||||
|
* @param[in] len String length.
|
||||||
|
*
|
||||||
|
* @warning The (0x0) point in on the low left corner.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void DRAW_DisplayString( u8 x, u8 y, const u8* ptr, u8 len )
|
||||||
|
{
|
||||||
|
DRAW_DisplayStringWithMode( x, y, ptr, len, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* DRAW_DisplayStringInverted
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* This function is used to display a 17 character max string of
|
||||||
|
* characters on the LCD display at the provided coordinates with inverted colors.
|
||||||
|
*
|
||||||
|
* @param[in] x The horizontal coordinate of the displayed string.
|
||||||
|
* @param[in] y The vertical coordinate of the display string.
|
||||||
|
* @param[in] *ptr Pointer to the string to display on LCD.
|
||||||
|
* @param[in] len String length.
|
||||||
|
*
|
||||||
|
* @warning The (0x0) point in on the low left corner.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void DRAW_DisplayStringInverted( u8 x, u8 y, const u8* ptr, u8 len )
|
||||||
|
{
|
||||||
|
//BackGround and Text Colors are inverted
|
||||||
|
DRAW_DisplayStringWithMode( x, y, ptr, len, 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* DRAW_SetDefaultColor
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Reset text and background colors to their default values.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void DRAW_SetDefaultColor (void)
|
||||||
|
{
|
||||||
|
BGndColor = RGB_WHITE;
|
||||||
|
TextColor = RGB_BLACK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* DRAW_DisplayTemp
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* This function is used to display the current temperature in ascii.
|
||||||
|
* The choice between Celcius and Fahrenheit is fixed by UTIL_SetModeTemp()
|
||||||
|
*
|
||||||
|
* @param[in] x The horizontal coordinate of the displayed string.
|
||||||
|
* @param[in] y The vertical coordinate of the display string.
|
||||||
|
*
|
||||||
|
* @warning The (0x0) point in on the low left corner.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void DRAW_DisplayTemp( u8 x, u8 y )
|
||||||
|
{
|
||||||
|
u32 Temp = 0;
|
||||||
|
u8 TextBuffer[5] = { 0,0,0,0,0};
|
||||||
|
|
||||||
|
// Get Time
|
||||||
|
Temp = UTIL_GetTemp() ;
|
||||||
|
|
||||||
|
if( Temp != OldTemp )
|
||||||
|
{
|
||||||
|
// Display C (if modified).
|
||||||
|
UTIL_uint2str( TextBuffer, Temp/10, 2, 1 );
|
||||||
|
TextBuffer[ 2 ] = '.';
|
||||||
|
DRAW_DisplayString( x + ( 0 * CharMagniCoeff * 7 ), y, TextBuffer, 3 );
|
||||||
|
|
||||||
|
// Display C/10 (if modified).
|
||||||
|
UTIL_uint2str( TextBuffer, Temp%10, 1, 1 );
|
||||||
|
TextBuffer[ 1 ] = fTemperatureInFahrenheit ? 'F' : 'C'; TextBuffer[ 2 ] = 0;
|
||||||
|
DRAW_DisplayString( x + ( 3 * CharMagniCoeff * 7 ), y, TextBuffer, 2 );
|
||||||
|
}
|
||||||
|
OldTemp = Temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* DRAW_Line
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
* Draw a line on the LCD screen. Optimized for horizontal/vertical lines,
|
||||||
|
* and use the Bresenham algorithm for other cases.
|
||||||
|
*
|
||||||
|
* @param[in] x1 The x-coordinate of the first line endpoint.
|
||||||
|
* @param[in] x2 The x-coordinate of the second line endpoint.
|
||||||
|
* @param[in] y1 The y-coordinate of the first line endpoint.
|
||||||
|
* @param[in] y2 The y-coordinate of the second line endpoint.
|
||||||
|
* @param[in] color The line color.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
void DRAW_Line (s16 x1, s16 y1, s16 x2, s16 y2, u16 color )
|
||||||
|
{
|
||||||
|
int i,dx,dy,sdx,sdy,dxabs,dyabs,x,y,px,py;
|
||||||
|
|
||||||
|
#define abs(X) ( ( (X) < 0 ) ? -(X) : (X) )
|
||||||
|
#define sgn(X) ( ( (X) < 0 ) ? -1 : 1 )
|
||||||
|
|
||||||
|
if ( x1==x2 ) //Vertical Line
|
||||||
|
{
|
||||||
|
if ( y1 > y2 ) //We assume y2>y1 and invert if not
|
||||||
|
{
|
||||||
|
i = y2;
|
||||||
|
y2 = y1;
|
||||||
|
y1 = i;
|
||||||
|
}
|
||||||
|
LCD_FillRect( x1, y1, 1, y2-y1+1, color );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if ( y1==y2 ) //Horizontal Line
|
||||||
|
{
|
||||||
|
if ( x1 > x2 ) //We assume x2>x1 and we swap them if not
|
||||||
|
{
|
||||||
|
i = x2;
|
||||||
|
x2 = x1;
|
||||||
|
x1 = i;
|
||||||
|
}
|
||||||
|
LCD_FillRect( x1, y1, x2-x1+1, 1, color );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
dx=x2-x1; /* the horizontal distance of the line */
|
||||||
|
dy=y2-y1; /* the vertical distance of the line */
|
||||||
|
dxabs=abs(dx);
|
||||||
|
dyabs=abs(dy);
|
||||||
|
sdx=sgn(dx);
|
||||||
|
sdy=sgn(dy);
|
||||||
|
x=dyabs>>1;
|
||||||
|
y=dxabs>>1;
|
||||||
|
px=x1;
|
||||||
|
py=y1;
|
||||||
|
|
||||||
|
if (dxabs>=dyabs) /* the line is more horizontal than vertical */
|
||||||
|
{
|
||||||
|
for(i=0;i<dxabs;i++)
|
||||||
|
{
|
||||||
|
y+=dyabs;
|
||||||
|
if (y>=dxabs)
|
||||||
|
{
|
||||||
|
y-=dxabs;
|
||||||
|
py+=sdy;
|
||||||
|
}
|
||||||
|
px+=sdx;
|
||||||
|
LCD_DrawPixel(px,py,color);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else /* the line is more vertical than horizontal */
|
||||||
|
{
|
||||||
|
for(i=0;i<dyabs;i++)
|
||||||
|
{
|
||||||
|
x+=dxabs;
|
||||||
|
if (x>=dyabs)
|
||||||
|
{
|
||||||
|
x-=dyabs;
|
||||||
|
px+=sdx;
|
||||||
|
}
|
||||||
|
py+=sdy;
|
||||||
|
LCD_DrawPixel(px,py,color);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,154 @@
|
|||||||
|
/********************* (C) COPYRIGHT 2007 RAISONANCE S.A.S. *******************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @file lcd.h
|
||||||
|
* @brief The header file for ST7637 driver.
|
||||||
|
* @author IB
|
||||||
|
* @date 07/2007
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef __LCD_H
|
||||||
|
#define __LCD_H
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "stm32f10x_lib.h"
|
||||||
|
|
||||||
|
/* Type def -----------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/* Data lines configuration mode */
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
Input,
|
||||||
|
Output
|
||||||
|
} DataConfigMode_TypeDef;
|
||||||
|
|
||||||
|
/* Constants -----------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/* LCD Control pins */
|
||||||
|
#define CtrlPin_RS GPIO_Pin_8
|
||||||
|
#define CtrlPin_RD GPIO_Pin_9
|
||||||
|
#define CtrlPin_WR GPIO_Pin_10
|
||||||
|
#define CtrlPin_RST GPIO_Pin_12
|
||||||
|
#define LCD_CTRL_PINS (CtrlPin_RS|CtrlPin_RD|CtrlPin_WR|CtrlPin_RST)
|
||||||
|
#define GPIOx_CTRL_LCD GPIOC
|
||||||
|
#define GPIO_LCD_CTRL_PERIPH RCC_APB2Periph_GPIOC
|
||||||
|
|
||||||
|
#define CtrlPin_CS GPIO_Pin_2
|
||||||
|
#define GPIOx_CS_LCD GPIOD
|
||||||
|
#define GPIO_LCD_CS_PERIPH RCC_APB2Periph_GPIOD
|
||||||
|
|
||||||
|
#define LCD_D0 GPIO_Pin_0
|
||||||
|
#define LCD_D1 GPIO_Pin_1
|
||||||
|
#define LCD_D2 GPIO_Pin_2
|
||||||
|
#define LCD_D3 GPIO_Pin_3
|
||||||
|
#define LCD_D4 GPIO_Pin_4
|
||||||
|
#define LCD_D5 GPIO_Pin_5
|
||||||
|
#define LCD_D6 GPIO_Pin_6
|
||||||
|
#define LCD_D7 GPIO_Pin_7
|
||||||
|
#define LCD_DATA_PINS (LCD_D0|LCD_D1|LCD_D2|LCD_D3|LCD_D4|LCD_D5|LCD_D6|LCD_D7)
|
||||||
|
#define GPIOx_D_LCD GPIOC
|
||||||
|
#define GPIO_LCD_D_PERIPH RCC_APB2Periph_GPIOC
|
||||||
|
|
||||||
|
/* LCD Commands */
|
||||||
|
#define DISPLAY_ON 0xAF
|
||||||
|
#define DISPLAY_OFF 0xAE
|
||||||
|
#define START_LINE 0xC0
|
||||||
|
#define START_COLUMN 0x00
|
||||||
|
#define CLOCKWISE_OUTPUT 0xA0
|
||||||
|
#define DYNAMIC_DRIVE 0xA4
|
||||||
|
#define DUTY_CYCLE 0xA9
|
||||||
|
#define READ_MODIFY_WRITE_OFF 0xEE
|
||||||
|
#define SOFTWARE_RESET 0xE2
|
||||||
|
|
||||||
|
#define ST7637_NOP 0x00
|
||||||
|
#define ST7637_SWRESET 0x01
|
||||||
|
#define ST7637_RDDID 0x04
|
||||||
|
#define ST7637_RDDST 0x09
|
||||||
|
#define ST7637_RDDPM 0x0A
|
||||||
|
#define ST7637_RDDMADCTR 0x0B
|
||||||
|
#define ST7637_RDDCOLMOD 0x0C
|
||||||
|
#define ST7637_RDDIM 0x0D
|
||||||
|
#define ST7637_RDDSM 0x0E
|
||||||
|
#define ST7637_RDDSDR 0x0F
|
||||||
|
|
||||||
|
#define ST7637_SLPIN 0x10
|
||||||
|
#define ST7637_SLPOUT 0x11
|
||||||
|
#define ST7637_PTLON 0x12
|
||||||
|
#define ST7637_NORON 0x13
|
||||||
|
|
||||||
|
#define ST7637_INVOFF 0x20
|
||||||
|
#define ST7637_INVON 0x21
|
||||||
|
#define ST7637_APOFF 0x22
|
||||||
|
#define ST7637_APON 0x23
|
||||||
|
#define ST7637_WRCNTR 0x25
|
||||||
|
#define ST7637_DISPOFF 0x28
|
||||||
|
#define ST7637_DISPON 0x29
|
||||||
|
#define ST7637_CASET 0x2A
|
||||||
|
#define ST7637_RASET 0x2B
|
||||||
|
#define ST7637_RAMWR 0x2C
|
||||||
|
#define ST7637_RGBSET 0x2D
|
||||||
|
#define ST7637_RAMRD 0x2E
|
||||||
|
|
||||||
|
#define ST7637_PTLAR 0x30
|
||||||
|
#define ST7637_SCRLAR 0x33
|
||||||
|
#define ST7637_TEOFF 0x34
|
||||||
|
#define ST7637_TEON 0x35
|
||||||
|
#define ST7637_MADCTR 0x36
|
||||||
|
#define ST7637_VSCSAD 0x37
|
||||||
|
#define ST7637_IDMOFF 0x38
|
||||||
|
#define ST7637_IDMON 0x39
|
||||||
|
#define ST7637_COLMOD 0x3A
|
||||||
|
|
||||||
|
#define ST7637_RDID1 0xDA
|
||||||
|
#define ST7637_RDID2 0xDB
|
||||||
|
#define ST7637_RDID3 0xDC
|
||||||
|
|
||||||
|
#define ST7637_DUTYSET 0xB0
|
||||||
|
#define ST7637_FIRSTCOM 0xB1
|
||||||
|
#define ST7637_OSCDIV 0xB3
|
||||||
|
#define ST7637_PTLMOD 0xB4
|
||||||
|
#define ST7637_NLINVSET 0xB5
|
||||||
|
#define ST7637_COMSCANDIR 0xB7
|
||||||
|
#define ST7637_RMWIN 0xB8
|
||||||
|
#define ST7637_RMWOUT 0xB9
|
||||||
|
|
||||||
|
#define ST7637_VOPSET 0xC0
|
||||||
|
#define ST7637_VOPOFSETINC 0xC1
|
||||||
|
#define ST7637_VOPOFSETDEC 0xC2
|
||||||
|
#define ST7637_BIASSEL 0xC3
|
||||||
|
#define ST7637_BSTBMPXSEL 0xC4
|
||||||
|
#define ST7637_BSTEFFSEL 0xC5
|
||||||
|
#define ST7637_VOPOFFSET 0xC7
|
||||||
|
#define ST7637_VGSORCSEL 0xCB
|
||||||
|
|
||||||
|
#define ST7637_ID1SET 0xCC
|
||||||
|
#define ST7637_ID2SET 0xCD
|
||||||
|
#define ST7637_ID3SET 0xCE
|
||||||
|
|
||||||
|
#define ST7637_ANASET 0xD0
|
||||||
|
#define ST7637_AUTOLOADSET 0xD7
|
||||||
|
#define ST7637_RDTSTSTATUS 0xDE
|
||||||
|
|
||||||
|
#define ST7637_EPCTIN 0xE0
|
||||||
|
#define ST7637_EPCTOUT 0xE1
|
||||||
|
#define ST7637_EPMWR 0xE2
|
||||||
|
#define ST7637_EPMRD 0xE3
|
||||||
|
#define ST7637_MTPSEL 0xE4
|
||||||
|
#define ST7637_ROMSET 0xE5
|
||||||
|
#define ST7637_HPMSET 0xEB
|
||||||
|
|
||||||
|
#define ST7637_FRMSEL 0xF0
|
||||||
|
#define ST7637_FRM8SEL 0xF1
|
||||||
|
#define ST7637_TMPRNG 0xF2
|
||||||
|
#define ST7637_TMPHYS 0xF3
|
||||||
|
#define ST7637_TEMPSEL 0xF4
|
||||||
|
#define ST7637_THYS 0xF7
|
||||||
|
#define ST7637_FRAMESET 0xF9
|
||||||
|
|
||||||
|
#define ST7637_MAXCOL 0x83
|
||||||
|
#define ST7637_MAXPAG 0x83
|
||||||
|
|
||||||
|
#endif /*__LCD_H */
|
@ -0,0 +1,210 @@
|
|||||||
|
/********************* (C) COPYRIGHT 2007 RAISONANCE S.A.S. *******************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @file led.c
|
||||||
|
* @brief LED management.
|
||||||
|
* @author IB
|
||||||
|
* @date 07/2007
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "circle.h"
|
||||||
|
|
||||||
|
/// @cond Internal
|
||||||
|
|
||||||
|
/* Private variables ---------------------------------------------------------*/
|
||||||
|
|
||||||
|
int GreenLED_Counter = 0;
|
||||||
|
int RedLED_Counter = 0;
|
||||||
|
enum LED_mode GreenLED_mode = LED_UNDEF;
|
||||||
|
enum LED_mode RedLED_mode = LED_UNDEF;
|
||||||
|
enum LED_mode GreenLED_newmode = LED_OFF;
|
||||||
|
enum LED_mode RedLED_newmode = LED_OFF;
|
||||||
|
const int HalfPeriod_LF = 200;
|
||||||
|
const int HalfPeriod_HF = 50;
|
||||||
|
const int Period_LF = 200 * 2;
|
||||||
|
const int Period_HF = 50 * 2;
|
||||||
|
|
||||||
|
/* Public functions for CircleOS ---------------------------------------------*/
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* LED_Init
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Initialization of the GPIOs for the LEDs
|
||||||
|
*
|
||||||
|
* @note Is called by CircleOS startup.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void LED_Init( void )
|
||||||
|
{
|
||||||
|
GPIO_InitTypeDef GPIO_InitStructure;
|
||||||
|
|
||||||
|
/* Enable LED GPIO clock */
|
||||||
|
RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOB, ENABLE );
|
||||||
|
|
||||||
|
/* Configure LED pins as output push-pull */
|
||||||
|
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8 | GPIO_Pin_9 ;
|
||||||
|
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
|
||||||
|
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||||
|
|
||||||
|
GPIO_Init( GPIOB, &GPIO_InitStructure );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* LED_Handler
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Called by the CircleOS scheduler to manage the states of the LEDs.
|
||||||
|
* LEDs may be on, off or blinking according to their state.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void LED_Handler( void )
|
||||||
|
{
|
||||||
|
LED_Handler_hw(LED_GREEN);
|
||||||
|
LED_Handler_hw(LED_RED);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* LED_Handler
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Called by the CircleOS scheduler to manage the states of the LEDs.
|
||||||
|
* LEDs may be on, off or blinking according to their state.
|
||||||
|
*
|
||||||
|
* @param[in] id A LED_id indicating the LED to take care of.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void LED_Handler_hw( enum LED_id id )
|
||||||
|
{
|
||||||
|
int counter;
|
||||||
|
enum LED_mode mode;
|
||||||
|
|
||||||
|
// Choose the right LED parameters.
|
||||||
|
if( id == LED_GREEN )
|
||||||
|
{
|
||||||
|
counter = GreenLED_Counter;
|
||||||
|
mode = GreenLED_newmode;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
counter = RedLED_Counter;
|
||||||
|
mode = RedLED_newmode;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch( mode )
|
||||||
|
{
|
||||||
|
case LED_OFF :
|
||||||
|
case LED_ON :
|
||||||
|
if( ( ( id == LED_GREEN ) && ( GreenLED_mode == mode ) ) ||
|
||||||
|
( ( id == LED_RED ) && ( RedLED_mode == mode ) ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( id == LED_GREEN )
|
||||||
|
{
|
||||||
|
GPIO_WriteBit( GPIOB, GPIO_Pin_8, ( mode == LED_OFF ) ? Bit_RESET : Bit_SET );
|
||||||
|
|
||||||
|
GreenLED_mode = mode;
|
||||||
|
}
|
||||||
|
else if( id == LED_RED )
|
||||||
|
{
|
||||||
|
GPIO_WriteBit( GPIOB, GPIO_Pin_9, ( mode == LED_OFF ) ? Bit_RESET : Bit_SET );
|
||||||
|
|
||||||
|
RedLED_mode = mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
counter = -1;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LED_BLINKING_HF :
|
||||||
|
counter++;
|
||||||
|
|
||||||
|
if( counter == HalfPeriod_HF )
|
||||||
|
{
|
||||||
|
GPIO_WriteBit( GPIOB, ( id == LED_RED ) ? GPIO_Pin_9 : GPIO_Pin_8, Bit_SET );
|
||||||
|
}
|
||||||
|
else if( ( counter < 0 ) || ( counter >= Period_HF ) )
|
||||||
|
{
|
||||||
|
GPIO_WriteBit( GPIOB, ( id == LED_RED ) ? GPIO_Pin_9 : GPIO_Pin_8, Bit_RESET );
|
||||||
|
|
||||||
|
counter = 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LED_BLINKING_LF :
|
||||||
|
counter++;
|
||||||
|
|
||||||
|
if( counter == HalfPeriod_LF )
|
||||||
|
{
|
||||||
|
GPIO_WriteBit( GPIOB, ( id == LED_RED ) ? GPIO_Pin_9 : GPIO_Pin_8, Bit_SET );
|
||||||
|
}
|
||||||
|
|
||||||
|
else if( ( counter < 0 ) || ( counter >= Period_LF ) )
|
||||||
|
{
|
||||||
|
GPIO_WriteBit( GPIOB, ( id == LED_RED ) ? GPIO_Pin_9 : GPIO_Pin_8, Bit_RESET );
|
||||||
|
|
||||||
|
counter = 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default :
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( id == LED_GREEN )
|
||||||
|
{
|
||||||
|
GreenLED_Counter = counter;
|
||||||
|
GreenLED_mode = mode;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RedLED_Counter = counter;
|
||||||
|
RedLED_mode = mode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @endcond
|
||||||
|
|
||||||
|
/* Public functions ----------------------------------------------------------*/
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* LED_Set
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Set a specified LED in a specified mode.
|
||||||
|
*
|
||||||
|
* @param[in] id A LED_id specifying the LED to change the mode.
|
||||||
|
* @param[in] mode A LED_mode describing the new LED mode.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void LED_Set( enum LED_id id, enum LED_mode mode )
|
||||||
|
{
|
||||||
|
if( id == LED_GREEN )
|
||||||
|
{
|
||||||
|
GreenLED_newmode = mode;
|
||||||
|
}
|
||||||
|
else if( id == LED_RED )
|
||||||
|
{
|
||||||
|
RedLED_newmode = mode;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,605 @@
|
|||||||
|
/********************* (C) COPYRIGHT 2007 RAISONANCE S.A.S. *******************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @file mems.c
|
||||||
|
* @brief Mems Initialization and management
|
||||||
|
* @author FL
|
||||||
|
* @date 07/2007
|
||||||
|
* @version 1.1
|
||||||
|
* @date 10/2007
|
||||||
|
* @version 1.5 various corrections reported by Ron Miller
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "circle.h"
|
||||||
|
|
||||||
|
/// @cond Internal
|
||||||
|
|
||||||
|
/* Private define ------------------------------------------------------------*/
|
||||||
|
#define RDOUTXL 0xE8 /*!< Multiple Read from OUTXL */
|
||||||
|
#define WRCTRL_REG1 0x20 /*!< Single Write CTRL_REG */
|
||||||
|
#define RDCTRL_REG1 0xA0 /*!< Single Read CTRL_REG */
|
||||||
|
#define RDID 0x8F /*!< Single Read WHO_AM_I */
|
||||||
|
#define LOW 0x00 /*!< ChipSelect line low */
|
||||||
|
#define HIGH 0x01 /*!< ChipSelect line high */
|
||||||
|
#define DUMMY_BYTE 0xA5
|
||||||
|
#define MEMS_DIVIDER 1
|
||||||
|
#define MEMS_TESTING_DIVIDER 101
|
||||||
|
#define MARGIN 500
|
||||||
|
#define DELAY_REACT 20
|
||||||
|
#define MIN_REACT 15
|
||||||
|
#define DIV_REACT 10
|
||||||
|
#define GRAD_SHOCK 200000
|
||||||
|
|
||||||
|
/* Private variables ---------------------------------------------------------*/
|
||||||
|
tMEMS_Info MEMS_Info = {0}; // structure definition in circle.h
|
||||||
|
int TestingActive = 0;
|
||||||
|
int StartingFromResetOrShockCounter = 1000;
|
||||||
|
int TimeCounterForDoubleClick = 0;
|
||||||
|
int TimeLastShock = 0;
|
||||||
|
static int divider = 0;
|
||||||
|
static Rotate_H12_V_Match_TypeDef previous_Screen_Orientation;
|
||||||
|
u32 Gradient2;
|
||||||
|
|
||||||
|
//Filtering
|
||||||
|
unsigned N_filtering = 0;
|
||||||
|
|
||||||
|
//Gradient
|
||||||
|
s16 GradX = 0;
|
||||||
|
s16 GradY = 0;
|
||||||
|
s16 GradZ = 0;
|
||||||
|
|
||||||
|
// Pointer move:
|
||||||
|
// each coordinate (X, Y and Z) is described by 3 variables where suffix means:
|
||||||
|
// f = flag to indicate that a move has been done. Cleared by the Ptr Manager when acknowledged.
|
||||||
|
// i = amplitude of the move (Grad / 10)
|
||||||
|
// t = delay to accept the counter reaction
|
||||||
|
int fMovePtrX;
|
||||||
|
int iMovePtrX;
|
||||||
|
int tMovePtrX;
|
||||||
|
int fMovePtrY;
|
||||||
|
int iMovePtrY;
|
||||||
|
int tMovePtrY;
|
||||||
|
int fMovePtrZ;
|
||||||
|
int iMovePtrZ;
|
||||||
|
int tMovePtrZ;
|
||||||
|
|
||||||
|
s16 XInit = 0;
|
||||||
|
s16 YInit = 0;
|
||||||
|
s16 ZInit = 0;
|
||||||
|
|
||||||
|
/* Private function prototypes -----------------------------------------------*/
|
||||||
|
static void MEMS_ChipSelect( u8 State );
|
||||||
|
static u8 MEMS_SendByte( u8 byte );
|
||||||
|
static void MEMS_WriteEnable( void );
|
||||||
|
static u32 MEMS_ReadOutXY( void );
|
||||||
|
static void MEMS_WakeUp( void );
|
||||||
|
|
||||||
|
/* Private functions ---------------------------------------------------------*/
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* MEMS_WakeUp
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
* Wake Up Mems.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
static void MEMS_WakeUp( void )
|
||||||
|
{
|
||||||
|
u8 reg_val;
|
||||||
|
|
||||||
|
/* read RDCTRL_REG1 */
|
||||||
|
|
||||||
|
/* Chip Select low */
|
||||||
|
MEMS_ChipSelect( LOW );
|
||||||
|
|
||||||
|
/* Send "RDCTRL_REG1" instruction */
|
||||||
|
MEMS_SendByte( RDCTRL_REG1 );
|
||||||
|
|
||||||
|
reg_val = MEMS_SendByte( DUMMY_BYTE );
|
||||||
|
|
||||||
|
/* Chip Select high */
|
||||||
|
MEMS_ChipSelect( HIGH );
|
||||||
|
|
||||||
|
/* SET P0:P1 to '11' */
|
||||||
|
/* 0xC0 to wake up and 0x30 for full speed frequency (640 Hz). */
|
||||||
|
reg_val = reg_val | 0xC0 | 0x30;
|
||||||
|
|
||||||
|
/* Chip Select low */
|
||||||
|
MEMS_ChipSelect( LOW );
|
||||||
|
|
||||||
|
/* Send "WRCTRL_REG1" instruction */
|
||||||
|
MEMS_SendByte( WRCTRL_REG1 );
|
||||||
|
MEMS_SendByte( reg_val );
|
||||||
|
|
||||||
|
/* Chip Select high */
|
||||||
|
MEMS_ChipSelect( HIGH );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* MEMS_ReadOutXY
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
* Reads X and Y Out.
|
||||||
|
*
|
||||||
|
* @return An unsigned 32 bit word with the highest 16 bits containing the Y
|
||||||
|
* and the lowest 16 bits the X.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
static u32 MEMS_ReadOutXY( void )
|
||||||
|
{
|
||||||
|
u8 OutXL;
|
||||||
|
u8 OutXH;
|
||||||
|
u8 OutYL;
|
||||||
|
u8 OutYH;
|
||||||
|
u8 OutZL;
|
||||||
|
u8 OutZH;
|
||||||
|
|
||||||
|
/* Chip Select low */
|
||||||
|
MEMS_ChipSelect( LOW );
|
||||||
|
|
||||||
|
/* Send "RDOUTXL" instruction */
|
||||||
|
MEMS_SendByte( RDOUTXL );
|
||||||
|
|
||||||
|
/* Read a byte */
|
||||||
|
OutXL = MEMS_SendByte( DUMMY_BYTE );
|
||||||
|
|
||||||
|
/* Read a byte */
|
||||||
|
OutXH = MEMS_SendByte( DUMMY_BYTE );
|
||||||
|
|
||||||
|
/* Read a byte */
|
||||||
|
OutYL = MEMS_SendByte( DUMMY_BYTE );
|
||||||
|
|
||||||
|
/* Read a byte */
|
||||||
|
OutYH = MEMS_SendByte( DUMMY_BYTE );
|
||||||
|
|
||||||
|
/* Read a byte */
|
||||||
|
OutZL = MEMS_SendByte( DUMMY_BYTE );
|
||||||
|
|
||||||
|
/* Read a byte */
|
||||||
|
OutZH = MEMS_SendByte( DUMMY_BYTE );
|
||||||
|
|
||||||
|
MEMS_Info.OutX = OutXL + ( OutXH << 8 );
|
||||||
|
MEMS_Info.OutY = OutYL + ( OutYH << 8 );
|
||||||
|
MEMS_Info.OutZ = OutZL + ( OutZH << 8 );
|
||||||
|
|
||||||
|
/* Chip Select high */
|
||||||
|
MEMS_ChipSelect( HIGH );
|
||||||
|
|
||||||
|
MEMS_Info.OutX_F4 += ( MEMS_Info.OutX - ( MEMS_Info.OutX_F4 >> 2 ) ); // Filter on 4 values.
|
||||||
|
MEMS_Info.OutY_F4 += ( MEMS_Info.OutY - ( MEMS_Info.OutY_F4 >> 2 ) ); // Filter on 4 values.
|
||||||
|
MEMS_Info.OutZ_F4 += ( MEMS_Info.OutZ - ( MEMS_Info.OutZ_F4 >> 2 ) ); // Filter on 4 values.
|
||||||
|
|
||||||
|
MEMS_Info.OutX_F16 += ( MEMS_Info.OutX - ( MEMS_Info.OutX_F16 >> 4 ) ); // Filter on 16 values.
|
||||||
|
MEMS_Info.OutY_F16 += ( MEMS_Info.OutY - ( MEMS_Info.OutY_F16 >> 4 ) ); // Filter on 16 values.
|
||||||
|
MEMS_Info.OutZ_F16 += ( MEMS_Info.OutZ - ( MEMS_Info.OutZ_F16 >> 4 ) ); // Filter on 16 values.
|
||||||
|
|
||||||
|
MEMS_Info.OutX_F64 += ( MEMS_Info.OutX - ( MEMS_Info.OutX_F64 >> 6 ) ); // Filter on 64 values.
|
||||||
|
MEMS_Info.OutY_F64 += ( MEMS_Info.OutY - ( MEMS_Info.OutY_F64 >> 6 ) ); // Filter on 64 values.
|
||||||
|
MEMS_Info.OutZ_F64 += ( MEMS_Info.OutZ - ( MEMS_Info.OutZ_F64 >> 6 ) ); // Filter on 64 values.
|
||||||
|
|
||||||
|
MEMS_Info.OutX_F256 += ( MEMS_Info.OutX - ( MEMS_Info.OutX_F256 >> 8) ); // Filter on 256 values.
|
||||||
|
MEMS_Info.OutY_F256 += ( MEMS_Info.OutY - ( MEMS_Info.OutY_F256 >> 8) ); // Filter on 256 values.
|
||||||
|
MEMS_Info.OutZ_F256 += ( MEMS_Info.OutZ - ( MEMS_Info.OutZ_F256 >> 8) ); // Filter on 256 values.
|
||||||
|
|
||||||
|
if( N_filtering < 256 )
|
||||||
|
{
|
||||||
|
// Just to validate the calculated average values.
|
||||||
|
N_filtering++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ( MEMS_Info.OutX + ( MEMS_Info.OutY << 16 ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* MEMS_ChipSelect
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
* Selects or deselects the MEMS device.
|
||||||
|
*
|
||||||
|
* @param[in] State Level to be applied on ChipSelect pin.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
static void MEMS_ChipSelect( u8 State )
|
||||||
|
{
|
||||||
|
/* Set High or low the chip select line on PA.4 pin */
|
||||||
|
GPIO_WriteBit( GPIOD, GPIO_Pin_2, (BitAction)State );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* MEMS_SendByte
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
* Sends a byte through the SPI interface and return the byte received from
|
||||||
|
* the SPI bus.
|
||||||
|
*
|
||||||
|
* @param[in] byte The byte to send to the SPI interface.
|
||||||
|
*
|
||||||
|
* @return The byte returned by the SPI bus.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
static u8 MEMS_SendByte( u8 byte )
|
||||||
|
{
|
||||||
|
/* Loop while DR register in not emplty */
|
||||||
|
while( SPI_GetFlagStatus( SPI2, SPI_FLAG_TXE ) == RESET );
|
||||||
|
|
||||||
|
/* Send byte through the SPI2 peripheral */
|
||||||
|
SPI_SendData( SPI2, byte );
|
||||||
|
|
||||||
|
/* Wait to receive a byte */
|
||||||
|
while( SPI_GetFlagStatus( SPI2, SPI_FLAG_RXNE ) == RESET );
|
||||||
|
|
||||||
|
/* Return the byte read from the SPI bus */
|
||||||
|
return SPI_ReceiveData( SPI2 );
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Public functions for CircleOS ---------------------------------------------*/
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* MEMS_Init
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Initializes the peripherals used by the SPI MEMS driver.
|
||||||
|
*
|
||||||
|
* @attention This function must <b>NOT</b> be called by the user.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void MEMS_Init(void)
|
||||||
|
{
|
||||||
|
SPI_InitTypeDef SPI_InitStructure;
|
||||||
|
GPIO_InitTypeDef GPIO_InitStructure;
|
||||||
|
|
||||||
|
/* Configure PC6 and PC7 as Output push-pull For MEMS*/
|
||||||
|
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7;
|
||||||
|
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||||
|
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
|
||||||
|
|
||||||
|
GPIO_Init( GPIOC, &GPIO_InitStructure );
|
||||||
|
|
||||||
|
/* Enable SPI2 and GPIOA clocks */
|
||||||
|
RCC_APB1PeriphClockCmd( RCC_APB1Periph_SPI2, ENABLE );
|
||||||
|
RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOB, ENABLE );
|
||||||
|
RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOD, ENABLE );
|
||||||
|
|
||||||
|
/* Configure SPI2 pins: SCK, MISO and MOSI */
|
||||||
|
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13 | GPIO_Pin_14 | GPIO_Pin_15;
|
||||||
|
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||||
|
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
|
||||||
|
|
||||||
|
GPIO_Init( GPIOB, &GPIO_InitStructure );
|
||||||
|
|
||||||
|
/* Configure PD2 as Output push-pull, used as MEMS Chip select */
|
||||||
|
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2;
|
||||||
|
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||||
|
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
|
||||||
|
|
||||||
|
GPIO_Init( GPIOD, &GPIO_InitStructure );
|
||||||
|
|
||||||
|
/* SPI2 configuration */
|
||||||
|
SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex;
|
||||||
|
SPI_InitStructure.SPI_Mode = SPI_Mode_Master;
|
||||||
|
SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b;
|
||||||
|
SPI_InitStructure.SPI_CPOL = SPI_CPOL_High;
|
||||||
|
SPI_InitStructure.SPI_CPHA = SPI_CPHA_2Edge;
|
||||||
|
SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;
|
||||||
|
SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_256;
|
||||||
|
SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;
|
||||||
|
SPI_InitStructure.SPI_CRCPolynomial = 7;
|
||||||
|
|
||||||
|
SPI_Init( SPI2, &SPI_InitStructure );
|
||||||
|
|
||||||
|
/* Enable SPI2 */
|
||||||
|
SPI_Cmd( SPI2, ENABLE );
|
||||||
|
|
||||||
|
if( MEMS_ReadID() != 0x3A )
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
// Try to resynchronize
|
||||||
|
for( i = 0 ; i < 17 ; i++ )
|
||||||
|
{
|
||||||
|
/* Configure SPI2 pins: SCK, MISO and MOSI */
|
||||||
|
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13 | GPIO_Pin_15;
|
||||||
|
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||||
|
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
|
||||||
|
|
||||||
|
GPIO_Init( GPIOB, &GPIO_InitStructure );
|
||||||
|
GPIO_WriteBit( GPIOB, GPIO_Pin_15, HIGH );
|
||||||
|
MEMS_ChipSelect( LOW );
|
||||||
|
|
||||||
|
GPIO_WriteBit( GPIOB, GPIO_Pin_13, LOW );
|
||||||
|
GPIO_WriteBit( GPIOB, GPIO_Pin_13, HIGH );
|
||||||
|
MEMS_ChipSelect( HIGH );
|
||||||
|
|
||||||
|
/* Configure again PB. SCK as SPI2 pin */
|
||||||
|
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13 | GPIO_Pin_15;
|
||||||
|
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||||
|
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
|
||||||
|
|
||||||
|
GPIO_Init( GPIOB, &GPIO_InitStructure );
|
||||||
|
if ( MEMS_ReadID() == 0x3A )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( i == 17 )
|
||||||
|
{
|
||||||
|
DRAW_DisplayString( 1, 50, "Test MEM ID Failed", 17 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Read for the first time */
|
||||||
|
N_filtering = 0;
|
||||||
|
|
||||||
|
MEMS_ReadOutXY();
|
||||||
|
|
||||||
|
MEMS_Info.OutX_F4 = MEMS_Info.OutX_F16 = MEMS_Info.OutX_F64 = MEMS_Info.OutX_F256 = MEMS_Info.OutX;
|
||||||
|
MEMS_Info.OutY_F4 = MEMS_Info.OutY_F16 = MEMS_Info.OutY_F64 = MEMS_Info.OutY_F256 = MEMS_Info.OutY;
|
||||||
|
MEMS_Info.OutZ_F4 = MEMS_Info.OutZ_F16 = MEMS_Info.OutZ_F64 = MEMS_Info.OutZ_F256 = MEMS_Info.OutZ;
|
||||||
|
|
||||||
|
/* Init X and Y*/
|
||||||
|
MEMS_GetPosition( &XInit, &YInit );
|
||||||
|
|
||||||
|
/* Wake Up Mems*/
|
||||||
|
MEMS_WakeUp();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* MEMS_Handler
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Called by the CircleOS scheduler to manage the MEMS. The Circle beeps if the
|
||||||
|
* MEMS is shocked.
|
||||||
|
*
|
||||||
|
* @attention This function must <b>NOT</b> be called by the user.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void MEMS_Handler( void )
|
||||||
|
{
|
||||||
|
char buffer [20];
|
||||||
|
int i;
|
||||||
|
int ofs_disp = 0;
|
||||||
|
|
||||||
|
if( StartingFromResetOrShockCounter )
|
||||||
|
{
|
||||||
|
StartingFromResetOrShockCounter--;
|
||||||
|
}
|
||||||
|
TimeCounterForDoubleClick++;
|
||||||
|
|
||||||
|
MEMS_ReadOutXY();
|
||||||
|
|
||||||
|
// Evaluate gradients
|
||||||
|
GradX = ( MEMS_Info.OutX_F4 >> 2 ) - MEMS_Info.OutX;
|
||||||
|
GradY = ( MEMS_Info.OutY_F4 >> 2 ) - MEMS_Info.OutY;
|
||||||
|
GradZ = ( MEMS_Info.OutZ_F4 >> 2 ) - MEMS_Info.OutZ;
|
||||||
|
|
||||||
|
// Decide whether a direction is selected
|
||||||
|
if( tMovePtrX == 0 )
|
||||||
|
{
|
||||||
|
if( ( GradX > MIN_REACT ) || ( GradX < -MIN_REACT ) )
|
||||||
|
{
|
||||||
|
iMovePtrX = GradX / DIV_REACT;
|
||||||
|
tMovePtrX = DELAY_REACT;
|
||||||
|
fMovePtrX = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tMovePtrX--;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( tMovePtrY == 0 )
|
||||||
|
{
|
||||||
|
if( ( GradY > MIN_REACT ) || ( GradY < -MIN_REACT ) )
|
||||||
|
{
|
||||||
|
iMovePtrY = GradY / DIV_REACT; //FL071012 rrm fix
|
||||||
|
tMovePtrY = DELAY_REACT;
|
||||||
|
fMovePtrY = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tMovePtrY--;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( tMovePtrZ==0 )
|
||||||
|
{
|
||||||
|
if( ( GradZ > MIN_REACT ) || ( GradY < -MIN_REACT ) )
|
||||||
|
{
|
||||||
|
iMovePtrZ = GradZ / DIV_REACT;
|
||||||
|
tMovePtrZ = DELAY_REACT;
|
||||||
|
fMovePtrZ = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tMovePtrZ--;
|
||||||
|
}
|
||||||
|
|
||||||
|
Gradient2 = (s32)GradX * (s32)GradX + (s32)GradY * (s32)GradY + (s32)GradZ * (s32)GradZ;
|
||||||
|
|
||||||
|
// MEMS is shocked, let's beep!
|
||||||
|
if( ( Gradient2 > GRAD_SHOCK ) && ( BUZZER_GetMode() == BUZZER_OFF ) && ( StartingFromResetOrShockCounter == 0 ) )
|
||||||
|
{
|
||||||
|
MEMS_Info.Shocked++;
|
||||||
|
/*FL071007 = 1;
|
||||||
|
Suggested by Bob Seabrook: a further posiblity is to increment Shocked rather than just setting it
|
||||||
|
So it can still be tested for non zero as before but one can get more
|
||||||
|
info from the int without extra cost. */
|
||||||
|
|
||||||
|
#define DELAY_BETWEEN_TWO_SHOCK 20
|
||||||
|
#define MAX_DELAY_FOR_DOUBLECLICK 150
|
||||||
|
StartingFromResetOrShockCounter = DELAY_BETWEEN_TWO_SHOCK; //< filter: short delay before detecting the next shock
|
||||||
|
if ( (TimeCounterForDoubleClick - TimeLastShock) < MAX_DELAY_FOR_DOUBLECLICK )
|
||||||
|
{
|
||||||
|
MEMS_Info.DoubleClick++;
|
||||||
|
TimeLastShock = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TimeLastShock = TimeCounterForDoubleClick;
|
||||||
|
}
|
||||||
|
BUZZER_SetMode( BUZZER_SHORTBEEP );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* MEMS_ReadID
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
* Reads SPI chip identification.
|
||||||
|
*
|
||||||
|
* @return The SPI chip identification.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
u8 MEMS_ReadID( void )
|
||||||
|
{
|
||||||
|
u8 Temp = 0;
|
||||||
|
|
||||||
|
/* Chip Select low */
|
||||||
|
MEMS_ChipSelect( LOW );
|
||||||
|
|
||||||
|
/* Send "RDID" instruction */
|
||||||
|
MEMS_SendByte( RDID );
|
||||||
|
|
||||||
|
/* Read a byte from the MEMS */
|
||||||
|
Temp = MEMS_SendByte( DUMMY_BYTE );
|
||||||
|
|
||||||
|
/* Chip Select low */
|
||||||
|
MEMS_ChipSelect( HIGH );
|
||||||
|
|
||||||
|
return Temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @endcond
|
||||||
|
|
||||||
|
/* Public functions ----------------------------------------------------------*/
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* MEMS_GetPosition
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Returns the current (relative) position of the Primer.
|
||||||
|
* Only X-Y axis are considered here.
|
||||||
|
*
|
||||||
|
* @param[out] pX Current horizontal coordinate.
|
||||||
|
* @param[out] pY Current vertical coordinate.
|
||||||
|
*
|
||||||
|
* @warning The (0x0) point in on the low left corner.
|
||||||
|
* @note For absolute position information use MEMS_GetInfo()
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void MEMS_GetPosition( s16* pX, s16* pY )
|
||||||
|
{
|
||||||
|
*pX = MEMS_Info.OutX - XInit;
|
||||||
|
*pY = MEMS_Info.OutY - YInit;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* MEMS_GetRotation
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Returns current screen orientation.
|
||||||
|
*
|
||||||
|
* @param[out] pH12 Current screen orientation.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void MEMS_GetRotation( Rotate_H12_V_Match_TypeDef* pH12 )
|
||||||
|
{
|
||||||
|
s16 sX = MEMS_Info.OutX;
|
||||||
|
s16 sY = MEMS_Info.OutY;
|
||||||
|
|
||||||
|
if( ( ( sX <= -MARGIN ) && ( sY <= 0 ) && (sX<=sY ) ) ||
|
||||||
|
( ( sX <=- MARGIN ) && ( sY > 0) && (sX <= (-sY ) ) ) )
|
||||||
|
{
|
||||||
|
// 1st case: x<0, |x|>y => H12 = V9
|
||||||
|
*pH12 = V9;
|
||||||
|
}
|
||||||
|
else if( ( ( sY <= -MARGIN ) && ( sX <= 0 ) && ( sY <= sX ) ) ||
|
||||||
|
( ( sY <= -MARGIN ) && ( sX > 0 ) && ( sY <= (-sX ) ) ) )
|
||||||
|
{
|
||||||
|
// 2nd case: y<0, |y|>x => H12 = V12
|
||||||
|
*pH12 = V12;
|
||||||
|
}
|
||||||
|
else if( ( ( sX >= MARGIN ) && ( sY <= 0 ) && ( sX >= (-sY) ) ) ||
|
||||||
|
( ( sX >= MARGIN ) && ( sY > 0 ) && ( sX >= sY ) ) )
|
||||||
|
{
|
||||||
|
// 3rd case: x>0, |x|>y => H12=V3
|
||||||
|
*pH12 = V3;
|
||||||
|
}
|
||||||
|
else if( ( ( sY >= MARGIN ) && ( sX <= 0 ) && ( sY >= (-sX ) ) ) ||
|
||||||
|
( ( sY >= MARGIN ) && ( sX > 0 ) && ( sY >= sX ) ) )
|
||||||
|
{
|
||||||
|
// 4th case: y>0, |y|>x => H12=V6
|
||||||
|
*pH12 = V6;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* MEMS_SetNeutral
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Set current position as "neutral position".
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void MEMS_SetNeutral( void )
|
||||||
|
{
|
||||||
|
// Set Neutral position.
|
||||||
|
MEMS_GetPosition( &XInit, &YInit );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* MEMS_GetInfo
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Return the current MEMS information (state, absolute position...).
|
||||||
|
*
|
||||||
|
* @return a pointer to tMEMS_Info
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
tMEMS_Info* MEMS_GetInfo( void )
|
||||||
|
{
|
||||||
|
return &MEMS_Info;
|
||||||
|
}
|
@ -0,0 +1,901 @@
|
|||||||
|
/********************* (C) COPYRIGHT 2007 RAISONANCE S.A.S. *******************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @file pointer.c
|
||||||
|
* @brief Various utilities for the pointer management for STM32-primer.
|
||||||
|
* @author FL
|
||||||
|
* @date 07/2007
|
||||||
|
* @version 1.1
|
||||||
|
* @date 10/2007
|
||||||
|
* @version 1.5 various corrections reported by Ron Miller to suppress jittery
|
||||||
|
*
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "circle.h"
|
||||||
|
|
||||||
|
/// @cond Internal
|
||||||
|
|
||||||
|
/* Private define ------------------------------------------------------------*/
|
||||||
|
#define POS_MIN 0
|
||||||
|
#define POS_MAX (SCREEN_WIDTH - POINTER_WIDTH - 1)
|
||||||
|
#define POINTER_DIVIDER 50
|
||||||
|
#define POINTER_DEFAULT_COLOR RGB_BLUE
|
||||||
|
|
||||||
|
// defines for pointer move
|
||||||
|
#define ANGLEPAUSE 500
|
||||||
|
#define DEFAULT_ANGLESTART 25
|
||||||
|
#define MIN_ANGLE_FOR_SHIFT_UP (ANGLEPAUSE+CurrentAngleStart)
|
||||||
|
#define MIN_ANGLE_FOR_SHIFT_DOWN (ANGLEPAUSE-CurrentAngleStart)
|
||||||
|
#define MIN_ANGLE_FOR_SHIFT_RIGHT (signed)(0+CurrentAngleStart)
|
||||||
|
#define MIN_ANGLE_FOR_SHIFT_LEFT (signed)(0-CurrentAngleStart)
|
||||||
|
#define DEFAULT_SPEED_ON_ANGLE 60
|
||||||
|
|
||||||
|
/* Private variables ---------------------------------------------------------*/
|
||||||
|
static int divider = 0;
|
||||||
|
|
||||||
|
unsigned char BallPointerBmp[ POINTER_WIDTH ] = { 0x38, 0x7C, 0xFF, 0xFF, 0xFF, 0x7C, 0x38 } ;
|
||||||
|
unsigned char locbuf[ POINTER_WIDTH ];
|
||||||
|
unsigned char DefaultAreaStore[ 2 * POINTER_WIDTH * POINTER_WIDTH ];
|
||||||
|
|
||||||
|
// Variables for pointer.
|
||||||
|
u8* CurrentPointerBmp = 0;
|
||||||
|
u8 CurrentPointerWidth = 0;
|
||||||
|
u8 CurrentPointerHeight = 0;
|
||||||
|
u16 CurrentSpeedOnAngle = DEFAULT_SPEED_ON_ANGLE;
|
||||||
|
u32 CurrentAngleStart = DEFAULT_ANGLESTART ;
|
||||||
|
unsigned char* ptrAreaStore = DefaultAreaStore;
|
||||||
|
u16 CurrentPointerColor = POINTER_DEFAULT_COLOR;
|
||||||
|
enum POINTER_mode Pointer_Mode = POINTER_UNDEF;
|
||||||
|
enum POINTER_state Pointer_State = POINTER_S_UNDEF;
|
||||||
|
|
||||||
|
s16 OUT_X;
|
||||||
|
s16 OUT_Y;
|
||||||
|
|
||||||
|
// Init pointer Info Structure (structure definition in circle.h)
|
||||||
|
tPointer_Info POINTER_Info = {
|
||||||
|
SCREEN_WIDTH - POINTER_WIDTH / 2,
|
||||||
|
SCREEN_WIDTH - POINTER_WIDTH / 2,
|
||||||
|
0,
|
||||||
|
0} ;
|
||||||
|
|
||||||
|
/* Private function prototypes -----------------------------------------------*/
|
||||||
|
static int POINTER_Move ( void );
|
||||||
|
|
||||||
|
/* Private functions ---------------------------------------------------------*/
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* Pointer_Move
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
* Moves LCD pointer according to Mems indications.
|
||||||
|
*
|
||||||
|
* @retval 0 The pointer resides in the screen
|
||||||
|
* @retval -1 The pointer touche the screen edges.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
static int POINTER_Move( void )
|
||||||
|
{
|
||||||
|
int res = 0;
|
||||||
|
s16 oldPointer_xPos = POINTER_Info.xPos;
|
||||||
|
s16 oldPointer_yPos = POINTER_Info.yPos;
|
||||||
|
s16 unmodied_shift_PosX;
|
||||||
|
s16 unmodied_shift_PosY;
|
||||||
|
signed outx = MEMS_Info.OutX_F16 >> 4;
|
||||||
|
signed outy = MEMS_Info.OutY_F16 >> 4;
|
||||||
|
|
||||||
|
POINTER_Info.shift_PosX = POINTER_Info.shift_PosY = 0;
|
||||||
|
|
||||||
|
// The move depends on the screen orientation
|
||||||
|
switch( LCD_GetScreenOrientation() )
|
||||||
|
{
|
||||||
|
// north
|
||||||
|
case V12 :
|
||||||
|
MEMS_Info.RELATIVE_X = outx;
|
||||||
|
MEMS_Info.RELATIVE_Y = outy;
|
||||||
|
|
||||||
|
if( outx > MIN_ANGLE_FOR_SHIFT_RIGHT )
|
||||||
|
{
|
||||||
|
POINTER_Info.shift_PosX = ( outx - MIN_ANGLE_FOR_SHIFT_RIGHT );
|
||||||
|
}
|
||||||
|
else if( outx < MIN_ANGLE_FOR_SHIFT_LEFT )
|
||||||
|
{
|
||||||
|
POINTER_Info.shift_PosX = ( outx - MIN_ANGLE_FOR_SHIFT_LEFT );
|
||||||
|
}
|
||||||
|
|
||||||
|
if( outy < -MIN_ANGLE_FOR_SHIFT_UP )
|
||||||
|
{
|
||||||
|
POINTER_Info.shift_PosY = ( outy + MIN_ANGLE_FOR_SHIFT_UP );
|
||||||
|
}
|
||||||
|
else if( outy > -MIN_ANGLE_FOR_SHIFT_DOWN )
|
||||||
|
{
|
||||||
|
POINTER_Info.shift_PosY = ( outy + MIN_ANGLE_FOR_SHIFT_DOWN );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
// West
|
||||||
|
case V9 :
|
||||||
|
MEMS_Info.RELATIVE_X = -( outy );
|
||||||
|
MEMS_Info.RELATIVE_Y = outx;
|
||||||
|
|
||||||
|
if( outy > MIN_ANGLE_FOR_SHIFT_RIGHT )
|
||||||
|
{
|
||||||
|
POINTER_Info.shift_PosX = -( outy - MIN_ANGLE_FOR_SHIFT_RIGHT );
|
||||||
|
}
|
||||||
|
else if( outy < MIN_ANGLE_FOR_SHIFT_LEFT )
|
||||||
|
{
|
||||||
|
POINTER_Info.shift_PosX = -( outy - MIN_ANGLE_FOR_SHIFT_LEFT );
|
||||||
|
}
|
||||||
|
|
||||||
|
if( outx < -MIN_ANGLE_FOR_SHIFT_UP )
|
||||||
|
{
|
||||||
|
POINTER_Info.shift_PosY = ( outx + MIN_ANGLE_FOR_SHIFT_UP );
|
||||||
|
}
|
||||||
|
else if( outx > -MIN_ANGLE_FOR_SHIFT_DOWN )
|
||||||
|
{
|
||||||
|
POINTER_Info.shift_PosY = ( outx + MIN_ANGLE_FOR_SHIFT_DOWN );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
// South
|
||||||
|
case V6 :
|
||||||
|
MEMS_Info.RELATIVE_X = -( outx );
|
||||||
|
MEMS_Info.RELATIVE_Y = -( outy );
|
||||||
|
|
||||||
|
if( outx > MIN_ANGLE_FOR_SHIFT_RIGHT )
|
||||||
|
{
|
||||||
|
POINTER_Info.shift_PosX = ( MIN_ANGLE_FOR_SHIFT_RIGHT - outx );
|
||||||
|
}
|
||||||
|
else if( outx < MIN_ANGLE_FOR_SHIFT_LEFT )
|
||||||
|
{
|
||||||
|
POINTER_Info.shift_PosX = ( MIN_ANGLE_FOR_SHIFT_LEFT - outx );
|
||||||
|
}
|
||||||
|
|
||||||
|
if( outy > MIN_ANGLE_FOR_SHIFT_UP )
|
||||||
|
{
|
||||||
|
POINTER_Info.shift_PosY = -( outy - MIN_ANGLE_FOR_SHIFT_UP );
|
||||||
|
}
|
||||||
|
else if( outy < MIN_ANGLE_FOR_SHIFT_DOWN )
|
||||||
|
{
|
||||||
|
POINTER_Info.shift_PosY = +( MIN_ANGLE_FOR_SHIFT_DOWN - outy );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
// East
|
||||||
|
case V3 :
|
||||||
|
MEMS_Info.RELATIVE_X = outy;
|
||||||
|
MEMS_Info.RELATIVE_Y = -( outx );
|
||||||
|
|
||||||
|
if( outy > MIN_ANGLE_FOR_SHIFT_RIGHT )
|
||||||
|
{
|
||||||
|
POINTER_Info.shift_PosX = ( outy - MIN_ANGLE_FOR_SHIFT_RIGHT );
|
||||||
|
}
|
||||||
|
else if( outy < MIN_ANGLE_FOR_SHIFT_LEFT )
|
||||||
|
{
|
||||||
|
POINTER_Info.shift_PosX = ( outy - MIN_ANGLE_FOR_SHIFT_LEFT );
|
||||||
|
}
|
||||||
|
|
||||||
|
if( outx > MIN_ANGLE_FOR_SHIFT_UP )
|
||||||
|
{
|
||||||
|
POINTER_Info.shift_PosY = ( MIN_ANGLE_FOR_SHIFT_UP - outx);
|
||||||
|
}
|
||||||
|
else if( outx < MIN_ANGLE_FOR_SHIFT_DOWN )
|
||||||
|
{
|
||||||
|
POINTER_Info.shift_PosY = ( MIN_ANGLE_FOR_SHIFT_DOWN - outx );
|
||||||
|
}
|
||||||
|
|
||||||
|
default :
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
unmodied_shift_PosX = POINTER_Info.shift_PosX;
|
||||||
|
unmodied_shift_PosY = POINTER_Info.shift_PosY;
|
||||||
|
|
||||||
|
POINTER_Info.shift_PosX /= CurrentSpeedOnAngle;
|
||||||
|
POINTER_Info.shift_PosY /= CurrentSpeedOnAngle;
|
||||||
|
|
||||||
|
if( Pointer_Mode == POINTER_APPLICATION )
|
||||||
|
{
|
||||||
|
if ( Application_Pointer_Mgr )
|
||||||
|
{
|
||||||
|
Application_Pointer_Mgr( POINTER_Info.shift_PosX, POINTER_Info.shift_PosY );
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
POINTER_Info.xPos += POINTER_Info.shift_PosX;
|
||||||
|
POINTER_Info.yPos += POINTER_Info.shift_PosY;
|
||||||
|
|
||||||
|
if( POINTER_Info.xPos < POINTER_Info.X_PosMin )
|
||||||
|
{
|
||||||
|
POINTER_Info.xPos = POINTER_Info.X_PosMin;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( POINTER_Info.xPos > POINTER_Info.X_PosMax )
|
||||||
|
{
|
||||||
|
POINTER_Info.xPos = POINTER_Info.X_PosMax;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( POINTER_Info.yPos < POINTER_Info.Y_PosMin )
|
||||||
|
{
|
||||||
|
POINTER_Info.yPos = POINTER_Info.Y_PosMin;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( POINTER_Info.yPos > POINTER_Info.Y_PosMax )
|
||||||
|
{
|
||||||
|
POINTER_Info.yPos = POINTER_Info.Y_PosMax;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ( Pointer_Mode != POINTER_MENU ) && ( Pointer_Mode != POINTER_RESTORE_LESS ) &&
|
||||||
|
( ( oldPointer_xPos != POINTER_Info.xPos ) || ( oldPointer_yPos != POINTER_Info.yPos ) ) )
|
||||||
|
{
|
||||||
|
// Use default area.
|
||||||
|
POINTER_SetCurrentAreaStore( 0 );
|
||||||
|
|
||||||
|
// Restore previously drawn area.
|
||||||
|
POINTER_Restore( oldPointer_xPos, oldPointer_yPos, POINTER_WIDTH, POINTER_WIDTH );
|
||||||
|
|
||||||
|
// Save new area and draw pointer
|
||||||
|
POINTER_Save( POINTER_Info.xPos, POINTER_Info.yPos, POINTER_WIDTH, POINTER_WIDTH );
|
||||||
|
POINTER_Draw( POINTER_Info.xPos, POINTER_Info.yPos, POINTER_WIDTH, POINTER_WIDTH, CurrentPointerBmp );
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ( Pointer_Mode == POINTER_RESTORE_LESS ) &&
|
||||||
|
( ( oldPointer_xPos != POINTER_Info.xPos ) || ( oldPointer_yPos != POINTER_Info.yPos ) ) )
|
||||||
|
{
|
||||||
|
// Use default area.
|
||||||
|
POINTER_SetCurrentAreaStore( 0 );
|
||||||
|
|
||||||
|
// Restore previously drawn area.
|
||||||
|
POINTER_Restore( oldPointer_xPos, oldPointer_yPos, CurrentPointerWidth, CurrentPointerHeight );
|
||||||
|
|
||||||
|
// Save new area and draw pointer
|
||||||
|
POINTER_Save( POINTER_Info.xPos, POINTER_Info.yPos, CurrentPointerWidth, CurrentPointerHeight );
|
||||||
|
POINTER_Draw( POINTER_Info.xPos, POINTER_Info.yPos, CurrentPointerWidth, CurrentPointerHeight, CurrentPointerBmp );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Is the pointer touching one edge of the screen ?
|
||||||
|
if( ( POINTER_Info.xPos == POS_MIN ) || ( POINTER_Info.yPos == POS_MIN ) ||
|
||||||
|
( POINTER_Info.xPos == POS_MAX ) || ( POINTER_Info.yPos == POS_MAX ) )
|
||||||
|
{
|
||||||
|
res = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Public functions for CircleOS ---------------------------------------------*/
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* POINTER_Init
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
* Initialize pointer. Called at CircleOS startup. Set default pointer at the
|
||||||
|
* middle of the screen and allows it to move into the whole screen.
|
||||||
|
*
|
||||||
|
* @attention This function must <b>NOT</b> be called by the user.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void POINTER_Init( void )
|
||||||
|
{
|
||||||
|
// Increase pointer sensibility.
|
||||||
|
POINTER_SetCurrentSpeedOnAngle( DEFAULT_SPEED_ON_ANGLE );
|
||||||
|
POINTER_SetCurrentAngleStart( DEFAULT_ANGLESTART );
|
||||||
|
POINTER_SetCurrentPointer( POINTER_WIDTH, POINTER_WIDTH, BallPointerBmp );
|
||||||
|
POINTER_SetMode( POINTER_ON );
|
||||||
|
POINTER_SetPos( 56, 56 );
|
||||||
|
POINTER_SetRectScreen();
|
||||||
|
|
||||||
|
CurrentPointerColor = POINTER_DEFAULT_COLOR;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* POINTER_Handler
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Called by the CircleOS scheduler to manage the pointer.
|
||||||
|
*
|
||||||
|
* @attention This function must <b>NOT</b> be called by the user.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void POINTER_Handler( void )
|
||||||
|
{
|
||||||
|
switch( Pointer_Mode )
|
||||||
|
{
|
||||||
|
// Nothing to do!
|
||||||
|
case POINTER_OFF :
|
||||||
|
case POINTER_UNDEF:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Where is the MEMS ?
|
||||||
|
MEMS_GetPosition( &OUT_X, &OUT_Y );
|
||||||
|
|
||||||
|
POINTER_Move();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @endcond
|
||||||
|
|
||||||
|
/* Public functions ----------------------------------------------------------*/
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* POINTER_SetCurrentPointer
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Set the dimension and the bitmap of the pointer.
|
||||||
|
* @note The bitmap is a monochrome one!
|
||||||
|
*
|
||||||
|
* @param[in] width width of the pointer (u8)
|
||||||
|
* @param[in] height height of the pointer (u8)
|
||||||
|
* @param[in] bmp pointer to an array of width * height bits.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/********************************************************************************/
|
||||||
|
void POINTER_SetCurrentPointer( u8 width, u8 height, u8* bmp )
|
||||||
|
{
|
||||||
|
if( !bmp )
|
||||||
|
{
|
||||||
|
bmp = BallPointerBmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
CurrentPointerWidth = width;
|
||||||
|
CurrentPointerHeight = height;
|
||||||
|
CurrentPointerBmp = bmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* POINTER_GetCurrentAngleStart
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Get the current minimal angle to move pointer
|
||||||
|
*
|
||||||
|
* @return current minimal angle.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
u16 POINTER_GetCurrentAngleStart( void )
|
||||||
|
{
|
||||||
|
return CurrentAngleStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* POINTER_SetCurrentAngleStart
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Set the current minimal angle to move pointer
|
||||||
|
*
|
||||||
|
* @param[in] newangle The new minimal angle to move pointer.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void POINTER_SetCurrentAngleStart( u16 newangle )
|
||||||
|
{
|
||||||
|
CurrentAngleStart = newangle;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* POINTER_GetCurrentSpeedOnAngle
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Return the current speed/angle ratio.
|
||||||
|
*
|
||||||
|
* @return current ratio.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
u16 POINTER_GetCurrentSpeedOnAngle( void )
|
||||||
|
{
|
||||||
|
return CurrentSpeedOnAngle;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* POINTER_SetCurrentSpeedOnAngle
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Set the current speed/angle ratio.
|
||||||
|
*
|
||||||
|
* @param[in] newspeed New speed/angle ratio.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void POINTER_SetCurrentSpeedOnAngle( u16 newspeed )
|
||||||
|
{
|
||||||
|
CurrentSpeedOnAngle = newspeed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* POINTER_SetCurrentAreaStore
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Change the current storage area. If the provided value is NULL, the default
|
||||||
|
* storage area will be used.
|
||||||
|
*
|
||||||
|
* @param[in] ptr New storage area (may be null).
|
||||||
|
*
|
||||||
|
* @warning Memory space pointed by the provided pointer must be large enough
|
||||||
|
* to store a color bitmap corresponding to the pointer area.
|
||||||
|
* In other words, space must be width * height * 2 large.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void POINTER_SetCurrentAreaStore( u8* ptr )
|
||||||
|
{
|
||||||
|
ptrAreaStore = ( ptr == 0 ) ? DefaultAreaStore : ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* POINTER_SetMode
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Change the current mode of the pointer management.
|
||||||
|
*
|
||||||
|
* @note Must be called only ONCE!!
|
||||||
|
*
|
||||||
|
* @param[in] mode New pointer management mode.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void POINTER_SetMode( enum POINTER_mode mode )
|
||||||
|
{
|
||||||
|
u16* ptr;
|
||||||
|
u16 i;
|
||||||
|
u16 color;
|
||||||
|
|
||||||
|
switch( mode )
|
||||||
|
{
|
||||||
|
case POINTER_APPLICATION:
|
||||||
|
ptr = (u16*)DefaultAreaStore;
|
||||||
|
color = DRAW_GetBGndColor();
|
||||||
|
|
||||||
|
for ( i = 0; i < (CurrentPointerWidth*CurrentPointerHeight) ; i++ )
|
||||||
|
{
|
||||||
|
*ptr++ = color;
|
||||||
|
}
|
||||||
|
|
||||||
|
POINTER_Draw( POINTER_Info.xPos, POINTER_Info.yPos, CurrentPointerWidth, CurrentPointerHeight, CurrentPointerBmp );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case POINTER_RESTORE_LESS:
|
||||||
|
POINTER_Draw( POINTER_Info.xPos, POINTER_Info.yPos, CurrentPointerWidth, CurrentPointerHeight, CurrentPointerBmp );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case POINTER_ON:
|
||||||
|
POINTER_SetCurrentAreaStore( 0 );
|
||||||
|
POINTER_Save( POINTER_Info.xPos, POINTER_Info.yPos, POINTER_WIDTH, POINTER_WIDTH );
|
||||||
|
POINTER_Draw( POINTER_Info.xPos, POINTER_Info.yPos, CurrentPointerWidth, CurrentPointerHeight,CurrentPointerBmp );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case POINTER_OFF:
|
||||||
|
POINTER_Info.xPos = ( SCREEN_WIDTH - POINTER_WIDTH ) / 2;
|
||||||
|
POINTER_Info.yPos = ( SCREEN_WIDTH - POINTER_WIDTH ) / 2;
|
||||||
|
|
||||||
|
case POINTER_MENU:
|
||||||
|
if( Pointer_Mode == POINTER_ON )
|
||||||
|
{
|
||||||
|
POINTER_SetCurrentAreaStore( 0 );
|
||||||
|
POINTER_Restore( POINTER_Info.xPos, POINTER_Info.yPos, POINTER_WIDTH, POINTER_WIDTH );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
Pointer_Mode = mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* POINTER_GetMode
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Return the current mode of the pointer management
|
||||||
|
*
|
||||||
|
* @return Current pointer management mode.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
enum POINTER_mode POINTER_GetMode( void )
|
||||||
|
{
|
||||||
|
return Pointer_Mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* POINTER_GetState
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Return current pointer state.
|
||||||
|
*
|
||||||
|
* @return Current pointer state.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
enum POINTER_state POINTER_GetState( void )
|
||||||
|
{
|
||||||
|
return Pointer_State;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* POINTER_SetRect
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Set new limits for the move of the pointer
|
||||||
|
*
|
||||||
|
* @param[in] x Horizontal coordinate of the bottom left corner of the new area.
|
||||||
|
* @param[in] y Vertical coordinate of the bottom left corner of the new are.
|
||||||
|
* @param[in] width New area width.
|
||||||
|
* @param[in] height New area height.
|
||||||
|
*
|
||||||
|
* @warning The (0x0) point in on the low left corner.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void POINTER_SetRect( s16 x, s16 y, s16 width, s16 height )
|
||||||
|
{
|
||||||
|
POINTER_Info.X_PosMin = x;
|
||||||
|
|
||||||
|
if( POINTER_Info.xPos < POINTER_Info.X_PosMin )
|
||||||
|
{
|
||||||
|
POINTER_Info.xPos = POINTER_Info.X_PosMin;
|
||||||
|
}
|
||||||
|
|
||||||
|
POINTER_Info.X_PosMax = x + width - 1;
|
||||||
|
|
||||||
|
if( POINTER_Info.xPos > POINTER_Info.X_PosMax )
|
||||||
|
{
|
||||||
|
POINTER_Info.xPos = POINTER_Info.X_PosMax;
|
||||||
|
}
|
||||||
|
|
||||||
|
POINTER_Info.Y_PosMin = y;
|
||||||
|
|
||||||
|
if( POINTER_Info.yPos < POINTER_Info.Y_PosMin )
|
||||||
|
{
|
||||||
|
POINTER_Info.yPos = POINTER_Info.Y_PosMin;
|
||||||
|
}
|
||||||
|
|
||||||
|
POINTER_Info.Y_PosMax = y + height - 1;
|
||||||
|
|
||||||
|
if( POINTER_Info.yPos > POINTER_Info.Y_PosMax )
|
||||||
|
{
|
||||||
|
POINTER_Info.yPos = POINTER_Info.Y_PosMax;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* POINTER_SetRectScreen
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Allow the pointer to move on the whole screen.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void POINTER_SetRectScreen( void )
|
||||||
|
{
|
||||||
|
POINTER_SetRect( 0, 0, POS_MAX, POS_MAX );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* POINTER_GetPos
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Return the current position of the pointer (on the screen).
|
||||||
|
*
|
||||||
|
* @return The current pointer screen position with X in the LSB and Y in the MSB.
|
||||||
|
*
|
||||||
|
* @warning The (0x0) point in on the low left corner.
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
u16 POINTER_GetPos( void )
|
||||||
|
{
|
||||||
|
return ( POINTER_Info.xPos | ( POINTER_Info.yPos << 8 ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* POINTER_SetPos
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Force the screen position of the pointer.
|
||||||
|
*
|
||||||
|
* @param[in] x New horizontal coordinate.
|
||||||
|
* @param[in] y New vertical coordinate.
|
||||||
|
*
|
||||||
|
* @warning The (0x0) point in on the low left corner.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void POINTER_SetPos( u16 x, u16 y )
|
||||||
|
{
|
||||||
|
POINTER_Info.xPos = x;
|
||||||
|
POINTER_Info.yPos = y;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* POINTER_Draw
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Draw pointer.
|
||||||
|
*
|
||||||
|
* @param[in] x Horizontal coordinate of the bottom left corner of the pointer.
|
||||||
|
* @param[in] y Vertical coordinate of the bottom left corner of the pointer.
|
||||||
|
* @param[in] width Pointer bitmap width.
|
||||||
|
* @param[in] height Pointer bitmap height.
|
||||||
|
* @param[in] bmp Pointer to width * height bit array. If null used default
|
||||||
|
* pointer bitmap.
|
||||||
|
*
|
||||||
|
* @note The provided bitmap is a monochrome one.
|
||||||
|
* @warning The (0x0) point in on the low left corner.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void POINTER_Draw( u8 x, u8 y, u8 width, u8 height, u8* bmp )
|
||||||
|
{
|
||||||
|
int i = 0;
|
||||||
|
int l = 0;
|
||||||
|
int n = 0;
|
||||||
|
char* ptr = ptrAreaStore;
|
||||||
|
char c;
|
||||||
|
u16 val;
|
||||||
|
|
||||||
|
// No bitmap provided, use the default one!
|
||||||
|
if( bmp == 0 )
|
||||||
|
{
|
||||||
|
bmp = BallPointerBmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Select the screen area were going to take care about!
|
||||||
|
LCD_SetRect_For_Cmd( x, y, width, height );
|
||||||
|
|
||||||
|
// Let draw to the LCD screen.
|
||||||
|
LCD_SendLCDCmd( ST7637_RAMWR );
|
||||||
|
|
||||||
|
while( n < ( width * height ) )
|
||||||
|
{
|
||||||
|
if( Pointer_Mode != POINTER_RESTORE_LESS )
|
||||||
|
{
|
||||||
|
// Draw pixel using current storage area data for background pixels.
|
||||||
|
c = *ptr++;
|
||||||
|
LCD_SendLCDData( ( bmp[ l + ( i / 8 ) ] & ( 1 << ( 7 - ( i % 8 ) ) ) ) ? ( POINTER_GetColor() & 255 ) : c );
|
||||||
|
|
||||||
|
c = *ptr++;
|
||||||
|
LCD_SendLCDData( ( bmp[ l + ( i / 8 ) ] & ( 1 << ( 7 - ( i % 8 ) ) ) ) ? ( POINTER_GetColor() >> 8 ) : c );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// POINTER_RESTORE_LESS: use current background color for background color.
|
||||||
|
c = DRAW_GetBGndColor();
|
||||||
|
val = ( bmp[ l + ( i / 8 ) ] & ( 1 << ( 7 - ( i % 8 ) ) ) ) ? POINTER_GetColor() : c;
|
||||||
|
|
||||||
|
LCD_SendLCDData( val & 255 );
|
||||||
|
LCD_SendLCDData( val >> 8 );
|
||||||
|
}
|
||||||
|
|
||||||
|
n++;
|
||||||
|
|
||||||
|
i++;
|
||||||
|
|
||||||
|
// End of line ?
|
||||||
|
if( i == width )
|
||||||
|
{
|
||||||
|
// Next line!
|
||||||
|
l++;
|
||||||
|
i=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* POINTER_Save
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Save the background of the pointer.
|
||||||
|
*
|
||||||
|
* @param[in] x Horizontal coordinate of the bottom left corner of the area to save.
|
||||||
|
* @param[in] y Vertical coordinate of the bottom left corner of the area to save.
|
||||||
|
* @param[in] width Width of the area to save.
|
||||||
|
* @param[in] height Height of the area to save.
|
||||||
|
*
|
||||||
|
* @note The store area must be large enough to store all the pixels (16 bits).
|
||||||
|
* @warning The (0x0) point in on the low left corner.
|
||||||
|
* @see POINTER_Restore
|
||||||
|
* @see POINTER_SetCurrentAreaStore
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void POINTER_Save( u8 x, u8 y, u8 width, u8 height )
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
char* ptr = ptrAreaStore;
|
||||||
|
int bytesize = ( width * height ) * 2; // 2 bytes per pixel.
|
||||||
|
|
||||||
|
// Is this pointer management mode, don't save pointer background!
|
||||||
|
if( Pointer_Mode == POINTER_RESTORE_LESS )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Select the LCD screen area to read.
|
||||||
|
LCD_SetRect_For_Cmd ( x, y, width, height );
|
||||||
|
|
||||||
|
// Send the memory read command to the LCD controller.
|
||||||
|
LCD_SendLCDCmd( ST7637_RAMRD );
|
||||||
|
|
||||||
|
// First returned byte is a dummy!
|
||||||
|
LCD_ReadLCDData();
|
||||||
|
|
||||||
|
for( i = 0; i < bytesize; i++ )
|
||||||
|
{
|
||||||
|
*ptr++ = LCD_ReadLCDData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* POINTER_Restore
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Restore the background of the pointer with data saved in the current store area.
|
||||||
|
*
|
||||||
|
* @param[in] x Horizontal coordinate of the bottom left corner of the area to restore.
|
||||||
|
* @param[in] y Vertical coordinate of the bottom left corner of the area to restore.
|
||||||
|
* @param[in] width Width of the area to restore.
|
||||||
|
* @param[in] height Height of the area to restore.
|
||||||
|
*
|
||||||
|
* @warning The (0x0) point in on the low left corner.
|
||||||
|
* @see POINTER_Save
|
||||||
|
* @see POINTER_SetCurrentAreaStore
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void POINTER_Restore( u8 x, u8 y, u8 width, u8 height )
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
char* ptr = ptrAreaStore;
|
||||||
|
int bytesize = ( width * height ) * 2; // 2 bytes per pixel.
|
||||||
|
|
||||||
|
// Select the screen area to write.
|
||||||
|
LCD_SetRect_For_Cmd( x, y, width, height );
|
||||||
|
|
||||||
|
// Send the memory write command to the LCD controller.
|
||||||
|
LCD_SendLCDCmd( ST7637_RAMWR );
|
||||||
|
|
||||||
|
for( i = 0; i < bytesize; i++ )
|
||||||
|
{
|
||||||
|
// In this mode, use background color (no data was previously saved).
|
||||||
|
if ( Pointer_Mode == POINTER_RESTORE_LESS )
|
||||||
|
{
|
||||||
|
LCD_SendLCDData( DRAW_GetBGndColor() );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LCD_SendLCDData( *ptr++ );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* POINTER_SetApplication_Pointer_Mgr
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Provides an user defined pointer manager.
|
||||||
|
*
|
||||||
|
* @param[in] mgr Pointer to the user defined pointer manager.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void POINTER_SetApplication_Pointer_Mgr( tAppPtrMgr mgr )
|
||||||
|
{
|
||||||
|
Application_Pointer_Mgr = mgr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* POINTER_SetColor
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Set the pointer color.
|
||||||
|
*
|
||||||
|
* @param[in] color The new pointer color.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void POINTER_SetColor( u16 color )
|
||||||
|
{
|
||||||
|
CurrentPointerColor = color;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* POINTER_GetColor
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Return the current pointer color.
|
||||||
|
*
|
||||||
|
* @return Current pointer color.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
u16 POINTER_GetColor( void )
|
||||||
|
{
|
||||||
|
return CurrentPointerColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* POINTER_GetInfo
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Get pointer informations.
|
||||||
|
*
|
||||||
|
* @return A pointer to a pointer information structure.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
tPointer_Info* POINTER_GetInfo( void )
|
||||||
|
{
|
||||||
|
return &POINTER_Info;
|
||||||
|
}
|
@ -0,0 +1,81 @@
|
|||||||
|
/********************* (C) COPYRIGHT 2007 RAISONANCE S.A.S. *******************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @file scheduler.h
|
||||||
|
* @brief Header file for the SysTick interrupt handler of the CircleOS project.
|
||||||
|
* @author FL
|
||||||
|
* @author IB
|
||||||
|
* @date 07/2007
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef __STM32F10x_IT_H
|
||||||
|
#define __STM32F10x_IT_H
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "stm32f10x_lib.h"
|
||||||
|
|
||||||
|
void NMIException( void );
|
||||||
|
void HardFaultException( void );
|
||||||
|
void MemManageException( void );
|
||||||
|
void BusFaultException( void );
|
||||||
|
void UsageFaultException( void );
|
||||||
|
void DebugMonitor( void );
|
||||||
|
void SVCHandler( void );
|
||||||
|
void PendSVC( void );
|
||||||
|
void SysTickHandler( void );
|
||||||
|
void WWDG_IRQHandler( void );
|
||||||
|
void PVD_IRQHandler( void );
|
||||||
|
void TAMPER_IRQHandler( void );
|
||||||
|
void RTC_IRQHandler( void );
|
||||||
|
void FLASH_IRQHandler( void );
|
||||||
|
void RCC_IRQHandler( void );
|
||||||
|
void EXTI0_IRQHandler( void );
|
||||||
|
void EXTI1_IRQHandler( void );
|
||||||
|
void EXTI2_IRQHandler( void );
|
||||||
|
void EXTI3_IRQHandler( void );
|
||||||
|
void EXTI4_IRQHandler( void );
|
||||||
|
void DMAChannel1_IRQHandler( void );
|
||||||
|
void DMAChannel2_IRQHandler( void );
|
||||||
|
void DMAChannel3_IRQHandler( void );
|
||||||
|
void DMAChannel4_IRQHandler( void );
|
||||||
|
void DMAChannel5_IRQHandler( void );
|
||||||
|
void DMAChannel6_IRQHandler( void );
|
||||||
|
void DMAChannel7_IRQHandler( void );
|
||||||
|
void ADC_IRQHandler( void );
|
||||||
|
void USB_HP_CAN_TX_IRQHandler( void );
|
||||||
|
void USB_LP_CAN_RX0_IRQHandler( void );
|
||||||
|
void CAN_RX1_IRQHandler( void );
|
||||||
|
void CAN_SCE_IRQHandler( void );
|
||||||
|
void EXTI9_5_IRQHandler( void );
|
||||||
|
void TIM1_BRK_IRQHandler( void );
|
||||||
|
void TIM1_UP_IRQHandler( void );
|
||||||
|
void TIM1_TRG_CCUP_IRQHandler( void );
|
||||||
|
void TIM1_CC_IRQHandler( void );
|
||||||
|
void TIM2_IRQHandler( void );
|
||||||
|
void TIM3_IRQHandler( void );
|
||||||
|
void TIM4_IRQHandler( void );
|
||||||
|
void I2C1_EV_IRQHandler( void );
|
||||||
|
void I2C1_ER_IRQHandler( void );
|
||||||
|
void I2C2_EV_IRQHandler( void );
|
||||||
|
void I2C2_ER_IRQHandler( void );
|
||||||
|
void SPI1_IRQHandler( void );
|
||||||
|
void SPI2_IRQHandler( void );
|
||||||
|
void USART1_IRQHandler( void );
|
||||||
|
void USART2_IRQHandler( void );
|
||||||
|
void USART3_IRQHandler( void );
|
||||||
|
void EXTI15_10_IRQHandler( void );
|
||||||
|
void RTCAlarm_IRQHandler( void );
|
||||||
|
void USBWakeUp_IRQHandler( void );
|
||||||
|
|
||||||
|
//FL071107 Make the scheduler configurable. The handler are inserted into a list that could
|
||||||
|
//be modified by the applications.
|
||||||
|
typedef void (*tHandler) ( void );
|
||||||
|
extern tHandler SchHandler [16+1];
|
||||||
|
#define SCH_HDL_MAX ( sizeof SchHandler / sizeof (tHandler) )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* __STM32F10x_IT_H */
|
@ -0,0 +1,217 @@
|
|||||||
|
/********************* (C) COPYRIGHT 2007 RAISONANCE S.A.S. *******************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @file stm32f10x_circle_it.c
|
||||||
|
* @brief Interrupt handler for the CircleOS project.
|
||||||
|
* @author FL
|
||||||
|
* @author IB
|
||||||
|
* @date 07/2007
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "circle.h"
|
||||||
|
|
||||||
|
/* External variables --------------------------------------------------------*/
|
||||||
|
extern u16 CCR_Val;
|
||||||
|
extern u16 Current_CCR_BackLightStart;
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* NMIException
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Handles the NMI exception.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void NMIException( void ) {}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* HardFaultException
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Handles the Hard Fault exception.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void HardFaultException( void )
|
||||||
|
{
|
||||||
|
#ifdef TIMING_ANALYSIS //to debug with a scope
|
||||||
|
GPIO_WriteBit( GPIOA, GPIO_Pin_5, Bit_RESET );
|
||||||
|
GPIO_WriteBit( GPIOA, GPIO_Pin_5, Bit_SET );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* MemManageException
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Handles the Memory Manage exception.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void MemManageException( void ) {}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* BusFaultException
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Handles the Bus Fault exception.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void BusFaultException( void ) {}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* UsageFaultException
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Handles the Usage Fault exception.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void UsageFaultException( void ) {}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* DebugMonitor
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Handles the Debug Monitor exception.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void DebugMonitor( void ) {}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* SVCHandler
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Handles the SVCall exception.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void SVCHandler( void ) {}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* PendSVC
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Handles the PendSVC exception.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void PendSVC( void ) {}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* DummyHandler
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Default handling for the IRQ-Exception
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void DummyHandler ( void ) {}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* TIM2_IRQHandler
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Handles the TIM2 global interrupt request.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void TIM2_IRQHandler( void )
|
||||||
|
{
|
||||||
|
#ifdef TIMING_ANALYSIS //to debug with a scope
|
||||||
|
GPIO_WriteBit( GPIOA, GPIO_Pin_7, Bit_RESET );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Clear TIM2 update interrupt */
|
||||||
|
TIM_ClearITPendingBit( TIM2, TIM_IT_Update );
|
||||||
|
|
||||||
|
MEMS_Handler();
|
||||||
|
|
||||||
|
#ifdef TIMING_ANALYSIS //to debug with a scope
|
||||||
|
GPIO_WriteBit( GPIOA, GPIO_Pin_7, Bit_SET );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* TIM3_IRQHandler
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Handles the TIM3 global interrupt request.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void TIM3_IRQHandler( void )
|
||||||
|
{
|
||||||
|
u16 capture = 0;
|
||||||
|
|
||||||
|
if( TIM_GetITStatus( TIM3, TIM_IT_CC3 ) != RESET )
|
||||||
|
{
|
||||||
|
capture = TIM_GetCapture3( TIM3 );
|
||||||
|
|
||||||
|
TIM_SetCompare3( TIM3, capture + CCR_Val + 1 );
|
||||||
|
TIM_ClearITPendingBit( TIM3, TIM_IT_CC3 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* TIM4_IRQHandler
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Handles the TIM4 global interrupt request.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
/******************************************************************************/
|
||||||
|
void TIM4_IRQHandler( void )
|
||||||
|
{
|
||||||
|
u16 BackLight_capture = 0;
|
||||||
|
|
||||||
|
if( TIM_GetITStatus( TIM4, TIM_IT_CC2 ) != RESET )
|
||||||
|
{
|
||||||
|
BackLight_capture = TIM_GetCapture2( TIM4 );
|
||||||
|
|
||||||
|
TIM_SetCompare2( TIM4, BackLight_capture + Current_CCR_BackLightStart + 1 );
|
||||||
|
TIM_ClearITPendingBit( TIM4, TIM_IT_CC2 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,119 @@
|
|||||||
|
/******************** (C) COPYRIGHT 2007 STMicroelectronics ********************
|
||||||
|
* File Name : stm32f10x_conf.h
|
||||||
|
* Author : MCD Application Team
|
||||||
|
* Date First Issued : 09/29/2006
|
||||||
|
* Description : Library configuration file.
|
||||||
|
********************************************************************************
|
||||||
|
* History:
|
||||||
|
* 02/05/2007: V0.1
|
||||||
|
* 09/29/2006: V0.01
|
||||||
|
********************************************************************************
|
||||||
|
* 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 to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef __STM32F10x_CONF_H
|
||||||
|
#define __STM32F10x_CONF_H
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
/* Comment the line below to compile the library in release mode */
|
||||||
|
//#define DEBUG 0
|
||||||
|
|
||||||
|
/* Comment the line below to disable the specific peripheral inclusion */
|
||||||
|
/************************************* ADC ************************************/
|
||||||
|
//#define _ADC
|
||||||
|
#define _ADC1
|
||||||
|
#define _ADC2
|
||||||
|
|
||||||
|
/************************************* CAN ************************************/
|
||||||
|
//#define _CAN
|
||||||
|
|
||||||
|
/************************************* DMA ************************************/
|
||||||
|
//#define _DMA
|
||||||
|
#define _DMA_Channel1
|
||||||
|
#define _DMA_Channel2
|
||||||
|
#define _DMA_Channel3
|
||||||
|
#define _DMA_Channel4
|
||||||
|
#define _DMA_Channel5
|
||||||
|
#define _DMA_Channel6
|
||||||
|
#define _DMA_Channel7
|
||||||
|
|
||||||
|
/************************************* EXTI ***********************************/
|
||||||
|
//#define _EXTI
|
||||||
|
|
||||||
|
/************************************* GPIO ***********************************/
|
||||||
|
#define _GPIO
|
||||||
|
#define _GPIOA
|
||||||
|
#define _GPIOB
|
||||||
|
#define _GPIOC
|
||||||
|
#define _GPIOD
|
||||||
|
//#define _GPIOE
|
||||||
|
#define _AFIO
|
||||||
|
|
||||||
|
/************************************* I2C ************************************/
|
||||||
|
//#define _I2C
|
||||||
|
//#define _I2C1
|
||||||
|
//#define _I2C2
|
||||||
|
|
||||||
|
/************************************* IWDG ***********************************/
|
||||||
|
//#define _IWDG
|
||||||
|
|
||||||
|
/************************************* NVIC ***********************************/
|
||||||
|
#define _NVIC
|
||||||
|
#define _SCB
|
||||||
|
|
||||||
|
/************************************* BKP ************************************/
|
||||||
|
//#define _BKP
|
||||||
|
|
||||||
|
/************************************* PWR ************************************/
|
||||||
|
//#define _PWR
|
||||||
|
|
||||||
|
/************************************* RCC ************************************/
|
||||||
|
#define _RCC
|
||||||
|
|
||||||
|
/************************************* RTC ************************************/
|
||||||
|
//#define _RTC
|
||||||
|
|
||||||
|
/************************************* SPI ************************************/
|
||||||
|
#define _SPI
|
||||||
|
//#define _SPI1
|
||||||
|
#define _SPI2
|
||||||
|
|
||||||
|
/************************************* SysTick ********************************/
|
||||||
|
#define _SysTick
|
||||||
|
|
||||||
|
/************************************* TIM1 ***********************************/
|
||||||
|
//#define _TIM1
|
||||||
|
|
||||||
|
/************************************* TIM ************************************/
|
||||||
|
#define _TIM
|
||||||
|
#define _TIM2
|
||||||
|
#define _TIM3
|
||||||
|
#define _TIM4
|
||||||
|
|
||||||
|
/************************************* USART **********************************/
|
||||||
|
//#define _USART
|
||||||
|
//#define _USART1
|
||||||
|
//#define _USART2
|
||||||
|
//#define _USART3
|
||||||
|
|
||||||
|
/************************************* WWDG ***********************************/
|
||||||
|
//#define _WWDG
|
||||||
|
|
||||||
|
/* In the following line adjust the value of External High Speed oscillator (HSE)
|
||||||
|
used in your application */
|
||||||
|
#define HSE_Value ((u32)12000000) /* Value of the External oscillator in Hz*/
|
||||||
|
|
||||||
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
|
/* Exported functions ------------------------------------------------------- */
|
||||||
|
|
||||||
|
#endif /* __STM32F10x_CONF_H */
|
||||||
|
|
||||||
|
/******************* (C) COPYRIGHT 2007 STMicroelectronics *****END OF FILE****/
|
@ -0,0 +1,70 @@
|
|||||||
|
/********************* (C) COPYRIGHT 2007 RAISONANCE S.A.S. ********************
|
||||||
|
* File Name : stm32f10x_it.c
|
||||||
|
* Author : IB/FL
|
||||||
|
* Date First Issued : 07/2007
|
||||||
|
* Description : Interrupt handler for the CircleOS project.
|
||||||
|
* Revision :
|
||||||
|
*******************************************************************************/
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef __STM32F10x_IT_H
|
||||||
|
#define __STM32F10x_IT_H
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "stm32f10x_lib.h"
|
||||||
|
|
||||||
|
/* Exported functions ------------------------------------------------------- */
|
||||||
|
void NMIException( void );
|
||||||
|
void HardFaultException( void );
|
||||||
|
void MemManageException( void );
|
||||||
|
void BusFaultException( void );
|
||||||
|
void UsageFaultException( void );
|
||||||
|
void DebugMonitor( void );
|
||||||
|
void SVCHandler( void );
|
||||||
|
void PendSVC( void );
|
||||||
|
void SysTickHandler( void );
|
||||||
|
void WWDG_IRQHandler( void );
|
||||||
|
void PVD_IRQHandler( void );
|
||||||
|
void TAMPER_IRQHandler( void );
|
||||||
|
void RTC_IRQHandler( void );
|
||||||
|
void FLASH_IRQHandler( void );
|
||||||
|
void RCC_IRQHandler( void );
|
||||||
|
void EXTI0_IRQHandler( void );
|
||||||
|
void EXTI1_IRQHandler( void );
|
||||||
|
void EXTI2_IRQHandler( void );
|
||||||
|
void EXTI3_IRQHandler( void );
|
||||||
|
void EXTI4_IRQHandler( void );
|
||||||
|
void DMAChannel1_IRQHandler( void );
|
||||||
|
void DMAChannel2_IRQHandler( void );
|
||||||
|
void DMAChannel3_IRQHandler( void );
|
||||||
|
void DMAChannel4_IRQHandler( void );
|
||||||
|
void DMAChannel5_IRQHandler( void );
|
||||||
|
void DMAChannel6_IRQHandler( void );
|
||||||
|
void DMAChannel7_IRQHandler( void );
|
||||||
|
void ADC_IRQHandler( void );
|
||||||
|
void USB_HP_CAN_TX_IRQHandler( void );
|
||||||
|
void USB_LP_CAN_RX0_IRQHandler( void );
|
||||||
|
void CAN_RX1_IRQHandler( void );
|
||||||
|
void CAN_SCE_IRQHandler( void );
|
||||||
|
void EXTI9_5_IRQHandler( void );
|
||||||
|
void TIM1_BRK_IRQHandler( void );
|
||||||
|
void TIM1_UP_IRQHandler( void );
|
||||||
|
void TIM1_TRG_COM_IRQHandler( void );
|
||||||
|
void TIM1_CC_IRQHandler( void );
|
||||||
|
void TIM2_IRQHandler( void );
|
||||||
|
void TIM3_IRQHandler( void );
|
||||||
|
void TIM4_IRQHandler( void );
|
||||||
|
void I2C1_EV_IRQHandler( void );
|
||||||
|
void I2C1_ER_IRQHandler( void );
|
||||||
|
void I2C2_EV_IRQHandler( void );
|
||||||
|
void I2C2_ER_IRQHandler( void );
|
||||||
|
void SPI1_IRQHandler( void );
|
||||||
|
void SPI2_IRQHandler( void );
|
||||||
|
void USART1_IRQHandler( void );
|
||||||
|
void USART2_IRQHandler( void );
|
||||||
|
void USART3_IRQHandler( void );
|
||||||
|
void EXTI15_10_IRQHandler( void );
|
||||||
|
void RTCAlarm_IRQHandler( void );
|
||||||
|
void USBWakeUp_IRQHandler( void );
|
||||||
|
|
||||||
|
#endif /* __STM32F10x_IT_H */
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,465 @@
|
|||||||
|
/*
|
||||||
|
FreeRTOS.org V4.6.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||||
|
|
||||||
|
This file is part of the FreeRTOS.org distribution.
|
||||||
|
|
||||||
|
FreeRTOS.org 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.org 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.org; 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.org, 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.
|
||||||
|
|
||||||
|
Also see http://www.SafeRTOS.com a version that has been certified for use
|
||||||
|
in safety critical systems, plus commercial licensing, development and
|
||||||
|
support options.
|
||||||
|
***************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Creates all the demo application tasks, then starts the scheduler. The WEB
|
||||||
|
* documentation provides more details of the standard demo application tasks.
|
||||||
|
* In addition to the standard demo tasks, the following tasks and tests are
|
||||||
|
* defined and/or created within this file:
|
||||||
|
*
|
||||||
|
* "Fast Interrupt Test" - A high frequency periodic interrupt is generated
|
||||||
|
* using a free running timer to demonstrate the use of the
|
||||||
|
* configKERNEL_INTERRUPT_PRIORITY configuration constant. The interrupt
|
||||||
|
* service routine measures the number of processor clocks that occur between
|
||||||
|
* each interrupt - and in so doing measures the jitter in the interrupt timing.
|
||||||
|
* The maximum measured jitter time is latched in the ulMaxJitter variable, and
|
||||||
|
* displayed on the LCD by the 'Check' task as described below. The
|
||||||
|
* fast interrupt is configured and handled in the timertest.c source file.
|
||||||
|
*
|
||||||
|
* "LCD" task - the LCD task is a 'gatekeeper' task. It is the only task that
|
||||||
|
* is permitted to access the display directly. Other tasks wishing to write a
|
||||||
|
* message to the LCD send the message on a queue to the LCD task instead of
|
||||||
|
* accessing the LCD themselves. The LCD task just blocks on the queue waiting
|
||||||
|
* for messages - waking and displaying the messages as they arrive. Messages
|
||||||
|
* can either be a text string to display, or an instruction to update MEMS
|
||||||
|
* input. The MEMS input is used to display a ball that can be moved around
|
||||||
|
* LCD by tilting the STM32 Primer. 45% is taken as the neutral position.
|
||||||
|
*
|
||||||
|
* "Check" task - This only executes every five seconds but has the highest
|
||||||
|
* priority so is guaranteed to get processor time. Its main function is to
|
||||||
|
* check that all the standard demo tasks are still operational. Should any
|
||||||
|
* unexpected behaviour within a demo task be discovered the 'check' task will
|
||||||
|
* write an error to the LCD (via the LCD task). If all the demo tasks are
|
||||||
|
* executing with their expected behaviour then the check task writes PASS
|
||||||
|
* along with the max jitter time to the LCD (again via the LCD task), as
|
||||||
|
* described above.
|
||||||
|
*
|
||||||
|
* Tick Hook - A tick hook is provided just for demonstration purposes. In
|
||||||
|
* this case it is used to periodically send an instruction to updated the
|
||||||
|
* MEMS input to the LCD task.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* CircleOS includes. Some of the CircleOS peripheral functionality is
|
||||||
|
utilised, although CircleOS itself is not used. */
|
||||||
|
#include "circle.h"
|
||||||
|
|
||||||
|
/* Standard includes. */
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
/* Scheduler includes. */
|
||||||
|
#include "FreeRTOS.h"
|
||||||
|
#include "Task.h"
|
||||||
|
#include "Queue.h"
|
||||||
|
|
||||||
|
/* Demo app includes. */
|
||||||
|
#include "BlockQ.h"
|
||||||
|
#include "blocktim.h"
|
||||||
|
#include "GenQTest.h"
|
||||||
|
#include "partest.h"
|
||||||
|
#include "QPeek.h"
|
||||||
|
|
||||||
|
/* The bitmap used to display the FreeRTOS.org logo is stored in 16bit format
|
||||||
|
and therefore takes up a large proportion of the Flash space. Setting this
|
||||||
|
parameter to 0 excludes the bitmap from the build, freeing up Flash space for
|
||||||
|
extra code. */
|
||||||
|
#define mainINCLUDE_BITMAP 1
|
||||||
|
|
||||||
|
#if mainINCLUDE_BITMAP == 1
|
||||||
|
#include "bitmap.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Task priorities. */
|
||||||
|
#define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 2 )
|
||||||
|
#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )
|
||||||
|
#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 )
|
||||||
|
#define mainGEN_Q_PRIORITY ( tskIDLE_PRIORITY + 0 )
|
||||||
|
#define mainFLASH_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 )
|
||||||
|
|
||||||
|
/* Splash screen related constants. */
|
||||||
|
#define mainBITMAP_Y ( 38 )
|
||||||
|
#define mainBITMAP_X ( 18 )
|
||||||
|
#define mainURL_Y ( 8 )
|
||||||
|
#define mainURL_X ( 78 )
|
||||||
|
#define mainSPLASH_SCREEN_DELAY ( 2000 / portTICK_RATE_MS )
|
||||||
|
|
||||||
|
/* Text drawing related constants. */
|
||||||
|
#define mainLCD_CHAR_HEIGHT ( 13 )
|
||||||
|
#define mainLCD_MAX_Y ( 110 )
|
||||||
|
|
||||||
|
/* The maximum number of message that can be waiting for display at any one
|
||||||
|
time. */
|
||||||
|
#define mainLCD_QUEUE_SIZE ( 3 )
|
||||||
|
|
||||||
|
/* The check task uses the sprintf function so requires a little more stack. */
|
||||||
|
#define mainCHECK_TASK_STACK_SIZE ( configMINIMAL_STACK_SIZE + 50 )
|
||||||
|
|
||||||
|
/* The LCD task calls some of the CircleOS functions (for MEMS and LCD access),
|
||||||
|
these can require a larger stack. */
|
||||||
|
#define configLCD_TASK_STACK_SIZE ( configMINIMAL_STACK_SIZE + 50 )
|
||||||
|
|
||||||
|
/* Dimensions the buffer into which the jitter time is written. */
|
||||||
|
#define mainMAX_MSG_LEN 25
|
||||||
|
|
||||||
|
/* The time between cycles of the 'check' task. */
|
||||||
|
#define mainCHECK_DELAY ( ( portTickType ) 5000 / portTICK_RATE_MS )
|
||||||
|
|
||||||
|
/* The period at which the MEMS input should be updated. */
|
||||||
|
#define mainMEMS_DELAY ( ( portTickType ) 100 / portTICK_RATE_MS )
|
||||||
|
|
||||||
|
/* The rate at which the flash task toggles the LED. */
|
||||||
|
#define mainFLASH_DELAY ( ( portTickType ) 1000 / portTICK_RATE_MS )
|
||||||
|
|
||||||
|
/* The number of nano seconds between each processor clock. */
|
||||||
|
#define mainNS_PER_CLOCK ( ( unsigned portLONG ) ( ( 1.0 / ( double ) configCPU_CLOCK_HZ ) * 1000000000.0 ) )
|
||||||
|
|
||||||
|
/* The two types of message that can be sent to the LCD task. */
|
||||||
|
#define mainUPDATE_BALL_MESSAGE ( 0 )
|
||||||
|
#define mainWRITE_STRING_MESSAGE ( 1 )
|
||||||
|
|
||||||
|
/* Type of the message sent to the LCD task. */
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
portBASE_TYPE xMessageType;
|
||||||
|
signed char *pcMessage;
|
||||||
|
} xLCDMessage;
|
||||||
|
|
||||||
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Configure the clocks, GPIO and other peripherals as required by the demo.
|
||||||
|
*/
|
||||||
|
static void prvSetupHardware( void );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The LCD is written two by more than one task so is controlled by a
|
||||||
|
* 'gatekeeper' task. This is the only task that is actually permitted to
|
||||||
|
* access the LCD directly. Other tasks wanting to display a message send
|
||||||
|
* the message to the gatekeeper.
|
||||||
|
*/
|
||||||
|
static void prvLCDTask( void *pvParameters );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Checks the status of all the demo tasks then prints a message to the
|
||||||
|
* display. The message will be either PASS - and include in brackets the
|
||||||
|
* maximum measured jitter time (as described at the to of the file), or a
|
||||||
|
* message that describes which of the standard demo tasks an error has been
|
||||||
|
* discovered in.
|
||||||
|
*
|
||||||
|
* Messages are not written directly to the terminal, but passed to prvLCDTask
|
||||||
|
* via a queue.
|
||||||
|
*
|
||||||
|
* The check task also receives instructions to update the MEMS input, which
|
||||||
|
* in turn can also lead to the LCD being updated.
|
||||||
|
*/
|
||||||
|
static void prvCheckTask( void *pvParameters );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Configures the timers and interrupts for the fast interrupt test as
|
||||||
|
* described at the top of this file.
|
||||||
|
*/
|
||||||
|
extern void vSetupTimerTest( void );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* A cut down version of sprintf() used to percent the HUGE GCC library
|
||||||
|
* equivalent from being included in the binary image.
|
||||||
|
*/
|
||||||
|
extern int sprintf(char *out, const char *format, ...);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Simple toggle the LED periodically for timing verification.
|
||||||
|
*/
|
||||||
|
static void prvFlashTask( void *pvParameters );
|
||||||
|
|
||||||
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
/* The queue used to send messages to the LCD task. */
|
||||||
|
xQueueHandle xLCDQueue;
|
||||||
|
|
||||||
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
int main( void )
|
||||||
|
{
|
||||||
|
#ifdef DEBUG
|
||||||
|
debug();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
prvSetupHardware();
|
||||||
|
|
||||||
|
/* Create the queue used by the LCD task. Messages for display on the LCD
|
||||||
|
are received via this queue. */
|
||||||
|
xLCDQueue = xQueueCreate( mainLCD_QUEUE_SIZE, sizeof( xLCDMessage ) );
|
||||||
|
|
||||||
|
/* Start the standard demo tasks. */
|
||||||
|
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
|
||||||
|
vCreateBlockTimeTasks();
|
||||||
|
vStartGenericQueueTasks( mainGEN_Q_PRIORITY );
|
||||||
|
vStartQueuePeekTasks();
|
||||||
|
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
|
||||||
|
|
||||||
|
/* Start the tasks defined within this file/specific to this demo. */
|
||||||
|
xTaskCreate( prvCheckTask, ( signed portCHAR * ) "Check", mainCHECK_TASK_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
|
||||||
|
xTaskCreate( prvLCDTask, ( signed portCHAR * ) "LCD", configLCD_TASK_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
|
||||||
|
xTaskCreate( prvFlashTask, ( signed portCHAR * ) "Flash", configMINIMAL_STACK_SIZE, NULL, mainFLASH_TASK_PRIORITY, NULL );
|
||||||
|
|
||||||
|
/* Configure the timers used by the fast interrupt timer test. */
|
||||||
|
vSetupTimerTest();
|
||||||
|
|
||||||
|
/* Start the scheduler. */
|
||||||
|
vTaskStartScheduler();
|
||||||
|
|
||||||
|
/* Will only get here if there was not enough heap space to create the
|
||||||
|
idle task. */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
void prvLCDTask( void *pvParameters )
|
||||||
|
{
|
||||||
|
xLCDMessage xMessage;
|
||||||
|
portCHAR cY = mainLCD_CHAR_HEIGHT;
|
||||||
|
const portCHAR * const pcString = "www.FreeRTOS.org";
|
||||||
|
const portCHAR * const pcBlankLine = " ";
|
||||||
|
|
||||||
|
DRAW_Init();
|
||||||
|
|
||||||
|
#if mainINCLUDE_BITMAP == 1
|
||||||
|
DRAW_SetImage( pucImage, mainBITMAP_Y, mainBITMAP_X, bmpBITMAP_HEIGHT, bmpBITMAP_WIDTH );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
LCD_SetScreenOrientation( V9 );
|
||||||
|
DRAW_DisplayString( mainURL_Y, mainURL_X, pcString, strlen( pcString ) );
|
||||||
|
vTaskDelay( mainSPLASH_SCREEN_DELAY );
|
||||||
|
LCD_FillRect( 0, 0, CHIP_SCREEN_WIDTH, CHIP_SCREEN_HEIGHT, RGB_WHITE );
|
||||||
|
|
||||||
|
for( ;; )
|
||||||
|
{
|
||||||
|
/* Wait for a message to arrive that requires displaying. */
|
||||||
|
while( xQueueReceive( xLCDQueue, &xMessage, portMAX_DELAY ) != pdPASS );
|
||||||
|
|
||||||
|
/* Check the message type. */
|
||||||
|
if( xMessage.xMessageType == mainUPDATE_BALL_MESSAGE )
|
||||||
|
{
|
||||||
|
/* Read the MEMS and update the ball display on the LCD if required. */
|
||||||
|
MEMS_Handler();
|
||||||
|
POINTER_Handler();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* A text string was sent. First blank off the old text string, then
|
||||||
|
draw the new text on the next line down. */
|
||||||
|
DRAW_DisplayString( 0, cY, pcBlankLine, strlen( pcBlankLine ) );
|
||||||
|
|
||||||
|
cY -= mainLCD_CHAR_HEIGHT;
|
||||||
|
if( cY <= ( mainLCD_CHAR_HEIGHT - 1 ) )
|
||||||
|
{
|
||||||
|
/* Wrap the line onto which we are going to write the text. */
|
||||||
|
cY = mainLCD_MAX_Y;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Display the message. */
|
||||||
|
DRAW_DisplayString( 0, cY, xMessage.pcMessage, strlen( xMessage.pcMessage ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
static void prvCheckTask( void *pvParameters )
|
||||||
|
{
|
||||||
|
portTickType xLastExecutionTime;
|
||||||
|
xLCDMessage xMessage;
|
||||||
|
static signed portCHAR cPassMessage[ mainMAX_MSG_LEN ];
|
||||||
|
extern unsigned portSHORT usMaxJitter;
|
||||||
|
|
||||||
|
/* Initialise the xLastExecutionTime variable on task entry. */
|
||||||
|
xLastExecutionTime = xTaskGetTickCount();
|
||||||
|
|
||||||
|
/* Setup the message we are going to send to the LCD task. */
|
||||||
|
xMessage.xMessageType = mainWRITE_STRING_MESSAGE;
|
||||||
|
xMessage.pcMessage = cPassMessage;
|
||||||
|
|
||||||
|
for( ;; )
|
||||||
|
{
|
||||||
|
/* Perform this check every mainCHECK_DELAY milliseconds. */
|
||||||
|
vTaskDelayUntil( &xLastExecutionTime, mainCHECK_DELAY );
|
||||||
|
|
||||||
|
/* Has an error been found in any task? If so then point the text
|
||||||
|
we are going to send to the LCD task to an error message instead of
|
||||||
|
the PASS message. */
|
||||||
|
if( xAreGenericQueueTasksStillRunning() != pdTRUE )
|
||||||
|
{
|
||||||
|
xMessage.pcMessage = "ERROR IN GEN Q";
|
||||||
|
}
|
||||||
|
if( xAreBlockingQueuesStillRunning() != pdTRUE )
|
||||||
|
{
|
||||||
|
xMessage.pcMessage = "ERROR IN BLOCK Q";
|
||||||
|
}
|
||||||
|
else if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
|
||||||
|
{
|
||||||
|
xMessage.pcMessage = "ERROR IN BLOCK TIME";
|
||||||
|
}
|
||||||
|
else if( xArePollingQueuesStillRunning() != pdTRUE )
|
||||||
|
{
|
||||||
|
xMessage.pcMessage = "ERROR IN POLL Q";
|
||||||
|
}
|
||||||
|
else if( xAreQueuePeekTasksStillRunning() != pdTRUE )
|
||||||
|
{
|
||||||
|
xMessage.pcMessage = "ERROR IN PEEK Q";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* No errors were found in any task, so send a pass message
|
||||||
|
with the max measured jitter time also included (as per the
|
||||||
|
fast interrupt test described at the top of this file and on
|
||||||
|
the online documentation page for this demo application). */
|
||||||
|
sprintf( ( portCHAR * ) cPassMessage, "PASS [%uns]", ( ( unsigned portLONG ) usMaxJitter ) * mainNS_PER_CLOCK );
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Send the message to the LCD gatekeeper for display. */
|
||||||
|
xQueueSend( xLCDQueue, &xMessage, portMAX_DELAY );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
void vApplicationTickHook( void )
|
||||||
|
{
|
||||||
|
static unsigned portLONG ulCallCount;
|
||||||
|
static const xLCDMessage xMemsMessage = { mainUPDATE_BALL_MESSAGE, NULL };
|
||||||
|
|
||||||
|
/* Periodically send a message to the LCD task telling it to update
|
||||||
|
the MEMS input, and then if necessary the LCD. */
|
||||||
|
ulCallCount++;
|
||||||
|
if( ulCallCount >= mainMEMS_DELAY )
|
||||||
|
{
|
||||||
|
ulCallCount = 0;
|
||||||
|
xQueueSendFromISR( xLCDQueue, &xMemsMessage, pdFALSE );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
static void prvSetupHardware( void )
|
||||||
|
{
|
||||||
|
/* Start with the clocks in their expected state. */
|
||||||
|
RCC_DeInit();
|
||||||
|
|
||||||
|
/* Enable HSE (high speed external clock). */
|
||||||
|
RCC_HSEConfig( RCC_HSE_ON );
|
||||||
|
|
||||||
|
/* Wait till HSE is ready. */
|
||||||
|
while( RCC_GetFlagStatus( RCC_FLAG_HSERDY ) == RESET )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 2 wait states required on the flash. */
|
||||||
|
*( ( unsigned portLONG * ) 0x40022000 ) = 0x02;
|
||||||
|
|
||||||
|
/* HCLK = SYSCLK */
|
||||||
|
RCC_HCLKConfig( RCC_SYSCLK_Div1 );
|
||||||
|
|
||||||
|
/* PCLK2 = HCLK */
|
||||||
|
RCC_PCLK2Config( RCC_HCLK_Div1 );
|
||||||
|
|
||||||
|
/* PCLK1 = HCLK/2 */
|
||||||
|
RCC_PCLK1Config( RCC_HCLK_Div2 );
|
||||||
|
|
||||||
|
/* PLLCLK = 12MHz * 6 = 72 MHz. */
|
||||||
|
RCC_PLLConfig( RCC_PLLSource_HSE_Div1, RCC_PLLMul_6 );
|
||||||
|
|
||||||
|
/* Enable PLL. */
|
||||||
|
RCC_PLLCmd( ENABLE );
|
||||||
|
|
||||||
|
/* Wait till PLL is ready. */
|
||||||
|
while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Select PLL as system clock source. */
|
||||||
|
RCC_SYSCLKConfig( RCC_SYSCLKSource_PLLCLK );
|
||||||
|
|
||||||
|
/* Wait till PLL is used as system clock source. */
|
||||||
|
while( RCC_GetSYSCLKSource() != 0x08 )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Enable GPIOA, GPIOB, GPIOC, GPIOD, GPIOE and AFIO clocks */
|
||||||
|
RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB |RCC_APB2Periph_GPIOC
|
||||||
|
| RCC_APB2Periph_GPIOD | RCC_APB2Periph_GPIOE | RCC_APB2Periph_AFIO, ENABLE );
|
||||||
|
|
||||||
|
/* SPI2 Periph clock enable */
|
||||||
|
RCC_APB1PeriphClockCmd( RCC_APB1Periph_SPI2, ENABLE );
|
||||||
|
|
||||||
|
|
||||||
|
/* Set the Vector Table base address at 0x08000000 */
|
||||||
|
NVIC_SetVectorTable( NVIC_VectTab_FLASH, 0x0 );
|
||||||
|
|
||||||
|
NVIC_PriorityGroupConfig( NVIC_PriorityGroup_4 );
|
||||||
|
|
||||||
|
/* Configure HCLK clock as SysTick clock source. */
|
||||||
|
SysTick_CLKSourceConfig( SysTick_CLKSource_HCLK );
|
||||||
|
|
||||||
|
/* Misc initialisation, including some of the CircleOS features. Note
|
||||||
|
that CircleOS itself is not used. */
|
||||||
|
vParTestInitialise();
|
||||||
|
MEMS_Init();
|
||||||
|
POINTER_Init();
|
||||||
|
POINTER_SetMode( POINTER_RESTORE_LESS );
|
||||||
|
}
|
||||||
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
static void prvFlashTask( void *pvParameters )
|
||||||
|
{
|
||||||
|
portTickType xLastExecutionTime;
|
||||||
|
|
||||||
|
/* Initialise the xLastExecutionTime variable on task entry. */
|
||||||
|
xLastExecutionTime = xTaskGetTickCount();
|
||||||
|
|
||||||
|
for( ;; )
|
||||||
|
{
|
||||||
|
/* Simple toggle the LED periodically. This just provides some timing
|
||||||
|
verification. */
|
||||||
|
vTaskDelayUntil( &xLastExecutionTime, mainFLASH_DELAY );
|
||||||
|
vParTestToggleLED( 0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
void starting_delay( unsigned long ul )
|
||||||
|
{
|
||||||
|
vTaskDelay( ( portTickType ) ul );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,280 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2001, 2002 Georges Menie (www.menie.org)
|
||||||
|
stdarg version contributed by Christian Ettinger
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program 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 Lesser General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
putchar is the only external dependency for this file,
|
||||||
|
if you have a working putchar, leave it commented out.
|
||||||
|
If not, uncomment the define below and
|
||||||
|
replace outbyte(c) by your own function call.
|
||||||
|
|
||||||
|
#define putchar(c) outbyte(c)
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
static void printchar(char **str, int c)
|
||||||
|
{
|
||||||
|
extern int putchar(int c);
|
||||||
|
|
||||||
|
if (str) {
|
||||||
|
**str = c;
|
||||||
|
++(*str);
|
||||||
|
}
|
||||||
|
else (void)putchar(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define PAD_RIGHT 1
|
||||||
|
#define PAD_ZERO 2
|
||||||
|
|
||||||
|
static int prints(char **out, const char *string, int width, int pad)
|
||||||
|
{
|
||||||
|
register int pc = 0, padchar = ' ';
|
||||||
|
|
||||||
|
if (width > 0) {
|
||||||
|
register int len = 0;
|
||||||
|
register const char *ptr;
|
||||||
|
for (ptr = string; *ptr; ++ptr) ++len;
|
||||||
|
if (len >= width) width = 0;
|
||||||
|
else width -= len;
|
||||||
|
if (pad & PAD_ZERO) padchar = '0';
|
||||||
|
}
|
||||||
|
if (!(pad & PAD_RIGHT)) {
|
||||||
|
for ( ; width > 0; --width) {
|
||||||
|
printchar (out, padchar);
|
||||||
|
++pc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for ( ; *string ; ++string) {
|
||||||
|
printchar (out, *string);
|
||||||
|
++pc;
|
||||||
|
}
|
||||||
|
for ( ; width > 0; --width) {
|
||||||
|
printchar (out, padchar);
|
||||||
|
++pc;
|
||||||
|
}
|
||||||
|
|
||||||
|
return pc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* the following should be enough for 32 bit int */
|
||||||
|
#define PRINT_BUF_LEN 12
|
||||||
|
|
||||||
|
static int printi(char **out, int i, int b, int sg, int width, int pad, int letbase)
|
||||||
|
{
|
||||||
|
char print_buf[PRINT_BUF_LEN];
|
||||||
|
register char *s;
|
||||||
|
register int t, neg = 0, pc = 0;
|
||||||
|
register unsigned int u = i;
|
||||||
|
|
||||||
|
if (i == 0) {
|
||||||
|
print_buf[0] = '0';
|
||||||
|
print_buf[1] = '\0';
|
||||||
|
return prints (out, print_buf, width, pad);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sg && b == 10 && i < 0) {
|
||||||
|
neg = 1;
|
||||||
|
u = -i;
|
||||||
|
}
|
||||||
|
|
||||||
|
s = print_buf + PRINT_BUF_LEN-1;
|
||||||
|
*s = '\0';
|
||||||
|
|
||||||
|
while (u) {
|
||||||
|
t = u % b;
|
||||||
|
if( t >= 10 )
|
||||||
|
t += letbase - '0' - 10;
|
||||||
|
*--s = t + '0';
|
||||||
|
u /= b;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (neg) {
|
||||||
|
if( width && (pad & PAD_ZERO) ) {
|
||||||
|
printchar (out, '-');
|
||||||
|
++pc;
|
||||||
|
--width;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
*--s = '-';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return pc + prints (out, s, width, pad);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int print( char **out, const char *format, va_list args )
|
||||||
|
{
|
||||||
|
register int width, pad;
|
||||||
|
register int pc = 0;
|
||||||
|
char scr[2];
|
||||||
|
|
||||||
|
for (; *format != 0; ++format) {
|
||||||
|
if (*format == '%') {
|
||||||
|
++format;
|
||||||
|
width = pad = 0;
|
||||||
|
if (*format == '\0') break;
|
||||||
|
if (*format == '%') goto out;
|
||||||
|
if (*format == '-') {
|
||||||
|
++format;
|
||||||
|
pad = PAD_RIGHT;
|
||||||
|
}
|
||||||
|
while (*format == '0') {
|
||||||
|
++format;
|
||||||
|
pad |= PAD_ZERO;
|
||||||
|
}
|
||||||
|
for ( ; *format >= '0' && *format <= '9'; ++format) {
|
||||||
|
width *= 10;
|
||||||
|
width += *format - '0';
|
||||||
|
}
|
||||||
|
if( *format == 's' ) {
|
||||||
|
register char *s = (char *)va_arg( args, int );
|
||||||
|
pc += prints (out, s?s:"(null)", width, pad);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if( *format == 'd' ) {
|
||||||
|
pc += printi (out, va_arg( args, int ), 10, 1, width, pad, 'a');
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if( *format == 'x' ) {
|
||||||
|
pc += printi (out, va_arg( args, int ), 16, 0, width, pad, 'a');
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if( *format == 'X' ) {
|
||||||
|
pc += printi (out, va_arg( args, int ), 16, 0, width, pad, 'A');
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if( *format == 'u' ) {
|
||||||
|
pc += printi (out, va_arg( args, int ), 10, 0, width, pad, 'a');
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if( *format == 'c' ) {
|
||||||
|
/* char are converted to int then pushed on the stack */
|
||||||
|
scr[0] = (char)va_arg( args, int );
|
||||||
|
scr[1] = '\0';
|
||||||
|
pc += prints (out, scr, width, pad);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
out:
|
||||||
|
printchar (out, *format);
|
||||||
|
++pc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (out) **out = '\0';
|
||||||
|
va_end( args );
|
||||||
|
return pc;
|
||||||
|
}
|
||||||
|
|
||||||
|
int printf(const char *format, ...)
|
||||||
|
{
|
||||||
|
va_list args;
|
||||||
|
|
||||||
|
va_start( args, format );
|
||||||
|
return print( 0, format, args );
|
||||||
|
}
|
||||||
|
|
||||||
|
int sprintf(char *out, const char *format, ...)
|
||||||
|
{
|
||||||
|
va_list args;
|
||||||
|
|
||||||
|
va_start( args, format );
|
||||||
|
return print( &out, format, args );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int snprintf( char *buf, unsigned int count, const char *format, ... )
|
||||||
|
{
|
||||||
|
va_list args;
|
||||||
|
|
||||||
|
( void ) count;
|
||||||
|
|
||||||
|
va_start( args, format );
|
||||||
|
return print( &buf, format, args );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef TEST_PRINTF
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
char *ptr = "Hello world!";
|
||||||
|
char *np = 0;
|
||||||
|
int i = 5;
|
||||||
|
unsigned int bs = sizeof(int)*8;
|
||||||
|
int mi;
|
||||||
|
char buf[80];
|
||||||
|
|
||||||
|
mi = (1 << (bs-1)) + 1;
|
||||||
|
printf("%s\n", ptr);
|
||||||
|
printf("printf test\n");
|
||||||
|
printf("%s is null pointer\n", np);
|
||||||
|
printf("%d = 5\n", i);
|
||||||
|
printf("%d = - max int\n", mi);
|
||||||
|
printf("char %c = 'a'\n", 'a');
|
||||||
|
printf("hex %x = ff\n", 0xff);
|
||||||
|
printf("hex %02x = 00\n", 0);
|
||||||
|
printf("signed %d = unsigned %u = hex %x\n", -3, -3, -3);
|
||||||
|
printf("%d %s(s)%", 0, "message");
|
||||||
|
printf("\n");
|
||||||
|
printf("%d %s(s) with %%\n", 0, "message");
|
||||||
|
sprintf(buf, "justif: \"%-10s\"\n", "left"); printf("%s", buf);
|
||||||
|
sprintf(buf, "justif: \"%10s\"\n", "right"); printf("%s", buf);
|
||||||
|
sprintf(buf, " 3: %04d zero padded\n", 3); printf("%s", buf);
|
||||||
|
sprintf(buf, " 3: %-4d left justif.\n", 3); printf("%s", buf);
|
||||||
|
sprintf(buf, " 3: %4d right justif.\n", 3); printf("%s", buf);
|
||||||
|
sprintf(buf, "-3: %04d zero padded\n", -3); printf("%s", buf);
|
||||||
|
sprintf(buf, "-3: %-4d left justif.\n", -3); printf("%s", buf);
|
||||||
|
sprintf(buf, "-3: %4d right justif.\n", -3); printf("%s", buf);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* if you compile this file with
|
||||||
|
* gcc -Wall $(YOUR_C_OPTIONS) -DTEST_PRINTF -c printf.c
|
||||||
|
* you will get a normal warning:
|
||||||
|
* printf.c:214: warning: spurious trailing `%' in format
|
||||||
|
* this line is testing an invalid % at the end of the format string.
|
||||||
|
*
|
||||||
|
* this should display (on 32bit int machine) :
|
||||||
|
*
|
||||||
|
* Hello world!
|
||||||
|
* printf test
|
||||||
|
* (null) is null pointer
|
||||||
|
* 5 = 5
|
||||||
|
* -2147483647 = - max int
|
||||||
|
* char a = 'a'
|
||||||
|
* hex ff = ff
|
||||||
|
* hex 00 = 00
|
||||||
|
* signed -3 = unsigned 4294967293 = hex fffffffd
|
||||||
|
* 0 message(s)
|
||||||
|
* 0 message(s) with %
|
||||||
|
* justif: "left "
|
||||||
|
* justif: " right"
|
||||||
|
* 3: 0003 zero padded
|
||||||
|
* 3: 3 left justif.
|
||||||
|
* 3: 3 right justif.
|
||||||
|
* -3: -003 zero padded
|
||||||
|
* -3: -3 left justif.
|
||||||
|
* -3: -3 right justif.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
@ -0,0 +1,170 @@
|
|||||||
|
/*
|
||||||
|
FreeRTOS.org V4.6.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||||
|
|
||||||
|
This file is part of the FreeRTOS.org distribution.
|
||||||
|
|
||||||
|
FreeRTOS.org 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.org 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.org; 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.org, 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.
|
||||||
|
|
||||||
|
Also see http://www.SafeRTOS.com a version that has been certified for use
|
||||||
|
in safety critical systems, plus commercial licensing, development and
|
||||||
|
support options.
|
||||||
|
***************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* High speed timer test as described in main.c. */
|
||||||
|
|
||||||
|
/* Scheduler includes. */
|
||||||
|
#include "FreeRTOS.h"
|
||||||
|
|
||||||
|
/* Library includes. */
|
||||||
|
#include "stm32f10x_lib.h"
|
||||||
|
#include "stm32f10x_tim.h"
|
||||||
|
#include "stm32f10x_map.h"
|
||||||
|
|
||||||
|
/* The set frequency of the interrupt. Deviations from this are measured as
|
||||||
|
the jitter. */
|
||||||
|
#define timerINTERRUPT_FREQUENCY ( ( unsigned portSHORT ) 20000 )
|
||||||
|
|
||||||
|
/* The expected time between each of the timer interrupts - if the jitter was
|
||||||
|
zero. */
|
||||||
|
#define timerEXPECTED_DIFFERENCE_VALUE ( configCPU_CLOCK_HZ / timerINTERRUPT_FREQUENCY )
|
||||||
|
|
||||||
|
/* The highest available interrupt priority. */
|
||||||
|
#define timerHIGHEST_PRIORITY ( 0 )
|
||||||
|
|
||||||
|
/* Misc defines. */
|
||||||
|
#define timerMAX_32BIT_VALUE ( 0xffffffffUL )
|
||||||
|
#define timerTIMER_1_COUNT_VALUE ( * ( ( unsigned long * ) ( TIMER1_BASE + 0x48 ) ) )
|
||||||
|
|
||||||
|
/* The number of interrupts to pass before we start looking at the jitter. */
|
||||||
|
#define timerSETTLE_TIME 5
|
||||||
|
|
||||||
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Configures the two timers used to perform the test.
|
||||||
|
*/
|
||||||
|
void vSetupTimerTest( void );
|
||||||
|
|
||||||
|
/* Interrupt handler in which the jitter is measured. */
|
||||||
|
void vTimer2IntHandler( void );
|
||||||
|
|
||||||
|
/* Stores the value of the maximum recorded jitter between interrupts. */
|
||||||
|
volatile unsigned portSHORT usMaxJitter = 0;
|
||||||
|
|
||||||
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
void vSetupTimerTest( void )
|
||||||
|
{
|
||||||
|
unsigned long ulFrequency;
|
||||||
|
TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
|
||||||
|
NVIC_InitTypeDef NVIC_InitStructure;
|
||||||
|
|
||||||
|
|
||||||
|
/* Enable timer clocks */
|
||||||
|
RCC_APB1PeriphClockCmd( RCC_APB1Periph_TIM2, ENABLE );
|
||||||
|
RCC_APB1PeriphClockCmd( RCC_APB1Periph_TIM3, ENABLE );
|
||||||
|
|
||||||
|
/* Initialise data. */
|
||||||
|
TIM_DeInit( TIM2 );
|
||||||
|
TIM_DeInit( TIM3 );
|
||||||
|
TIM_TimeBaseStructInit( &TIM_TimeBaseStructure );
|
||||||
|
|
||||||
|
/* Time base configuration for timer 2 - which generates the interrupts. */
|
||||||
|
ulFrequency = configCPU_CLOCK_HZ / timerINTERRUPT_FREQUENCY;
|
||||||
|
TIM_TimeBaseStructure.TIM_Period = ( unsigned portSHORT ) ( ulFrequency & 0xffffUL );
|
||||||
|
TIM_TimeBaseStructure.TIM_Prescaler = 0x0;
|
||||||
|
TIM_TimeBaseStructure.TIM_ClockDivision = 0x0;
|
||||||
|
TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
|
||||||
|
TIM_TimeBaseInit( TIM2, &TIM_TimeBaseStructure );
|
||||||
|
TIM_ARRPreloadConfig( TIM2, ENABLE );
|
||||||
|
|
||||||
|
|
||||||
|
/* Configuration for timer 3 which is used as a high resolution time
|
||||||
|
measurement. */
|
||||||
|
TIM_TimeBaseStructure.TIM_Period = ( unsigned portSHORT ) 0xffff;
|
||||||
|
TIM_TimeBaseInit( TIM3, &TIM_TimeBaseStructure );
|
||||||
|
TIM_ARRPreloadConfig( TIM3, ENABLE );
|
||||||
|
|
||||||
|
/* Enable TIM2 IT. TIM3 does not generate an interrupt. */
|
||||||
|
NVIC_InitStructure.NVIC_IRQChannel = TIM2_IRQChannel;
|
||||||
|
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
|
||||||
|
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = timerHIGHEST_PRIORITY;
|
||||||
|
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
|
||||||
|
NVIC_Init( &NVIC_InitStructure );
|
||||||
|
TIM_ITConfig( TIM2, TIM_IT_Update, ENABLE );
|
||||||
|
|
||||||
|
/* Finally, enable both timers. */
|
||||||
|
TIM_Cmd( TIM2, ENABLE );
|
||||||
|
TIM_Cmd( TIM3, ENABLE );
|
||||||
|
}
|
||||||
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
void vTimer2IntHandler( void )
|
||||||
|
{
|
||||||
|
static unsigned portSHORT usLastCount = 0, usSettleCount = 0, usMaxDifference = 0;
|
||||||
|
unsigned portSHORT usThisCount, usDifference;
|
||||||
|
|
||||||
|
/* Capture the free running timer 3 value as we enter the interrupt. */
|
||||||
|
usThisCount = TIM3->CNT;
|
||||||
|
|
||||||
|
if( usSettleCount >= timerSETTLE_TIME )
|
||||||
|
{
|
||||||
|
/* What is the difference between the timer value in this interrupt
|
||||||
|
and the value from the last interrupt. */
|
||||||
|
usDifference = usThisCount - usLastCount;
|
||||||
|
|
||||||
|
/* Store the difference in the timer values if it is larger than the
|
||||||
|
currently stored largest value. The difference over and above the
|
||||||
|
expected difference will give the 'jitter' in the processing of these
|
||||||
|
interrupts. */
|
||||||
|
if( usDifference > usMaxDifference )
|
||||||
|
{
|
||||||
|
usMaxDifference = usDifference;
|
||||||
|
usMaxJitter = usMaxDifference - timerEXPECTED_DIFFERENCE_VALUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Don't bother storing any values for the first couple of
|
||||||
|
interrupts. */
|
||||||
|
usSettleCount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Remember what the timer value was this time through, so we can calculate
|
||||||
|
the difference the next time through. */
|
||||||
|
usLastCount = usThisCount;
|
||||||
|
|
||||||
|
TIM_ClearITPendingBit( TIM2, TIM_IT_Update );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue