libws libws
WSwan hardware library for the Wonderful toolchain
Loading...
Searching...
No Matches
util.h File Reference
#include <stdint.h>
#include <wonderful.h>

Go to the source code of this file.

Functions

static uint32_t ws_ptr_to_linear (const void __far *src)
 
void ws_portcpy (uint16_t port, const void __far *src, uint16_t count)
 Copy memory data to I/O ports, in order.
 
 __attribute__ ((no_assume_ds_data, no_assume_ss_data)) void ws_busywait(uint16_t us)
 Busy wait.
 

Detailed Description

Various utility functions for working with the WonderSwan hardware.

Definition in file util.h.

Function Documentation

◆ __attribute__()

__attribute__ ( (no_assume_ds_data, no_assume_ss_data) )

Busy wait.

This is not recommended - use only when necessary! Not halting the CPU can lead to higher power consumption. The recommended approach is configuring an interrupt handler and using cpu_halt() - which will then sleep until any interrupt occurs.

Parameters
usApproximate number of microseconds.

◆ ws_portcpy()

void ws_portcpy ( uint16_t port,
const void __far * src,
uint16_t count )

Copy memory data to I/O ports, in order.

Parameters
portDestination port.
srcSource pointer.
countCount, in bytes.

◆ ws_ptr_to_linear()

static uint32_t ws_ptr_to_linear ( const void __far * src)
inlinestatic

Definition at line 33 of file util.h.