Hi everyone,
disappointed with altitude readings in GPS tracking software on my SGS2 I9100, I got an idea to implant a pressure sensor into it. Not that I can't live without it, it's more like a hacking exercise for fun. Anyways, let me explain the idea.
Few newer devices have pressure sensor built in. I.e. SGS3 uses LPS331AP from ST (mentioned in kernel sources and on some websites). It's well documented and is available to buy. Hooking it up (space challenges aside) would be pretty straightforward. I am certain i can find supply and SDA/SCL lines to connect to. However, I cannot hook up interrupt to main processor, and there is probably nothing to be done about it. OK, let's imagine I succeed in soldering, don't screw up the whole mainboard, and have a sensor attached.
Now, I'd need a custom ROM, or at least kernel aware of my new sensor. If all the wiring would be standard (including interrupt), I could just copy relevant parts from sources for SGS3, compile it, and expect it to work. Or something along the lines.
So, here is a question: can I communicate to pressure sensor without interrupt connected? Sensor itself supports it, but does android? With reasonable amount of hacking, of course.
I did quick search in kernel sources for SGS3, and I see it expects an interrupt input from lps331 during some init routines. However, I cannot figure out yet whether it always needs it, or can it live without somehow. I will go on reading sources. In particular, I'll look how exactly does HAL interacts with the sensor.
In the meantime, maybe someone more knowledgeable has some advice? I have very vague idea about linux kernel working, and never before looked into one for smartphone. I can read the sources, but my programming experience is limited. So, any tips are appreciated. Especially if you think it's hopeless :)
disappointed with altitude readings in GPS tracking software on my SGS2 I9100, I got an idea to implant a pressure sensor into it. Not that I can't live without it, it's more like a hacking exercise for fun. Anyways, let me explain the idea.
Few newer devices have pressure sensor built in. I.e. SGS3 uses LPS331AP from ST (mentioned in kernel sources and on some websites). It's well documented and is available to buy. Hooking it up (space challenges aside) would be pretty straightforward. I am certain i can find supply and SDA/SCL lines to connect to. However, I cannot hook up interrupt to main processor, and there is probably nothing to be done about it. OK, let's imagine I succeed in soldering, don't screw up the whole mainboard, and have a sensor attached.
Now, I'd need a custom ROM, or at least kernel aware of my new sensor. If all the wiring would be standard (including interrupt), I could just copy relevant parts from sources for SGS3, compile it, and expect it to work. Or something along the lines.
So, here is a question: can I communicate to pressure sensor without interrupt connected? Sensor itself supports it, but does android? With reasonable amount of hacking, of course.
I did quick search in kernel sources for SGS3, and I see it expects an interrupt input from lps331 during some init routines. However, I cannot figure out yet whether it always needs it, or can it live without somehow. I will go on reading sources. In particular, I'll look how exactly does HAL interacts with the sensor.
In the meantime, maybe someone more knowledgeable has some advice? I have very vague idea about linux kernel working, and never before looked into one for smartphone. I can read the sources, but my programming experience is limited. So, any tips are appreciated. Especially if you think it's hopeless :)