SAM3S8/SD8 Software Package: libraries/sam-gui/source/porting/sam_gui_porting.h Source File

SAM3S8/SD8 Software Package 1.2

# sam_gui_porting.h

    00001 #ifndef _SAM_GUI_PORTING_
    00002 #define _SAM_GUI_PORTING_
    00003
    00004 #include "source/common/sam_gui_errors.h"
    00005
    00006 #include <stdint.h>
    00007
    00008 #define SAM_PORTING_NONE               0
    00009 #define SAM_PORTING_FREERTOS           1
    00010 #define SAM_PORTING_EMBOS              2
    00011 #define SAM_PORTING_NUTTX              3
    00012
    00013 #ifndef SAM_PORTING
    00014     #error SAM_PORTING must be defined...
    00015 #  define SAM_PORTING SAM_PORTING_NONE
    00016 //#  define SAM_PORTING SAM_PORTING_FREERTOS
    00017 #endif
    00018
    00019 #if !defined SAM_PORTING
    00020     #error SAM_PORTING must be defined
    00021 #endif
    00022
    00023 /**
    00024  * Definitions for FreeRTOs
    00025  */
    00026 #if SAM_PORTING == SAM_PORTING_NONE
    00027 #  define SAMGUI_TaskHandle uint32_t
    00028 #  define SAMGUI_QueueHandle uint32_t
    00029 #  define SAMGUI_SemaphoreHandle uint32_t
    00030 #endif // SAM_PORTING == SAM_PORTING_NONE
    00031
    00032 /**
    00033  * Definitions for FreeRTOs
    00034  */
    00035 #if SAM_PORTING == SAM_PORTING_FREERTOS
    00036 // FreeRTOS includes
    00037 #  include "libfreertos.h"
    00038 #  define SAMGUI_TaskHandle xTaskHandle
    00039 #  define SAMGUI_QueueHandle xQueueHandle
    00040 #  define SAMGUI_SemaphoreHandle xSemaphoreHandle
    00041 #endif // SAM_PORTING == SAM_PORTING_FREERTOS
    00042
    00043 // Tasks functions
    00044 typedef void (*SAMGUI_fnTask)( void* pvParam ) ;
    00045
    00046 extern int SAMGUI_TaskCreate( SAMGUI_fnTask fnTask, const uint8_t* pucName, uint8_t* pucStack, uint32_t dwStackSize,
    00047                               uint32_t dwPriority, void* pvParameters, SAMGUI_TaskHandle* pHandle ) ;
    00048 extern void SAMGUI_TaskDelete( SAMGUI_TaskHandle Handle ) ;
    00049 extern void SAMGUI_TaskDelay( uint32_t dwDelayMs ) ;
    00050
    00051 // Memory functions
    00052 extern void* SAMGUI_Malloc( uint32_t dwSize ) ;
    00053 extern void SAMGUI_Free( void *pv ) ;
    00054
    00055
    00056 // Message queue functions
    00057 extern SAMGUI_QueueHandle SAMGUI_QueueCreate( uint32_t dwMsgNumber, uint32_t dwMsgSize ) ;
    00058
    00059 extern uint32_t SAMGUI_QueueReceive( SAMGUI_QueueHandle hQueue, void* pMsg, uint32_t dwDelay ) ;
    00060 extern uint32_t SAMGUI_QueueSendToFront( SAMGUI_QueueHandle hQueue, void* pMsg, uint32_t dwDelay )  ;
    00061 extern uint32_t SAMGUI_QueueSendToBack( SAMGUI_QueueHandle hQueue, void* pMsg, uint32_t dwDelay ) ;
    00062 extern uint32_t SAMGUI_QueueSendToFrontFromISR( SAMGUI_QueueHandle hQueue, void* pMsg )  ;
    00063 extern uint32_t SAMGUI_QueueSendToBackFromISR( SAMGUI_QueueHandle hQueue, void* pMsg ) ;
    00064
    00065 // Semaphore functions
    00066 extern SAMGUI_SemaphoreHandle SAMGUI_SemaphoreCreate( void ) ;
    00067 extern uint32_t SAMGUI_SemaphoreTake( SAMGUI_SemaphoreHandle hSem, uint32_t dwDelay ) ;
    00068 extern uint32_t SAMGUI_SemaphoreRelease( SAMGUI_SemaphoreHandle hSem ) ;
    00069
    00070 #endif // _SAM_GUI_PORTING_

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines