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

Output control on debug clock and data lines #146

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 2 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
8 changes: 8 additions & 0 deletions src/probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
#include "probe.pio.h"
#include "tusb.h"

#define PADS_BANK0_GPIO12 _u(12)
julianagentile marked this conversation as resolved.
Show resolved Hide resolved
#define PADS_BANK0_GPIO14 _u(14)

#define DIV_ROUND_UP(m, n) (((m) + (n) - 1) / (n))

// Only want to set / clear one gpio per event so go up in powers of 2
Expand Down Expand Up @@ -147,6 +150,8 @@ void probe_write_mode(void) {

void probe_init() {
if (!probe.initted) {
hw_clear_bits(&padsbank0_hw->io[PADS_BANK0_GPIO12], PADS_BANK0_GPIO12_OD_BITS);
hw_clear_bits(&padsbank0_hw->io[PADS_BANK0_GPIO14], PADS_BANK0_GPIO14_OD_BITS);
uint offset = pio_add_program(pio0, &probe_program);
probe.offset = offset;

Expand Down Expand Up @@ -174,5 +179,8 @@ void probe_deinit(void)
probe_assert_reset(1); // de-assert nRESET

probe.initted = 0;

hw_set_bits(&padsbank0_hw->io[PADS_BANK0_GPIO12], PADS_BANK0_GPIO12_OD_BITS);
hw_set_bits(&padsbank0_hw->io[PADS_BANK0_GPIO14], PADS_BANK0_GPIO14_OD_BITS);
}
}