Revision bbeeceaf source/TLC5947/v1/alld_TLC5947_v1.c

View differences:

source/TLC5947/v1/alld_TLC5947_v1.c
62 62
{
63 63
  apalDbgAssert(tlc5947 != NULL);
64 64

  
65
  // set the output value of the GPIO pin depending on the activation property
66
  return apalControlGpioSet(tlc5947->blank_gpio, blank == TLC5947_LLD_BLANK_ENABLE ? APAL_GPIO_ON : APAL_GPIO_OFF);
65
  // BLANK signal is optional
66
  if (tlc5947->blank_gpio == NULL) {
67
    return APAL_STATUS_WARNING;
68
  } else {
69
    // set the output value of the GPIO pin depending on the activation property
70
    return apalControlGpioSet(tlc5947->blank_gpio, blank == TLC5947_LLD_BLANK_ENABLE ? APAL_GPIO_ON : APAL_GPIO_OFF);
71
  }
67 72
}
68 73

  
69 74
/**
......
77 82
  apalDbgAssert(tlc5947 != NULL);
78 83
  apalDbgAssert(blank != NULL);
79 84

  
80
  apalControlGpioState_t gpio_state;
81
  apalExitStatus_t status = apalControlGpioGet(tlc5947->blank_gpio, &gpio_state);
82
  *blank = gpio_state == APAL_GPIO_ON ? TLC5947_LLD_BLANK_ENABLE : TLC5947_LLD_BLANK_DISABLE;
83
  return status;
85
  // BLANK signal is optional
86
  if (tlc5947->blank_gpio == NULL) {
87
    return APAL_STATUS_WARNING;
88
  } else {
89
    apalControlGpioState_t gpio_state;
90
    apalExitStatus_t status = apalControlGpioGet(tlc5947->blank_gpio, &gpio_state);
91
    *blank = gpio_state == APAL_GPIO_ON ? TLC5947_LLD_BLANK_ENABLE : TLC5947_LLD_BLANK_DISABLE;
92
    return status;
93
  }
84 94
}
85 95

  
86 96
/**
......
93 103
{
94 104
  apalDbgAssert(tlc5947 != NULL);
95 105

  
96
  apalExitStatus_t status = apalControlGpioSet(tlc5947->xlat_gpio, APAL_GPIO_ON);
97
  // The XLAT signal has to be active for at least 30 ns.
98
  // It is assumed that that these function calls satisfy this requirement even without explicit delay.
99
  if (apalControlGpioSet(tlc5947->xlat_gpio, APAL_GPIO_OFF) == APAL_STATUS_OK && status == APAL_STATUS_OK) {
100
    return APAL_STATUS_OK;
106
  // XLAT signal GPIO is optional
107
  if (tlc5947->xlat_gpio == NULL) {
108
    return APAL_STATUS_WARNING;
101 109
  } else {
102
    return APAL_STATUS_ERROR;
110
    apalExitStatus_t status = apalGpioWrite(tlc5947->xlat_gpio->gpio, (tlc5947->xlat_gpio->meta.edge == APAL_GPIO_EDGE_RISING) ? APAL_GPIO_LOW : APAL_GPIO_HIGH);
111
    // The XLAT signal has to be active for at least 30 ns.
112
    // It is assumed that that these function calls satisfy this requirement even without explicit delay.
113
    status |= apalGpioWrite(tlc5947->xlat_gpio->gpio, (tlc5947->xlat_gpio->meta.edge == APAL_GPIO_EDGE_RISING) ? APAL_GPIO_HIGH : APAL_GPIO_LOW);
114
    return status;
103 115
  }
104 116
}
105 117

  

Also available in: Unified diff