element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Moto Mods
  • Products
  • Manufacturers
  • Moto Mods
  • More
  • Cancel
Moto Mods
Forum Extending Blinky to talk to i2c breakout board
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Moto Mods to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 3 replies
  • Answers 1 answer
  • Subscribers 56 subscribers
  • Views 633 views
  • Users 0 members are here
  • i2c
  • howto
  • moto mdk
Related

Extending Blinky to talk to i2c breakout board

akamediasystem
akamediasystem over 7 years ago

Hello, I'm playing around with the Moto Mods developer resources and have gotten the 'blinky' examples working. Embedded development is a bit new to me, so this has been a lot to learn at once! My apologies in advance if this question is inappropriate for here.

 

I want to extend the "Blinky" example so that the toggle switch in the Android app causes a simple change in an i2c IC that I'm adding to the perfboard. Do I need to create an entire "device driver" for my IC (the TI DRV2667)? (If so, can anyone point me to a guide through that process?) Or can I just extend "stm32_modsraw_blinky.c" to use the i2c methods at "<nuttx/i2c.h>" like other examples do?

 

...as you might have gathered, I'm coming from the world of Arduino, so both embedded linux and the particular microcontroller here are both new to me. I am a determined learner, though, so any help or links would be much appreciated!

 

AKA

  • Sign in to reply
  • Cancel
  • akamediasystem
    0 akamediasystem over 7 years ago

    ...just an update, I found that the TI IC comes with a device driver(!). It's at: DRV2667SW-LINUX Linux Driver for DRV2667 | TI.com

     

    So now I *think* what I have to do is:

    * change the TI-supplied device driver so that all the includes resolve to the correct nuttx resources (could anyone please point me to a guide or post about this?)

    * tweak "stm32_modsraw_blinky.c" so that it uses the device driver

    * update the Make.defs file in the same directory as the driver file, so nuttx knows about the new driver (and in general, follow the instructions here: https://acassis.wordpress.com/2013/06/11/how-to-create-a-driver-for-nuttx/  )

    * find a way to test if the new circuit and firmware are working

     

     

    ...does this all sound right? I apologize if this is all too basic for everyone, I've just been having trouble finding where to learn all these things in one place.

     

    Thanks in advance for any help or suggestions you can provide!

     

    AKA

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • motomodsdev
    0 motomodsdev over 7 years ago in reply to akamediasystem

    Take a look at the nuttx Porting Guide, that should have some advice.  You're on the right track, but you'll need to actually write an i2c driver.  You don't need to implement all the functionality, but you can limit it to just what you plan on using.  You'll need to configure the appropriate MuC pins as i2c, make sure addressing is correct, etc, you'll do this in menuconfig (both under STM32 Peripherals and under Device Drivers).  In the MDK, you can look at the BQ driver, or the MAX17050 fuel gauge.  Both of those connect to the MuC via i2c and can be found in nuttx/nuttx/drivers/power.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • akamediasystem
    0 akamediasystem over 7 years ago in reply to motomodsdev

    Thank you, that's just the sort of helpful push I was hoping for!

     

    ...since I'm a bit new here, I'm not sure what's best, accepting this as an "answer" or leaving the question open (for I will inevitably have updates and questions later on). I'm going to leave it open for now, but please chime in if that's not what I should do!

     

    Best,

     

    AKA

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube