Skip to content

Commit

Permalink
Update daisy::patch_sm to use GPIO
Browse files Browse the repository at this point in the history
  • Loading branch information
stellar-aria committed May 29, 2023
1 parent 28b62c3 commit b508d8a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
18 changes: 4 additions & 14 deletions src/daisy_patch_sm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,23 +234,13 @@ namespace patch_sm
}

/** Fixed-function Digital I/O */
user_led.mode = DSY_GPIO_MODE_OUTPUT_PP;
user_led.pull = DSY_GPIO_NOPULL;
user_led.pin = PIN_USER_LED;
dsy_gpio_init(&user_led);
user_led.Init(PIN_USER_LED, GPIO::Mode::OUTPUT);
//gate_in_1.Init((dsy_gpio_pin *)&DaisyPatchSM::B10);
gate_in_1.Init(B10);
gate_in_2.Init(B9);

gate_out_1.mode = DSY_GPIO_MODE_OUTPUT_PP;
gate_out_1.pull = DSY_GPIO_NOPULL;
gate_out_1.pin = B5;
dsy_gpio_init(&gate_out_1);

gate_out_2.mode = DSY_GPIO_MODE_OUTPUT_PP;
gate_out_2.pull = DSY_GPIO_NOPULL;
gate_out_2.pin = B6;
dsy_gpio_init(&gate_out_2);
gate_out_1.Init(B5, GPIO::Mode::OUTPUT);
gate_out_2.Init(B6, GPIO::Mode::OUTPUT);

/** DAC init */
pimpl_->InitDac();
Expand Down Expand Up @@ -400,7 +390,7 @@ namespace patch_sm

void DaisyPatchSM::SetLed(bool state)
{
dsy_gpio_write(&user_led, state);
user_led.Write(state);
}

bool DaisyPatchSM::ValidateSDRAM()
Expand Down
4 changes: 2 additions & 2 deletions src/daisy_patch_sm.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,10 @@ namespace patch_sm
DacHandle dac;

/** Dedicated Function Pins */
dsy_gpio user_led;
GPIO user_led;
AnalogControl controls[ADC_LAST];
GateIn gate_in_1, gate_in_2;
dsy_gpio gate_out_1, gate_out_2;
GPIO gate_out_1, gate_out_2;

class Impl;

Expand Down

0 comments on commit b508d8a

Please sign in to comment.