⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 led.c

📁 freescale的基于802.15.4的无线通讯例程
💻 C
字号:
/************************************************************************************
* This is the source file for LED Driver.
*
*
* (c) Copyright 2006, Freescale, Inc.  All rights reserved.
*
* Freescale Confidential Proprietary
* Digianswer Confidential
*
* No part of this document must be reproduced in any form - including copied,
* transcribed, printed or by any electronic means - without specific written
* permission from Freescale.
*
************************************************************************************/
#include "TMR_Interface.h"
#include "IoConfig.h"
#include "AppToPlatformConfig.h"
#include "LED.h"

#if (gLEDSupported_d == 1) 
/******************************************************************************
*******************************************************************************
* Public Macros
*******************************************************************************
******************************************************************************/
/*None*/

/******************************************************************************
*******************************************************************************
* Private prototypes
*******************************************************************************
******************************************************************************/
static void StartFlashFunc(uint8_t timerId);

/******************************************************************************
*******************************************************************************
* Private type definitions
*******************************************************************************
******************************************************************************/
static uint8_t mLED = 0;

/******************************************************************************
*******************************************************************************
* Private Memory Declarations
*******************************************************************************
******************************************************************************/
/* None */

/******************************************************************************
*******************************************************************************
* Public functions
*******************************************************************************
******************************************************************************/
/******************************************************************************
* This function flash a LED
*
* Interface assumptions:
* Flash specified LED. 
*
* Return value:
* None
*
* Revison history:
*   date      Author    Comments
*   ------    ------    --------
*   06.02.06   MMA       Created
******************************************************************************/
void LED_StartFlash
  (
    LED_t LEDNr /* IN: LED Number. */
  )
{
  mLED = (mLED | LEDNr);
  TMR_StartInterval(mLEDTimerID_c, mLEDInterval_c, StartFlashFunc);
}

/******************************************************************************
* This function flash the selected LED
*
* Interface assumptions:
* Flash specified LEDs
*
* Return value:
* None
*
* Revison history:
*   date      Author    Comments
*   ------    ------    --------
*   06.02.06   MMA       Created
******************************************************************************/
void StopFlashFunc
  (
  LED_t LEDNr /* IN: LED Number. */
  )
{
  mLED = (mLED & ~LEDNr);
  if(mLED == 0) {
    TMR_StopInterval(mLEDTimerID_c);
  }
}

/******************************************************************************
*******************************************************************************
* Private functions
*******************************************************************************
******************************************************************************/
/******************************************************************************
* This function flash the selected LED
*
* Interface assumptions:
* Flash specified LEDs
*
* Return value:
* None
*
* Revison history:
*   date      Author    Comments
*   ------    ------    --------
*   06.02.06   MMA       Created
******************************************************************************/
static void StartFlashFunc
  (
  uint8_t timerId /* IN: TimerID. */
  )
{
  
  (void)timerId;
  if( (mLED & LED1) == LED1) {
    Led1Toggle;
  }
  if( (mLED & LED2) == LED2) {
    Led2Toggle;
  }
  if( (mLED & LED3) == LED3) {
    Led3Toggle;
  } 
  if( (mLED & LED4) == LED4) {
    Led4Toggle;
  }
}

/******************************************************************************
*******************************************************************************
* Private Debug stuff
*******************************************************************************
******************************************************************************/
#endif /* gLEDSupported_d */
/* None */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -