user66713: This piece of code was taken from AMIS30543- Arduino library,
void init(uint8_t slaveSelectPin) {
    ssPin = slaveSelectPin;
    digitalWrite(ssPin, HIGH);
    pinMode(ssPin, OUTPUT);
}

Facts I know

digitalWrite - makes the pin to the corresponding voltage level
pinMode - makes the pin either input or output
ssPin is active low pin usually.

So I was wondering before setting the pinDirection why the pin is made HIGH, Then immediately after that the pinDirection was declared as OUTPUT
Also I know , if a pin was made HIGH and on the next line if the direction of the same is set as  INPUT will bring the internal pull up resistor in action .
So what am I missing here. More over in Arduino does the order of pinMode/digitalWrite matter.? if So what is the meaning of this particular lines of code Github link to the library

user69487: This initialization will work with spi communication for PIC32 microchip too?

66713: <p>This piece of code was taken from AMIS30543- Arduino library,</p>
<pre class="lang-cpp prettyprint-override"><code>void init(uint8_t slaveSelectPin) {
    ssPin = slaveSelectPin;
    digitalWrite(ssPin, HIGH);
    pinMode(ssPin, OUTPUT);
}
</code></pre>
<p>Facts I know</p>
<ul>
<li>digitalWrite - makes the pin to the corresponding voltage level</li>
<li>pinMode - makes the pin either input or output</li>
<li>ssPin is active low pin usually.</li>
</ul>
<p>So I was wondering before setting the pinDirection why the pin is made HIGH, Then immediately after that the pinDirection was declared as OUTPUT</p>
<p>Also I know , if a pin was made HIGH and on the next line if the direction of the same is set as  INPUT will bring the internal pull up resistor in action .</p>
<p>So what am I missing here. More over in Arduino does the order of pinMode/digitalWrite matter.? if So what is the meaning of this particular lines of code <a href="https://github.com/pololu/amis-30543-arduino/blob/master/AMIS30543.h" rel="nofollow noreferrer">Github link to the library</a></p>
 69487: <p>This initialization will work with <a href="https://911electronic.com/spi-communication-how-spi-works/" rel="nofollow noreferrer">spi communication</a> for PIC32 microchip too?</p>
