Hi Seb, I think it can be done from the datasheets, to have a wiki page similar as the SSPCON registers, so I can look for commonalityifferences of the registers mappings throughout the various PICs Albert
----- Original Message ----- From: "Sebastien Lelong" <[email protected]> To: <[email protected]> Sent: Saturday, August 01, 2009 8:31 AM Subject: [jallib] Re: Timer Library? Hi Albert, Nice idea. User could also register a callable called when timer reaches 0 (or another value), or when an interrupt is raised. Having alias feature makes code clear. procedure my_proc() is -- bla end procedure alias my_proc is timerX_callable In addition it > would be nice to have a wiki page with the timer related registers > (Seb?). Do you me to parse datasheets ? Maybe this information can be taken from MPLAB files (or device files ?) more easily. Rob, is it possible to do this from one of those ? Let me know, if not, I'll try to get something from DS. Cheers, Seb > Hello, > I was thinking of creating a generic library for the 8 and 16 bit > timers. For almost every project with PICs I've used the timers wihin > the PICs. So I browsed through my JAL source files and looked for a > common timer pattern(s) I've used. Below a first shot how the > interface, which can be used to start the discussion. In addition it > would be nice to have a wiki page with the timer related registers > (Seb?). > > > const TIMERX_TICKS_PER_SECOND = 1200 > > > -- reset timer, set value to 0 > procedure timerX_reset() is > end procedure > > -- enable timer X > procedure timerX_enable() is > end procedure > > -- disable timer X > procedure timerX_disable() is > end procedure > > -- get the current timer value > function timer1_get() return word is > end function > > -- block until ticks value < timer value > procedure timer_wait_till_tick( word in ticks) is > end procedure > > -- initialize timer > procedure timer1_init() is > end procedure > > -- enable timer X > procedure timerX_enable_interrupt() is > end procedure > > -- disable timer X > procedure timerX_disable_interrupt() is > end procedure > > > > > -- Sbastien Lelong http://www.sirloon.net http://sirbot.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jallib" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jallib?hl=en -~----------~----~----~----~------~----~------~--~---
