Ultibo API
C/C++ API for Ultibo Core
Loading...
Searching...
No Matches
platform.h File Reference

Go to the source code of this file.

Data Structures

struct  _DMA_DATA
struct  _SYSTEM_CALL_REQUEST
struct  _HANDLE_ENTRY
struct  _INTERRUPT_ENTRY
struct  _SYSTEM_CALL_ENTRY
struct  _PAGE_TABLE_ENTRY

Macros

#define HANDLE_FLAG_NONE   0x00000000
#define HANDLE_FLAG_NAMED   0x00000001
 Set if the handle has a name.
#define HANDLE_FLAG_DUPLICATE   0x00000002
 Set if the handle can be duplicated.
#define HANDLE_FLAG_INTERNAL   HANDLE_FLAG_NONE + 0x80000000
 Note: Temporary value to avoid warning.
#define HANDLE_SIGNATURE   0xCD15E20A
#define HANDLE_TABLE_MIN   0x100
 Minimum handle number (Skip first 256).
#define HANDLE_TABLE_MAX   0x7FFFFFFF
 Maximum handle number (Avoid MSB as THandle is a signed value).
#define HANDLE_TABLE_MASK   0x7FF
 2048 buckets for handle lookups
#define HANDLE_NAME_LENGTH   256
 Maximum length of handle name.
#define DMA_DATA_FLAG_NONE   0x00000000
#define DMA_DATA_FLAG_STRIDE   0x00000001
 Transfer from the source to the destination using 2D stride (If supported).
#define DMA_DATA_FLAG_SOURCE_NOINCREMENT   0x00000002
 Don't increment the source address during the DMA request (If supported).
#define DMA_DATA_FLAG_DEST_NOINCREMENT   0x00000004
 Don't increment the dest address during the DMA request (If supported).
#define DMA_DATA_FLAG_SOURCE_DREQ   0x00000008
 Use DREQ gating on the source address during the DMA request (If supported).
#define DMA_DATA_FLAG_DEST_DREQ   0x00000010
 Use DREQ gating on the dest address during the DMA request (If supported).
#define DMA_DATA_FLAG_SOURCE_WIDE   0x00000020
 Use wide reads on the source address during the DMA request (If supported).
#define DMA_DATA_FLAG_DEST_WIDE   0x00000040
 Use wide writes on the dest address during the DMA request (If supported).
#define DMA_DATA_FLAG_NOREAD   0x00000080
 Ignore the source address and zero fill the destination (If supported).
#define DMA_DATA_FLAG_NOWRITE   0x00000100
 Ignore the dest address and cache fill from the source (If supported).
#define DMA_DATA_FLAG_NOCLEAN   0x00000200
 Do not perform cache clean on the source address (If applicable).
#define DMA_DATA_FLAG_NOINVALIDATE   0x00000400
 Do not perform cache invalidate on the dest address (If applicable).
#define DMA_DATA_FLAG_BULK   0x00000800
 Perform a bulk transfer (Higher transfer throughput)(If applicable).
#define DMA_DATA_FLAG_LITE   0x00001000
 Perform a "lite" transfer (Lower transfer throughput but less waiting for free channel) (If applicable).
#define DMA_DATA_FLAG_40BIT   0x00002000
 Perform a 40-bit address transfer (Address to memory above 1GB or 4GB depending on SoC) (If applicable).
#define PAGE_TABLE_FLAG_NONE   0x00000000
#define PAGE_TABLE_FLAG_NORMAL   0x00000002
 Page Table Entry represents Normal memory.
#define PAGE_TABLE_FLAG_DEVICE   0x00000004
 Page Table Entry represents Device memory.
#define PAGE_TABLE_FLAG_ORDERED   0x00000008
 Page Table Entry represents Ordered memory.
#define PAGE_TABLE_FLAG_SHARED   0x00000010
 Page Table Entry represents Shared memory.
#define PAGE_TABLE_FLAG_CACHEABLE   0x00000020
 Page Table Entry represents Cacheable memory.
#define PAGE_TABLE_FLAG_READONLY   0x00000040
 Page Table Entry represents Read Only memory.
#define PAGE_TABLE_FLAG_READWRITE   0x00000080
 Page Table Entry represents Read Write memory.
#define PAGE_TABLE_FLAG_EXECUTABLE   0x00000100
 Page Table Entry represents Executable memory.
#define PAGE_TABLE_FLAG_WRITEBACK   0x00000200
 Page Table Entry is Writeback Cacheable memory.
#define PAGE_TABLE_FLAG_WRITETHROUGH   0x00000400
 Page Table Entry is Writethrough Cacheable memory.
#define PAGE_TABLE_FLAG_WRITEALLOCATE   0x00000800
 Page Table Entry is Writeallocate Cacheable memory.
#define INTERRUPT_FLAG_NONE   0x00000000
#define INTERRUPT_FLAG_SHARED   0x00000001
 A shared interrupt, multiple devices can register for the same interrupt and each will be called until one returns INTERRUPT_RETURN_HANDLED.
#define INTERRUPT_FLAG_LOCAL   0x00000002
 A local interrupt, generated only on the CPU it is associated with.
#define INTERRUPT_FLAG_IPI   0x00000004
 A software interrupt or inter processor interrupt, generated by a software request instead of hardware.
#define INTERRUPT_FLAG_FIQ   0x00000008
 A fast interrupt, takes precedence over all other interrupts (where applicable).
#define INTERRUPT_FLAG_CHAINED   0x00000010
 A chained interrupt, multiple devices can register for the same interrupt and all will be called when it occurs.
#define INTERRUPT_PRIORITY_MAXIMUM   0x00
#define INTERRUPT_PRIORITY_FIQ   0x40
#define INTERRUPT_PRIORITY_DEFAULT   0xA0
#define INTERRUPT_PRIORITY_MINIMUM   0xF0
#define INTERRUPT_RETURN_NONE   0
 Shared interrupt not handled or not for this device.
#define INTERRUPT_RETURN_HANDLED   1
 Shared interrupt handled, no further processing.
#define VECTOR_TABLE_ENTRY_ARM_RESET   0
 ARM Reset Vector.
#define VECTOR_TABLE_ENTRY_ARM_UNDEFINED   1
 ARM Undefined Vector.
#define VECTOR_TABLE_ENTRY_ARM_SWI   2
 ARM Software Interrupt (SWI) Vector.
#define VECTOR_TABLE_ENTRY_ARM_PREFETCH   3
 ARM Prefetch Abort Vector.
#define VECTOR_TABLE_ENTRY_ARM_ABORT   4
 ARM Data Abort Vector.
#define VECTOR_TABLE_ENTRY_ARM_RESERVED   5
 ARM Reserved Vector.
#define VECTOR_TABLE_ENTRY_ARM_IRQ   6
 ARM IRQ Vector.
#define VECTOR_TABLE_ENTRY_ARM_FIQ   7
 ARM FIQ Vector.
#define SHUTDOWN_FLAG_NONE   0x00000000
#define SHUTDOWN_FLAG_RESTART   0x00000001
 The system is shutting down and restarting.
#define SHUTDOWN_FLAG_FORCE   0x00000002
 Forced shutdown or restart requested, registered callbacks will be bypassed.
#define SHUTDOWN_SIGNATURE   0xA73D8B0C
#define SHUTDOWN_DEFAULT_DELAY   1000
 Default delay before starting a shutdown or restart (Milliseconds).
#define SHUTDOWN_MINIMUM_DELAY   10
 Minimum delay before starting a shutdown or restart (Milliseconds).
#define SHUTDOWN_DEFAULT_TIMEOUT   5000
 Default time to wait for a shutdown callback to complete before continuing (Milliseconds).
#define EXCEPTION_TYPE_DATA_ABORT   1
#define EXCEPTION_TYPE_PREFETCH_ABORT   2
#define EXCEPTION_TYPE_UNDEFINED_INSTRUCTION   3
#define FIRMWARE_THROTTLE_NONE   (0 << 0)
#define FIRMWARE_THROTTLE_UNDER_VOLTAGE   (1 << 0)
 Under voltage is occurring.
#define FIRMWARE_THROTTLE_FREQUENCY_LIMIT   (1 << 1)
 Frequency limiting is occurring.
#define FIRMWARE_THROTTLE_THROTTLED   (1 << 2)
 Throttling is occurring.
#define FIRMWARE_THROTTLE_SOFT_TEMP_LIMIT   (1 << 3)
 Soft temperature limit is active.
#define FIRMWARE_THROTTLE_WAS_UNDER_VOLTAGE   (1 << 16)
 Under voltage has occurred.
#define FIRMWARE_THROTTLE_WAS_FREQUENCY_LIMIT   (1 << 17)
 Frequency limiting has occurred.
#define FIRMWARE_THROTTLE_WAS_THROTTLED   (1 << 18)
 Throttling has occurred.
#define FIRMWARE_THROTTLE_WAS_SOFT_TEMP_LIMIT   (1 << 19)
 Soft temperature limit has occurred.

Typedefs

typedef uint32_t IRQ_MASK
typedef uint32_t FIQ_MASK
typedef uint32_t IRQ_FIQ_MASK
typedef uint32_t ABORT_MASK
typedef struct _DMA_DATA DMA_DATA
typedef struct _SYSTEM_CALL_REQUEST SYSTEM_CALL_REQUEST
typedef void STDCALL(* handle_close_proc) (HANDLE data)
typedef uint32_t STDCALL(* handle_close_ex_proc) (HANDLE data)
typedef HANDLE STDCALL(* handle_duplicate_proc) (HANDLE data)
typedef struct _HANDLE_ENTRY HANDLE_ENTRY
typedef uint32_t STDCALL(* handle_enumerate_cb) (HANDLE_ENTRY *handle, void *data)
typedef uint32_t STDCALL(* shutdown_cb) (uint32_t flags, void *parameter)
typedef void STDCALL(* interrupt_handler) (void *parameter)
typedef THREAD_HANDLE STDCALL(* interrupt_ex_handler) (uint32_t cpuid, THREAD_HANDLE thread, void *parameter)
typedef uint32_t STDCALL(* shared_interrupt_handler) (uint32_t number, uint32_t cpuid, uint32_t flags, void *parameter)
typedef struct _INTERRUPT_ENTRY INTERRUPT_ENTRY
typedef struct _SYSTEM_CALL_ENTRY SYSTEM_CALL_ENTRY
typedef struct _PAGE_TABLE_ENTRY PAGE_TABLE_ENTRY
typedef shared_interrupt_handler ipi_handler
typedef void STDCALL(* system_call_handler) (SYSTEM_CALL_REQUEST *request)
typedef THREAD_HANDLE STDCALL(* system_call_ex_handler) (uint32_t cpuid, THREAD_HANDLE thread, SYSTEM_CALL_REQUEST *request)
typedef uint32_t STDCALL(* thread_yield_proc) (void)
typedef uint32_t STDCALL(* thread_wait_proc) (LIST_HANDLE list, SPIN_HANDLE lock, uint32_t flags)
typedef uint32_t STDCALL(* thread_wait_ex_proc) (LIST_HANDLE list, SPIN_HANDLE lock, uint32_t flags, uint32_t timeout)
typedef uint32_t STDCALL(* thread_release_proc) (LIST_HANDLE list)
typedef uint32_t STDCALL(* thread_abandon_proc) (LIST_HANDLE list)
typedef void STDCALL(* timer_event_proc) (void *data)
typedef void STDCALL(* worker_task_proc) (void *data)
typedef void STDCALL(* worker_cb) (void *data)
typedef void STDCALL(* counter_event_cb) (void *data)
typedef void STDCALL(* gpio_event_cb) (void *data, uint32_t pin, uint32_t trigger)

Functions

BOOL STDCALL device_tree_valid (void)
 Check if valid Device Tree information was provided by the firmware/bootloader.
size_t STDCALL device_tree_get_base (void)
 Get the base address of the Device Tree Blob (Where Applicable).
uint32_t STDCALL device_tree_get_size (void)
 Get the total size of the Device Tree Blob (Where Applicable).
uint32_t STDCALL device_tree_read (const char *path, const char *name, void *buffer, uint32_t *size)
 Read the raw value of a Device Tree property (Where Applicable).
uint32_t STDCALL device_tree_read32 (const char *path, const char *name, uint32_t *value)
 Read a 32-bit value from a Device Tree property (Where Applicable).
uint32_t STDCALL device_tree_read64 (const char *path, const char *name, uint64_t *value)
 Read a 64-bit value from a Device Tree property (Where Applicable).
uint32_t STDCALL device_tree_read_string (const char *path, const char *name, char *value, uint32_t len)
 Read a string value from a Device Tree property (Where Applicable).
void STDCALL boot_blink (void)
 Blink the Activity LED (Where Applicable).
void STDCALL boot_output (uint32_t value)
 Output boot time information (Where Applicable).
void STDCALL boot_console_start (void)
 Start the boot time console display (Where Applicable).
void STDCALL boot_console_write (const char *value)
 Output text to the boot time console display (Where Applicable).
void STDCALL boot_console_write_ex (const char *value, uint32_t x, uint32_t y)
 Output text to the boot time console display at the specified X and Y position (Where Applicable).
uint32_t STDCALL boot_console_get_x (void)
 Get the current X position of the boot time console display (Where Applicable).
uint32_t STDCALL boot_console_get_y (void)
 Get the current Y position of the boot time console display (Where Applicable).
void STDCALL power_led_enable (void)
 Enable the Power LED (Where Applicable).
void STDCALL power_led_on (void)
 Turn On the Power LED (Where Applicable).
void STDCALL power_led_off (void)
 Turn Off the Power LED (Where Applicable).
void STDCALL activity_led_enable (void)
 Enable the Activity LED (Where Applicable).
void STDCALL activity_led_on (void)
 Turn On the Activity LED (Where Applicable).
void STDCALL activity_led_off (void)
 Turn Off the Activity LED (Where Applicable).
BOOL STDCALL counter_available (void)
 Check if a counter is currently available.
uint32_t STDCALL counter_read (void)
 Read the current value of the default counter.
int64_t STDCALL counter_read64 (void)
 Read the current value of the default counter.
uint32_t STDCALL counter_wait (void)
 Wait for the current interval to expire on the default counter.
uint32_t STDCALL counter_event (counter_event_cb callback, void *data)
 Schedule a function to be called when the current interval expires on the default counter.
uint32_t STDCALL counter_cancel (void)
 Cancel a previously scheduled event callback function on the default counter.
uint32_t STDCALL counter_get_rate (void)
 Get the current clock rate in Hz of the default counter.
uint32_t STDCALL counter_set_rate (uint32_t rate)
 Set the current clock rate in Hz of the default counter.
uint32_t STDCALL counter_get_interval (void)
 Get the current interval in ticks of the default counter.
uint32_t STDCALL counter_set_interval (uint32_t interval)
 Set the current interval in ticks of the default counter.
uint32_t STDCALL mailbox_receive (uint32_t mailbox, uint32_t channel)
 Receive from specified mailbox on specified channel.
void STDCALL mailbox_send (uint32_t mailbox, uint32_t channel, uint32_t data)
 Send to specified mailbox on specified channel.
uint32_t STDCALL mailbox_call (uint32_t mailbox, uint32_t channel, uint32_t data, uint32_t *response)
 Perform a transaction (Send/Receive) to specified mailbox on specified channel.
uint32_t STDCALL mailbox_call_ex (uint32_t mailbox, uint32_t channel, uint32_t data, uint32_t *response, uint32_t timeout)
 Perform a transaction (Send/Receive) to specified mailbox on specified channel.
uint32_t STDCALL mailbox_property_call (uint32_t mailbox, uint32_t channel, void *data, uint32_t *response)
 Perform a property tag transaction (Send/Receive) to specified mailbox on specified channel.
uint32_t STDCALL mailbox_property_call_ex (uint32_t mailbox, uint32_t channel, void *data, uint32_t *response, uint32_t timeout)
 Perform a property tag transaction (Send/Receive) to specified mailbox on specified channel.
uint32_t STDCALL mailbox_property_tag (uint32_t tag, void *data, uint32_t size)
 Request a property tag (Get/Set) from the mailbox property channel.
BOOL STDCALL random_available (void)
 Check if a hardware random number generator is currently available The software random number generator from the RTL is always available.
void STDCALL random_seed (uint32_t seed)
int32_t STDCALL random_read_longint (int32_t limit)
int64_t STDCALL random_read_int64 (int64_t limit)
double_t STDCALL random_read_double (void)
double_t STDCALL random_read_extended (void)
BOOL STDCALL watchdog_available (void)
 Check if a watchdog timer is currently available.
uint32_t STDCALL watchdog_start (uint32_t milliseconds)
uint32_t STDCALL watchdog_stop (void)
uint32_t STDCALL watchdog_refresh (uint32_t milliseconds)
uint32_t STDCALL request_irq (uint32_t cpuid, uint32_t number, interrupt_handler handler, void *parameter)
 Request registration of the supplied handler to the specified IRQ number.
uint32_t STDCALL release_irq (uint32_t cpuid, uint32_t number, interrupt_handler handler, void *parameter)
 Request deregistration of the supplied handler from the specified IRQ number.
uint32_t STDCALL request_ex_irq (uint32_t cpuid, uint32_t number, interrupt_handler handler, interrupt_ex_handler handlerex, void *parameter)
 Request registration of the supplied extended handler to the specified IRQ number.
uint32_t STDCALL release_ex_irq (uint32_t cpuid, uint32_t number, interrupt_handler handler, interrupt_ex_handler handlerex, void *parameter)
 Request deregistration of the supplied extended handler from the specified IRQ number.
uint32_t STDCALL request_fiq (uint32_t cpuid, uint32_t number, interrupt_handler handler, void *parameter)
 Request registration of the supplied handler to the specified FIQ number (Where Applicable).
uint32_t STDCALL release_fiq (uint32_t cpuid, uint32_t number, interrupt_handler handler, void *parameter)
 Request deregistration of the supplied handler from the specified FIQ number (Where Applicable).
uint32_t STDCALL request_ex_fiq (uint32_t cpuid, uint32_t number, interrupt_handler handler, interrupt_ex_handler handlerex, void *parameter)
 Request registration of the supplied extended handler to the specified FIQ number (Where Applicable).
uint32_t STDCALL release_ex_fiq (uint32_t cpuid, uint32_t number, interrupt_handler handler, interrupt_ex_handler handlerex, void *parameter)
 Request deregistration of the supplied extended handler from the specified FIQ number (Where Applicable).
uint32_t STDCALL request_ipi (uint32_t cpuid, uint32_t number, ipi_handler handler, void *parameter)
 Request registration of the supplied handler to the specified IPI (Inter-processor interrupt) number (Where Applicable).
uint32_t STDCALL release_ipi (uint32_t cpuid, uint32_t number, ipi_handler handler, void *parameter)
 Request deregistration of the supplied handler from the specified IPI (Inter-processor interrupt) number (Where Applicable).
uint32_t STDCALL register_interrupt (uint32_t number, uint32_t mask, uint32_t priority, uint32_t flags, shared_interrupt_handler handler, void *parameter)
 Request registration of the supplied handler to the specified interrupt number (Where Applicable).
uint32_t STDCALL deregister_interrupt (uint32_t number, uint32_t mask, uint32_t priority, uint32_t flags, shared_interrupt_handler handler, void *parameter)
 Request deregistration of the supplied handler from the specified interrupt number (Where Applicable).
void STDCALL system_call (uint32_t number, size_t param1, size_t param2, size_t param3)
 Perform a System Call function with the supplied parameters (Where Applicable).
uint32_t STDCALL register_system_call (uint32_t number, system_call_handler handler)
 Request registration of the supplied handler to the specified System Call number (Where Applicable).
uint32_t STDCALL deregister_system_call (uint32_t number, system_call_handler handler)
 Request deregistration of the supplied handler from the specified System Call number (Where Applicable).
uint32_t STDCALL register_system_call_ex (uint32_t cpuid, uint32_t number, system_call_handler handler, system_call_ex_handler handlerex)
 Request registration of the supplied extended handler to the specified System Call number (Where Applicable).
uint32_t STDCALL deregister_system_call_ex (uint32_t cpuid, uint32_t number, system_call_handler handler, system_call_ex_handler handlerex)
 Request deregistration of the supplied extended handler from the specified System Call number (Where Applicable).
uint32_t STDCALL get_interrupt_count (void)
 Get the number of interrupt entries for the current platform.
uint32_t STDCALL get_interrupt_start (void)
 Get the starting number of interrupt entries for the current platform.
uint32_t STDCALL get_interrupt_entry (uint32_t number, uint32_t instance, INTERRUPT_ENTRY *interrupt)
 Get the interrupt entry for the specified interrupt number and instance.
uint32_t STDCALL get_local_interrupt_count (void)
 Get the number of local interrupt entries for the current platform (Where Applicable).
uint32_t STDCALL get_local_interrupt_start (void)
 Get the starting number of local interrupt entries for the current platform (Where Applicable).
uint32_t STDCALL get_local_interrupt_entry (uint32_t cpuid, uint32_t number, uint32_t instance, INTERRUPT_ENTRY *interrupt)
 Get the local interrupt entry for the specified interrupt number (Where Applicable).
uint32_t STDCALL get_software_interrupt_count (void)
 Get the number of software interrupt entries for the current platform (Where Applicable).
uint32_t STDCALL get_software_interrupt_start (void)
 Get the starting number of software interrupt entries for the current platform (Where Applicable).
uint32_t STDCALL get_software_interrupt_entry (uint32_t cpuid, uint32_t number, uint32_t instance, INTERRUPT_ENTRY *interrupt)
 Get the software interrupt entry for the specified interrupt number and instance (Where Applicable).
uint32_t STDCALL get_system_call_count (void)
 Get the number of system call entries for the current platform (Where Applicable).
SYSTEM_CALL_ENTRY STDCALL get_system_call_entry (uint32_t number)
 Get the system call entry for the specified system call number (Where Applicable).
uint32_t STDCALL system_restart (uint32_t delay)
 Restart the system.
uint32_t STDCALL system_shutdown (uint32_t delay)
 Shutdown the system.
uint32_t STDCALL system_register_shutdown (shutdown_cb callback, void *parameter, uint32_t timeout)
 Register a procedure to be called during system shutdown or restart.
uint32_t STDCALL system_deregister_shutdown (shutdown_cb callback, void *parameter)
 Deregister a procedure from being called during system shutdown or restart.
int64_t STDCALL system_get_uptime (void)
 Get the current system up time in 100 nanosecond ticks since 1 January 1601.
uint32_t STDCALL system_get_command_line (char *commandline, uint32_t len)
 Get the current command line.
void *STDCALL system_get_environment (void)
 Get the current environment.
uint32_t STDCALL system_date_to_string (double_t date, char *value, uint32_t len)
 Return the supplied date value as a string in the system defined format.
uint32_t STDCALL system_time_to_string (double_t time, char *value, uint32_t len)
 Return the supplied time value as a string in the system defined format.
uint32_t STDCALL system_date_time_to_string (double_t datetime, char *value, uint32_t len)
 Return the supplied date and time value as a string in the system defined format.
uint32_t STDCALL system_interval_to_string (double_t interval, char *value, uint32_t len)
 Return the supplied time interval as a string in the system defined format.
uint32_t STDCALL cpu_get_arch (void)
 Get the CPU architecture for this board.
uint32_t STDCALL cpu_get_type (void)
 Get the CPU type for this board.
uint32_t STDCALL cpu_get_boot (void)
 Get the boot CPU for this board.
uint32_t STDCALL cpu_get_mask (void)
 Get the CPU mask for this board.
uint32_t STDCALL cpu_get_count (void)
 Get the CPU count for this board.
uint32_t STDCALL cpu_get_mode (void)
 Get the current CPU mode.
uint32_t STDCALL cpu_get_state (void)
 Get the current CPU state.
uint32_t STDCALL cpu_get_group (void)
 Get the current CPU group.
uint32_t STDCALL cpu_get_current (void)
 Get the current CPU ID.
uint32_t STDCALL cpu_get_memory (size_t *address, uint64_t *length)
 Get the memory start and size available to the CPU.
double_t STDCALL cpu_get_percentage (uint32_t cpuid)
 Get the last second utilization of the specified CPU in percentage.
uint32_t STDCALL cpu_get_utilization (uint32_t cpuid)
 Get the last second utilization of the specified CPU.
uint32_t STDCALL cpu_get_model (void)
 Get the CPU model of the current CPU.
uint32_t STDCALL cpu_get_revision (void)
 Get the CPU revision of the current CPU.
uint32_t STDCALL cpu_get_description (char *description, uint32_t len)
 Get the CPU description of the current CPU.
uint32_t STDCALL fpu_get_type (void)
 Get the FPU type for this board.
uint32_t STDCALL fpu_get_state (void)
 Get the current FPU state.
uint32_t STDCALL gpu_get_type (void)
 Get the GPU type for this board.
uint32_t STDCALL gpu_get_state (void)
 Get the current GPU state.
uint32_t STDCALL gpu_get_memory (size_t *address, uint64_t *length)
 Get the memory start and size available to the GPU.
uint32_t STDCALL l1_cache_get_type (void)
 Get the L1 cache type for this board.
uint32_t STDCALL l1_data_cache_get_size (void)
 Get the L1 data cache size for this board.
uint32_t STDCALL l1_data_cache_get_line_size (void)
 Get the L1 data cache line size for this board.
uint32_t STDCALL l1_instruction_cache_get_size (void)
 Get the L1 instruction cache size for this board.
uint32_t STDCALL l1_instruction_cache_get_line_size (void)
 Get the L1 instruction cache line size for this board.
uint32_t STDCALL l2_cache_get_type (void)
 Get the L2 cache type for this board.
uint32_t STDCALL l2_cache_get_size (void)
 Get the L2 cache size for this board.
uint32_t STDCALL l2_cache_get_line_size (void)
 Get the L2 cache line size for this board.
void STDCALL version_get_info (uint32_t *major, uint32_t *minor, uint32_t *revision)
 Get the version information of the currently running system.
uint32_t STDCALL version_get_date (char *date, uint32_t len)
 Get the version release date of the currently running system.
uint32_t STDCALL version_get_name (char *name, uint32_t len)
 Get the version release name of the currently running system.
uint32_t STDCALL version_get_version (char *version, uint32_t len)
 Get the version string of the currently running system.
uint32_t STDCALL board_get_type (void)
 Get the current Board type.
uint32_t STDCALL board_get_model (void)
 Get the current Board model.
int64_t STDCALL board_get_serial (void)
 Get the current Board serial number.
uint32_t STDCALL board_get_revision (void)
 Get the current Board revision number.
uint32_t STDCALL board_get_mac_address (char *address, uint32_t len)
 Get the current Board MAC address (Where Applicable).
uint32_t STDCALL chip_get_revision (void)
 Get the current Chip revision number.
uint32_t STDCALL firmware_get_revision (void)
 Get the current board Firmware Revision.
uint32_t STDCALL firmware_get_throttled (void)
 Get the current throttling state from the firmware.
uint32_t STDCALL machine_get_type (void)
 Get the current Machine type.
size_t STDCALL memory_get_base (void)
 Get the base address of system memory.
uint64_t STDCALL memory_get_size (void)
 Get the total size of system memory.
uint32_t STDCALL memory_get_page_size (void)
 Get the page size of system memory.
uint32_t STDCALL memory_get_large_page_size (void)
 Get the large page size of system memory (Where Applicable).
uint32_t STDCALL memory_get_section_size (void)
 Get the section size of system memory (Where Applicable).
uint32_t STDCALL memory_get_large_section_size (void)
 Get the large section size of system memory (Where Applicable).
uint32_t STDCALL power_on (uint32_t powerid)
 Power On the specified device.
uint32_t STDCALL power_off (uint32_t powerid)
 Power Off the specified device.
uint32_t STDCALL power_get_wait (uint32_t powerid)
 Get the enable wait time in Microseconds of the specified device.
uint32_t STDCALL power_get_state (uint32_t powerid)
 Get the power state of the specified device.
uint32_t STDCALL power_set_state (uint32_t powerid, uint32_t state, BOOL wait)
 Set the power state of the specified device (Optionally waiting for ready).
uint32_t STDCALL clock_ticks (void)
 Get the current number of clock ticks (When this reaches CLOCK_TICKS_PER_SECOND then ClockSeconds is incremented and this is reset to zero).
uint32_t STDCALL clock_seconds (void)
 Get the number of clock seconds since the system was started (This forms the system clock).
int64_t STDCALL clock_milliseconds (void)
 Get the number of clock milliseconds since the system was started.
int64_t STDCALL clock_microseconds (void)
 Get the number of clock microseconds since the system was started.
int64_t STDCALL clock_nanoseconds (void)
 Get the number of clock nanoseconds since the system was started.
int64_t STDCALL clock_get_base (void)
 Get the current clock base in 100 nanosecond ticks since 1 January 1601.
int64_t STDCALL clock_get_time (void)
 Get the current system time in 100 nanosecond ticks since 1 January 1601.
int64_t STDCALL clock_set_time (int64_t time, BOOL rtc)
 Set the current system time in 100 nanosecond ticks since 1 January 1601.
uint32_t STDCALL clock_get_count (void)
 Gets the current system clock count (32 least significant bits of total).
int64_t STDCALL clock_get_total (void)
 Gets the total system clock count.
uint32_t STDCALL clock_update_offset (void)
 Update the system time offset between UTC and Local.
uint32_t STDCALL clock_calculate_offset (double_t datetime, int32_t *offset, BOOL *daylight)
 Calculate the system time offset between UTC and Local at the given date and time.
uint32_t STDCALL clock_get_rate (uint32_t clockid)
 Get the clock rate in Hz of the specified Clock.
uint32_t STDCALL clock_set_rate (uint32_t clockid, uint32_t rate, BOOL turbo)
 Set the clock rate in Hz of the specified Clock.
uint32_t STDCALL clock_get_state (uint32_t clockid)
 Get the state of the specified Clock.
uint32_t STDCALL clock_set_state (uint32_t clockid, uint32_t state)
 Set the state of the specified Clock.
uint32_t STDCALL clock_get_min_rate (uint32_t clockid)
 Get the minimum clock rate in Hz of the specified Clock.
uint32_t STDCALL clock_get_max_rate (uint32_t clockid)
 Get the maximum clock rate in Hz of the specified Clock.
uint32_t STDCALL clock_get_measured_rate (uint32_t clockid)
 Get the measured or actual clock rate in Hz of the specified Clock.
uint32_t STDCALL turbo_get_state (uint32_t turboid)
 Get the Turbo state (0 equals Off / 1 equals On) of the specified device.
uint32_t STDCALL turbo_set_state (uint32_t turboid, uint32_t state)
 Set the Turbo state (0 equals Off / 1 equals On) of the specified device.
uint32_t STDCALL voltage_get_value (uint32_t voltageid)
 Get the current voltage level of the specified device.
uint32_t STDCALL voltage_set_value (uint32_t voltageid, uint32_t value)
 Set the current voltage level of the specified device.
uint32_t STDCALL voltage_get_min_value (uint32_t voltageid)
 Get the minimum voltage level of the specified device.
uint32_t STDCALL voltage_get_max_value (uint32_t voltageid)
 Get the maximum voltage level of the specified device.
uint32_t STDCALL temperature_get_current (uint32_t temperatureid)
 Get the current temperature in thousandths of a degree C of the specified device.
uint32_t STDCALL temperature_get_maximum (uint32_t temperatureid)
 Get the maximum temperature in thousandths of a degree C of the specified device.
HANDLE STDCALL gpu_memory_allocate (uint32_t length, uint32_t alignment, uint32_t flags)
 Allocate memory from the GPU.
uint32_t STDCALL gpu_memory_release (HANDLE handle)
 Release memory allocated from the GPU.
uint32_t STDCALL gpu_memory_lock (HANDLE handle)
 Lock memory allocated from the GPU and return an address.
uint32_t STDCALL gpu_memory_unlock (HANDLE handle)
 Unlock memory allocated from the GPU.
uint32_t STDCALL gpu_execute_code (void *address, uint32_t r0, uint32_t r1, uint32_t r2, uint32_t r3, uint32_t r4, uint32_t r5)
 Execute a block of code on the GPU.
HANDLE STDCALL dispmanx_handle_get (HANDLE resource)
 Convert a Dispmanx Resource handle to a Memory handle (Which can be passed to Lock/Unlock above).
uint32_t STDCALL edid_block_get (uint32_t block, void *buffer, uint32_t length)
 Get an EDID block from HDMI.
BOOL STDCALL framebuffer_available (void)
 Check if a framebuffer device is currently available.
uint32_t STDCALL framebuffer_allocate (uint32_t alignment, uint32_t *address, uint32_t *length)
 Allocate a new Framebuffer.
uint32_t STDCALL framebuffer_release (void)
 Release the current Framebuffer.
uint32_t STDCALL framebuffer_set_state (uint32_t state)
 Set the current Framebuffer (Display) state (0 for Off / 1 for On).
uint32_t STDCALL framebuffer_get_dimensions (uint32_t *width, uint32_t *height, uint32_t *top, uint32_t *bottom, uint32_t *left, uint32_t *right)
 Get the default Dimensions of the Framebuffer (Physical Width, Height and Overscan Top, Bottom, Left, Right in Pixels).
uint32_t STDCALL framebuffer_get_physical (uint32_t *width, uint32_t *height)
 Get the Physical Framebuffer Width and Height in Pixels.
uint32_t STDCALL framebuffer_set_physical (uint32_t *width, uint32_t *height)
 Set the Physical Framebuffer Width and Height in Pixels.
uint32_t STDCALL framebuffer_test_physical (uint32_t *width, uint32_t *height)
 Test the Physical Framebuffer Width and Height in Pixels.
uint32_t STDCALL framebuffer_get_virtual (uint32_t *width, uint32_t *height)
 Get the Virtual Framebuffer Width and Height in Pixels.
uint32_t STDCALL framebuffer_set_virtual (uint32_t *width, uint32_t *height)
 Set the Virtual Framebuffer Width and Height in Pixels.
uint32_t STDCALL framebuffer_test_virtual (uint32_t *width, uint32_t *height)
 Test the Virtual Framebuffer Width and Height in Pixels.
uint32_t STDCALL framebuffer_get_depth (uint32_t *depth)
 Get the Framebuffer Depth in Bits per Pixel.
uint32_t STDCALL framebuffer_set_depth (uint32_t *depth)
 Set the Framebuffer Depth in Bits per Pixel.
uint32_t STDCALL framebuffer_test_depth (uint32_t *depth)
 Test the Framebuffer Depth in Bits per Pixel.
uint32_t STDCALL framebuffer_get_pixel_order (uint32_t *order)
 Get the Framebuffer Pixel Order (0 = BGR / 1 = RGB).
uint32_t STDCALL framebuffer_set_pixel_order (uint32_t *order)
 Set the Framebuffer Pixel Order (0 = BGR / 1 = RGB).
uint32_t STDCALL framebuffer_test_pixel_order (uint32_t *order)
 Test the Framebuffer Pixel Order (0 = BGR / 1 = RGB).
uint32_t STDCALL framebuffer_get_alpha_mode (uint32_t *mode)
 Get the Framebuffer Alpha Mode.
uint32_t STDCALL framebuffer_set_alpha_mode (uint32_t *mode)
 Set the Framebuffer Alpha Mode.
uint32_t STDCALL framebuffer_test_alpha_mode (uint32_t *mode)
 Test the Framebuffer Alpha Mode.
uint32_t STDCALL framebuffer_get_pitch (void)
 Get the Framebuffer Pitch in Bytes per Line.
uint32_t STDCALL framebuffer_get_offset (uint32_t *x, uint32_t *y)
 Get the Framebuffer Virtual Offset in Pixels.
uint32_t STDCALL framebuffer_set_offset (uint32_t *x, uint32_t *y)
 Set the Framebuffer Virtual Offset in Pixels.
uint32_t STDCALL framebuffer_test_offset (uint32_t *x, uint32_t *y)
 Test the Framebuffer Virtual Offset in Pixels.
uint32_t STDCALL framebuffer_get_overscan (uint32_t *top, uint32_t *bottom, uint32_t *left, uint32_t *right)
 Get the Framebuffer Top, Bottom, Left and Right Overscan in Pixels.
uint32_t STDCALL framebuffer_set_overscan (uint32_t *top, uint32_t *bottom, uint32_t *left, uint32_t *right)
 Set the Framebuffer Top, Bottom, Left and Right Overscan in Pixels.
uint32_t STDCALL framebuffer_test_overscan (uint32_t *top, uint32_t *bottom, uint32_t *left, uint32_t *right)
 Test the Framebuffer Top, Bottom, Left and Right Overscan in Pixels.
uint32_t STDCALL framebuffer_get_palette (void *buffer, uint32_t length)
 Get the Framebuffer Palette in RGBA values.
uint32_t STDCALL framebuffer_set_palette (uint32_t start, uint32_t count, void *buffer, uint32_t length)
 Set the Framebuffer Palette in RGBA values.
uint32_t STDCALL framebuffer_test_palette (uint32_t start, uint32_t count, void *buffer, uint32_t length)
 Test the Framebuffer Palette in RGBA values.
uint32_t STDCALL framebuffer_get_layer (int32_t *layer)
 Get the Framebuffer Layer.
uint32_t STDCALL framebuffer_set_layer (int32_t *layer)
 Set the Framebuffer Layer.
uint32_t STDCALL framebuffer_test_layer (int32_t *layer)
 Test the Framebuffer Layer.
uint32_t STDCALL framebuffer_test_vsync (void)
 Test the Framebuffer Vertical Sync (Where Applicable).
uint32_t STDCALL framebuffer_set_vsync (void)
 Set (Wait For) the Framebuffer Vertical Sync (Where Applicable).
uint32_t STDCALL framebuffer_set_backlight (uint32_t brightness)
 Set the Framebuffer Backlight brightness (Where Applicable).
uint32_t STDCALL framebuffer_get_num_displays (uint32_t *numdisplays)
 Get the number of framebuffer displays (Where Applicable).
uint32_t STDCALL framebuffer_get_display_id (uint32_t displaynum)
 Get the display id for the specified display number (Where Applicable).
uint32_t STDCALL framebuffer_set_display_num (uint32_t displaynum)
 Set the current framebuffer display number (Where Applicable).
uint32_t STDCALL framebuffer_get_display_settings (uint32_t displaynum, DISPLAY_SETTINGS *displaysettings)
 Get the display settings for the specified display number (Where Applicable).
uint32_t STDCALL framebuffer_display_id_to_name (uint32_t displayid, char *name, uint32_t len)
 Get the name for the specified display id (Where Applicable).
uint32_t STDCALL touch_get_buffer (size_t *address)
 Get the Touchscreen memory buffer (Where Applicable).
uint32_t STDCALL touch_set_buffer (size_t address)
 Set the Touchscreen memory buffer (Where Applicable).
uint32_t STDCALL cursor_set_default (void)
 Set the default Cursor Info (Where Applicable).
uint32_t STDCALL cursor_set_info (uint32_t width, uint32_t height, uint32_t hotspotx, uint32_t hotspoty, void *pixels, uint32_t length)
 Set the Cursor Info (Width and Height, Hotspot and Pixel image).
uint32_t STDCALL cursor_set_state (BOOL enabled, uint32_t x, uint32_t y, BOOL relative)
 Set the Cursor State (Enabled, X and Y).
BOOL STDCALL dma_available (void)
 Check if DMA is currently available.
uint32_t STDCALL dma_transfer (DMA_DATA *data, uint32_t direction, uint32_t peripheral)
 Perform a DMA transfer using the list of DMA data blocks provided.
uint32_t STDCALL dma_fill_memory (void *dest, uint32_t size, uint8_t value)
 Fill memory at the destination address using DMA.
uint32_t STDCALL dma_copy_memory (void *source, void *dest, uint32_t size)
 Copy memory from the source to the destination address using DMA.
uint32_t STDCALL dma_read_peripheral (void *address, void *dest, uint32_t size, uint32_t peripheral)
 Read from a peripheral address to the destination address using DMA.
uint32_t STDCALL dma_write_peripheral (void *source, void *address, uint32_t size, uint32_t peripheral)
 Write to a peripheral address from the source address using DMA.
void *STDCALL dma_allocate_buffer (uint32_t size)
 Allocate a buffer compatible with DMA memory reads or writes.
void *STDCALL dma_allocate_buffer_ex (uint32_t *size)
 Allocate a buffer compatible with DMA memory reads or writes.
uint32_t STDCALL dma_release_buffer (void *buffer)
 Release a buffer allocated with DMAAllocateBuffer.
uint32_t STDCALL dma_get_channels (void)
 Get the currently enabled DMA channel bitmap (If supported).
HANDLE STDCALL handle_create (HANDLE data, uint32_t _type)
 Create and Open a new unnamed handle of the supplied type.
HANDLE_ENTRY *STDCALL handle_create_ex (const char *name, uint32_t flags, HANDLE data, uint32_t _type)
 Create and Open a new named or unnamed handle of the supplied type.
uint32_t STDCALL handle_destroy (HANDLE handle)
 Close and Destroy a named or unnamed handle.
HANDLE_ENTRY *STDCALL handle_get (HANDLE handle)
 Get the handle entry for the supplied handle.
HANDLE_ENTRY *STDCALL handle_find (const char *name)
 Find an existing named handle of the supplied type.
uint32_t STDCALL handle_enumerate (handle_enumerate_cb callback, void *data)
 Enumerate all handles in the handle table.
HANDLE STDCALL handle_open (const char *name)
 Open an existing named handle.
uint32_t STDCALL handle_close (HANDLE handle)
 Close a named or unnamed handle.
HANDLE STDCALL handle_duplicate (HANDLE handle)
 Duplicate an existing named or unnamed handle.
BOOL STDCALL gpio_available (void)
 Check if a GPIO device is available.
uint32_t STDCALL gpio_read (uint32_t reg)
 Perform a direct read from a GPIO register.
void STDCALL gpio_write (uint32_t reg, uint32_t value)
 Perform a direct write to a GPIO register.
uint32_t STDCALL gpio_input_get (uint32_t pin)
 Get the current state of a GPIO input pin.
uint32_t STDCALL gpio_input_wait (uint32_t pin, uint32_t trigger, uint32_t timeout)
 Wait for the state of a GPIO input pin to change.
uint32_t STDCALL gpio_input_event (uint32_t pin, uint32_t trigger, uint32_t timeout, gpio_event_cb callback, void *data)
 Schedule a function to be called when the state of a GPIO input pin changes.
uint32_t STDCALL gpio_output_set (uint32_t pin, uint32_t level)
 Set the state of a GPIO output pin.
uint32_t STDCALL gpio_level_get (uint32_t pin)
 Get the current level (state) of a GPIO pin.
uint32_t STDCALL gpio_level_set (uint32_t pin, uint32_t level)
 Set the level (state) of a GPIO pin.
uint32_t STDCALL gpio_pull_get (uint32_t pin)
 Get the current pull state of a GPIO pin.
uint32_t STDCALL gpio_pull_select (uint32_t pin, uint32_t mode)
 Change the pull state of a GPIO pin.
uint32_t STDCALL gpio_function_get (uint32_t pin)
 Get the current function of a GPIO pin.
uint32_t STDCALL gpio_function_select (uint32_t pin, uint32_t mode)
 Change the function of a GPIO pin.
uint32_t STDCALL virtual_gpio_input_get (uint32_t pin)
 Get the current state of a virtual GPIO input pin.
uint32_t STDCALL virtual_gpio_output_set (uint32_t pin, uint32_t level)
 Set the state of a virtual GPIO output pin.
uint32_t STDCALL virtual_gpio_level_get (uint32_t pin)
 Get the current level (state) of a virtual GPIO pin.
uint32_t STDCALL virtual_gpio_level_set (uint32_t pin, uint32_t level)
 Set the level (state) of a virtual GPIO pin.
uint32_t STDCALL virtual_gpio_function_get (uint32_t pin)
 Get the current function of a virtual GPIO pin.
uint32_t STDCALL virtual_gpio_function_select (uint32_t pin, uint32_t mode)
 Change the function of a virtual GPIO pin.
BOOL STDCALL spi_available (void)
 Check if an SPI device is available.
uint32_t STDCALL spi_start (uint32_t mode, uint32_t clockrate, uint32_t clockphase, uint32_t clockpolarity)
 Start the default SPI device ready for writing and reading.
uint32_t STDCALL spi_stop (void)
 Stop the default SPI device and terminate writing and reading.
uint32_t STDCALL spi_read (uint16_t chipselect, void *dest, uint32_t size, uint32_t *count)
 Read data from the default SPI device Because SPI writes and then reads for each byte, dummy data will be written for each byte to be read.
uint32_t STDCALL spi_write (uint16_t chipselect, void *source, uint32_t size, uint32_t *count)
 Write data to the default SPI device Because SPI writes and then reads for each byte, received data will be discarded for each byte written.
uint32_t STDCALL spi_write_read (uint16_t chipselect, void *source, void *dest, uint32_t size, uint32_t *count)
 Write data to and Read data from the default SPI device in one operation Because SPI writes and then reads for each byte, both the source and dest buffers must be the same size.
uint32_t STDCALL spi_get_mode (void)
 Get the device mode of the default SPI device.
uint32_t STDCALL spi_set_mode (uint32_t mode)
 Set the device mode for the default SPI device.
uint32_t STDCALL spi_get_clock_rate (uint16_t chipselect)
 Get the clock rate of the default SPI device.
uint32_t STDCALL spi_set_clock_rate (uint16_t chipselect, uint32_t clockrate)
 Set the clock rate for the default SPI device.
uint32_t STDCALL spi_get_clock_phase (void)
 Get the clock phase of the default SPI device.
uint32_t STDCALL spi_set_clock_phase (uint32_t clockphase)
 Set the clock phase for the default SPI device.
uint32_t STDCALL spi_get_clock_polarity (void)
 Get the clock polarity of the default SPI device.
uint32_t STDCALL spi_set_clock_polarity (uint32_t clockpolarity)
 Set the clock polarity for the default SPI device.
uint32_t STDCALL spi_get_select_polarity (uint16_t chipselect)
 Get the chip select polarity of the default SPI device.
uint32_t STDCALL spi_set_select_polarity (uint16_t chipselect, uint32_t selectpolarity)
 Set the chip select polarity for the default SPI device.
uint32_t STDCALL spi_get_description (uint32_t id, char *description, uint32_t len)
 Return the device description of an SPI device.
BOOL STDCALL i2c_available (void)
 Check if an I2C device is available.
uint32_t STDCALL i2c_start (uint32_t rate)
 Start the default I2C device ready for reading and writing.
uint32_t STDCALL i2c_stop (void)
 Stop the default I2C device and terminate reading and writing.
uint32_t STDCALL i2c_read (uint16_t address, void *buffer, uint32_t size, uint32_t *count)
 Read data from the default I2C device.
uint32_t STDCALL i2c_write (uint16_t address, void *buffer, uint32_t size, uint32_t *count)
 Write data to the default I2C device.
uint32_t STDCALL i2c_write_read (uint16_t address, void *initial, uint32_t len, void *data, uint32_t size, uint32_t *count)
 Write data to and Read data from the default I2C device in one operation Useful for devices that require a register address specified before a read (eg EEPROM devices).
uint32_t STDCALL i2c_write_write (uint16_t address, void *initial, uint32_t len, void *data, uint32_t size, uint32_t *count)
 Write 2 data blocks to the default I2C device in one operation Useful for devices that require a register address specified before a write (eg EEPROM devices).
uint32_t STDCALL i2c_get_rate (void)
 Get the clock rate of the default I2C device.
uint32_t STDCALL i2c_set_rate (uint32_t rate)
 Set the clock rate for the default I2C device.
uint16_t STDCALL i2c_get_address (void)
 Get the slave address for the default I2C device.
uint32_t STDCALL i2c_set_address (uint16_t address)
 Set the slave address for the default I2C device.
uint32_t STDCALL i2c_get_description (uint32_t id, char *description, uint32_t len)
 Get the device description of an I2C device.
uint32_t STDCALL i2c_slave_get_description (uint32_t id, char *description, uint32_t len)
 Get the device description of an I2C slave device.
BOOL STDCALL pwm_available (void)
 Check if a PWM device is available.
uint32_t STDCALL pwm_start (void)
 Start the default PWM device.
uint32_t STDCALL pwm_stop (void)
 Stop the default PWM device.
uint32_t STDCALL pwm_write (uint32_t value)
 Write a value to the default PWM device.
uint32_t STDCALL pwm_set_mode (uint32_t mode)
 Set the mode for the default PWM device.
uint32_t STDCALL pwm_set_range (uint32_t range)
 Set the range for the default PWM device.
uint32_t STDCALL pwm_set_frequency (uint32_t frequency)
 Set the clock frequency for the default PWM device.
uint32_t STDCALL pwm_configure (uint32_t dutyns, uint32_t periodns)
 Set the configuration of the default PWM device.
uint32_t STDCALL pwm_get_description (uint32_t id, uint32_t channel, char *description, uint32_t len)
 Get the device description of an PWM device.
BOOL STDCALL rtc_available (void)
 Check if a Real Time Clock (RTC) device is available.
int64_t STDCALL rtc_get_time (void)
 Get the current time from a Real Time Clock device Returned time is 100 nanosecond ticks since 1 January 1601 The same format as the ClockGetTime function.
int64_t STDCALL rtc_set_time (int64_t time)
 Set the current time for a Real Time Clock device.
uint32_t STDCALL uart_get_description (uint32_t id, char *description, uint32_t len)
 Get the device description of a UART device.
BOOL STDCALL serial_available (void)
 Check if a Serial device is available.
uint32_t STDCALL serial_open (uint32_t baudrate, uint32_t databits, uint32_t stopbits, uint32_t parity, uint32_t flowcontrol, uint32_t receivedepth, uint32_t transmitdepth)
 Open the default Serial device ready for sending and receiving.
uint32_t STDCALL serial_close (void)
 Close the default Serial device and terminate sending and receiving.
uint32_t STDCALL serial_read (void *buffer, uint32_t size, uint32_t *count)
 Read data from the default Serial device.
uint32_t STDCALL serial_write (void *buffer, uint32_t size, uint32_t *count)
 Write data to the default Serial device.
int STDCALL serial_printf (const char *format,...) _ATTRIBUTE((__format__(__printf__
 Print formatted text to the default Serial device.
int STDCALL size_t STDCALL peripheral_get_base (void)
 Get the base address of the peripherals.
uint32_t STDCALL peripheral_get_size (void)
 Get the total size of the peripherals.
uint32_t STDCALL peripheral_read (uint32_t base, uint32_t reg)
 Read from a Peripheral register.
void STDCALL peripheral_write (uint32_t base, uint32_t reg, uint32_t value)
 Write to a Peripheral register.
size_t STDCALL local_peripheral_get_base (void)
 Get the base address of the local peripherals (Peripherals local to each CPU).
uint32_t STDCALL local_peripheral_get_size (void)
 Get the total size of the local peripherals (Peripherals local to each CPU).
size_t STDCALL get_sp (void)
 Get the current stack pointer (SP).
size_t STDCALL get_pc (void)
 Get the current program counter (PC).
BOOL STDCALL get_irq (void)
 Get Interrupts (IRQ) state.
void STDCALL enable_irq (void)
 Enable Interrupts (IRQ) unconditionally.
void STDCALL disable_irq (void)
 Disable Interrupts (IRQ) unconditionally.
IRQ_MASK STDCALL save_irq (void)
 Disable Interrupts (IRQ) and return the previous state.
IRQ_MASK STDCALL restore_irq (IRQ_MASK irqmask)
 Restore Interrupts (IRQ) to a previous state.
BOOL STDCALL get_fiq (void)
 Get Fast Interrupts (FIQ) state.
void STDCALL enable_fiq (void)
 Enable Fast Interrupts (FIQ) unconditionally.
void STDCALL disable_fiq (void)
 Disable Fast Interrupts (FIQ) unconditionally.
FIQ_MASK STDCALL save_fiq (void)
 Disable Fast Interrupts (FIQ) and return the previous state.
FIQ_MASK STDCALL restore_fiq (FIQ_MASK fiqmask)
 Restore Fast Interrupts (FIQ) to a previous state.
void STDCALL enable_irq_fiq (void)
 Enable Interrupts and Fast Interrupts (IRQ/FIQ) unconditionally.
void STDCALL disable_irq_fiq (void)
 Disable Interrupts and Fast Interrupts (IRQ/FIQ) unconditionally.
IRQ_FIQ_MASK STDCALL save_irq_fiq (void)
 Disable Interrupts and Fast Interrupts (IRQ/FIQ) and return the previous state.
IRQ_FIQ_MASK STDCALL restore_irq_fiq (IRQ_FIQ_MASK irqfiqmask)
 Restore Interrupts and Fast Interrupts (IRQ/FIQ) to a previous state.
BOOL STDCALL get_abort (void)
 Get Abort state.
void STDCALL enable_abort (void)
 Enable Abort unconditionally.
void STDCALL disable_abort (void)
 Disable Abort unconditionally.
ABORT_MASK STDCALL save_abort (void)
 Disable Abort and return the previous state.
ABORT_MASK STDCALL restore_abort (ABORT_MASK abortmask)
 Restore Abort to a previous state.
void STDCALL halt_cpu (void)
 Halt the current processor.
void STDCALL pause_cpu (void)
 Pause the current processor and wait for an Event or Interrupt (Where Applicable).
uint32_t STDCALL halt_thread (uint32_t exitcode)
 Halt the current thread.
void STDCALL send_event (void)
 Send a signal that an Event has occurred (Where Applicable).
void STDCALL wait_for_event (void)
 Wait for an Event to occur (Where Applicable).
void STDCALL wait_for_interrupt (void)
 Wait for an Interrupt to occur (Where Applicable).
void STDCALL read_memory_barrier (void)
 Perform a Read Memory Barrier operation (Where Applicable).
void STDCALL write_memory_barrier (void)
 Perform a Write Memory Barrier operation (Where Applicable).
void STDCALL data_memory_barrier (void)
 Perform a Data Memory Barrier operation (Where Applicable).
void STDCALL data_synchronization_barrier (void)
 Perform a Data Synchronization Barrier operation (Where Applicable).
void STDCALL instruction_memory_barrier (void)
 Perform an Instruction Memory Barrier operation (Where Applicable).
void STDCALL invalidate_tlb (void)
 Perform an Invalidate Entire TLB operation (Where Applicable).
void STDCALL invalidate_data_tlb (void)
 Perform an Invalidate Data TLB operation (Where Applicable).
void STDCALL invalidate_instruction_tlb (void)
 Perform an Invalidate Instruction TLB operation (Where Applicable).
void STDCALL invalidate_cache (void)
 Perform an Invalidate Entire Cache operation (Where Applicable).
void STDCALL clean_data_cache (void)
 Perform a Clean Data Cache operation (Where Applicable).
void STDCALL invalidate_data_cache (void)
 Perform an Invalidate Data Cache operation (Where Applicable).
void STDCALL clean_and_invalidate_data_cache (void)
 Perform a Clean and Invalidate Data Cache operation (Where Applicable).
void STDCALL invalidate_instruction_cache (void)
 Perform an Invalidate Instruction Cache operation (Where Applicable).
void STDCALL clean_data_cache_range (size_t address, uint32_t size)
 Perform a Clean Data Cache Range operation (Where Applicable).
void STDCALL invalidate_data_cache_range (size_t address, uint32_t size)
 Perform an Invalidate Data Cache Range operation (Where Applicable).
void STDCALL clean_and_invalidate_data_cache_range (size_t address, uint32_t size)
 Perform a Clean and Invalidate Data Cache Range operation (Where Applicable).
void STDCALL invalidate_instruction_cache_range (size_t address, uint32_t size)
 Perform an Invalidate Instruction Cache Range operation (Where Applicable).
void STDCALL flush_prefetch_buffer (void)
 Perform a Flush Prefetch Buffer operation (Where Applicable).
void STDCALL flush_branch_target_cache (void)
 Perform a Flush Entire Branch Target Cache operation (Where Applicable).
void STDCALL context_switch (void *oldstack, void *newstack, THREAD_HANDLE newthread)
 Perform a Context Switch from one thread to another.
void STDCALL context_switch_irq (void *oldstack, void *newstack, THREAD_HANDLE newthread)
 Perform a Context Switch from one thread to another from an IRQ handler.
void STDCALL context_switch_fiq (void *oldstack, void *newstack, THREAD_HANDLE newthread)
 Perform a Context Switch from one thread to another from an FIQ handler.
void STDCALL context_switch_swi (void *oldstack, void *newstack, THREAD_HANDLE newthread)
 Perform a Context Switch from one thread to another from a software interrupt handler.
int32_t STDCALL interlocked_or (int32_t *target, int32_t value)
 Perform an atomic OR operation.
int32_t STDCALL interlocked_xor (int32_t *target, int32_t value)
 Perform an atomic XOR operation.
int32_t STDCALL interlocked_and (int32_t *target, int32_t value)
 Perform an atomic AND operation.
int32_t STDCALL interlocked_decrement (int32_t *target)
 Perform an atomic decrement operation.
int32_t STDCALL interlocked_increment (int32_t *target)
 Perform an atomic increment operation.
int32_t STDCALL interlocked_exchange (int32_t *target, int32_t source)
 Perform an atomic exchange operation.
int32_t STDCALL interlocked_add_exchange (int32_t *target, int32_t source)
 Perform an atomic add and exchange operation.
int32_t STDCALL interlocked_compare_exchange (int32_t *target, int32_t source, int32_t compare)
 Perform an atomic compare and exchange operation.
uint32_t STDCALL page_table_get_levels (void)
 Get the number of page table levels for the current platform.
size_t STDCALL page_directory_get_base (void)
 Get the base address of the first level page directory (Where applicable).
uint32_t STDCALL page_directory_get_size (void)
 Get the size of the first level page directory (Where applicable).
size_t STDCALL page_table_get_base (void)
 Get the base address of the first or second level page table.
uint32_t STDCALL page_table_get_size (void)
 Get the size of the first or second level page table.
void STDCALL page_table_get_entry (size_t address, PAGE_TABLE_ENTRY *entry)
 Get the Page Table entry that corresponds to the supplied virtual address.
uint32_t STDCALL page_table_set_entry (PAGE_TABLE_ENTRY *entry)
 Set the Page Table entry that corresponds to the supplied virtual address.
uint32_t STDCALL page_table_get_page_size (size_t address)
 Get the Size from the Page Table page that corresponds to the supplied virtual address.
uint32_t STDCALL page_table_get_page_flags (size_t address)
 Get the Flags from the Page Table page that corresponds to the supplied virtual address.
size_t STDCALL page_table_get_page_physical (size_t address)
 Get the Physical Address from the Page Table page that corresponds to the supplied virtual address.
size_t STDCALL page_tables_get_address (void)
 Get the address of the second or third level page tables.
uint32_t STDCALL page_tables_get_length (void)
 Get the size of the second or third level page tables.
uint32_t STDCALL page_tables_get_count (void)
 Get the number of second or third level page tables.
uint32_t STDCALL page_tables_get_shift (void)
 Get the multiplier to convert count to actual size of the second or third level page tables.
size_t STDCALL page_tables_get_next (void)
 Get the address of the next available second or third level page table.
uint32_t STDCALL page_tables_get_used (void)
 Get the number of used second or third level page tables.
uint32_t STDCALL page_tables_get_free (void)
 Get the number of available second or third level page tables.
size_t STDCALL vector_table_get_base (void)
 Get the base address of the interrupt vector table.
uint32_t STDCALL vector_table_get_size (void)
 Get the size in bytes of the interrupt vector table.
uint32_t STDCALL vector_table_get_count (void)
 Get the number of entries in the interrupt vector table.
size_t STDCALL vector_table_get_entry (uint32_t number)
 Get the interrupt vector table entry that corresponds to the supplied number.
uint32_t STDCALL vector_table_set_entry (uint32_t number, size_t address)
 Set the interrupt vector table entry that corresponds to the supplied number.
BOOL STDCALL console_get_key (char *ch, void *userdata)
BOOL STDCALL console_peek_key (char *ch, void *userdata)
BOOL STDCALL console_write_char (char ch, void *userdata)
BOOL STDCALL console_read_char (char *ch, void *userdata)
BOOL STDCALL console_read_wide_char (WCHAR *ch, void *userdata)
BOOL STDCALL console_hide_mouse (void *userdata)
BOOL STDCALL console_show_mouse (uint32_t x, uint32_t y, void *userdata)
BOOL STDCALL console_read_mouse (uint32_t *x, uint32_t *y, uint32_t *buttons, void *userdata)
WCHAR STDCALL code_page_to_wide_char (char ch)
char STDCALL wide_char_to_code_page (WCHAR ch)
uint32_t STDCALL host_get_name (char *name, uint32_t len)
BOOL STDCALL host_set_name (const char *name)
uint32_t STDCALL host_get_domain (char *domain, uint32_t len)
BOOL STDCALL host_set_domain (const char *domain)
HANDLE STDCALL module_load (const char *name)
HANDLE STDCALL module_load_ex (const char *name, uint32_t flags)
BOOL STDCALL module_unload (HANDLE handle)
uint32_t STDCALL module_get_name (HANDLE handle, char *name, uint32_t len)
HANDLE STDCALL module_get_handle (char *name)
BOOL STDCALL symbol_add (HANDLE handle, const char *name, size_t address)
BOOL STDCALL symbol_remove (HANDLE handle, const char *name)
size_t STDCALL symbol_get_address (HANDLE handle, const char *name)
void STDCALL logging_output (const char *text)
void STDCALL logging_output_ex (uint32_t facility, uint32_t severity, const char *tag, const char *content)
int STDCALL logging_outputf (const char *format,...) _ATTRIBUTE((__format__(__printf__
 Output formatted text to the default logging.
int STDCALL uint32_t STDCALL environment_get (const char *name, char *value, uint32_t len)
 Locate an environment variable and return the current value.
uint32_t STDCALL environment_set (const char *name, const char *value)
 Add an environment variable or update an existing variable.
uint32_t STDCALL environment_count (BOOL reset)
 Get the current number of environment variables.
uint32_t STDCALL environment_index (const char *name)
 Locate an environment variable and return the index.
uint32_t STDCALL environment_string (uint32_t index, char *string, uint32_t len)
 Get an environment variable by index.
int setenv (const char *name, const char *value, int overwrite)
int unsetenv (const char *name)
uint32_t STDCALL first_bit_set (uint32_t value)
 Find the first set bit in a nonzero 32 bit value.
uint32_t STDCALL last_bit_set (uint32_t value)
 Find the last set bit in a nonzero 32 bit value.
uint32_t STDCALL count_leading_zeros (uint32_t value)
 Count the number of leading 0 bits in a nonzero 32 bit value.
uint32_t STDCALL count_trailing_zeros (uint32_t value)
 Count the number of trailing 0 bits in a nonzero 32 bit value.
size_t STDCALL physical_to_io_address (void *address)
 Convert Physical address to an IO addresses (Where Applicable).
size_t STDCALL io_address_to_physical (void *address)
 Convert an IO address to a Physical address (Where Applicable).
size_t STDCALL physical_to_bus_address (void *address)
 Convert a Physical address to a Bus address (Where Applicable).
size_t STDCALL bus_address_to_physical (void *address)
 Convert a Bus address to a Physical address (Where Applicable).
void STDCALL nanosecond_delay (uint32_t nanoseconds)
 Non sleep wait for a number of nanoseconds.
void STDCALL microsecond_delay (uint32_t microseconds)
 Non sleep wait for a number of microseconds.
void STDCALL millisecond_delay (uint32_t milliseconds)
 Non sleep wait for a number of milliseconds.
void STDCALL nanosecond_delay_ex (uint32_t nanoseconds, BOOL wait)
 Non sleep wait for a number of nanoseconds.
void STDCALL microsecond_delay_ex (uint32_t microseconds, BOOL wait)
 Non sleep wait for a number of microseconds.
void STDCALL millisecond_delay_ex (uint32_t milliseconds, BOOL wait)
 Non sleep wait for a number of milliseconds.
uint32_t get_tick_count (void)
uint64_t get_tick_count64 (void)
int posix_memalign (void **memptr, size_t alignment, size_t size)
char * realpath (const char *__restrict path, char *__restrict resolved_path)
int getpagesize (void)
int dup3 (int oldfd, int newfd, int flags)
int getentropy (void *buffer, size_t length)
int usleep (useconds_t useconds)
int symlink (const char *path1, const char *path2)
int ftruncate (int fd, off_t length)
int truncate (const char *path, off_t length)
int fdatasync (int fd)
int sethostname (const char *name, size_t size)
int gethostname (char *name, size_t size)
void * mmap (void *addr, size_t length, int prot, int flags, int fd, off_t offset)
int munmap (void *addr, size_t length)
int settimeofday (const struct timeval *tv, const struct timezone *tz)
int sched_getcpu (void)
void msleep (unsigned int msecs)
pid_t gettid (void)
HANDLE fd_handle (int fd)

Macro Definition Documentation

◆ HANDLE_FLAG_NONE

#define HANDLE_FLAG_NONE   0x00000000

Platform specific constants Handle Flags

◆ HANDLE_FLAG_NAMED

#define HANDLE_FLAG_NAMED   0x00000001

Set if the handle has a name.

◆ HANDLE_FLAG_DUPLICATE

#define HANDLE_FLAG_DUPLICATE   0x00000002

Set if the handle can be duplicated.

◆ HANDLE_FLAG_INTERNAL

#define HANDLE_FLAG_INTERNAL   HANDLE_FLAG_NONE + 0x80000000

Note: Temporary value to avoid warning.

◆ HANDLE_SIGNATURE

#define HANDLE_SIGNATURE   0xCD15E20A

Handle constants

◆ HANDLE_TABLE_MIN

#define HANDLE_TABLE_MIN   0x100

Minimum handle number (Skip first 256).

◆ HANDLE_TABLE_MAX

#define HANDLE_TABLE_MAX   0x7FFFFFFF

Maximum handle number (Avoid MSB as THandle is a signed value).

◆ HANDLE_TABLE_MASK

#define HANDLE_TABLE_MASK   0x7FF

2048 buckets for handle lookups

◆ HANDLE_NAME_LENGTH

#define HANDLE_NAME_LENGTH   256

Maximum length of handle name.

◆ DMA_DATA_FLAG_NONE

#define DMA_DATA_FLAG_NONE   0x00000000

DMA Data Flags

◆ DMA_DATA_FLAG_STRIDE

#define DMA_DATA_FLAG_STRIDE   0x00000001

Transfer from the source to the destination using 2D stride (If supported).

◆ DMA_DATA_FLAG_SOURCE_NOINCREMENT

#define DMA_DATA_FLAG_SOURCE_NOINCREMENT   0x00000002

Don't increment the source address during the DMA request (If supported).

◆ DMA_DATA_FLAG_DEST_NOINCREMENT

#define DMA_DATA_FLAG_DEST_NOINCREMENT   0x00000004

Don't increment the dest address during the DMA request (If supported).

◆ DMA_DATA_FLAG_SOURCE_DREQ

#define DMA_DATA_FLAG_SOURCE_DREQ   0x00000008

Use DREQ gating on the source address during the DMA request (If supported).

◆ DMA_DATA_FLAG_DEST_DREQ

#define DMA_DATA_FLAG_DEST_DREQ   0x00000010

Use DREQ gating on the dest address during the DMA request (If supported).

◆ DMA_DATA_FLAG_SOURCE_WIDE

#define DMA_DATA_FLAG_SOURCE_WIDE   0x00000020

Use wide reads on the source address during the DMA request (If supported).

◆ DMA_DATA_FLAG_DEST_WIDE

#define DMA_DATA_FLAG_DEST_WIDE   0x00000040

Use wide writes on the dest address during the DMA request (If supported).

◆ DMA_DATA_FLAG_NOREAD

#define DMA_DATA_FLAG_NOREAD   0x00000080

Ignore the source address and zero fill the destination (If supported).

◆ DMA_DATA_FLAG_NOWRITE

#define DMA_DATA_FLAG_NOWRITE   0x00000100

Ignore the dest address and cache fill from the source (If supported).

◆ DMA_DATA_FLAG_NOCLEAN

#define DMA_DATA_FLAG_NOCLEAN   0x00000200

Do not perform cache clean on the source address (If applicable).

◆ DMA_DATA_FLAG_NOINVALIDATE

#define DMA_DATA_FLAG_NOINVALIDATE   0x00000400

Do not perform cache invalidate on the dest address (If applicable).

◆ DMA_DATA_FLAG_BULK

#define DMA_DATA_FLAG_BULK   0x00000800

Perform a bulk transfer (Higher transfer throughput)(If applicable).

◆ DMA_DATA_FLAG_LITE

#define DMA_DATA_FLAG_LITE   0x00001000

Perform a "lite" transfer (Lower transfer throughput but less waiting for free channel) (If applicable).

◆ DMA_DATA_FLAG_40BIT

#define DMA_DATA_FLAG_40BIT   0x00002000

Perform a 40-bit address transfer (Address to memory above 1GB or 4GB depending on SoC) (If applicable).

◆ PAGE_TABLE_FLAG_NONE

#define PAGE_TABLE_FLAG_NONE   0x00000000

Page Table Flags

◆ PAGE_TABLE_FLAG_NORMAL

#define PAGE_TABLE_FLAG_NORMAL   0x00000002

Page Table Entry represents Normal memory.

Reserved 0x00000001 (Previously used incorrectly for PAGE_TABLE_FLAG_NONE)

◆ PAGE_TABLE_FLAG_DEVICE

#define PAGE_TABLE_FLAG_DEVICE   0x00000004

Page Table Entry represents Device memory.

◆ PAGE_TABLE_FLAG_ORDERED

#define PAGE_TABLE_FLAG_ORDERED   0x00000008

Page Table Entry represents Ordered memory.

◆ PAGE_TABLE_FLAG_SHARED

#define PAGE_TABLE_FLAG_SHARED   0x00000010

Page Table Entry represents Shared memory.

◆ PAGE_TABLE_FLAG_CACHEABLE

#define PAGE_TABLE_FLAG_CACHEABLE   0x00000020

Page Table Entry represents Cacheable memory.

◆ PAGE_TABLE_FLAG_READONLY

#define PAGE_TABLE_FLAG_READONLY   0x00000040

Page Table Entry represents Read Only memory.

◆ PAGE_TABLE_FLAG_READWRITE

#define PAGE_TABLE_FLAG_READWRITE   0x00000080

Page Table Entry represents Read Write memory.

◆ PAGE_TABLE_FLAG_EXECUTABLE

#define PAGE_TABLE_FLAG_EXECUTABLE   0x00000100

Page Table Entry represents Executable memory.

◆ PAGE_TABLE_FLAG_WRITEBACK

#define PAGE_TABLE_FLAG_WRITEBACK   0x00000200

Page Table Entry is Writeback Cacheable memory.

◆ PAGE_TABLE_FLAG_WRITETHROUGH

#define PAGE_TABLE_FLAG_WRITETHROUGH   0x00000400

Page Table Entry is Writethrough Cacheable memory.

◆ PAGE_TABLE_FLAG_WRITEALLOCATE

#define PAGE_TABLE_FLAG_WRITEALLOCATE   0x00000800

Page Table Entry is Writeallocate Cacheable memory.

◆ INTERRUPT_FLAG_NONE

#define INTERRUPT_FLAG_NONE   0x00000000

Interrupt Entry Flags

◆ INTERRUPT_FLAG_SHARED

#define INTERRUPT_FLAG_SHARED   0x00000001

A shared interrupt, multiple devices can register for the same interrupt and each will be called until one returns INTERRUPT_RETURN_HANDLED.

◆ INTERRUPT_FLAG_LOCAL

#define INTERRUPT_FLAG_LOCAL   0x00000002

A local interrupt, generated only on the CPU it is associated with.

◆ INTERRUPT_FLAG_IPI

#define INTERRUPT_FLAG_IPI   0x00000004

A software interrupt or inter processor interrupt, generated by a software request instead of hardware.

◆ INTERRUPT_FLAG_FIQ

#define INTERRUPT_FLAG_FIQ   0x00000008

A fast interrupt, takes precedence over all other interrupts (where applicable).

◆ INTERRUPT_FLAG_CHAINED

#define INTERRUPT_FLAG_CHAINED   0x00000010

A chained interrupt, multiple devices can register for the same interrupt and all will be called when it occurs.

◆ INTERRUPT_PRIORITY_MAXIMUM

#define INTERRUPT_PRIORITY_MAXIMUM   0x00

Interrupt Priority Values

◆ INTERRUPT_PRIORITY_FIQ

#define INTERRUPT_PRIORITY_FIQ   0x40

◆ INTERRUPT_PRIORITY_DEFAULT

#define INTERRUPT_PRIORITY_DEFAULT   0xA0

◆ INTERRUPT_PRIORITY_MINIMUM

#define INTERRUPT_PRIORITY_MINIMUM   0xF0

◆ INTERRUPT_RETURN_NONE

#define INTERRUPT_RETURN_NONE   0

Shared interrupt not handled or not for this device.

Interrupt Return Values

◆ INTERRUPT_RETURN_HANDLED

#define INTERRUPT_RETURN_HANDLED   1

Shared interrupt handled, no further processing.

◆ VECTOR_TABLE_ENTRY_ARM_RESET

#define VECTOR_TABLE_ENTRY_ARM_RESET   0

ARM Reset Vector.

Vector Table Entries ARM

◆ VECTOR_TABLE_ENTRY_ARM_UNDEFINED

#define VECTOR_TABLE_ENTRY_ARM_UNDEFINED   1

ARM Undefined Vector.

◆ VECTOR_TABLE_ENTRY_ARM_SWI

#define VECTOR_TABLE_ENTRY_ARM_SWI   2

ARM Software Interrupt (SWI) Vector.

◆ VECTOR_TABLE_ENTRY_ARM_PREFETCH

#define VECTOR_TABLE_ENTRY_ARM_PREFETCH   3

ARM Prefetch Abort Vector.

◆ VECTOR_TABLE_ENTRY_ARM_ABORT

#define VECTOR_TABLE_ENTRY_ARM_ABORT   4

ARM Data Abort Vector.

◆ VECTOR_TABLE_ENTRY_ARM_RESERVED

#define VECTOR_TABLE_ENTRY_ARM_RESERVED   5

ARM Reserved Vector.

◆ VECTOR_TABLE_ENTRY_ARM_IRQ

#define VECTOR_TABLE_ENTRY_ARM_IRQ   6

ARM IRQ Vector.

◆ VECTOR_TABLE_ENTRY_ARM_FIQ

#define VECTOR_TABLE_ENTRY_ARM_FIQ   7

ARM FIQ Vector.

◆ SHUTDOWN_FLAG_NONE

#define SHUTDOWN_FLAG_NONE   0x00000000

AARCH64 Shutdown Flags

◆ SHUTDOWN_FLAG_RESTART

#define SHUTDOWN_FLAG_RESTART   0x00000001

The system is shutting down and restarting.

◆ SHUTDOWN_FLAG_FORCE

#define SHUTDOWN_FLAG_FORCE   0x00000002

Forced shutdown or restart requested, registered callbacks will be bypassed.

◆ SHUTDOWN_SIGNATURE

#define SHUTDOWN_SIGNATURE   0xA73D8B0C

Shutdown constants

◆ SHUTDOWN_DEFAULT_DELAY

#define SHUTDOWN_DEFAULT_DELAY   1000

Default delay before starting a shutdown or restart (Milliseconds).

◆ SHUTDOWN_MINIMUM_DELAY

#define SHUTDOWN_MINIMUM_DELAY   10

Minimum delay before starting a shutdown or restart (Milliseconds).

◆ SHUTDOWN_DEFAULT_TIMEOUT

#define SHUTDOWN_DEFAULT_TIMEOUT   5000

Default time to wait for a shutdown callback to complete before continuing (Milliseconds).

◆ EXCEPTION_TYPE_DATA_ABORT

#define EXCEPTION_TYPE_DATA_ABORT   1

Exception Types

◆ EXCEPTION_TYPE_PREFETCH_ABORT

#define EXCEPTION_TYPE_PREFETCH_ABORT   2

◆ EXCEPTION_TYPE_UNDEFINED_INSTRUCTION

#define EXCEPTION_TYPE_UNDEFINED_INSTRUCTION   3

◆ FIRMWARE_THROTTLE_NONE

#define FIRMWARE_THROTTLE_NONE   (0 << 0)

Firmware Throttling Flags

◆ FIRMWARE_THROTTLE_UNDER_VOLTAGE

#define FIRMWARE_THROTTLE_UNDER_VOLTAGE   (1 << 0)

Under voltage is occurring.

◆ FIRMWARE_THROTTLE_FREQUENCY_LIMIT

#define FIRMWARE_THROTTLE_FREQUENCY_LIMIT   (1 << 1)

Frequency limiting is occurring.

◆ FIRMWARE_THROTTLE_THROTTLED

#define FIRMWARE_THROTTLE_THROTTLED   (1 << 2)

Throttling is occurring.

◆ FIRMWARE_THROTTLE_SOFT_TEMP_LIMIT

#define FIRMWARE_THROTTLE_SOFT_TEMP_LIMIT   (1 << 3)

Soft temperature limit is active.

◆ FIRMWARE_THROTTLE_WAS_UNDER_VOLTAGE

#define FIRMWARE_THROTTLE_WAS_UNDER_VOLTAGE   (1 << 16)

Under voltage has occurred.

◆ FIRMWARE_THROTTLE_WAS_FREQUENCY_LIMIT

#define FIRMWARE_THROTTLE_WAS_FREQUENCY_LIMIT   (1 << 17)

Frequency limiting has occurred.

◆ FIRMWARE_THROTTLE_WAS_THROTTLED

#define FIRMWARE_THROTTLE_WAS_THROTTLED   (1 << 18)

Throttling has occurred.

◆ FIRMWARE_THROTTLE_WAS_SOFT_TEMP_LIMIT

#define FIRMWARE_THROTTLE_WAS_SOFT_TEMP_LIMIT   (1 << 19)

Soft temperature limit has occurred.

Typedef Documentation

◆ IRQ_MASK

typedef uint32_t IRQ_MASK

Platform specific types IRQ/FIQ Masks

◆ FIQ_MASK

typedef uint32_t FIQ_MASK

◆ IRQ_FIQ_MASK

typedef uint32_t IRQ_FIQ_MASK

◆ ABORT_MASK

typedef uint32_t ABORT_MASK

Abort Masks

◆ DMA_DATA

typedef struct _DMA_DATA DMA_DATA

DMA Data

◆ SYSTEM_CALL_REQUEST

System Call Request (SWI)

◆ handle_close_proc

typedef void STDCALL(* handle_close_proc) (HANDLE data)

Prototypes for Handle methods

◆ handle_close_ex_proc

typedef uint32_t STDCALL(* handle_close_ex_proc) (HANDLE data)

◆ handle_duplicate_proc

typedef HANDLE STDCALL(* handle_duplicate_proc) (HANDLE data)

◆ HANDLE_ENTRY

typedef struct _HANDLE_ENTRY HANDLE_ENTRY

Handle Entry

◆ handle_enumerate_cb

typedef uint32_t STDCALL(* handle_enumerate_cb) (HANDLE_ENTRY *handle, void *data)

Handle Enumeration Callback

◆ shutdown_cb

typedef uint32_t STDCALL(* shutdown_cb) (uint32_t flags, void *parameter)

Prototype for Shutdown Callback

◆ interrupt_handler

typedef void STDCALL(* interrupt_handler) (void *parameter)

Prototypes for Interrupt (IRQ/FIQ) Handlers

◆ interrupt_ex_handler

typedef THREAD_HANDLE STDCALL(* interrupt_ex_handler) (uint32_t cpuid, THREAD_HANDLE thread, void *parameter)

◆ shared_interrupt_handler

typedef uint32_t STDCALL(* shared_interrupt_handler) (uint32_t number, uint32_t cpuid, uint32_t flags, void *parameter)

◆ INTERRUPT_ENTRY

Interrupt Entry (IRQ/FIQ

◆ SYSTEM_CALL_ENTRY

System Call Entry (SWI)

◆ PAGE_TABLE_ENTRY

Page Table Entry

◆ ipi_handler

Prototype for Inter Processor Interrupt (IPI) Handlers Note: When used for IPI the CPUID parameter will be the sending CPU

◆ system_call_handler

typedef void STDCALL(* system_call_handler) (SYSTEM_CALL_REQUEST *request)

Prototype for System Call (SWI) Handlers

◆ system_call_ex_handler

typedef THREAD_HANDLE STDCALL(* system_call_ex_handler) (uint32_t cpuid, THREAD_HANDLE thread, SYSTEM_CALL_REQUEST *request)

◆ thread_yield_proc

typedef uint32_t STDCALL(* thread_yield_proc) (void)

Prototypes for Thread Yield/Wait/Release/Abandon Handlers

◆ thread_wait_proc

typedef uint32_t STDCALL(* thread_wait_proc) (LIST_HANDLE list, SPIN_HANDLE lock, uint32_t flags)

◆ thread_wait_ex_proc

typedef uint32_t STDCALL(* thread_wait_ex_proc) (LIST_HANDLE list, SPIN_HANDLE lock, uint32_t flags, uint32_t timeout)

◆ thread_release_proc

typedef uint32_t STDCALL(* thread_release_proc) (LIST_HANDLE list)

◆ thread_abandon_proc

typedef uint32_t STDCALL(* thread_abandon_proc) (LIST_HANDLE list)

◆ timer_event_proc

typedef void STDCALL(* timer_event_proc) (void *data)

Prototype for Timer Event Handler

◆ worker_task_proc

typedef void STDCALL(* worker_task_proc) (void *data)

Prototype for Worker Task/Callback Handlers

◆ worker_cb

typedef void STDCALL(* worker_cb) (void *data)

◆ counter_event_cb

typedef void STDCALL(* counter_event_cb) (void *data)

Prototype for Counter Callback Handlers

◆ gpio_event_cb

typedef void STDCALL(* gpio_event_cb) (void *data, uint32_t pin, uint32_t trigger)

Prototype for GPIO Callback Handlers

Function Documentation

◆ device_tree_valid()

BOOL STDCALL device_tree_valid ( void )

Check if valid Device Tree information was provided by the firmware/bootloader.

Device Tree Functions

◆ device_tree_get_base()

size_t STDCALL device_tree_get_base ( void )

Get the base address of the Device Tree Blob (Where Applicable).

◆ device_tree_get_size()

uint32_t STDCALL device_tree_get_size ( void )

Get the total size of the Device Tree Blob (Where Applicable).

◆ device_tree_read()

uint32_t STDCALL device_tree_read ( const char * path,
const char * name,
void * buffer,
uint32_t * size )

Read the raw value of a Device Tree property (Where Applicable).

Parameters
PathThe path of the requested property
NameThe name of the requested property
BufferA pointer to a buffer to receive the raw value
SizeThe size in byte of the buffer, updated on return with the actual size of the value
Returns
ERROR_SUCCESS if the property value was read or another error code on failure

◆ device_tree_read32()

uint32_t STDCALL device_tree_read32 ( const char * path,
const char * name,
uint32_t * value )

Read a 32-bit value from a Device Tree property (Where Applicable).

Parameters
PathThe path of the requested property
NameThe name of the requested property
ValueThe returned value of the property
Returns
ERROR_SUCCESS if the property value was read or another error code on failure

◆ device_tree_read64()

uint32_t STDCALL device_tree_read64 ( const char * path,
const char * name,
uint64_t * value )

Read a 64-bit value from a Device Tree property (Where Applicable).

Parameters
PathThe path of the requested property
NameThe name of the requested property
ValueThe returned value of the property
Returns
ERROR_SUCCESS if the property value was read or another error code on failure

◆ device_tree_read_string()

uint32_t STDCALL device_tree_read_string ( const char * path,
const char * name,
char * value,
uint32_t len )

Read a string value from a Device Tree property (Where Applicable).

Parameters
PathThe path of the requested property
NameThe name of the requested property
ValueThe returned value of the property
Returns
ERROR_SUCCESS if the property value was read or another error code on failure

◆ boot_blink()

void STDCALL boot_blink ( void )

Blink the Activity LED (Where Applicable).

Boot Functions

Note
Intended for startup diagnostics when bootstrapping a new board

◆ boot_output()

void STDCALL boot_output ( uint32_t value)

Output boot time information (Where Applicable).

Note
Intended for startup diagnostics when bootstrapping a new board

◆ boot_console_start()

void STDCALL boot_console_start ( void )

Start the boot time console display (Where Applicable).

Note
Intended for startup diagnostics when bootstrapping a new board

◆ boot_console_write()

void STDCALL boot_console_write ( const char * value)

Output text to the boot time console display (Where Applicable).

Note
Intended for startup diagnostics when bootstrapping a new board

◆ boot_console_write_ex()

void STDCALL boot_console_write_ex ( const char * value,
uint32_t x,
uint32_t y )

Output text to the boot time console display at the specified X and Y position (Where Applicable).

Note
Intended for startup diagnostics when bootstrapping a new board

◆ boot_console_get_x()

uint32_t STDCALL boot_console_get_x ( void )

Get the current X position of the boot time console display (Where Applicable).

Note
Intended for startup diagnostics when bootstrapping a new board

◆ boot_console_get_y()

uint32_t STDCALL boot_console_get_y ( void )

Get the current Y position of the boot time console display (Where Applicable).

Note
Intended for startup diagnostics when bootstrapping a new board

◆ power_led_enable()

void STDCALL power_led_enable ( void )

Enable the Power LED (Where Applicable).

LED Functions

◆ power_led_on()

void STDCALL power_led_on ( void )

Turn On the Power LED (Where Applicable).

◆ power_led_off()

void STDCALL power_led_off ( void )

Turn Off the Power LED (Where Applicable).

◆ activity_led_enable()

void STDCALL activity_led_enable ( void )

Enable the Activity LED (Where Applicable).

◆ activity_led_on()

void STDCALL activity_led_on ( void )

Turn On the Activity LED (Where Applicable).

◆ activity_led_off()

void STDCALL activity_led_off ( void )

Turn Off the Activity LED (Where Applicable).

◆ counter_available()

BOOL STDCALL counter_available ( void )

Check if a counter is currently available.

Counter Functions (Timer device)

◆ counter_read()

uint32_t STDCALL counter_read ( void )

Read the current value of the default counter.

Returns
The 32 bit current value of the counter or 0 on failure

◆ counter_read64()

int64_t STDCALL counter_read64 ( void )

Read the current value of the default counter.

Returns
The 64 bit current value of the counter or 0 on failure

◆ counter_wait()

uint32_t STDCALL counter_wait ( void )

Wait for the current interval to expire on the default counter.

Returns
ERROR_SUCCESS if the interval expired or another error code on failure

◆ counter_event()

uint32_t STDCALL counter_event ( counter_event_cb callback,
void * data )

Schedule a function to be called when the current interval expires on the default counter.

Parameters
CallbackThe function to be called when the interval expires
DataA pointer to be pass to the function when the interval expires (Optional)
Returns
ERROR_SUCCESS if the callback was scheduled successfully or another error code on failure

◆ counter_cancel()

uint32_t STDCALL counter_cancel ( void )

Cancel a previously scheduled event callback function on the default counter.

Returns
ERROR_SUCCESS if the callback was cancelled successfully or another error code on failure

◆ counter_get_rate()

uint32_t STDCALL counter_get_rate ( void )

Get the current clock rate in Hz of the default counter.

Returns
The current clock rate in Hz or 0 on failure

◆ counter_set_rate()

uint32_t STDCALL counter_set_rate ( uint32_t rate)

Set the current clock rate in Hz of the default counter.

Parameters
RateThe clock rate in Hz to set
Returns
ERROR_SUCCESS if the clock rate was set or another error code on failure

◆ counter_get_interval()

uint32_t STDCALL counter_get_interval ( void )

Get the current interval in ticks of the default counter.

Returns
The current interval in ticks or 0 on failure (or not set)
Note
The tick rate is determined by the clock rate

◆ counter_set_interval()

uint32_t STDCALL counter_set_interval ( uint32_t interval)

Set the current interval in ticks of the default counter.

Parameters
IntervalThe interval in ticks to set
Returns
ERROR_SUCCESS if the interval was set or another error code on failure
Note
The tick rate is determined by the clock rate

◆ mailbox_receive()

uint32_t STDCALL mailbox_receive ( uint32_t mailbox,
uint32_t channel )

Receive from specified mailbox on specified channel.

Mailbox Functions

◆ mailbox_send()

void STDCALL mailbox_send ( uint32_t mailbox,
uint32_t channel,
uint32_t data )

Send to specified mailbox on specified channel.

◆ mailbox_call()

uint32_t STDCALL mailbox_call ( uint32_t mailbox,
uint32_t channel,
uint32_t data,
uint32_t * response )

Perform a transaction (Send/Receive) to specified mailbox on specified channel.

◆ mailbox_call_ex()

uint32_t STDCALL mailbox_call_ex ( uint32_t mailbox,
uint32_t channel,
uint32_t data,
uint32_t * response,
uint32_t timeout )

Perform a transaction (Send/Receive) to specified mailbox on specified channel.

◆ mailbox_property_call()

uint32_t STDCALL mailbox_property_call ( uint32_t mailbox,
uint32_t channel,
void * data,
uint32_t * response )

Perform a property tag transaction (Send/Receive) to specified mailbox on specified channel.

◆ mailbox_property_call_ex()

uint32_t STDCALL mailbox_property_call_ex ( uint32_t mailbox,
uint32_t channel,
void * data,
uint32_t * response,
uint32_t timeout )

Perform a property tag transaction (Send/Receive) to specified mailbox on specified channel.

◆ mailbox_property_tag()

uint32_t STDCALL mailbox_property_tag ( uint32_t tag,
void * data,
uint32_t size )

Request a property tag (Get/Set) from the mailbox property channel.

◆ random_available()

BOOL STDCALL random_available ( void )

Check if a hardware random number generator is currently available The software random number generator from the RTL is always available.

Random Number Functions

◆ random_seed()

void STDCALL random_seed ( uint32_t seed)

◆ random_read_longint()

int32_t STDCALL random_read_longint ( int32_t limit)

◆ random_read_int64()

int64_t STDCALL random_read_int64 ( int64_t limit)

◆ random_read_double()

double_t STDCALL random_read_double ( void )

◆ random_read_extended()

double_t STDCALL random_read_extended ( void )
Note
Replaced by RandomReadDouble

◆ watchdog_available()

BOOL STDCALL watchdog_available ( void )

Check if a watchdog timer is currently available.

Watchdog Functions

◆ watchdog_start()

uint32_t STDCALL watchdog_start ( uint32_t milliseconds)

◆ watchdog_stop()

uint32_t STDCALL watchdog_stop ( void )

◆ watchdog_refresh()

uint32_t STDCALL watchdog_refresh ( uint32_t milliseconds)

◆ request_irq()

uint32_t STDCALL request_irq ( uint32_t cpuid,
uint32_t number,
interrupt_handler handler,
void * parameter )

Request registration of the supplied handler to the specified IRQ number.

Interrupt Request (IRQ) Functions

Parameters
CPUIDCPU to route IRQ to
NumberIRQ number to register
HandlerInterrupt handler function to register
ParameterA pointer to be passed to the handler when the interrupt occurs (Optional)
Note
If the IRQ number is already registered then the request will fail

◆ release_irq()

uint32_t STDCALL release_irq ( uint32_t cpuid,
uint32_t number,
interrupt_handler handler,
void * parameter )

Request deregistration of the supplied handler from the specified IRQ number.

Parameters
CPUIDCPU to unroute IRQ from
NumberIRQ number to deregister
HandlerInterrupt handler function to deregister
ParameterA pointer to be passed to the handler when the interrupt occurs (Optional)
Note
If the IRQ number is not currently registered then the request will fail

◆ request_ex_irq()

uint32_t STDCALL request_ex_irq ( uint32_t cpuid,
uint32_t number,
interrupt_handler handler,
interrupt_ex_handler handlerex,
void * parameter )

Request registration of the supplied extended handler to the specified IRQ number.

Parameters
CPUIDCPU to route IRQ to
NumberIRQ number to register
HandlerInterrupt handler function to register
HandlerExExtended Interrupt handler function to register
ParameterA pointer to be passed to the handler when the interrupt occurs (Optional)
Note
Only one of Handler or HandlerEx can be specified
If the IRQ number is already registered then the request will fail

◆ release_ex_irq()

uint32_t STDCALL release_ex_irq ( uint32_t cpuid,
uint32_t number,
interrupt_handler handler,
interrupt_ex_handler handlerex,
void * parameter )

Request deregistration of the supplied extended handler from the specified IRQ number.

Parameters
CPUIDCPU to unroute IRQ from
NumberIRQ number to deregister
HandlerInterrupt handler function to deregister
HandlerExExtended Interrupt handler function to deregister
ParameterA pointer to be passed to the handler when the interrupt occurs (Optional)
Note
Only one of Handler or HandlerEx can be specified
If the IRQ number is not currently registered then the request will fail

◆ request_fiq()

uint32_t STDCALL request_fiq ( uint32_t cpuid,
uint32_t number,
interrupt_handler handler,
void * parameter )

Request registration of the supplied handler to the specified FIQ number (Where Applicable).

Fast Interrupt Request (FIQ) Functions

Parameters
CPUIDCPU to route FIQ to
NumberFIQ number to register
HandlerInterrupt handler function to register
ParameterA pointer to be passed to the handler when the interrupt occurs (Optional)
Note
If the FIQ number is already registered then the request will fail

◆ release_fiq()

uint32_t STDCALL release_fiq ( uint32_t cpuid,
uint32_t number,
interrupt_handler handler,
void * parameter )

Request deregistration of the supplied handler from the specified FIQ number (Where Applicable).

Parameters
CPUIDCPU to unroute FIQ from
NumberFIQ number to deregister
HandlerInterrupt handler function to deregister
ParameterA pointer to be passed to the handler when the interrupt occurs (Optional)
Note
If the FIQ number is not currently registered then the request will fail

◆ request_ex_fiq()

uint32_t STDCALL request_ex_fiq ( uint32_t cpuid,
uint32_t number,
interrupt_handler handler,
interrupt_ex_handler handlerex,
void * parameter )

Request registration of the supplied extended handler to the specified FIQ number (Where Applicable).

Parameters
CPUIDCPU to route FIQ to
NumberFIQ number to register
HandlerInterrupt handler function to register
HandlerExExtended Interrupt handler function to register
ParameterA pointer to be passed to the handler when the interrupt occurs (Optional)
Note
Only one of Handler or HandlerEx can be specified
If the FIQ number is already registered then the request will fail

◆ release_ex_fiq()

uint32_t STDCALL release_ex_fiq ( uint32_t cpuid,
uint32_t number,
interrupt_handler handler,
interrupt_ex_handler handlerex,
void * parameter )

Request deregistration of the supplied extended handler from the specified FIQ number (Where Applicable).

Parameters
CPUIDCPU to unroute FIQ from
NumberFIQ number to deregister
HandlerInterrupt handler function to deregister
HandlerExExtended Interrupt handler function to deregister
ParameterA pointer to be passed to the handler when the interrupt occurs (Optional)
Note
Only one of Handler or HandlerEx can be specified
If the FIQ number is not currently registered then the request will fail

◆ request_ipi()

uint32_t STDCALL request_ipi ( uint32_t cpuid,
uint32_t number,
ipi_handler handler,
void * parameter )

Request registration of the supplied handler to the specified IPI (Inter-processor interrupt) number (Where Applicable).

Inter Processor Interrupt (IPI) Functions

Parameters
CPUIDCPU to route IPI to
NumberIPI number to register
HandlerInterrupt handler function to register
ParameterA pointer to be passed to the handler when the interrupt occurs (Optional)
Note
If the IPI number is already registered then the request will fail

◆ release_ipi()

uint32_t STDCALL release_ipi ( uint32_t cpuid,
uint32_t number,
ipi_handler handler,
void * parameter )

Request deregistration of the supplied handler from the specified IPI (Inter-processor interrupt) number (Where Applicable).

Parameters
CPUIDCPU to unroute IPI from
NumberIPI number to deregister
HandlerInterrupt handler function to deregister
ParameterA pointer to be passed to the handler when the interrupt occurs (Optional)
Note
If the IPI number is not currently registered then the request will fail

◆ register_interrupt()

uint32_t STDCALL register_interrupt ( uint32_t number,
uint32_t mask,
uint32_t priority,
uint32_t flags,
shared_interrupt_handler handler,
void * parameter )

Request registration of the supplied handler to the specified interrupt number (Where Applicable).

Interrupt Register/Deregister Functions

Parameters
NumberThe interrupt number to register the handler for
MaskThe mask of CPUs to register the handler for (eg CPU_MASK_0, CPU_MASK_1) (Where Applicable)
PriorityThe priority level of the interrupt to be registered (eg INTERRUPT_PRIORITY_MAXIMUM) (Where Applicable)
FlagsThe flags to control the registration of the interrupt (eg INTERRUPT_FLAG_SHARED) (Where Applicable)
HandlerThe shared interrupt handler to be called when the interrupt occurs
ParameterA pointer to be passed to the handler when the interrupt occurs (Optional)
Returns
ERROR_SUCCESS if the callback was scheduled successfully or another error code on failure

◆ deregister_interrupt()

uint32_t STDCALL deregister_interrupt ( uint32_t number,
uint32_t mask,
uint32_t priority,
uint32_t flags,
shared_interrupt_handler handler,
void * parameter )

Request deregistration of the supplied handler from the specified interrupt number (Where Applicable).

Parameters
NumberThe interrupt number to deregister the hanlder for
MaskThe mask of CPUs to deregister the handler for (eg CPU_MASK_0, CPU_MASK_1) (Where Applicable)
PriorityThe priority level of the interrupt to be deregistered (eg INTERRUPT_PRIORITY_MAXIMUM) (Where Applicable)
FlagsThe flags to control the deregistration of the interrupt (eg INTERRUPT_FLAG_SHARED, INTERRUPT_FLAG_LOCAL, INTERRUPT_FLAG_FIQ) (Where Applicable)
HandlerThe shared interrupt handler to be called when the interrupt occurs
ParameterA pointer to be passed to the handler when the interrupt occurs (Optional)
Returns
ERROR_SUCCESS if the callback was scheduled successfully or another error code on failure

◆ system_call()

void STDCALL system_call ( uint32_t number,
size_t param1,
size_t param2,
size_t param3 )

Perform a System Call function with the supplied parameters (Where Applicable).

System Call (SWI) Functions

Parameters
NumberThe System Call number to be called
Param1The first parameter to pass to the function (Optional / Function defined)
Param2The second parameter to pass to the function (Optional / Function defined)
Param3The third parameter to pass to the function (Optional / Function defined)

◆ register_system_call()

uint32_t STDCALL register_system_call ( uint32_t number,
system_call_handler handler )

Request registration of the supplied handler to the specified System Call number (Where Applicable).

Parameters
NumberThe System Call number to be registered
HandlerThe handler function to be registered
Note
If the System Call number is already registered then the request will fail

◆ deregister_system_call()

uint32_t STDCALL deregister_system_call ( uint32_t number,
system_call_handler handler )

Request deregistration of the supplied handler from the specified System Call number (Where Applicable).

Parameters
NumberThe System Call number to be deregistered
HandlerThe handler function to be deregistered
Note
If the System Call number is not currently registered then the request will fail

◆ register_system_call_ex()

uint32_t STDCALL register_system_call_ex ( uint32_t cpuid,
uint32_t number,
system_call_handler handler,
system_call_ex_handler handlerex )

Request registration of the supplied extended handler to the specified System Call number (Where Applicable).

Parameters
CPUIDThe CPU ID to register the System Call against (or CPU_ID_ALL)
NumberThe System Call number to be registered
HandlerThe handler function to be registered (Optional) (Handler or HandlerEx must be specified, not both)
HandlerExThe extended handler function to be registered (Optional) (Handler or HandlerEx must be specified, not both)
Note
If the System Call number is already registered then the request will fail

◆ deregister_system_call_ex()

uint32_t STDCALL deregister_system_call_ex ( uint32_t cpuid,
uint32_t number,
system_call_handler handler,
system_call_ex_handler handlerex )

Request deregistration of the supplied extended handler from the specified System Call number (Where Applicable).

Parameters
CPUIDThe CPU ID to deregister the System Call from (or CPU_ID_ALL)
NumberThe System Call number to be deregistered
HandlerThe handler function to be deregistered (Optional) (Handler or HandlerEx must be specified, not both)
HandlerExThe extended handler function to be deregistered (Optional) (Handler or HandlerEx must be specified, not both)
Note
If the System Call number is not currently registered then the request will fail

◆ get_interrupt_count()

uint32_t STDCALL get_interrupt_count ( void )

Get the number of interrupt entries for the current platform.

Interrupt Entry Functions

◆ get_interrupt_start()

uint32_t STDCALL get_interrupt_start ( void )

Get the starting number of interrupt entries for the current platform.

◆ get_interrupt_entry()

uint32_t STDCALL get_interrupt_entry ( uint32_t number,
uint32_t instance,
INTERRUPT_ENTRY * interrupt )

Get the interrupt entry for the specified interrupt number and instance.

◆ get_local_interrupt_count()

uint32_t STDCALL get_local_interrupt_count ( void )

Get the number of local interrupt entries for the current platform (Where Applicable).

Local Interrupt Entry Functions

◆ get_local_interrupt_start()

uint32_t STDCALL get_local_interrupt_start ( void )

Get the starting number of local interrupt entries for the current platform (Where Applicable).

◆ get_local_interrupt_entry()

uint32_t STDCALL get_local_interrupt_entry ( uint32_t cpuid,
uint32_t number,
uint32_t instance,
INTERRUPT_ENTRY * interrupt )

Get the local interrupt entry for the specified interrupt number (Where Applicable).

◆ get_software_interrupt_count()

uint32_t STDCALL get_software_interrupt_count ( void )

Get the number of software interrupt entries for the current platform (Where Applicable).

Software Interrupt Entry (IPI) Functions

◆ get_software_interrupt_start()

uint32_t STDCALL get_software_interrupt_start ( void )

Get the starting number of software interrupt entries for the current platform (Where Applicable).

◆ get_software_interrupt_entry()

uint32_t STDCALL get_software_interrupt_entry ( uint32_t cpuid,
uint32_t number,
uint32_t instance,
INTERRUPT_ENTRY * interrupt )

Get the software interrupt entry for the specified interrupt number and instance (Where Applicable).

◆ get_system_call_count()

uint32_t STDCALL get_system_call_count ( void )

Get the number of system call entries for the current platform (Where Applicable).

System Call Entry Functions

◆ get_system_call_entry()

SYSTEM_CALL_ENTRY STDCALL get_system_call_entry ( uint32_t number)

Get the system call entry for the specified system call number (Where Applicable).

◆ system_restart()

uint32_t STDCALL system_restart ( uint32_t delay)

Restart the system.

System Functions

Parameters
DelayHow long to delay before commencing the restart (Milliseconds)
Returns
ERROR_SUCCESS if the restart was successfully initiated or another error code on failure

◆ system_shutdown()

uint32_t STDCALL system_shutdown ( uint32_t delay)

Shutdown the system.

Parameters
DelayHow long to delay before commencing the shutdown (Milliseconds)
Returns
ERROR_SUCCESS if the shutdown was successfully initiated or another error code on failure

◆ system_register_shutdown()

uint32_t STDCALL system_register_shutdown ( shutdown_cb callback,
void * parameter,
uint32_t timeout )

Register a procedure to be called during system shutdown or restart.

Parameters
CallbackThe procedure to be called on shutdown or restart
ParameterA pointer to be passed to the callback procedure
TimeoutTime the shutdown process should wait for this callback to complete (0 for the default timeout) (Milliseconds)
Returns
ERROR_SUCCESS if the callback was successfully registered or another error code on failure

◆ system_deregister_shutdown()

uint32_t STDCALL system_deregister_shutdown ( shutdown_cb callback,
void * parameter )

Deregister a procedure from being called during system shutdown or restart.

Parameters
CallbackThe procedure previously registered for shutdown or restart
ParameterThe pointer previously registered for the callback procedure
Returns
ERROR_SUCCESS if the callback was successfully deregistered or another error code on failure

◆ system_get_uptime()

int64_t STDCALL system_get_uptime ( void )

Get the current system up time in 100 nanosecond ticks since 1 January 1601.

Returns
The current system up time
Note
This is the same time format as Windows FILE_TIME and is intended to allow compatibility with file system functions etc.

◆ system_get_command_line()

uint32_t STDCALL system_get_command_line ( char * commandline,
uint32_t len )

Get the current command line.

◆ system_get_environment()

void *STDCALL system_get_environment ( void )

Get the current environment.

◆ system_date_to_string()

uint32_t STDCALL system_date_to_string ( double_t date,
char * value,
uint32_t len )

Return the supplied date value as a string in the system defined format.

Parameters
DateThe date in Pascal TDateTime format
Returns
The date formatted according to the system date format
Note
Applications should use FormatDateTime or DateTimeToString directly This function is intended to provide a uniform and generic date and time output from system functions such as logging and debug output

◆ system_time_to_string()

uint32_t STDCALL system_time_to_string ( double_t time,
char * value,
uint32_t len )

Return the supplied time value as a string in the system defined format.

Parameters
TimeThe time in Pascal TDateTime format
Returns
The time formatted according to the system time format
Note
Applications should use FormatDateTime or DateTimeToString directly This function is intended to provide a uniform and generic date and time output from system functions such as logging and debug output

◆ system_date_time_to_string()

uint32_t STDCALL system_date_time_to_string ( double_t datetime,
char * value,
uint32_t len )

Return the supplied date and time value as a string in the system defined format.

Parameters
DateTimeThe date and time in Pascal TDateTime format
Returns
The date and time formatted according to the system date and time format
Note
Applications should use FormatDateTime or DateTimeToString directly This function is intended to provide a uniform and generic date and time output from system functions such as logging and debug output

◆ system_interval_to_string()

uint32_t STDCALL system_interval_to_string ( double_t interval,
char * value,
uint32_t len )

Return the supplied time interval as a string in the system defined format.

Parameters
IntervalThe time interval in Pascal TDateTime format
Returns
The time interval formatted according to the system time format

◆ cpu_get_arch()

uint32_t STDCALL cpu_get_arch ( void )

Get the CPU architecture for this board.

CPU Functions

◆ cpu_get_type()

uint32_t STDCALL cpu_get_type ( void )

Get the CPU type for this board.

◆ cpu_get_boot()

uint32_t STDCALL cpu_get_boot ( void )

Get the boot CPU for this board.

◆ cpu_get_mask()

uint32_t STDCALL cpu_get_mask ( void )

Get the CPU mask for this board.

◆ cpu_get_count()

uint32_t STDCALL cpu_get_count ( void )

Get the CPU count for this board.

◆ cpu_get_mode()

uint32_t STDCALL cpu_get_mode ( void )

Get the current CPU mode.

Note
The return value is specific to the CPU type

◆ cpu_get_state()

uint32_t STDCALL cpu_get_state ( void )

Get the current CPU state.

◆ cpu_get_group()

uint32_t STDCALL cpu_get_group ( void )

Get the current CPU group.

◆ cpu_get_current()

uint32_t STDCALL cpu_get_current ( void )

Get the current CPU ID.

◆ cpu_get_memory()

uint32_t STDCALL cpu_get_memory ( size_t * address,
uint64_t * length )

Get the memory start and size available to the CPU.

◆ cpu_get_percentage()

double_t STDCALL cpu_get_percentage ( uint32_t cpuid)

Get the last second utilization of the specified CPU in percentage.

Parameters
CPUIDThe CPU to get utilization from or CPU_ID_ALL for average of all CPUs

◆ cpu_get_utilization()

uint32_t STDCALL cpu_get_utilization ( uint32_t cpuid)

Get the last second utilization of the specified CPU.

Parameters
CPUIDThe CPU to get utilization from or CPU_ID_ALL for average of all CPUs

◆ cpu_get_model()

uint32_t STDCALL cpu_get_model ( void )

Get the CPU model of the current CPU.

◆ cpu_get_revision()

uint32_t STDCALL cpu_get_revision ( void )

Get the CPU revision of the current CPU.

Note
The return value is specific to the CPU type and model

◆ cpu_get_description()

uint32_t STDCALL cpu_get_description ( char * description,
uint32_t len )

Get the CPU description of the current CPU.

◆ fpu_get_type()

uint32_t STDCALL fpu_get_type ( void )

Get the FPU type for this board.

FPU Functions

◆ fpu_get_state()

uint32_t STDCALL fpu_get_state ( void )

Get the current FPU state.

◆ gpu_get_type()

uint32_t STDCALL gpu_get_type ( void )

Get the GPU type for this board.

GPU Functions

◆ gpu_get_state()

uint32_t STDCALL gpu_get_state ( void )

Get the current GPU state.

◆ gpu_get_memory()

uint32_t STDCALL gpu_get_memory ( size_t * address,
uint64_t * length )

Get the memory start and size available to the GPU.

◆ l1_cache_get_type()

uint32_t STDCALL l1_cache_get_type ( void )

Get the L1 cache type for this board.

Cache Functions

◆ l1_data_cache_get_size()

uint32_t STDCALL l1_data_cache_get_size ( void )

Get the L1 data cache size for this board.

Note
If data cache is not supported, the size returned is zero
If separate data and instruction caches are not supported, the size returned is the unified size

◆ l1_data_cache_get_line_size()

uint32_t STDCALL l1_data_cache_get_line_size ( void )

Get the L1 data cache line size for this board.

Note
If data cache is not supported, the size returned is zero
If separate data and instruction caches are not supported, the size returned is the unified size

◆ l1_instruction_cache_get_size()

uint32_t STDCALL l1_instruction_cache_get_size ( void )

Get the L1 instruction cache size for this board.

Note
If instruction cache is not supported, the size returned is zero
If separate data and instruction caches are not supported, the size returned is the unified size

◆ l1_instruction_cache_get_line_size()

uint32_t STDCALL l1_instruction_cache_get_line_size ( void )

Get the L1 instruction cache line size for this board.

Note
If instruction cache is not supported, the size returned is zero
If separate data and instruction caches are not supported, the size returned is the unified size

◆ l2_cache_get_type()

uint32_t STDCALL l2_cache_get_type ( void )

Get the L2 cache type for this board.

◆ l2_cache_get_size()

uint32_t STDCALL l2_cache_get_size ( void )

Get the L2 cache size for this board.

Note
If L2 cache is not supported, the size returned is zero

◆ l2_cache_get_line_size()

uint32_t STDCALL l2_cache_get_line_size ( void )

Get the L2 cache line size for this board.

Note
If L2 cache is not supported, the size returned is zero

◆ version_get_info()

void STDCALL version_get_info ( uint32_t * major,
uint32_t * minor,
uint32_t * revision )

Get the version information of the currently running system.

Version Functions

◆ version_get_date()

uint32_t STDCALL version_get_date ( char * date,
uint32_t len )

Get the version release date of the currently running system.

◆ version_get_name()

uint32_t STDCALL version_get_name ( char * name,
uint32_t len )

Get the version release name of the currently running system.

◆ version_get_version()

uint32_t STDCALL version_get_version ( char * version,
uint32_t len )

Get the version string of the currently running system.

◆ board_get_type()

uint32_t STDCALL board_get_type ( void )

Get the current Board type.

Board Functions

◆ board_get_model()

uint32_t STDCALL board_get_model ( void )

Get the current Board model.

◆ board_get_serial()

int64_t STDCALL board_get_serial ( void )

Get the current Board serial number.

◆ board_get_revision()

uint32_t STDCALL board_get_revision ( void )

Get the current Board revision number.

◆ board_get_mac_address()

uint32_t STDCALL board_get_mac_address ( char * address,
uint32_t len )

Get the current Board MAC address (Where Applicable).

◆ chip_get_revision()

uint32_t STDCALL chip_get_revision ( void )

Get the current Chip revision number.

Chip Functions

◆ firmware_get_revision()

uint32_t STDCALL firmware_get_revision ( void )

Get the current board Firmware Revision.

Firmware Functions

◆ firmware_get_throttled()

uint32_t STDCALL firmware_get_throttled ( void )

Get the current throttling state from the firmware.

Returns
A bit mask of FIRMWARE_THROTTLE_* values for the throttling state

◆ machine_get_type()

uint32_t STDCALL machine_get_type ( void )

Get the current Machine type.

Machine Functions

◆ memory_get_base()

size_t STDCALL memory_get_base ( void )

Get the base address of system memory.

Memory Functions

◆ memory_get_size()

uint64_t STDCALL memory_get_size ( void )

Get the total size of system memory.

◆ memory_get_page_size()

uint32_t STDCALL memory_get_page_size ( void )

Get the page size of system memory.

◆ memory_get_large_page_size()

uint32_t STDCALL memory_get_large_page_size ( void )

Get the large page size of system memory (Where Applicable).

◆ memory_get_section_size()

uint32_t STDCALL memory_get_section_size ( void )

Get the section size of system memory (Where Applicable).

◆ memory_get_large_section_size()

uint32_t STDCALL memory_get_large_section_size ( void )

Get the large section size of system memory (Where Applicable).

◆ power_on()

uint32_t STDCALL power_on ( uint32_t powerid)

Power On the specified device.

Power Functions

◆ power_off()

uint32_t STDCALL power_off ( uint32_t powerid)

Power Off the specified device.

◆ power_get_wait()

uint32_t STDCALL power_get_wait ( uint32_t powerid)

Get the enable wait time in Microseconds of the specified device.

◆ power_get_state()

uint32_t STDCALL power_get_state ( uint32_t powerid)

Get the power state of the specified device.

◆ power_set_state()

uint32_t STDCALL power_set_state ( uint32_t powerid,
uint32_t state,
BOOL wait )

Set the power state of the specified device (Optionally waiting for ready).

◆ clock_ticks()

uint32_t STDCALL clock_ticks ( void )

Get the current number of clock ticks (When this reaches CLOCK_TICKS_PER_SECOND then ClockSeconds is incremented and this is reset to zero).

Clock Functions

Returns
The current number of clock ticks

◆ clock_seconds()

uint32_t STDCALL clock_seconds ( void )

Get the number of clock seconds since the system was started (This forms the system clock).

Returns
The current number of clock seconds

◆ clock_milliseconds()

int64_t STDCALL clock_milliseconds ( void )

Get the number of clock milliseconds since the system was started.

Returns
The current number of clock milliseconds

◆ clock_microseconds()

int64_t STDCALL clock_microseconds ( void )

Get the number of clock microseconds since the system was started.

Returns
The current number of clock microseconds

◆ clock_nanoseconds()

int64_t STDCALL clock_nanoseconds ( void )

Get the number of clock nanoseconds since the system was started.

Returns
The current number of clock nanoseconds

◆ clock_get_base()

int64_t STDCALL clock_get_base ( void )

Get the current clock base in 100 nanosecond ticks since 1 January 1601.

Returns
The current clock base or zero if not set
Note
Clock base is the value added to the system clock to obtain the current time which is calculated at the last setting of the clock
This is the same time format as Windows FILE_TIME and is intended to allow compatibility with file system functions etc.
By default the time returned by this function is considered to be UTC but the actual conversion between UTC and local time is handled at a higher level

◆ clock_get_time()

int64_t STDCALL clock_get_time ( void )

Get the current system time in 100 nanosecond ticks since 1 January 1601.

Returns
The current system time
Note
This is the same time format as Windows FILE_TIME and is intended to allow compatibility with file system functions etc.
By default the time returned by this function is considered to be UTC but the actual conversion between UTC and local time is handled at a higher level

◆ clock_set_time()

int64_t STDCALL clock_set_time ( int64_t time,
BOOL rtc )

Set the current system time in 100 nanosecond ticks since 1 January 1601.

Parameters
TimeThe time to be set
RTCSet the default RTC (real time clock) if available
Returns
The system time after setting
Note
This is the same time format as Windows FILE_TIME and is intended to allow compatibility with file system functions etc.
By default the time passed to this function is considered to be UTC but the actual conversion between UTC and local time is handled at a higher level

◆ clock_get_count()

uint32_t STDCALL clock_get_count ( void )

Gets the current system clock count (32 least significant bits of total).

Note
This will normally come from the free running system timer in the board and is useful as a form of tick count but not for time keeping because the actual rate at which this increments is dependent on the system timer clock frequency of the specific board and may not be a measure of time in its raw form

◆ clock_get_total()

int64_t STDCALL clock_get_total ( void )

Gets the total system clock count.

Note
This will normally come from the free running system timer in the board and is useful as a form of tick count but not for time keeping because the actual rate at which this increments is dependent on the system timer clock frequency of the specific board and may not be a measure of time in its raw form

◆ clock_update_offset()

uint32_t STDCALL clock_update_offset ( void )

Update the system time offset between UTC and Local.

◆ clock_calculate_offset()

uint32_t STDCALL clock_calculate_offset ( double_t datetime,
int32_t * offset,
BOOL * daylight )

Calculate the system time offset between UTC and Local at the given date and time.

Parameters
DateTimeThe date and time to calculate the offset for (Assumed to be Local)
OffsetThe returned Offset in minutes
DaylightTrue on return if daylight savings is in effect at the specified date and time
Returns
ERROR_SUCCESS if the offset was calculated or another error code on failure

◆ clock_get_rate()

uint32_t STDCALL clock_get_rate ( uint32_t clockid)

Get the clock rate in Hz of the specified Clock.

◆ clock_set_rate()

uint32_t STDCALL clock_set_rate ( uint32_t clockid,
uint32_t rate,
BOOL turbo )

Set the clock rate in Hz of the specified Clock.

◆ clock_get_state()

uint32_t STDCALL clock_get_state ( uint32_t clockid)

Get the state of the specified Clock.

◆ clock_set_state()

uint32_t STDCALL clock_set_state ( uint32_t clockid,
uint32_t state )

Set the state of the specified Clock.

◆ clock_get_min_rate()

uint32_t STDCALL clock_get_min_rate ( uint32_t clockid)

Get the minimum clock rate in Hz of the specified Clock.

◆ clock_get_max_rate()

uint32_t STDCALL clock_get_max_rate ( uint32_t clockid)

Get the maximum clock rate in Hz of the specified Clock.

◆ clock_get_measured_rate()

uint32_t STDCALL clock_get_measured_rate ( uint32_t clockid)

Get the measured or actual clock rate in Hz of the specified Clock.

◆ turbo_get_state()

uint32_t STDCALL turbo_get_state ( uint32_t turboid)

Get the Turbo state (0 equals Off / 1 equals On) of the specified device.

Turbo Functions

◆ turbo_set_state()

uint32_t STDCALL turbo_set_state ( uint32_t turboid,
uint32_t state )

Set the Turbo state (0 equals Off / 1 equals On) of the specified device.

◆ voltage_get_value()

uint32_t STDCALL voltage_get_value ( uint32_t voltageid)

Get the current voltage level of the specified device.

Voltage Functions

◆ voltage_set_value()

uint32_t STDCALL voltage_set_value ( uint32_t voltageid,
uint32_t value )

Set the current voltage level of the specified device.

◆ voltage_get_min_value()

uint32_t STDCALL voltage_get_min_value ( uint32_t voltageid)

Get the minimum voltage level of the specified device.

◆ voltage_get_max_value()

uint32_t STDCALL voltage_get_max_value ( uint32_t voltageid)

Get the maximum voltage level of the specified device.

◆ temperature_get_current()

uint32_t STDCALL temperature_get_current ( uint32_t temperatureid)

Get the current temperature in thousandths of a degree C of the specified device.

Temperature Functions

◆ temperature_get_maximum()

uint32_t STDCALL temperature_get_maximum ( uint32_t temperatureid)

Get the maximum temperature in thousandths of a degree C of the specified device.

◆ gpu_memory_allocate()

HANDLE STDCALL gpu_memory_allocate ( uint32_t length,
uint32_t alignment,
uint32_t flags )

Allocate memory from the GPU.

GPU Memory Functions

◆ gpu_memory_release()

uint32_t STDCALL gpu_memory_release ( HANDLE handle)

Release memory allocated from the GPU.

◆ gpu_memory_lock()

uint32_t STDCALL gpu_memory_lock ( HANDLE handle)

Lock memory allocated from the GPU and return an address.

◆ gpu_memory_unlock()

uint32_t STDCALL gpu_memory_unlock ( HANDLE handle)

Unlock memory allocated from the GPU.

◆ gpu_execute_code()

uint32_t STDCALL gpu_execute_code ( void * address,
uint32_t r0,
uint32_t r1,
uint32_t r2,
uint32_t r3,
uint32_t r4,
uint32_t r5 )

Execute a block of code on the GPU.

GPU Misc Functions

◆ dispmanx_handle_get()

HANDLE STDCALL dispmanx_handle_get ( HANDLE resource)

Convert a Dispmanx Resource handle to a Memory handle (Which can be passed to Lock/Unlock above).

◆ edid_block_get()

uint32_t STDCALL edid_block_get ( uint32_t block,
void * buffer,
uint32_t length )

Get an EDID block from HDMI.

◆ framebuffer_available()

BOOL STDCALL framebuffer_available ( void )

Check if a framebuffer device is currently available.

Framebuffer Functions

◆ framebuffer_allocate()

uint32_t STDCALL framebuffer_allocate ( uint32_t alignment,
uint32_t * address,
uint32_t * length )

Allocate a new Framebuffer.

◆ framebuffer_release()

uint32_t STDCALL framebuffer_release ( void )

Release the current Framebuffer.

◆ framebuffer_set_state()

uint32_t STDCALL framebuffer_set_state ( uint32_t state)

Set the current Framebuffer (Display) state (0 for Off / 1 for On).

◆ framebuffer_get_dimensions()

uint32_t STDCALL framebuffer_get_dimensions ( uint32_t * width,
uint32_t * height,
uint32_t * top,
uint32_t * bottom,
uint32_t * left,
uint32_t * right )

Get the default Dimensions of the Framebuffer (Physical Width, Height and Overscan Top, Bottom, Left, Right in Pixels).

◆ framebuffer_get_physical()

uint32_t STDCALL framebuffer_get_physical ( uint32_t * width,
uint32_t * height )

Get the Physical Framebuffer Width and Height in Pixels.

Note
The "physical" size is the size of the allocated buffer in memory, not the resolution of the video signal sent to the display device

◆ framebuffer_set_physical()

uint32_t STDCALL framebuffer_set_physical ( uint32_t * width,
uint32_t * height )

Set the Physical Framebuffer Width and Height in Pixels.

◆ framebuffer_test_physical()

uint32_t STDCALL framebuffer_test_physical ( uint32_t * width,
uint32_t * height )

Test the Physical Framebuffer Width and Height in Pixels.

◆ framebuffer_get_virtual()

uint32_t STDCALL framebuffer_get_virtual ( uint32_t * width,
uint32_t * height )

Get the Virtual Framebuffer Width and Height in Pixels.

Note
The "virtual" size is the portion of buffer that is sent to the display device, not the resolution the buffer itself. This may be smaller than the allocated buffer size in order to implement panning

◆ framebuffer_set_virtual()

uint32_t STDCALL framebuffer_set_virtual ( uint32_t * width,
uint32_t * height )

Set the Virtual Framebuffer Width and Height in Pixels.

◆ framebuffer_test_virtual()

uint32_t STDCALL framebuffer_test_virtual ( uint32_t * width,
uint32_t * height )

Test the Virtual Framebuffer Width and Height in Pixels.

◆ framebuffer_get_depth()

uint32_t STDCALL framebuffer_get_depth ( uint32_t * depth)

Get the Framebuffer Depth in Bits per Pixel.

◆ framebuffer_set_depth()

uint32_t STDCALL framebuffer_set_depth ( uint32_t * depth)

Set the Framebuffer Depth in Bits per Pixel.

◆ framebuffer_test_depth()

uint32_t STDCALL framebuffer_test_depth ( uint32_t * depth)

Test the Framebuffer Depth in Bits per Pixel.

◆ framebuffer_get_pixel_order()

uint32_t STDCALL framebuffer_get_pixel_order ( uint32_t * order)

Get the Framebuffer Pixel Order (0 = BGR / 1 = RGB).

◆ framebuffer_set_pixel_order()

uint32_t STDCALL framebuffer_set_pixel_order ( uint32_t * order)

Set the Framebuffer Pixel Order (0 = BGR / 1 = RGB).

◆ framebuffer_test_pixel_order()

uint32_t STDCALL framebuffer_test_pixel_order ( uint32_t * order)

Test the Framebuffer Pixel Order (0 = BGR / 1 = RGB).

◆ framebuffer_get_alpha_mode()

uint32_t STDCALL framebuffer_get_alpha_mode ( uint32_t * mode)

Get the Framebuffer Alpha Mode.

◆ framebuffer_set_alpha_mode()

uint32_t STDCALL framebuffer_set_alpha_mode ( uint32_t * mode)

Set the Framebuffer Alpha Mode.

◆ framebuffer_test_alpha_mode()

uint32_t STDCALL framebuffer_test_alpha_mode ( uint32_t * mode)

Test the Framebuffer Alpha Mode.

◆ framebuffer_get_pitch()

uint32_t STDCALL framebuffer_get_pitch ( void )

Get the Framebuffer Pitch in Bytes per Line.

◆ framebuffer_get_offset()

uint32_t STDCALL framebuffer_get_offset ( uint32_t * x,
uint32_t * y )

Get the Framebuffer Virtual Offset in Pixels.

◆ framebuffer_set_offset()

uint32_t STDCALL framebuffer_set_offset ( uint32_t * x,
uint32_t * y )

Set the Framebuffer Virtual Offset in Pixels.

◆ framebuffer_test_offset()

uint32_t STDCALL framebuffer_test_offset ( uint32_t * x,
uint32_t * y )

Test the Framebuffer Virtual Offset in Pixels.

◆ framebuffer_get_overscan()

uint32_t STDCALL framebuffer_get_overscan ( uint32_t * top,
uint32_t * bottom,
uint32_t * left,
uint32_t * right )

Get the Framebuffer Top, Bottom, Left and Right Overscan in Pixels.

◆ framebuffer_set_overscan()

uint32_t STDCALL framebuffer_set_overscan ( uint32_t * top,
uint32_t * bottom,
uint32_t * left,
uint32_t * right )

Set the Framebuffer Top, Bottom, Left and Right Overscan in Pixels.

◆ framebuffer_test_overscan()

uint32_t STDCALL framebuffer_test_overscan ( uint32_t * top,
uint32_t * bottom,
uint32_t * left,
uint32_t * right )

Test the Framebuffer Top, Bottom, Left and Right Overscan in Pixels.

◆ framebuffer_get_palette()

uint32_t STDCALL framebuffer_get_palette ( void * buffer,
uint32_t length )

Get the Framebuffer Palette in RGBA values.

◆ framebuffer_set_palette()

uint32_t STDCALL framebuffer_set_palette ( uint32_t start,
uint32_t count,
void * buffer,
uint32_t length )

Set the Framebuffer Palette in RGBA values.

◆ framebuffer_test_palette()

uint32_t STDCALL framebuffer_test_palette ( uint32_t start,
uint32_t count,
void * buffer,
uint32_t length )

Test the Framebuffer Palette in RGBA values.

◆ framebuffer_get_layer()

uint32_t STDCALL framebuffer_get_layer ( int32_t * layer)

Get the Framebuffer Layer.

◆ framebuffer_set_layer()

uint32_t STDCALL framebuffer_set_layer ( int32_t * layer)

Set the Framebuffer Layer.

◆ framebuffer_test_layer()

uint32_t STDCALL framebuffer_test_layer ( int32_t * layer)

Test the Framebuffer Layer.

◆ framebuffer_test_vsync()

uint32_t STDCALL framebuffer_test_vsync ( void )

Test the Framebuffer Vertical Sync (Where Applicable).

◆ framebuffer_set_vsync()

uint32_t STDCALL framebuffer_set_vsync ( void )

Set (Wait For) the Framebuffer Vertical Sync (Where Applicable).

◆ framebuffer_set_backlight()

uint32_t STDCALL framebuffer_set_backlight ( uint32_t brightness)

Set the Framebuffer Backlight brightness (Where Applicable).

◆ framebuffer_get_num_displays()

uint32_t STDCALL framebuffer_get_num_displays ( uint32_t * numdisplays)

Get the number of framebuffer displays (Where Applicable).

◆ framebuffer_get_display_id()

uint32_t STDCALL framebuffer_get_display_id ( uint32_t displaynum)

Get the display id for the specified display number (Where Applicable).

◆ framebuffer_set_display_num()

uint32_t STDCALL framebuffer_set_display_num ( uint32_t displaynum)

Set the current framebuffer display number (Where Applicable).

◆ framebuffer_get_display_settings()

uint32_t STDCALL framebuffer_get_display_settings ( uint32_t displaynum,
DISPLAY_SETTINGS * displaysettings )

Get the display settings for the specified display number (Where Applicable).

◆ framebuffer_display_id_to_name()

uint32_t STDCALL framebuffer_display_id_to_name ( uint32_t displayid,
char * name,
uint32_t len )

Get the name for the specified display id (Where Applicable).

◆ touch_get_buffer()

uint32_t STDCALL touch_get_buffer ( size_t * address)

Get the Touchscreen memory buffer (Where Applicable).

Touch Functions

◆ touch_set_buffer()

uint32_t STDCALL touch_set_buffer ( size_t address)

Set the Touchscreen memory buffer (Where Applicable).

◆ cursor_set_default()

uint32_t STDCALL cursor_set_default ( void )

Set the default Cursor Info (Where Applicable).

Cursor Functions

◆ cursor_set_info()

uint32_t STDCALL cursor_set_info ( uint32_t width,
uint32_t height,
uint32_t hotspotx,
uint32_t hotspoty,
void * pixels,
uint32_t length )

Set the Cursor Info (Width and Height, Hotspot and Pixel image).

◆ cursor_set_state()

uint32_t STDCALL cursor_set_state ( BOOL enabled,
uint32_t x,
uint32_t y,
BOOL relative )

Set the Cursor State (Enabled, X and Y).

Parameters
RelativeX, Y is relative to Display (Virtual) not Framebuffer (Physical)

◆ dma_available()

BOOL STDCALL dma_available ( void )

Check if DMA is currently available.

DMA Functions

◆ dma_transfer()

uint32_t STDCALL dma_transfer ( DMA_DATA * data,
uint32_t direction,
uint32_t peripheral )

Perform a DMA transfer using the list of DMA data blocks provided.

Parameters
DataA linked list of DMA data blocks for the transfer
DirectionThe direction of the DMA request (eg DMA_DIR_MEM_TO_MEM)
PeripheralThe peripheral ID for data request gating (eg DMA_DREQ_ID_NONE)

◆ dma_fill_memory()

uint32_t STDCALL dma_fill_memory ( void * dest,
uint32_t size,
uint8_t value )

Fill memory at the destination address using DMA.

Parameters
DestThe address to start the memory fill
SizeThe size of memory to fill in bytes
ValueThe value to fill the memory with

◆ dma_copy_memory()

uint32_t STDCALL dma_copy_memory ( void * source,
void * dest,
uint32_t size )

Copy memory from the source to the destination address using DMA.

Parameters
SourceThe source address to start the memory copy
DestThe destination address to start the memory copy
SizeThe size of memory to copy in bytes

◆ dma_read_peripheral()

uint32_t STDCALL dma_read_peripheral ( void * address,
void * dest,
uint32_t size,
uint32_t peripheral )

Read from a peripheral address to the destination address using DMA.

Parameters
AddressThe address of the peripheral register to read from
DestThe destination address to start writing to
SizeThe size of the read in bytes
PeripheralThe peripheral ID for data request gating (eg DMA_DREQ_ID_UART_RX)

◆ dma_write_peripheral()

uint32_t STDCALL dma_write_peripheral ( void * source,
void * address,
uint32_t size,
uint32_t peripheral )

Write to a peripheral address from the source address using DMA.

Parameters
SourceThe source address to start reading from
AddressThe address of the peripheral register to write to
SizeThe size of the write in bytes
PeripheralThe peripheral ID for data request gating (eg DMA_DREQ_ID_UART_TX)

◆ dma_allocate_buffer()

void *STDCALL dma_allocate_buffer ( uint32_t size)

Allocate a buffer compatible with DMA memory reads or writes.

Parameters
SizeThe size of the buffer to allocate

◆ dma_allocate_buffer_ex()

void *STDCALL dma_allocate_buffer_ex ( uint32_t * size)

Allocate a buffer compatible with DMA memory reads or writes.

Parameters
SizeThe size of the buffer to allocate (Updated on return to actual size)

◆ dma_release_buffer()

uint32_t STDCALL dma_release_buffer ( void * buffer)

Release a buffer allocated with DMAAllocateBuffer.

Parameters
BufferThe buffer to be released

◆ dma_get_channels()

uint32_t STDCALL dma_get_channels ( void )

Get the currently enabled DMA channel bitmap (If supported).

◆ handle_create()

HANDLE STDCALL handle_create ( HANDLE data,
uint32_t _type )

Create and Open a new unnamed handle of the supplied type.

Handle Functions

Parameters
DataPurpose specific data to be referenced by the new handle (Optional)
ATypeThe type of the new handle (eg HANDLE_TYPE_FILE)
Returns
The newly created handle or INVALID_HANDLE_VALUE on failure

◆ handle_create_ex()

HANDLE_ENTRY *STDCALL handle_create_ex ( const char * name,
uint32_t flags,
HANDLE data,
uint32_t _type )

Create and Open a new named or unnamed handle of the supplied type.

Parameters
NameThe name of the new handle (Optional)
FlagsThe flags for the new handle (eg HANDLE_FLAG_DUPLICATE)
DataPurpose specific data to be referenced by the new handle (Optional)
ATypeThe type of the new handle (eg HANDLE_TYPE_FILE)
Returns
The newly created handle entry or nil on failure

◆ handle_destroy()

uint32_t STDCALL handle_destroy ( HANDLE handle)

Close and Destroy a named or unnamed handle.

Parameters
HandleThe handle to be closed and destroyed
Returns
ERROR_SUCCESS if completed successfully or another error code on failure
Note
For handles which have been opened multiple times, the handle is not destroyed until the last reference is closed. If there are still open references to the handle the return value will be ERROR_IN_USE instead of ERROR_SUCCESS

◆ handle_get()

HANDLE_ENTRY *STDCALL handle_get ( HANDLE handle)

Get the handle entry for the supplied handle.

Parameters
HandleThe handle to get the entry for
Returns
The handle entry on success or nil on failure

◆ handle_find()

HANDLE_ENTRY *STDCALL handle_find ( const char * name)

Find an existing named handle of the supplied type.

Parameters
NameThe name of the handle to find
Returns
The handle entry on success or nil on failure

◆ handle_enumerate()

uint32_t STDCALL handle_enumerate ( handle_enumerate_cb callback,
void * data )

Enumerate all handles in the handle table.

Parameters
CallbackThe callback function to call for each handle in the table
DataA private data pointer to pass to callback for each device in the table
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ handle_open()

HANDLE STDCALL handle_open ( const char * name)

Open an existing named handle.

Parameters
NameThe name of the handle to open
Returns
The handle matching the name or INVALID_HANDLE_VALUE on failure

◆ handle_close()

uint32_t STDCALL handle_close ( HANDLE handle)

Close a named or unnamed handle.

Parameters
HandleThe handle to be closed
Returns
ERROR_SUCCESS if completed successfully or another error code on failure
Note
For handles which have been opened multiple times, the handle is destroyed when the last reference is closed

◆ handle_duplicate()

HANDLE STDCALL handle_duplicate ( HANDLE handle)

Duplicate an existing named or unnamed handle.

Parameters
HandleThe handle to be duplicated
Returns
The newly duplicated handle or INVALID_HANDLE_VALUE on failure
Note
Handles must be marked as HANDLE_FLAG_DUPLICATE to support duplication

◆ gpio_available()

BOOL STDCALL gpio_available ( void )

Check if a GPIO device is available.

GPIO Functions

◆ gpio_read()

uint32_t STDCALL gpio_read ( uint32_t reg)

Perform a direct read from a GPIO register.

Parameters
RegThe memory register to read from
Returns
The value of the memory register

◆ gpio_write()

void STDCALL gpio_write ( uint32_t reg,
uint32_t value )

Perform a direct write to a GPIO register.

Parameters
RegThe memory register to write to
ValueThe value to write to the register

◆ gpio_input_get()

uint32_t STDCALL gpio_input_get ( uint32_t pin)

Get the current state of a GPIO input pin.

Parameters
PinThe pin to get the state for (eg GPIO_PIN_1)
Returns
The current state (eg GPIO_LEVEL_HIGH) or GPIO_LEVEL_UNKNOWN on failure

◆ gpio_input_wait()

uint32_t STDCALL gpio_input_wait ( uint32_t pin,
uint32_t trigger,
uint32_t timeout )

Wait for the state of a GPIO input pin to change.

Parameters
PinThe pin to wait for the state to change (eg GPIO_PIN_1)
TriggerThe trigger event to wait for (eg GPIO_TRIGGER_HIGH)
TimeoutNumber of milliseconds to wait for the change (INFINITE to wait forever)
Returns
The state after the change (eg GPIO_LEVEL_HIGH) or GPIO_LEVEL_UNKNOWN on failure or timeout

◆ gpio_input_event()

uint32_t STDCALL gpio_input_event ( uint32_t pin,
uint32_t trigger,
uint32_t timeout,
gpio_event_cb callback,
void * data )

Schedule a function to be called when the state of a GPIO input pin changes.

Parameters
PinThe pin to schedule the state change for (eg GPIO_PIN_1)
TriggerThe trigger event which will cause the function to be called (eg GPIO_TRIGGER_HIGH)
TimeoutThe number of milliseconds before the scheduled trigger expires (INFINITE to never expire)
CallbackThe function to be called when the trigger occurs
DataA pointer to be pass to the function when the trigger occurs (Optional)
Returns
ERROR_SUCCESS if the trigger was scheduled successfully or another error code on failure
Note
The pin and trigger that caused the event will be passed to the callback function

◆ gpio_output_set()

uint32_t STDCALL gpio_output_set ( uint32_t pin,
uint32_t level )

Set the state of a GPIO output pin.

Parameters
PinThe pin to set the state for (eg GPIO_PIN_1)
LevelThe state to set the pin to (eg GPIO_LEVEL_HIGH)
Returns
ERROR_SUCCESS if completed successfully or another error code on failure

◆ gpio_level_get()

uint32_t STDCALL gpio_level_get ( uint32_t pin)

Get the current level (state) of a GPIO pin.

Parameters
PinThe pin to get the level for (eg GPIO_PIN_1)
Returns
The current level (eg GPIO_LEVEL_HIGH) or GPIO_LEVEL_UNKNOWN on failure
Note
This function is a synonym for GPIOInputGet as in many cases the level can be read from a pin regardless of input or output mode. This may help to make code clearer or easier to understand in some cases

◆ gpio_level_set()

uint32_t STDCALL gpio_level_set ( uint32_t pin,
uint32_t level )

Set the level (state) of a GPIO pin.

Parameters
PinThe pin to set the level for (eg GPIO_PIN_1)
LevelThe level to set the pin to (eg GPIO_LEVEL_HIGH)
Returns
ERROR_SUCCESS if completed successfully or another error code on failure
Note
This function is a synonym for GPIOOutputSet as in many cases the level can be set for a pin regardless of input or output mode. This may help to make code clearer or easier to understand in some cases

◆ gpio_pull_get()

uint32_t STDCALL gpio_pull_get ( uint32_t pin)

Get the current pull state of a GPIO pin.

Parameters
PinThe pin to get the pull state for (eg GPIO_PIN_1)
Returns
The current pull state of the pin (eg GPIO_PULL_UP) or GPIO_PULL_UNKNOWN on failure

◆ gpio_pull_select()

uint32_t STDCALL gpio_pull_select ( uint32_t pin,
uint32_t mode )

Change the pull state of a GPIO pin.

Parameters
PinThe pin to change the pull state for (eg GPIO_PIN_1)
ModeThe pull state to set for the pin (eg GPIO_PULL_UP)
Returns
ERROR_SUCCESS if completed successfully or another error code on failure

◆ gpio_function_get()

uint32_t STDCALL gpio_function_get ( uint32_t pin)

Get the current function of a GPIO pin.

Parameters
PinThe pin to get the function for (eg GPIO_PIN_1)
Returns
The current function of the pin (eg GPIO_FUNCTION_IN) or GPIO_FUNCTION_UNKNOWN on failure

◆ gpio_function_select()

uint32_t STDCALL gpio_function_select ( uint32_t pin,
uint32_t mode )

Change the function of a GPIO pin.

Parameters
PinThe pin to change the function for (eg GPIO_PIN_1)
ModeThe function to set for the pin (eg GPIO_FUNCTION_OUT)
Returns
ERROR_SUCCESS if completed successfully or another error code on failure

◆ virtual_gpio_input_get()

uint32_t STDCALL virtual_gpio_input_get ( uint32_t pin)

Get the current state of a virtual GPIO input pin.

Virtual GPIO Functions

Parameters
PinThe pin to get the state for (eg VIRTUAL_GPIO_PIN_1)
Returns
The current state (eg GPIO_LEVEL_HIGH) or GPIO_LEVEL_UNKNOWN on failure

◆ virtual_gpio_output_set()

uint32_t STDCALL virtual_gpio_output_set ( uint32_t pin,
uint32_t level )

Set the state of a virtual GPIO output pin.

Parameters
PinThe pin to set the state for (eg GPIO_PIN_1)
LevelThe state to set the pin to (eg GPIO_LEVEL_HIGH)
Returns
ERROR_SUCCESS if completed successfully or another error code on failure

◆ virtual_gpio_level_get()

uint32_t STDCALL virtual_gpio_level_get ( uint32_t pin)

Get the current level (state) of a virtual GPIO pin.

Parameters
PinThe pin to get the level for (eg GPIO_PIN_1)
Returns
The current level (eg GPIO_LEVEL_HIGH) or GPIO_LEVEL_UNKNOWN on failure
Note
This function is a synonym for VirtualGPIOInputGet as in many cases the level can be read from a pin regardless of input or output mode. This may help to make code clearer or easier to understand in some cases

◆ virtual_gpio_level_set()

uint32_t STDCALL virtual_gpio_level_set ( uint32_t pin,
uint32_t level )

Set the level (state) of a virtual GPIO pin.

Parameters
PinThe pin to set the level for (eg GPIO_PIN_1)
LevelThe level to set the pin to (eg GPIO_LEVEL_HIGH)
Returns
ERROR_SUCCESS if completed successfully or another error code on failure
Note
This function is a synonym for VirtualGPIOOutputSet as in many cases the level can be set for a pin regardless of input or output mode. This may help to make code clearer or easier to understand in some cases

◆ virtual_gpio_function_get()

uint32_t STDCALL virtual_gpio_function_get ( uint32_t pin)

Get the current function of a virtual GPIO pin.

Parameters
PinThe pin to get the function for (eg GPIO_PIN_1)
Returns
The current function of the pin (eg GPIO_FUNCTION_IN) or GPIO_FUNCTION_UNKNOWN on failure

◆ virtual_gpio_function_select()

uint32_t STDCALL virtual_gpio_function_select ( uint32_t pin,
uint32_t mode )

Change the function of a virtual GPIO pin.

Parameters
PinThe pin to change the function for (eg GPIO_PIN_1)
ModeThe function to set for the pin (eg GPIO_FUNCTION_OUT)
Returns
ERROR_SUCCESS if completed successfully or another error code on failure

◆ spi_available()

BOOL STDCALL spi_available ( void )

Check if an SPI device is available.

SPI Functions

◆ spi_start()

uint32_t STDCALL spi_start ( uint32_t mode,
uint32_t clockrate,
uint32_t clockphase,
uint32_t clockpolarity )

Start the default SPI device ready for writing and reading.

Parameters
ModeThe device mode to set (eg SPI_MODE_4WIRE)
ClockRateThe clock rate to set for the device
ClockPhaseThe clock phase to set (eg SPI_CLOCK_PHASE_LOW)
ClockPolarityThe clock polarity to set (eg SPI_CLOCK_POLARITY_LOW)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ spi_stop()

uint32_t STDCALL spi_stop ( void )

Stop the default SPI device and terminate writing and reading.

Returns
ERROR_SUCCESS if completed or another error code on failure

◆ spi_read()

uint32_t STDCALL spi_read ( uint16_t chipselect,
void * dest,
uint32_t size,
uint32_t * count )

Read data from the default SPI device Because SPI writes and then reads for each byte, dummy data will be written for each byte to be read.

Parameters
ChipSelectThe chip select for the slave to read from (eg SPI_CS_0)
DestPointer to a buffer to receive the data
SizeThe size of the buffer
CountThe number of bytes read on return
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ spi_write()

uint32_t STDCALL spi_write ( uint16_t chipselect,
void * source,
uint32_t size,
uint32_t * count )

Write data to the default SPI device Because SPI writes and then reads for each byte, received data will be discarded for each byte written.

Parameters
ChipSelectThe chip select for the slave to write to (eg SPI_CS_0)
SourcePointer to a buffer of data to transmit
SizeThe size of the buffer
CountThe number of bytes written on return
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ spi_write_read()

uint32_t STDCALL spi_write_read ( uint16_t chipselect,
void * source,
void * dest,
uint32_t size,
uint32_t * count )

Write data to and Read data from the default SPI device in one operation Because SPI writes and then reads for each byte, both the source and dest buffers must be the same size.

Parameters
ChipSelectThe chip select for the slave to write to and read from (eg SPI_CS_0)
SourcePointer to a buffer of data to transmit
DestPointer to a buffer to receive the data
SizeThe size of the buffer
CountThe number of bytes written and read on return
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ spi_get_mode()

uint32_t STDCALL spi_get_mode ( void )

Get the device mode of the default SPI device.

Returns
The device mode or SPI_MODE_UNKNOWN on failure

◆ spi_set_mode()

uint32_t STDCALL spi_set_mode ( uint32_t mode)

Set the device mode for the default SPI device.

Parameters
ModeThe device mode to set (eg SPI_MODE_4WIRE)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ spi_get_clock_rate()

uint32_t STDCALL spi_get_clock_rate ( uint16_t chipselect)

Get the clock rate of the default SPI device.

Parameters
ChipSelectThe chip select number to get clock rate from (SPI_CS_NONE for default)
Returns
The clock rate in Hz or 0 on failure

◆ spi_set_clock_rate()

uint32_t STDCALL spi_set_clock_rate ( uint16_t chipselect,
uint32_t clockrate )

Set the clock rate for the default SPI device.

Parameters
ClockRateThe clock rate to set in Hz
ChipSelectThe chip select number to set clock rate for (SPI_CS_NONE for default)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ spi_get_clock_phase()

uint32_t STDCALL spi_get_clock_phase ( void )

Get the clock phase of the default SPI device.

Returns
The clock phase or SPI_CLOCK_PHASE_UNKNOWN on failure

◆ spi_set_clock_phase()

uint32_t STDCALL spi_set_clock_phase ( uint32_t clockphase)

Set the clock phase for the default SPI device.

Parameters
ClockPhaseThe clock phase to set (eg SPI_CLOCK_PHASE_LOW)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ spi_get_clock_polarity()

uint32_t STDCALL spi_get_clock_polarity ( void )

Get the clock polarity of the default SPI device.

Returns
The clock polarity or SPI_CLOCK_POLARITY_UNKNOWN on failure

◆ spi_set_clock_polarity()

uint32_t STDCALL spi_set_clock_polarity ( uint32_t clockpolarity)

Set the clock polarity for the default SPI device.

Parameters
ClockPolarityThe clock polarity to set (eg SPI_CLOCK_POLARITY_LOW)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ spi_get_select_polarity()

uint32_t STDCALL spi_get_select_polarity ( uint16_t chipselect)

Get the chip select polarity of the default SPI device.

Parameters
ChipSelectThe chip select number to get polarity from (SPI_CS_NONE for default)
Returns
The chip select polarity or SPI_CS_POLARITY_UNKNOWN on failure

◆ spi_set_select_polarity()

uint32_t STDCALL spi_set_select_polarity ( uint16_t chipselect,
uint32_t selectpolarity )

Set the chip select polarity for the default SPI device.

Parameters
ChipSelectThe chip select number to set polarity for (SPI_CS_NONE for default)
SelectPolarityThe chip select polarity to set (eg SPI_CS_POLARITY_LOW)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ spi_get_description()

uint32_t STDCALL spi_get_description ( uint32_t id,
char * description,
uint32_t len )

Return the device description of an SPI device.

Parameters
IdThe Id number of the SPI device as shown in the official documentation
Returns
The correct device description suitable for passing to SPIDeviceFindByDescription
Note
The Id number supplied to this function may differ from the Ultibo device id value

◆ i2c_available()

BOOL STDCALL i2c_available ( void )

Check if an I2C device is available.

I2C Functions

◆ i2c_start()

uint32_t STDCALL i2c_start ( uint32_t rate)

Start the default I2C device ready for reading and writing.

Parameters
RateThe clock rate to set for the device (0 to use the default rate)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ i2c_stop()

uint32_t STDCALL i2c_stop ( void )

Stop the default I2C device and terminate reading and writing.

Returns
ERROR_SUCCESS if completed or another error code on failure

◆ i2c_read()

uint32_t STDCALL i2c_read ( uint16_t address,
void * buffer,
uint32_t size,
uint32_t * count )

Read data from the default I2C device.

Parameters
AddressThe slave address to read from (I2C_ADDRESS_INVALID to use the current address)
BufferPointer to a buffer to receive the data
SizeThe size of the buffer
CountThe number of bytes read on return
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ i2c_write()

uint32_t STDCALL i2c_write ( uint16_t address,
void * buffer,
uint32_t size,
uint32_t * count )

Write data to the default I2C device.

Parameters
AddressThe slave address to write to (I2C_ADDRESS_INVALID to use the current address)
BufferPointer to a buffer of data to transmit
SizeThe size of the buffer
CountThe number of bytes written on return
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ i2c_write_read()

uint32_t STDCALL i2c_write_read ( uint16_t address,
void * initial,
uint32_t len,
void * data,
uint32_t size,
uint32_t * count )

Write data to and Read data from the default I2C device in one operation Useful for devices that require a register address specified before a read (eg EEPROM devices).

Parameters
AddressThe slave address to write to (I2C_ADDRESS_INVALID to use the current address)
InitialPointer to the initial buffer to transmit
LenThe size of the initial buffer
DataPointer to a buffer to receive the data
SizeThe size of the data buffer
CountThe number of bytes read on return
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ i2c_write_write()

uint32_t STDCALL i2c_write_write ( uint16_t address,
void * initial,
uint32_t len,
void * data,
uint32_t size,
uint32_t * count )

Write 2 data blocks to the default I2C device in one operation Useful for devices that require a register address specified before a write (eg EEPROM devices).

Parameters
AddressThe slave address to write to (I2C_ADDRESS_INVALID to use the current address)
InitialPointer to the initial buffer to transmit
LenThe size of the initial buffer
DataPointer to a buffer of data to transmit
SizeThe size of the data buffer
CountThe number of bytes of data written on return
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ i2c_get_rate()

uint32_t STDCALL i2c_get_rate ( void )

Get the clock rate of the default I2C device.

Returns
The clock rate in Hz or 0 on failure

◆ i2c_set_rate()

uint32_t STDCALL i2c_set_rate ( uint32_t rate)

Set the clock rate for the default I2C device.

Parameters
RateThe clock rate to set in Hz
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ i2c_get_address()

uint16_t STDCALL i2c_get_address ( void )

Get the slave address for the default I2C device.

Returns
The slave address or I2C_ADDRESS_INVALID on failure

◆ i2c_set_address()

uint32_t STDCALL i2c_set_address ( uint16_t address)

Set the slave address for the default I2C device.

Parameters
AddressThe slave address to set
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ i2c_get_description()

uint32_t STDCALL i2c_get_description ( uint32_t id,
char * description,
uint32_t len )

Get the device description of an I2C device.

Parameters
IdThe Id number of the I2C device as shown in the official documentation
Returns
The correct device description suitable for passing to I2CDeviceFindByDescription
Note
The Id number supplied to this function may differ from the Ultibo device id value

◆ i2c_slave_get_description()

uint32_t STDCALL i2c_slave_get_description ( uint32_t id,
char * description,
uint32_t len )

Get the device description of an I2C slave device.

Parameters
IdThe Id number of the I2C slave device as shown in the official documentation
Returns
The correct device description suitable for passing to I2CSlaveFindByDescription
Note
The Id number supplied to this function may differ from the Ultibo device id value

◆ pwm_available()

BOOL STDCALL pwm_available ( void )

Check if a PWM device is available.

PWM Functions

◆ pwm_start()

uint32_t STDCALL pwm_start ( void )

Start the default PWM device.

Returns
ERROR_SUCCESS if completed or another error code on failure

◆ pwm_stop()

uint32_t STDCALL pwm_stop ( void )

Stop the default PWM device.

Returns
ERROR_SUCCESS if completed or another error code on failure

◆ pwm_write()

uint32_t STDCALL pwm_write ( uint32_t value)

Write a value to the default PWM device.

Parameters
ValueThe value to write
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
The exact meaning of value may depend on the device and other configured options, in many cases the value will represent the "on" time of each pulse with regard to the duty cycle of the waveform output by the device

◆ pwm_set_mode()

uint32_t STDCALL pwm_set_mode ( uint32_t mode)

Set the mode for the default PWM device.

Parameters
ModeThe mode value to set (eg PWM_MODE_MARKSPACE)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ pwm_set_range()

uint32_t STDCALL pwm_set_range ( uint32_t range)

Set the range for the default PWM device.

Parameters
RangeThe range value to set
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
The exact meaning of range may depend on the device and other configured options, in many cases the range will represent the period of one full cycle of the waveform output by the device

◆ pwm_set_frequency()

uint32_t STDCALL pwm_set_frequency ( uint32_t frequency)

Set the clock frequency for the default PWM device.

Parameters
FrequencyThe frequency to set in Hz
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ pwm_configure()

uint32_t STDCALL pwm_configure ( uint32_t dutyns,
uint32_t periodns )

Set the configuration of the default PWM device.

Parameters
DutyNSThe "on" time part of the cycle (Nanoseconds)
PeriodNSThe duration of one full cycle (Nanoseconds)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ pwm_get_description()

uint32_t STDCALL pwm_get_description ( uint32_t id,
uint32_t channel,
char * description,
uint32_t len )

Get the device description of an PWM device.

Parameters
IdThe Id number of the PWM device as shown in the official documentation
ChannelThe channel number of the PWM device as shown in the official documentation
Returns
The correct device description suitable for passing to PWMDeviceFindByDescription
Note
The Id number supplied to this function may differ from the Ultibo device id value

◆ rtc_available()

BOOL STDCALL rtc_available ( void )

Check if a Real Time Clock (RTC) device is available.

RTC Functions

◆ rtc_get_time()

int64_t STDCALL rtc_get_time ( void )

Get the current time from a Real Time Clock device Returned time is 100 nanosecond ticks since 1 January 1601 The same format as the ClockGetTime function.

◆ rtc_set_time()

int64_t STDCALL rtc_set_time ( int64_t time)

Set the current time for a Real Time Clock device.

Parameters
TimeThe time to be set
Returns
The device time after setting (or 0 on failure) Time and returned time is 100 nanosecond ticks since 1 January 1601 The same format as the ClockSetTime function

◆ uart_get_description()

uint32_t STDCALL uart_get_description ( uint32_t id,
char * description,
uint32_t len )

Get the device description of a UART device.

UART Functions

Parameters
IdThe Id number of the UART device as shown in the official documentation
Returns
The correct device description suitable for passing to UARTDeviceFindByDescription
Note
The Id number supplied to this function may differ from the Ultibo device id value

◆ serial_available()

BOOL STDCALL serial_available ( void )

Check if a Serial device is available.

Serial Functions

◆ serial_open()

uint32_t STDCALL serial_open ( uint32_t baudrate,
uint32_t databits,
uint32_t stopbits,
uint32_t parity,
uint32_t flowcontrol,
uint32_t receivedepth,
uint32_t transmitdepth )

Open the default Serial device ready for sending and receiving.

Parameters
BaudRateBaud rate for the connection (eg 9600, 57600, 115200 etc
DataBitsSize of the data (eg SERIAL_DATA_8BIT)
StopBitsNumber of stop bits (eg SERIAL_STOP_1BIT)
ParityParity type for the data (eg SERIAL_PARITY_NONE)
FlowControlFlow control for the connection (eg SERIAL_FLOW_NONE)
ReceiveDepthSize of the receive buffer (0 = Default size)
TransmitDepthSize of the transmit buffer (0 = Default size)

◆ serial_close()

uint32_t STDCALL serial_close ( void )

Close the default Serial device and terminate sending and receiving.

◆ serial_read()

uint32_t STDCALL serial_read ( void * buffer,
uint32_t size,
uint32_t * count )

Read data from the default Serial device.

Parameters
BufferPointer to a buffer to receive the data
SizeThe size of the buffer
CountThe number of bytes read on return

◆ serial_write()

uint32_t STDCALL serial_write ( void * buffer,
uint32_t size,
uint32_t * count )

Write data to the default Serial device.

Parameters
BufferPointer to a buffer of data to transmit
SizeThe size of the buffer
CountThe number of bytes written on return

◆ serial_printf()

int STDCALL serial_printf ( const char * format,
... )

Print formatted text to the default Serial device.

Parameters
FormatThe formatted text to print (As per printf in standard C library)
Returns
On success the total number of characters sent to the serial device, on error a negative value is returned and errno is set to the error code

◆ peripheral_get_base()

int STDCALL size_t STDCALL peripheral_get_base ( void )

Get the base address of the peripherals.

Peripheral Functions

◆ peripheral_get_size()

uint32_t STDCALL peripheral_get_size ( void )

Get the total size of the peripherals.

◆ peripheral_read()

uint32_t STDCALL peripheral_read ( uint32_t base,
uint32_t reg )

Read from a Peripheral register.

◆ peripheral_write()

void STDCALL peripheral_write ( uint32_t base,
uint32_t reg,
uint32_t value )

Write to a Peripheral register.

◆ local_peripheral_get_base()

size_t STDCALL local_peripheral_get_base ( void )

Get the base address of the local peripherals (Peripherals local to each CPU).

◆ local_peripheral_get_size()

uint32_t STDCALL local_peripheral_get_size ( void )

Get the total size of the local peripherals (Peripherals local to each CPU).

◆ get_sp()

size_t STDCALL get_sp ( void )

Get the current stack pointer (SP).

System Functions

◆ get_pc()

size_t STDCALL get_pc ( void )

Get the current program counter (PC).

◆ get_irq()

BOOL STDCALL get_irq ( void )

Get Interrupts (IRQ) state.

Returns
True if enabled, False if disabled

◆ enable_irq()

void STDCALL enable_irq ( void )

Enable Interrupts (IRQ) unconditionally.

◆ disable_irq()

void STDCALL disable_irq ( void )

Disable Interrupts (IRQ) unconditionally.

◆ save_irq()

IRQ_MASK STDCALL save_irq ( void )

Disable Interrupts (IRQ) and return the previous state.

Returns
IRQ state when called

◆ restore_irq()

IRQ_MASK STDCALL restore_irq ( IRQ_MASK irqmask)

Restore Interrupts (IRQ) to a previous state.

Parameters
IRQMaskIRQ state to restore
Returns
IRQ state when called

◆ get_fiq()

BOOL STDCALL get_fiq ( void )

Get Fast Interrupts (FIQ) state.

Returns
True if enabled, False if disabled

◆ enable_fiq()

void STDCALL enable_fiq ( void )

Enable Fast Interrupts (FIQ) unconditionally.

◆ disable_fiq()

void STDCALL disable_fiq ( void )

Disable Fast Interrupts (FIQ) unconditionally.

◆ save_fiq()

FIQ_MASK STDCALL save_fiq ( void )

Disable Fast Interrupts (FIQ) and return the previous state.

Returns
FIQ state when called

◆ restore_fiq()

FIQ_MASK STDCALL restore_fiq ( FIQ_MASK fiqmask)

Restore Fast Interrupts (FIQ) to a previous state.

Parameters
FIQMaskFIQ state to restore
Returns
FIQ state when called

◆ enable_irq_fiq()

void STDCALL enable_irq_fiq ( void )

Enable Interrupts and Fast Interrupts (IRQ/FIQ) unconditionally.

◆ disable_irq_fiq()

void STDCALL disable_irq_fiq ( void )

Disable Interrupts and Fast Interrupts (IRQ/FIQ) unconditionally.

◆ save_irq_fiq()

IRQ_FIQ_MASK STDCALL save_irq_fiq ( void )

Disable Interrupts and Fast Interrupts (IRQ/FIQ) and return the previous state.

Returns
IRQ/FIQ state when called

◆ restore_irq_fiq()

IRQ_FIQ_MASK STDCALL restore_irq_fiq ( IRQ_FIQ_MASK irqfiqmask)

Restore Interrupts and Fast Interrupts (IRQ/FIQ) to a previous state.

Parameters
IRQFIQMaskIRQ/FIQ state to restore
Returns
IRQ/FIQ state when called

◆ get_abort()

BOOL STDCALL get_abort ( void )

Get Abort state.

Returns
True if enabled, False if disabled

◆ enable_abort()

void STDCALL enable_abort ( void )

Enable Abort unconditionally.

◆ disable_abort()

void STDCALL disable_abort ( void )

Disable Abort unconditionally.

◆ save_abort()

ABORT_MASK STDCALL save_abort ( void )

Disable Abort and return the previous state.

Returns
Abort state when called

◆ restore_abort()

ABORT_MASK STDCALL restore_abort ( ABORT_MASK abortmask)

Restore Abort to a previous state.

Parameters
AbortMaskAbort state to restore
Returns
Abort state when called

◆ halt_cpu()

void STDCALL halt_cpu ( void )

Halt the current processor.

◆ pause_cpu()

void STDCALL pause_cpu ( void )

Pause the current processor and wait for an Event or Interrupt (Where Applicable).

◆ halt_thread()

uint32_t STDCALL halt_thread ( uint32_t exitcode)

Halt the current thread.

◆ send_event()

void STDCALL send_event ( void )

Send a signal that an Event has occurred (Where Applicable).

◆ wait_for_event()

void STDCALL wait_for_event ( void )

Wait for an Event to occur (Where Applicable).

◆ wait_for_interrupt()

void STDCALL wait_for_interrupt ( void )

Wait for an Interrupt to occur (Where Applicable).

◆ read_memory_barrier()

void STDCALL read_memory_barrier ( void )

Perform a Read Memory Barrier operation (Where Applicable).

◆ write_memory_barrier()

void STDCALL write_memory_barrier ( void )

Perform a Write Memory Barrier operation (Where Applicable).

◆ data_memory_barrier()

void STDCALL data_memory_barrier ( void )

Perform a Data Memory Barrier operation (Where Applicable).

◆ data_synchronization_barrier()

void STDCALL data_synchronization_barrier ( void )

Perform a Data Synchronization Barrier operation (Where Applicable).

◆ instruction_memory_barrier()

void STDCALL instruction_memory_barrier ( void )

Perform an Instruction Memory Barrier operation (Where Applicable).

◆ invalidate_tlb()

void STDCALL invalidate_tlb ( void )

Perform an Invalidate Entire TLB operation (Where Applicable).

◆ invalidate_data_tlb()

void STDCALL invalidate_data_tlb ( void )

Perform an Invalidate Data TLB operation (Where Applicable).

◆ invalidate_instruction_tlb()

void STDCALL invalidate_instruction_tlb ( void )

Perform an Invalidate Instruction TLB operation (Where Applicable).

◆ invalidate_cache()

void STDCALL invalidate_cache ( void )

Perform an Invalidate Entire Cache operation (Where Applicable).

◆ clean_data_cache()

void STDCALL clean_data_cache ( void )

Perform a Clean Data Cache operation (Where Applicable).

◆ invalidate_data_cache()

void STDCALL invalidate_data_cache ( void )

Perform an Invalidate Data Cache operation (Where Applicable).

◆ clean_and_invalidate_data_cache()

void STDCALL clean_and_invalidate_data_cache ( void )

Perform a Clean and Invalidate Data Cache operation (Where Applicable).

◆ invalidate_instruction_cache()

void STDCALL invalidate_instruction_cache ( void )

Perform an Invalidate Instruction Cache operation (Where Applicable).

◆ clean_data_cache_range()

void STDCALL clean_data_cache_range ( size_t address,
uint32_t size )

Perform a Clean Data Cache Range operation (Where Applicable).

◆ invalidate_data_cache_range()

void STDCALL invalidate_data_cache_range ( size_t address,
uint32_t size )

Perform an Invalidate Data Cache Range operation (Where Applicable).

◆ clean_and_invalidate_data_cache_range()

void STDCALL clean_and_invalidate_data_cache_range ( size_t address,
uint32_t size )

Perform a Clean and Invalidate Data Cache Range operation (Where Applicable).

◆ invalidate_instruction_cache_range()

void STDCALL invalidate_instruction_cache_range ( size_t address,
uint32_t size )

Perform an Invalidate Instruction Cache Range operation (Where Applicable).

◆ flush_prefetch_buffer()

void STDCALL flush_prefetch_buffer ( void )

Perform a Flush Prefetch Buffer operation (Where Applicable).

◆ flush_branch_target_cache()

void STDCALL flush_branch_target_cache ( void )

Perform a Flush Entire Branch Target Cache operation (Where Applicable).

◆ context_switch()

void STDCALL context_switch ( void * oldstack,
void * newstack,
THREAD_HANDLE newthread )

Perform a Context Switch from one thread to another.

◆ context_switch_irq()

void STDCALL context_switch_irq ( void * oldstack,
void * newstack,
THREAD_HANDLE newthread )

Perform a Context Switch from one thread to another from an IRQ handler.

◆ context_switch_fiq()

void STDCALL context_switch_fiq ( void * oldstack,
void * newstack,
THREAD_HANDLE newthread )

Perform a Context Switch from one thread to another from an FIQ handler.

◆ context_switch_swi()

void STDCALL context_switch_swi ( void * oldstack,
void * newstack,
THREAD_HANDLE newthread )

Perform a Context Switch from one thread to another from a software interrupt handler.

◆ interlocked_or()

int32_t STDCALL interlocked_or ( int32_t * target,
int32_t value )

Perform an atomic OR operation.

◆ interlocked_xor()

int32_t STDCALL interlocked_xor ( int32_t * target,
int32_t value )

Perform an atomic XOR operation.

◆ interlocked_and()

int32_t STDCALL interlocked_and ( int32_t * target,
int32_t value )

Perform an atomic AND operation.

◆ interlocked_decrement()

int32_t STDCALL interlocked_decrement ( int32_t * target)

Perform an atomic decrement operation.

◆ interlocked_increment()

int32_t STDCALL interlocked_increment ( int32_t * target)

Perform an atomic increment operation.

◆ interlocked_exchange()

int32_t STDCALL interlocked_exchange ( int32_t * target,
int32_t source )

Perform an atomic exchange operation.

◆ interlocked_add_exchange()

int32_t STDCALL interlocked_add_exchange ( int32_t * target,
int32_t source )

Perform an atomic add and exchange operation.

◆ interlocked_compare_exchange()

int32_t STDCALL interlocked_compare_exchange ( int32_t * target,
int32_t source,
int32_t compare )

Perform an atomic compare and exchange operation.

◆ page_table_get_levels()

uint32_t STDCALL page_table_get_levels ( void )

Get the number of page table levels for the current platform.

◆ page_directory_get_base()

size_t STDCALL page_directory_get_base ( void )

Get the base address of the first level page directory (Where applicable).

◆ page_directory_get_size()

uint32_t STDCALL page_directory_get_size ( void )

Get the size of the first level page directory (Where applicable).

◆ page_table_get_base()

size_t STDCALL page_table_get_base ( void )

Get the base address of the first or second level page table.

◆ page_table_get_size()

uint32_t STDCALL page_table_get_size ( void )

Get the size of the first or second level page table.

◆ page_table_get_entry()

void STDCALL page_table_get_entry ( size_t address,
PAGE_TABLE_ENTRY * entry )

Get the Page Table entry that corresponds to the supplied virtual address.

◆ page_table_set_entry()

uint32_t STDCALL page_table_set_entry ( PAGE_TABLE_ENTRY * entry)

Set the Page Table entry that corresponds to the supplied virtual address.

◆ page_table_get_page_size()

uint32_t STDCALL page_table_get_page_size ( size_t address)

Get the Size from the Page Table page that corresponds to the supplied virtual address.

◆ page_table_get_page_flags()

uint32_t STDCALL page_table_get_page_flags ( size_t address)

Get the Flags from the Page Table page that corresponds to the supplied virtual address.

◆ page_table_get_page_physical()

size_t STDCALL page_table_get_page_physical ( size_t address)

Get the Physical Address from the Page Table page that corresponds to the supplied virtual address.

◆ page_tables_get_address()

size_t STDCALL page_tables_get_address ( void )

Get the address of the second or third level page tables.

◆ page_tables_get_length()

uint32_t STDCALL page_tables_get_length ( void )

Get the size of the second or third level page tables.

◆ page_tables_get_count()

uint32_t STDCALL page_tables_get_count ( void )

Get the number of second or third level page tables.

◆ page_tables_get_shift()

uint32_t STDCALL page_tables_get_shift ( void )

Get the multiplier to convert count to actual size of the second or third level page tables.

◆ page_tables_get_next()

size_t STDCALL page_tables_get_next ( void )

Get the address of the next available second or third level page table.

◆ page_tables_get_used()

uint32_t STDCALL page_tables_get_used ( void )

Get the number of used second or third level page tables.

◆ page_tables_get_free()

uint32_t STDCALL page_tables_get_free ( void )

Get the number of available second or third level page tables.

◆ vector_table_get_base()

size_t STDCALL vector_table_get_base ( void )

Get the base address of the interrupt vector table.

◆ vector_table_get_size()

uint32_t STDCALL vector_table_get_size ( void )

Get the size in bytes of the interrupt vector table.

◆ vector_table_get_count()

uint32_t STDCALL vector_table_get_count ( void )

Get the number of entries in the interrupt vector table.

◆ vector_table_get_entry()

size_t STDCALL vector_table_get_entry ( uint32_t number)

Get the interrupt vector table entry that corresponds to the supplied number.

◆ vector_table_set_entry()

uint32_t STDCALL vector_table_set_entry ( uint32_t number,
size_t address )

Set the interrupt vector table entry that corresponds to the supplied number.

◆ console_get_key()

BOOL STDCALL console_get_key ( char * ch,
void * userdata )

Console Functions

◆ console_peek_key()

BOOL STDCALL console_peek_key ( char * ch,
void * userdata )

◆ console_write_char()

BOOL STDCALL console_write_char ( char ch,
void * userdata )

◆ console_read_char()

BOOL STDCALL console_read_char ( char * ch,
void * userdata )

◆ console_read_wide_char()

BOOL STDCALL console_read_wide_char ( WCHAR * ch,
void * userdata )

◆ console_hide_mouse()

BOOL STDCALL console_hide_mouse ( void * userdata)

◆ console_show_mouse()

BOOL STDCALL console_show_mouse ( uint32_t x,
uint32_t y,
void * userdata )

◆ console_read_mouse()

BOOL STDCALL console_read_mouse ( uint32_t * x,
uint32_t * y,
uint32_t * buttons,
void * userdata )

◆ code_page_to_wide_char()

WCHAR STDCALL code_page_to_wide_char ( char ch)

CodePage Functions

◆ wide_char_to_code_page()

char STDCALL wide_char_to_code_page ( WCHAR ch)

◆ host_get_name()

uint32_t STDCALL host_get_name ( char * name,
uint32_t len )

Name Functions

◆ host_set_name()

BOOL STDCALL host_set_name ( const char * name)

◆ host_get_domain()

uint32_t STDCALL host_get_domain ( char * domain,
uint32_t len )

◆ host_set_domain()

BOOL STDCALL host_set_domain ( const char * domain)

◆ module_load()

HANDLE STDCALL module_load ( const char * name)

Module Functions

◆ module_load_ex()

HANDLE STDCALL module_load_ex ( const char * name,
uint32_t flags )

◆ module_unload()

BOOL STDCALL module_unload ( HANDLE handle)

◆ module_get_name()

uint32_t STDCALL module_get_name ( HANDLE handle,
char * name,
uint32_t len )

◆ module_get_handle()

HANDLE STDCALL module_get_handle ( char * name)

◆ symbol_add()

BOOL STDCALL symbol_add ( HANDLE handle,
const char * name,
size_t address )

Symbol Functions

◆ symbol_remove()

BOOL STDCALL symbol_remove ( HANDLE handle,
const char * name )

◆ symbol_get_address()

size_t STDCALL symbol_get_address ( HANDLE handle,
const char * name )

◆ logging_output()

void STDCALL logging_output ( const char * text)

Logging Functions

◆ logging_output_ex()

void STDCALL logging_output_ex ( uint32_t facility,
uint32_t severity,
const char * tag,
const char * content )

◆ logging_outputf()

int STDCALL logging_outputf ( const char * format,
... )

Output formatted text to the default logging.

Parameters
FormatThe formatted text to output (As per printf in standard C library)
Returns
On success the total number of characters output to the logging device, on error a negative value is returned and errno is set to the error code

◆ environment_get()

int STDCALL uint32_t STDCALL environment_get ( const char * name,
char * value,
uint32_t len )

Locate an environment variable and return the current value.

Environment Functions

Parameters
NameThe name of the variable to locate (eg TZ)
Returns
The value of the variable or an empty string if not found

◆ environment_set()

uint32_t STDCALL environment_set ( const char * name,
const char * value )

Add an environment variable or update an existing variable.

Parameters
NameThe name of the variable to add or update (eg TZ)
ValueThe new value of the variable (eg EST+5)
Returns
ERROR_SUCCESS if the value was set or another error code on failure
Note
Passing an empty value will delete the environment variable if it exists

◆ environment_count()

uint32_t STDCALL environment_count ( BOOL reset)

Get the current number of environment variables.

Parameters
ResetIf True then force a recount
Returns
The number of environment variables

◆ environment_index()

uint32_t STDCALL environment_index ( const char * name)

Locate an environment variable and return the index.

Parameters
NameThe name of the variable to locate (eg TZ)
Returns
The index of the environment variable or 0 if not found

◆ environment_string()

uint32_t STDCALL environment_string ( uint32_t index,
char * string,
uint32_t len )

Get an environment variable by index.

Parameters
IndexThe index of the variable to get (1 to EnvironmentCount)
Returns
The environment variable or an empty string if index is not valid

◆ setenv()

int setenv ( const char * name,
const char * value,
int overwrite )

Environment Functions (From stdlib.h)

◆ unsetenv()

int unsetenv ( const char * name)

◆ first_bit_set()

uint32_t STDCALL first_bit_set ( uint32_t value)

Find the first set bit in a nonzero 32 bit value.

Utility Functions

Returns
31 for MSB and 0 for LSB (0xFFFFFFFF / -1 if no bits are set)
Note
Similar in operation to the fls() macro, equivalent to fls() - 1

◆ last_bit_set()

uint32_t STDCALL last_bit_set ( uint32_t value)

Find the last set bit in a nonzero 32 bit value.

Returns
31 for MSB and 0 for LSB (0xFFFFFFFF / -1 if no bits are set)
Note
Similar in operation to the ffs() builtin, equivalent to ffs() - 1

◆ count_leading_zeros()

uint32_t STDCALL count_leading_zeros ( uint32_t value)

Count the number of leading 0 bits in a nonzero 32 bit value.

Returns
32 if no bits are set

◆ count_trailing_zeros()

uint32_t STDCALL count_trailing_zeros ( uint32_t value)

Count the number of trailing 0 bits in a nonzero 32 bit value.

Returns
32 if no bits are set

◆ physical_to_io_address()

size_t STDCALL physical_to_io_address ( void * address)

Convert Physical address to an IO addresses (Where Applicable).

◆ io_address_to_physical()

size_t STDCALL io_address_to_physical ( void * address)

Convert an IO address to a Physical address (Where Applicable).

◆ physical_to_bus_address()

size_t STDCALL physical_to_bus_address ( void * address)

Convert a Physical address to a Bus address (Where Applicable).

◆ bus_address_to_physical()

size_t STDCALL bus_address_to_physical ( void * address)

Convert a Bus address to a Physical address (Where Applicable).

◆ nanosecond_delay()

void STDCALL nanosecond_delay ( uint32_t nanoseconds)

Non sleep wait for a number of nanoseconds.

Parameters
NanosecondsNumber of nanoseconds to wait

◆ microsecond_delay()

void STDCALL microsecond_delay ( uint32_t microseconds)

Non sleep wait for a number of microseconds.

Parameters
MicrosecondsNumber of microseconds to wait

◆ millisecond_delay()

void STDCALL millisecond_delay ( uint32_t milliseconds)

Non sleep wait for a number of milliseconds.

Parameters
MillisecondsNumber of milliseconds to wait

◆ nanosecond_delay_ex()

void STDCALL nanosecond_delay_ex ( uint32_t nanoseconds,
BOOL wait )

Non sleep wait for a number of nanoseconds.

Parameters
NanosecondsNumber of nanoseconds to wait
WaitUse WaitForEvent on each loop to reduce power consumption
Note
Not suitable for use by interrupt handlers if wait is true

◆ microsecond_delay_ex()

void STDCALL microsecond_delay_ex ( uint32_t microseconds,
BOOL wait )

Non sleep wait for a number of microseconds.

Parameters
MicrosecondsNumber of microseconds to wait
WaitUse WaitForEvent on each loop to reduce power consumption
Note
Not suitable for use by interrupt handlers if wait is true

◆ millisecond_delay_ex()

void STDCALL millisecond_delay_ex ( uint32_t milliseconds,
BOOL wait )

Non sleep wait for a number of milliseconds.

Parameters
MillisecondsNumber of milliseconds to wait
WaitUse WaitForEvent on each loop to reduce power consumption
Note
Not suitable for use by interrupt handlers if wait is true

◆ get_tick_count()

uint32_t get_tick_count ( void )

RTL Functions

◆ get_tick_count64()

uint64_t get_tick_count64 ( void )

◆ posix_memalign()

int posix_memalign ( void ** memptr,
size_t alignment,
size_t size )

LIBC Functions (From stdlib.h)

◆ realpath()

char * realpath ( const char *__restrict path,
char *__restrict resolved_path )

◆ getpagesize()

int getpagesize ( void )

◆ dup3()

int dup3 ( int oldfd,
int newfd,
int flags )

LIBC Functions (From unistd.h)

◆ getentropy()

int getentropy ( void * buffer,
size_t length )

◆ usleep()

int usleep ( useconds_t useconds)

◆ symlink()

int symlink ( const char * path1,
const char * path2 )

◆ ftruncate()

int ftruncate ( int fd,
off_t length )

◆ truncate()

int truncate ( const char * path,
off_t length )

◆ fdatasync()

int fdatasync ( int fd)

◆ sethostname()

int sethostname ( const char * name,
size_t size )

◆ gethostname()

int gethostname ( char * name,
size_t size )

winsock[2].h defines as __stdcall, and with int as 2nd arg

◆ mmap()

void * mmap ( void * addr,
size_t length,
int prot,
int flags,
int fd,
off_t offset )

LIBC Functions (From sys/mman.h)

◆ munmap()

int munmap ( void * addr,
size_t length )

◆ settimeofday()

int settimeofday ( const struct timeval * tv,
const struct timezone * tz )

LIBC Functions (From sys/time.h)

◆ sched_getcpu()

int sched_getcpu ( void )

LIBC Functions (From sched.h)

◆ msleep()

void msleep ( unsigned int msecs)

LIBC Functions (Non Standard)

◆ gettid()

pid_t gettid ( void )

◆ fd_handle()

HANDLE fd_handle ( int fd)