commit bbeeceaf8939b09dd7adf10995b5da3f4688c2b0
Author: Thomas Schöpping <tschoepp@cit-ec.uni-bielefeld.de>
Date:   Thu Mar 21 17:37:01 2019 +0100

    TLC5947: the BLANK and XLAT pins are nor optional per object.

diff --git a/include/TLC5947/v1/alld_TLC5947_v1.h b/include/TLC5947/v1/alld_TLC5947_v1.h
index e10b6bf..3abc577 100644
--- a/include/TLC5947/v1/alld_TLC5947_v1.h
+++ b/include/TLC5947/v1/alld_TLC5947_v1.h
@@ -48,9 +48,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define TLC5947_LLD_BLANK_ACTIVE_STATE          APAL_GPIO_ACTIVE_HIGH
 
 /**
- * @brief   Active state of the XLAT signal.
+ * @brief   Signal edge of the XLAT signal, which causes the SPI registers to be latched to the output.
  */
-#define TLC5947_LLD_XLAT_ACTIVE_STATE           APAL_GPIO_ACTIVE_HIGH
+#define TLC5947_LLD_XLAT_UPDATE_EDGE            APAL_GPIO_EDGE_RISING
 
 /**
  * @brief   Number of PWM channels.
@@ -84,8 +84,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 typedef struct {
   apalSPIDriver_t* spi_driver;    /**< @brief The SPI Driver.                           */
-  const apalControlGpio_t* blank_gpio;  /**< @brief The identifier of the BLANK signal GPIO.  */
-  const apalControlGpio_t* xlat_gpio;   /**< @brief The identifier of the XLAT signal GPIO.   */
+  const apalControlGpio_t* blank_gpio;  /**< @brief The identifier of the BLANK signal GPIO (may be @p NULL).  */
+  const apalControlGpio_t* xlat_gpio;   /**< @brief The identifier of the XLAT signal GPIO (may be @p NULL).   */
 } TLC5947Driver;
 
 /**
diff --git a/source/TLC5947/v1/alld_TLC5947_v1.c b/source/TLC5947/v1/alld_TLC5947_v1.c
index 5c113d7..bfd2690 100644
--- a/source/TLC5947/v1/alld_TLC5947_v1.c
+++ b/source/TLC5947/v1/alld_TLC5947_v1.c
@@ -62,8 +62,13 @@ apalExitStatus_t tlc5947_lld_setBlank(const TLC5947Driver* const tlc5947, const
 {
   apalDbgAssert(tlc5947 != NULL);
 
-  // set the output value of the GPIO pin depending on the activation property
-  return apalControlGpioSet(tlc5947->blank_gpio, blank == TLC5947_LLD_BLANK_ENABLE ? APAL_GPIO_ON : APAL_GPIO_OFF);
+  // BLANK signal is optional
+  if (tlc5947->blank_gpio == NULL) {
+    return APAL_STATUS_WARNING;
+  } else {
+    // set the output value of the GPIO pin depending on the activation property
+    return apalControlGpioSet(tlc5947->blank_gpio, blank == TLC5947_LLD_BLANK_ENABLE ? APAL_GPIO_ON : APAL_GPIO_OFF);
+  }
 }
 
 /**
@@ -77,10 +82,15 @@ apalExitStatus_t tlc5947_lld_getBlank(const TLC5947Driver* const tlc5947, tlc594
   apalDbgAssert(tlc5947 != NULL);
   apalDbgAssert(blank != NULL);
 
-  apalControlGpioState_t gpio_state;
-  apalExitStatus_t status = apalControlGpioGet(tlc5947->blank_gpio, &gpio_state);
-  *blank = gpio_state == APAL_GPIO_ON ? TLC5947_LLD_BLANK_ENABLE : TLC5947_LLD_BLANK_DISABLE;
-  return status;
+  // BLANK signal is optional
+  if (tlc5947->blank_gpio == NULL) {
+    return APAL_STATUS_WARNING;
+  } else {
+    apalControlGpioState_t gpio_state;
+    apalExitStatus_t status = apalControlGpioGet(tlc5947->blank_gpio, &gpio_state);
+    *blank = gpio_state == APAL_GPIO_ON ? TLC5947_LLD_BLANK_ENABLE : TLC5947_LLD_BLANK_DISABLE;
+    return status;
+  }
 }
 
 /**
@@ -93,13 +103,15 @@ apalExitStatus_t tlc5947_lld_update(const TLC5947Driver* const tlc5947)
 {
   apalDbgAssert(tlc5947 != NULL);
 
-  apalExitStatus_t status = apalControlGpioSet(tlc5947->xlat_gpio, APAL_GPIO_ON);
-  // The XLAT signal has to be active for at least 30 ns.
-  // It is assumed that that these function calls satisfy this requirement even without explicit delay.
-  if (apalControlGpioSet(tlc5947->xlat_gpio, APAL_GPIO_OFF) == APAL_STATUS_OK && status == APAL_STATUS_OK) {
-    return APAL_STATUS_OK;
+  // XLAT signal GPIO is optional
+  if (tlc5947->xlat_gpio == NULL) {
+    return APAL_STATUS_WARNING;
   } else {
-    return APAL_STATUS_ERROR;
+    apalExitStatus_t status = apalGpioWrite(tlc5947->xlat_gpio->gpio, (tlc5947->xlat_gpio->meta.edge == APAL_GPIO_EDGE_RISING) ? APAL_GPIO_LOW : APAL_GPIO_HIGH);
+    // The XLAT signal has to be active for at least 30 ns.
+    // It is assumed that that these function calls satisfy this requirement even without explicit delay.
+    status |= apalGpioWrite(tlc5947->xlat_gpio->gpio, (tlc5947->xlat_gpio->meta.edge == APAL_GPIO_EDGE_RISING) ? APAL_GPIO_HIGH : APAL_GPIO_LOW);
+    return status;
   }
 }
 
