[fix] spi drivers set cs pin in idle

This commit is contained in:
2023-05-21 21:08:09 +02:00
parent 6d313aaa54
commit 26f5cfe3ce
2 changed files with 4 additions and 0 deletions

View File

@@ -17,6 +17,8 @@ void mcp41x_init(mcp41x_handle_t *hpot, SPI_HandleTypeDef *hspi, GPIO_TypeDef *c
hpot->cs_pin = cs_pin;
hpot->max_res = res;
hpot->dir = MCP41X_ATOB;
HAL_GPIO_WritePin(hpot->cs_port, hpot->cs_pin, GPIO_PIN_SET);
}
void mcp41x_setValue(mcp41x_handle_t *hpot, uint8_t value)