Browse Source

tec: fix wrong SHDN pins

master
Astro 3 years ago
parent
commit
13771bf770
  1. 8
      firmware/src/board/gpio.rs
  2. 10
      firmware/src/tec.rs

8
firmware/src/board/gpio.rs

@ -72,7 +72,7 @@ pub struct PE4;
def_gpio!(GPIO_PORTE_AHB, PE4, 4);
pub struct PE5;
def_gpio!(GPIO_PORTE_AHB, PE5, 5);
pub struct PP4;
def_gpio!(GPIO_PORTP, PP4, 4);
pub struct PP5;
def_gpio!(GPIO_PORTP, PP5, 5);
pub struct PP2;
def_gpio!(GPIO_PORTP, PP2, 2);
pub struct PP3;
def_gpio!(GPIO_PORTP, PP3, 3);

10
firmware/src/tec.rs

@ -1,6 +1,6 @@
use core::fmt;
use crate::board::pwm::{self, PwmChannel, PwmPeripheral};
use crate::board::gpio::{Gpio, GpioOutput, PP4, PP5};
use crate::board::gpio::{Gpio, GpioOutput, PP2, PP3};
use embedded_hal::digital::v2::OutputPin;
#[derive(Clone, Copy, Debug)]
@ -56,20 +56,20 @@ pub struct Tec<MaxIPos: PwmChannel, MaxINeg: PwmChannel, ISet: PwmChannel, MaxV:
shdn: SHDN,
}
impl Tec<pwm::T2CCP0, pwm::T2CCP1, pwm::T3CCP0, pwm::T3CCP1, GpioOutput<PP4>> {
impl Tec<pwm::T2CCP0, pwm::T2CCP1, pwm::T3CCP0, pwm::T3CCP1, GpioOutput<PP2>> {
pub fn tec0() -> Self {
let (max_i_pos, max_i_neg) = tm4c129x::TIMER2::split();
let (i_set, max_v) = tm4c129x::TIMER3::split();
let shdn = setup_shdn(PP4);
let shdn = setup_shdn(PP2);
Tec { max_i_pos, max_i_neg, i_set, max_v, shdn }
}
}
impl Tec<pwm::T4CCP0, pwm::T4CCP1, pwm::T5CCP0, pwm::T5CCP1, GpioOutput<PP5>> {
impl Tec<pwm::T4CCP0, pwm::T4CCP1, pwm::T5CCP0, pwm::T5CCP1, GpioOutput<PP3>> {
pub fn tec1() -> Self {
let (max_i_pos, max_i_neg) = tm4c129x::TIMER4::split();
let (i_set, max_v) = tm4c129x::TIMER5::split();
let shdn = setup_shdn(PP5);
let shdn = setup_shdn(PP3);
Tec { max_i_pos, max_i_neg, i_set, max_v, shdn }
}
}

Loading…
Cancel
Save