pointer.c File Reference

Various utilities for the pointer management for STM32-primer. More...


Functions

void POINTER_SetCurrentPointer (u8 width, u8 height, u8 *bmp)
u16 POINTER_GetCurrentAngleStart (void)
void POINTER_SetCurrentAngleStart (u16 newangle)
u16 POINTER_GetCurrentSpeedOnAngle (void)
void POINTER_SetCurrentSpeedOnAngle (u16 newspeed)
void POINTER_SetCurrentAreaStore (u8 *ptr)
void POINTER_SetMode (enum POINTER_mode mode)
enum POINTER_mode POINTER_GetMode (void)
enum POINTER_state POINTER_GetState (void)
void POINTER_SetRect (s16 x, s16 y, s16 width, s16 height)
void POINTER_SetRectScreen (void)
u16 POINTER_GetPos (void)
void POINTER_SetPos (u16 x, u16 y)
void POINTER_Draw (u8 x, u8 y, u8 width, u8 height, u8 *bmp)
void POINTER_Save (u8 x, u8 y, u8 width, u8 height)
void POINTER_Restore (u8 x, u8 y, u8 width, u8 height)
void POINTER_SetApplication_Pointer_Mgr (tAppPtrMgr mgr)
void POINTER_SetColor (u16 color)
u16 POINTER_GetColor (void)
tPointer_InfoPOINTER_GetInfo (void)


Detailed Description

Author:
FL
Date:
07/2007
Version:
1.1
Date:
10/2007
Version:
1.5 various corrections reported by Ron Miller to suppress jittery

Function Documentation

void POINTER_Draw ( u8  x,
u8  y,
u8  width,
u8  height,
u8 *  bmp 
)

Draw pointer.

Parameters:
[in] x Horizontal coordinate of the bottom left corner of the pointer.
[in] y Vertical coordinate of the bottom left corner of the pointer.
[in] width Pointer bitmap width.
[in] height Pointer bitmap height.
[in] bmp Pointer to width * height bit array. If null used default pointer bitmap.
Note:
The provided bitmap is a monochrome one.
Warning:
The (0x0) point in on the low left corner.

u16 POINTER_GetColor ( void   ) 

Return the current pointer color.

Returns:
Current pointer color.

u16 POINTER_GetCurrentAngleStart ( void   ) 

Get the current minimal angle to move pointer

Returns:
current minimal angle.

u16 POINTER_GetCurrentSpeedOnAngle ( void   ) 

Return the current speed/angle ratio.

Returns:
current ratio.

tPointer_Info* POINTER_GetInfo ( void   ) 

Get pointer informations.

Returns:
A pointer to a pointer information structure.

enum POINTER_mode POINTER_GetMode ( void   ) 

Return the current mode of the pointer management

Returns:
Current pointer management mode.

u16 POINTER_GetPos ( void   ) 

Return the current position of the pointer (on the screen).

Returns:
The current pointer screen position with X in the LSB and Y in the MSB.
Warning:
The (0x0) point in on the low left corner.

enum POINTER_state POINTER_GetState ( void   ) 

Return current pointer state.

Returns:
Current pointer state.

void POINTER_Restore ( u8  x,
u8  y,
u8  width,
u8  height 
)

Restore the background of the pointer with data saved in the current store area.

Parameters:
[in] x Horizontal coordinate of the bottom left corner of the area to restore.
[in] y Vertical coordinate of the bottom left corner of the area to restore.
[in] width Width of the area to restore.
[in] height Height of the area to restore.
Warning:
The (0x0) point in on the low left corner.
See also:
POINTER_Save

POINTER_SetCurrentAreaStore

void POINTER_Save ( u8  x,
u8  y,
u8  width,
u8  height 
)

Save the background of the pointer.

Parameters:
[in] x Horizontal coordinate of the bottom left corner of the area to save.
[in] y Vertical coordinate of the bottom left corner of the area to save.
[in] width Width of the area to save.
[in] height Height of the area to save.
Note:
The store area must be large enough to store all the pixels (16 bits).
Warning:
The (0x0) point in on the low left corner.
See also:
POINTER_Restore

POINTER_SetCurrentAreaStore

void POINTER_SetApplication_Pointer_Mgr ( tAppPtrMgr  mgr  ) 

Provides an user defined pointer manager.

Parameters:
[in] mgr Pointer to the user defined pointer manager.

void POINTER_SetColor ( u16  color  ) 

Set the pointer color.

Parameters:
[in] color The new pointer color.

void POINTER_SetCurrentAngleStart ( u16  newangle  ) 

Set the current minimal angle to move pointer

Parameters:
[in] newangle The new minimal angle to move pointer.

void POINTER_SetCurrentAreaStore ( u8 *  ptr  ) 

Change the current storage area. If the provided value is NULL, the default storage area will be used.

Parameters:
[in] ptr New storage area (may be null).
Warning:
Memory space pointed by the provided pointer must be large enough to store a color bitmap corresponding to the pointer area. In other words, space must be width * height * 2 large.

void POINTER_SetCurrentPointer ( u8  width,
u8  height,
u8 *  bmp 
)

Set the dimension and the bitmap of the pointer.

Note:
The bitmap is a monochrome one!
Parameters:
[in] width width of the pointer (u8)
[in] height height of the pointer (u8)
[in] bmp pointer to an array of width * height bits.

void POINTER_SetCurrentSpeedOnAngle ( u16  newspeed  ) 

Set the current speed/angle ratio.

Parameters:
[in] newspeed New speed/angle ratio.

void POINTER_SetMode ( enum POINTER_mode  mode  ) 

Change the current mode of the pointer management.

Note:
Must be called only ONCE!!
Parameters:
[in] mode New pointer management mode.

void POINTER_SetPos ( u16  x,
u16  y 
)

Force the screen position of the pointer.

Parameters:
[in] x New horizontal coordinate.
[in] y New vertical coordinate.
Warning:
The (0x0) point in on the low left corner.

void POINTER_SetRect ( s16  x,
s16  y,
s16  width,
s16  height 
)

Set new limits for the move of the pointer

Parameters:
[in] x Horizontal coordinate of the bottom left corner of the new area.
[in] y Vertical coordinate of the bottom left corner of the new are.
[in] width New area width.
[in] height New area height.
Warning:
The (0x0) point in on the low left corner.

void POINTER_SetRectScreen ( void   ) 

Allow the pointer to move on the whole screen.