⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 osal.h

📁 本程序为ST公司开发的源代码
💻 H
字号:
/***   @defgroup OSAL_H OSAL_H*   This file specifies the Operating System Abstraction Layer.*   The current implementation is based on OS20.*   @{*//******************************************************************************                O S A L . H***************************************************************************************************************************************************************  Project           : CDM M8 CAV2*  Organisation      : Philips Optical Storage*  File Name         : osal.h***  Description       : External operations + customized enumerations*                      for Operating System Abstraction Layer* *************************************************** * * STM CVS Log: * * $Log: osal.h,v $ * Revision 1.17  2007/08/10 12:33:29  longauer * IPOD_AP compilation switch enables future iAP * * Revision 1.16  2007/04/11 14:20:14  belardi * Integration of HAVE_CD_MECHA modification by [GP] * * Revision 1.15  2006/10/09 15:18:58  dellorto * no message * * Revision 1.14  2006/09/18 09:55:24  belardi * Corrected CVS keyword usage * * Revision 1.13  2006/09/18 09:24:52  belardi * Added Log CVS keyword into file header * ******************************************************************************/#ifndef _OSAL_H_#define _OSAL_H_#include "configuration.h"#include "os20.h"#include "lld_eic.h"#include "accordoptimer.h"#include "events.h"#include "pdebug.h"/******************************************************************************                    Type Definitions*****************************************************************************/// isr            function// function-pointer typedef for a function without parameters returning void// i.e. "void func (void)"typedef void (* OSAL_ISR_FPTR)            (void);// thread-function// function-pointer typedef for a function with 1 void-pointer parameter returning void// i.e. "void func (void * param)"typedef void (* OSAL_THREAD_FPTR)         (void *param);/***   list of threads (application specific)*/typedef enum{  OSAL_THREAD_IdleTask,  OSAL_THREAD_CaptureTask,  OSAL_THREAD_ControllerTask,  OSAL_THREAD_DecoderTask,#if (HAVE_CD_MECHA == 1)  OSAL_THREAD_LoaderTask,#endif  OSAL_THREAD_PlayerTask,#if (HAVE_CD_MECHA == 1)  OSAL_THREAD_ServoTask,#endif  OSAL_THREAD_HostIfTask,  OSAL_THREAD_FilesysTask,#if (0 != HAVE_USB)  OSAL_THREAD_USBTask,#endif#if (0 != HAVE_SDC)  OSAL_THREAD_SDCTask,#endif /* HAVE_SDC */#if (0 != IPOD_AP)	//[LL]new  OSAL_THREAD_ACPTask,	//[LL]new#endif /* IPOD_AP */	//[LL]new  OSAL_THREAD_LAST} OSAL_THREAD_ID_t;/***   list of ISRs (AccordoPlus specific)*/typedef enum{  OSAL_ISR_EINT0_3   = 0,  OSAL_ISR_EINT4_7   = 1,  OSAL_ISR_EINT8     = 2,  OSAL_ISR_EINT_I2C0 = 3,  OSAL_ISR_WIU       = 4,  OSAL_ISR_RCCU      = 5,  OSAL_ISR_SPI       = 6,  OSAL_ISR_UART0     = 7,  OSAL_ISR_UART1     = 8,  OSAL_ISR_I2C0_EVENT= 9,  OSAL_ISR_I2C0_DATA =10,  OSAL_ISR_I2C1_EVENT=11,  OSAL_ISR_I2C1_DATA =12,  OSAL_ISR_UNUSED13  =13,  OSAL_ISR_USB       =14,  OSAL_ISR_SRC_ERROR =15,  OSAL_ISR_SRC_FULL  =16,  OSAL_ISR_SRC_EMPTY =17,  OSAL_ISR_DMA       =18,  OSAL_ISR_DMA0      =19,  OSAL_ISR_DMA1      =20,  OSAL_ISR_OIF       =21,  OSAL_ISR_BD        =22,  OSAL_ISR_CLV       =23,  OSAL_ISR_CIRC      =24,  OSAL_ISR_ACQ       =25,  OSAL_ISR_RATE      =26,  OSAL_ISR_MAILBOX   =27,  OSAL_ISR_CAV       =28,  OSAL_ISR_TIMER0    =29,  OSAL_ISR_TIMER1    =30,  OSAL_ISR_WATCHDOG  =31,  OSAL_ISR_LAST} OSAL_ISR_ID_t;typedef uint8 OSAL_ISR_PRIORITY_t;// run-time info for each threadtypedef struct{  task_t            task;   /* MUST BE FIRST */  semaphore_t       sem;  OSAL_THREAD_ID_t  thread_ID;  uint32            eventcmd_to_shedule;} OSAL_THREAD_DATA_t;/******************************************************************************                    Extern Data Declarations*****************************************************************************//******************************************************************************                    Extern Function Prototypes*****************************************************************************/// We need to let the linker know if we're calling c functions from c++//#ifdef __cplusplusextern "C" {#endif /** *   start the OSAL and RTOS * *   all threads are created and started; *   all semaphores are created *   this function will never return during normal operation * *   @param    void *   @return   extern   void *   @pre      no RTOS is running, bare system is initialized *   @post     unrecorverable error has occurred */extern   void              OSAL_start(void);/***   Installation of interrupt handler**   @param    FPTR isr*   @param    OSAL_ISR_ID_t vector*   @return   void*   @pre*   @post*/extern   void              OSAL_isr_install(OSAL_ISR_ID_t vector, OSAL_ISR_PRIORITY_t priority, OSAL_ISR_FPTR isr);/***   Disable specified ISR**   Enable/Disable ISR will be use for subcode reading. This is based on ISR*   but the application SW does not want to have an ISR all the time.**   @param    OSAL_ISR_ID_t vector*   @return   void*   @pre*   @post*/extern   void              OSAL_isr_disable(OSAL_ISR_ID_t vector);/***   Enable specified ISR**   Enable/Disable ISR will be use for subcode reading. This is based on ISR*   but the application SW does not want to have an ISR all the time.**   @param    OSAL_ISR_ID_t vector*   @return   oid*   @pre*   @post*/extern   void              OSAL_isr_enable(OSAL_ISR_ID_t vector);extern   UInt              OSAL_isr_status(OSAL_ISR_ID_t vector);// those functions are prototyped in mqx.h// but we want to avoid that any module outside OSAL knows anything// about MQX; therefor they are redefined here//extern void _int_disable(void);//extern void _int_enable(void);/***   Enter critical section**   @param    void*   @return   extern   void*   @pre*   @post*/extern   Int              OSAL_enter_critical_section(void);/***   Leave critical section**   @param    void*   @return   extern   void*   @pre*   @post*/extern   void              OSAL_leave_critical_section(Int itr);/***   Get thread-id of current thread**   @param    void*   @return   extern   OSAL_THREAD_ID_t*   @pre*   @post*/extern   OSAL_THREAD_ID_t  OSAL_get_thread_id(void);extern   OSAL_THREAD_DATA_t  *OSAL_get_thread_data(void);extern   void  OSAL_wake_thread(OSAL_THREAD_ID_t thread);extern   void  OSAL_wait_thread(OSAL_THREAD_ID_t thread);extern   void  _OSAL_thread_priority_set(OSAL_THREAD_ID_t thread, int NewPriority);extern   void  _event_OSAL_wake_thread(OSAL_THREAD_ID_t thread);#ifdef __cplusplus}#endif#define DISABLE_INTERRUPTS()  { Int __itr__ = EIC_vEicGlobalDis()#define ENABLE_INTERRUPTS()   EIC_vEicGlobalRest(__itr__);}#endif // _OSAL_H/***   @} End of OSAL_H*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -