avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] [bug #25300] Additional i/o port names


From: anonymous
Subject: [avr-libc-dev] [bug #25300] Additional i/o port names
Date: Sun, 11 Jan 2009 11:46:29 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.5) Gecko/2008120122 AdCentriaIM/1.7 MRA 5.3 (build 02552) Firefox/3.0.5

URL:
  <http://savannah.nongnu.org/bugs/?25300>

                 Summary: Additional i/o port names
                 Project: AVR C Runtime Library
            Submitted by: None
            Submitted on: Вск 11 Янв 2009 11:46:27
                Category: Feature Request
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Header files
                  Status: None
        Percent Complete: 0%
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
                 Release: Any
           Fixed Release: None

    _______________________________________________________

Details:

It's a common thing when single pin on a device represents several features,
for example atmega8:
PORTB:
  PB5 can be used as regular i/o port or SCK for SPI interface
  PB4 can be used as regular i/o port or MISO for SPI interface
  PB3 can be used as regular i/o port or MOSI for SPI interface
  PB2 can be used as regular i/o port or SS for SPI interface
PORTD:
  PD0 can be used as regular i/o port or RX for usart
  PD1 can be used as regular i/o port or TX for usart
etc...
Almost every pin have several meanings. So if I'm trying to build software
wich communicates using for example SPI interface, i have to use some of i/o
ports in another meaning(write logical 1/0 to SS pin to select/deselect slave
device) So i think it's a good idea to put such definitions to headers:

for example:
#define SS   PB2
#define MOSI PB3
#define MISO PB4
#define SCK  PB5
#define SPI_PORT PORTB


#define RX PD0
#define TX PD1
#define USART_PORT PORTD




    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?25300>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/






reply via email to

[Prev in Thread] Current Thread [Next in Thread]