Main Page | Modules | Data Structures | File List | Data Fields | Globals

sim.h

Go to the documentation of this file.
00001 /*
00002  * $Id: sim.h,v 1.7 2003/12/07 07:26:09 dhylands Exp $
00003  *
00004  * public interface for the 683XX system integration module (SIM)
00005  *
00006  * Copyright (C) 2001 Doug Chapman
00007  *
00008  * This library is distributed under the terms of the GNU Lesser General
00009  * Public License (LGPL).  You should have received a copy of the
00010  * license along with this library (LGPL.txt); if not, write to
00011  * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
00012  * Boston, MA  02111-1307  USA
00013  */
00014 
00037 #ifndef __SIM_H__
00038 #define __SIM_H__
00039 
00040 #include <68332/types.h>
00041 
00042 /*
00043  * Clock speed definitions used to set processor speed.
00044  */
00045 #ifndef FCRYSTAL
00046 #define FCRYSTAL 32768L
00047 #endif
00048 
00050 #define CLOCK8MHZ       0x3f00
00051 
00052 #define CLOCK16MHZ      0x7f00
00053 
00054 #define CLOCK25MHZ      0xd700  
00055 
00059 typedef enum {
00060     RESET_EXT,                  
00061     RESET_POW,                  
00062     RESET_SW,                   
00063     RESET_HLT,                  
00064     RESET_SYS,                  
00065     RESET_TST                   
00066 } reset_state_t;
00067 
00068 #ifdef __cplusplus
00069 extern "C" {
00070 #endif
00071 
00079 int set_sim_iarb (
00080         int iarb
00081 );
00082 
00096 int set_processor_speed (
00097         int speed
00098 );
00099 
00107 uint32 get_processor_freq(void);
00108 
00115 reset_state_t get_reset_state(void);
00116 
00122 uint8 read_porte(void);
00123 
00127 void write_porte(uint8 val);
00128 
00141 int set_porte_data_direction (
00142         uint8 direction_mask
00143 );
00144 
00158 int set_porte_pin_assignment (
00159         uint8 pin_assignment
00160 );
00161 
00167 uint8 read_portf(void);
00168 
00172 void write_portf(uint8 val);
00173 
00185 int set_portf_data_direction (
00186         uint8 direction_mask
00187 );
00188 
00202 int set_portf_pin_assignment (
00203         uint8 pin_assignment
00204 );
00205 
00225 int set_watchdog (
00226         int enable, 
00227         int prescale, 
00228         int timeout
00229 );
00230 
00238 void reset_watchdog(void);
00239 
00256 int periodic_interrupt_setup (
00257         void (*function)(),
00258         int level, 
00259         int vector,
00260         int prescale, 
00261         uint8 timer
00262 );
00263 
00271 void barrier_read_uint16( uint16 val );
00272 
00277 void barrier( void );
00278 
00279 
00280 #ifdef __cplusplus
00281 }
00282 #endif
00283 
00284 #endif /* __SIM_H__ */
00285 

Generated on Wed Sep 6 03:02:22 2006 for MotoRobots by doxygen 1.3.6