How to call c macro with parameters #18307
Answered
by
JalonSolov
Blackrose
asked this question in
Questions and Answers
-
Hi all, I try to use v to read/write data through spidev0.0 device. In c, the write data will called ioctl function.Below is example ioctl(fd, SPI_IOC_MESSAGE(1), &tr); the error: unknown function: C.SPI_IOC_MESSAGE
rc := int(C.ioctl(this.fd, C.SPI_IOC_MESSAGE(1), &transfer)) Does the v not support call c macro with parameter? If so, how can this situation be resolved? |
Beta Was this translation helpful? Give feedback.
Answered by
JalonSolov
May 30, 2023
Replies: 1 comment
-
You have to define |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Blackrose
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You have to define
C.SPI_IOC_MESSAGE
in your V code, for V to recognize it. V does not parse.h
files, so it cannot know about it otherwise.