A Ricker is a simple Ticker but using the RIT rather than Timer3

Embed: (wiki syntax)

« Back to documentation index

Ricker Class Reference

Ricker. More...

#include <Ricker.h>

Public Member Functions

 Ricker ()
 Constructor.
 ~Ricker ()
 Destructor.
void detach (void)
 detach
void attach_ms (void(*fptr)(void), uint32_t u)
 attach_ms
template<typename T >
void attach_ms (T *tptr, void(T::*mptr)(void), uint32_t u)
 attach_ms
void attach (void(*fptr)(void), double d)
 attach
template<typename T >
void attach (T *tptr, void(T::*mptr)(void), double d)
 attach

Protected Member Functions

void tick (void)
 tick

Detailed Description

Ricker.

A class used to create multiple Rickers. These attach themselves to the RickerSys main controller.

Note, unlike an Mbed Ticker, a Ricker can only make callbacks down to 1ms.

 #include "mbed.h"
 #include "Ricker.h"
 
 DigitalOut led1(LED1);

 Ricker r1;
  
 void cb1(void) { led1 = !led1; }
 
 int main() {
 
     r1.attach(&cb1, 0.25);
     
     while(1) { }
 }

Definition at line 82 of file Ricker.h.


Constructor & Destructor Documentation

Ricker (  )

Constructor.

Definition at line 107 of file Ricker.h.

~Ricker (  )

Destructor.

Definition at line 114 of file Ricker.h.


Member Function Documentation

void attach ( void(*)(void)  fptr,
double  d 
)

attach

Attach a C style function pointer callback.

Parameters:
fptrA C style function pointer.
doubled The number of seconds to call at.

Definition at line 161 of file Ricker.h.

void attach ( T *  tptr,
void(T::*)(void)  mptr,
double  d 
)

attach

Attach a C++ style functor object/method callback.

Parameters:
tptrA C++ style object pointer.
mptrA C++ style method pointer.
doubled The number of seconds to call at.

Definition at line 175 of file Ricker.h.

void attach_ms ( T *  tptr,
void(T::*)(void)  mptr,
uint32_t  u 
)

attach_ms

Attach a C++ style functor object/method callback.

Parameters:
tptrA C++ style object pointer.
mptrA C++ style method pointer.
uint32_tu The number of milliseconds to call at.

Definition at line 147 of file Ricker.h.

void attach_ms ( void(*)(void)  fptr,
uint32_t  u 
)

attach_ms

Attach a C style function pointer callback.

Parameters:
fptrA C style function pointer.
uint32_tu The number of milliseconds to call at.

Definition at line 133 of file Ricker.h.

void detach ( void   )

detach

Remove the callback from the Ricker.

Definition at line 122 of file Ricker.h.

void tick ( void   ) [protected]

tick

Definition at line 92 of file Ricker.h.