errr...
no... basically.
I think some inline assm macros will solve this problem.
Obviously, you can do it with bitfields, but the code will not be efficient.
~d
On Monday 09 December 2002 08:01, Tim Wade wrote:
> Hi ho
>
> Just a quick query...
>
> I am writing a lot of code to do pin bashing and am getting a lot of:
>
> #define FPGA_POWER_PORT_SELECT P6SEL
> #define FPGA_POWER_PORT_IN P6IN
> #define FPGA_POWER_PORT_OUT P6OUT
> #define FPGA_POWER_PORT_DIRECTION P6DIR
> #define FPGA_POWER_PIN (1 << 4)
>
> void
> powerOn(void)
> {
> FPGA_POWER_PORT_OUT |= FPGA_POWER_PIN;
> FPGA_POWER_PORT_DIRECTION |= FPGA_POWER_PIN;
> }
>
> What i would like to do is something like this:
>
> const Msp430Pin l_fpga_power_pin(6, 4);
>
> then:
>
> l_fpga_power_pin = 1; // set pin high
>
> or:
>
> state = l_fpga_power_pin; // check pin level
>
> or what would be really nice:
>
> l_fpga_power_pin = Z; // make pin an input!
>
> when i have a lot of pins it gets pretty messy doing it the current way
> and from time to time i get the |= and the &=~ the wrong way around etc.
> etc.
>
> The PIC compiler we also use has all the standard pins already defined so
> you can do:
>
> RB0 = 1; // set bit 0 of PORTB high
>
> or what ever... it uses bit fields but i am not sure if we could do
> something similar on the MSP430 with GCC and still get efficient code?
>
> as you have probably guessed i am a hardware type who mostly write VHDL!!
> maybe a perl/python/ruby script?
>
> any ideas?
>
> cheers
> Tim
>
> ____
> This communication contains information which is confidential and the
> copyright of Nautronix.
>
> If you are not the intended recipient of this communication please delete
> and destroy all copies and advise Nautronix immediately. If you are the
> intended recipient of this communication you should not copy, disclose or
> distribute this communication without the prior authority of Nautronix. Any
> views expressed in this Communication are those of the individual sender,
> except where the sender specifically states them to be the views of
> Nautronix.
>
> Except as required at law, Nautronix does not represent, warrant and/or
> guarantee that the integrity of this communication has been maintained nor
> that the communication is free of errors, virus, interception or
> interference.
>
>
>
> -------------------------------------------------------
> 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
********************************************************************/