interrupt handler arguments

J

jmariano

Guest
Hi everybody,


Sorry if this is a basic question.

I'm trying to implement a interrupt handler for the UARTLite in my
mBlaze system. The chain is: mBlaze->IntCtrl->Uart. The IntCtrl is to
add future interrupt sources. I'm using as an example the code from
XAPP808 - FPGA Motor Control Reference Design by Craig Hackney.


What I don't understand is the actual handler structure. It looks like
this:

void serialCommRecv (void *param, unsigned int byteCount)
{
do
{
// do something
} while ((byteCount = XUartLite_Recv(( XUartLite * ) param,
charBuffer, 1)));
}

I don't understand what are the handler function arguments values when
the function is called and what is the purpose of using arguments in a
handler? Can anyone explain that to me?


Tanks,

mariano
 
In article <6016bdb3-2ece-44d4-8945-
cb442b57d55b@t11g2000vbc.googlegroups.com>, jmariano65@gmail.com says...
Hi everybody,


Sorry if this is a basic question.

I'm trying to implement a interrupt handler for the UARTLite in my
mBlaze system. The chain is: mBlaze->IntCtrl->Uart. The IntCtrl is to
add future interrupt sources. I'm using as an example the code from
XAPP808 - FPGA Motor Control Reference Design by Craig Hackney.


What I don't understand is the actual handler structure. It looks like
this:

void serialCommRecv (void *param, unsigned int byteCount)
{
do
{
// do something
} while ((byteCount = XUartLite_Recv(( XUartLite * ) param,
charBuffer, 1)));
}

I don't understand what are the handler function arguments values when
the function is called and what is the purpose of using arguments in a
handler? Can anyone explain that to me?


Tanks,

mariano
You are correct in questioning the routine you posted. This must be
called from some other code that loads up the calling parameter
arguments. A direct interrupt handler would not have any parameters.

--

Michael Karas
Carousel Design Solutions
http://www.carousel-design.com
 
On Sep 19, 6:55 am, Michael Karas <mka...@carouselDASHdesign.com>
wrote:
In article <6016bdb3-2ece-44d4-8945-
cb442b57d...@t11g2000vbc.googlegroups.com>, jmarian...@gmail.com says...





Hi everybody,

Sorry if this is a basic question.

I'm trying to implement a interrupt handler for the UARTLite in my
mBlaze system. The chain is: mBlaze->IntCtrl->Uart. The IntCtrl is to
add future interrupt sources.  I'm using as an example the code from
XAPP808 - FPGA Motor Control Reference Design by Craig Hackney.

What I don't understand is the actual handler structure. It looks like
this:

void serialCommRecv (void *param, unsigned int byteCount)
{
   do
   {
      // do something
   } while ((byteCount = XUartLite_Recv(( XUartLite *  ) param,
charBuffer, 1)));
}

I don't understand what are the handler function arguments values when
the function is called and what is the purpose of using arguments in a
handler? Can anyone explain that to me?

Tanks,

mariano

You are correct in questioning the routine you posted. This must be
called from some other code that loads up the calling parameter
arguments. A direct interrupt handler would not have any parameters.

--

Michael Karas
Carousel Design Solutionshttp://www.carousel-design.com
OK Michael, Tanks. I'm not used to program enbeded systens, hence my
question.
regards,

mariano
 

Welcome to EDABoard.com

Sponsor

Back
Top