1 /* -------------------------------- Arctic Core ------------------------------
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
6 * This source code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published by the
8 * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * -------------------------------- Arctic Core ------------------------------*/
26 #define MCU_SW_MAJOR_VERSION 1
27 #define MCU_SW_MINOR_VERSION 0
28 #define MCU_SW_PATCH_VERSION 0
32 //#include "mpc55xx_aos.h"
\r
35 #define MCU_INIT_SERVICE_ID 0x00
\r
36 #define MCU_INITRAMSECTION_SERVICE_ID 0x01
\r
37 #define MCU_INITCLOCK_SERVICE_ID 0x02
\r
38 #define MCU_DISTRIBUTEPLLCLOCK_SERVICE_ID 0x03
\r
39 #define MCU_GETPLLSTATUS_SERVICE_ID 0x04
\r
40 #define MCU_GETRESETREASON_SERVICE_ID 0x05
\r
41 #define MCU_GETRESETRAWVALUE_SERVICE_ID 0x06
\r
42 #define MCU_PERFORMRESET_SERVICE_ID 0x07
\r
43 #define MCU_SETMODE_SERVICE_ID 0x08
\r
44 #define MCU_GETVERSIONINFO_SERVICE_ID 0x09
\r
45 #define MCU_INTCVECTORINSTALL_SERVICE_ID 0x0A // Not in spec but follows pattern
\r
47 /* Development error codes */
\r
48 #define MCU_E_PARAM_CONFIG 0x0A
\r
49 #define MCU_E_PARAM_CLOCK 0x0B
\r
50 #define MCU_E_PARAM_MODE 0x0C
\r
51 #define MCU_E_PARAM_RAMSECTION 0x0D
\r
52 #define MCU_E_PLL_NOT_LOCKED 0x0E
\r
53 #define MCU_E_UNINIT 0x0F
\r
55 /* Specific return values */
\r
56 #define MCU_GETRESETRAWVALUE_NORESETREG_RV 0x00 // MCU006
\r
57 #define MCU_GETRESETRAWVALUE_UNINIT_RV 0xffffffff // MCU135
\r
62 MCU_PLL_STATUS_UNDEFINED,
\r
63 } Mcu_PllStatusType;
\r
71 typedef uint8_t Mcu_RamSectionType;
\r
73 typedef uint32_t Mcu_RawResetType;
\r
82 #include "Mcu_Cfg.h"
\r
84 void Mcu_Init( const Mcu_ConfigType *configPtr );
\r
86 Std_ReturnType Mcu_InitRamSection( const Mcu_RamSectionType RamSection );
\r
87 Std_ReturnType Mcu_InitClock( const Mcu_ClockType ClockSetting );
\r
88 void Mcu_DistributePllClock( void );
\r
89 Mcu_PllStatusType Mcu_GetPllStatus( void );
\r
90 Mcu_ResetType Mcu_GetResetReason( void );
\r
91 Mcu_RawResetType Mcu_GetResetRawValue( void );
\r
92 #if ( MCU_PERFORM_RESET_API == STD_ON )
\r
93 void Mcu_PerformReset( void );
\r
95 void Mcu_SetMode( const Mcu_ModeType McuMode );
\r
97 #if ( MCU_VERSION_INFO_API == STD_ON )
\r
98 #define MCU_SW_MAJOR_VERSION 1
\r
99 #define MCU_SW_MINOR_VERSION 0
\r
100 #define MCU_SW_PATCH_VERSION 0
\r
101 #define MCU_AR_MAJOR_VERSION 2
\r
102 #define MCU_AR_MINOR_VERSION 2
\r
103 #define MCU_AR_PATCH_VERSION 2
\r
105 #define Mcu_GetVersionInfo(_vi) STD_GET_VERSION_INFO(_vi,MCU)
\r
108 typedef uint32_t imask_t;
\r
110 /* ArcCore extensions */
\r
111 void IntCtrl_InstallVector(void (*func)(), IrqType vector, uint8_t priority, Cpu_t cpu );
\r
112 void IntCtrl_GenerateSoftInt( IrqType vector );
\r
113 uint8_t IntCtrl_GetCurrentPriority( Cpu_t cpu);
\r
114 uint32_t McuE_GetSystemClock( void );
\r
115 #if defined(CFG_MPC55XX)
\r
116 uint32_t McuE_GetPeripheralClock( McuE_PeriperalClock_t type );
\r
118 imask_t McuE_EnterCriticalSection(void);
\r
119 void McuE_ExitCriticalSection(imask_t old_state);
\r
120 void McuE_EnableInterrupts(void);
\r
121 void McuE_DisableInterrupts(void);
\r