arduino / arduino-cli

Arduino command line tool
https://arduino.github.io/arduino-cli/latest/
GNU General Public License v3.0
4.39k stars 384 forks source link

Document interfaces that should be implemented by boards platforms #985

Open matthijskooijman opened 9 years ago

matthijskooijman commented 9 years ago

Describe the request

We need some more exhaustive documentation about the "interface" that a core or variant should expose.

In particular:

Both of these pieces of documentation should be updated when the requirements change in future IDE or core versions, with the changes mentioned explicitly and with the IDE or core version that introduced them.

Describe the current behavior

The **Arduino Platform Specification documents a good deal of the structure and has examples, but is not exhaustive or explicit.

Additional context

Related

Additional requests

Issue checklist

matthijskooijman commented 9 years ago

One additional angle should be covered: The interface that the Arduino core offers to its variants and derived (board-only) platforms. E.g., what variables does each tool, recipe, programmer, etc. assume are present and how they are used.

per1234 commented 9 years ago

Other thing that should be documented(assuming it's the intended behavior) is that Burn Bootloader uses the platform.txt of the selected board but Upload Using Programmer uses the platform.txt of the selected programmer. This has caused confusion for me and at least two other 3rd party cores because it wasn't documented(see https://github.com/arduino/Arduino/issues/2886 and https://github.com/SpenceKonde/ATTinyCore/commit/9c501518037cfa78242500e5749e15ccce3418c8).

Edit: I've added this information to the wiki.

matthijskooijman commented 4 years ago

Also note this proposal I made (quite) a while ago already, which suggests to apply some versioning scheme to these interfaces, to make it easier to change them in the future while keeping compatibility: https://groups.google.com/a/arduino.cc/g/developers/c/H6vCRlgRTCo/m/22oQfVY3AgAJ

matthijskooijman commented 3 years ago

I just noticed that in the area of versioning, the SAMD core already applies some versioning to its variants by letting the variants define a constant to indicate what version of the core-variant interface they implement (I think). I dont' think there's any specific documentation about what this version number implies exactly, though.

See: https://github.com/arduino/ArduinoCore-samd/blob/56e13aa5ebb21f8aca8805e2bc0835a1f1fea372/cores/arduino/Arduino.h#L52

ianfixes commented 3 years ago

Subscribing for interest, via https://github.com/Arduino-CI/arduino_ci/issues/251

I am trying to put boundaries around what would be considered the proper set of compilation mocks for Arduino, and the lack of official documentation on stuff like these:

#define portOutputRegister(P) ( (volatile uint8_t *)( pgm_read_word( port_to_output_PGM + (P))) )
#define portInputRegister(P) ( (volatile uint8_t *)( pgm_read_word( port_to_input_PGM + (P))) )
#define portModeRegister(P) ( (volatile uint8_t *)( pgm_read_word( port_to_mode_PGM + (P))) )

I can't find any official-looking documentation to say whether these are meant to exist for the long term and/or what their function should be (so that I can create proper unit tests for my mockups of them).