0.3.1
ARP Cart

Data Structures

struct  arp_callback
 Not yet documented. More...
 

Typedefs

typedef enum arp_function_type arp_function_type_t
 ARP Function types.
 
typedef struct arp_callback arp_callback_t
 Callback type.
 
typedef void(* arp_callback_handler_t) (const arp_callback_t *callback)
 Callback handler.
 

Enumerations

enum  arp_function_type
 ARP Function types. More...
 

Functions

bool arp_busy_status (void)
 Determine if the ARP is busy.
 
bool arp_sync_nonblock (void)
 Perform the ARP handshake.
 
bool arp_detect (void)
 Detect if the ARP cartridge in inserted.
 
char * arp_version_string_get (void)
 Obtain a copy of the ARP cartridge version string.
 
uint32_t arp_long_read (void)
 Read a 32-bit value via the parallel port.
 
uint8_t arp_byte_read (void)
 Read a 8-bit value via the parallel port.
 
uint8_t arp_byte_xchg (uint8_t c)
 Reads an 8-bit value and writes an 8-bit value via the parallel port.
 
void arp_function_callback_set (arp_callback_handler_t handler)
 Set the ARP function callback handler.
 
void arp_function_nonblock (void)
 Perform ARP functions.
 
void arp_return (void)
 Return to the ARP menu.
 
void arp_long_send (uint32_t w)
 Write a 32-bit value via the parallel port.
 
void arp_sync (void)
 Perform the ARP handshake.
 

Detailed Description

Description goes here.


Data Structure Documentation

◆ arp_callback

struct arp_callback

Not yet documented.

Data Fields
arp_function_type_t function_type Function recently executed.
void * ptr Address.
size_t len Length of transfer.

Typedef Documentation

◆ arp_callback_handler_t

typedef void(* arp_callback_handler_t) (const arp_callback_t *callback)

Callback handler.

Parameters
callback

Enumeration Type Documentation

◆ arp_function_type

ARP Function types.

Enumerator
ARP_FUNCTION_TYPE_NONE 

Invalid function.

ARP_FUNCTION_TYPE_DOWNLOAD 

Download function.

ARP_FUNCTION_TYPE_UPLOAD 

Upload function.

ARP_FUNCTION_TYPE_EXEC 

Upload and execute function.

Function Documentation

◆ arp_busy_status()

bool arp_busy_status ( void  )

Determine if the ARP is busy.

Returns
true if ARP is busy. Otherwise, false.

◆ arp_sync_nonblock()

bool arp_sync_nonblock ( void  )

Perform the ARP handshake.

This function blocks until the handshake is successful.

Returns
true if the handshake is successful. Otherwise, false.

◆ arp_detect()

bool arp_detect ( void  )

Detect if the ARP cartridge in inserted.

Note
The detection scheme simply checks if the vendor is a valid 16-bit value.
Returns
true if the ARP cartridge is detected.

◆ arp_version_string_get()

char * arp_version_string_get ( void  )

Obtain a copy of the ARP cartridge version string.

Note
This function allocates a 256-byte buffer with malloc. The caller is responsible for freeing the allocated string.
Returns
A copy of the ARP cartridge version string.

◆ arp_long_read()

uint32_t arp_long_read ( void  )

Read a 32-bit value via the parallel port.

Note
Does not wait for ARP.
Returns
The 32-bit read value.

◆ arp_byte_read()

uint8_t arp_byte_read ( void  )

Read a 8-bit value via the parallel port.

Note
Does not wait for ARP.
Returns
The 8-bit read value.

◆ arp_byte_xchg()

uint8_t arp_byte_xchg ( uint8_t  c)

Reads an 8-bit value and writes an 8-bit value via the parallel port.

The function polls using arp_busy_status until ARP is no longer busy.

Once the ARP is free, a byte is read and stored, Then immediately, c is written (sent).

Parameters
cThe 8-bit value to exchange.
Returns
The 8-bit read value.

◆ arp_function_callback_set()

void arp_function_callback_set ( arp_callback_handler_t  handler)

Set the ARP function callback handler.

The callback is invoked depending on the function invoked within arp_function_nonblock.

Parameters
handlerThe handler.

◆ arp_function_nonblock()

void arp_function_nonblock ( void  )

Perform ARP functions.

This function performs the following ARP functions:

  • Download memory from Saturn to host.
  • Upload binary to Saturn from host and jump (if requested).
Warning
The function still currently blocks.

◆ arp_return()

void arp_return ( void  )

Return to the ARP menu.

Warning
This forcefully jumps to the ARP entry point.

◆ arp_long_send()

void arp_long_send ( uint32_t  w)

Write a 32-bit value via the parallel port.

Note
Does not wait for ARP.
Parameters
wThe 32-bit value.

◆ arp_sync()

void arp_sync ( void  )

Perform the ARP handshake.

This function blocks until the handshake is successful.