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

📄 lh7a404_csc_driver.h

📁 在sharp 404开发板的串口测试代码
💻 H
字号:
/***********************************************************************
 * $Workfile:   lh7a404_csc_driver.h  $
 * $Revision:   1.1  $
 * $Author:   KovitzP  $
 * $Date:   Mar 15 2004 11:02:50  $
 *
 * Project: LH7A404 CSC driver
 *
 * Description:
 *     This file contains driver support for the CSC module on the
 *     LH7A404
 *
 * Revision History:
 * $Log:   //smaicnt2/pvcs/VM/sharpmcu/archives/sharpmcu/software/csps/lh7a404/include/lh7a404_csc_driver.h-arc  $
 * 
 *    Rev 1.1   Mar 15 2004 11:02:50   KovitzP
 * Added function declaration headers for getting the CPU clock, 
 * the FCLK, and the PCLK.
 * 
 *    Rev 1.0   Jul 01 2003 10:58:00   WellsK
 * Initial revision.
 * 
 *
 ***********************************************************************
 * SHARP MICROELECTRONICS OF THE AMERICAS MAKES NO REPRESENTATION
 * OR WARRANTIES WITH RESPECT TO THE PERFORMANCE OF THIS SOFTWARE,
 * AND SPECIFICALLY DISCLAIMS ANY RESPONSIBILITY FOR ANY DAMAGES, 
 * SPECIAL OR CONSEQUENTIAL, CONNECTED WITH THE USE OF THIS SOFTWARE.
 *
 * SHARP MICROELECTRONICS OF THE AMERICAS PROVIDES THIS SOFTWARE SOLELY 
 * FOR THE PURPOSE OF SOFTWARE DEVELOPMENT INCORPORATING THE USE OF A 
 * SHARP MICROCONTROLLER OR SYSTEM-ON-CHIP PRODUCT. USE OF THIS SOURCE
 * FILE IMPLIES ACCEPTANCE OF THESE CONDITIONS.
 *
 * COPYRIGHT (C) 2001 SHARP MICROELECTRONICS OF THE AMERICAS, INC.
 *     CAMAS, WA
 **********************************************************************/

#ifndef LH7A404_CSC_DRIVER_H
#define LH7A404_CSC_DRIVER_H

#ifdef __cplusplus
extern "C" {
#endif

#include "lh7a404_csc.h"

/***********************************************************************
 * CSC driver enumerations
 **********************************************************************/

/* CSC low power states */
typedef enum {STANDBY, HALT} CSC_POWER_T;

/* CSC interrupt clear request enumerations */
typedef enum {BATTLOWINT, MEDCHGINT, TICKINT} CSC_INT_CLEAR_T;

/* CSC status request enumerations */
typedef enum {
    RTCDIV,
    MEDIACHG,
    DCDETECT,
    WAKEUPDIR,
    WAKEUPON,
    NEWBATT,
    USERRESET,
    POWERFAIL,
    COLDSTART,
    PLL2LOCK,
    WDTFLAG,
    CHIPID,
    CHIPMAN
} CSC_STATUS_T;

/* Possible CSC clock types for frequency query */
typedef enum {CPUCLK, AHBCLK, APBCLK} CSC_CLOCK_T;

/* CSC DMA channel types */
typedef enum
{
   DMA_M2P_CH1 = 0,
   DMA_M2P_CH0,
   DMA_M2P_CH3,
   DMA_M2P_CH2,
   DMA_M2P_CH5,
   DMA_M2P_CH4,
   DMA_M2P_CH7,
   DMA_M2P_CH6,
   DMA_M2P_CH9,
   DMA_M2P_CH8,
   DMA_M2M_CH1,
   DMA_M2M_CH0
} CSC_DMA_CHANNEL_T;

/* CSC USB reset enumeration type */
typedef enum {
    USB_IO = CSC_USBRESET_IO,
    USB_CONTROL = CSC_USBRESET_CONTROL} CSC_USB_RESET_T;
  
/***********************************************************************
 * CSC driver functions
 **********************************************************************/
/* Return the current HCLK settings */
UNS_32 csc_get_hclk(void);

/* Return the current CPU CLOCK settings */
UNS_32 csc_get_cpuclk(void);

/* Return the current PCLK settings */
UNS_32 csc_get_pclk(void);

/* Enter the chip low power state */
void csc_enter_low_power_state(CSC_POWER_T state);

/* Clear a CSC interrupt */
void csc_clear_interrupt(CSC_INT_CLEAR_T interrupts);

/* Clear misc CSC status bits */
void csc_clear_misc_status(void);

/* Return a status value from the PWRSR register in the CSC */
INT_32 csc_get_status(CSC_STATUS_T status);

/* Get CPU, AHB Bus, or APB bus clock speed */
UNS_32 csc_get_clock(CSC_CLOCK_T clock);

/* Set the CSC CLKSET register */
void csc_clock_set(UNS_32 clkset_register_setting);

/* Enable or disable the wakeup signal */
void csc_stby_wakeup_enable(BOOL_32 enable);

/* Set the PGMCLK divisor (> 1) or disable it (= 0) */
void csc_set_pgmclk_divisor(UNS_8 div);

/* Enable or disable a DMA controller channel clock */
void csc_enable_dma_clock(CSC_DMA_CHANNEL_T channel, BOOL_32 enable);

/* Issue a USB IO or control reset */
void csc_usb_reset(CSC_USB_RESET_T reset);

/***********************************************************************
 * The csc_compute_divide is a convienence function and not really part
 * of the CSC driver. So many functions base their clocks of a divided
 * value of a CSC derived clock that this function is really useful as
 * part of this driver.
 **********************************************************************/

/* Compute the closest divider to the passed input frequency and desired
   target frequency */
INT_32 csc_compute_divider(UNS_32 input_freq,
                           UNS_32 desired_freq);

#ifdef __cplusplus
}
#endif

#endif /* LH7A404_CSC_DRIVER_H */

⌨️ 快捷键说明

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