((uint16_t)0x0000)
With the above line you mention that it is a 16 bit value i.e 2Bytes.
You are typecasting the value to a 16bit where you have only assigned 4bits. Remaining bits are set to zero by type casting as above.
For second question :
There is a called function and calling function.
Called function : When one piece of code invokes or calls a function.
Example voide m1(int1,int2);
Calling funciton : When called by a function, this piece of code tells what needs to be done.
Example void SPI_Init(SPI_TypeDef* SPIx, SPI_InitTypeDef* SPI_InitStruct)
In the above calling function, SPI_TypeDef and SPI_InitTypeDef are defined in the code as structures. SPIx and SPI_InitStruct are initialised to create a temp value
SPIx. a = 123; SPIx.b = 456; ... etc.
In called function.. int1 and int2 initialized in main and are have a scope of using those variables in whole program. These two examples are not the perfect way to look at the called and calling function.
Hope am being clear .....