#include "TPS4H160Q1.h"
#include "SGM4591Q.h"


void TPS2HB35_SetOutput1A_OUT1(uint8_t state)
{
  static uint8_t Output1A_OUT1 = 0;
  if (Output1A_OUT1 != state)
  {
    if (state == 1)
    {
      SGM4591Q_Chip2_4_Segment1.BIT.PIN_0 = 1;
    }
    else
    {
      SGM4591Q_Chip2_4_Segment1.BIT.PIN_0 = 0;
    }
    SGM4591Q_Global_Control(SGM4591Q_Chip2_4, SGM4591Q_Segment1);

    Output1A_OUT1= state;
  }
}
void TPS2HB35_SetOutput1A_OUT2(uint8_t state)
{
  static uint8_t Output1A_OUT2 = 0;
  if (Output1A_OUT2 != state)
  {
    if (state == 1)
    {
      SGM4591Q_Chip2_4_Segment1.BIT.PIN_2 = 1;
    }
    else
    {
      SGM4591Q_Chip2_4_Segment1.BIT.PIN_2 = 0;
    }
    SGM4591Q_Global_Control(SGM4591Q_Chip2_4, SGM4591Q_Segment1);

    Output1A_OUT2 = state;
  }
}
void TPS2HB35_SetOutput1A_OUT3(uint8_t state)
{
  static uint8_t Output1A_OUT3 = 0;
  if (Output1A_OUT3 != state)
  {
    if (state == 1)
    {
      SGM4591Q_Chip2_4_Segment0.BIT.PIN_0 = 1;
    }
    else
    {
      SGM4591Q_Chip2_4_Segment0.BIT.PIN_0 = 0;
    }
    SGM4591Q_Global_Control(SGM4591Q_Chip2_4, SGM4591Q_Segment0);

    Output1A_OUT3 = state;
  }
}
void TPS2HB35_SetOutput1A_OUT4(uint8_t state)
{
  static uint8_t Output1A_OUT4 = 0;
  if (Output1A_OUT4 != state)
  {
    if (state == 1)
    {
      SGM4591Q_Chip2_4_Segment0.BIT.PIN_1 = 1;
    }
    else
    {
      SGM4591Q_Chip2_4_Segment0.BIT.PIN_1 = 0;
    }
    SGM4591Q_Global_Control(SGM4591Q_Chip2_4, SGM4591Q_Segment0);

    Output1A_OUT4 = state;
  }
}
void TPS2HB35_SetOutput1A_OUT5(uint8_t state)
{
  static uint8_t Output1A_OUT5 = 0;
  if (Output1A_OUT5 != state)
  {
    if (state == 1)
    {
      SGM4591Q_Chip2_4_Segment0.BIT.PIN_2 = 1;
    }
    else
    {
      SGM4591Q_Chip2_4_Segment0.BIT.PIN_2 = 0;
    }
    SGM4591Q_Global_Control(SGM4591Q_Chip2_4, SGM4591Q_Segment0);

    Output1A_OUT5 = state;
  }
}
void TPS2HB35_SetOutput1A_OUT6(uint8_t state)
{
  static uint8_t Output1A_OUT6 = 0;
  if (Output1A_OUT6 != state)
  {
    if (state == 1)
    {
      SGM4591Q_Chip2_4_Segment0.BIT.PIN_3 = 1;
    }
    else
    {
      SGM4591Q_Chip2_4_Segment0.BIT.PIN_3 = 0;
    }
    SGM4591Q_Global_Control(SGM4591Q_Chip2_4, SGM4591Q_Segment0);

    Output1A_OUT6 = state;
  }
}
void TPS2HB35_SetOutput1A_OUT7(uint8_t state)
{
  static uint8_t Output1A_OUT7 = 0;
  if (Output1A_OUT7 != state)
  {
    if (state == 1)
    {
      SGM4591Q_Chip2_4_Segment1.BIT.PIN_2 = 1;
    }
    else
    {
      SGM4591Q_Chip2_4_Segment1.BIT.PIN_2 = 0;
    }
    SGM4591Q_Global_Control(SGM4591Q_Chip2_4, SGM4591Q_Segment1);

    Output1A_OUT7 = state;
  }
}
void TPS2HB35_SetOutput1A_OUT8(uint8_t state)
{
  static uint8_t Output1A_OUT8 = 0;
  if (Output1A_OUT8 != state)
  {
    if (state == 1)
    {
      SGM4591Q_Chip2_4_Segment1.BIT.PIN_3 = 1;
    }
    else
    {
      SGM4591Q_Chip2_4_Segment1.BIT.PIN_3 = 0;
    }
    SGM4591Q_Global_Control(SGM4591Q_Chip2_4, SGM4591Q_Segment1);

    Output1A_OUT8 = state;
  }
}