Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] accessing bits (e.g. of ports)

2005-01-31 by Stefan Trethan

On Mon, 31 Jan 2005 12:31:51 -0000, Paul Maddox  
<P.Maddox@signal.qinetiq.com> wrote:

>
> Stefan,
>
>> Why, and if yes how, can i get something like that:
>> PORTC.0 = 1;
>> or
>> PC0 = 1;
>> or if it must be
>> PORTC.BIT0 =1;
> why don't you use #define?
> to do some of this?
> A lot depends on your compiler, for example CV-AVR is happy with ;-
> PORTC.0 = 1;
> PAul


I use gcc.
It doesn't accept PortC.0 = 1;

In the IO.H (for the chip) there is a section, e.g.


/* DDRB */
#define DDB7	7
#define DDB6	6
#define DDB5	5
#define DDB4	4
#define DDB3	3
#define DDB2	2
#define DDB1	1
#define DDB0	0

I wonder what it is good for?


I would use define if i could figure out how ;-)

ST

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.