/* =========================================================================== */
/* Project:        Ex1 */
/* File:           Ex1Main.c */
/* Organization:    */
/* Author:           (initial version generated by RBuilder) */
/* Date:           12/1/2004 */
/* =========================================================================== */

#include "ST7lib_config.h"
#include <stdio.h>


/*---------------------------------------------------------------------------*/
/*Function:       PeriphInit*/
/*Purpose:        Periph configuration at RESET*/
/* Date:           12/1/2004 */
/*---------------------------------------------------------------------------*/
void PeriphInit ( void )
{
   
   /* I/O Port initialization */
   IO_Init();
   //do not use pins 0 and 1 because these are the ICC pins
   IO_Output(IO_OPEN_DRAIN, IO_PORT_A, 0xfc); 
   IO_Input(IO_PULL_UP_IT, IO_PORT_B, 0x3f);
}

/*---------------------------------------------------------------------------*/
/*Function:       main()*/
/*Purpose:        main routine*/
/* Date:           12/1/2004 */
/*---------------------------------------------------------------------------*/
void main ( void ) 
{
	unsigned char readval=0;
   
   /*Configure the internal peripherals*/
   PeriphInit();

   while ( 1 )
   {
   	//read port B
   	readval=IO_Read (IO_PORT_B);
   	//shift read value
	   //(do not use pins 0 and 1 because these are the ICC pins)
   	readval <<= 2;
   	//write value on port A
   	IO_ByteWrite (IO_PORT_A, readval);   	
   }
}/*end of main*/

