⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.c

📁 使用JTAG口对AT91R40008芯片进行FLASH编程的程序
💻 C
字号:
//*----------------------------------------------------------------------------
//*      ATMEL Microcontroller Software Support  -  ROUSSET  -
//*----------------------------------------------------------------------------
//* The software is delivered "AS IS" without warranty or condition of any
//* kind, either express, implied or statutory. This includes without
//* limitation any warranty or condition with respect to merchantability or
//* fitness for any particular purpose, or against the infringements of
//* intellectual property rights of others.
//*----------------------------------------------------------------------------
//* File Name           : main.c
//* Object              : Audio extention board for MP3
//*
//* 1.0 16/01/02 tbd    : Creation,
//*----------------------------------------------------------------------------

//* --------------------------- include file ----------------------------------
#include 	"parts/r40008/lib_r40008.h"		//* for &PIO_DESC
#include 	"parts/r40008/reg_r40008.h"
#include    "targets/eb40a/eb40a.h"

#include    "drivers/com/com.h"

#define 	MAIN_CALL
#include 	"global.h"

//* --------------------------- Constant definition ---------------------------

//* ------------------------------  Global variable ---------------------------


//* ------------------------------  Local variable ----------------------------

//*----------------------------------------------------------------------------
//* Function Name       : Get_Command
//* Object              : Get command val
//* Input Parameters    : None
//* Output Parameters   : int : Command num
//*----------------------------------------------------------------------------
int Get_Command(const char * menu)
{
  int command;
  at91_print(&COM0,(char *)menu);
  at91_scanf(&COM0,"%d", &command);
  at91_print_crlf(&COM0);
  return command;
}

//*----------------------------------------------------------------------------
//* Function Name       : Get_Value
//* Object              : Get command val
//* Input Parameters    : None
//* Output Parameters   : int : Value hex
//*----------------------------------------------------------------------------
int Get_Value(const char * menu)
{
  int value;
  at91_print(&COM0,(char *)menu);
  at91_scanf(&COM0,"%x", &value);
  at91_print_crlf(&COM0);
  return value;
}

//*----------------------------------------------------------------------------
//* Function Name       : main
//* Object              : Main function of Polling USART 0
//* Input Parameters    : none
//* Output Parameters   : True
//*----------------------------------------------------------------------------
int main( void )
//* Begin
{

	unsigned short  cd;

    //* open terminal for console
    COM0.usart= &USART0_DESC;
    COM1.usart= &USART1_DESC;

    //* -- Set up PIO
    at91_pio_open ( &PIO_DESC, LED_MASK, PIO_OUTPUT ) ;
	at91_pio_write (&PIO_DESC, LED_MASK, LED_OFF ) ;

    //* Open com
	cd = at91_baud_com(MCK,115200);

    at91_open_com(&COM0,(COM_8_BIT|COM_PAR_NONE|COM_NBSTOP_1|COM_FLOW_CONTROL_NONE), cd);
    at91_open_com(&COM1,(COM_8_BIT|COM_PAR_NONE|COM_NBSTOP_1|COM_FLOW_CONTROL_NONE), cd);

    //* print header
    at91_print(&COM0,"\n\rATMEL JTAG  for eb40a\n\r");
    at91_print(&COM0,"Version1.0\n\r");

	main_menu();

//* End
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -