Not applicable
Oct 05, 2015
04:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 05, 2015
04:37 AM
I have a problem to understand how I can read out status of different portpins in a for loop
I want to read the the status of port pin p2.0 to p.2.
but how I can do that?
i found only the solution to do this only with each pin separate?
pin_status = DIGITAL_IO_GetInput(&DIGITAL_IO_0);
if(pin_status == 1)
{
// Add application code here
}
else
{
// Add application code here
}
hopefully you have a better solution for me?
if this routine against? the app idea?
XMC_GPIO_SetOutputHigh(handler->gpio_port, handler->gpio_pin);
How I can give the port itself an name with the app?
Sorry for all my questions. I programmed before all the time only in C on AVR controllers 🙂
thanks a lot
I want to read the the status of port pin p2.0 to p.2.
but how I can do that?
i found only the solution to do this only with each pin separate?
pin_status = DIGITAL_IO_GetInput(&DIGITAL_IO_0);
if(pin_status == 1)
{
// Add application code here
}
else
{
// Add application code here
}
hopefully you have a better solution for me?
if this routine against? the app idea?
XMC_GPIO_SetOutputHigh(handler->gpio_port, handler->gpio_pin);
How I can give the port itself an name with the app?
Sorry for all my questions. I programmed before all the time only in C on AVR controllers 🙂
thanks a lot
1 Reply
Oct 07, 2015
02:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 07, 2015
02:14 AM
Hello,
To read the 3 pins together, I would simply read directly the port's IN register and masked the unnecessary bits accordingly.
For example:
pin_status = PORT2->IN & 0x7;
The intention of the function XMC_GPIO_SetOutputHigh() is to output a high level of a General Purpose Output pin.
Yes, you can rename the port pin instance label from the APP view as shown in the attached figure:
Regards,
Min Wei
To read the 3 pins together, I would simply read directly the port's IN register and masked the unnecessary bits accordingly.
For example:
pin_status = PORT2->IN & 0x7;
The intention of the function XMC_GPIO_SetOutputHigh() is to output a high level of a General Purpose Output pin.
Yes, you can rename the port pin instance label from the APP view as shown in the attached figure:
Regards,
Min Wei