make amp_en OutputOpenDrain
This commit is contained in:
parent
c71ace5063
commit
6ba94f1cbb
1 changed files with 4 additions and 4 deletions
|
|
@ -31,7 +31,7 @@ use insert_coin::{CoreConfig, DacService, InsertCoin, LedService, SimplePwmCore}
|
||||||
use ch32_hal as hal;
|
use ch32_hal as hal;
|
||||||
use hal::bind_interrupts;
|
use hal::bind_interrupts;
|
||||||
use hal::delay::Delay;
|
use hal::delay::Delay;
|
||||||
use hal::gpio::{AnyPin, Input, Level, Output, Pin, Pull};
|
use hal::gpio::{AnyPin, Input, Level, Output, OutputOpenDrain, Pin, Pull};
|
||||||
use hal::time::Hertz;
|
use hal::time::Hertz;
|
||||||
use hal::timer::low_level::CountingMode;
|
use hal::timer::low_level::CountingMode;
|
||||||
use hal::timer::simple_pwm::{PwmPin, SimplePwm};
|
use hal::timer::simple_pwm::{PwmPin, SimplePwm};
|
||||||
|
|
@ -64,11 +64,11 @@ impl Usb {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Amplifier {
|
pub struct Amplifier {
|
||||||
amp_en: Output<'static>,
|
amp_en: OutputOpenDrain<'static>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Amplifier {
|
impl Amplifier {
|
||||||
pub fn new(amp_en: Output<'static>) -> Self {
|
pub fn new(amp_en: OutputOpenDrain<'static>) -> Self {
|
||||||
let mut amp = Self { amp_en };
|
let mut amp = Self { amp_en };
|
||||||
amp.disable();
|
amp.disable();
|
||||||
amp
|
amp
|
||||||
|
|
@ -312,7 +312,7 @@ fn app_main(mut p: hal::Peripherals) -> ! {
|
||||||
let extra_io_1 = p.PD0;
|
let extra_io_1 = p.PD0;
|
||||||
let extra_io_2 = p.PD3;
|
let extra_io_2 = p.PD3;
|
||||||
|
|
||||||
let mut amp_en_output = Output::new(amp_en, Level::Low, Default::default());
|
let mut amp_en_output = OutputOpenDrain::new(amp_en, Level::Low, Default::default());
|
||||||
let amp = Amplifier::new(amp_en_output);
|
let amp = Amplifier::new(amp_en_output);
|
||||||
|
|
||||||
// set up interrupts
|
// set up interrupts
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue