Jump to content
Sign in to follow this  

Creating A Own Lib File

Recommended Posts

i would like to create special libary function .

what is syntax.

how could i do that?

help me.

A library is a precompiled binary file that means the compilation of the library code is only required once.


To create a library:

1) Create a header file containing function prototypes.

2) Create a .c file containing the implementation of the functions.

3) Set the Compiler options->Compile options->Output Type to Library.

4) Build the code.

If successful a .lib file is produce.


To use a library:

1) #include the library header file in any source file that will use any of the library functions.

2) Add the .lib file to the project.

3) Build the code to link in the library.


I hope that helps.




Share this post

Link to post
Share on other sites


I am going to write down a library with a free pin assignement. I mean, I need to drive a clock signal out from the PIC and I would like that pin to be RA3. For instance you could use the same library I wrote, but due to you hardware desing you need to drive the clock signal out from RB5 (the same can be done also for inputs) How I can do it? How can I "teach the library" that the pin is not static but it can be assigned by the library user? How can I manage TRISx and PORTx, leaving the freedom to assign x to a not pre-defined port?

Thank you.



Share this post

Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...