Taking the Arduino Uno as an example, it uses an Atmel ATmega328p (or variant of it).
So, you need to set pin D13 to be an output, in Arduino, we use pinMode(13, OUTPUT). In AVR C/C++ we set one bit in a Data Direction Register:
\\ Set D13, aka PORT B, Pin 5 as output.
DDRB |= (1 << DDB5);
In AVR C/C++, you can set multiple pins to output (or input) all at the same time:
\\ Set PORT B, Pins 2 and 5 as output.
DDRB |= (1 << DDB5) | (1 << DDB2));
The Arduino Language would need two pinMode() calls.
Most of the Arduino Language drops down to statements like those above. This is not surprising as it is “just” a library of useful functions based on the registers/functions/commands of the underlying device.
For the other microcontrollers, the language stays the same, but what goes on beneath is different for each one. This is useful, as people can migrate from device to device, and with minimum changes, run the same (Arduino) code on all of them.
If you need to know more, there’s a good book around which explains the entire Arduino Language and how it works. Modesty prevents me from saying the author’s name.
You gave me a differences example between ATmega and AVR and later you said:
“For the other microcontrollers, the language stays the same, but what goes on beneath is different for each one”
Here are you referring to or including ESP 8266 / ESP32 uC ?
That’s because my main question was about them and if there are any specific
C / C++ “commands” for ESP 8266 / ESP32 uC ( PlatformIO )
that differ from “standard” Arduino C / C++ language set .
Note:
By “commands” I mean C / C++ functions, variables kind, … … …
or any other C / C++ programming stuff.
Well, that’s a really broad question – you can include any header from the ESP8266 / ESP32 core and call into any publically exposed function. Or library.
Some hardware specific calls are e.g. available through the Esp class defined here. Otherwise you can include every header file in the core, the SDK that Arduino-ESP8266 builds on (Espressif NONOS SDK) and use all core-provided libraries.
Functions that are e.g. expanded from the regular Arduino core would be analogWriteRange(new_range), analogWriteResolution, analogWriteMode, analogWriteFreq, Serial.swap, Serial.detectBaudrate, the entire WiFi class, the entire Esp class, etc. etc…
What I meant was that for the other devices, if there is an Arduino framework, you will have the same pinMode() function names, but whatever they do underneath will be different to the Atmel AVR commands and regisrers.
The data sheets for the various microcontrollers will (should!) document the registers, sys calls etc. There may even be examples in C/C++ as in the Atmel docs, but I don’t have too much experience outside of AVRs at the moment – I’ve not had time to play with my BluePills, Wemos D1 Minis etc, yet.