Skip to content

Commit

Permalink
some dma beginnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffpiep committed Nov 19, 2023
1 parent 19013ef commit bde43e0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pico/mac/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pico_generate_pio_header(commands ${CMAKE_CURRENT_LIST_DIR}/dcd_write.pio)

# target_sources(pio_and PRIVATE pio_and.c)

target_link_libraries(commands pico_stdlib hardware_pio)
target_link_libraries(commands pico_stdlib hardware_pio hardware_dma)

# Add the standard include files to the build
target_include_directories(commands PRIVATE
Expand Down
12 changes: 12 additions & 0 deletions pico/mac/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "hardware/uart.h"
#include "hardware/clocks.h"
#include "hardware/claim.h"
#include "hardware/dma.h"

#include "hardware/pio.h"
#include "hardware/pio_instructions.h"
Expand Down Expand Up @@ -182,6 +183,17 @@ uint8_t dcd_latch;
inline uint16_t get_latch() { return latch; }
inline uint16_t dcd_get_latch() { return ((dcd_latch << 8) + dcd_latch); }

// need the following:
// put_dcd_latch() {this tells the DMA to push the DCD latch into the latch PIO tx fifo}
// put_floppy_latch() {this tells the DMA to push the FLOPPY latch into the latch PIO tx fifo}
// create DMA channel that copies 1 16-bit value from latch or dcd_latch to the PIO TX FIFO

void setup_latch_dma()
{

}


void set_latch(enum latch_bits s) { latch |= (1u << s); }

void dcd_set_latch(uint8_t s) { dcd_latch |= (1u << s); }
Expand Down

0 comments on commit bde43e0

Please sign in to comment.