mbed library for STMicroelectronics' X-NUCLEO-IKA01A1 expansion board.
Dependents: HelloWorld_IKA01A1
Fork of X_NUCLEO_IKA01A1 by
Library for STMicroelectronics' X-NUCLEO-IKA01A1 multifunctional expansion board based on operational amplifiers.
Diff: Components/tsv734/tsv734_class.h
- Revision:
- 19:af35fc938d88
- Parent:
- 17:cbdee5f7a2aa
diff -r 25dbc718084c -r af35fc938d88 Components/tsv734/tsv734_class.h --- a/Components/tsv734/tsv734_class.h Fri Apr 08 09:22:36 2016 +0000 +++ b/Components/tsv734/tsv734_class.h Mon Apr 11 05:50:58 2016 +0000 @@ -88,13 +88,13 @@ /** * @brief Constructor. */ - TSV734(PinName ledDriverPin, unsigned int ledDutyCycle_ms) : Led_driver() + TSV734(PinName ledDriverPin, double ledPeriod) : Led_driver() { led_driver_pin = ledDriverPin; - period = ledDutyCycle_ms; + period_us = ledPeriod; PwmOut ledOut(led_driver_pin); - ledOut.period_ms(period); + ledOut.period_us(period_us); } /** @@ -130,11 +130,11 @@ * @param dc duty cycle to set * @retval duty cycle in LED driver configuration */ - virtual int SetDutyCycle(float dc) + virtual double SetDutyCycle(double dc) { PwmOut ledOut(led_driver_pin); - ledOut.pulsewidth_us(period*dc); - return (int) dc; + ledOut.pulsewidth_us(period_us*dc); + return (double) dc; } @@ -197,7 +197,7 @@ /* TSV734's interrupts related functions. */ Status_t TSV734_ConfigIT(void* a); Status_t TSV734_SetDutyCycle(float dutyCycle); - unsigned int period; + double period_us; PinName led_driver_pin;