/**
******************************************************************************
* @file upp_io.h
* @brief Входы/выходы УПП
******************************************************************************
* @details
******************************************************************************/

#ifndef _UPP_ERRORS_H
#define _UPP_ERRORS_H
#include "mylibs_include.h"

typedef struct
{  
  /* Отладочные светодиоды */
  GPIO_LEDTypeDef green1;
  GPIO_LEDTypeDef green2;
  GPIO_LEDTypeDef red;
}UPP_LEDs_t;
extern UPP_LEDs_t UPP_LEDS;

typedef struct
{
  GPIO_SwitchTypeDef in1;
  GPIO_SwitchTypeDef in2;
  GPIO_SwitchTypeDef in3;  
  
  GPIO_SwitchTypeDef err_24V;
  GPIO_SwitchTypeDef err_5Vd;
  GPIO_SwitchTypeDef err_5Vsi;
}UPP_DiscreteInputs_t;
extern UPP_DiscreteInputs_t UPP_DIN;

typedef struct
{
  void (*CEN)(int state);
  
  void (*RDO_Error)(int state);
  void (*RDO_Work)(int state);
  void (*RDO_Ready)(int state);
  void (*RDO4_Reserved)(int state);
  
  
  void (*DO1_Reserved)(int state);
  void (*DO2_Reserved)(int state);
  void (*DO3_Reserved)(int state);
  void (*DO4_Reserved)(int state);
  void (*DO5_Reserved)(int state);
}UPP_DiscreteOutputs_t;
extern UPP_DiscreteOutputs_t UPP_DO;
#endif //_UPP_ERRORS_H