Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow signals to settle on REQ pulse #92

Merged
merged 1 commit into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/BlueSCSI_platform_RP2040/scsi_accel_host.pio
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

start:
wait 0 gpio REQ side 1 ; Wait for REQ low
nop [1] side 1 ; Wait for signals to settle
in pins, 9 side 0 ; Assert ACK, read GPIO
in null, 7 side 0 ; Padding bits
wait 1 gpio REQ side 0 ; Wait for REQ high
Expand Down
13 changes: 7 additions & 6 deletions lib/BlueSCSI_platform_RP2040/scsi_accel_host.pio.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,25 @@
// -------------------- //

#define scsi_host_async_read_wrap_target 0
#define scsi_host_async_read_wrap 6
#define scsi_host_async_read_wrap 7

static const uint16_t scsi_host_async_read_program_instructions[] = {
// .wrap_target
0x90a0, // 0: pull block side 1
0xb027, // 1: mov x, osr side 1
0x3013, // 2: wait 0 gpio, 19 side 1
0x4009, // 3: in pins, 9 side 0
0x4067, // 4: in null, 7 side 0
0x2093, // 5: wait 1 gpio, 19 side 0
0x1042, // 6: jmp x--, 2 side 1
0xb142, // 3: nop side 1 [1]
0x4009, // 4: in pins, 9 side 0
0x4067, // 5: in null, 7 side 0
0x2093, // 6: wait 1 gpio, 19 side 0
0x1042, // 7: jmp x--, 2 side 1
// .wrap
};

#if !PICO_NO_HARDWARE
static const struct pio_program scsi_host_async_read_program = {
.instructions = scsi_host_async_read_program_instructions,
.length = 7,
.length = 8,
.origin = -1,
};

Expand Down