libjoybus
Joybus implementation for 32-bit MCUs
Loading...
Searching...
No Matches
joybus_target_n64_pak_api Struct Reference

API for implementing an N64 pak. More...

#include <n64_pak.h>

Data Fields

void(* read_block )(struct joybus_target_n64_pak *pak, uint16_t addr, uint8_t buf[JOYBUS_PAK_BLOCK_SIZE])
 Called when a host requests to read a 32-byte block from the pak.
void(* write_block )(struct joybus_target_n64_pak *pak, uint16_t addr, const uint8_t buf[JOYBUS_PAK_BLOCK_SIZE])
 Called when a host requests to write a 32-byte block to the pak.

Detailed Description

API for implementing an N64 pak.

Field Documentation

◆ read_block

void(* joybus_target_n64_pak_api::read_block) (struct joybus_target_n64_pak *pak, uint16_t addr, uint8_t buf[JOYBUS_PAK_BLOCK_SIZE])

Called when a host requests to read a 32-byte block from the pak.

Runs in interrupt context, on the response critical path, so it must return quickly.

Parameters
pakthe pak being read from
addrblock-aligned address (low 5 bits are zero)
bufdestination buffer, exactly 32 bytes

◆ write_block

void(* joybus_target_n64_pak_api::write_block) (struct joybus_target_n64_pak *pak, uint16_t addr, const uint8_t buf[JOYBUS_PAK_BLOCK_SIZE])

Called when a host requests to write a 32-byte block to the pak.

Runs in interrupt context, AFTER the CRC response has been sent, but still on the command handling path, so must return before the next command byte is received.

Parameters
pakthe pak being written to
addrblock-aligned address (low 5 bits are zero)
bufsource buffer, exactly 32 bytes

The documentation for this struct was generated from the following file: