📄 plf_intr.h
字号:
#ifndef CYGONCE_HAL_PLF_INTR_H
#define CYGONCE_HAL_PLF_INTR_H
//==========================================================================
//
// plf_intr.h
//
// EDOSK-2674R interrupt and clock support
//
//==========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//==========================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s): yoshinori sato
// Contributors: yoshinori sato, Uwe Kindler
// Date: 2003-12-06
// Purpose: Define Interrupt support
// Description: The macros defined here provide the HAL APIs for handling
// interrupts and the clock.
//
// Usage:
// #include <cyg/hal/plf_intr.h>
// ...
//
//
//####DESCRIPTIONEND####
//
//==========================================================================
//==========================================================================
// DOXYGEN FILE HEADER
/// \file plf_intr.h
/// \brief Define platform interrupt support.
/// \author yoshinori sato, Uwe Kindler
/// \date 2003-12-06
///
/// The macros defined here provide the HAL APIs for handling
/// interrupts and the clock
///
/// Usage: #include <cyg/hal/plf_intr.h>
//==========================================================================
//==========================================================================
// HARDWARE PLATFORM RESET
// DESCRIPTION:
// The reset() function defined in hal_if.c will attempt to do a
// hardware reset by calling this macro, but if this fails it will fall
// back to simply jumping to the reset entry-point
// (HAL_PLATFORM_RESET_ENTRY).
//
// NOTES:
// This is a real hardware reset by triggering the internal h8s watchdog
//==========================================================================
externC void h8s_reset_watchdog (void);
#define HAL_PLATFORM_RESET() h8s_reset_watchdog()
//==========================================================================
// MANUAL RESET
// DESCRIPTION:
// The call to this macro will execute a manual reset. This means the
// whole initialisation code starting at _start label will be
// executed again.
//
// NOTES:
// h8s_reset_manual is implemented in hal_misc.c
//==========================================================================
externC void h8s_reset_manual (void);
#define HAL_PLATFORM_RESET_ENTRY &h8s_reset_manual
//==========================================================================
// DELAY uS
//
// This is an optional definition.
/// Implements a busy loop delay for the given number of microseconds.
/// This operation should normally be used when a very short delay is
/// needed when controlling hardware, programming FLASH devices and
/// similar situations where a wait/timeout loop would otherwise be used.
/// Since it may disable interrupts, and is implemented by busy waiting,
/// it should not be used in code that is sensitive to interrupt or
/// context switch latencies. (delay_us.S)
///
/// \param usecs Number of useconds to delay program execution.
///
/// \note The macro HAL_DELAY_US() is defined to call the function
/// hal_delay_us in delay_us.S While most of the time this function is
/// called with very small values, occasionally (particularly in some
/// ethernet drivers) it is called with values of several seconds.
/// Hence the function should take care to avoid overflow in any
/// calculations.
//==========================================================================
externC void hal_delay_us(cyg_uint32 usecs);
#define HAL_DELAY_US(n) hal_delay_us(n)
//==========================================================================
// CLOCK CONTROL
// DESCRIPTION:
// These macros provide control over a clock or timer device that may
// be used by the kernel to provide time-out, delay and scheduling
// services.
//
// NOTES:
// Clock control is all handled in plf_misc.c
//==========================================================================
//--------------------------------------------------------------------------
// HAL_CLOCK_INITIALIZE() initializes the timer device to interrupt at
// the given period.
//
externC void hal_clock_initialize(cyg_uint32 period);
#define HAL_CLOCK_INITIALIZE( _period_ ) \
hal_clock_initialize( _period_ )
//--------------------------------------------------------------------------
// HAL_CLOCK_RESET() Re-initializes the timer to provoke the next interrupt.
// This macro is only really necessary when the timer device needs to
// be reset in some way after each interrupt - this is not necessary for
// h8s interrupts so we define it empty
//
#define HAL_CLOCK_RESET( _vector_, _period_ )
//--------------------------------------------------------------------------
// HAL_CLOCK_READ() reads the current value of the timer counter and puts
// the value in the location pointed to by pvalue.
//
externC void hal_clock_read(cyg_uint32 *pvalue);
#define HAL_CLOCK_READ( _pvalue_ ) \
hal_clock_read( _pvalue_ )
//--------------------------------------------------------------------------
#endif // ifndef CYGONCE_HAL_PLF_INTR_H
// End of plf_intr.h
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -