Module rp_hal::rom_data[][src]

Functions and data from the RPI Bootrom.

Functions

clz32

Return the number of consecutive high order 0 bits of value. If value is zero, returns 32.

connect_internal_flash

Restore all QSPI pad controls to their default state, and connect the SSI to the QSPI pads.

copyright_string

The Raspberry Pi Trading Ltd copyright string.

ctz32

Return the number of consecutive low order 0 bits of value. If value is zero, returns 32.

dadd

Return a + b

datan2

Computes the arc tangent of y/x using the signs of arguments to determine the correct quadrant

dcmp

Compares two floating point numbers, returning: • 0 if a == b • -1 if a < b • 1 if a > b

dcos

Return the cosine of angle. angle is in radians, and must be in the range -1024 to 1024

ddiv

Return a / b

dexp

Return the exponential value of v, i.e. so

dln

Return the natural logarithm of v. If v <= 0 return -Infinity

dmul

Return a * b

double_to_fix

Convert a double to an unsigned fixed point integer representation where n specifies the position of the binary point in the resulting fixed point representation, e.g. _double2ufix(0.5f, 16) == 0x8000. This method rounds towards -Infinity, and clamps the resulting integer to lie within the range 0x00000000 to 0xFFFFFFFF

double_to_fix64

Convert a double to a signed fixed point 64-bit integer representation where n specifies the position of the binary point in the resulting fixed point representation - e.g. _double2fix(0.5f, 16) == 0x8000. This method rounds towards -Infinity, and clamps the resulting integer to lie within the range -0x8000000000000000 to 0x7FFFFFFFFFFFFFFF

double_to_float

Converts a double to a float

double_to_int

Convert a double to a signed integer, rounding towards -Infinity, and clamping the result to lie within the range -0x80000000 to 0x7FFFFFFF

double_to_int64

Convert a double to a signed 64-bit integer, rounding towards -Infinity, and

double_to_ufix

Convert a double to an unsigned integer, rounding towards -Infinity, and clamping the result to lie within the range 0x00000000 to 0xFFFFFFFF 0x24 double_to_uint(v: f64) -> u32;

double_to_ufix64

Convert a double to an unsigned fixed point 64-bit integer representation where n specifies the position of the binary point in the resulting fixed point representation, e.g. _double2ufix(0.5f, 16) == 0x8000. This method rounds towards -Infinity, and clamps the resulting integer to lie within the range 0x0000000000000000 to 0xFFFFFFFFFFFFFFFF

double_to_uint64

Convert a double to an unsigned 64-bit integer, rounding towards -Infinity, and clamping the result to lie within the range 0x0000000000000000 to 0xFFFFFFFFFFFFFFFF

dsin

Return the sine of angle. angle is in radians, and must be in the range -1024 to 1024

dsqrt

Return sqrt(v) or -Infinity if v is negative

dsub

Return a - b

dtan

Return the tangent of angle. angle is in radians, and must be in the range -1024 to 1024

fadd

Return a + b.

fatan2

Computes the arc tangent of y/x using the signs of arguments to determine the correct quadrant.

fcmp

Compares two floating point numbers, returning:

fcos

Return the cosine of angle. angle is in radians, and must be in the range -128 to 128.

fdiv

Return a / b.

fexp

Return the exponential value of v, i.e. so e^v.

fix64_to_doubl

Convert a signed fixed point 64-bit integer representation to the nearest double value, rounding to even on tie. n specifies the position of the binary point in fixed point, so f = nearest(v/(2^n))

fix64_to_float

Convert a signed fixed point integer representation to the nearest float value, rounding to even on tie. n specifies the position of the binary point in fixed point, so f = nearest(v/2^n).

fix_to_double

Convert a signed fixed point integer representation to the nearest double value, rounding to even on tie. n specifies the position of the binary point in fixed point, so f = nearest(v/(2^n))

fix_to_float

Convert a signed fixed point integer representation to the nearest float value, rounding to even on tie. n specifies the position of the binary point in fixed point, so f = nearest(v/2^n).

flash_enter_cmd_xip

Configure the SSI to generate a standard 03h serial read command, with 24 address bits, upon each XIP access. This is a very slow XIP configuration, but is very widely supported. The debugger calls this function after performing a flash erase/programming operation, so that the freshly-programmed code and data is visible to the debug host, without having to know exactly what kind of flash device is connected.

flash_exit_xip

First set up the SSI for serial-mode operations, then issue the fixed XIP exit sequence. Note that the bootrom code uses the IO forcing logic to drive the CS pin, which must be cleared before returning the SSI to XIP mode (e.g. by a call to _flash_flush_cache). This function configures the SSI with a fixed SCK clock divisor of /6.

flash_flush_cache

Flush and enable the XIP cache. Also clears the IO forcing on QSPI CSn, so that the SSI can drive the flashchip select as normal.

flash_range_erase

Erase a count bytes, starting at addr (offset from start of flash). Optionally, pass a block erase command e.g. D8h block erase, and the size of the block erased by this command — this function will use the larger block erase where possible, for much higher erase speed. addr must be aligned to a 4096-byte sector, and count must be a multiple of 4096 bytes.

flash_range_program

Program data to a range of flash addresses starting at addr (offset from the start of flash) and count bytesin size. addr must be aligned to a 256-byte boundary, and count must be a multiple of 256.

fln

Return the natural logarithm of v. If v <= 0 return -Infinity.

float_to_double

Convert a float to an unsigned fixed point 64-bit integer representation where n specifies the position of the binary point in the resulting fixed point representation, e.g. _float2ufix(0.5f, 16) == 0x8000. This method rounds towards -Infinity, and clamps the resulting integer to lie within the range 0x0000000000000000 to 0xFFFFFFFFFFFFFFFF 0x78 float_to_ufix64(v: f32, n: i32) -> u64; Converts a float to a double.

float_to_fix

Convert a float to a signed fixed point integer reprsentation where n specifies the position of the binary point in the resulting fixed point representation. e.g. float_to_fix(0.5, 16) == 0x8000. This method rounds towards -INFINITY, and clamps the resulting integer to lie within the range -800000000 to 0x7FFFFFFF.

float_to_fix64
float_to_int

Convert a float to a signed integer, rounding towards -INFINITY, and clamping the result to lie within the range -0x80000000 to 0x7FFFFFFF.

float_to_int64

Convert a float to a signed 64-bit integer, rounding towards -Infinity, and clamping the result to lie within the range -0x8000000000000000 to 0x7FFFFFFFFFFFFFFF

float_to_ufix

Convert a float to an unsigned fixed point integer representation where n specifies the position of the binary point in the resulting fixed point representation, e.g. float_to_ufix(0.5f, 16) == 0x8000. This method rounds towards -Infinity, and clamps the resulting integer to lie within the range 0x00000000 to 0xFFFFFFFF.

float_to_uint

Convert a float to an unsigned integer, rounding towards -INFINITY, and clamping the result to lie within the range 0x00000000 to 0xFFFFFFFF

float_to_uint64

Convert a float to an unsigned 64-bit integer, rounding towards -Infinity, and clamping the result to lie within the range 0x0000000000000000 to 0xFFFFFFFFFFFFFFFF

fmul

Return a * b.

fplib_end

The end address of the floating point library code and data.

fplib_start

The start address of the floating point library code and data. This and fplib_end along with the individual function pointers in soft_float_table can be used to copy the floating point implementation into RAM if desired.

fsin

Return the sine of angle. angle is in radians, and must be in the range -128 to 128.

fsqrt

Return the square root of v or -INFINITY if v is negative.

fsub

Return a - b.

ftan

Return the tangent of angle. angle is in radians, and must be in the range -128 to 128.

git_revision

The 8 most significant hex digits of the Bootrom git revision.

int64_to_double

Convert a signed 64-bit integer to the nearest double value, rounding to even on tie

int64_to_float

Convert a signed 64-bit integer to the nearest float value, rounding to even on tie.

int_to_double

Convert a signed integer to the nearest double value, rounding to even on tie

int_to_float

Convert a signed integer to the nearest float value, rounding to even on tie.

memcpy

Copies n bytes starting at src to dest and returns dest. The results are undefined if the regions overlap.

memcpy44

Copies n bytes starting at src to dest and returns dest. The results are undefined if the regions overlap. Note this is a slightly more efficient variant of _memcpy that may only be used if dest and src are word aligned.

memset

Sets n bytes start at ptr to the value c and returns ptr

memset4

Sets n bytes start at ptr to the value c and returns ptr. Note this is a slightly more efficient variant of _memset that may only be used if ptr is word aligned.

popcount32

Return a count of the number of 1 bits in value.

reset_to_usb_boot

Resets the RP2040 and uses the watchdog facility to re-start in BOOTSEL mode:

reverse32

Return the bits of value in the reverse order.

soft_double_table

This entry is only present in the V2 bootrom. See Table 182 for the contents of this table.

soft_float_table

See Table 181 for the contents of this table.

ufix64_to_double

Convert an unsigned fixed point 64-bit integer representation to the nearest double value, rounding to even on tie. n specifies the position of the binary point in fixed point, so f = nearest(v/(2^n))

ufix64_to_float

Convert an unsigned fixed point integer representation to the nearest float value, rounding to even on tie. n specifies the position of the binary point in fixed point, so f = nearest(v/2^n).

ufix_to_double

Convert an unsigned fixed point integer representation to the nearest double value, rounding to even on tie. n specifies the position of the binary point in fixed point, so f = nearest(v/(2^n))

ufix_to_float

Convert a unsigned fixed point integer representation to the nearest float value, rounding to even on tie. n specifies the position of the binary point in fixed point, so f = nearest(v/2^n).

uint64_to_double

Convert an unsigned 64-bit integer to the nearest double value, rounding to even on tie

uint64_to_float

Convert an unsigned 64-bit integer to the nearest float value, rounding to even on tie.

uint_to_double

Convert an unsigned integer to the nearest double value, rounding to even on tie

uint_to_float

Convert an unsigned integer to the nearest float value, rounding to even on tie.

wait_for_vector

This is the method that is entered by core 1 on reset to wait to be launched by core 0. There are few cases where you should call this method (resetting core 1 is much better). This method does not return and should only ever be called on core 1.

Type Definitions

RomFnTableCode

A bootrom function table code.