音影先锋亚洲天堂网|电影世界尽头的爱完整版播放|国产 熟女 91|高清无码免费观看欧美日韩|韩国一区二区三区黄色录像|美女亚洲加勒比在线|亚洲综合网 开心五月|7x成人在线入口|成人网站免费日韩毛片区|国产黄片?一级?二级?三级

登錄 免費(fèi)注冊(cè) 首頁(yè) | 行業(yè)黑名單 | 幫助
維庫(kù)電子市場(chǎng)網(wǎng)
技術(shù)交流 | 電路欣賞 | 工控天地 | 數(shù)字廣電 | 通信技術(shù) | 電源技術(shù) | 測(cè)控之家 | EMC技術(shù) | ARM技術(shù) | EDA技術(shù) | PCB技術(shù) | 嵌入式系統(tǒng)
驅(qū)動(dòng)編程 | 集成電路 | 器件替換 | 模擬技術(shù) | 新手園地 | 單 片 機(jī) | DSP技術(shù) | MCU技術(shù) | IC 設(shè)計(jì) | IC 產(chǎn)業(yè) | CAN-bus/DeviceNe

用過英倍特的開發(fā)環(huán)境的大蝦幫看看!

作者:HHHBBB 欄目:ARM技術(shù)
用過英倍特的開發(fā)環(huán)境的大蝦幫看看!
//*----------------------------------------------------------------------------
//*      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           : led_swing.c
//* Object              : Led Swing for the AT91EB40A
//*
//* 1.0 06/08/01  PF    : Creation
//*----------------------------------------------------------------------------
#ifndef AT91_DEBUG_NONE
#include <stdio.h>
#endif
#include "parts/m40800/lib_m40800.h"
#include "drivers/capture/capture.h"
#include "drivers/wait/wait.h"
#include "periph/ebi/lib_ebi.h"
#include "drivers/flash/lib_flash_at49.h"
#include "targets/eb40a/eb40a.h"


#define baud_rate  115200

extern void wake_up_handler (void) ;

/* GLOBAL Variable */
WaitDesc wait_desc = { &TC0_DESC, 0, 0, WAIT_DELAY, wake_up_handler } ;

u_int LedSpeed = 50000 ;
u_int loop_count = 0 ;

const int led_mask[8]= {LED1, LED2, LED3, LED4, LED5, LED6, LED7, LED8};


//*----------------------------------------------------------------------------
//* Function NAME       : change_speed
//* Object              : Adjust led speed depending on SW1 and SW3
//* Input Parameters    : none
//* OUTPUT Parameters   : none
//* Functions called    : none
//*----------------------------------------------------------------------------
void change_speed ( void )
//* Begin
{
    u_int status = at91_pio_read (&PIO_DESC) ;
    if (( status & SW1 ) == 0 )
    {
        if ( LedSpeed > 100000 ) LedSpeed -=1000 ;
    }
    if (( status & SW3 ) == 0 )
    {
        if ( LedSpeed < 20000000 ) LedSpeed +=1000 ;
    }
}
//* End


//*----------------------------------------------------------------------------
//* Function NAME       : main
//* Object              : Main function of the led blink
//* Input Parameters    : none
//* OUTPUT Parameters   : True
//* Functions called    :
//*----------------------------------------------------------------------------
int main( void )
//* Begin
{
    int   i = 0 ;
    u_short cd_baud;
    ChipSelectDesc cs_descx;
    ComDesc COM;
    COM.usart = &USART0_DESC;    
    cd_baud = MCK/(baud_rate*16);

   cs_descx.cs_id = 0; // CS0  selected
   cs_descx.base_address = 0x01000000;
   cs_descx.page_size = CS_2_MBYTE;
   cs_descx.byte_access_type = CS_BYTE_WRITE; // byte access type
   cs_descx.data_bus_width = CS_8_BIT_BUS; // 8 bit    
   at91_chip_select_open ( &cs_descx );
   at91_chip_select_close( &cs_descx );


    //* -- Set up PIO
    at91_pio_open ( &PIO_DESC, LED_MASK, PIO_OUTPUT ) ;
    at91_pio_write (&PIO_DESC, LED_MASK, LED_OFF ) ;
    at91_open_com(
        &COM,
        COM_8_BIT|COM_PAR_NONE|COM_NBSTOP_1|COM_FLOW_CONTROL_NONE,
        cd_baud    
      );
    //* Detect MASTER Clock
    wait_desc.mcki_khz = 66000 ;

    //* Loop forever
    for (;;)
    {
        at91_print(&COM,"21340193285293045802934\n\r");
        at91_print(&COM,"ABCDEFG\n\r");
        //* Once a Shot on each led
        for ( i=0 ; i < 8 ; i++ )
        {
            change_speed () ;
            at91_pio_write (&PIO_DESC, led_mask[i], LED_ON ) ;
            wait_desc.period = LedSpeed ;
            at91_wait_open ( &wait_desc ) ;
            at91_pio_write (&PIO_DESC, led_mask[i], LED_OFF ) ;
        }

        //* Once a Shot on each led
        for ( i=7 ; i >= 0 ; i-- )
        {
            change_speed () ;
            at91_pio_write (&PIO_DESC, led_mask[i], LED_ON ) ;
            at91_wait_open ( &wait_desc ) ;
            at91_pio_write (&PIO_DESC, led_mask[i], LED_OFF ) ;
        }
    
#ifdef SEMIHOSTING
       printf ( "Loop %d\n", loop_count ) ;
#endif
        loop_count ++ ;
    }

    return(TRUE);
//* End
}
調(diào)用at91_chip_select_open ( &cs_descx ); 時(shí)出錯(cuò)
.\debug\led_swing.o: In function `main':
.\debug\led_swing.o(.text+0x108): undefined reference to `at91_chip_select_open'
.\debug\led_swing.o(.text+0x110): undefined reference to `at91_chip_select_close'

Error executing above command.


2樓: >>參與討論
cxzeng
AT91的庫(kù)沒有連接進(jìn)來
 
3樓: >>參與討論
paoa
一般遇到這種錯(cuò)誤就應(yīng)該知道是某些庫(kù)文件沒有鏈接好。
   undefined reference to `at91_chip_select_open'

   一般遇到這種錯(cuò)誤就應(yīng)該知道是某些庫(kù)文件沒有鏈接好。


參與討論
昵稱:
討論內(nèi)容:
 
 
相關(guān)帖子
代理商拿多少回扣啊
程序?yàn)槭裁床荒苓M(jìn)中斷,附代碼,請(qǐng)大蝦指點(diǎn)
請(qǐng)問哪位大蝦有Z80的仿真器出售或出租也行,幫幫忙,謝謝啦!
再請(qǐng)教一下zlei
請(qǐng)問我在哪兒可以找到ADS1.2的使用說明呀!謝謝!
免費(fèi)注冊(cè)為維庫(kù)電子開發(fā)網(wǎng)會(huì)員,參與電子工程師社區(qū)討論,點(diǎn)此進(jìn)入


Copyright © 1998-2006 m.58mhw.cn 浙ICP證030469號(hào)