/*
 * Copyright (c) 2022, Shenzhen CVA Innovation CO.,LTD
 * All rights reserved.
 *
 * Shenzhen CVA Innovation CO.,LTD (CVA chip) is supplying this file for use
 * exclusively with CVA's microcontroller products. This file can be freely
 * distributed within development tools that are supporting such microcontroller
 * products.
 *
 * THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED
 * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
 * CVA SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL,
 * OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
 */

#ifndef _IPM_PTE_H_
#define _IPM_PTE_H_

/*! \brief  Contains public interface to various functions related
 *          to the Interior Permanent Magnet Motor (IPM)
 *          Parameters Table Element (PTE)
 */

/*******************************************************************************
 * the includes
 ******************************************************************************/

#ifdef __cplusplus
extern "C" {
#endif

/*******************************************************************************
 * the defines
 ******************************************************************************/

/*******************************************************************************
 * the typedefs
 ******************************************************************************/

/*! \brief  Defines the IPM parameters table element
 *  \note   To make it simple we use the ABS value for the row and column,
 *          but actually the Id normally is negative, and Iq is irrelevant of
 *          the sign.
 *  \note   The size must align to 4 bytes
 */
typedef struct _IpmPteType_
{
    _iq absId_pu; /*!< Donate the row variable - ABS Id value in P.U. */
    _iq absIq_pu; /*!< Donate the column variable - ABS Iq value in P.U. */

    _iq Ld_mH;    /*!< Donate the D-axis inductance in mH */
    _iq Lq_mH;    /*!< Donate the D-axis inductance in mH */
    _iq Psi_wb;   /*!< Donate the permanent magnet flux in Wb */
} IpmPteType;

/*******************************************************************************
 * the globals
 ******************************************************************************/

/*******************************************************************************
 * the function prototypes
 ******************************************************************************/

#ifdef __cplusplus
}
#endif /* extern "C" */

#endif /* _IPM_PTE_H_ */
