/*
 * dsp_fixpt_sim.h
 *
 * DSP Blockset helper function.
 *
 * Query input/output port fixed-point data type information. 
 *
 *
 * Copyright (c) 1995-2000 The MathWorks, Inc.
 * $Revision: 1.6 $ $Date: 2000/03/16 03:16:55 $
 */

#ifndef dsp_fixpt_sim_h
#define dsp_fixpt_sim_h

#include "simstruc.h"

/*******************************************************************************
 * FUNCTION isInputSignedFixedPoint
 *
 * DESCRIPTION: Check if an input port's data type is considered to be
 *              "signed fixed-point".
 *
 *              This means (1) In the form of the Simulink fixed-point data type
 *              AND (2) the information contained is signed fixed-pt information.
 *
 * INPUTS: S    - the block SimStruct
 *         port - the index of the input port to be checked
 *
 * RETURNS: boolean value (true -> signed fixed-pt, false -> not signed fix-pt)
 *
 * PRECONDITIONS: None
 *
 * POSTCONDITIONS: None
 *
 * OPERATION: Synchronous (operation completed upon function return)
 ******************************************************************************/
extern boolean_T isInputSignedFixedPoint(SimStruct *S, int_T port);

/*******************************************************************************
 * FUNCTION isOutputSignedFixedPoint
 *
 * DESCRIPTION: Check if an output port's data type is considered to be
 *              "signed fixed-point".
 *
 *              This means (1) In the form of the Simulink fixed-point data type
 *              AND (2) the information contained is signed fixed-pt information.
 *
 * INPUTS: S    - the block SimStruct
 *         port - the index of the output port to be checked
 *
 * RETURNS: boolean value (true -> signed fixed-pt, false -> not signed fix-pt)
 *
 * PRECONDITIONS: None
 *
 * POSTCONDITIONS: None
 *
 * OPERATION: Synchronous (operation completed upon function return)
 ******************************************************************************/
extern boolean_T isOutputSignedFixedPoint(SimStruct *S, int_T port);

/*******************************************************************************
 * FUNCTION isInputUnsignedFixedPoint
 *
 * DESCRIPTION: Check if an input port's data type is considered to be
 *              "unsigned fixed-point".
 *
 *              This means (1) In the form of the Simulink fixed-point data type
 *              AND (2) the information contained is unsigned fixed-pt info.
 *
 * INPUTS: S    - the block SimStruct
 *         port - the index of the input port to be checked
 *
 * RETURNS: boolean value (true -> unsigned fixed-pt, false -> not uns fix-pt)
 *
 * PRECONDITIONS: None
 *
 * POSTCONDITIONS: None
 *
 * OPERATION: Synchronous (operation completed upon function return)
 ******************************************************************************/
extern boolean_T isInputUnsignedFixedPoint(SimStruct *S, int_T port);

/*******************************************************************************
 * FUNCTION isOutputUnsignedFixedPoint
 *
 * DESCRIPTION: Check if an output port's data type is considered to be
 *              "unsigned fixed-point".
 *
 *              This means (1) In the form of the Simulink fixed-point data type
 *              AND (2) the information contained is unsigned fixed-pt info.
 *
 * INPUTS: S    - the block SimStruct
 *         port - the index of the output port to be checked
 *
 * RETURNS: boolean value (true -> unsigned fixed-pt, false -> not uns fix-pt)
 *
 * PRECONDITIONS: None
 *
 * POSTCONDITIONS: None
 *
 * OPERATION: Synchronous (operation completed upon function return)
 ******************************************************************************/
extern boolean_T isOutputUnsignedFixedPoint(SimStruct *S, int_T port);

/*******************************************************************************
 * FUNCTION isInputFixedPoint
 *
 * DESCRIPTION: Check if an input port's data type is considered to be fixed-pt
 *
 *              This means (1) In the form of the Simulink fixed-point data type
 *              AND (2) the info contained is signed or unsigned fixed-pt info.
 *
 *              NOTE: Quantized floating-point quantities are NOT considered
 *                    to be "fixed-point" quantities.  This function returns
 *                    FALSE for quantized floating-point information contained
 *                    within a fixed-point data type.
 *
 * INPUTS: S    - the block SimStruct
 *         port - the index of the input port to be checked
 *
 * RETURNS: boolean value (true -> fixed-point, false -> not fixed-point)
 *
 * PRECONDITIONS: None
 *
 * POSTCONDITIONS: None
 *
 * OPERATION: Synchronous (operation completed upon function return)
 ******************************************************************************/
extern boolean_T isInputFixedPoint(SimStruct *S, int_T port);

/*******************************************************************************
 * FUNCTION isOutputFixedPoint
 *
 * DESCRIPTION: Check if an output port's data type is considered to be fixed-pt
 *
 *              This means (1) In the form of the Simulink fixed-point data type
 *              AND (2) the info contained is signed or unsigned fixed-pt info.
 *
 *              NOTE: Quantized floating-point quantities are NOT considered
 *                    to be "fixed-point" quantities.  This function returns
 *                    FALSE for quantized floating-point information contained
 *                    within a fixed-point data type.
 *
 * INPUTS: S    - the block SimStruct
 *         port - the index of the output port to be checked
 *
 * RETURNS: boolean value (true -> fixed-point, false -> not fixed-point)
 *
 * PRECONDITIONS: None
 *
 * POSTCONDITIONS: None
 *
 * OPERATION: Synchronous (operation completed upon function return)
 ******************************************************************************/
extern boolean_T isOutputFixedPoint(SimStruct *S, int_T port);

/*******************************************************************************
 * FUNCTION isFixedPointDspDataType
 *
 * DESCRIPTION: Check if a data type is considered to be "fixed-point".
 *
 *              This means (1) In the form of the Simulink fixed-point data type
 *              AND (2) the information contained is NOT quantized floating-pt
 *              information (fixed-point information only).
 *
 * INPUTS: dtName - the data type character string name
 *
 * RETURNS: boolean value (true -> fixed-point, false -> not fixed-point)
 *
 * PRECONDITIONS: None
 *
 * POSTCONDITIONS: None
 *
 * OPERATION: Synchronous (operation completed upon function return)
 ******************************************************************************/
extern boolean_T isFixedPointDspDataType(const char *dtName);

/*******************************************************************************
 * FUNCTION isQuantizedFltPtDspDataType
 *
 * DESCRIPTION: Check if a data type is considered to be "quantized floating-pt"
 *
 *              This means (1) In the form of the Simulink fixed-point data type
 *              AND (2) the information contained is quantized floating-pt info.
 *
 * INPUTS: dtName - the data type character string name
 *
 * RETURNS: boolean value (true -> quant floating-point, false -> not quant flt)
 *
 * PRECONDITIONS: None
 *
 * POSTCONDITIONS: None
 *
 * OPERATION: Synchronous (operation completed upon function return)
 ******************************************************************************/
extern boolean_T isQuantizedFltPtDspDataType(const char *dtName);

#endif /* dsp_fixpt_sim_h */

/* [EOF] dsp_fixpt_sim.h */
