Skip to content

Commit

Permalink
Interact.json implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
agg23 committed Dec 3, 2023
1 parent fc1d349 commit c26f494
Show file tree
Hide file tree
Showing 23 changed files with 4,925 additions and 1,930 deletions.
25 changes: 18 additions & 7 deletions docs/control.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ See [the Analogue Docs](https://www.analogue.co/developer/docs/host-target-comma
| `request_getfile` | `0x8` | W | 1 | Writing 1 to this register will trigger a request for the filepath of the active slot. |
| `request_openfile` | `0xC` | W | 1 | Writing 1 to this register will trigger a request to change the file in the active slot to the one specified by the path in memory. |

## Interact API

Base address (`APF_INTERACT` block): `0xF000_2000`

This interface provides IO to the Pocket's `interact.json`, or `Core Settings`, API. If you point your `interact.json` `address` entries to byte addresses (with 32 bit words) between `0x1000_0100` to `0x1000_0140`, you can send and receive values at indices 0-15, corresponding to the address (alternatively, this address is the same thing as 32 bit addresses, or shifting the byte address right twice). [See the Analogue Docs](https://www.analogue.co/developer/docs/core-definition-files/interact-json) for more information.

| Name | Offset | Dir | Width | Description |
| ------------------------ | ---------------- | --- | ----- | -------------------------------------------------------------------- |
| `interact[0-15]` | `[0-15] * 8` | RW | 32 | `Interact.json` entry [0-15] |
| `interact_changed[0-15]` | `[0-15] * 8 + 4` | R | 1 | When 1, indicates the `interact.json` entry [0-15] has been updated. |

# ID

### CSR
Expand Down Expand Up @@ -138,7 +149,7 @@ Input data is directly exposed through read registers exactly how they are expos

## Control

Base address (`CTRL` block): `0xF000_0000`
Base address (`CTRL` block): `0xF000_3800`

| Name | Offset | Dir | Width | Description |
| ------- | ------ | --- | ----- | ------------------------------------------------------- |
Expand All @@ -151,7 +162,7 @@ Provides a cycle counter timer (trigger after X cycles) and a global cycle count

### CSR

Base address (`TIMER0` block): `0xF000_2000`
Base address (`TIMER0` block): `0xF000_5000`

**NOTE:** These registers marked "TODO" may have documentation in the SVD file.

Expand All @@ -177,7 +188,7 @@ The dev cart baud rate is set to 2,000,000 bps.

### CSR

Base address (`UART` block): `0xF000_2800` + `0x0`
Base address (`UART` block): `0xF000_5800` + `0x0`

| Name | Offset | Dir | Width | Description |
| ------------ | ------ | --- | ----- | ------------------------------------------- |
Expand All @@ -194,7 +205,7 @@ Base address (`UART` block): `0xF000_2800` + `0x0`

### CSR

Base address (`VIDEO_FRAMEBUFFER` block): `0xF000_3000` + `0x0`
Base address (`VIDEO_FRAMEBUFFER` block): `0xF000_6000` + `0x0`

| Name | Offset | Dir | Width | Description |
| ------------ | ------ | --- | ----- | --------------------------------------------------------------------------------------------------------------------- |
Expand All @@ -205,7 +216,7 @@ Base address (`VIDEO_FRAMEBUFFER` block): `0xF000_3000` + `0x0`
| `dma_loop` | `0x10` | RW | 1 | When 1, DMA will continue to loop when it completes a frame. When 0, it stops. |
| `dma_offset` | `0x14` | RW | 32 | The current offset (in bytes) of the DMA into a frame. This can be used to restart drawing partially through a frame. |

Base address (`VIDEO_FRAMEBUFFER_VTG` block): `0xF000_3800` + `0x0`
Base address (`VIDEO_FRAMEBUFFER_VTG` block): `0xF000_6800` + `0x0`

| Name | Offset | Dir | Width | Description |
| -------- | ------ | --- | ----- | ----------- |
Expand All @@ -215,7 +226,7 @@ Base address (`VIDEO_FRAMEBUFFER_VTG` block): `0xF000_3800` + `0x0`

## CSR

Base address (`APF_RTC` block): `0xF000_2000`
Base address (`APF_RTC` block): `0xF000_2800`

| Name | Offset | Dir | Width | Description |
| -------------- | ------ | --- | ----- | --------------------------------------------------------- |
Expand All @@ -227,7 +238,7 @@ Base address (`APF_RTC` block): `0xF000_2000`

## CSR

Base address (`APF_VIDEO` block): `0xF000_2800`. Single 32 bit video register at `0x0`. Split as follows:
Base address (`APF_VIDEO` block): `0xF000_3000`. Single 32 bit video register at `0x0`. Split as follows:

| Name | Dir | Width | Description |
| ------------------ | --- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
Expand Down
15 changes: 15 additions & 0 deletions lang/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lang/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[workspace]
resolver = "2"
members = [
"examples/interact",
"examples/minibreak",
"examples/minimal",
"examples/rough_fps",
Expand Down
5 changes: 5 additions & 0 deletions lang/rust/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ fps:
cargo build --release && \
cargo objcopy --release -- -O binary ../../rust.bin

interact:
cd examples/interact && \
cargo build --release && \
cargo objcopy --release -- -O binary ../../rust.bin

minibreak:
cd examples/minibreak && \
cargo build --release && \
Expand Down
Loading

0 comments on commit c26f494

Please sign in to comment.