How Arduino IDE "links" the libraries so it works for different processors?


hello,

i trying understand how arduino ide sort of links libraries work both avr , arm-based atmel processors. or put other way, how arduino ide knows registers configure , use when jumping avr-based boards arm-based boards? of libraries tested use spi (sd card , oled) , uart (for gps). , work both genuino uno , samd21g-based adafruit feather m0.

from understand, avr , arm-based microcontrollers have (obviously) different register size , naming. example, spi registers named differently in avr architecture vs of arm, , spi pinouts different (fix on atmega328, while configurable on samd21 via multiplexing). when switch board genuino uno adafruit feather m0 in arduino ide, there must ways ide tell needs shift avr mode arm mode configure , use registers correctly, of course still allowing me use same sd card library. suspect there must sort of abstraction layer hide complexity on hardware side.

so, how arduino ide clever trick? , if may kindly point me relevant files in arduino installation structure, appreciated.

thanks lot!  :)

-ruch

some libraries (for spi, i2c, softwareserial, etc) specific core (aka third party hardware package), different version used when compiling boards in different cores - implement same api.

other libraries use #ifdef's detect board/chip, different code used depending on you're building for. that's why many libraries work on avr-based boards.

in case of sd card library, 1 may same - uses spi library different arm or avr boards.


Arduino Forum > Using Arduino > Microcontrollers > How Arduino IDE "links" the libraries so it works for different processors?


arduino

Comments

Popular posts from this blog

Error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode - Raspberry Pi Forums

class MPU6050 has no member named begin

missing filename after '-o'