Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Application-defined function to convert a 32-bit CPU timestamp from timer counts to microseconds.

Files

cpu_core.h / Application’s cpu_bsp.c

Prototype

Code Block
languagecpp
          CPU_INT64U  CPU_TS32_to_uSec (CPU_TS32  ts_cnts);


Arguments

ts_cnts

32-bit CPU timestamp (in CPU timestamp timer counts).

Returned Value

Converted 32-bit CPU timestamp (in microseconds).

Required Configuration

CPU_TS32_to_uSec() is an application/BSP function that may be optionally defined by the developer if CPU_CFG_TS_32_EN is DEF_ENABLED in cpu_cfg.h. See Timestamps Configuration.

Notes / Warnings

  1. The amount of time measured by CPU timestamps is calculated by either of the following equations:

...

Developer-defined CPU_TS32_to_uSec() implementations may convert any number of CPU_TS32 bits, up to 32, into microseconds.

...

Implementation Template

Anchor
Listing - CPU_TS32_to_uSec() implementation template
Listing - CPU_TS32_to_uSec() implementation template

Code Block
languagecpp
titleListing - CPU_TS32_to_uSec() implementation template
linenumberstrue
          CPU_INT64U  CPU_TS32_to_uSec (CPU_TS32  ts_cnts)
          {
              CPU_INT64U  ts_usec;
           
              :
              :  /* Insert code to convert 32-bit CPU timestamp into microseconds. */
              :
           
              return (ts_usec);
          }