#include <oprocessor.h>
Public Member Functions | |
| oProcessor (CLOCK) | |
| Constructor setting system clock speed because. | |
Static Public Member Functions | |
| void | system_clock (CLOCK) |
| Sets the system clock to specified rate. | |
| CLOCK | system_clock (void) |
| Return system speed (Ref. CLOCK). | |
| bool | reset_status (STATUS) |
| Return Reset Status Register (STATUS out of reset). | |
Static Public Attributes | |
| SIM_T * | SIM |
| Global object. | |
Once system speed is set, the clock speed on the TPU port is modified by use of the clock prescaler (TCR1P/PSCK Ref: TPU reference manual 2-2) in the time processing unit (TPU)
#include <oconsole.h> #include <oled.h> #include <oprocessor.h> int main(void) { oConsole debug; oGreenLED green; green.on(); debug.echo("Debugging on...\n"); oProcessor MRM; if (MRM.reset_status(POWERUP)) debug.echo("Reset caused by Powerup\n"); MRM.system_clock(MH25); debug.syncronize(); debug.echo("After clock change..\n"); if (MRM.system_clock() == MH8) debug.echo("8 MHZ\n"); else if (MRM.system_clock() == MH16) debug.echo("16 MHZ\n"); else if (MRM.system_clock() == MH25) debug.echo("25 MHZ\n"); else debug.echo("Unknown Speed detected!"); green.off(); exit(0); }
|
|
Constructor setting system clock speed because.
|
1.3