libjoybus
Joybus implementation for 32-bit MCUs
Loading...
Searching...
No Matches
n64_pak.h
1
31
32#pragma once
33
34#include <stdint.h>
35
36#include <joybus/bus.h>
37
39
41#define JOYBUS_TARGET_N64_PAK(pak) ((struct joybus_target_n64_pak *)(pak))
42
57 void (*read_block)(struct joybus_target_n64_pak *pak, uint16_t addr, uint8_t buf[JOYBUS_PAK_BLOCK_SIZE]);
58
70 void (*write_block)(struct joybus_target_n64_pak *pak, uint16_t addr, const uint8_t buf[JOYBUS_PAK_BLOCK_SIZE]);
71};
72
80
#define JOYBUS_PAK_BLOCK_SIZE
Size of a Joybus N64 pak read/write block.
Definition bus.h:56
API for implementing an N64 pak.
Definition n64_pak.h:46
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.
Definition n64_pak.h:70
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.
Definition n64_pak.h:57
An N64 pak, such as a Rumble Pak or Controller Pak.
Definition n64_pak.h:76
const struct joybus_target_n64_pak_api * api
API for handling reads and writes to the pak.
Definition n64_pak.h:78