📄 csl_hdq1w.h
字号:
/** ============================================================================
* @file csl_hdq1w.h
*
* @path $(CSLPATH)\arm\hdq1w\inc
*
* @desc API header for HDQ1W
*
*/
/* =============================================================================
* Copyright (c) Texas Instruments Inc 2002, 2003, 2004
*
* Use of this software is controlled by the terms and conditions found in the
* license agreement under which this software has been supplied.
* ============================================================================
*/
/* @(#) PSP/CSL 3.00.01.00[5912] (2004-08-03) */
/* =============================================================================
* Revision History
* ================
* 03-Aug-2004 sp File Created.
*
* =============================================================================
*/
#ifndef _CSL_HDQ1W_H_
#define _CSL_HDQ1W_H_
#include <csl.h>
#include <cslr_hdq1w.h>
#ifdef __cplusplus
extern "C" {
#endif
/**************************************************************************\
* HDQ1W global typedef declarations
\**************************************************************************/
/**
* This enumeration describes the operational modes of HDQ1W module
*/
typedef enum {
/** HDQ mode */
CSL_HDQ1W_MODE_HDQ,
/** 1-Wire mode */
CSL_HDQ1W_MODE_1WIRE
}CSL_Hdq1wMode;
/**
* This enumeration describes the control commands to control the HDQ1W module.
*/
typedef enum {
/**
* @brief Disable power down mode
* @param (NULL)
*/
CSL_HDQ1W_CMD_PDM_DIS,
/**
* @brief Enable power down mode
* @param (NULL)
*/
CSL_HDQ1W_CMD_PDM_EN,
/**
* @brief Send the appropriate command
* @param (NULL)
*/
CSL_HDQ1W_CMD_SET_GB,
/**
* @brief Send the initialization pulse
* @param (NULL)
*/
CSL_HDQ1W_CMD_SND_INIT_PULSE,
/**
* @brief Write mode
* @param (NULL)
*/
CSL_HDQ1W_CMD_WRITE,
/**
* @brief Read mode
* @param (NULL)
*/
CSL_HDQ1W_CMD_READ,
/**
* @brief Write data to transmit register
* @param (Uint8 *)
*/
CSL_HDQ1W_CMD_TX
}CSL_Hdq1wHwControlCmd;
/**
* This enumeration describes the queries used to get the various parameter
* information of the HDQ1W module.
*/
typedef enum {
/**
* @brief Get the Go bit status
* @param (Bool *)
*/
CSL_HDQ1W_QUERY_GB_STAT,
/**
* @brief Get the initialization pulse bit status
* @param (Bool *)
*/
CSL_HDQ1W_QUERY_INIT_PULSE_STAT,
/**
* @brief Get the slave presence detect status
* @param (Bool *)
*/
CSL_HDQ1W_QUERY_SLV_PRES_STAT,
/**
* @brief Get the transmit complete interrupt status
* @param (Bool *)
*/
CSL_HDQ1W_QUERY_INTR_TX_DONE,
/**
* @brief Get the read complete interrupt status
* @param (Bool *)
*/
CSL_HDQ1W_QUERY_INTR_RX_DONE,
/**
* @brief Get the presence detect/time-out interrupt status. This interrupt
* is raised for timeout on read in HDQ mode and for slave presence
* detect in 1-Wire mode
* @param (Bool *)
*/
CSL_HDQ1W_QUERY_INTR_DTO,
/**
* @brief Read the received data byte
* @param (Uint8 *)
*/
CSL_HDQ1W_QUERY_RX_DATA
}CSL_Hdq1wHwStatusQuery;
/**
* Structure used to setup the HDQ1W device
*/
typedef struct CSL_Hdq1wHwSetup
{
/** 1-Wire operation mode single bit/byte mode*/
Bool oneWireBitMode;
/** Interrupt enable/disble */
Bool interruptEnable;
/** HDQ/1-Wire mode */
CSL_Hdq1wMode mode;
}CSL_Hdq1wHwSetup;
/**
* HDQ1W config structure
*/
typedef struct CSL_Hdq1wConfig
{
/** TX write data register */
Uint32 HDQ1W_TX;
/** Control register */
Uint32 HDQ1W_CTRL;
}CSL_Hdq1wConfig;
/**
* Default setup values for HDQ1W module
*/
#define CSL_HDQ1W_SETUP_DEFAULTS { \
FALSE, \
TRUE, \
CSL_HDQ1W_MODE_HDQ \
}
/**
* Default setup values for config structure
*/
#define CSL_HDQ1W_CONFIG_DEFAULTS { \
CSL_HDQ1W_HDQ1W_TX_RESETVAL, \
CSL_HDQ1W_HDQ1W_CTRL_RESETVAL \
}
/**
* HDQ1W object structure
*/
typedef struct CSL_Hdq1wObj
{
/** Base address of the configuration registers of HDQ1W */
CSL_Hdq1wRegsOvly regs;
/** HDQ1W instance */
CSL_InstNum perNum;
}CSL_Hdq1wObj;
/**
* This structure will have the base address information for peripheral instance
*/
typedef struct CSL_Hdq1wBaseAddress
{
/** Base address of the configuration registers of HDQ1W */
CSL_Hdq1wRegsOvly regs;
}CSL_Hdq1wBaseAddress;
/**
* HDQ1W module specific parameters. Present implimentation doesn't have any
* module specific parameters.
*/
typedef struct CSL_Hdq1wParam
{
/** Bit mask to be used for module specific parameters. The declaration is
* just a place-holder for future implementation.
*/
CSL_BitMask16 flags;
}CSL_Hdq1wParam;
/**
* HDQ1W module specific context information. Present implimentation doesn't
* have any context information.
*/
typedef struct CSL_Hdq1wContext
{
/** Context information of HDQ1W. The declaration is just a place-holder for
* future implementation.
*/
Uint16 contextInfo;
} CSL_Hdq1wContext;
/**
* This data type is used to return the handle to the CSL of HDQ1W
*/
typedef struct CSL_Hdq1wObj *CSL_Hdq1wHandle;
/**************************************************************************\
* HDQ1W global function declarations
\**************************************************************************/
/*
* =============================================================================
* @func CSL_hdq1wInit
*
* @desc
* This is the initialization function for the HDQ1W CSL. This function
* needs to be called before any other HDQ1W CSL function is called. This
* function is idem-potent. Currently, this function does not perform
* anything.
*
* @arg pContext
* Pointer to module-context. As HDQ1W doesn't have any context based
* information user is expected to pass NULL.
*
* @ret CSL_Status
* CSL_SOK - Always returns
*
* @eg
* CSL_Status status;
*
* status = CSL_hdq1wInit (NULL);
*
* =============================================================================
*/
extern CSL_Status CSL_hdq1wInit (
CSL_Hdq1wContext *pContext
);
/*
* =============================================================================
* @func CSL_hdq1wOpen
*
* @desc
* This function populates the peripheral data object for the HDQ1W instance
* and returns a handle to the instance
*
* @arg pHdq1wObj
* Pointer to the peripheral data object for HDQ1W
*
* @arg hdq1wNum
* Specifies the instance of the HDQ1W to be opened
*
* @arg pHdq1wParam
* Module specific parameter for HDQ1W instance
*
* @arg pStatus
* pointer for returning status of the function call
*
* @ret CSL_Hdq1wHandle
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -