| PIC24 Support Libraries
    | 
Go to the source code of this file.
| Macros | |
| #define | getTimerPrescale(TxCONbits) getTimerPrescaleBits(TxCONbits.TCKPS) | 
| Functions | |
| uint16_t | msToU16Ticks (uint16_t u16_ms, uint16_t u16_pre) | 
| uint16_t | usToU16Ticks (uint16_t u16_us, uint16_t u16_pre) | 
| uint32_t | usToU32Ticks (uint32_t u32_us, uint16_t u16_pre) | 
| uint32_t | ticksToMs (uint32_t u32_ticks, uint16_t u16_tmrPre) | 
| uint32_t | ticksToUs (uint32_t u32_ticks, uint16_t u16_tmrPre) | 
| uint32_t | ticksToNs (uint32_t u32_ticks, uint16_t u16_tmrPre) | 
| uint16_t | getTimerPrescaleBits (uint8_t u8_TCKPS) | 
| uint32_t | computeDeltaTicksLong (uint16_t u16_start, uint16_t u16_end, uint16_t u16_tmrPR, uint16_t u16_oflows) | 
| uint16_t | computeDeltaTicks (uint16_t u16_start, uint16_t u16_end, uint16_t u16_tmrPR) | 
To do.
Definition in file pic24_timer.h.
| #define getTimerPrescale | ( | TxCONbits | ) | getTimerPrescaleBits(TxCONbits.TCKPS) | 
Given the TxCON register as a bitfield, determines the prescale based on the TCKPS bitfield. Works for PIC24H, PIC24F timers. Simply accesses the TCKPS bitfield then calls getTimerPrescaleBits with the bitfield.
| TxCONbits | The TxCONbits for the timer in question | 
Definition at line 23 of file pic24_timer.h.
| uint16_t computeDeltaTicks | ( | uint16_t | u16_start, | 
| uint16_t | u16_end, | ||
| uint16_t | u16_tmrPR | ||
| ) | 
Computes delta ticks between two Timer register captures Assumes the delta time does not exceeds the timer period
| u16_start | start tick | 
| u16_end | end tick | 
| u16_tmrPR | Timer period register | 
Definition at line 193 of file pic24_timer.c.
| uint32_t computeDeltaTicksLong | ( | uint16_t | u16_start, | 
| uint16_t | u16_end, | ||
| uint16_t | u16_tmrPR, | ||
| uint16_t | u16_oflows | ||
| ) | 
Computes delta ticks between two Timer register captures Assumes long time interval and thus has a parameter for tracking timer overflows
| u16_start | start tick | 
| u16_end | end tick | 
| u16_tmrPR | Timer period register | 
| u16_oflows | number of timer overflows | 
Definition at line 172 of file pic24_timer.c.
| uint16_t getTimerPrescaleBits | ( | uint8_t | u8_TCKPS | ) | 
Given the TCKPS bitfield, return the timer prescale encoded by these bits. Use getTimerPrescale as a convenient way to extract the TCKPS bitfield from a TxCONbits SFT then call this function.
| u8_TCKPS | TCKPS bitfield from the timer in question | 
Definition at line 158 of file pic24_timer.c.
| uint16_t msToU16Ticks | ( | uint16_t | u16_ms, | 
| uint16_t | u16_pre | ||
| ) | 
Converts milliseconds to 16-bit timer ticks.
| u16_ms | Time, in milliseconds, to convert to ticks | 
| u16_pre | Prescale set for this timer. Note that getTimerPrescale can easily determine this. | 
Definition at line 53 of file pic24_timer.c.
| uint32_t ticksToMs | ( | uint32_t | u32_ticks, | 
| uint16_t | u16_tmrPre | ||
| ) | 
Converts timer ticks to milliseconds
| u32_ticks | Timer ticks | 
| u16_tmrPre | Timer prescale value | 
Definition at line 106 of file pic24_timer.c.
| uint32_t ticksToNs | ( | uint32_t | u32_ticks, | 
| uint16_t | u16_tmrPre | ||
| ) | 
Converts timer ticks to nanoseconds
| u32_ticks | Timer ticks | 
| u16_tmrPre | Timer prescale value | 
Definition at line 139 of file pic24_timer.c.
| uint32_t ticksToUs | ( | uint32_t | u32_ticks, | 
| uint16_t | u16_tmrPre | ||
| ) | 
Converts timer ticks to microseconds
| u32_ticks | Timer ticks | 
| u16_tmrPre | Timer prescale value | 
Definition at line 123 of file pic24_timer.c.
| uint16_t usToU16Ticks | ( | uint16_t | u16_us, | 
| uint16_t | u16_pre | ||
| ) | 
Converts microseconds to 16-bit timer ticks.
| u16_us | Time, in microseconds, to convert to ticks | 
| u16_pre | Prescale set for this timer. Note that getTimerPrescale can easily determine this. | 
Definition at line 71 of file pic24_timer.c.
| uint32_t usToU32Ticks | ( | uint32_t | u32_us, | 
| uint16_t | u16_pre | ||
| ) | 
Converts microseconds to 32-bit timer ticks.
| u32_us | Time, in microseconds, to convert to ticks | 
| u16_pre | Prescale set for this timer. Note that getTimerPrescale can easily determine this. | 
Definition at line 90 of file pic24_timer.c.
 1.8.13
 1.8.13