?? des_mc35xs3400.h
字號:
/*******************************************************************************/
/**
Copyright (c) 2007 Freescale Semiconductor
\file des_MC35XS3400.h
\brief Register definitions and function prototypes for high side switch \n
MC35XS3400
\author Freescale Semiconductor
\author B05114
\version 0.1
\date May/2007
*/
/*******************************************************************************/
#ifndef _DES_MC35XS3400_H /* Prevent duplicated includes */
#define _DES_MC35XS3400_H
/** Variable types and common definitions */
#include "typedefs.h"
/* MC35XS3400 default configuration */
#define XS35_PWMR_0_INIT XS_OFF|0x7F
#define XS35_PWMR_1_INIT XS_OFF|0x7F
#define XS35_PWMR_2_INIT XS_OFF|0x7F
#define XS35_PWMR_3_INIT XS_OFF|0x7F
#define XS35_CONFR0_0_INIT XS_DIR_DIS|XS_SLEW_LOW|XS_NO_DELAY
#define XS35_CONFR0_1_INIT XS_DIR_DIS|XS_SLEW_LOW|XS_NO_DELAY
#define XS35_CONFR0_2_INIT XS_DIR_DIS|XS_SLEW_LOW|XS_NO_DELAY
#define XS35_CONFR0_3_INIT XS_DIR_DIS|XS_SLEW_LOW|XS_NO_DELAY
#define XS35_CONFR1_0_INIT XS_RETRY_DIS|XS_OS_DIS|XS_OLON_EN|XS_OLOFF_DIS|XS_OLLED_DIS|XS_CSNS_LOW
#define XS35_CONFR1_1_INIT XS_RETRY_DIS|XS_OS_DIS|XS_OLON_EN|XS_OLOFF_DIS|XS_OLLED_DIS|XS_CSNS_LOW
#define XS35_CONFR1_2_INIT XS_RETRY_DIS|XS_OS_DIS|XS_OLON_EN|XS_OLOFF_DIS|XS_OLLED_DIS|XS_CSNS_LOW
#define XS35_CONFR1_3_INIT XS_RETRY_DIS|XS_OS_DIS|XS_OLON_EN|XS_OLOFF_DIS|XS_OLLED_DIS|XS_CSNS_LOW
#define XS35_OCR_0_INIT XS_INRUSH_LOW|XS_OC_INRUSH_ONLY
#define XS35_OCR_1_INIT XS_INRUSH_LOW|XS_OC_INRUSH_ONLY
#define XS35_OCR_2_INIT XS_INRUSH_LOW|XS_OC_INRUSH_ONLY
#define XS35_OCR_3_INIT XS_INRUSH_LOW|XS_OC_INRUSH_ONLY
#define XS35_GCR_INIT XS_PWM_INTCLK|XS_TEMP_DIS|XS_CSNS_DIS|XS_UV_EN|XS_OV_EN
/* Operation modes */
#define XS_SLEEP 0
#define XS_NORMAL 1
/* Registers */
#define XS_STATR 0x00
#define XS_PWMR 0x04
#define XS_CONFR0 0x08
#define XS_CONFR1 0x0C
#define XS_OCR 0x10
#define XS_GCR 0x14
#define XS_CALR 0x1D
/* Channel Selection */
#define XS_HS0 0x00
#define XS_HS1 0x20
#define XS_HS2 0x40
#define XS_HS3 0x60
/* PWM Register */
#define XS_ON 0x80
#define XS_OFF 0x00
/* CONFR0 Register */
#define XS_DIR_EN 0x00
#define XS_DIR_DIS 0x20
#define XS_SLEW_MED 0x00
#define XS_SLEW_LOW 0x08
#define XS_SLEW_HIGH 0x10
#define XS_NO_DELAY 0x00
#define XS_DELAY_16 0x01
#define XS_DELAY_32 0x02
#define XS_DELAY_48 0x03
#define XS_DELAY_64 0x04
#define XS_DELAY_80 0x05
#define XS_DELAY_96 0x06
#define XS_DELAY_112 0x07
/* CONFR1 Register */
#define XS_RETRY_UNL 0x40
#define XS_RETRY_DIS 0x20
#define XS_OS_DIS 0x10
#define XS_OLON_EN 0x00
#define XS_OLON_DIS 0x08
#define XS_OLOFF_EN 0x00
#define XS_OLOFF_DIS 0x04
#define XS_OLLED_EN 0x02
#define XS_OLLED_DIS 0x00
#define XS_CSNS_LOW 0x00
#define XS_CSNS_HIGH 0x01
/* Open load selection */
#define XS_NO_LOAD XS_OLON_DIS
#define XS_LED XS_OLLED_EN
#define XS_BULB XS_OLLED_DIS
/* Overcurrent Register */
#define XS_BULB_COOL_MED 0x00
#define XS_BULB_COOL_LOW 0x40
#define XS_BULB_COOL_HIGH 0x80
#define XS_INRUSH_MED 0x00
#define XS_INRUSH_LOW 0x10
#define XS_INRUSH_HIGH 0x20
#define XS_OCH1_TO_OCH2 0x08
#define XS_STEADY_OCL1 0x00
#define XS_STEADY_OCL0 0x02
#define XS_STEADY_OCL2 0x04
#define XS_OC_INRUSH_ONLY 0x00
#define XS_OC_INRUSH_COOLING 0x01
/* Global Configuration Register */
#define XS_PWM_DISABLED 0x00
#define XS_PWM_IN0CLK 0x80
#define XS_PWM_INTCLK 0xC0
#define XS_TEMP_EN 0x20
#define XS_TEMP_DIS 0x00
#define XS_CSNS_EN 0x10
#define XS_CSNS_DIS 0x00
#define XS_CSNS_HS0 0x00
#define XS_CSNS_HS1 0x04
#define XS_CSNS_HS2 0x08
#define XS_CSNS_HS3 0x0C
#define XS_UV_EN 0x02
#define XS_OV_EN 0x01
/* SOA bits for reading through STATR */
#define XS_HS0_RD 0x00
#define XS_HS1_RD 0x08
#define XS_HS2_RD 0x10
#define XS_HS3_RD 0x18
#define XS_FLTR_RD 0x00
#define XS_PWMR_RD 0x01
#define XS_CONFR0_RD 0x02
#define XS_CONFR1_RD 0x03
#define XS_OCR_RD 0x04
#define XS_GCR_RD 0x05
#define XS_DIAGR0 0x07
#define XS_DIAGR1 0x0F
#define XS_DIAGR2 0x17
#define XS_HS0_RD 0x00
#define XS_HS1_RD 0x08
#define XS_HS2_RD 0x10
#define XS_HS3_RD 0x18
/* Fault Register flags */
#define XS_FAULT_UVF 0x80
#define XS_FAULT_OVF 0x40
#define XS_FAULT_OLON 0x20
#define XS_FAULT_OLOFF 0x10
#define XS_FAULT_OSF 0x08
#define XS_FAULT_OTF 0x04
#define XS_FAULT_SCF 0x02
#define XS_FAULT_OCF 0x01
/** Function Prototypes */
/** Write MC35XS3400 register */
void des_MC35XS3400_SendCommand(UINT8 u8XS_Command, UINT8 u8XS_Data);
/** Clear MC35XS3400 watchdog */
void des_MC35XS3400_ClrWDT(void);
/** Set MC35XS3400 operation mode */
void des_MC35XS3400_SetMode(UINT8 u8XS_Mode);
/** MC35XS3400 initial default configuration */
void des_MC35XS3400_Config(void);
/** Outputs configuration */
void des_MC35XS3400_HS_Configuration(UINT8 u8HSout, UINT8 u8Dir_control,
UINT8 u8SlewRate, UINT8 u8SwitchDelay);
/** Outputs control */
void des_MC35XS3400_HS_Control(UINT8 u8HSout, UINT8 u8HS_State, UINT8 u8HS_PWM);
/** PWM module selection */
void des_MC35XS3400_Select_PWM_Module(UINT8 u8PWMSelect);
/** Select open load detection */
void des_MC35XS3400_OpenLoad_Detect(UINT8 u8HSout, UINT8 u8OLselect);
/** Select current sense ratio */
void des_MC35XS3400_Select_CurrentSense(UINT8 u8HSout, UINT8 u8SenseRatio);
/** Select current profile */
void des_MC35XS3400_Select_CurrentProfile(UINT8 u8HSout,
UINT8 u8CoolCurve, UINT8 u8InrushCurve);
/** Select output steady state */
void des_MC35XS3400_Select_SteadyState(UINT8 u8HSout, UINT8 u8SteadyState);
/** Select overcurrent mode */
void des_MC35XS3400_Select_OverCurrent(UINT8 u8HSout, UINT8 u8OCmode);
/** Read HS output status */
UINT8 des_MC35XS3400_Get_Status(UINT8 u8HSout);
#endif /* _DES_MC35XS3400_H */
/*******************************************************************************/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -