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

📄 circle_api.h

📁 FreeRTOS is a portable, open source, mini Real Time Kernel - a free to download and royalty free RTO
💻 H
📖 第 1 页 / 共 4 页
字号:
   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

⌨️ 快捷键说明

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