Various common utilities for CircleOS.
More...
Go to the source code of this file.
- Author
- RT
- Date
- 07/2007
- Version
- 4.0 Add Open4 Primer
- Date
- 10/2009
- Version
- 4.4 Add divider handler management
- Date
- 07/2013
Definition in file Util.c.
u16 UTIL_GetBatStatus |
( |
void |
) | |
|
Reads the status of the battery charger.
- Returns
- flagsta : 0 : battery is absent or dead (green on and red on) 1 : charged (green on and red off) 2 : battery is being charged (green off and red on) 3 : power supplied by battery (green off and red off) = normal mode
Definition at line 366 of file Util.c.
Get the current divider for a SCHEDULER handler. With UTIL_GetDividerHandler(), these functions allow to take the control of the different handler. See scheduler.c to understand further...
- Parameters
-
[in] | IDx | ID if the SCH Handler |
- Returns
- divider.
Definition at line 544 of file Util.c.
enum eSpeed UTIL_GetPll |
( |
void |
) | |
|
Get clock frequency
- Returns
- Current clock speed from very low to very fast.
Definition at line 240 of file Util.c.
Get the current SCHEDULER handler. With UTIL_SetSchHandler(), these functions allow to take the control of the different handler. You can:
- replace them (get-Set)by your own handler
- disable a handler: UTIL_SetSchHandler(Ix,0);
- create a new handler (using the unused handlers). See scheduler.c to understand further...
- Parameters
-
[in] | Ix | ID is the SCH Handler |
- Returns
- A pointer to the current handler, or 0 in case of an error.
Definition at line 316 of file Util.c.
char* UTIL_GetVersion |
( |
void |
) | |
|
Get CircleOS version.
- Returns
- A pointer to a string containing the CircleOS version.
Definition at line 258 of file Util.c.
void UTIL_int2str |
( |
u8 * |
ptr, |
|
|
int_t |
X, |
|
|
len_t |
digit, |
|
|
bool |
fillwithzero |
|
) |
| |
Convert a signed integer into a string. Using this function leads to much smaller code than using the sprintf() function from the C library.
- Parameters
-
[out] | ptr | The output string. |
[in] | X | The unsigned value to convert. |
[in] | digit | The number of digits in the output string. |
[in] | fillwithzero | 0 fill with blanks. 1 fill with zeros. |
Definition at line 222 of file Util.c.
bool UTIL_IsStandAloneMode |
( |
void |
) | |
|
Get the current mode of the Primer.
- Returns
- 1 if "stand alone" mode detected. 0 if "in base" mode detected.
Definition at line 345 of file Util.c.
NODEBUG2 uint_t UTIL_SaveScreenBMP |
( |
char * |
filename) | |
|
void UTIL_SetDividerHandler |
( |
enum eSchHandler |
IDx, |
|
|
u16 |
divider |
|
) |
| |
Set the current divider for a SCHEDULER handler. With UTIL_GetDividerHandler(), these functions allow to take the control of the different handler. See scheduler.c to understand further...
- Parameters
-
[in] | IDx | ID if the SCH Handler |
[in] | divider | new ticks divider of the handler |
Definition at line 522 of file Util.c.
void UTIL_SetSchHandler |
( |
enum eSchHandler |
Ix, |
|
|
tHandler |
pHDL |
|
) |
| |
Redirect a SCHEDULER handler. Set the current SCHEDULER handler. With UTIL_GetSchHandler(), these functions allow to take the control of the different handler. You can:
- replace them (get-Set)by your own handler
- disable a handler: UTIL_SetSchHandler(Ix,0);
- create a new handler (using the unused handlers). See scheduler.c to understand further...
- Parameters
-
[in] | Ix | ID if the SCH Handler |
[in] | pHDL | Pointer to the handler. |
Definition at line 284 of file Util.c.
void UTIL_SetTempMode |
( |
bool |
mode) | |
|
Set the temperature mode (F/C)
- Parameters
-
[in] | mode | 0: Celcius, 1: Fahrenheit |
Definition at line 172 of file Util.c.
void UTIL_uint2str |
( |
u8 * |
ptr, |
|
|
uint_t |
X, |
|
|
len_t |
digit, |
|
|
bool |
fillwithzero |
|
) |
| |
Convert an unsigned integer into a string. Using this function leads to much smaller code than using the sprintf() function from the C library.
- Parameters
-
[out] | ptr | The output string. |
[in] | X | The unsigned value to convert. |
[in] | digit | The number of digits in the output string. |
[in] | fillwithzero | 0 fill with blanks. 1 fill with zeros. |
Definition at line 198 of file Util.c.