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/




_______________________________________________
AVR-libc-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-libc-dev

Reply via email to