/*wisard ARM for keil ver 1.01(Alfa)
povide By IRAN MICRO GROUP*/
/************************************************** *******
Project Name:
Date: 2011/01/13
Author:
Company: IranMicro
Version:
Description:
************************************************** *******/
#include "AT91SAM7X256.h"
#include "lib_AT91SAM7X256.h"
#include "usart.h"
#include <stdio.h>
#include "kbd.h"
/*TFT_LCD Configuration */
#define PORTRAIT
#define TFTLCD_DATAPORT_B
#define TFTLCD_DATAPORT_OFFSET 0
#define TFTLCD_CONTROLPORT_B
#define TFTLCD_RST 16
#define TFTLCD_RS 18
#define TFTLCD_CS 17
#define TFTLCD_WR 19
#define TFTLCD_RD 20
#include "tftlcd_functions.c"
/***************/
int main(void)
{
/* configuration PORTA used by at91sam7x256.h lib */
// Active PORTA Pins
*AT91C_PIOA_PER = 0xF;
// (1 logic) BITs : 0,1,2,3,
//---------------------------------------
// PORTA Direct < input or output >
*AT91C_PIOA_OER =0xF;
// (1 logic) BITs : 0,1,2,3,
//---------------------------------------
// Active Pullup PORTA Pins
*AT91C_PIOA_PPUER = 0x0;
// (1 logic) BITs :
//---------------------------------------
// Set Output PORTA Pins
*AT91C_PIOA_SODR = 0xF;
// (1 logic) BITs : 0,1,2,3,
//---------------------------------------
// configuration register ODSR in (read only) => multi mode (read&write)
*AT91C_PIOA_OWER = 0xF;
// (1 logic) BITs : 0,1,2,3,
//---------------------------------------
/* configuration PORTB used by at91sam7x256.h lib */
// Active PORTB Pins
*AT91C_PIOB_PER = 0x4000000F;
// (1 logic) BITs : 0,1,2,3,30,
//---------------------------------------
// PORTB Direct < input or output >
*AT91C_PIOB_OER =0x1;
// (1 logic) BITs : 0,
//---------------------------------------
// Active Pullup PORTB Pins
*AT91C_PIOB_PPUER = 0x40000007;
// (1 logic) BITs : 0,1,2,30,
//---------------------------------------
// Set Output PORTB Pins
*AT91C_PIOB_SODR = 0x40000007;
// (1 logic) BITs : 0,1,2,30,
//---------------------------------------
// configuration register ODSR in (read only) => multi mode (read&write)
*AT91C_PIOB_OWER = 0x4000000F;
// (1 logic) BITs : 0,1,2,3,30,
//---------------------------------------
// Keyboard configuration
kbd_pin(2,0,1,2,3,4,5,7,6);
// * TFT lcd init
tftlcd_init();
//*******************
// USART0 configuration
USART(18432000,9600,0);
usart0_init();
//*******************
while(1)
{
//place your code Here
} //while 1
} //main
*موفق باشید.