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 10 15:32:20 2015 +0000
Revision:
0:4a3d02667d9f
Child:
1:eab47c592e8f
Library to handle the X-NUCLEO-LED61A1 LED Control Expansion Board based on the LED6001 component.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Davidroid 0:4a3d02667d9f 1 /**
Davidroid 0:4a3d02667d9f 2 ******************************************************************************
Davidroid 0:4a3d02667d9f 3 * @file led6001_class.cpp
Davidroid 0:4a3d02667d9f 4 * @author CL
Davidroid 0:4a3d02667d9f 5 * @version V1.0.0
Davidroid 0:4a3d02667d9f 6 * @date 30-Sep-2015
Davidroid 0:4a3d02667d9f 7 * @brief This file contains implementation of the LED6001's firmware driver.
Davidroid 0:4a3d02667d9f 8 ******************************************************************************
Davidroid 0:4a3d02667d9f 9 * @attention
Davidroid 0:4a3d02667d9f 10 *
Davidroid 0:4a3d02667d9f 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
Davidroid 0:4a3d02667d9f 12 *
Davidroid 0:4a3d02667d9f 13 * Redistribution and use in source and binary forms, with or without modification,
Davidroid 0:4a3d02667d9f 14 * are permitted provided that the following conditions are met:
Davidroid 0:4a3d02667d9f 15 * 1. Redistributions of source code must retain the above copyright notice,
Davidroid 0:4a3d02667d9f 16 * this list of conditions and the following disclaimer.
Davidroid 0:4a3d02667d9f 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Davidroid 0:4a3d02667d9f 18 * this list of conditions and the following disclaimer in the documentation
Davidroid 0:4a3d02667d9f 19 * and/or other materials provided with the distribution.
Davidroid 0:4a3d02667d9f 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Davidroid 0:4a3d02667d9f 21 * may be used to endorse or promote products derived from this software
Davidroid 0:4a3d02667d9f 22 * without specific prior written permission.
Davidroid 0:4a3d02667d9f 23 *
Davidroid 0:4a3d02667d9f 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Davidroid 0:4a3d02667d9f 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Davidroid 0:4a3d02667d9f 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Davidroid 0:4a3d02667d9f 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Davidroid 0:4a3d02667d9f 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Davidroid 0:4a3d02667d9f 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Davidroid 0:4a3d02667d9f 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Davidroid 0:4a3d02667d9f 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Davidroid 0:4a3d02667d9f 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Davidroid 0:4a3d02667d9f 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Davidroid 0:4a3d02667d9f 34 *
Davidroid 0:4a3d02667d9f 35 ******************************************************************************
Davidroid 0:4a3d02667d9f 36 */
Davidroid 0:4a3d02667d9f 37
Davidroid 0:4a3d02667d9f 38
Davidroid 0:4a3d02667d9f 39 /* Generated with Stm32CubeTOO -----------------------------------------------*/
Davidroid 0:4a3d02667d9f 40
Davidroid 0:4a3d02667d9f 41
Davidroid 0:4a3d02667d9f 42 /* Revision ------------------------------------------------------------------*/
Davidroid 0:4a3d02667d9f 43 /*
Davidroid 0:4a3d02667d9f 44 Repository: http://svn.x-nucleodev.codex.cro.st.com/svnroot/X-NucleoDev
Davidroid 0:4a3d02667d9f 45 Branch/Trunk/Tag: trunk
Davidroid 0:4a3d02667d9f 46 Based on: X-CUBE-LED1/trunk/Drivers/BSP/Components/led6001/led6001.c
Davidroid 0:4a3d02667d9f 47 Revision: 0
Davidroid 0:4a3d02667d9f 48 */
Davidroid 0:4a3d02667d9f 49
Davidroid 0:4a3d02667d9f 50
Davidroid 0:4a3d02667d9f 51 /* Includes ------------------------------------------------------------------*/
Davidroid 0:4a3d02667d9f 52
Davidroid 0:4a3d02667d9f 53 #include "led6001_class.h"
Davidroid 0:4a3d02667d9f 54 #include "led6001.h"
Davidroid 0:4a3d02667d9f 55
Davidroid 0:4a3d02667d9f 56
Davidroid 0:4a3d02667d9f 57 /* Methods -------------------------------------------------------------------*/
Davidroid 0:4a3d02667d9f 58
Davidroid 0:4a3d02667d9f 59 /**
Davidroid 0:4a3d02667d9f 60 * @brief Initializing the component.
Davidroid 0:4a3d02667d9f 61 * @param init Configuration settings for the LED6001 component.
Davidroid 0:4a3d02667d9f 62 * @retval COMPONENT_OK in case of success, an error code otherwise.
Davidroid 0:4a3d02667d9f 63 */
Davidroid 0:4a3d02667d9f 64 LED_StatusTypeDef LED6001::LED6001_Init(LED_InitTypeDef *init)
Davidroid 0:4a3d02667d9f 65 {
Davidroid 0:4a3d02667d9f 66 /* Configure the low level interface */
Davidroid 0:4a3d02667d9f 67 if(LED6001_IO_Init() != COMPONENT_OK)
Davidroid 0:4a3d02667d9f 68 {
Davidroid 0:4a3d02667d9f 69 return COMPONENT_ERROR;
Davidroid 0:4a3d02667d9f 70 }
Davidroid 0:4a3d02667d9f 71
Davidroid 0:4a3d02667d9f 72 LED6001_IO_ITConfig();
Davidroid 0:4a3d02667d9f 73
Davidroid 0:4a3d02667d9f 74 return COMPONENT_OK;
Davidroid 0:4a3d02667d9f 75 }
Davidroid 0:4a3d02667d9f 76
Davidroid 0:4a3d02667d9f 77 /**
Davidroid 0:4a3d02667d9f 78 * @brief Deinitializing the component.
Davidroid 0:4a3d02667d9f 79 * @param None.
Davidroid 0:4a3d02667d9f 80 * @retval None.
Davidroid 0:4a3d02667d9f 81 */
Davidroid 0:4a3d02667d9f 82 void LED6001::LED6001_DeInit(void)
Davidroid 0:4a3d02667d9f 83 {
Davidroid 0:4a3d02667d9f 84 LED6001_IO_DeInit();
Davidroid 0:4a3d02667d9f 85 }
Davidroid 0:4a3d02667d9f 86
Davidroid 0:4a3d02667d9f 87 /**
Davidroid 0:4a3d02667d9f 88 * @brief Setting PWM dim value.
Davidroid 0:4a3d02667d9f 89 * @param value PWM dim value.
Davidroid 0:4a3d02667d9f 90 * @retval None.
Davidroid 0:4a3d02667d9f 91 */
Davidroid 0:4a3d02667d9f 92 void LED6001::LED6001_SetPwmDim(uint8_t value)
Davidroid 0:4a3d02667d9f 93 {
Davidroid 0:4a3d02667d9f 94 LED6001_SetPdimTimer(value);
Davidroid 0:4a3d02667d9f 95 }
Davidroid 0:4a3d02667d9f 96
Davidroid 0:4a3d02667d9f 97 /**
Davidroid 0:4a3d02667d9f 98 * @brief Setting analog dim value.
Davidroid 0:4a3d02667d9f 99 * @param value Analog dim value.
Davidroid 0:4a3d02667d9f 100 * @retval None.
Davidroid 0:4a3d02667d9f 101 */
Davidroid 0:4a3d02667d9f 102 void LED6001::LED6001_SetAnaDim(uint8_t value)
Davidroid 0:4a3d02667d9f 103 {
Davidroid 0:4a3d02667d9f 104 LED6001_SetAdimTimer(value);
Davidroid 0:4a3d02667d9f 105 }
Davidroid 0:4a3d02667d9f 106
Davidroid 0:4a3d02667d9f 107 /**
Davidroid 0:4a3d02667d9f 108 * @brief Returning fault status of the component.
Davidroid 0:4a3d02667d9f 109 * @param None.
Davidroid 0:4a3d02667d9f 110 * @retval Fault status.
Davidroid 0:4a3d02667d9f 111 */
Davidroid 0:4a3d02667d9f 112 LED_StatusTypeDef LED6001::LED6001_FaultStatus(void)
Davidroid 0:4a3d02667d9f 113 {
Davidroid 0:4a3d02667d9f 114 return COMPONENT_OK;
Davidroid 0:4a3d02667d9f 115 }
Davidroid 0:4a3d02667d9f 116
Davidroid 0:4a3d02667d9f 117 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/