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:
Thu Dec 17 18:13:13 2015 +0000
Revision:
2:a270bdb62fc8
Child:
5:8626c6a14ef3
+ Implementation completed.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Davidroid 2:a270bdb62fc8 1 /**
Davidroid 2:a270bdb62fc8 2 ******************************************************************************
Davidroid 2:a270bdb62fc8 3 * @file Component_class.h
Davidroid 2:a270bdb62fc8 4 * @author Davide Aliprandi, STMicrolectronics
Davidroid 2:a270bdb62fc8 5 * @version V1.0.0
Davidroid 2:a270bdb62fc8 6 * @date April 13th, 2015
Davidroid 2:a270bdb62fc8 7 * @brief This file contains the abstract class describing the interface of a
Davidroid 2:a270bdb62fc8 8 * generic component.
Davidroid 2:a270bdb62fc8 9 ******************************************************************************
Davidroid 2:a270bdb62fc8 10 * @attention
Davidroid 2:a270bdb62fc8 11 *
Davidroid 2:a270bdb62fc8 12 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
Davidroid 2:a270bdb62fc8 13 *
Davidroid 2:a270bdb62fc8 14 * Redistribution and use in source and binary forms, with or without modification,
Davidroid 2:a270bdb62fc8 15 * are permitted provided that the following conditions are met:
Davidroid 2:a270bdb62fc8 16 * 1. Redistributions of source code must retain the above copyright notice,
Davidroid 2:a270bdb62fc8 17 * this list of conditions and the following disclaimer.
Davidroid 2:a270bdb62fc8 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
Davidroid 2:a270bdb62fc8 19 * this list of conditions and the following disclaimer in the documentation
Davidroid 2:a270bdb62fc8 20 * and/or other materials provided with the distribution.
Davidroid 2:a270bdb62fc8 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Davidroid 2:a270bdb62fc8 22 * may be used to endorse or promote products derived from this software
Davidroid 2:a270bdb62fc8 23 * without specific prior written permission.
Davidroid 2:a270bdb62fc8 24 *
Davidroid 2:a270bdb62fc8 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Davidroid 2:a270bdb62fc8 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Davidroid 2:a270bdb62fc8 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Davidroid 2:a270bdb62fc8 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Davidroid 2:a270bdb62fc8 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Davidroid 2:a270bdb62fc8 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Davidroid 2:a270bdb62fc8 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Davidroid 2:a270bdb62fc8 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Davidroid 2:a270bdb62fc8 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Davidroid 2:a270bdb62fc8 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Davidroid 2:a270bdb62fc8 35 *
Davidroid 2:a270bdb62fc8 36 ******************************************************************************
Davidroid 2:a270bdb62fc8 37 */
Davidroid 2:a270bdb62fc8 38
Davidroid 2:a270bdb62fc8 39
Davidroid 2:a270bdb62fc8 40 /* Define to prevent from recursive inclusion --------------------------------*/
Davidroid 2:a270bdb62fc8 41
Davidroid 2:a270bdb62fc8 42 #ifndef __COMPONENT_CLASS_H
Davidroid 2:a270bdb62fc8 43 #define __COMPONENT_CLASS_H
Davidroid 2:a270bdb62fc8 44
Davidroid 2:a270bdb62fc8 45
Davidroid 2:a270bdb62fc8 46 /* Includes ------------------------------------------------------------------*/
Davidroid 2:a270bdb62fc8 47
Davidroid 2:a270bdb62fc8 48 #include <stdint.h>
Davidroid 2:a270bdb62fc8 49
Davidroid 2:a270bdb62fc8 50
Davidroid 2:a270bdb62fc8 51 /* Classes ------------------------------------------------------------------*/
Davidroid 2:a270bdb62fc8 52
Davidroid 2:a270bdb62fc8 53 /** An abstract class for Generic components.
Davidroid 2:a270bdb62fc8 54 */
Davidroid 2:a270bdb62fc8 55 class Component
Davidroid 2:a270bdb62fc8 56 {
Davidroid 2:a270bdb62fc8 57 public:
Davidroid 2:a270bdb62fc8 58 /**
Davidroid 2:a270bdb62fc8 59 * @brief Initializing the component.
Davidroid 2:a270bdb62fc8 60 * @param init Pointer to device specific initalization structure.
Davidroid 2:a270bdb62fc8 61 * @retval "0" in case of success, an error code otherwise.
Davidroid 2:a270bdb62fc8 62 */
Davidroid 2:a270bdb62fc8 63 virtual int Init(void *init) = 0;
Davidroid 2:a270bdb62fc8 64
Davidroid 2:a270bdb62fc8 65 /**
Davidroid 2:a270bdb62fc8 66 * @brief Getting the ID of the component.
Davidroid 2:a270bdb62fc8 67 * @param id Pointer to an allocated variable to store the ID into.
Davidroid 2:a270bdb62fc8 68 * @retval "0" in case of success, an error code otherwise.
Davidroid 2:a270bdb62fc8 69 */
Davidroid 2:a270bdb62fc8 70 virtual int ReadID(uint8_t *id) = 0;
Davidroid 2:a270bdb62fc8 71 };
Davidroid 2:a270bdb62fc8 72
Davidroid 2:a270bdb62fc8 73 #endif /* __COMPONENT_CLASS_H */
Davidroid 2:a270bdb62fc8 74
Davidroid 2:a270bdb62fc8 75 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/