⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 srvnlc.c

📁 本程序为ST公司开发的源代码
💻 C
字号:
/*******************************************************************************
 *                    CONFIDENTIAL - PHILIPS APM
 *
 *  This is unpublished work is a trade secret. Philips APM owns all rights
 *  to this work and intends to maintain it in confidence to preserve its
 *  trade secret status. Philips Automotive Playback Modules reserves the
 *  right to protect this work as an unpublished copyrighted work in the
 *  event of an inadvertent Automotive Systems also reserves its right.
 *  Those having access to this work mayor deliberate unauthorized publication.
 *  Do not copy it, use it, or disclose the information contained in it
 *  without the written authorization of Philips Automotive Playback Modules.
 ******************************************************************************/
/******************************************************************************/
/*! \file
 *
 *  Project Scope:  CDM M8
 *
 *  Organization:   Philips APM
 *
 *  Version Control:
 *    \source       sources\servo\srvnlc.c
 *    \version      0.1
 *    \author       Marcel Rieck
 *    \date         26.03.2004
 *
 *  Target Hardware:    Accordo
 *******************************************************************************
 *  \brief        Nonlinear control
 *
 *  \par          Change History:
 *
 ***************************************************
 *
 * STM CVS Log:
 *
 * $Log: srvnlc.c,v $ * Revision 1.9  2007/04/11 14:21:05  belardi * Integration of HAVE_CD_MECHA modification by [GP] *
 * Revision 1.8  2006/10/09 15:13:44  dellorto
 * *** empty log message ***
 *
 * Revision 1.7  2006/09/18 09:55:25  belardi
 * Corrected CVS keyword usage
 *
 * Revision 1.6  2006/09/18 09:25:38  belardi
 * AddeLogg$ CVS keyword into file header
 *
 *
 ******************************************************************************/

#include "gendef.h"
#include "hwreg.h"
#include "osal.h"
#include "srvinc.h"


#if (HAVE_CD_MECHA == 1)

/******************************************************************************/
/* Function:  nlc_init                                                        */
/*                                                                            */
/*! \brief    initialization of the nonlinear part of the tracking controller.
 *  \param    void
 *  \return   void
 *  \remark   this should later become part of a profile.
 */
/******************************************************************************/

void nlc_init(void)
{
  /* Set parameters of deadzone. */
  /* Per default enable nonlinear control. */
  dsp_write_xmem(NLC_ALPHA_ADD, NLC_PHI_ALPHA_ON);
  dsp_write_xmem(NLC_DELTA_ADD, NLC_PHI_DELTA);
}


#ifdef APM_PICKUP   /* [RB] commented out to reduce ROM space */

/******************************************************************************/
/* Function:  nlc_on                                                          */
/*                                                                            */
/*! \brief    turn the nonlinear part of the radial tracking controller on
 *  \param    void
 *  \return   void
 *  \remark
 */
/******************************************************************************/

void nlc_on(void)
{
  /* Turn nonlinear control on. */
  dsp_write_xmem(NLC_ALPHA_ADD, NLC_PHI_ALPHA_ON);
}


/******************************************************************************/
/* Function:  nlc_off                                                         */
/*                                                                            */
/*! \brief    turn the nonlinear part of the radial tracking controller on
 *  \param    void
 *  \return   void
 *  \remark
 */
/******************************************************************************/

void nlc_off(void)
{
  /* Turn nonlinear control off. */
  dsp_write_xmem(NLC_ALPHA_ADD, NLC_PHI_ALPHA_OFF);
}


/******************************************************************************/
/* Function:  nlc_set_alpha                                                   */
/*                                                                            */
/*! \brief    set ALPHA parameter of deadzone
 *  \param    ALPHA parameter
 *  \return   void
 *  \remark
 */
/******************************************************************************/

void nlc_set_alpha(uint16 alpha)
{
  dsp_write_xmem(NLC_ALPHA_ADD, alpha);
}

#endif   /* APM_PICKUP */


/******************************************************************************/
/* Function:  nlc_set_delta                                                   */
/*                                                                            */
/*! \brief    set DELTA parameter of deadzone
 *  \param    DELTA parameter
 *  \return   void
 *  \remark
 */
/******************************************************************************/

void nlc_set_delta(uint16 delta)
{
  dsp_write_xmem(NLC_DELTA_ADD, delta);
}

#endif // HAVE_CD_MECHA

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -