linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* RE: Howto set DIO on MPC-5200 Lite
@ 2007-03-19 13:18 Josu Onandia
  2007-03-19 18:16 ` Matthias Fechner
  2007-03-22 20:04 ` Matthias Fechner
  0 siblings, 2 replies; 11+ messages in thread
From: Josu Onandia @ 2007-03-19 13:18 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 1671 bytes --]

Some sample code. Hope this helps.

Regards

Josu Onandia

//   PSC2_0  ---->  J20 pin 2
//   PSC2_1  ---->  J20 pin 4
//   PSC2_2  ---->  J20 pin 6
//   PSC2_3  ---->  J20 pin 8
//
//   GND ---- J20 pins 15,17,19,20

static void psc2_configure_pins(void)
{
	struct mpc5xxx_gpio *gpio;
	
	gpio = (struct mpc5xxx_gpio*) MPC5xxx_GPIO;
	
	gpio->port_config &= ~(0x00000070);
	gpio->simple_gpioe |= 0x000000F0;
	gpio->simple_ode &= ~0x000000F0;
	gpio->simple_ddr |= 0x000000F0;
}
/* PSC2   0 to 3 pins */
static inline void psc2_pin_on(int pin)
{
	struct mpc5xxx_gpio *gpio;
	
	if((pin < 0) || (pin > 3))
		return;
	gpio = (struct mpc5xxx_gpio*) MPC5xxx_GPIO;
	gpio->simple_dvo |= (1 << (pin + 4));
}
static inline void psc2_pin_off(int pin)
{
	struct mpc5xxx_gpio *gpio;
	
	if((pin < 0) || (pin > 3))
		return;
	
	gpio = (struct mpc5xxx_gpio*) MPC5xxx_GPIO;
	
	gpio->simple_dvo &= ~ (1 << (pin + 4));
}



-----Mensaje original-----
De: linuxppc-embedded-bounces+jonandia=aotek.es@ozlabs.org en nombre de Matthias Fechner
Enviado el: lun 19/03/2007 8:31
Para: linuxppc-embedded@ozlabs.org
Asunto: Howto set DIO on MPC-5200 Lite
 
Hi,

how can I set the DIO ports from a MPC-5200 Lite?


Best regards,
Matthias

-- 

"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the universe trying to
produce bigger and better idiots. So far, the universe is winning." --
Rich Cook
_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded


[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 3239 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Howto set DIO on MPC-5200 Lite
@ 2007-03-19  7:31 Matthias Fechner
  2007-03-19  8:16 ` Sylvain Munaut
  2007-03-19  8:45 ` Pedro Luis D. L.
  0 siblings, 2 replies; 11+ messages in thread
From: Matthias Fechner @ 2007-03-19  7:31 UTC (permalink / raw)
  To: linuxppc-embedded

Hi,

how can I set the DIO ports from a MPC-5200 Lite?


Best regards,
Matthias

-- 

"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the universe trying to
produce bigger and better idiots. So far, the universe is winning." --
Rich Cook

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-03-23 12:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-19 13:18 Howto set DIO on MPC-5200 Lite Josu Onandia
2007-03-19 18:16 ` Matthias Fechner
2007-03-22 20:04 ` Matthias Fechner
2007-03-22 22:48   ` Steven Kaiser
2007-03-23 12:02     ` Sylvain Munaut
  -- strict thread matches above, loose matches on Subject: below --
2007-03-19  7:31 Matthias Fechner
2007-03-19  8:16 ` Sylvain Munaut
2007-03-19  8:45 ` Pedro Luis D. L.
2007-03-19  9:48   ` Matthias Fechner
2007-03-19 10:12     ` Pedro Luis D. L.
2007-03-19 10:14     ` Sylvain Munaut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).