Wim van der Vegt / RIT

Dependents:   ORTP-L_SensorTest ORTP-L_V01 ORTP-L_V01 RIT_Demo

Embed: (wiki syntax)

« Back to documentation index

RIT Class Reference

RIT Class Reference

Repetitive Interrupt Timer (RIT) class. More...

#include <RIT.h>

Public Member Functions

 RIT (uint32_t ms)
 Constructor.
void setup_ms (uint32_t ms)
 Setup timing in ms.
void setup_us (uint32_t us)
 Setup timing in us.
void attach (void(*fptr)(void))
 Attach custom interrupt handler replacing default.
void detach (void)
 Restore default interrupt handler.
void append (void(*fptr)(void))
 Append function isr to global interrupt handler.
void unappend ()
 Remove function isr from global interrupt handler.
void enable (void)
 Enable RIT & Interrupt.
void disable (void)
 Disable RIT & Interrupt.
void power_enable (void)
 Power up RIT.
void power_disable (void)
 Power down RIT.

Detailed Description

Repetitive Interrupt Timer (RIT) class.

Sample Code:

DigitalOut rit_led(LED3);

//Our function isr. void RIT_IRQHandler(void) { rit_led=!rit_led; // Flash a Led }

RIT rit(1000); //Set interval to 1000 ms or 1 second.

rit.append(RIT_IRQHandler); //Append our own function ISR. rit.enable();

wait(10); //wait 10 seconds (and watch the led flashing).

rit.disable(); rit.unappend();

Definition at line 54 of file RIT.h.


Constructor & Destructor Documentation

RIT ( uint32_t  ms )

Constructor.

ms the number of milliseconds between two interrupts.

Definition at line 38 of file RIT.cpp.


Member Function Documentation

void append ( void(*)(void)  fptr )

Append function isr to global interrupt handler.

fptr the function isr to be called from within the default interrupt handler.

void attach ( void(*)(void)  fptr )

Attach custom interrupt handler replacing default.

fptr the new interrupt handler.

Definition at line 78 of file RIT.cpp.

void detach ( void   )

Restore default interrupt handler.

Definition at line 84 of file RIT.cpp.

void disable ( void   )

Disable RIT & Interrupt.

Definition at line 109 of file RIT.cpp.

void enable ( void   )

Enable RIT & Interrupt.

Definition at line 101 of file RIT.cpp.

void power_disable ( void   )

Power down RIT.

Note: Powering down might take some more effect when entering Deep Sleep, accoring to errata.lpc1768.pdf.

Definition at line 122 of file RIT.cpp.

void power_enable ( void   )

Power up RIT.

Definition at line 117 of file RIT.cpp.

void setup_ms ( uint32_t  ms )

Setup timing in ms.

ms the number of milliseconds between two interrupts.

Definition at line 66 of file RIT.cpp.

void setup_us ( uint32_t  us )

Setup timing in us.

us the number of microseconds between two interrupts.

Definition at line 72 of file RIT.cpp.

void unappend (  )

Remove function isr from global interrupt handler.

Definition at line 97 of file RIT.cpp.