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

📄 ui_onboard.h

📁 Luminary Micro BLDC motor control software
💻 H
字号:
//*****************************************************************************
//
// ui_onboard.h - Prototypes for the on-board control interface.
//
// Copyright (c) 2006-2008 Luminary Micro, Inc.  All rights reserved.
// 
// Software License Agreement
// 
// Luminary Micro, Inc. (LMI) is supplying this software for use solely and
// exclusively on LMI's microcontroller products.
// 
// The software is owned by LMI and/or its suppliers, and is protected under
// applicable copyright laws.  All rights are reserved.  You may not combine
// this software with "viral" open-source software in order to form a larger
// program.  Any use in violation of the foregoing restrictions may subject
// the user to criminal sanctions under applicable laws, as well as to civil
// liability for the breach of the terms and conditions of this license.
// 
// THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED
// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
// LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
// CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
// 
// This is part of revision 716 of the BLDC motor application.
//
//*****************************************************************************

#ifndef __UI_ONBOARD_H__
#define __UI_ONBOARD_H__

//*****************************************************************************
//
//! \addtogroup ui_onboard_api
//! @{
//
//*****************************************************************************

//*****************************************************************************
//
//! This structure contains a set of variables that describe the properties of
//! a switch.
//
//*****************************************************************************
typedef struct
{
    //
    //! The bit position of this switch.
    //
    unsigned char ucBit;

    //
    //! The number of sample periods which the switch must be held in order to
    //! invoke the hold function.
    //
    unsigned long ulHoldTime;

    //
    //! A pointer to the function to be called when the switch is pressed.
    //! For switches that do not have a hold function, this is called as soon
    //! as the switch is pressed.  For switches that have a hold function, it
    //! is called when the switch is released only if it was held for less than
    //! the hold time (if held longer, this function will not be called).  If
    //! no press function is required then this can be NULL.
    //
    void (*pfnPress)(void);

    //
    //! A pointer to the function to be called when the switch is released.
    //! if no release function is required then this can be NULL.
    //
    void (*pfnRelease)(void);

    //
    //! A pointer to the function to be called when the switch is held for the
    //! hold time.  If no hold function is required then this can be NULL.
    //
    void (*pfnHold)(void);
}
tUIOnboardSwitch;

//*****************************************************************************
//
// Close the Doxygen group.
//! @}
//
//*****************************************************************************

//*****************************************************************************
//
// An array of the switches supported by this target.  This array must be
// supplied by the application.
//
//*****************************************************************************
extern const tUIOnboardSwitch g_sUISwitches[];

//*****************************************************************************
//
// The number of switches on this target.  This value must be supplied by the
// application.
//
//*****************************************************************************
extern const unsigned long g_ulUINumButtons;

//*****************************************************************************
//
// This is the count of the number of samples during which the switches have
// been pressed; it is used to distinguish a switch press from a switch
// hold.  This array must be supplied by the application.
//
//*****************************************************************************
extern unsigned long g_pulUIHoldCount[];

//*****************************************************************************
//
// Functions exported by the on-board user interface.
//
//*****************************************************************************
extern void UIOnboardSwitchDebouncer(unsigned long ulSwitches);
extern unsigned long UIOnboardPotentiometerFilter(unsigned long ulValue);
extern void UIOnboardInit(unsigned long ulSwitches,
                          unsigned long ulPotentiometer);

#endif // __UI_ONBOARD_H__

⌨️ 快捷键说明

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