CircleOS  1
circle_api.h
Go to the documentation of this file.
1 /****************** COPYRIGHT (C) 2007-2013 KEOLABS S.A.S. ********************/
38 /*******************************************************************************
39 *
40 * Use this header with version 1.5 or later of the OS.
41 *
42 * For a complete documentation on the CircleOS, please go to:
43 * http://www.stm32circle.com
44 *
45 *******************************************************************************/
46 
47 /* Define to prevent recursive inclusion -------------------------------------*/
48 #ifndef __CIRCLE_API_H
49 #define __CIRCLE_API_H
50 
51 #include "stdint.h"
52 
53 /*-------------------------------- Type definitions --------------------------*/
54 #include "circle_types.h"
55 
56 /*-------------------------Platform specific definitions ---------------------*/
57 #include "circle_spe.h"
58 
59 /*-------------------------------- General -----------------------------------*/
66 extern enum eSpeed
67 {
69  SPEED_LOW = 2,
73 } CurrentSpeed;
74 
76 {
94 };
95 
96 
98 
99 /* Typedefs ------------------------------------------------------------------*/
100 typedef u32( *tCircleFunc0 )( void );
101 typedef u32( *tCircleFunc1 )( u32 param1 );
102 typedef u32( *tCircleFunc2 )( u32 param1, u32 param2 );
103 typedef u32( *tCircleFunc3 )( u32 param1, u32 param2, u32 param3 );
104 typedef u32( *tCircleFunc4 )( u32 param1, u32 param2, u32 param3, u32 param4 );
105 typedef u32( *tCircleFunc5 )( u32 param1, u32 param2, u32 param3, u32 param4, u32 param5 );
106 typedef u32( *tCircleFunc6 )( u32 param1, u32 param2, u32 param3, u32 param4, u32 param5, u32 param6 );
107 typedef u32( *tCircleFunc7 )( u32 param1, u32 param2, u32 param3, u32 param4, u32 param5, u32 param6, u32 param7 );
108 typedef u32( *tCircleFunc8 )( u32 param1, u32 param2, u32 param3, u32 param4, u32 param5, u32 param6, u32 param7, u32 param8 );
109 
110 extern tCircleFunc0( *ptrCircle_API )[];
111 
112 /* Defines -------------------------------------------------------------------*/
113 #define Circle_API (*ptrCircle_API)
114 
115 #define POINTER_ID 0x00
116 #define DRAW_ID 0x20
117 #define LCD_ID 0x40
118 #define LED_ID 0x60
119 #define TOUCHSCR_ID 0x61
120 #define TOOLBAR_ID 0x6A
121 #define MEMS_ID 0x70
122 #define BUTTON_ID 0x80
123 #define JOYSTICK_ID 0x84
124 #define CX_ID 0x88
125 #define BUZZER_ID 0x90
126 #define AUDIO_ID 0x93
127 #define MENU_ID 0xA0
128 #define UTIL_ID 0xB0
129 #define RTC_ID 0xC0
130 #define AUDIO2_ID 0xC3
131 #define UTIL2_ID 0xC8
132 #define SHUTDOWN_ID 0xD0
133 #define FS_ID 0xD8
134 
135 /*/ UTIL functions definition.*/
136 #define UTIL_SET_PLL_ID (UTIL_ID + 0) /* Set clock frequency.*/
137 #define UTIL_GET_PLL_ID (UTIL_ID + 1) /* Get clock frequency.*/
138 #define UTIL_UINT2STR_ID (UTIL_ID + 2) /* Convert an unsigned integer into a string.*/
139 #define UTIL_INT2STR_ID (UTIL_ID + 3) /* Convert a signed integer into a string.*/
140 #define UTIL_GET_VERSION_ID (UTIL_ID + 4) /* Get CircleOS version.*/
141 #define UTIL_READ_BACKUPREGISTER_ID (UTIL_ID + 5) /* Reads data from the specified Data Backup Register.*/
142 #define UTIL_WRITE_BACKUPREGISTER_ID (UTIL_ID + 6) /* Writes data to the specified Data Backup Register.*/
143 #define UTIL_GET_BAT_ID (UTIL_ID + 7) /* Return the batterie tension in mV.*/
144 #define UTIL_GET_USB_ID (UTIL_ID + 8) /* Return the USB connexion state.*/
145 #define UTIL_SET_IRQ_HANDLER_ID (UTIL_ID + 9) /* Replace an irq handler*/
146 #define UTIL_GET_IRQ_HANDLER_ID (UTIL_ID + 10) /* Get the current irq handler*/
147 #define UTIL_SET_SCH_HANDLER_ID (UTIL_ID + 11) /* Replace an irq handler*/
148 #define UTIL_GET_SCH_HANDLER_ID (UTIL_ID + 12) /* Get the current irq handler*/
149 #define UTIL_GET_TEMP_ID (UTIL_ID + 13) /* Return the temperature (1/100 C)*/
150 #define UTIL_SET_TEMPMODE_ID (UTIL_ID + 14) /* Set the temperature mode (0: mCelcius, 1: mFahrenheit*/
151 #define UTIL_GET_PRIMERTYPE_ID (UTIL_ID + 15) /* Get the type of PRIMER (1: Primer1, 2: Primer2)*/
152 #define UTIL_GET_APP_ADDRESS_ID (UTIL2_ID + 0) /* Get an application address.*/
153 #define UTIL_IS_STAND_ALONE_ID (UTIL2_ID + 1) /* Get current mode, stand alone or not */
154 #define UTIL_SETTIMER_ID (UTIL2_ID + 2) /* Set a timer to trigger an event */
155 #define UTIL_GET_BATSTATUS_ID (UTIL2_ID + 3) /* Get the battery recharging status */
156 #define UTIL_SAVE_SCREEN_BMP_ID (UTIL2_ID + 4) /* Capture/save the current screen on the SD card */
157 #define UTIL_SET_DIVIDER_HANDLER_ID (UTIL2_ID + 5) /* Set the current divider for a SCHEDULER handler. */
158 #define UTIL_GET_DIVIDER_HANDLER_ID (UTIL2_ID + 6) /* Get the current divider for a SCHEDULER handler. */
159 
160 typedef void ( *tHandler )( void );
161 
162 /* Prototypes.*/
163 #define UTIL_SetPll(a) ( (tCircleFunc1)(Circle_API [UTIL_SET_PLL_ID])) ((u32)(a)) /* void UTIL_SetPll( enum eSpeed speed );*/
164 #define UTIL_GetPll() (u32) (((tCircleFunc0)(Circle_API [UTIL_GET_PLL_ID])) ()) /* enum eSpeed UTIL_GetPll( void );*/
165 #define UTIL_uint2str(a,b,c,d) ( (tCircleFunc4)(Circle_API [UTIL_UINT2STR_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d)) /* void uint2str( u8* ptr , u32 X, u16 digit, s32 fillwithzero );*/
166 #define UTIL_int2str(a,b,c,d) ( (tCircleFunc4)(Circle_API [UTIL_INT2STR_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d)) /* void int2str( u8* ptr , s32 X, u16 digit, s32 fillwithzero );*/
167 #define UTIL_GetVersion() (const u8*) (((tCircleFunc0)(Circle_API [UTIL_GET_VERSION_ID])) ()) /* u8* UTIL_GetVersion( void );*/
168 #define UTIL_ReadBackupRegister(a) (u32) (((tCircleFunc1)(Circle_API [UTIL_READ_BACKUPREGISTER_ID])) ((u32)(a))) /* u16 UTIL_ReadBackupRegister( u16 BKP_DR );*/
169 #define UTIL_WriteBackupRegister(a,b) ( (tCircleFunc2)(Circle_API [UTIL_WRITE_BACKUPREGISTER_ID])) ((u32)(a),(u32)(b)) /* void UTIL_WriteBackupRegister( u16 BKP_DR, u16 Data );*/
170 #define UTIL_GetBat() (u32) (((tCircleFunc0)(Circle_API [UTIL_GET_BAT_ID])) ()) /* u16 UTIL_GetBat( void );*/
171 #define UTIL_GetUsb() (u32) (((tCircleFunc0)(Circle_API [UTIL_GET_USB_ID])) ()) /* u8 UTIL_GetUsb( void );*/
172 #define UTIL_SetIrqHandler(a,b) (((tCircleFunc2)(Circle_API [UTIL_SET_IRQ_HANDLER_ID])) ((s32)a,(u32) b)) /* void UTIL_SetIrqHandler ( s32 , tHandler );*/
173 #define UTIL_GetIrqHandler(a) (u32) (((tCircleFunc1)(Circle_API [UTIL_GET_IRQ_HANDLER_ID])) ((s32)a)) /* tHandler* UTIL_GetIrqHandler ( s32 );*/
174 #define UTIL_SetSchHandler(a,b) (((tCircleFunc2)(Circle_API [UTIL_SET_SCH_HANDLER_ID])) ((s32)a,(u32)b)) /* void UTIL_SetSchHandler ( s32 , tHandler );*/
175 #define UTIL_GetSchHandler(a) (u32) (((tCircleFunc1)(Circle_API [UTIL_GET_SCH_HANDLER_ID])) ((s32)a)) /* tHandler* UTIL_GetSchHandler ( s32 );*/
176 #define UTIL_GetTemp() (u32) (((tCircleFunc0)(Circle_API [UTIL_GET_TEMP_ID])) ()) /* u16 UTIL_GetTemp( void );*/
177 #define UTIL_SetTempMode(a) (((tCircleFunc1)(Circle_API [UTIL_SET_TEMPMODE_ID])) ((s32)a)) /* void UTIL_SetTempMode( s32 mode );*/
178 #define UTIL_GetPrimerType() (u32) (((tCircleFunc0)(Circle_API [UTIL_GET_PRIMERTYPE_ID])) ()) /* u16 UTIL_GetPrimerType();*/
179 #define UTIL_GetAppAddress(a) (u32) (((tCircleFunc1)(Circle_API [UTIL_GET_APP_ADDRESS_ID])) ((u32)(a))) /* long unsigned UTIL_GetAppAddress(u8* AppName);*/
180 #define UTIL_IsStandAloneMode() (u32) (((tCircleFunc0)(Circle_API [UTIL_IS_STAND_ALONE_ID])) ())
181 #define UTIL_SetTimer(a,b) (u32) (((tCircleFunc2)(Circle_API [UTIL_SETTIMER_ID])) ((u32)(a), (u32)(b))) /* void UTIL_SetTimer ( u32 millisec, void (*fTimerHandler) ( void ) ) ; */
182 #define UTIL_GetBatStatus() (u16) (((tCircleFunc0)(Circle_API [UTIL_GET_BATSTATUS_ID])) ()) /* u16 UTIL_GetBatteryStatus ( void ) ;*/
183 #define UTIL_SaveScreenBMP(a) (u32) (((tCircleFunc1)(Circle_API [UTIL_SAVE_SCREEN_BMP_ID])) ((u32)(a))) /* uint_t UTIL_SaveScreenBMP( char* filename ) ;*/
184 #define UTIL_SetDividerHandler(a,b) (((tCircleFunc2)(Circle_API [UTIL_SET_DIVIDER_HANDLER_ID])) ((u32)(a), (u16)(b))) /* void UTIL_SetDividerHandler(enum eSchHandler IDx, u16 divider) */
185 #define UTIL_GetDividerHandler(a) (u16) (((tCircleFunc1)(Circle_API [UTIL_GET_DIVIDER_HANDLER_ID])) ((u32)(a))) /* u16 UTIL_GetDividerHandler(enum eSchHandler IDx) */
186 
188 
189 /*--------------------------------- MEMS ------------------------------------*/
190 
191 /* Exported types ------------------------------------------------------------*/
192 
199 typedef enum
200 {
201  V12 = 0, // upright
202  V3 = 1, // on the right side
203  V6 = 2, // upside down
204  V9 = 3, // on the left side
205  V12BMP = 4,
206  V3BMP = 5,
207  V6BMP = 6,
208  V9BMP = 7
210 
215 typedef struct
216 {
217  s16 OutX;
218  s16 OutX_F4;
219  s16 OutX_F16;
220  s32 OutX_F64;
221  s32 OutX_F256;
222  s16 OutY;
223  s16 OutY_F4;
224  s16 OutY_F16;
225  s32 OutY_F64;
226  s32 OutY_F256;
227  s16 OutZ;
228  s16 OutZ_F4;
229  s16 OutZ_F16;
230  s32 OutZ_F64;
231  s32 OutZ_F256;
232  s16 Shocked;
236 } tMEMS_Info;
237 
239 
240 /* Exported defines ----------------------------------------------------------*/
241 
242 /* MEMS functions definition*/
243 #define MEMS_GET_POSITION_ID (MEMS_ID + 0) /* Return the current (relative) Mems information*/
244 #define MEMS_GET_ROTATION_ID (MEMS_ID + 1) /* Return the current screen orientation of the circle*/
245 #define MEMS_SET_NEUTRAL_ID (MEMS_ID + 2) /* Set the current position as "neutral position"*/
246 #define MEMS_GET_INFO_ID (MEMS_ID + 3) /* Return Mems informations*/
247 
248 /* Prototypes*/
249 #define MEMS_GetPosition(a,b) ((tCircleFunc2)(Circle_API [MEMS_GET_POSITION_ID])) ((u32)(a),(u32)(b)) /* void MEMS_GetPosition(s16 * pX, s16* pY);*/
250 #define MEMS_GetRotation(a) ((tCircleFunc1)(Circle_API [MEMS_GET_ROTATION_ID])) ((u32)(a)) /* void MEMS_GetRotation(Rotate_H12_V_Match_TypeDef * H12);*/
251 #define MEMS_SetNeutral() ((tCircleFunc0)(Circle_API [MEMS_SET_ROTATION_ID])) () /* void MEMS_SetNeutral( void );*/
252 #define MEMS_GetInfo() ( (tMEMS_Info*) (((tCircleFunc0)(Circle_API [MEMS_GET_INFO_ID])) ())) /* tMEMS_Info* MEMS_GetInfo (void)*/
253 
255 
256 /*-------------------------------- POINTER ----------------------------------*/
257 
258 /* Exported types ------------------------------------------------------------*/
259 
267 {
274 };
275 
283 {
287 };
288 
293 typedef struct
294 {
295  s16 xPos;
296  s16 yPos;
299  s16 X_PosMin;
300  s16 Y_PosMin;
301  s16 X_PosMax;
302  s16 Y_PosMax;
303 } tPointer_Info;
304 
306 
307 /* Exported defines ---------------------------------------------------------*/
308 #define POINTER_WIDTH 7
309 
310 /* POINTER functions definition*/
311 #define POINTER_SET_RECT_ID (POINTER_ID + 0) /* Set new limits for the move of the pointer*/
312 #define POINTER_SETRECTSCREEN_ID (POINTER_ID + 1) /* Remove any space restriction for the pointer moves.*/
313 #define POINTER_GETCURRENTANGLESTART_ID (POINTER_ID + 2) /* Return the current minimum angle to move pointer*/
314 #define POINTER_SETCURRENTANGLESTART_ID (POINTER_ID + 3) /* Set the current minimum angle to move pointer*/
315 #define POINTER_GETCURRENTSPEEDONANGLE_ID (POINTER_ID + 4) /* Return the ratio speed / angle*/
316 #define POINTER_SETCURRENTSPEEDONANGLE_ID (POINTER_ID + 5) /* Set the ratio speed / angle*/
317 #define POINTER_SETMODE_ID (POINTER_ID + 6) /* Change the current mode of the pointer management*/
318 #define POINTER_GETMODE_ID (POINTER_ID + 7) /* Return the current mode of the pointer management*/
319 #define POINTER_SETCURRENTPOINTER_ID (POINTER_ID + 8) /* Set the dimention and bitmap of pointer*/
320 #define POINTER_GETSTATE_ID (POINTER_ID + 9) /* Return the current state*/
321 #define POINTER_DRAW_ID (POINTER_ID + 10) /* Draw a pointer*/
322 #define POINTER_SAVE_ID (POINTER_ID + 11) /* Save the background of the pointer*/
323 #define POINTER_RESTORE_ID (POINTER_ID + 12) /* Restore the background of the pointer*/
324 #define POINTER_GETPOSITION_ID (POINTER_ID + 13) /* Return the poistion of the cursor (x=lower byte, y = upperbyte)*/
325 #define POINTER_SETPOSITION_ID (POINTER_ID + 14) /* Force the position of the pointer in the screen*/
326 #define POINTER_SETAPPLICATION_POINTER_MGR_ID (POINTER_ID + 15) /* Set the application pointer manager*/
327 #define POINTER_SETCOLOR_ID (POINTER_ID + 16) /* Set pointer color*/
328 #define POINTER_GETCOLOR_ID (POINTER_ID + 17) /* Return pointer color*/
329 #define POINTER_GETINFO_ID (POINTER_ID + 18) /* Return pointer informations*/
330 #define POINTER_SET_CURRENT_AREASTORE_ID (POINTER_ID + 19) /* Change the current storage area*/
331 
332 /* Prototypes*/
333 #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*/
334 #define POINTER_SetRectScreen() ((tCircleFunc0)(Circle_API [POINTER_SETRECTSCREEN_ID])) () /*void POINTER_SetRectScreen ( void );*/
335 #define POINTER_GetCurrentAngleStart() (u16) (((tCircleFunc0)(Circle_API [POINTER_GETCURRENTANGLESTART_ID])) ()) /*u16 POINTER_GetCurrentAngleStart ( void );*/
336 #define POINTER_SetCurrentAngleStart(a) ((tCircleFunc1)(Circle_API [POINTER_SETCURRENTANGLESTART_ID])) ((u32)(a)) /*void POINTER_SetCurrentAngleStart ( u16 );*/
337 #define POINTER_GetCurrentSpeedOnAngle() (u16) (((tCircleFunc0)(Circle_API [POINTER_GETCURRENTSPEEDONANGLE_ID])) ()) /*u16 POINTER_GetCurrentSpeedOnAngle ( void );*/
338 #define POINTER_SetCurrentSpeedOnAngle(a) ((tCircleFunc1)(Circle_API [POINTER_SETCURRENTSPEEDONANGLE_ID])) ((u32)(a)) /*void POINTER_SetCurrentSpeedOnAngle ( u16 newspeed );*/
339 #define POINTER_SetMode(a) ((tCircleFunc1)(Circle_API [POINTER_SETMODE_ID])) ((u32)(a)) /*void POINTER_SetMode( enum POINTER_mode mode);*/
340 #define POINTER_GetMode() (enum POINTER_mode)(((tCircleFunc0)(Circle_API [POINTER_GETMODE_ID])) ()) /*enum POINTER_mode POINTER_GetMode( void );*/
341 #define POINTER_SetCurrentPointer(a,b,c) ((tCircleFunc3)(Circle_API [POINTER_SETCURRENTPOINTER_ID])) ((u32)(a),(u32)(b),(u32)(c)) /*void POINTER_SetCurrentPointer( u8 width, u8 height, u8 *bmp);*/
342 #define POINTER_GetState() (enum POINTER_state)(((tCircleFunc0)(Circle_API [POINTER_GETSTATE_ID])) ()) /*enum POINTER_state POINTER_GetState(void);*/
343 #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);*/
344 #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);*/
345 #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);*/
346 #define POINTER_GetPos() (u16)(((tCircleFunc0)(Circle_API [POINTER_GETPOSITION_ID])) ()) /*u16 POINTER_GetPos(void);*/
347 #define POINTER_SetPos(a,b) ((tCircleFunc2)(Circle_API [POINTER_SETPOSITION_ID])) ((u32)(a),(u32)(b)) /*void POINTER_SetPos ( u16 x, u16 y );*/
348 #define POINTER_SetApplication_Pointer_Mgr(a) ((tCircleFunc1)(Circle_API [POINTER_SETAPPLICATION_POINTER_MGR_ID])) ((u32)(a)) /*void POINTER_SetApplication_Pointer_Mgr( tAppPtrMgr mgr );*/
349 #define POINTER_SetColor(a) ((tCircleFunc1)(Circle_API [POINTER_SETCOLOR_ID])) ((u32)(a)) /*void POINTER_SetColor ( u16 color )*/
350 #define POINTER_GetColor() (u16)(((tCircleFunc0)(Circle_API [POINTER_GETCOLOR_ID])) ()) /*u16 POINTER_GetColor ( void )*/
351 #define POINTER_GetInfo() (tPointer_Info*) (((tCircleFunc0)(Circle_API [POINTER_GETINFO_ID])) ()) /*tPointer_Info* POINTER_GetInfo ( void )*/
352 #define POINTER_SetCurrentAreaStore(a) ((tCircleFunc1)(Circle_API [POINTER_SET_CURRENT_AREASTORE_ID])) ((u32)(a)) /*void POINTER_SetCurrentAreaStore ( u8 *ptr )*/
353 
355 
356 /*-------------------------------- BUTTON -----------------------------------*/
357 
358 /* Exported types ------------------------------------------------------------*/
359 
367 {
372 };
373 
381 {
388 };
389 
391 
392 /* Exported defines ----------------------------------------------------------*/
393 
394 
395 /* BUTTON functions definition */
396 #define BUTTON_GETSTATE_ID (BUTTON_ID + 0) /* Return state of button*/
397 #define BUTTON_SETMODE_ID (BUTTON_ID + 1) /* Set button mode*/
398 #define BUTTON_GETMODE_ID (BUTTON_ID + 2) /* Return button mode*/
399 #define BUTTON_WAITFORRELEASE_ID (BUTTON_ID + 3) /* Disable temporarily any new button event*/
400 
401 /* Prototypes*/
402 #define BUTTON_GetState() (enum BUTTON_state)(((tCircleFunc0)(Circle_API [BUTTON_GETSTATE_ID])) ()) /* enum BUTTON_state BUTTON_GetState(void);*/
403 #define BUTTON_SetMode(a) ((tCircleFunc1)(Circle_API [BUTTON_SETMODE_ID])) ((u32)(a)) /* void BUTTON_SetMode( enum BUTTON_mode mode);*/
404 #define BUTTON_GetMode() (enum BUTTON_mode)(((tCircleFunc0)(Circle_API [BUTTON_GETMODE_ID])) ()) /* enum BUTTON_mode BUTTON_GetMode ( void ) ;*/
405 #define BUTTON_WaitForRelease() ((tCircleFunc0)(Circle_API [BUTTON_WAITFORRELEASE_ID])) () /* void BUTTON_WaitForRelease(void);*/
406 
408 
409 /*------------------------------ JOYSTICK -----------------------------------*/
410 
411 /* Exported types ------------------------------------------------------------*/
412 
420 {
427  JOYSTICK_RIGHT_UP = 11, /*JOYSTICK_RIGHT | JOYSTICK_UP*/
428  JOYSTICK_LEFT_UP = 5, /*JOYSTICK_LEFT | JOYSTICK_UP*/
429  JOYSTICK_RIGHT_DOWN = 13, /*JOYSTICK_RIGHT | JOYSTICK_DOWN*/
430  JOYSTICK_LEFT_DOWN = 7, /*JOYSTICK_LEFT | JOYSTICK_DOWN */
431 };
432 
434 
435 /* Exported defines ----------------------------------------------------------*/
436 
437 /* JOYSTICK functions definition*/
438 #define JOYSTICK_GETSTATE_ID (JOYSTICK_ID + 0) /* Return state of joystick*/
439 #define JOYSTICK_WAITFORRELEASE_ID (JOYSTICK_ID + 1) /* Disable temporarily any new joystick event*/
440 
441 /* Prototypes*/
442 #define JOYSTICK_GetState() (enum JOYSTICK_state) (((tCircleFunc0)(Circle_API [JOYSTICK_GETSTATE_ID])) ()) // enum JOYSTICK_state JOYSTICK_GetState(void);
443 #define JOYSTICK_WaitForRelease() ((tCircleFunc0)(Circle_API [JOYSTICK_WAITFORRELEASE_ID])) () // void JOYSTICK_WaitForRelease(void);
444 
446 
447 
448 /*------------------------------ CX Extension control ----------------------*/
449 
450 /* Exported types ------------------------------------------------------------*/
451 
458 typedef enum
459 {
464  CX_USART = 0x20, CX_SPI = 0x21, CX_I2C = 0x22, CX_ADC1 = 0x23, CX_ADC2 = 0x24
465 } tCX_ID;
466 
473 typedef enum
474 {
480 } tCX_GPIO_Mode;
481 
487 typedef struct
488 {
489  u32 BaudRate; // An integer specifying the baud rate in bit per second.
490  u32 WordLength; // The number of transferred data bit
491  u32 StopBits; // The number of stop bits
492  u32 Parity; // The parity : 0 for none, 1 for odd and 2 for even.
493  u32 HWControl; // The flow control: 0: none, 1: RTS, 2: CTS, 3: RTS and CTS
494  u8* RxBuffer; // Rolling buffer to be used for reception
495  u32 RxBufferLen; // Size of the receive buffer
496  u8* TxBuffer; // Buffer to be used for trasmission
497  u32 TxBufferLen; // Size of the transmit buffer
499 
505 typedef enum
506 {
507  CX_SPI_Speed_standard = 0, // Equivalent to CX_SPI_Speed_Low (2)
508  CX_SPI_Speed_VeryLow = 1, // Typically 10kbps
509  CX_SPI_Speed_Low = 2, // Typically 100kbps
510  CX_SPI_Mode_High = 3, // Typically 1Mbps
511  CX_SPI_Mode_VeryHigh = 4 // Typically 10Mbps
512 } tCX_SPI_Speed ;
513 
519 typedef struct
520 {
521  tCX_SPI_Speed Speed;// The speed range of the serial bit rate.
522  u8 WordLength; // The number of transferred data bit. Standard is 8, but could be 16 for some specific devices.
523  u8 Mode; // 1: master, 0: slave
524  u8 Polarity; // Indicates the steady state (idle state of the clock when no transmission).
525  u8 Phase; // Phase: 0 indicates that the first edge of the clock when leaving the idle state is active
526  // 1 indicates that the second edge of the clock when leaving the idle state is active
527  u8 MSB1LSB0; // First bit to be sent. 1: MSB first, 0: LSB first
528  u8 Nss; // Nss signal management : 1 = hardware / 0 = software
529  u8* RxBuffer; // Rolling buffer to be used for reception
530  u32 RxBufferLen; // Size of the receive buffer
531  u8* TxBuffer; // Buffer to be used for transmission
532  u32 TxBufferLen; // Size of the transmit buffer
534 
535 /* Exported defines ----------------------------------------------------------*/
536 #define CX_GPIO_LOW (0)
537 #define CX_GPIO_HIGH (1)
538 
539 #define CX_NO_ERROR 0
540 #define CX_USART_PARITYERR 0x01
541 #define CX_USART_FRAMEERR 0x02
542 #define CX_USART_NOISEERR 0x04
543 #define CX_USART_OVERRUN 0x08
544 
545 #define CX_SPI_OVERRUN 0x20
546 #define CX_SPI_MODF 0x40
547 
548 #define CX_SPI_MODE_SLAVE 0
549 #define CX_SPI_MODE_MASTER 1
550 #define CX_SPI_POL_LOW 0
551 #define CX_SPI_POL_HIGH 1
552 #define CX_SPI_PHA_FIRST 0
553 #define CX_SPI_PHA_SECOND 1
554 #define CX_SPI_MSBFIRST 0
555 #define CX_SPI_LSBFIRST 1
556 #define CX_SPI_8_Bits 0
557 #define CX_SPI_16_Bits 1
558 #define CX_SPI_Soft 0
559 #define CX_SPI_Hard 1
560 
562 
563 /* CX functions definition*/
564 #define CX_CONFIGURE_ID (CX_ID + 0) /* Configure peripheral of the extension connector */
565 #define CX_WRITE_ID (CX_ID + 1) /* Write data to peripheral on the extension connector*/
566 #define CX_READ_ID (CX_ID + 2) /* Read data from peripheral of the extension connector */
567 
568 /* Prototypes*/
569 #define CX_Configure(a,b,c) (((tCircleFunc3)(Circle_API [CX_CONFIGURE_ID])) ((u32)(a),(u32)(b),(u32)(c))) // s32 CX_Configure ( tCX_ID what, s32 param1, s32 param2 );
570 #define CX_Write(a,b,c) (((tCircleFunc3)(Circle_API [CX_WRITE_ID])) ((u32)(a),(u32)(b),(u32)(c))) // s32 CX_Configure ( tCX_ID what, s32 param1, s32 param2 );
571 #define CX_Read(a,b,c) (((tCircleFunc3)(Circle_API [CX_READ_ID])) ((u32)(a),(u32)(b),(u32)(c))) // s32 CX_Configure ( tCX_ID what, s32 param1, s32 param2 );
572 
574 
575 /*---------------------------------- LCD -----------------------------------*/
576 /* Exported defines ----------------------------------------------------------*/
577 
578 /* RGB is 16-bit coded as G2G1G0B4 B3B2B1B0 R4R3R2R1 R0G5G4G3*/
579 #define RGB_MAKE(xR,xG,xB) ( ( (((xG)>>2)&0x07)<<13 ) + ( (xG)>>5 ) + \
580  ( ((xB)>>3) << 8 ) + \
581  ( ((xR)>>3) << 3 ) )
583 // Major HTML Color codes
584 #define RGB_RED RGB_MAKE(0xFF, 0x00, 0x00) //0x00F8
585 #define RGB_GREEN RGB_MAKE(0x00, 0xFF, 0x00) //0xE007 (official name is PASTELGREEN)
586 #define RGB_PASTELGREEN RGB_MAKE(0x00, 0xFF, 0x00)
587 #define RGB_LIGHTBLUE RGB_MAKE(0x00, 0x00, 0xFF) //0x1F00 (was 0xFF07 in CircleOS 3)
588 #define RGB_BLUE RGB_MAKE(0x00, 0x00, 0xFF) //0x1F00 (official name is LIGHTBLUE)
589 #define RGB_BLACK RGB_MAKE(0x00, 0x00, 0x00) //0x0000
590 #define RGB_WHITE RGB_MAKE(0xFF, 0xFF, 0xFF) //0xFFFF
591 #define RGB_YELLOW RGB_MAKE(0xFF, 0xFF, 0x00) //0xE0FF
592 #define RGB_MAGENTA RGB_MAKE(0xFF, 0x00, 0xFF) //0x1FF8
593 #define RGB_TURQUOISE RGB_MAKE(0x00, 0xFF, 0xFF)
594 #define RGB_ORANGE RGB_MAKE(0xFF, 0x80, 0x40) //0x08FC (was 0xE0F9 in CircleOS 3)
595 #define RGB_PINK RGB_MAKE(0xFF, 0x3F, 0xFF) //0xFFF9
596 #define RGB_LIGHTGREY RGB_MAKE(0xC0, 0xC0, 0xC0)
597 #define RGB_DARKGREY RGB_MAKE(0x80, 0x80, 0x80)
598 #define RGB_DARKBLUE RGB_MAKE(0x00, 0x00, 0xA0)
599 #define RGB_LIGHTPURPLE RGB_MAKE(0xFF, 0x00, 0x80)
600 #define RGB_DARKPURPLE RGB_MAKE(0x80, 0x00, 0x80)
601 #define RGB_BROWN RGB_MAKE(0x80, 0x40, 0x00)
602 #define RGB_BURGUNDY RGB_MAKE(0x80, 0x00, 0x00)
603 #define RGB_FORESTGREEN RGB_MAKE(0x80, 0x80, 0x00)
604 #define RGB_GRASSGREEN RGB_MAKE(0x40, 0x80, 0x80)
606 /* PWM rates.*/
607 #define BACKLIGHTMIN 0x1000
608 #define DEFAULT_CCR_BACKLIGHTSTART 0x8000
610 /* Characters Infos*/
611 #define CHAR_WIDTH 7
612 #define CHAR_HEIGHT 14
614 /* Font Structures */
615 #define MAX_FONT_NB 20
616 
617 typedef enum
618 {
620  FONT_PRIMERX2 = 1,
626 typedef struct
627 {
629  u8 width;
630  u8 height;
631  u8 FontCoeff;
632  u8 ASCII_start;
633  u8 ASCII_end;
634  u8 *font;
635  u8 title[16];
638 typedef struct
639 {
640  u8 nb;
641  tFontDef fonts[MAX_FONT_NB];
644 
646 
647 /* LCD functions definition*/
648 #define LCD_SETRECTFORCMD_ID (LCD_ID + 0) /* Define the rectangle (for the next command to be applied)*/
649 #define LCD_GETPIXEL_ID (LCD_ID + 1) /* Read the value of one pixel*/
650 #define LCD_DRAWPIXEL_ID (LCD_ID + 2) /* Draw a Graphic image on slave LCD.*/
651 #define LCD_SENDLCDCMD_ID (LCD_ID + 3) /* Send one byte command to LCD.*/
652 #define LCD_SENDLCDDATA_ID (LCD_ID + 4) /* Display one byte data to LCD.*/
653 #define LCD_READLCDDATA_ID (LCD_ID + 5) /* Read LCD byte data displayed on LCD.*/
654 #define LCD_FILLRECT_ID (LCD_ID + 6) /* Fill a rectangle with one color*/
655 #define LCD_DRAWRECT_ID (LCD_ID + 7) /* Draw a rectangle with one color*/
656 #define LCD_DISPLAYCHAR_ID (LCD_ID + 8) /* Display one character*/
657 #define LCD_RECTREAD_ID (LCD_ID + 9) /* Save a rectangle of the monitor RAM*/
658 #define LCD_SETBACKLIGHT_ID (LCD_ID + 10) /* Modify the PWM rate*/
659 #define LCD_GETBACKLIGHT_ID (LCD_ID + 11) /* Return the PWM rate*/
660 #define LCD_SETROTATESCREEN_ID (LCD_ID + 12) /* Enable/Disable screen rotation*/
661 #define LCD_GETROTATESCREEN_ID (LCD_ID + 13) /* Return screen rotation mode*/
662 #define LCD_SETSCREENORIENTATION_ID (LCD_ID + 14) /* Set screen orientation*/
663 #define LCD_GETSCREENORIENTATION_ID (LCD_ID + 15) /* Return screen orientation*/
664 #define LCD_SETBACKLIGHT_OFF_ID (LCD_ID + 16) /* Switch the LCD back light off.*/
665 #define LCD_SETBACKLIGHT_ON_ID (LCD_ID + 17) /* Switch the LCD back light on.*/
666 #define LCD_SETFONT_ID (LCD_ID + 18) /* Switch to a new font.*/
667 #define LCD_SETDEFAULT_ID (LCD_ID + 19) /* Switch to the default system font.*/
668 #define LCD_SETOFFSET_ID (LCD_ID + 20) /* Activate the offset.*/
669 #define LCD_GETSCREENWIDTH_ID (LCD_ID + 21) /* Return the width of the screen in pixels.*/
670 #define LCD_GETSCREENHEIGHT_ID (LCD_ID + 22) /* Return the height of the screen in pixels.*/
671 #define LCD_SETFONTDEF_ID (LCD_ID + 23) /* Change the current font definitition to fit with a new current font.*/
672 #define LCD_GETFONTDEF_ID (LCD_ID + 24) /* Get the current font definitition.*/
673 #define LCD_CHANGEFONT_ID (LCD_ID + 25) /* Change the current font and its definitition.*/
674 #define LCD_SETTRANSPARENCY_ID (LCD_ID + 26) /* Return the transparency value for the characters.*/
675 #define LCD_GETTRANSPARENCY_ID (LCD_ID + 27) /* Set the transparency value for the characters.*/
676 #define LCD_FULLSCREEN_ID (LCD_ID + 28) /* Enable or disable the possibility to use all the screen.*/
677 
678 /* Prototypes*/
679 #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)*/
680 #define LCD_GetPixel(a,b) (u16)(((tCircleFunc2)(Circle_API [LCD_GETPIXEL_ID])) ((u32)(a),(u32)(b))) /*u16 LCD_GetPixel (u8 x, u8 y)*/
681 #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) ;*/
682 #define LCD_SendLCDCmd(a) ((tCircleFunc1)(Circle_API [LCD_SENDLCDCMD_ID])) ((u32)(a)) /*void LCD_SendLCDCmd(u8 Cmd);*/
683 #define LCD_SendLCDData(a) ((tCircleFunc1)(Circle_API [LCD_SENDLCDDATA_ID])) ((u32)(a)) /*void LCD_SendLCDData(u8 Data);*/
684 #define LCD_ReadLCDData() (u32)(((tCircleFunc0)(Circle_API [LCD_READLCDDATA_ID])) ()) /*u32 LCD_ReadLCDData(void);*/
685 #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 );*/
686 #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 );*/
687 #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),(mag_t)(f))/*void LCD_DisplayChar(u8 x, u8 y, u8 Ascii, u16 TextColor, u16 BGndColor, mag_t CharMagniCoeff);*/
688 #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 );*/
689 #define LCD_SetBackLight(a) ((tCircleFunc1)(Circle_API [LCD_SETBACKLIGHT_ID])) ((u32)(a)) /*void LCD_SetBackLight(u32 newBaclightStart);*/
690 #define LCD_GetBackLight() (u32)(((tCircleFunc0)(Circle_API [LCD_GETBACKLIGHT_ID])) ()) /*u32 LCD_GetBackLight(void);*/
691 #define LCD_SetRotateScreen(a) ((tCircleFunc1)(Circle_API [LCD_SETROTATESCREEN_ID])) ((u32)(a)) /*void LCD_SetRotateScreen ( u8 RotateScreen)*/
692 #define LCD_GetRotateScreen() (u32)(((tCircleFunc0)(Circle_API [LCD_GETROTATESCREEN_ID])) ()) /*u8 LCD_GetRotateScreen (void)*/
693 #define LCD_SetScreenOrientation(a) ((tCircleFunc1)(Circle_API [LCD_SETSCREENORIENTATION_ID])) ((u32)(a)) /*void LCD_SetScreenOrientation (Rotate_H12_V_Match_TypeDef ScreenOrientation)*/
694 #define LCD_GetScreenOrientation() (u32)(((tCircleFunc0)(Circle_API [LCD_GETSCREENORIENTATION_ID])) ()) /*Rotate_H12_V_Match_TypeDef LCD_GetScreenOrientation (void)*/
695 #define LCD_SetBackLightOff() ((tCircleFunc0)(Circle_API [LCD_SETBACKLIGHT_OFF_ID])) ()
696 #define LCD_SetBackLightOn() ((tCircleFunc0)(Circle_API [LCD_SETBACKLIGHT_ON_ID])) ()
697 #define LCD_SetFont(a) ((tCircleFunc1)(Circle_API [LCD_SETFONT_ID])) ((u32)(a)) /*void LCD_SetFont(u8* NewFont);*/
698 #define LCD_SetDefaultFont() ((tCircleFunc0)(Circle_API [LCD_SETDEFAULT_ID])) () /*void LCD_SetDefaultFont(void);*/
699 #define LCD_SetOffset(a) ((tCircleFunc1)(Circle_API [LCD_SETOFFSET_ID])) ((u32)(a)) /*void LCD_SetOffset( ENUM_Offset Offset );*/
700 #define LCD_GetScreenWidth() (s16)(((tCircleFunc0)(Circle_API [LCD_GETSCREENWIDTH_ID])) ()) /*coord_t LCD_GetScreenWidth( void )*/
701 #define LCD_GetScreenHeight() (s16)(((tCircleFunc0)(Circle_API [LCD_GETSCREENHEIGHT_ID])) ()) /*coord_t LCD_GetScreenHeight( void )*/
702 #define LCD_SetFontDef(a) ((tCircleFunc1)(Circle_API [LCD_SETFONTDEF_ID])) ((u32)(a)) /*void LCD_SetFontDef(u32* FontDef);*/
703 #define LCD_GetFontDef(a) (tFontDef*)((tCircleFunc0)(Circle_API [LCD_GETFONTDEF_ID])) () /*tFontDef* LCD_GetFontDef( void );*/
704 #define LCD_ChangeFont(a) ((tCircleFunc1)(Circle_API [LCD_CHANGEFONT_ID])) ((u8)(a)) /*void LCD_ChangeFont(u8 ENUM_FontID ID);*/
705 #define LCD_SetTransparency(a) ((tCircleFunc1)(Circle_API [LCD_SETTRANSPARENCY_ID])) ((bool)(a)) /*void LCD_SetTransparency( u8 NewTransparency )*/
706 #define LCD_GetTransparency() (u8)(((tCircleFunc0)(Circle_API [LCD_GETTRANSPARENCY_ID])) ()) /*u8 LCD_GetTransparency( void )*/
707 #define LCD_FullScreen(a) ((tCircleFunc1)(Circle_API [LCD_FULLSCREEN_ID])) ((u8)(a)) /*void LCD_FullScreen( u8 FullScreenONOFF )*/
708 
710 /*---------------------------------- DRAW ----------------------------------*/
711 
712 /* Exported defines ----------------------------------------------------------*/
713 enum Align { LEFT = 0, CENTER = 1, RIGHT = 2 };
714 #define INVERTED_TEXT 1
715 #define NORMAL_TEXT 0
716 #define ALL_SCREEN -1 /*< To center the text in the screen for draw functions. */
718 enum SELECT_MODE { SELNONE = 0, SELADDR = 1, SELDISP = 2, SELFULL = 3 };
719 
720 typedef int ( *tFctXY )( int x, int y );
721 typedef struct
722 {
723  tFctXY mFctX;
724  tFctXY mFctY;
725  u32 mDefault;
729 
730 /* DRAW functions definition*/
731 #define DRAW_SETDEFAULTCOLOR_ID (DRAW_ID + 0) /* Reset colors (bgnd + text)*/
732 #define DRAW_CLEAR_ID (DRAW_ID + 1) /* Clear the LCD display*/
733 #define DRAW_SETIMAGE_ID (DRAW_ID + 2) /* Draw a colored image*/
734 #define DRAW_SETIMAGEBW_ID (DRAW_ID + 3) /* Draw a black and white image*/
735 #define DRAW_SETLOGOBW_ID (DRAW_ID + 4) /* Draw logo*/
736 #define DRAW_DISPLAYVBAT_ID (DRAW_ID + 5) /* Display the voltage of battery in ascii*/
737 #define DRAW_DISPLAYTIME_ID (DRAW_ID + 6) /* Display time in ascii*/
738 #define DRAW_DISPLAYSTRING_ID (DRAW_ID + 7) /* Display a x char max string of characters*/
739 #define DRAW_DISPLAYSTRINGINVERTED_ID (DRAW_ID + 8) /* Display a x char max string of characters with inverted colors*/
740 #define DRAW_GETCHARMAGNICOEFF_ID (DRAW_ID + 9) /* Return the magnifying value for the characters*/
741 #define DRAW_SETCHARMAGNICOEFF_ID (DRAW_ID + 10) /* Set the magnifying value for the characters*/
742 #define DRAW_GETTEXTCOLOR_ID (DRAW_ID + 11) /* Return the current text color*/
743 #define DRAW_SETTEXTCOLOR_ID (DRAW_ID + 12) /* Set the current text color*/
744 #define DRAW_GETBGNDCOLOR_ID (DRAW_ID + 13) /* Return the current background color*/
745 #define DRAW_SETBGNDCOLOR_ID (DRAW_ID + 14) /* Set the current background color*/
746 #define DRAW_LINE_ID (DRAW_ID + 15) /* Draw a Line between (using Bresenham algorithm) */
747 #define DRAW_SETIMAGESEL_ID (DRAW_ID + 16) /* Draw a colored image with selected background color*/
748 #define DRAW_PUTC_ID (DRAW_ID + 17) /* Set the current position of the cursor*/
749 #define DRAW_PUTS_ID (DRAW_ID + 18) /* Draw a colored image with selected background color*/
750 #define DRAW_SETCURSOR_POS_ID (DRAW_ID + 19) /* Set the current position of the cursor*/
751 #define DRAW_GETCURSOR_POS_ID (DRAW_ID + 20) /* Get the current position of the cursor*/
752 #define DRAW_SETCURSORMARGIN_ID (DRAW_ID + 21) /* Set the current margins of the cursor*/
753 #define DRAW_GETCURSORMARGIN_ID (DRAW_ID + 22) /* Get the current margins of the cursor*/
754 #define DRAW_DISPLAYSTRINGMODE_ID (DRAW_ID + 23) /* Display a x char max string of characters with attributes*/
755 #define DRAW_DRAW_CIRCLE_ID (DRAW_ID + 24) /* Display a circle with attributes*/
756 #define DRAW_DRAW_ELLIPSE_ID (DRAW_ID + 25) /* Display a ellipse with attributes*/
757 #define DRAW_DRAW_POLYGONE_ID (DRAW_ID + 26) /* Display a polygone*/
758 #define DRAW_DMA2D_DIPATCH_ID (DRAW_ID + 31) /* Dispatch to the set of functions dedicatedd to DMA2D */
759 
760 /*Prototypes*/
761 #define DRAW_SetDefaultColor() ((tCircleFunc0)(Circle_API [DRAW_SETDEFAULTCOLOR_ID])) () /*void DRAW_SetDefaultColor (void);*/
762 #define DRAW_Clear() ((tCircleFunc0)(Circle_API [DRAW_CLEAR_ID])) () /*void DRAW_Clear(void);*/
763 #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);*/
764 #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);*/
765 #define DRAW_SetLogoBW() ((tCircleFunc0)(Circle_API [DRAW_SETLOGOBW_ID])) () /*void DRAW_SetLogoBW(void);*/
766 #define DRAW_DisplayVbat(a,b) ((tCircleFunc2)(Circle_API [DRAW_DISPLAYVBAT_ID])) ((u32)(a),(u32)(b)) /*void DRAW_DisplayVbat(u8 x, u8 y);*/
767 #define DRAW_DisplayTime(a,b) ((tCircleFunc2)(Circle_API [DRAW_DISPLAYTIME_ID])) ((u32)(a),(u32)(b)) /*void DRAW_DisplayTime(u8 x, u8 y);*/
768 #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 );*/
769 #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 );*/
770 #define DRAW_GetCharMagniCoeff() (u16)(((tCircleFunc0)(Circle_API [DRAW_GETCHARMAGNICOEFF_ID])) ()) /*u16 DRAW_GetCharMagniCoeff(void);*/
771 #define DRAW_SetCharMagniCoeff(a) ((tCircleFunc1)(Circle_API [DRAW_SETCHARMAGNICOEFF_ID])) ((u32)(a)) /*void DRAW_SetCharMagniCoeff(u16 Coeff);*/
772 #define DRAW_GetTextColor() (u16)(((tCircleFunc0)(Circle_API [DRAW_GETTEXTCOLOR_ID])) ()) /*u16 DRAW_GetTextColor(void);*/
773 #define DRAW_SetTextColor(a) ((tCircleFunc1)(Circle_API [DRAW_SETTEXTCOLOR_ID])) ((u32)(a)) /*void DRAW_SetTextColor(u16 Color);*/
774 #define DRAW_GetBGndColor() (u16)(((tCircleFunc0)(Circle_API [DRAW_GETBGNDCOLOR_ID])) ()) /*u16 DRAW_GetBGndColor(void);*/
775 #define DRAW_SetBGndColor(a) ((tCircleFunc1)(Circle_API [DRAW_SETBGNDCOLOR_ID])) ((u32)(a)) /*void DRAW_SetBGndColor(u16 Color);*/
776 #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 );*/
777 #define DRAW_SetImageSel(a,b,c,d,e,f,g) ((tCircleFunc7)(Circle_API [DRAW_SETIMAGESEL_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d),(u32)(e),(u32)(f),(u32)(g)) /*void DRAW_SetImageSel(const u16* imageptr, u8 x, u8 y, u8 width, u8 height, u16 oldBgndColor, u16 newBgndColor);*/
778 #define DRAW_Putc(a) ((tCircleFunc1)(Circle_API [DRAW_PUTC_ID])) ((u32)(a)) /*void DRAW_Putc( u8 Ascii );*/
779 #define DRAW_Puts(a) ((tCircleFunc1)(Circle_API [DRAW_PUTS_ID])) ((u32)(a)) /*void DRAW_Puts( const u8* ptr );*/
780 #define DRAW_SetCursorPos(a,b) ((tCircleFunc2)(Circle_API [DRAW_SETCURSOR_POS_ID])) ((u32)(a),(u32)(b)) /*void DRAW_SetCursorPos( s32 x, s32 y );*/
781 #define DRAW_GetCursorPos() (u16)(((tCircleFunc0)(Circle_API [DRAW_GETCURSOR_POS_ID])) ()) /*s32 DRAW_GetCursorPos();*/
782 #define DRAW_SetCursorMargin(a,b,c,d) ((tCircleFunc4)(Circle_API [DRAW_SETCURSORMARGIN_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d)) /*void DRAW_SetCursorMargin( s32 lx, s32 rx, s32 hy, s32 ly );*/
783 #define DRAW_GetCursorMargin(a,b,c,d) ((tCircleFunc4)(Circle_API [DRAW_GETCURSORMARGIN_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d)) /*void DRAW_GetCursorMargin( s32* lx, s32* rx, s32* hy, s32* ly );*/
784 #define DRAW_DisplayStringWithMode(a,b,c,d,e,f) ((tCircleFunc6)(Circle_API [DRAW_DISPLAYSTRINGMODE_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d),(u32)(e),(u32)(f)) /*void DRAW_DisplayStringWithMode( coord_t x, coord_t y, const u8* ptr, len_t len, bool mode, enumset_t align );*/
785 #define DRAW_Circle(a,b,c,d,e,f,g) ((tCircleFunc7)(Circle_API [DRAW_DRAW_CIRCLE_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d),(u32)(e),(u32)(f),(u32)(g)) /*DRAW_Circle(coord_t CENTER_x, coord_t CENTER_y, coord_t RADIUS_r, color_t Color, color_t Fill_Color, bool Fill, bool Circle);*/
786 #define DRAW_Ellipse(a,b,c,d,e,f,g,h) ((tCircleFunc8)(Circle_API [DRAW_DRAW_ELLIPSE_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d),(u32)(e),(u32)(f),(u32)(g),(u32)(h)) /*DRAW_Ellipse( coord_t CENTER_x, coord_t CENTER_y, coord_t RADIUS_a, coord_t RADIUS_b, color_t Color, color_t Fill_Color, bool Fill, bool Ellipse);*/
787 #define DRAW_Polygon(a,b,c) ((tCircleFunc3)(Circle_API [DRAW_DRAW_POLYGONE_ID])) ((u32)(a),(u32)(b),(u32)(c)) /*DRAW_Polygon(coord_t *points, u16 NUM_Points, color_t Line_Color)*/
788 
789 /* DMA2D functions definition */
790 #define DRAW_DMA2D_Dispatch(a,b,c,d) (u32) ((tCircleFunc4)(Circle_API [DRAW_DMA2D_DIPATCH_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d)) /*u32 DRAW_DMA2D_Dispatch( u32 fct, u32 param1, u32 param2, u32 param3 )*/
791 
792 enum CD_DMA2D_FCT
793 {
794  CD_SCREENINIT = 0,
795  CD_UPDATE = 1,
796  CD_UNUSED_2 = 2,
797  CD_SCREENCLEAR = 3,
798  CD_SCREENSELECT = 4,
799  CD_SCREENSETDIRTY = 5,
800  CD_SCREENREDRAW = 6,
801  CD_SCREENCOPY = 7,
802  CD_SCREENUNUSED = 8,
803  CD_OBJECTCREATE = 9,
804  CD_OBJECTDELETE = 10,
807  CD_OBJECTSETPARTIAL = 13,
808  CD_OBJECTMOVE = 14,
809  CD_OBJECTSETVISIBLE = 15,
810  CD_OBJECTSELECT = 16,
812  CD_OBJECTGETPIXEL = 18,
814  CD_OBJECTGETPOS = 20,
815  CD_OBJECTGETSIZE = 21,
816  CD_OBJECTFIND = 22,
817  CD_OBJECTGETIMAGE = 23,
818  CD_OBJECTSETOFFSET = 24,
819  CD_OBJECTPOPZ = 25,
820  CD_OBJECTPUSHZ = 26,
823  CD_SETTRANSFORM = 29,
824  CD_OBJECTTRANSFORM = 30,
826 };
827 
828 /*Prototypes*/
829 #define DMA2D_ScreenInit() DRAW_DMA2D_Dispatch(CD_SCREENINIT,0,0,0)
830 #define DMA2D_Update() DRAW_DMA2D_Dispatch(CD_UPDATE,0,0,0)
831 #define DMA2D_ScreenClear(screen,del) DRAW_DMA2D_Dispatch(CD_SCREENCLEAR,(u32)screen,(u32)del,0)
832 #define DMA2D_ScreenSelect(screen,mode) DRAW_DMA2D_Dispatch(CD_SCREENSELECT,screen, mode, 0)
833 #define DMA2D_ScreenSetDirty(screen) DRAW_DMA2D_Dispatch(CD_SCREENSETDIRTY,screen,0,0)
834 #define DMA2D_ScreenRedraw(screen) DRAW_DMA2D_Dispatch(CD_SCREENREDRAW,screen,0,0)
835 #define DMA2D_ScreenCopy(dest,src) DRAW_DMA2D_Dispatch(CD_SCREENCOPY,dest,src,0)
836 #define DMA2D_ObjectCreate(width,height,rdonly) (void*)DRAW_DMA2D_Dispatch(CD_OBJECTCREATE,width,height,rdonly)
837 #define DMA2D_ObjectDelete(obj) DRAW_DMA2D_Dispatch(CD_OBJECTDELETE,obj,0,0)
838 #define DMA2D_ObjectSetToScreen(obj,screen) DRAW_DMA2D_Dispatch(CD_OBJECTSETTOSCREEN,obj,screen,0)
839 #define DMA2D_ObjectAssignBitmap(obj,pbitmap,fbitmap0constant1) DRAW_DMA2D_Dispatch(CD_OBJECTASSIGNBITMAP,obj,pbitmap,fbitmap0constant1)
840 #define DMA2D_ObjectSetPartial(obj,width,height) DRAW_DMA2D_Dispatch(CD_OBJECTSETPARTIAL,obj,width,height)
841 #define DMA2D_ObjectSetOffset(obj,x,y) DRAW_DMA2D_Dispatch(CD_OBJECTSETOFFSET,obj,x,y)
842 #define DMA2D_ObjectMove(obj,x,y) DRAW_DMA2D_Dispatch(CD_OBJECTMOVE,obj,x,y)
843 #define DMA2D_ObjectSetVisible(obj,mode) DRAW_DMA2D_Dispatch(CD_OBJECTSETVISIBLE,obj,mode,0)
844 #define DMA2D_ObjectSelect(obj) DRAW_DMA2D_Dispatch(CD_OBJECTSELECT,obj,0,0)
845 #define DMA2D_ObjectSetTransparency(obj,transp) DRAW_DMA2D_Dispatch(CD_OBJECTSETTRANSPARENCY,obj,transp,0)
846 #define DMA2D_ObjectGetPixel(obj, x, y) DRAW_DMA2D_Dispatch(CD_OBJECTGETPIXEL,obj,x,y)
847 #define DMA2D_ObjectGetIntersection(screen,obj1, obj2) DRAW_DMA2D_Dispatch(CD_OBJECTGETINTERSECTION,screen,obj1,obj2)
848 #define DMA2D_ObjectGetPos(obj, screen) DRAW_DMA2D_Dispatch(CD_OBJECTGETPOS,obj,screen,0)
849 #define DMA2D_ObjectGetSize(obj) DRAW_DMA2D_Dispatch(CD_OBJECTGETSIZE,obj,0,0)
850 #define DMA2D_ObjectFind(screen,x,y) (void*)DRAW_DMA2D_Dispatch(CD_OBJECTFIND,screen,x,y)
851 #define DMA2D_ObjectGetImage(obj) (u32*)DRAW_DMA2D_Dispatch(CD_OBJECTGETIMAGE,obj,0,0)
852 #define DMA2D_ObjectPushZ(obj, screen) DRAW_DMA2D_Dispatch(CD_OBJECTPUSHZ,obj,screen,0)
853 #define DMA2D_ObjectPopZ(obj, screen) DRAW_DMA2D_Dispatch(CD_OBJECTPOPZ,obj,screen,0)
854 #define DMA2D_ObjectSetForeground(obj, screen) DRAW_DMA2D_Dispatch(CD_OBJECTSETFOREGROUND,obj,screen,0)
855 #define DMA2D_ObjectSetBackground(obj, screen) DRAW_DMA2D_Dispatch(CD_OBJECTSETBACKGROUND,obj,screen,0)
856 #define DMA2D_SetTransform(fct_X,fct_Y) DRAW_DMA2D_Dispatch(CD_SETTRANSFORM,fct_X,fct_Y,0)
857 #define DMA2D_ObjectTransform(obj_dest,obj_src,color) DRAW_DMA2D_Dispatch(CD_OBJECTTRANSFORM,obj_dest,obj_src,color)
858 #define DMA2D_ObjectTransformReverse(obj_dest,obj_src,fct) DRAW_DMA2D_Dispatch(CD_OBJECTTRANSFORMREVERSE,obj_dest,obj_src,fct)
859 
861 
862 
863 /*-------------------------------- BUZZER -----------------------------------*/
864 
865 /* Exported type def ---------------------------------------------------------*/
866 
873 enum BUZZER_mode
874 {
876  BUZZER_OFF = 0,
877  BUZZER_ON = 1,
881 };
884 
885 /* Exported defines ----------------------------------------------------------*/
886 #define BUZZER_BEEP BUZZER_SHORTBEEP
887 
888 /* BUZZER functions definition*/
889 #define BUZZER_SETMODE_ID (BUZZER_ID + 0) /* Set new buzzer mode*/
890 #define BUZZER_GETMODE_ID (BUZZER_ID + 1) /* Get the current buzzer mode.*/
891 #define BUZZER_PLAY_MUSIC_ID (BUZZER_ID + 2) /* Plays the provided melody that follows the RTTTL Format.*/
892 
893 /* Prototypes*/
894 #define BUZZER_SetMode(a) ((tCircleFunc1)(Circle_API [BUZZER_SETMODE_ID])) ((u32)(a)) /*void BUZZER_SetMode( enum BUZZER_mode mode);*/
895 #define BUZZER_GetMode() (enum BUZZER_mode)(((tCircleFunc0)(Circle_API [BUZZER_GETMODE_ID])) ()) /*enum BUZZER_mode BUZZER_GetMode( void );*/
896 #define BUZZER_PlayMusic(a) ((tCircleFunc1)(Circle_API [BUZZER_PLAY_MUSIC_ID])) ((u32)(a)) /*void BUZZER_PlayMusic (const u8 *melody );*/
897 
898 
900 
901 
902 /*--------------------------------- MENU -----------------------------------*/
903 
904 /* Exported defines ----------------------------------------------------------*/
905 #define REMOVE_MENU 0x01
906 #define APP_MENU 0x02
907 #define MENU_MAXITEM 8
909 /* Exported type def ---------------------------------------------------------*/
910 
915 typedef struct
916 {
917  const u8* Text;
918  enum MENU_code( *Fct_Init )( void );
919  enum MENU_code( *Fct_Manage )( void );
920  s32 fRemoveMenu;
927 typedef struct
928 {
929  unsigned fdispTitle: 1;
930  const u8* Title;
931  s32 NbItems;
932  s32 LgMax;
933  s32 XPos;
934  s32 YPos;
935  s32 XSize;
936  s32 YSize;
937  u32 SelectedItem;
947 enum MENU_code
948 {
950  MENU_CONTINUE = 1,
956 };
959 
960 /* Exported defines ----------------------------------------------------------*/
961 
962 /* MENU functions definition*/
963 #define MENU_SET_ID (MENU_ID + 0) /* Display a menu*/
964 #define MENU_REMOVE_ID (MENU_ID + 1) /* Remove the current menu, DRAW_Clear and set pointer mode to "POINTER_ON".*/
965 #define MENU_QUESTION_ID (MENU_ID + 2) /* Dedicated menu for ask question and yes/no responses*/
966 #define MENU_PRINT_ID (MENU_ID + 3) /* Display a popup menu with a string.*/
967 #define MENU_CLEAR_CURRENT_COMMAND_ID (MENU_ID + 4) /* Set CurrentCommand to 0*/
968 #define MENU_SET_LEVELTITLE_ID (MENU_ID + 5) /* Set the title of level menu managed by MENU_SetLevel_Mgr.*/
969 #define MENU_SET_TEXTCOLOR_ID (MENU_ID + 6) /* Set the color used for text menu.*/
970 #define MENU_GET_TEXTCOLOR_ID (MENU_ID + 7) /* Return the color used for text menu.*/
971 #define MENU_SET_BGNDCOLOR_ID (MENU_ID + 8) /* Set the background color used for menu.*/
972 #define MENU_GET_BGNDCOLOR_ID (MENU_ID + 9) /* Return the background color used for menu.*/
973 #define MENU_QUIT_ID (MENU_ID + 10) /* Leave the current menu (stand for "cancel" and do a DRAW_Clear)*/
974 #define MENU_SET_LEVELINI_ID (MENU_ID + 11) /* Initialise a generic function to set a avalue in the range of [0,4]*/
975 #define MENU_CLEAR_CURRENT_MENU_ID (MENU_ID + 12) /* Set CurrentMenu to 0*/
976 #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)*/
977 #define MENU_SET_APP_DIVIDER_ID (MENU_ID + 14) /* Set divider for applications calls*/
978 #define MENU_RESTORE_APP_DIVIDER_ID (MENU_ID + 15) /* Restore the factory divider for applications calls*/
979 
980 /* Prototypes*/
981 #define MENU_Set(a) ((tCircleFunc1)(Circle_API [MENU_SET_ID])) ((u32)(a)) /* void MENU_Set( tMenu* mptr ); */
982 #define MENU_Remove() ((tCircleFunc0)(Circle_API [MENU_REMOVE_ID])) () /* void MENU_Remove( void ); */
983 #define MENU_Question(a,b) ((tCircleFunc2)(Circle_API [MENU_QUESTION_ID])) ((u32)(a),(u32)(b)) /* void MENU_Question( u8* str, bool* answer ); */
984 #define MENU_Print(a) ((tCircleFunc1)(Circle_API [MENU_PRINT_ID])) ((u32)(a)) /* void MENU_Print( u8* str ) */
985 #define MENU_ClearCurrentCommand() ((tCircleFunc0)(Circle_API [MENU_CLEAR_CURRENT_COMMAND_ID])) () /* void MENU_ClearCurrentCommand( void ) */
986 #define MENU_SetLevelTitle(a) ((tCircleFunc1)(Circle_API [MENU_SET_LEVELTITLE_ID])) ((u32)(a)) /* void MENU_SetLevelTitle( u8* title ) */
987 #define MENU_SetTextColor(a) ((tCircleFunc1)(Circle_API [MENU_SET_TEXTCOLOR_ID])) ((u32)(a)) /* void MENU_SetTextColor( s32 TextColor ) */
988 #define MENU_GetTextColor() (color_t)(((tCircleFunc0)(Circle_API [MENU_GET_TEXTCOLOR_ID])) ()) /* color_t MENU_GetTextColor( void ) */
989 #define MENU_SetBGndColor(a) ((tCircleFunc1)(Circle_API [MENU_SET_BGNDCOLOR_ID])) ((u32)(a)) /* void MENU_SetBGndColor( s32 BGndColor ) */
990 #define MENU_GetBGndColor() (color_t)(((tCircleFunc0)(Circle_API [MENU_GET_BGNDCOLOR_ID])) ()) /* color_t MENU_GetBGndColor( void ) */
991 #define MENU_Quit() (enum MENU_code)(((tCircleFunc0)(Circle_API [MENU_QUIT_ID])) ()) /* enum MENU_code MENU_Quit( void ) */
992 #define MENU_SetLevel_Ini() (enum MENU_code)(((tCircleFunc0)(Circle_API [MENU_SET_LEVELINI_ID])) ()) /* enum MENU_code MENU_SetLevel_Ini( void ) */
993 #define MENU_ClearCurrentMenu() ((tCircleFunc0)(Circle_API [MENU_CLEAR_CURRENT_MENU_ID])) () /* void MENU_ClearCurrentMenu( void ) */
994 #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 [] ) */
995 #define MENU_SetAppliDivider(a) ((tCircleFunc1)(Circle_API [MENU_SET_APP_DIVIDER_ID])) ((u32)(a)) /* void MENU_SetAppliDivider( s32 divider ) */
996 #define MENU_RestoreAppliDivider() ((tCircleFunc0)(Circle_API [MENU_RESTORE_APP_DIVIDER_ID])) () /* void MENU_RestoreAppliDivider( void ) */
997 
999 
1000 /*---------------------------------- LED -------------------------------------*/
1001 
1002 /* Exported types ------------------------------------------------------------*/
1003 
1010 enum LED_mode
1011 {
1012  LED_UNDEF = -1,
1013  LED_OFF = 0,
1014  LED_ON = 1,
1017 };
1025 enum LED_id
1026 {
1028  LED_RED = 1
1029 };
1032 
1033 /* Exported defines ----------------------------------------------------------*/
1034 
1035 /* LED functions definition*/
1036 #define LED_SET_ID (LED_ID + 0) /* Set a specified LED in a specified mode.*/
1037 
1038 /* Prototypes*/
1039 #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 );*/
1040 
1042 
1043 /*-------------------------------- RTC --------------------------------------*/
1044 
1045 /* Exported defines ----------------------------------------------------------*/
1046 
1047 /* Backup registers*/
1048 #define BKP_SYS1 1
1049 #define BKP_SYS2 2
1050 #define BKP_SYS3 3
1051 #define BKP_SYS4 4
1052 #define BKP_SYS5 5
1053 #define BKP_SYS6 6
1054 #define BKP_SYS7 11
1055 #define BKP_SYS8 12
1056 #define BKP_SYS9 13
1057 #define BKP_SYS10 14
1058 #define BKP_SYS11 15
1059 #define BKP_SYS12 16
1060 #define BKP_SYS13 17
1061 #define BKP_SYS14 18
1063 #define BKP_USER1 7
1064 #define BKP_USER2 8
1065 #define BKP_USER3 9
1066 #define BKP_USER4 10
1070 /*RTC functions definition*/
1071 #define RTC_SET_TIME_ID (RTC_ID + 0) /* Set current time.*/
1072 #define RTC_GET_TIME_ID (RTC_ID + 1) /* Return current time.*/
1073 #define RTC_DISPLAY_TIME_ID (RTC_ID + 2) /* Display current time on the 6th line at column 0.*/
1074 
1075 /* Prototypes*/
1076 #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);*/
1077 #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);*/
1078 #define RTC_DisplayTime() ((tCircleFunc0)(Circle_API [RTC_DISPLAY_TIME_ID])) () /*void RTC_DisplayTime ( void );*/
1079 
1081 
1082 /*------------------------------ TOOLBAR -----------------------------------*/
1083 
1084 /* Exported defines ----------------------------------------------------------*/
1085 #define TOOLBAR_MAXITEMS 4
1086 
1087 /* Exported types ------------------------------------------------------------*/
1092 typedef struct
1093 {
1094  const u16* icon;
1095  enum MENU_code( *Fct_Manage )( void );
1102 typedef struct
1103 {
1104  index_t NbItems;
1105  u32 FirstDispItem; /* index of the first displayed item (if > 4)*/
1109 
1111 
1112 /* TOOLBAR functions definition*/
1113 #define TOOLBAR_SET_ID (TOOLBAR_ID + 0) /* Set new toolbar*/
1114 #define TOOLBAR_SET_DEFAULT_TOOLBAR_ID (TOOLBAR_ID + 1) /* Restore default factory toolbar*/
1115 #define TOOLBAR_CHANGE_BUTTON_ID (TOOLBAR_ID + 2) /* Change icone and function of a button*/
1116 
1117 /* Prototypes*/
1118 #define TOOLBAR_Set(a) (((tCircleFunc1)(Circle_API [TOOLBAR_SET_ID])) ((u32)(a))) /* void TOOLBAR_Set(tToolbar* NewToolbar);*/
1119 #define TOOLBAR_SetDefaultToolbar() ((tCircleFunc0)(Circle_API [TOOLBAR_SET_DEFAULT_TOOLBAR_ID])) () /* void TOOLBAR_SetDefaultToolbar(void);*/
1120 #define TOOLBAR_ChangeButton(a,b,c) (((tCircleFunc3)(Circle_API [TOOLBAR_CHANGE_BUTTON_ID])) ((u32)(a),(u32)(b),(u32)(c) )) /* void TOOLBAR_ChangeButton(s32 button, const u8 *newicon, enum MENU_code (*newfct)( void ));*/
1121 
1123 /*------------------------------ TOUCHSCREEN ----------------------------------*/
1124 
1125 /* Exported defines ----------------------------------------------------------*/
1126 #define LIST_MAXITEM 64
1127 
1128 /* Exported types ------------------------------------------------------------*/
1130 
1135 typedef struct
1136 {
1137  const u8* Text;
1138 } tListItem;
1144 typedef struct
1145 {
1146  unsigned fdispTitle : 1;
1147  const u8* Title;
1148  s32 NbItems;
1149  s32 LgMax;
1150  s32 XPos, YPos;
1151  s32 XSize, YSize;
1152  s32 NbDisp; /* Number of lines to be displayed*/
1153  u32 SelectedItem; /* Current selected item*/
1154  u32 FirstDisplayItem; /* Index of the first displayed item*/
1159 
1160 /* TOUCHSCREEN functions definition*/
1161 #define TOUCHSCR_GET_POS_ID (TOUCHSCR_ID + 0) /* Get the position of the hit point according the LCD position*/
1162 #define TOUCHSCR_GET_ABS_POS_ID (TOUCHSCR_ID + 1) /* Get the absolute position of the hit point*/
1163 #define TOUCHSCR_IS_PRESSED_ID (TOUCHSCR_ID + 2) /* See if toucscreen touched or not*/
1164 #define TOUCHSCR_GET_MODE_ID (TOUCHSCR_ID + 3) /* Get the running mode of the touchscreen (normal, calibration...)*/
1165 #define TOUCHSCR_SET_SENS_ID (TOUCHSCR_ID + 4) /* Set the sensitivity if the touch (0 to 4095)*/
1166 #define LIST_MANAGER_ID (TOUCHSCR_ID + 5) /* Manage the current list*/
1167 #define LIST_SET_ID (TOUCHSCR_ID + 6) /* Set the new list to manage with the touchscreen*/
1168 #define TOUCHSCR_GET_POSX_ID (TOUCHSCR_ID + 7) /* Get the horizontal position of the hit point according the LCD position*/
1169 #define TOUCHSCR_GET_POSY_ID (TOUCHSCR_ID + 8) /* Get the vertical position of the hit point according the LCD position*/
1170 
1171 /* Prototypes*/
1172 #define TOUCHSCR_GetPos() (u16) (((tCircleFunc0)(Circle_API [TOUCHSCR_GET_POS_ID])) () ) /* u16 TOUCHSCR_GetPos( void );*/
1173 #define TOUCHSCR_GetAbsPos() (u16) (((tCircleFunc0)(Circle_API [TOUCHSCR_GET_ABS_POS_ID])) () ) /* u16 TOUCHSCR_GetAbsPos( void );*/
1174 #define TOUCHSCR_IsPressed() (bool) (((tCircleFunc0)(Circle_API [TOUCHSCR_IS_PRESSED_ID])) () ) /* bool TOUCHSCR_IsPressed( void )*/
1175 #define TOUCHSCR_GetMode() (TOUCHSCR_Mode_enum) (((tCircleFunc0)(Circle_API [TOUCHSCR_GET_MODE_ID])) () ) /* TOUCHSCR_Mode_enum TOUCHSCR_GetMode( void );*/
1176 #define TOUCHSCR_SetSensibility(a) (((tCircleFunc1)(Circle_API [TOUCHSCR_SET_SENS_ID])) ((u32)(a)) ) /* void TOUCHSCR_SetSensibility( u16 sens );*/
1177 #define LIST_Manager() (s32) (((tCircleFunc0)(Circle_API [LIST_MANAGER_ID])) () ) /* s32 LIST_Manager( void );*/
1178 #define LIST_Set(a,b,c,d) (((tCircleFunc4)(Circle_API [LIST_SET_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d)) ) /* void LIST_Set( tList *lptr, u16 posX, u16 posY, bool center );*/
1179 #define TOUCHSCR_GetPosX() (s32) (((tCircleFunc0)(Circle_API [TOUCHSCR_GET_POSX_ID])) () ) /* s32 TOUCHSCR_GetPos( void );*/
1180 #define TOUCHSCR_GetPosY() (s32) (((tCircleFunc0)(Circle_API [TOUCHSCR_GET_POSY_ID])) () ) /* s32 TOUCHSCR_GetPos( void );*/
1181 
1182 
1184 
1185 /*-------------------------------- AUDIO -------------------------------------*/
1186 
1187 /* Exported types ------------------------------------------------------------*/
1188 typedef enum { OFF, ON} ON_OFF_enum ;
1193 typedef enum { FRQ_48KHZ , FRQ_44KHZ , FRQ_22KHZ , FRQ_16KHZ , FRQ_8KHZ} AUDIO_Frequency_enum; // KJ - Changed to support more FRQ
1194 typedef enum { MONO, STEREO} AUDIO_Format_enum;
1195 typedef enum { FULL = 0, LOW_EMPTY = 1, HIGH_EMPTY = 2 } AUDIO_PlaybackBuffer_Status ;
1196 typedef enum { EMPTY = 0, LOW_FULL = 1, HIGH_FULL = 2 } AUDIO_RecordBuffer_Status ;
1197 typedef s8 sound_type;
1200 
1201 /* AUDIO functions definition*/
1202 #define AUDIO_SET_MODE_ID (AUDIO_ID + 0) /* Set new codec mode*/
1203 #define AUDIO_GET_MODE_ID (AUDIO_ID + 1) /* Get the current codec mode*/
1204 #define AUDIO_PLAY_ID (AUDIO_ID + 2) /* Issues audio samples (stored in buffer) to the audio codec via I2S*/
1205 #define AUDIO_SPEAKER_ONOFF_ID (AUDIO_ID + 3) /* Set the PLS switch of the audio codec ON or OFF, in order to mute or not the loudspeaker.*/
1206 #define AUDIO_MUTE_ONOFF_ID (AUDIO_ID + 4) /* Set the MUT switch of the audio codec ON or OFF*/
1207 #define AUDIO_ISMUTE_ID (AUDIO_ID + 5) /* Indicates if the audio is MUTE or not*/
1208 #define AUDIO_INC_VOLUME_ID (AUDIO_ID + 6) /* Increment the volume of the loudspeaker and headphones*/
1209 #define AUDIO_DEC_VOLUME_ID (AUDIO_ID + 7) /* Decrement the volume of the loudspeaker and headphones*/
1210 #define AUDIO_PLAYBACK_GETSTATUS_ID (AUDIO_ID + 8) /* Get the current status of the playback mode*/
1211 #define AUDIO_RECORD_GETSTATUS_ID (AUDIO_ID + 9) /* Get the current status of the record mode*/
1212 #define AUDIO_RECORD_ID (AUDIO_ID + 10) /* Store audio samples into buffer from the audio codec via I2S*/
1213 #define AUDIO_READ_REGISTER_ID (AUDIO_ID + 11) /* Reads a data byte from one of STw5094A configuration registers*/
1214 #define AUDIO_WRITE_REGISTER_ID (AUDIO_ID + 12) /* Send a data byte to one of STw5094A configuration registers*/
1215 
1216 #define AUDIO_SET_BUFFER_SIZE_ID (AUDIO2_ID + 0) /* Adjust the size of the local buffer used in MONO mode.*/
1217 #define AUDIO_RECORD_BUFF_GETSTATUS_ID (AUDIO2_ID + 1) /* Stores audio samples to the buffer from the audio codec via I2S.*/
1218 #define AUDIO_RECORD_STOP_ID (AUDIO2_ID + 2) /* Stop the record by stopping the DMA transfer.*/
1219 #define AUDIO_PLAY_BUFF_GETSTATUS_ID (AUDIO2_ID + 3) /* Issues audio samples (stored in buffer) to the audio codec via I2S.*/
1220 #define AUDIO_PLAY_STOP_ID (AUDIO2_ID + 4) /* Stop the playback by stopping the DMA transfer.*/
1221 
1222 /* Prototypes*/
1223 #define AUDIO_SetMode(a,b,c,d) (((tCircleFunc4)(Circle_API [AUDIO_SET_MODE_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d)))
1224 /* void AUDIO_SetMode( AUDIO_DeviceMode_enum mode, */
1225 /* AUDIO_Playback_length_enum length,*/
1226 /* AUDIO_Playback_frequence_enum frequence,*/ /* AUDIO_format_enum format);*/
1227 #define AUDIO_GetMode() (AUDIO_DeviceMode_enum)(((tCircleFunc0)(Circle_API [AUDIO_GET_MODE_ID])) () ) /* AUDIO_DeviceMode_enum AUDIO_GetMode();*/
1228 #define AUDIO_Play(a,b) ((tCircleFunc2)(Circle_API[AUDIO_PLAY_ID])) ((u32) (a), (u32) (b)) /* void AUDIO_Play( sound_type * buffer, s32 size );*/
1229 #define AUDIO_SPEAKER_OnOff(a) ((tCircleFunc1)(Circle_API [AUDIO_SPEAKER_ONOFF_ID])) ((u32) (a)) /* void AUDIO_SPEAKER_OnOff(ON_OFF_enum mode);*/
1230 #define AUDIO_MUTE_OnOff(a) ((tCircleFunc1)(Circle_API [AUDIO_MUTE_ONOFF_ID])) ((u32) (a)) /* void AUDIO_MUTE_OnOff(ON_OFF_enum mode);*/
1231 #define AUDIO_IsMute() (bool)(((tCircleFunc0)(Circle_API [AUDIO_ISMUTE_ID])) () ) /* bool AUDIO_IsMute(void);*/
1232 #define AUDIO_Inc_Volume(a) ((tCircleFunc1)(Circle_API [AUDIO_INC_VOLUME_ID])) ((u32) (a)) /* void AUDIO_Inc_Volume(u8 dB);*/
1233 #define AUDIO_Dec_Volume(a) ((tCircleFunc1)(Circle_API [AUDIO_DEC_VOLUME_ID])) ((u32) (a)) /* void AUDIO_Dec_Volume(u8 dB)*/
1234 #define AUDIO_Playback_GetStatus() (AUDIO_Playback_status_enum)(((tCircleFunc0)(Circle_API [AUDIO_PLAYBACK_GETSTATUS_ID])) () ) /* AUDIO_Playback_status_enum AUDIO_Playback_GetStatus();*/
1235 #define AUDIO_Recording_GetStatus() (AUDIO_Recording_status_enum)(((tCircleFunc0)(Circle_API [AUDIO_RECORD_GETSTATUS_ID])) () ) /* AUDIO_Record_status_enum AUDIO_Playback_GetStatus();*/
1236 #define AUDIO_Record(a,b) ((tCircleFunc2)(Circle_API[AUDIO_RECORD_ID])) ((u32) (a), (u32) (b)) /* void AUDIO_Record( sound_type * buffer, s32 size );*/
1237 #define AUDIO_ReadRegister(a) (u8)((tCircleFunc1)(Circle_API[AUDIO_READ_REGISTER_ID])) ((u32) (a)) /* u8 AUDIO_ReadRegister(u8 register_to_read);*/
1238 #define AUDIO_WriteRegister(a,b) ((tCircleFunc2)(Circle_API[AUDIO_WRITE_REGISTER_ID])) ((u32) (a), (u32) (b)) /* void AUDIO_WriteRegister(u8 register_to_write, u8 data_to_write);*/
1239 #define AUDIO_RecordBuffer_GetStatus(a) (AUDIO_RecordBuffer_Status)((tCircleFunc1)(Circle_API[AUDIO_RECORD_BUFF_GETSTATUS_ID])) ((u32) (a)) /* AUDIO_RecordBuffer_Status AUDIO_RecordBuffer_GetStatus(AUDIO_RecordBuffer_Status value);*/
1240 #define AUDIO_Record_Stop() ((tCircleFunc0)(Circle_API [AUDIO_RECORD_STOP_ID])) () /* void AUDIO_Record_Stop( );*/
1241 #define AUDIO_PlaybackBuffer_GetStatus(a) (AUDIO_PlaybackBuffer_Status)((tCircleFunc1)(Circle_API[AUDIO_PLAY_BUFF_GETSTATUS_ID])) ((u32) (a)) /* AUDIO_PlaybackBuffer_Status AUDIO_PlaybackBuffer_GetStatus(AUDIO_PlaybackBuffer_Status value);*/
1242 #define AUDIO_Playback_Stop() ((tCircleFunc0)(Circle_API [AUDIO_PLAY_STOP_ID])) () /* void AUDIO_Playback_Stop( );*/
1243 #define AUDIO_SetLocalBufferSize(a) ((tCircleFunc1)(Circle_API [AUDIO_SET_BUFFER_SIZE_ID])) ((u32) (a)) /* void AUDIO_SetLocalBufferSize(s32 size);*/
1244 
1246 
1247 
1248 /*------------------------------ POWER / SHUTDOWN -----------------------------*/
1249 
1250 /* Exported types ------------------------------------------------------------*/
1251 
1252 
1254 
1255 /* Exported defines ----------------------------------------------------------*/
1256 
1257 /* SHUTDOWN functions definition*/
1258 #define SHUTDOWN_ACTION_ID (SHUTDOWN_ID + 0) /* Switch off the power supply*/
1259 
1260 /* Prototypes*/
1261 #define SHUTDOWN_Action() ((tCircleFunc0)(Circle_API [SHUTDOWN_ACTION_ID])) () /* void SHUTDOWN_Action( void );*/
1262 
1264 
1265 
1266 /*------------------------------ Filesystem -----------------------------------*/
1267 
1268 /* Exported defines ----------------------------------------------------------*/
1269 #define MAX_PATH_LENGTH 200
1270 
1271 /*===================================================================*/
1272 /* 32-bit error codes*/
1273 #define FS_OK 0 // no error
1274 #define FS_EOF 1 // end of file (not an error)
1275 #define FS_WRITEPROT 2 // volume is write protected
1276 #define FS_NOTFOUND 3 // path or file not found
1277 #define FS_PATHLEN 4 // path too long
1278 #define FS_ALLOCNEW 5 // must allocate new directory cluster
1279 #define FS_ERRMISC 0xffffffff // generic error
1281 /*===================================================================*/
1282 /* File access modes*/
1283 #define FS_OPEN_EXISTING 0x00
1284 #define FS_READ 0x01 // read-only
1285 #define FS_WRITE 0x02 // write-only
1286 #define FS_CREATE_NEW 0x04
1287 #define FS_CREATE_ALWAYS 0x08
1288 #define FS_OPEN_ALWAYS 0x10
1290 /*===================================================================*/
1291 /* DOS attribute bits*/
1292 #define FS_ATTR_READ_ONLY 0x01
1293 #define FS_ATTR_HIDDEN 0x02
1294 #define FS_ATTR_SYSTEM 0x04
1295 #define FS_ATTR_VOLUME_ID 0x08
1296 #define FS_ATTR_DIRECTORY 0x10
1297 #define FS_ATTR_ARCHIVE 0x20
1298 #define FS_ATTR_LONG_NAME (FS_ATTR_READ_ONLY | FS_ATTR_HIDDEN | FS_ATTR_SYSTEM | FS_ATTR_VOLUME_ID)
1300 /* Exported types ------------------------------------------------------------*/
1301 
1302 typedef enum STORAGE_device
1303 {
1305  INTERNAL_FLASH // currently not used
1312 typedef struct _tagVOLINFO
1313 {
1314  u8 unit; // unit on which this volume resides
1315  u8 filesystem; // formatted filesystem
1317  /* These two fields aren't very useful, so support for them has been commented out to*/
1318  /* save memory. (Note that the "system" tag is not actually used by DOS to determine*/
1319  /* filesystem type - that decision is made entirely on the basis of how many clusters*/
1320  /* the drive contains. DOSFS works the same way).*/
1321  /* See tag: OEMID in dosfs.c*/
1322  /* u8 oemid[9]; // OEM ID ASCIIZ*/
1323  /* u8 system[9]; // system ID ASCIIZ*/
1324  u8 label[12]; /* volume label ASCIIZ*/
1325  u32 startsector; /* starting sector of filesystem*/
1326  u8 secperclus; /* sectors per cluster*/
1327  u16 reservedsecs; /* reserved sectors*/
1328  u32 numsecs; /* number of sectors in volume*/
1329  u32 secperfat; /* sectors per FAT*/
1330  u16 rootentries; /* number of root dir entries*/
1332  u32 numclusters; /* number of clusters on drive*/
1333 
1334  /* The fields below are PHYSICAL SECTOR NUMBERS.*/
1335  u32 fat1; /* starting sector# of FAT copy 1*/
1336  u32 rootdir; /* starting sector# of root directory (FAT12/FAT16) or cluster (FAT32)*/
1337  u32 dataarea; /* starting sector# of data area (cluster #2)*/
1340 
1341 
1358 typedef struct _tagDIRENT
1359 {
1360  u8 name[11]; /* filename*/
1361  u8 attr; /* attributes (see ATTR_* constant definitions)*/
1362  u8 reserved; /* reserved, must be 0*/
1363  u8 crttimetenth; /* create time, 10ths of a second (0-199 are valid)*/
1364  u8 crttime_l; /* creation time low byte*/
1365  u8 crttime_h; /* creation time high byte*/
1366  u8 crtdate_l; /* creation date low byte*/
1367  u8 crtdate_h; /* creation date high byte*/
1368  u8 lstaccdate_l; /* last access date low byte*/
1369  u8 lstaccdate_h; /* last access date high byte*/
1370  u8 startclus_h_l; /* high word of first cluster, low byte (FAT32)*/
1371  u8 startclus_h_h; /* high word of first cluster, high byte (FAT32)*/
1372  u8 wrttime_l; /* last write time low byte*/
1373  u8 wrttime_h; /* last write time high byte*/
1374  u8 wrtdate_l; /* last write date low byte*/
1375  u8 wrtdate_h; /* last write date high byte*/
1376  u8 startclus_l_l; /* low word of first cluster, low byte*/
1377  u8 startclus_l_h; /* low word of first cluster, high byte*/
1378  u8 filesize_0; /* file size, low byte*/
1381  u8 filesize_3; /* file size, high byte*/
1384 
1389 typedef struct _tagDIRINFO
1390 {
1391  u32 currentcluster; /* current cluster in dir*/
1392  u8 currentsector; /* current sector in cluster*/
1393  u8 currententry; /* current dir entry in sector*/
1394  u8* scratch; /* ptr to user-supplied scratch buffer (one sector)*/
1395  u8 flags; /* internal DOSFS flags*/
1402 typedef struct _tagFILEINFO
1403 {
1404  PVOLINFO volinfo; /* VOLINFO used to open this file*/
1405  u32 dirsector; /* physical sector containing dir entry of this file*/
1406  u8 diroffset; /* # of this entry within the dir sector*/
1407  u8 mode; /* mode in which this file was opened*/
1408  u32 firstcluster; /* first cluster of file*/
1409  u32 filelen; /* byte length of file*/
1411  u32 cluster; /* current cluster*/
1412  u32 pointer; /* current (BYTE) pointer*/
1415 
1417 
1418 /* FILE SYSTEM functions definition*/
1419 
1420 #define FS_MOUNT_ID (FS_ID+0) /* Mount device: perform necessary initialization*/
1421 #define FS_UNMOUNT_ID (FS_ID+1) /* Unmount device: perform necessary deinitialization*/
1422 #define FS_OPENFILE_ID (FS_ID+2) /* Opens file / directory from specified path*/
1423 #define FS_READFILE_ID (FS_ID+3) /* Reads from specified file*/
1424 #define FS_WRITEFILE_ID (FS_ID+4) /* writs data to specified file*/
1425 #define FS_CLOSE_ID (FS_ID+5) /* closes file*/
1426 #define FS_SEEK_ID (FS_ID+6) /* seek in file*/
1427 #define FS_DELETE_ID (FS_ID+7) /* delete file or directory*/
1428 #define FS_GET_NEXT_ENTRY_ID (FS_ID+8) /* Reads next entry from dir*/
1429 #define FS_OPEN_DIRECTORY_ID (FS_ID+9) /* Open directory*/
1430 #define FS_GET_VOLUME_INFO_ID (FS_ID+10) /* get volume info*/
1431 #define FS_EXPLORER_INI_ID (FS_ID+11) /* Initialize the explorer list*/
1432 #define FS_EXPLORER_ID (FS_ID+12) /* Manage the navigation into the SDCard*/
1433 #define FS_GET_SD_CURRENT_PATH_ID (FS_ID+13) /* Get the current path of the SDCard*/
1434 #define FS_GET_SD_VOLINFO_ID (FS_ID+14) /* Get the current path of the SDCard*/
1435 #define FS_GET_PATH_FILTER_ID (FS_ID+15) /* Get the current path filter*/
1436 #define FS_SET_PATH_FILTER_ID (FS_ID+16) /* Set the current path filer*/
1437 #define FS_TELL_ID (FS_ID+17) /* Get the file pointer position */
1438 #define FS_GETS_ID (FS_ID+18) /* Get a string */
1439 #define FS_FILE_COPY_ID (FS_ID+19) /* Copy a file */
1440 #define FS_FILE_CMP_ID (FS_ID+20) /* Compare two files */
1441 #define FS_SIZE_ID (FS_ID+21) /* Get the file size */
1442 #define FS_EOF_ID (FS_ID+22) /* Check the End Of the File */
1443 
1444 
1445 /* Prototypes*/
1446 #define FS_Mount(a) (u32)((tCircleFunc1)(Circle_API [FS_MOUNT_ID])) ((u32) (a)) /* u32 FS_Mount(enum STORAGE_device device);*/
1447 #define FS_Unmount(a) (u32)((tCircleFunc1)(Circle_API [FS_UNMOUNT_ID])) ((u32) (a)) /* u32 FS_Unmount(enum STORAGE_device device);*/
1448 #define FS_OpenFile(a,b,c,d) (u32)(((tCircleFunc4)(Circle_API [FS_OPENFILE_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d)) ) /* u32 FS_OpenFile(PVOLINFO volinfo, u8 *path, u8 mode, PFILEINFO fileinfo);*/
1449 #define FS_ReadFile(a,b,c,d) (u32)(((tCircleFunc4)(Circle_API [FS_READFILE_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d)) ) /* u32 FS_ReadFile(PFILEINFO fileinfo, u8 *buffer, u32 *successcount, u32 len);*/
1450 #define FS_WriteFile(a,b,c,d) (u32)(((tCircleFunc4)(Circle_API [FS_WRITEFILE_ID])) ((u32)(a),(u32)(b),(u32)(c),(u32)(d)) ) /* u32 FS_WriteFile(PFILEINFO fileinfo, u8 *buffer, u32 *successcount, u32 len);*/
1451 #define FS_Close(a) (u32)((tCircleFunc1)(Circle_API [FS_CLOSE_ID])) ((u32) (a)) /* u32 FS_Close(PFILEINFO fileinfo);*/
1452 #define FS_Seek(a,b) ((tCircleFunc2)(Circle_API [FS_SEEK_ID])) ((u32) (a), (u32) (b)) /* void FS_Seek(PFILEINFO fileinfo, u32 offset);*/
1453 #define FS_Delete(a,b) (u32)((tCircleFunc2)(Circle_API [FS_DELETE_ID])) ((u32) (a), (u32) (b)) /* u32 FS_Delete(PVOLINFO volinfo, u8 *path);*/
1454 #define FS_GetNextEntry(a,b,c) (u32)(((tCircleFunc3)(Circle_API [FS_GET_NEXT_ENTRY_ID])) ((u32)(a),(u32)(b),(u32)(c) )) /* u32 FS_GetNextEntry(PVOLINFO volinfo, PDIRINFO dirinfo, PDIRENT dirent);*/
1455 #define FS_OpenDirectory(a,b,c) (u32)(((tCircleFunc3)(Circle_API [FS_OPEN_DIRECTORY_ID])) ((u32)(a),(u32)(b),(u32)(c) )) /* u32 FS_OpenDirectory(PVOLINFO volinfo,u8 *dirname, PDIRINFO dirinfo); */
1456 #define FS_GetVolumeInfo(a,b,c) (u32)(((tCircleFunc3)(Circle_API [FS_GET_VOLUME_INFO_ID])) ((u32)(a),(u32)(b),(u32)(c) )) /* u32 FS_GetVolumeInfo(u8 unit, u32 startsector, PVOLINFO volinfo); */
1457 #define FS_Explorer_Ini() (u32)(((tCircleFunc0)(Circle_API [FS_EXPLORER_INI_ID])) () ) /* enum MENU_code FS_Explorer_Ini ( void );*/
1458 #define FS_Explorer() (u32)(((tCircleFunc0)(Circle_API [FS_EXPLORER_ID])) () ) /* s32 FS_Explorer (void);*/
1459 #define FS_GetSDCardCurrentPath() (u32)(((tCircleFunc0)(Circle_API [FS_GET_SD_CURRENT_PATH_ID])) () ) /* u8* FS_GetSDCardCurrentPath (void);*/
1460 #define FS_GetSDCardVolInfo() (u32)(((tCircleFunc0)(Circle_API [FS_GET_SD_VOLINFO_ID])) () ) /* VOLINFO* FS_GetSDCardVolInfo (void);*/
1461 #define FS_GetPathFilter() (u32)(((tCircleFunc0)(Circle_API [FS_GET_PATH_FILTER_ID])) () ) /* u8* FS_GetPathFilter ( void );*/
1462 #define FS_SetPathFilter(a) ((tCircleFunc1)(Circle_API [FS_SET_PATH_FILTER_ID])) ((u32) (a)) /* void FS_SetPathFilter ( u8* filter );*/
1463 #define FS_Tell(a) (u32) ((tCircleFunc1)(Circle_API [FS_TELL_ID])) ((u32) (a)) /* u32 FS_Tell( PFILEINFO fileinfo ) */
1464 #define FS_Gets(a,b,c) (u32)(((tCircleFunc3)(Circle_API [FS_GETS_ID])) ((u32)(a),(u32)(b),(u32)(c) )) /* u32 FS_Gets(char* ptr, int len, PFILEINFO fileinfo); */
1465 #define FS_FileCopy(a,b) (u32) ((tCircleFunc2)(Circle_API [FS_FILE_COPY_ID])) ((u32) (a), (u32) (b)) /* u32 FS_FileCopy( char* dest, char* src ); */
1466 #define FS_FileCmp(a,b) (u32) ((tCircleFunc2)(Circle_API [FS_FILE_CMP_ID])) ((u32) (a), (u32) (b)) /* u32 FS_FileCmp( char* fn1, char* fn2 ); */
1467 #define FS_Size(a) (u32) ((tCircleFunc1)(Circle_API [FS_SIZE_ID])) ((u32) (a)) /* u32 FS_Size( PFILEINFO fileinfo ); */
1468 #define FS_Eof(a) (u32) ((tCircleFunc1)(Circle_API [FS_EOF_ID])) ((u32) (a)) /* u32 FS_Eof( PFILEINFO fileinfo ); */
1469 
1470 
1472 
1473 //--------------------------------- Application -------------------------------
1474 typedef void ( *tAppPtrMgr )( coord_t sposX, coord_t sposY );
1475 
1477 #endif /*__CIRCLE_API_H */