Adding a library in AS7

Go To Last Post
10 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This seems like it should be easy, but a) I'm extremely new to AS (as well as to the rest of the toolchain - 99% of my prior uC experience has been straight Arduino) and b) I can't seem to find anything that is specifically on-point.  Also, the fact that Microchip seems to have broken all their links, including the one from AS7 to the help system, doesn't help....

 

I want to use the Peter Fleury I2C/TWI library (http://homepage.hispeed.ch/peter...) and can't figure out how to install it in AS7.  Lots of installation instructions seem to require the library to contain a .a file.  Do I really need to build one?  Or is there a simpler way?

 

Detailed instructions (or a link to them) would be much appreciated. 

This topic has a solution.
Last Edited: Fri. Jan 12, 2018 - 07:05 PM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jgalak wrote:
Microchip seems to have broken all their links, including the one from AS7 to the help system

See: http://www.avrfreaks.net/forum/lots-brokenmissing-links-after-atmelcom-closed-redirect-microchipcom

 

You could PM users mt_nor and Jacob to complain - they are Site Admins. Microchip  really need to get their corporate fingers out.

 

 

Do I really need to build one?

No.

 

  Or is there a simpler way?

As far as Atmel Studio is concerned, they are just source files - exactly the same as source files you write yourself.

 

So you add them to the project exactly as you would for source files you write yourself.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ah!  Not used to working with assembly/.S files.  Yes, adding them to the project will work.  What about setting them up so that they can be accessed from any project via #include<>?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are two uses of "library" and a set of .h and .c files from Peter Fleury is the wrong use of the word! It's not a "library" so it has nothing to do with a libTWI.a or anything like that. It's just some shared source files so all you need do is to add any .c files you have been given to the list of other source files in your solution/project then #include any .h files where you plan to call the support functions and, if necessary (because .h are not in same directory as the other sources) arrange to tell the preprocessor where to look for the include files and that's all there is to it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
There are two uses of "library" and a set of .h and .c files from Peter Fleury is the wrong use of the word! It's not a "library" so it has nothing to do with a libTWI.a or anything like that. It's just some shared source files

Glad to hear you are feeling better!

 

While you were away, you missed an opportunity for that rant: http://www.avrfreaks.net/comment...

 

cheeky

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jgalak wrote:
What about setting them up so that they can be accessed from any project 

You use 'Add As Link' - See: https://docs.microsoft.com/en-us/previous-versions/windows/apps/jj714082(v=vs.105)

 

 

 

 

EDIT

 

fix link (the forum doesn't cope with parentheses in URLs)

 

Last Edited: Fri. Jan 12, 2018 - 02:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You could PM users mt_nor and Jacob to complain - they are Site Admins. Microchip  really need to get their corporate fingers out

Oh come one, no one that admins this site has anything to do with the microchip web site! For any issues with the web site, create a support ticket as before. The more noise the more 'suddenly' someone might fix it... smiley

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What was throwing me was that it wasn't .h and .c files.  It was a .h and a .S file, and since I knew the library was written in assembly I thought the .S was a compiled binary.  Obviously not.

 

Thanks for the help.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jgalak wrote:
since I knew the library was written in assembly I thought the .S was a compiled binary

No - .S is assembler Source.

 

.s (lowercase) is also used. There is a distinction, but I forget.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm still not right but threads about "libraries" are wont to pull me from my deathbed!

 

Anyway difference between .s and .S is that latter are preprocessed.