What is the difference between call by value and call by reference?
Short answer: C always passes arguments by value: the function receives a copy, so changing the parameter does not change the caller's variable. To let a function modify the caller's data, you pass a pointer to it, which is what people call "call by reference" in C. (C++ has true references; C does not.)
void inc_value(int x) { x++; } /* changes only the local copy */
void inc_ref(int *x) { (*x)++; } /* changes the caller's variable */
int n = 5;
inc_value(n); /* n is still 5 */
inc_ref(&n); /* n is now 6 */
Passing a pointer is still pass-by-value: the pointer itself is copied. So a function cannot change which object the caller's pointer points to, unless you pass a pointer to the pointer:
void alloc_buf(uint8_t **out, size_t n) { *out = malloc(n); }
uint8_t *buf;
alloc_buf(&buf, 64);
Arrays are passed as a pointer to their first element, so the function can modify the caller's array.
Structs are copied when passed by value. A 100-byte config struct passed by value costs 100 bytes of stack and a copy on every call. Embedded code usually passes const struct cfg * for read-only access (no copy, and the const documents and enforces that the function will not modify it):
void uart_init(const uart_cfg_t *cfg);
Returning values: returning small structs by value is fine and often efficient (the AAPCS returns structs up to 4 bytes in r0, larger ones through memory provided by the caller). For several results, return a status and write results through pointer parameters, or return a small struct.