src/lcd_5110.c
LCD_ErrorStatus LCD_Write_Command(uint8_t cmd) {
    HAL_StatusTypeDef HAL_Status;

    HAL_GPIO_WritePin(conf.CE_PORT, conf.CE_PIN, GPIO_PIN_RESET);
    HAL_GPIO_WritePin(conf.DC_PORT, conf.DC_PIN, GPIO_PIN_RESET);
    HAL_Status = HAL_SPI_Transmit(conf.spi, &cmd, 0x01, LCD_SPI_TIMEOUT);
    HAL_GPIO_WritePin(conf.CE_PORT, conf.CE_PIN, GPIO_PIN_SET);
    HAL_GPIO_WritePin(conf.DC_PORT, conf.DC_PIN, GPIO_PIN_SET);

    if (HAL_Status != HAL_OK) {
        return LCD_STATUS_ERROR;
    }

    return LCD_STATUS_SUCCESS;
}
/**
 * Write LCD command to SPI
 * @param cmd command to write.
 */
Write LCD command to SPI
@param cmd command to write.
Write LCD command to SPI @param cmd command to write .
LCD_ErrorStatus LCD_Write_Command(uint8_t cmd) {
    HAL_StatusTypeDef HAL_Status;
    HAL_GPIO_WritePin(conf.CE_PORT, conf.CE_PIN, GPIO_PIN_RESET);
    HAL_GPIO_WritePin(conf.DC_PORT, conf.DC_PIN, GPIO_PIN_RESET);
    HAL_Status = HAL_SPI_Transmit(conf.spi, &cmd, 0x01, LCD_SPI_TIMEOUT);
    HAL_GPIO_WritePin(conf.CE_PORT, conf.CE_PIN, GPIO_PIN_SET);
    HAL_GPIO_WritePin(conf.DC_PORT, conf.DC_PIN, GPIO_PIN_SET);
    if (HAL_Status != HAL_OK) {
        return LCD_STATUS_ERROR;
    }
    return LCD_STATUS_SUCCESS;
}
LCD_ErrorStatus LCD_Write_Command ( uint8_t cmd ) { HAL_StatusTypeDef HAL_Status ; HAL_GPIO_WritePin ( conf . CE_PORT , conf . CE_PIN , GPIO_PIN_RESET ) ; HAL_GPIO_WritePin ( conf . DC_PORT , conf . DC_PIN , GPIO_PIN_RESET ) ; HAL_Status = HAL_SPI_Transmit ( conf . spi , & cmd , 0x01 , LCD_SPI_TIMEOUT ) ; HAL_GPIO_WritePin ( conf . CE_PORT , conf . CE_PIN , GPIO_PIN_SET ) ; HAL_GPIO_WritePin ( conf . DC_PORT , conf . DC_PIN , GPIO_PIN_SET ) ; if ( HAL_Status != HAL_OK ) { return LCD_STATUS_ERROR ; } return LCD_STATUS_SUCCESS ; }
Write LCD command to SPI
 @param cmd command to write.
Write LCD command to SPI @param cmd command to write .