Symbol Timer Functions

void halInternalStartSymbolTimer (void)
 Initializes the symbol timer. When a dedicated symbol timer peripheral exists (e.g. EM2xx, EM3xx) this initialization is generally performed directly by the PHY, so this routine may be a no-op. More...
 
uint32_t halStackGetInt32uSymbolTick (void)
 Returns the current symbol time in symbol ticks (units are platform-dependent, but typically on the order of microseconds). More...
 
bool halStackInt32uSymbolTickGTorEqual (uint32_t st1, uint32_t st2)
 Returns true if symbol tick time st1 is greater than symbol tick time st2, as determined by half the range of the symbol timer. Can only account for 1 wrap around between st1 and st2 before it is wrong. More...
 
uint32_t halStackGetSymbolTicksPerSecond (void)
 Obtains the number of symtol timer ticks in one second of real time. Can be used for conversion between real time and symbol ticks. More...
 

MAC Timer Support Functions

These functions are used for MAC layer timing and symbol-based delays.

Applications should not directly call these functions. They are used internally by the operation of the stack.

enum  EmHalSymbolDelayChannel_t {
  EM_HAL_SYMBOL_DELAY_CHANNEL_A,
  EM_HAL_SYMBOL_DELAY_CHANNEL_B,
  EM_HAL_SYMBOL_DELAY_CHANNELS
}
 Specifies two independent channels for symbol delay operations. More...
 
typedef void(* EmHalSymbolDelayCallback_t) (EmHalSymbolDelayChannel_t delayChan)
 Specifies the callback API triggered when the symbol timer channel expires. More...
 
uint32_t halStackOrderSymbolDelay (EmHalSymbolDelayChannel_t delayChan, EmHalSymbolDelayCallback_t callback, uint32_t microseconds)
 Sets up a delay timer to call the indicated interrupt-context callback when it expires. More...
 
void halStackCancelSymbolDelay (EmHalSymbolDelayChannel_t delayChan, EmHalSymbolDelayCallback_t callback)
 Cancels the delay set up by an earlier halStackOrderSymbolDelay() call. More...
 
void halStackOrderInt16uSymbolDelayA (uint16_t symbols)
 Sets up a timer and calls an interrupt-context callback when it expires. More...
 
void halStackCancelSymbolDelayA (void)
 Cancels the timer set up by halStackOrderInt16uSymbolDelayA(). More...
 
void halStackSymbolDelayAIsr (void)
 This is the interrupt level callback into the stack that is called when the timers set by halStackOrderInt16uSymbolDelayA expire. More...
 

Detailed Description

See symbol-timer.h for source code.

Typedef Documentation

typedef void(* EmHalSymbolDelayCallback_t) (EmHalSymbolDelayChannel_t delayChan)

Specifies the callback API triggered when the symbol timer channel expires.

Definition at line 74 of file symbol-timer.h.

Enumeration Type Documentation

Specifies two independent channels for symbol delay operations.

Enumerator
EM_HAL_SYMBOL_DELAY_CHANNEL_A 
EM_HAL_SYMBOL_DELAY_CHANNEL_B 
EM_HAL_SYMBOL_DELAY_CHANNELS 

Definition at line 65 of file symbol-timer.h.

Function Documentation

void halInternalStartSymbolTimer ( void  )

Initializes the symbol timer. When a dedicated symbol timer peripheral exists (e.g. EM2xx, EM3xx) this initialization is generally performed directly by the PHY, so this routine may be a no-op.

void halStackCancelSymbolDelay ( EmHalSymbolDelayChannel_t  delayChan,
EmHalSymbolDelayCallback_t  callback 
)

Cancels the delay set up by an earlier halStackOrderSymbolDelay() call.

Parameters
delayChanThe symbol timer delay channel specified in the earlier halStackOrderSymbolDelay() call.
callbackThe callback specified in the earlier halStackOrderSymbolDelay() call.
Note
If cancelled prior to the delay expiring, the original callback will not be called.
void halStackCancelSymbolDelayA ( void  )

Cancels the timer set up by halStackOrderInt16uSymbolDelayA().

uint32_t halStackGetInt32uSymbolTick ( void  )

Returns the current symbol time in symbol ticks (units are platform-dependent, but typically on the order of microseconds).

Returns
The least significant 32 bits of the current symbol time in symbol timer ticks.
uint32_t halStackGetSymbolTicksPerSecond ( void  )

Obtains the number of symtol timer ticks in one second of real time. Can be used for conversion between real time and symbol ticks.

Returns
How many symbol ticks occur in a second.
bool halStackInt32uSymbolTickGTorEqual ( uint32_t  st1,
uint32_t  st2 
)

Returns true if symbol tick time st1 is greater than symbol tick time st2, as determined by half the range of the symbol timer. Can only account for 1 wrap around between st1 and st2 before it is wrong.

void halStackOrderInt16uSymbolDelayA ( uint16_t  symbols)

Sets up a timer and calls an interrupt-context callback when it expires.

Used by the MAC to request an interrupt callback at a specified amount of time in the future.

Parameters
symbolsThe delay, in symbols.
uint32_t halStackOrderSymbolDelay ( EmHalSymbolDelayChannel_t  delayChan,
EmHalSymbolDelayCallback_t  callback,
uint32_t  microseconds 
)

Sets up a delay timer to call the indicated interrupt-context callback when it expires.

Used by the MAC to request an interrupt callback at a specified number of symbol timer ticks in the future.

Parameters
delayChanThe symbol timer delay channel to use.
callbackThe callback to call in interrupt context when the delay expires. If NULL, the timer is not actually started, but the return value is accurate; useful for polling.
microsecondsThe delay, in units of microseconds.
Returns
The absolute symbol tick value of the delay (usually in the future).
Note
Internal conversion of microseconds to symbol ticks will use a rounding function.
No minimum delay is enforced; short delays may trigger the callback immediately, before this routine returns to its caller.
void halStackSymbolDelayAIsr ( void  )

This is the interrupt level callback into the stack that is called when the timers set by halStackOrderInt16uSymbolDelayA expire.