How to use XMOS streaming chan & chan in C function.

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
jagspaul
Experienced Member
Posts: 117
Joined: Tue Oct 18, 2011 3:28 pm

How to use XMOS streaming chan & chan in C function.

Post by jagspaul »

Hi,

My code is combined of XC & C. I want to use XMOS channels between Xc & C functions.

main.xc file

Code: Select all

streaming chan chan1
chan chan2
int main(void)
{
    par
    {
          fun_c(chan1,chan2);
          fun_xc(chan1,chan2);

     }
}
fun_c.c file

Code: Select all

 fun_c(chan1,chan2)
{
    ........
      .......

}
fun_xc.xc file

Code: Select all

 fun_xc(chan1,chan2)
{
    ........
      .......

}
Can anybody help me how to do this?

Thanks & regards
jags


User avatar
Obtuse
Member++
Posts: 29
Joined: Mon Jul 09, 2012 11:54 pm

Post by Obtuse »

jagspaul wrote:Hi,

My code is combined of XC & C. I want to use XMOS channels between Xc & C functions.

jags
jags,

Unless I'm misunderstanding,,,

Channels are a hardware path and in order to use C you would have to reproduce the channel end in C. That would mean an assembly routine driver compatible with the XC function on the other end of the channel.

Yes?
User avatar
segher
XCore Expert
Posts: 844
Joined: Sun Jul 11, 2010 1:31 am
Contact:

Post by segher »

See http://www.xmos.com/call-between-cc-and-xc for
how to pass chanends to C functions. How to actually use them
is a different story, of course.
jagspaul
Experienced Member
Posts: 117
Joined: Tue Oct 18, 2011 3:28 pm

Post by jagspaul »

Thanks All.

I have got it. It's working.

regards
jags
Post Reply