Just added to the cvs tree.
No any changes required. (just update your cvs copy, do not forget '-d' flag.
gcc and libc. gcc received a significant improvement to bitfield operations.
Recompile. have fun.)
The declaration is _slightly_ different than suggested.
Please check <msp430/iostructures.h>
Please also read 'devheaders' file in msp430-libc/doc.
~d
On Monday 09 December 2002 16:58, Dmitry wrote:
> Folks,
> I am thinking of changind some io API (not really changing, but
> extensions). So, will it worth if we declare ports as structures:
> ---------------------------------------------------------------------------
>------------ typedef union port {
> volatile unsigned char reg_p;
> volatile struct {
> unsigned __p0:1, __p1:1, __p2:1, __p3:1, __p4:1, __p5:1, __p6:1,
> __p7:1; } __pin;
> } ioport_t;
>
> #define pin0 __pin.__p0
> #define pin1 __pin.__p1
> #define pin2 __pin.__p2
> #define pin3 __pin.__p3
> #define pin4 __pin.__p4
> #define pin5 __pin.__p5
> #define pin6 __pin.__p6
> #define pin7 __pin.__p7
>
> typedef struct {
> ioport_t in, out,dir,ifg,ies,ie,sel;
> } xport_t;
>
> xport_t port0 asm("0x10");
> /// and so on...
> ----------------------------------------------------------------------
> So, user can write:
> port0.out.pin1 = 1;
> xxx = port0.in.pin2;
> port0.reg_p = 0x7e;
> or something.
>
> Of course this will not discard existing declarations.
>
> If we're going to add this declaration to header files, we need to choose a
> name for portX. Will 'port0 .. port6' be suitable for it?
>
> Or just forget about it?
>
> ~d
>
>
> /********************************************************************
> ("`-''-/").___..--''"`-._ (\ Dimmy the Wild UA1ACZ
> `6_ 6 ) `-. ( ).`-.__.`) Enterprise Information Sys
> (_Y_.)' ._ ) `._ `. ``-..-' Nevsky prospekt, 20 / 44
> _..`--'_..-_/ /--'_.' ,' Saint Petersburg, Russia
> (il),-'' (li),' ((!.-' +7 (812) 3468202, 5585314
> ********************************************************************/
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Mspgcc-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
--
/********************************************************************
("`-''-/").___..--''"`-._ (\ Dimmy the Wild UA1ACZ
`6_ 6 ) `-. ( ).`-.__.`) Enterprise Information Sys
(_Y_.)' ._ ) `._ `. ``-..-' Nevsky prospekt, 20 / 44
_..`--'_..-_/ /--'_.' ,' Saint Petersburg, Russia
(il),-'' (li),' ((!.-' +7 (812) 3468202, 5585314
********************************************************************/