30.12.2013 Views

T-Kernel Specification (1.B0.02)

T-Kernel Specification (1.B0.02)

T-Kernel Specification (1.B0.02)

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4.9. SYSTEM MANAGEMENT FUNCTIONS 199<br />

tk set pow<br />

Set Power Mode<br />

[C Language Interface]<br />

ER ercd = tk_set_pow ( UINT powmode ) ;<br />

[Parameters]<br />

UINT powmod Low-power mode<br />

[Return Parameters]<br />

ER ercd Error code<br />

[Error Codes]<br />

E OK Normal completion<br />

E PAR Parameter error (value that cannot be used in powmode)<br />

E QOVR Low-power mode disable count overflow<br />

E OBJ TPW ENALOWPOW was requested with low-power mode disable count at 0<br />

[Description]<br />

The following two power-saving functions are supported.<br />

• Switching to low-power mode when the system is idle<br />

When there are no tasks to be executed, the system switches to a low-power mode provided in<br />

hardware. Low-power mode is a function for reducing power use during very short intervals, such<br />

as from one timer interrupt to the next. This is accomplished, for example, by lowering the CPU<br />

clock frequency. It does not require complicated mode-switching in software but is implemented<br />

mainly using hardware functionality.<br />

• Automatic power-off<br />

When the operator performs no operations for a certain length of time, the system automatically<br />

cuts the power and goes to suspended state. If there is a start request (interrupt, etc.) from a<br />

peripheral device or if the operator turns on the power, the system resumes from the state when<br />

the power was cut. In the case of a power supply problem such as low battery, the system likewise<br />

cuts the power and goes to suspended state.<br />

In suspended state, the power is cut to peripheral devices and circuits as well as to the CPU, but<br />

the main memory contents are retained.<br />

tk set pow sets the low-power mode.<br />

powmode:= ( TPW_DOSUSPEND || TPW_DISLOWPOW || TPW_ENALOWPOW )<br />

Copyright c○ 2002, 2003 by T-Engine Forum<br />

T-<strong>Kernel</strong> <strong>1.B0.02</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!