00001 /* 00002 * $Id: mcpwm.h,v 1.7 2002/12/02 03:58:00 dwalters Exp $ 00003 * 00004 * mcpwm.h - This file contains the definitions of the 00005 * functions used to manipulate the MCPWM TPU function. 00006 * 00007 * Copyright (C) 2001 Mike Panetta 00008 * 00009 * This library is distributed under the terms of the GNU Lesser General 00010 * Public License (LGPL). You should have received a copy of the 00011 * license along with this library (LGPL.txt); if not, write to 00012 * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, 00013 * Boston, MA 02111-1307 USA 00014 */ 00015 00032 #ifndef __TPU_MCPWM_H 00033 #define __TPU_MCPWM_H 00034 00035 #include <68332/types.h> 00036 #include <68332/tpu.h> 00037 00042 typedef struct _MCPWMObject MCPWMObject; 00043 00045 typedef struct _MCPWMObject * MCPWMObjectP; 00046 00048 struct _MCPWMObject 00049 { 00050 TPUChannel* masterChannel; 00051 uint16 EAChannels; 00052 uint16 CAAChannels; 00053 uint16 CABChannels; 00054 uint16 priority; 00055 uint16 period; 00056 uint16 initialized; 00057 }; 00058 00059 /* Start of C function declarations */ 00060 #ifdef __cplusplus 00061 extern "C" { 00062 #endif 00063 00082 MCPWMObjectP mcpwm_init ( 00083 uint16 tpu_num, 00084 uint16 chan, 00085 uint16 priority, 00086 uint16 period, 00087 uint16 irqr 00088 ); 00089 00102 int mcpwm_start ( 00103 MCPWMObjectP handle 00104 ); 00105 00115 void mcpwm_shutdown ( 00116 MCPWMObjectP handle 00117 ); 00118 00135 int mcpwm_add_ea ( 00136 MCPWMObjectP handle, 00137 uint16 chan, 00138 uint16 high 00139 ); 00140 00153 int mcpwm_set_ea_hightime ( 00154 MCPWMObjectP handle, 00155 uint16 chan, 00156 uint16 high 00157 ); 00158 00159 #ifdef __cplusplus 00160 } 00161 #endif 00162 00163 #endif // #ifndef __TPU_MCPWM_H