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

📄 avr.nut

📁 含有完整TCP/IP PPP协议的嵌入式操作系统
💻 NUT
📖 第 1 页 / 共 3 页
字号:
---- Copyright (C) 2004-2005 by egnite Software GmbH. All rights reserved.---- Redistribution and use in source and binary forms, with or without-- modification, are permitted provided that the following conditions-- are met:---- 1. Redistributions of source code must retain the above copyright--    notice, this list of conditions and the following disclaimer.-- 2. Redistributions in binary form must reproduce the above copyright--    notice, this list of conditions and the following disclaimer in the--    documentation and/or other materials provided with the distribution.-- 3. Neither the name of the copyright holders nor the names of--    contributors may be used to endorse or promote products derived--    from this software without specific prior written permission.---- THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS-- ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS-- FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE-- SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,-- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,-- BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS-- OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED-- AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,-- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF-- THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF-- SUCH DAMAGE.---- For additional information see http://www.ethernut.de/---- AVR Architecture---- $Log: avr.nut,v $-- Revision 1.7  2005/11/24 11:26:33  haraldkipp-- Added TLC16C550 driver.---- Revision 1.6  2005/11/22 16:42:39  haraldkipp-- ICCAVR fixed. Re-enabled AHDLC and old UART driver.---- Revision 1.5  2005/11/20 14:43:11  haraldkipp-- AHDLC driver and deprecated AVR UART driver temporarely removed from ICCAVR-- build. Will look into this later.---- Revision 1.4  2005/10/24 11:14:07  haraldkipp-- NUT_CPU_FREQ option removed. This is handled in os.nut.---- Revision 1.3  2005/10/04 05:51:49  hwmaier-- Added CAN driver for AT90CAN128---- Revision 1.2  2005/09/17 09:28:26  drsung-- Added irqstack.c to sources for avr target.---- Revision 1.1  2005/07/26 15:41:06  haraldkipp-- All target dependent code is has been moved to a new library named-- libnutarch. Each platform got its own script.----nutarch_avr ={    --    -- Runtime Initialization    --    {        name = "nutarch_avr_cstartup_icc",        brief = "ICCAVR Startup",        description = "There are four different ICCAVR startup files available.\n\n"..                      "crtnut.s, if globals and static variables use less than 4kB.\n"..                      "crtenut.s, same as above but including EEPROM emulation.\n"..                      "crtnutram.s, if globals and static variables use more than 4kB.\n"..                      "crtenutram.s, same as above but including EEPROM emulation.\n\n"..                      "Ethernut 1.3 Rev-G boards require EEPROM emulation.",        sources = {            "avr/init/crtnut.s",            "avr/init/crtnutram.s",            "avr/init/crtenut.s",            "avr/init/crtenutram.s"        },        targets = {            "avr/init/crtnut.o",            "avr/init/crtnutram.o",            "avr/init/crtenut.o",            "avr/init/crtenutram.o"        },        requires = { "TOOL_CC_AVR", "TOOL_ICC" },    },    --    -- Context Switching    --    {        name = "nutarch_avr_context_gcc",        brief = "Context Switching (AVRGCC)",        provides = { "NUT_CONTEXT_SWITCH" },        requires = { "HW_MCU_AVR", "TOOL_GCC" },        sources = { "avr/os/context_gcc.c" },    },    {        name = "nutarch_avr_context_icc",        brief = "Context Switching (ICCAVR)",        provides = { "NUT_CONTEXT_SWITCH" },        requires = { "HW_MCU_AVR", "TOOL_ICC" },        sources = { "avr/os/context_icc.c" },    },    --    -- System Timer Hardware    --    {        name = "nutarch_avr_ostimer",        brief = "System Timer",        requires = { "HW_MCU_AVR" },        provides = { "NUT_OSTIMER_DEV" },        sources = { "avr/dev/ostimer.c" },    },    --    -- AVR interrupt handling.    --    {        name = "nutarch_avr_irq",        brief = "Interrupt Handler",        requires = { "HW_MCU_AVR" },        provides = { "DEV_IRQ_AVR" },        sources =        {            "avr/dev/ivect01.c",            "avr/dev/ivect02.c",            "avr/dev/ivect03.c",            "avr/dev/ivect04.c",            "avr/dev/ivect05.c",            "avr/dev/ivect06.c",            "avr/dev/ivect07.c",            "avr/dev/ivect08.c",            "avr/dev/ivect09.c",            "avr/dev/ivect10.c",            "avr/dev/ivect11.c",            "avr/dev/ivect12.c",            "avr/dev/ivect13.c",            "avr/dev/ivect14.c",            "avr/dev/ivect15.c",            "avr/dev/ivect16.c",            "avr/dev/ivect17.c",            "avr/dev/ivect18.c",            "avr/dev/ivect19.c",            "avr/dev/ivect20.c",            "avr/dev/ivect21.c",            "avr/dev/ivect22.c",            "avr/dev/ivect23.c",            "avr/dev/ivect24.c",            "avr/dev/ivect25.c",            "avr/dev/ivect26.c",            "avr/dev/ivect27.c",            "avr/dev/ivect28.c",            "avr/dev/ivect29.c",            "avr/dev/ivect30.c",            "avr/dev/ivect31.c",            "avr/dev/ivect32.c",            "avr/dev/ivect33.c",            "avr/dev/ivect34.c",            "avr/dev/ivect35.c",            "avr/dev/ivect36.c",            "avr/dev/irqstack.c"        },        options =        {            {                macro = "IRQSTACK_SIZE",                brief = "Separate Stack",                description = "If this option is enabled, Nut/OS will use a separate "..                              "stack of the specified size for interrupts.\n"..                              "If this option is disabled, make sure to reserve "..                              "additional stack space for each thread.\n\n"..                              "Available for AVR-GCC only.",                requires = { "HW_MCU_AVR", "TOOL_GCC" },                flavor = "booldata",                file = "include/cfg/dev.h"            },        }    },    --    -- Device Drivers    --    {        name = "nutarch_avr_ahdlc",        brief = "AHDLC Protocol",        description = "HDLC driver, required for PPP.",        requires = { "HW_UART_AVR", "NUT_EVENT" },        provides = { "PROTO_HDLC" },        sources = { "avr/dev/ahdlc0.c", "avr/dev/ahdlc1.c", "avr/dev/ahdlcavr.c" },        options =        {            {                macro = "NUT_THREAD_AHDLCRXSTACK",                brief = "Receiver Thread Stack",                description = "Number of bytes to be allocated for the stack of the AHDLC receive thread.",                default = "512",                type = "integer",                file = "include/cfg/ahdlc.h"            }        }    },    {        name = "nutarch_avr_debug",        brief = "UART Debug Output",        description = "This simple UART output driver uses polling instead of "..                      "interrupts and can be used within interrupt routines. It "..                      "is mainly used for debugging and tracing.\n\n"..                      "Call NutRegisterDevice(&devDebug0, 0, 0) for U(S)ART0 and "..                      "NutRegisterDevice(&devDebug1, 0, 0) for U(S)ART1. "..                      "Then you can use any of the stdio functions to open "..                      "device uart0 or uart1 resp.",        requires = { "HW_UART_AVR" },        provides = { "DEV_UART", "DEV_FILE", "DEV_WRITE" },        sources = { "avr/dev/debug0.c", "avr/dev/debug1.c" }    },    {        name = "nutarch_avr_usart0",        brief = "USART0 Driver",        description = "Hardware specific USART driver. Implements hardware "..                      "functions for the generic driver framework.",        requires = {                        "HW_MCU_AVR", "DEV_IRQ_AVR", "DEV_UART_GENERIC",                        "NUT_EVENT", "CRT_HEAPMEM"        },        provides = { "DEV_UART_SPECIFIC" },        sources = { "avr/dev/usart0avr.c" },        options =        {            {                macro = "UART0_RTS_BIT",                brief = "RTS Bit",                description = "Bit number of UART0 RTS handshake output. If enabled, "..                              "the driver provides RS 232 input hardware handshake.\n\n"..                              "Ethernut 2.x:\n"..                              "Short JP1 pins 4 and 6 to select bit 2 on PORTE.",                provides = { "UART0_RTS_BIT" },                flavor = "booldata",                type = "enumerated",                choices = avr_bit_choice,                file = "include/cfg/arch/avrpio.h"            },            {                macro = "UART0_RTS_AVRPORT",                brief = "RTS Port",                description = "Port register name of UART0 RTS handshake output.",                requires = { "UART0_RTS_BIT" },                type = "enumerated",                choices = avr_port_choice,                file = "include/cfg/arch/avrpio.h"            },            {                macro = "UART0_CTS_IRQ",                brief = "CTS Interrupt",                description = "Interrupt number of UART0 CTS handshake input. If enabled, "..                              "the driver provides RS 232 output hardware handshake.\n\n"..                              "Ethernut 2.x:\n"..                              "Short JP1 pins 7 and 8 to select INT7.",                flavor = "booldata",                type = "enumerated",                choices = avr_irq_choice,                file = "include/cfg/arch/avrpio.h"            },            {                macro = "UART0_HDX_BIT",                brief = "Half Duplex Bit",                description = "Bit number of UART0 half duplex control output. If enabled, "..                              "the driver provides RS 485 half duplex mode.",                provides = { "UART0_HDX_BIT" },                flavor = "booldata",                type = "enumerated",                choices = avr_bit_choice,                file = "include/cfg/arch/avrpio.h"            },            {                macro = "UART0_HDX_AVRPORT",                brief = "Half Duplex Port",                description = "Port register name of UART0 half duplex control output.",                requires = { "UART0_HDX_BIT" },                type = "enumerated",                choices = avr_port_choice,                file = "include/cfg/arch/avrpio.h"            },        }    },    {        name = "nutarch_avr_usart1",        brief = "USART1 Driver",        description = "Hardware specific USART driver. Implements hardware "..                      "functions for the generic driver framework.",        requires = {                        "HW_MCU_AVR", "DEV_IRQ_AVR", "DEV_UART_GENERIC",                        "NUT_EVENT", "CRT_HEAPMEM"        },        provides = { "DEV_UART_SPECIFIC" },        sources = { "avr/dev/usart1avr.c" },        options =        {            {                macro = "UART1_RTS_BIT",                brief = "RTS Bit",                description = "Bit number of UART1 RTS handshake output. If enabled, "..                              "the driver provides RS 232 input hardware handshake.\n\n"..                              "Ethernut 2.x:\n"..                              "Short JP1 pins 4 and 6 to select bit 2 on PORTE.",                provides = { "UART1_RTS_BIT" },                flavor = "booldata",                type = "enumerated",                choices = avr_bit_choice,                file = "include/cfg/arch/avrpio.h"            },            {                macro = "UART1_RTS_AVRPORT",                brief = "RTS Port",                description = "Port register name of UART1 RTS handshake output.",                requires = { "UART1_RTS_BIT" },                type = "enumerated",                choices = avr_port_choice,                file = "include/cfg/arch/avrpio.h"            },            {                macro = "UART1_CTS_IRQ",                brief = "CTS Interrupt",                description = "Interrupt number of UART1 CTS handshake input. If enabled, "..                              "the driver provides RS 232 output hardware handshake.\n\n"..                              "Ethernut 2.x:\n"..                              "Short JP1 pins 7 and 8 to select INT7.",                flavor = "booldata",                type = "enumerated",                choices = avr_bit_choice,                file = "include/cfg/arch/avrpio.h"            },            {

⌨️ 快捷键说明

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