Blame view

build3/ion/src/device/swd.cpp 513 Bytes
6663b6c9   adorian   projet complet av...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  #include "swd.h"
  #include "regs/regs.h"
  
  namespace Ion {
  namespace SWD {
  namespace Device {
  
  void init() {
    for(const GPIOPin & g : Pins) {
      g.group().MODER()->setMode(g.pin(), GPIO::MODER::Mode::AlternateFunction);
      g.group().AFR()->setAlternateFunction(g.pin(), GPIO::AFR::AlternateFunction::AF0);
    }
  }
  
  void shutdown() {
    for(const GPIOPin & g : Pins) {
      g.group().MODER()->setMode(g.pin(), GPIO::MODER::Mode::Analog);
      g.group().PUPDR()->setPull(g.pin(), GPIO::PUPDR::Pull::None);
    }
  }
  
  }
  }
  }