Why always to stop clock for read by SPI interface ?
uint8_t P_LIS302_Read1Adr(uint8_t adr)
{
uint8_t ret_wert=0;
uint8_t spi_wert;
// Chip Select to Lo
P_LIS302_CS(
Bit_RESET
);// read an address
spi_wert=(adr&0x3F);
spi_wert|=0x80;
// 0b1000 0000 or
// Send address
UB_SPI1_SendByte(spi_wert);
// read address
ret_wert=UB_SPI1_SendByte(0x55);
// Chip Select to Hi
P_LIS302_CS(
Bit_SET
);return
(ret_wert);}
i get this code in repository, so i dont know all the code ... I ask about why we should stopP_LIS302_CS(
Bit_RESET
); in this code is here </p>
void
</b>
P_LIS302_CS(
BitAction
wert) {
if
(wert==
Bit_RESET
) {
LIS302_CS_GPIO_PORT->
BSRRH
= LIS302_CS_PIN;
}
else
{
LIS302_CS_GPIO_PORT->
BSRRL
= LIS302_CS_PIN;
}
}
why ? #rtfm-lmgtfy