HAL_StatusTypeDef function
Hi, i come across a H7 code that use HAL_StatusTypeDef , could anyone kindly advise what does the HAL_StatusTypeDef do, whats HAL_OK means? what does ret != HAL_OK mean? and what does return HAL_OK means?
HAL_StatusTypeDef spi_write(reg, *pData)
{
HAL_StatusTypeDef ret;
uint8_t sendData[2] = {reg, *pData};
HAL_GPIO_WritePin(...SPI1_CS_Pin, 0); // CS pull low
ret = HAL_SPI_Transmit(&hspi1, sendData, 2, 20);
if (ret != HAL_OK)
{
HAL_GPIO_WritePin(.., SPI1_CS_Pin, 1); // CS pull high
return ret;
}
