AN2364 Freescale Semiconductor / Motorola, AN2364 Datasheet - Page 31

no-image

AN2364

Manufacturer Part Number
AN2364
Description
Using the Table Stepper Motor TPU Function (TSM) with the MPC500 Family
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
tpu_tsm.c
/* Issue a move request to the host service request (master channel:HSR=0x11) */
/*******************************************************************************
FUNCTION
PURPOSE
INPUTS NOTES
RETURN NOTES
GENERAL NOTES : The channel must be a master channel for the TSM function. The
*******************************************************************************/
UINT16 tpu_tsm_rd_dp(struct TPU3_tag *tpu, UINT8 channel)
/* read and return the desired position from the TSM master channel */
/*******************************************************************************
FUNCTION
PURPOSE
INPUTS NOTES
RETURN NOTES
GENERAL NOTES : The channel must be a master channel for the TSM function. The
*******************************************************************************/
UINT16 tpu_tsm_rd_cp(struct TPU3_tag *tpu, UINT8 channel)
/* read and return the current position from the TSM master channel */
31
tpu_hsr(tpu, channel, TPU_TSM_HSR_MOV);
};
{
return (tpu->PARM.R[channel][TPU_TSM_DESIRED_POSITION]);
};
{
return (tpu->PARM.R[channel][TPU_TSM_CURRENT_POSITION]);
};
: tpu_tsm_rd_dp
: To read the desired position.
: This function has 2 parameters:
: desired position - The desired position is returned as a UINT16.
: tpu_tsm_rd_cp
: To read the current position.
: This function has 2 parameters:
: current position - The desired position is returned as a UINT16.
*tpu - This is a pointer to the TPU3 module to use. It is of
channel - This is the number of the master channel
read of the desired position can be used to drive the program.
*tpu - This is a pointer to the TPU3 module to use. It is of
channel - This is the number of the master channel
read of the current position can be used to drive the program.
type TPU3_tag which is defined in m_tpu3.h
type TPU3_tag which is defined in m_tpu3.h
Freescale Semiconductor, Inc.
Using the Table Stepper Motor TPU Function
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA

Related parts for AN2364