Hello,
is it possible to use the function partin(my_32bit_buffered_port, count) in a select case statement? My intention is, that the case block is only triggered, when "count" bits are read from the port into the port's shift buffer. I need a syntax like "case my_32bit_buffered_port :> my_var: ..." but with a different number of bits.
Syntax for partin() in select case statement Topic is solved
-
- XCore Addict
- Posts: 144
- Joined: Wed Jun 29, 2016 8:59 am
-
- XCore Addict
- Posts: 144
- Joined: Wed Jun 29, 2016 8:59 am
I think, it is not possible, because you can only use the operators :> and <: in the case-statement to read and write resources. Resource can only be ports, timers or channels, but a function like partin() is not a resource. Therefore I guess, it is not possible.
-
- XCore Addict
- Posts: 144
- Joined: Wed Jun 29, 2016 8:59 am
It's possible with inline assembler like this:
For more informations look here: https://www.xcore.com/viewtopic.php?f=2 ... 974#p33974
Code: Select all
asm("setpsc res[%0], %1" :: "r"(p_in), "r"(bit_width));