//#############################################################################
// $Copyright:
// Copyright (C) 2017-2023 Texas Instruments Incorporated - http://www.ti.com/
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
//   Redistributions of source code must retain the above copyright
//   notice, this list of conditions and the following disclaimer.
//
//   Redistributions in binary form must reproduce the above copyright
//   notice, this list of conditions and the following disclaimer in the
//   documentation and/or other materials provided with the
//   distribution.
//
//   Neither the name of Texas Instruments Incorporated nor the names of
//   its contributors may be used to endorse or promote products derived
//   from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// $
//#############################################################################

// *****************************************************************************
//! \file   /solutions/tidm_dualmtrpfc/common/include/user_dms.h
//! \brief  Contains the user related definitions
//!
// *****************************************************************************

#ifndef USER_DMS_H
#define USER_DMS_H

// the includes
#include "userParams.h"
#include "hal.h"

//!
//!
//! \defgroup USER USER
//!
//@{


#ifdef __cplusplus
extern "C" {
#endif


// **************************************************************************
// the defines
//! \brief Defines the system clock frequency, MHz
//!
#define USER_SYSTEM_FREQ_MHz            (100.0f)

//! \brief Defines the system time base period, ms
//!
#define USER_TIME_BASE_PERIOD_ms        (1.0f)

//! \brief Defines the system time base frequency, Hz
//!
#define USER_TIME_BASE_FREQ_Hz          (1000.0f / USER_TIME_BASE_PERIOD_ms)

//! \brief Defines the system time base period, ms
//!
#define USER_BASE_TIMER_PERIOD_ms       (1.0f)

//! \brief Defines the system time base frequency, Hz
//!
#define USER_BASE_TIMER_FREQ_Hz         (1000.0f / USER_BASE_TIMER_PERIOD_ms)

//! \brief Defines the system time base period, ms
//!
#define USER_RTOS_TIMER_PERIOD_ms       (1.0f)

//! \brief Defines the system time base frequency, Hz
//!
#define USER_RTOS_TIMER_FREQ_Hz         (1000.0f / USER_RTOS_TIMER_PERIOD_ms)

//! \brief A flag to bypass motor identification (1/0 : true/false)
//!
#define USER_BYPASS_MOTOR_ID           (1)  // 1- No motor parameters identification

#define USER_ENABLE_MOTOR_ID            0
#define USER_DISABLE_MOTOR_ID           1

//! defines DMA buffer size for ADC, 3*2
#define DMA_MTR_ADC_BUF_SIZE            (6)

//! defines DMA burst size for ADC,
#define DMA_MTR_ADC_BURST_SIZE          (3)

//! defines DMA transfer size for ADC, 3*2
#define DMA_MTR_ADC_TRANSFER_SIZE       (6)

//! defines ADC wrap size for ADC,
#define DMA_MTR_ADC_SRC_WRAP_SIZE       (2)

//! defines ADC wrap size for ADC,
#define DMA_MTR_ADC_DST_WRAP_SIZE       (6)

//============================================================================================
// Motor defines

//************** Motor Parameters **************
// PMSM motors
#define Estun_EMJ_04APB22           110
#define ziehlab_Fan160hv            111
#define Marathon_N56PNRA10102       112
#define Anaheim_BLWS235D            113
#define QXA_A091ZE190A              114
#define GMCC_KSK89D53U              115
#define Baldor_BSM90N175            116
#define industry_Fan220hv           117
#define Anaheim_BLZ362S             118
#define Dhvac_Fan110hv              119

#define Teknic_M2310PLN04K          121
#define Anaheim_BLY172S_24V         122
#define Anaheim_BLY341S_Y24V        123
#define Anaheim_BLY341S_D24V        124
#define AirFan_MFA0500_24V          125
#define Drone_BLK2BLADE             126
#define Drone_DJI920KV              127

// ACIM motors
#define Marathon_5K33GN2A           200
#define Marathon_56H17T2011A        201
#define Dayton_3N352C               202

#define my_pm_motor_1               301
#define my_aci_motor_2              302


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


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


// **************************************************************************
// the functions
//! \brief      Sets the private user parameter values
//! \param[in]  pUserParams  The pointer to the user param structure
extern void cla_USER_setParams_priv(USER_Params *pUserParams);

//! \brief      Sets the private user parameter values
//! \param[in]  pUserParams  The pointer to the user param structure
extern void USER_setParams_priv(USER_Params *pUserParams);


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

//@}  // ingroup
#endif // end of USER_ALL_H definition

