Hi,
I have a printer attached to imx6ul using SPI. It is a thermal printer so on printing the printer gets heated up so I have change the printing time according to the Head temperature. Now the problem is If I read from the sysfs interface from Application space it is taking too much time for printing and my printer head is getting damaged.
Is there any way to do in the kernel space itself. I have to read the ADC for each dotted line printing and take decision for heating time or else I should terminate the printing.
Thanks
CHandrasekhar
已解决! 转到解答。
Hi Chandrasekhar
reason may be that when vf610 adc driver is disabled, adc clocks are gated.
Best regards
igor
Hi Chandra
one can look for answer on that linux generic question on
linux - How to access kernel space from user space? - Stack Overflow
or probably write own application using driver sources described in Chapter 53 ADC Driver
attached Linux Manual.
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Igor,
I am able to read ADC values from sysfs interface.
I am going through the imx-test-5.7 for /dev/mem interface accessing ADC. I found a strange issue . I enable vf610 adc driver and running memtool on ADC, what ever data I write to ADC registers when reading back I am able to read the updated values.
When I disable the vf610 adc driver from make menuconfig and build the kernel and update it and after running memtool on adc values are not updating. Below is the log.
root@imx6ulevk:/# ./a.out ADC1.CFG.MODE=1
write 0x00000001 to Bit 2..3 of 0x02198014
root@imx6ulevk:/# ./a.out ADC1.CFG.MODE 1
ADC1 Addr:0x2198000
ADC1.CFG Addr:0x02198014 Value:0x00000200 - Selects the mode of operation, clock source, clock divide, configure for low power, long sample time, high speed configuration and selects the sample time duration.
ADC1.CFG.MODE(2..3) :0x0
Used to set the ADC resolution mode.
Can you tell me what is the wrong I am doing.
Thanks and Regards,
Chandrasekhar
hi Chandra sekhar
i am trying to interface thermal printer using spi .. getting full of confusions regarding driver code . can you please suggest me the procedure of how to interface thermal printer . here i am going with imx6solo sabresd board. your info more valuable for me.
regards,
srikrishna
It depends on Thermal printer you use. There will be a sequence to use, that you have to push the data to SPI and Enable Strobes and VH and rotate paper. I don't know what is your exact requirement.
I have just gone through the IIO subsystem in drivers, there I have found a source file inkern.c I understood that we can call the functions present in inkern.c file to read a ADC value. Is that correct ?? Below is the link for the same from stackoverflow