2015-05-07 07:06:50 -06:00
|
|
|
/****************************************************************************
|
2019-08-13 16:08:49 +00:00
|
|
|
* boards/arm/kl/teensy-lc/src/kl_led.c
|
2015-05-07 07:06:50 -06:00
|
|
|
*
|
2021-03-17 18:14:12 +01:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
2015-05-07 07:06:50 -06:00
|
|
|
*
|
2021-03-17 18:14:12 +01:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2015-05-07 07:06:50 -06:00
|
|
|
*
|
2021-03-17 18:14:12 +01:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
2015-05-07 07:06:50 -06:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <debug.h>
|
|
|
|
|
|
|
|
#include <nuttx/board.h>
|
|
|
|
#include <arch/board/board.h>
|
|
|
|
|
|
|
|
#include "chip.h"
|
|
|
|
#include "kl_gpio.h"
|
|
|
|
#include "teensy-lc.h"
|
|
|
|
|
|
|
|
#ifdef CONFIG_ARCH_LEDS
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
2015-11-01 12:45:58 -06:00
|
|
|
* Name: kl_led_initialize
|
2015-05-07 07:06:50 -06:00
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Initialize the on-board LED
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2015-11-01 12:45:58 -06:00
|
|
|
void kl_led_initialize(void)
|
2015-05-07 07:06:50 -06:00
|
|
|
{
|
|
|
|
kl_configgpio(GPIO_LED);
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
2015-11-01 09:07:36 -06:00
|
|
|
* Name: board_autoled_on
|
2015-05-07 07:06:50 -06:00
|
|
|
****************************************************************************/
|
|
|
|
|
2015-11-01 09:07:36 -06:00
|
|
|
void board_autoled_on(int led)
|
2015-05-07 07:06:50 -06:00
|
|
|
{
|
|
|
|
if (led != 0)
|
|
|
|
{
|
|
|
|
kl_gpiowrite(GPIO_LED, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
2015-11-01 09:10:08 -06:00
|
|
|
* Name: board_autoled_off
|
2015-05-07 07:06:50 -06:00
|
|
|
****************************************************************************/
|
|
|
|
|
2015-11-01 09:10:08 -06:00
|
|
|
void board_autoled_off(int led)
|
2015-05-07 07:06:50 -06:00
|
|
|
{
|
|
|
|
if (led == 3)
|
|
|
|
{
|
|
|
|
kl_gpiowrite(GPIO_LED, false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* CONFIG_ARCH_LEDS */
|