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

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

Re: [avr-libc-dev] Nice to have: XCK Definition


From: Frédéric Nadeau
Subject: Re: [avr-libc-dev] Nice to have: XCK Definition
Date: Tue, 10 Mar 2009 07:16:35 -0500

My original plan was to have something like this:

#define INT0_DDR DDRB
#define INT0_PORT PORTB
#define INT0_PIN PINB
#define INT0_IDX 1

Witch let people use it in a more or less common way:
INT0_DDR |= _BV(INT0_IDX );

Vs. your idea:

#define INT0 B,1

I totally love the idea. I see only one small downer; some macro will
have to be added in io.h(or at least a file that io.h include).

A word on progress:
I'm almost done with my program to append the defines at the end of
each ioxxx.h. I did use the original AVR Studio xml(I scraped my linux
machine days ago, so I did not use Bob xml file). Should I report
errors in AVR Studio xml to someone?(Like PD0 being written as "PDO")

Since this require a lot of file to be modified, I was thinking that
it might be a good idea to make a brench in the CVS for that feature,
and when it is done and clean merge it with HEAD.

I'll let you know when I'm done with my program. In the meanwhile, I
would like to know people opinion on wheter to use the pin_macro Vs
the more or less conventional way.

Thanks
Frédéric

On Tue, Mar 10, 2009 at 4:20 AM, Oleksandr Redchuk <address@hidden> wrote:
> 2009/3/9 Frédéric Nadeau <address@hidden>:
>
>> My suggestion is adding the following:
>>
>> #define XCK_DDR DDRD
>> #define XCK_DDRx DDD4
>
> May be better
>
> #define XCK D,4
>
> or even
>
> #define XCK D,4,H
>
> with dummy High active level symbol? This 'H' not needed for XCK or
> MOSI or OC1A but needed for uniformity with user-defined pins like
> #define LED_ERROR     B,0,L
> #define PUMP_RELAY  B,1,H
>
> That sort of definitions usable with macros like in attached header file.
> I use this macro from about 1999-2000.
>
>
> --
> wbr,
> ReAl
>




reply via email to

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