element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • 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
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • 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
Autodesk EAGLE
  • Products
  • More
Autodesk EAGLE
EAGLE User Support (English) C-header generator
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Autodesk EAGLE to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 2 replies
  • Subscribers 180 subscribers
  • Views 295 views
  • Users 0 members are here
Related

C-header generator

Former Member
Former Member over 15 years ago

I think a tool (or a script, TBD) able to read .sch file and generate .c/.h file with #define will spare a lot of time.

 

I mean something able to outputs something like (in case of a PIC):

 

#define PORTAbits.RA3 LED

 

If UC pin will have an option "input / output / open drain / pull-up enabled / analog", the generator will also be able to generate mask for ports direction regs:

 

#define TRISA_MASK 0x1234

 

The shematic errors checker will be able to generate new type of errors :

- "UC1.RA4 and UC2.RB6 connected together and defined as output"

- "UC1.RB14 defined as input and unconnected. Don't leave unused inputs unconnected"

 

A such powerful tool could spare a lot of time and avoid a lot of errors!

  • Sign in to reply
  • Cancel
  • Former Member
    Former Member over 15 years ago

    Matt Collinge wrote on Mon, 19 July 2010 08:50

    I think a tool (or a script, TBD) able to read .sch file and generate

    .c/.h file with #define will spare a lot of time.

     

    I mean something able to outputs something like (in case of a PIC):

     

    #define PORTAbits.RA3 LED

     

    I have something like that in my PIC http://www.embedinc.com/pic but it

    doesn't interface with Eagle.  Check out the

    http://www.embedinc.com/pic/prepic.txt.htm commands /INBIT and /OUTBIT.

    These allow you to define a symbolic name for each I/O line and how it is

    used.

     

    I hadn't thought of merging this with Eagle schematics, but that's a good

    idea.  I'm not sure which direction it should work in though.  If starting

    with Eagle, the net name connected to a pin can become the pin name in the

    PIC source code, but it won't know the pin direction.  It will be tricky to

    automate this, but it could be possible.  Going the other direction may

    make more sense in that the source code should probably be the master

    definition and the schematic should reflect it.  However, I don't think pin

    directions can be changed on the fly for a instance of a part in the

    schematic.  Actually this is a problem with both methods.

     

    --

    Web access to CadSoft support forums at www.eaglecentral.ca.  Where the CadSoft EAGLE community meets.

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 15 years ago in reply to Former Member

    I think it should be the schematic which would define the pin names.  The schematic pins should be annotated with pin directions, maybe from the IC library.  They can be in, out, i/o, or special/alternate function.  This would allow the header generator to define either specific pin names for each, or a generic name which supports all directions and special or alternate functions.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • 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 © 2026 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