?? main.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 + -