Custom deck for two TCS34725 RGB sensors and TCA9548A I2C MUX #462
-
Dear Crazyflie DEVs, I am currently working on a project that involves integrating 2x: TCS34725 RGB color sensor and a TCA9548A 1-to-8 I2C multiplexer on the Crazyflie. I have done some research and the best approach seems to be developing my own deck using either the prototyping deck or the breakout deck. Both of which I have in my possession. Q1: Is this the correct approach? Do the DEVs (or anyone else reading this) recommend a different approach? The RGB sensors have the following interfaces that I need to use:
Currently, I have a C-based implementation of the whole system working on an Arduino DUE. The next step that I have to do is to migrate my code to the Crazyflie. With the above information, I'm sure I can figure it out for my own system. Using the functions provided in the “i2cdev.c” source file. In addition, I have found some information on how to import external driver files here: Link. The one part I'm still missing is how to use a form of GPIO interrupt. E.g. Whenever the pin is pulled LOW some code is run by the system. Q2: Could the DEVs help here and point me in the right direction? I did however find some workarounds achieving a similar result: Thank you in advance for answering my questions. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Q1: If the sensors are easy enough to solder without making a PCB design the prototyping deck should do the job. Q2: There's no deck interface to simply use pin interrupts but you can use the system functions. First find out what pin you would like to use. If e.g. you choose IO1, this is mapped to PB8. EXTI is the STM32 pin interrupt system which you could read up on but in short PB8 is mapped to EXTI interrupt 8. The system already has callback functions for the EXTI interrupts so you have to add this to you deck driver file and also enable it. Use e.g. the uart_syslink.c as an example. Enabling of the interrupt is done here. Hope this gets you started! |
Beta Was this translation helpful? Give feedback.
Q1: If the sensors are easy enough to solder without making a PCB design the prototyping deck should do the job.
Q2: There's no deck interface to simply use pin interrupts but you can use the system functions. First find out what pin you would like to use. If e.g. you choose IO1, this is mapped to PB8. EXTI is the STM32 pin interrupt system which you could read up on but in short PB8 is mapped to EXTI interrupt 8. The system already has callback functions for the EXTI interrupts so you have to add this to you deck driver file and also enable it. Use e.g. the uart_syslink.c as an example. Enabling of the interrupt is done here. Hope this gets you started!