Library to handle the X-NUCLEO-LED61A1 LED Control Expansion Board based on the LED6001 component.

Dependents:   LedDimming_LED61A1_mbedOS HelloWorld_LED61A1_mbedOS LedDimming_LED61A1 HelloWorld_LED61A1 ... more

Fork of X_NUCLEO_LED61A1 by ST Expansion SW Team

LED Control Library

Library to handle the X-NUCLEO-LED61A1 LED Control Expansion Board based on the LED6001 component.

Platform compatibility

  • NUCLEO boards have been tested with the default configuration provided by the HelloWorld_LED61A1 example.
  • NUCLEO-F070RB, NUCLEO-F072RB, NUCLEO-F091RC boards have been tested with the following patch:
    • to connect with a wire the NUCLEO’s D9 pin to the LED61A1’s D6 pin;
    • to initialize the pwm PinName variable with D9 rather than D6.
  • NUCLEO-F302R8 board has been tested with the following patch:
    • to connect with a wire the NUCLEO’s D7 pin to the LED61A1’s D6 pin;
    • to initialize the pwm PinName variable with D7 rather than D6.
  • LPCXpresso11U68 board has been tested with the limitation of using only the PWM Dimming, as it provides only one PWM channel, thus allowing just one between the PWM or Analog Dimming functionalities. It has been tested with the following patch:
    • to connect with a wire the LPCX’s D3 pin to the LED61A1’s D4 pin;
    • to connect with a wire the LPCX’s D4 pin to the LED61A1’s D6 pin;
    • to initialize the xfault_irq PinName variable with D3 rather than D4;
    • to initialize the pwm PinName variable with D4 rather than D6;
    • to initialize the analog PinName variable with NC rather than D5;
    • to disable the use of the user button in any application example as it is not available.
  • FRDM-K64F board has been tested with the following patch:
    • to disable the use of the user button in any application example as it is not available.
Committer:
Davidroid
Date:
Mon May 08 16:16:44 2017 +0000
Revision:
13:8cd869d64965
Parent:
12:fc2d2d3a2499
Aligned to ARM mbed coding style.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Davidroid 12:fc2d2d3a2499 1 /**
Davidroid 12:fc2d2d3a2499 2 ******************************************************************************
Davidroid 12:fc2d2d3a2499 3 * @file Led.h
Davidroid 12:fc2d2d3a2499 4 * @author AST
Davidroid 12:fc2d2d3a2499 5 * @version V1.0.0
Davidroid 12:fc2d2d3a2499 6 * @date April 13th, 2015
Davidroid 12:fc2d2d3a2499 7 * @brief This file contains the abstract class describing the interface of a
Davidroid 12:fc2d2d3a2499 8 * led component.
Davidroid 12:fc2d2d3a2499 9 ******************************************************************************
Davidroid 12:fc2d2d3a2499 10 * @attention
Davidroid 12:fc2d2d3a2499 11 *
Davidroid 12:fc2d2d3a2499 12 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
Davidroid 12:fc2d2d3a2499 13 *
Davidroid 12:fc2d2d3a2499 14 * Redistribution and use in source and binary forms, with or without modification,
Davidroid 12:fc2d2d3a2499 15 * are permitted provided that the following conditions are met:
Davidroid 12:fc2d2d3a2499 16 * 1. Redistributions of source code must retain the above copyright notice,
Davidroid 12:fc2d2d3a2499 17 * this list of conditions and the following disclaimer.
Davidroid 12:fc2d2d3a2499 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
Davidroid 12:fc2d2d3a2499 19 * this list of conditions and the following disclaimer in the documentation
Davidroid 12:fc2d2d3a2499 20 * and/or other materials provided with the distribution.
Davidroid 12:fc2d2d3a2499 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Davidroid 12:fc2d2d3a2499 22 * may be used to endorse or promote products derived from this software
Davidroid 12:fc2d2d3a2499 23 * without specific prior written permission.
Davidroid 12:fc2d2d3a2499 24 *
Davidroid 12:fc2d2d3a2499 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Davidroid 12:fc2d2d3a2499 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Davidroid 12:fc2d2d3a2499 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Davidroid 12:fc2d2d3a2499 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Davidroid 12:fc2d2d3a2499 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Davidroid 12:fc2d2d3a2499 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Davidroid 12:fc2d2d3a2499 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Davidroid 12:fc2d2d3a2499 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Davidroid 12:fc2d2d3a2499 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Davidroid 12:fc2d2d3a2499 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Davidroid 12:fc2d2d3a2499 35 *
Davidroid 12:fc2d2d3a2499 36 ******************************************************************************
Davidroid 12:fc2d2d3a2499 37 */
Davidroid 12:fc2d2d3a2499 38
Davidroid 12:fc2d2d3a2499 39
Davidroid 12:fc2d2d3a2499 40 /* Generated with STM32CubeTOO -----------------------------------------------*/
Davidroid 12:fc2d2d3a2499 41
Davidroid 12:fc2d2d3a2499 42
Davidroid 12:fc2d2d3a2499 43 /* Revision ------------------------------------------------------------------*/
Davidroid 12:fc2d2d3a2499 44 /*
Davidroid 12:fc2d2d3a2499 45 Repository: http://svn.x-nucleodev.codex.cro.st.com/svnroot/X-NucleoDev
Davidroid 12:fc2d2d3a2499 46 Branch/Trunk/Tag: trunk
Davidroid 12:fc2d2d3a2499 47 Based on: X-CUBE-LED1/trunk/Drivers/BSP/Components/Common/led.h
Davidroid 12:fc2d2d3a2499 48 Revision: 0
Davidroid 12:fc2d2d3a2499 49 */
Davidroid 12:fc2d2d3a2499 50
Davidroid 12:fc2d2d3a2499 51
Davidroid 12:fc2d2d3a2499 52 /* Define to prevent recursive inclusion -------------------------------------*/
Davidroid 12:fc2d2d3a2499 53
Davidroid 12:fc2d2d3a2499 54 #ifndef __LED_CLASS_H
Davidroid 12:fc2d2d3a2499 55 #define __LED_CLASS_H
Davidroid 12:fc2d2d3a2499 56
Davidroid 12:fc2d2d3a2499 57
Davidroid 12:fc2d2d3a2499 58 /* Includes ------------------------------------------------------------------*/
Davidroid 12:fc2d2d3a2499 59
Davidroid 12:fc2d2d3a2499 60 #include <Component.h>
Davidroid 12:fc2d2d3a2499 61
Davidroid 12:fc2d2d3a2499 62
Davidroid 12:fc2d2d3a2499 63 /* Classes ------------------------------------------------------------------*/
Davidroid 12:fc2d2d3a2499 64
Davidroid 12:fc2d2d3a2499 65 /** An abstract class for Led components.
Davidroid 12:fc2d2d3a2499 66 */
Davidroid 12:fc2d2d3a2499 67 class Led : public Component
Davidroid 12:fc2d2d3a2499 68 {
Davidroid 12:fc2d2d3a2499 69 public:
Davidroid 12:fc2d2d3a2499 70 /* ACTION 1 --------------------------------------------------------------*
Davidroid 12:fc2d2d3a2499 71 * Declare here the interface's methods. *
Davidroid 12:fc2d2d3a2499 72 * They should be: *
Davidroid 12:fc2d2d3a2499 73 * + Methods with the same name of the C component's virtual table *
Davidroid 12:fc2d2d3a2499 74 * (and extended virtual table, if any)'s functions, provided that *
Davidroid 12:fc2d2d3a2499 75 * the component's driver implements them (i.e.: the corresponding *
Davidroid 12:fc2d2d3a2499 76 * pointer to function is not "0"). *
Davidroid 12:fc2d2d3a2499 77 * *
Davidroid 12:fc2d2d3a2499 78 * Example: *
Davidroid 12:fc2d2d3a2499 79 * virtual int get_value(float *f) = 0; *
Davidroid 12:fc2d2d3a2499 80 *------------------------------------------------------------------------*/
Davidroid 12:fc2d2d3a2499 81 /**
Davidroid 12:fc2d2d3a2499 82 * @brief Getting the current flowing through the LED.
Davidroid 12:fc2d2d3a2499 83 * @param None.
Davidroid 12:fc2d2d3a2499 84 * @retval The current flowing through the LED, represented as a floating
Davidroid 12:fc2d2d3a2499 85 * point number in the range [0.0, 1.0].
Davidroid 12:fc2d2d3a2499 86 */
Davidroid 12:fc2d2d3a2499 87 virtual float get_current(void) = 0;
Davidroid 12:fc2d2d3a2499 88
Davidroid 12:fc2d2d3a2499 89 /**
Davidroid 12:fc2d2d3a2499 90 * @brief Setting PWM dimming value.
Davidroid 12:fc2d2d3a2499 91 * @param dimming PWM dimming value.
Davidroid 12:fc2d2d3a2499 92 * @retval None.
Davidroid 12:fc2d2d3a2499 93 */
Davidroid 12:fc2d2d3a2499 94 virtual void set_pwm_dimming(float dimming) = 0;
Davidroid 12:fc2d2d3a2499 95
Davidroid 12:fc2d2d3a2499 96 /**
Davidroid 12:fc2d2d3a2499 97 * @brief Setting Analog dimming value.
Davidroid 12:fc2d2d3a2499 98 * @param dimming Analog dimming value.
Davidroid 12:fc2d2d3a2499 99 * @retval None.
Davidroid 12:fc2d2d3a2499 100 */
Davidroid 12:fc2d2d3a2499 101 virtual void set_analog_dimming(float dimming) = 0;
Davidroid 12:fc2d2d3a2499 102
Davidroid 12:fc2d2d3a2499 103 /**
Davidroid 12:fc2d2d3a2499 104 * @brief Destructor.
Davidroid 12:fc2d2d3a2499 105 */
Davidroid 12:fc2d2d3a2499 106 virtual ~Led() {};
Davidroid 12:fc2d2d3a2499 107 };
Davidroid 12:fc2d2d3a2499 108
Davidroid 12:fc2d2d3a2499 109 #endif /* __LED_CLASS_H */
Davidroid 12:fc2d2d3a2499 110
Davidroid 12:fc2d2d3a2499 111 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/