dRonin
adbada4
dRonin firmware
|
PiOS Delay functionality. More...
Data Structures | |
struct | rtc_callback_entry |
Macros | |
#define | SYSTICK_HZ 1250 |
#define | RTC_DIVIDER 2 /* Must be power of 2; this results in 625Hz "RTC" */ |
#define | PIOS_RTC_MAX_CALLBACKS 3 |
Functions | |
int32_t | PIOS_DELAY_Init (void) |
int32_t | PIOS_DELAY_WaituS (uint32_t uS) |
int32_t | PIOS_DELAY_WaitmS (uint32_t mS) |
uint32_t | PIOS_DELAY_GetuS () |
Query the Delay timer for the current uS. More... | |
uint32_t | PIOS_DELAY_GetuSSince (uint32_t t) |
Calculate time in microseconds since a previous time. More... | |
uint32_t | PIOS_DELAY_GetuSExpired (uint32_t t) |
Calculates whether a given time has passed. More... | |
uint32_t | PIOS_DELAY_GetRaw () |
Get the raw delay timer, useful for timing. More... | |
uint32_t | PIOS_DELAY_DiffuS (uint32_t raw) |
Subtract raw time from now and convert to us. More... | |
uint32_t | PIOS_DELAY_DiffuS2 (uint32_t raw, uint32_t later) |
Subrtact two raw times and convert to us. More... | |
static uint32_t | get_monotonic_us_time (void) |
static void | PIOS_DELAY_Systick_Handler (void) |
float | PIOS_RTC_Rate () |
float | PIOS_RTC_MsPerTick () |
bool | PIOS_RTC_RegisterTickCallback (void(*fn)(uintptr_t id), uintptr_t data) |
static void | PIOS_RTC_Tick () |
Variables | |
static uint32_t | base_time |
static uint32_t | us_ticks |
static uint32_t | us_modulo |
static struct rtc_callback_entry | rtc_callback_list [PIOS_RTC_MAX_CALLBACKS] |
PiOS Delay functionality.
#define PIOS_RTC_MAX_CALLBACKS 3 |
Definition at line 39 of file pios_delay.c.
#define RTC_DIVIDER 2 /* Must be power of 2; this results in 625Hz "RTC" */ |
Definition at line 37 of file pios_delay.c.
#define SYSTICK_HZ 1250 |
Definition at line 36 of file pios_delay.c.
|
static |
Definition at line 73 of file pios_delay.c.
uint32_t PIOS_DELAY_DiffuS | ( | uint32_t | raw | ) |
Subtract raw time from now and convert to us.
Definition at line 159 of file pios_delay.c.
uint32_t PIOS_DELAY_DiffuS2 | ( | uint32_t | raw, |
uint32_t | later | ||
) |
Subrtact two raw times and convert to us.
Definition at line 164 of file pios_delay.c.
uint32_t PIOS_DELAY_GetRaw | ( | ) |
Get the raw delay timer, useful for timing.
Definition at line 153 of file pios_delay.c.
uint32_t PIOS_DELAY_GetuS | ( | ) |
Query the Delay timer for the current uS.
Definition at line 173 of file pios_delay.c.
uint32_t PIOS_DELAY_GetuSExpired | ( | uint32_t | t | ) |
Calculates whether a given time has passed.
[in] | t | the time in question |
Definition at line 193 of file pios_delay.c.
uint32_t PIOS_DELAY_GetuSSince | ( | uint32_t | t | ) |
Calculate time in microseconds since a previous time.
[in] | t | previous time |
Definition at line 183 of file pios_delay.c.
int32_t PIOS_DELAY_Init | ( | void | ) |
Initialises the Timer used by PIOS_DELAY functions
This is called from pios.c as part of the main() function at system start up.
Initialises the Timer used by PIOS_DELAY functions.
Definition at line 98 of file pios_delay.c.
|
static |
Definition at line 48 of file pios_delay.c.
int32_t PIOS_DELAY_WaitmS | ( | uint32_t | ms | ) |
Waits for a specific number of mS
Example:
[in] | mS | delay (1..65535 milliseconds) |
Waits for a specific number of mS
Example:
[in] | mS | delay (1..65535 milliseconds) |
Definition at line 140 of file pios_delay.c.
int32_t PIOS_DELAY_WaituS | ( | uint32_t | us | ) |
Waits for a specific number of uS
Example:
[in] | uS | delay (1..65535 microseconds) |
Waits for a specific number of uS
Example:
[in] | uS | delay |
Definition at line 116 of file pios_delay.c.
float PIOS_RTC_MsPerTick | ( | ) |
Definition at line 180 of file pios_delay.c.
float PIOS_RTC_Rate | ( | ) |
Definition at line 175 of file pios_delay.c.
bool PIOS_RTC_RegisterTickCallback | ( | void(*)(uintptr_t id) | fn, |
uintptr_t | data | ||
) |
Definition at line 185 of file pios_delay.c.
|
static |
Definition at line 203 of file pios_delay.c.
|
static |
This is the value used as a base. Strictly not required, as times can be expected to wrap... But it makes sense to get sane numbers at first that will agree with the PIOS_Thread ones etc.
Definition at line 42 of file pios_delay.c.
|
static |
Definition at line 46 of file pios_delay.c.
|
static |
Definition at line 39 of file pios_delay.c.
|
static |
Definition at line 38 of file pios_delay.c.