ioc.cpp 432 B

123456789101112131415161718192021222324
  1. #include "ioc.h"
  2. InterruptIn IO_nFault(PA_3);
  3. DigitalOut IO_HvEn(PA_2);
  4. DigitalOut IO_LED(PB_6);
  5. AnalogIn IO_Imon(PA_0);
  6. AnalogIn IO_Vout(PA_1);
  7. void InterruptFault(void) {
  8. IO_LED.write(1);
  9. while(1);
  10. }
  11. void IO_Init(void) {
  12. IO_nFault.fall(&InterruptFault);
  13. }
  14. void HV_EnableOutput(bool Enable) {
  15. IO_HvEn.write(Enable);
  16. }
  17. void LED_SetOutput(bool Value) {
  18. IO_LED.write(Value);
  19. }