Revision c930aa01

View differences:

modules/LightRing_1-0/board.h
301 301
 * PB4  - PIN4                      (input floating)
302 302
 * PB5  - LASER_OC_N                (input floating)
303 303
 * PB6  - SYS_UART_DN               (output opendrain high 50MHz)
304
 * PB7  - PIN7                      (input foating)
304
 * PB7  - PIN7                      (input floating)
305 305
 * PB8  - WL_GDO2                   (input pullup)
306 306
 * PB9  - WL_GDO0                   (input pullup)
307 307
 * PB10 - MEM_SCL                   (alternate opendrain 50MHz)
......
352 352
 * PC1  - PIN1                      (input floating)
353 353
 * PC2  - PIN2                      (input floating)
354 354
 * PC3  - PIN3                      (input floating)
355
 * PC4  - LIGHT_XLAT                (output pushpull high 10MHz)
355
 * PC4  - LIGHT_XLAT                (output pushpull low 50MHz)
356 356
 * PC5  - PIN5                      (input floating)
357 357
 * PC6  - PIN6                      (input floating)
358 358
 * PC7  - PIN7                      (input floating)
......
370 370
                                     PIN_CR(GPIOC_PIN1, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                \
371 371
                                     PIN_CR(GPIOC_PIN2, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                \
372 372
                                     PIN_CR(GPIOC_PIN3, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                \
373
                                     PIN_CR(GPIOC_LIGHT_XLAT, PIN_MODE_OUTPUT_10M, PIN_CNF_OUTPUT_PUSHPULL) |    \
373
                                     PIN_CR(GPIOC_LIGHT_XLAT, PIN_MODE_OUTPUT_50M, PIN_CNF_OUTPUT_PUSHPULL) |    \
374 374
                                     PIN_CR(GPIOC_PIN5, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                \
375 375
                                     PIN_CR(GPIOC_PIN6, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                \
376 376
                                     PIN_CR(GPIOC_PIN7, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING))
modules/LightRing_1-0/module.c
176 176
};
177 177

  
178 178
/**
179
 * @brief   LIGHT_XLAT output signal GPIO.
180
 */
181
static apalGpio_t _gpioLightXlat = {
182
  /* line */ LINE_LIGHT_XLAT,
183
};
184
ROMCONST apalControlGpio_t moduleGpioLightXlat = {
185
  /* GPIO */ &_gpioLightXlat,
186
  /* meta */ {
187
    /* direction      */ APAL_GPIO_DIRECTION_OUTPUT,
188
    /* active state   */ (TLC5947_LLD_XLAT_UPDATE_EDGE == APAL_GPIO_EDGE_RISING) ? APAL_GPIO_ACTIVE_HIGH : APAL_GPIO_ACTIVE_LOW,
189
    /* interrupt edge */ APAL_GPIO_EDGE_NONE,
190
  },
191
};
192

  
193
/**
179 194
 * @brief   SYS_PD bidirectional signal GPIO.
180 195
 */
181 196
static apalGpio_t _gpioSysPd = {
......
244 259
TLC5947Driver moduleLldLedPwm = {
245 260
  /* SPI driver         */ &MODULE_HAL_SPI_LIGHT,
246 261
  /* BLANK signal GPIO  */ &moduleGpioLightBlank,
247
  /* XLAT signal GPIO   */ NULL,
262
  /* XLAT signal GPIO   */ &moduleGpioLightXlat,
248 263
};
249 264

  
250 265
TPS20xxBDriver moduleLldPowerSwitchLaser = {
modules/LightRing_1-0/module.h
140 140
extern ROMCONST apalControlGpio_t moduleGpioWlGdo0;
141 141

  
142 142
/**
143
 * @brief   LIGHT_XLAT output signal.
144
 */
145
extern ROMCONST apalControlGpio_t moduleGpioLightXlat;
146

  
147
/**
143 148
 * @brief   SYS_PD bidirectional signal GPIO.
144 149
 */
145 150
extern ROMCONST apalControlGpio_t moduleGpioSysPd;
......
208 213
  palEnableLineEvent(moduleGpioWlGdo2.gpio->line, APAL2CH_EDGE(moduleGpioWlGdo2.meta.edge));                \
209 214
  /* WL_GDO0 */                                                               \
210 215
  palSetLineCallback(moduleGpioWlGdo0.gpio->line, aosSysGetStdIntCallback(), &moduleGpioWlGdo0.gpio->line); \
211
  palEnableLineEvent(moduleGpioWlGdo0.gpio->line, APAL2CH_EDGE(moduleGpioWlGdo0.meta.edge));                \
216
  /*palEnableLineEvent(moduleGpioWlGdo0.gpio->line, APAL2CH_EDGE(moduleGpioWlGdo0.meta.edge)); // this is broken for some reason*/  \
212 217
}
213 218

  
214 219
/**
modules/LightRing_1-2/module.c
303 303
};
304 304

  
305 305
/**
306
 * @brief   LIGHT_XLAT output signal GPIO.
307
 */
308
static apalGpio_t _gpioLightXlat = {
309
  /* line */ LINE_LIGHT_XLAT,
310
};
311
ROMCONST apalControlGpio_t moduleGpioLightXlat = {
312
  /* GPIO */ &_gpioLightXlat,
313
  /* meta */ {
314
    /* direction      */ APAL_GPIO_DIRECTION_OUTPUT,
315
    /* active state   */ (TLC5947_LLD_XLAT_UPDATE_EDGE == APAL_GPIO_EDGE_RISING) ? APAL_GPIO_ACTIVE_HIGH : APAL_GPIO_ACTIVE_LOW,
316
    /* interrupt edge */ APAL_GPIO_EDGE_NONE,
317
  },
318
};
319

  
320
/**
306 321
 * @brief   SW_V18_EN output signal GPIO.
307 322
 */
308 323
static apalGpio_t _gpioSwV18En = {
......
447 462
TLC5947Driver moduleLldLedPwm = {
448 463
  /* SPI driver         */ &MODULE_HAL_SPI_LIGHT,
449 464
  /* BLANK signal GPIO  */ &moduleGpioLightBlank,
450
  /* XLAT signal GPIO   */ NULL,
465
  /* XLAT signal GPIO   */ &moduleGpioLightXlat,
451 466
};
452 467

  
453 468
/** @} */
modules/LightRing_1-2/module.h
185 185
extern ROMCONST apalControlGpio_t moduleGpioLed;
186 186

  
187 187
/**
188
 * @brief   LIGHT_XLAT output signal.
189
 */
190
extern ROMCONST apalControlGpio_t moduleGpioLightXlat;
191

  
192
/**
188 193
 * @brief   SW_V18_EN output signal GPIO.
189 194
 */
190 195
extern ROMCONST apalControlGpio_t moduleGpioSwV18En;
unittests/periphery-lld/src/ut_alld_TLC5947_v1.c
61 61

  
62 62
  // local variables
63 63
  aos_utresult_t result = {0, 0};
64
  uint32_t status = 0;
64
  int32_t status = 0;
65 65
  tlc5947_lld_blank_t blank;
66 66
  tlc5947_lld_buffer_t buffer;
67 67

  
......
150 150
      tlc5947_lld_setBuffer(&buffer, channel, value);
151 151
      status |= tlc5947_lld_write((TLC5947Driver*)ut->data, &buffer);
152 152
      status |= tlc5947_lld_update((TLC5947Driver*)ut->data);
153
      aosThdSleep(1.0f / 3.0f);
153
      aosThdSleep(10.0f / TLC5947_LLD_NUM_CHANNELS / 3.0f);
154 154
      tlc5947_lld_setBuffer(&buffer, channel, 0);
155 155
    }
156 156
  }
......
162 162

  
163 163
  chprintf(stream, "setting one color after another...\n");
164 164
  status = APAL_STATUS_OK;
165
  for (int8_t color = 0; color < 3; ++color) {
165
  for (uint8_t color = 0; color < 3; ++color) {
166 166
    for (uint8_t channel = color; channel < TLC5947_LLD_NUM_CHANNELS; channel += 3) {
167 167
      const uint16_t val = 0xAF5u; // some deterministic value with high entropy
168 168
      tlc5947_lld_setBuffer(&buffer, channel, val);
169 169
      status |= tlc5947_lld_write((TLC5947Driver*)ut->data, &buffer);
170 170
      status |= tlc5947_lld_update((TLC5947Driver*)ut->data);
171
      status |= (tlc5947_lld_getBuffer(&buffer, channel) != val) ? (1 << 31) : 0;
171
      status |= (tlc5947_lld_getBuffer(&buffer, channel) != val) ? ((int32_t)1 << 30) : 0;
172 172
      if (status != APAL_STATUS_OK) {
173 173
        break;
174 174
      } else {
175
        aosThdSleep(1.0f / 8.0f);
175
        aosThdSleep(10.0f / TLC5947_LLD_NUM_CHANNELS / 3.0f);
176 176
      }
177 177
    }
178 178
    for (uint8_t channel = 0; channel < TLC5947_LLD_NUM_CHANNELS; ++channel) {

Also available in: Unified diff