5.11.0.0R3
Software Development Kit
 
Loading...
Searching...
No Matches
ltrx_definitions.h File Reference

Definitions for general use. More...

Data Structures

struct  ltrx_power_level_application
 Represents a power level application for registration. More...
 

Macros

#define ARRAY_SIZE(a)
 Size of array.
 
#define ASSIGN_CONST_STRUCT_POINTER_FROM_MEMBER_POINTER(sp, st, m, mp)
 Const structure pointer from member pointer.
 
#define ASSIGN_STRUCT_POINTER_FROM_MEMBER_POINTER(sp, st, m, mp)
 Structure pointer from member pointer.
 
#define INTEGERIFY(v)
 Unsigned long from defined number.
 
#define KILOBYTE   0x400
 Kilobyte.
 
#define ltrx_free(addr)
 Free previously allocated memory.
 
#define LTRX_MUTEX_WAIT(mutex, timeout_in_milliseconds)
 Wait for a mutex.
 
#define ltrx_preemption_block()
 Block preemption.
 
#define ltrx_thread_sleep(timeMsec)
 Pause this thread.
 
#define ltrx_thread_yield()
 Yield control to other threads.
 
#define LTRX_TRIGGER_WAIT(trigger, timeout_in_milliseconds)
 Wait for a trigger.
 
#define MALLOC(size)
 Allocate memory.
 
#define MALLOC_ZEROED(size)
 Allocate memory and clear it to zeroes.
 
#define MAXIMUM(a, b)
 Larger of two numbers.
 
#define MEGABYTE   0x100000
 Megabyte.
 
#define MEMALIGN(align_size, requested_size)
 Allocate memory with alignment.
 
#define MEMBER_OFFSET(st, m)
 Offset of member in struct.
 
#define MINIMUM(a, b)
 Smaller of two numbers.
 
#define REALLOC(addr, newSize)
 Re-allocate memory and copy original into it.
 
#define STACK_SIZE_GREEN_FROM_MAX_OBSERVED_STACK_USED(used)
 Compute stack size based on observation.
 
#define STRDUP(string)
 Allocate memory and copy a string into it.
 
#define STRINGIFY(v)
 String from defined number.
 
#define STRNDUP(string, n)
 Allocate memory and copy a string into it, up to a limit.
 
#define TIME_WAIT_FOREVER   0xffffffff
 Wait forever.
 

Functions

uint32_t ltrx_elapsed_time_current_ms (uint32_t time_mark)
 Measure time since time mark.
 
uint32_t ltrx_get_uptime_ms (void)
 Get device uptime.
 
void ltrx_interrupt_disable (void)
 Disable interrupts.
 
void ltrx_interrupt_enable (void)
 Enable interrupts.
 
bool ltrx_malloc_has_ever_failed (void)
 Determine if any memory allocation has yet failed.
 
bool ltrx_mutex_create (struct ltrx_mutex *mutex, const char *name)
 Create a mutex.
 
bool ltrx_mutex_destroy (struct ltrx_mutex *mutex)
 Destroy a mutex.
 
struct ltrx_thread * ltrx_mutex_held_by (const struct ltrx_mutex *mutex)
 Get ID of thread holding mutex.
 
void ltrx_mutex_signal (struct ltrx_mutex *mutex)
 Relinquish a mutex.
 
const char * ltrx_platform_get_product_type (void)
 Get the product type name.
 
void ltrx_power_level_application_permit_shutdown (const char *applicationName, uint32_t durationSeconds)
 Application permits shutdown for specified time duration.
 
void ltrx_power_level_application_register (const struct ltrx_power_level_application *application)
 Register an application to have a voice in power control.
 
void ltrx_power_level_application_request_full_power (const char *applicationName)
 Application requests full power till further notice.
 
void ltrx_preemption_unblock (void)
 Unblock preemption.
 
struct ltrx_thread * ltrx_thread_create (const char *name, void(*entry_function)(void *opaque), void *entry_opaque, uint32_t stack_size)
 Create a thread.
 
void ltrx_thread_destroy (struct ltrx_thread *thread)
 Destroy a thread.
 
struct ltrx_thread * ltrx_thread_id (void)
 Get current thread ID.
 
void ltrx_thread_resume (struct ltrx_thread *thread)
 Resumes a thread.
 
void ltrx_thread_suspend (void)
 Suspend a thread.
 
void ltrx_thread_wake (struct ltrx_thread *thread)
 Wake a thread.
 
uint32_t ltrx_timemark (void)
 Get time mark.
 
void ltrx_trigger_clear (struct ltrx_trigger *trigger)
 Clear a trigger.
 
bool ltrx_trigger_create (struct ltrx_trigger *trigger, const char *name)
 Create a trigger.
 
bool ltrx_trigger_destroy (struct ltrx_trigger *trigger)
 Destroy a trigger.
 
void ltrx_trigger_signal (struct ltrx_trigger *trigger)
 Signal a trigger.
 

Detailed Description

Definitions for general use.

Macro Definition Documentation

◆ KILOBYTE

#define KILOBYTE   0x400

Kilobyte.

Typically a multiplier.

◆ MEGABYTE

#define MEGABYTE   0x100000

Megabyte.

Typically a multiplier.

◆ TIME_WAIT_FOREVER

#define TIME_WAIT_FOREVER   0xffffffff

Wait forever.

Many macros or functions with a timeout parameter will accept this value to represent an indefinite period of time.