Skip to content

Commit

Permalink
remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
josuah committed Jan 30, 2025
1 parent 4ebe348 commit 88b3e2a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 238 deletions.
43 changes: 0 additions & 43 deletions include/ice_wishbone.h

This file was deleted.

54 changes: 4 additions & 50 deletions src/ice_fpga.c
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/*
* MIT License
*
*
* Copyright (c) 2023 tinyVision.ai
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down Expand Up @@ -72,49 +72,3 @@ bool ice_fpga_start(void) {
}
return true;
}

// https://github.com/xobs/spibone

// Read protocol:
// Write: 01 | AA | AA | AA | AA
// [Wishbone Operation]
// Read: 01 | VV | VV | VV | VV
void ice_fpga_read(uint32_t addr, uint8_t *data, size_t data_size) {
uint8_t header[5] = {
0x01,
(addr >> 24) & 0xFF,
(addr >> 16) & 0xFF,
(addr >> 8) & 0xFF,
(addr >> 0) & 0xFF,
};
uint8_t byte;

ice_spi_chip_select(ICE_FPGA_CSN_PIN);
ice_spi_write_blocking(header, sizeof header);
while (ice_spi_read_blocking(&byte, 1), byte == 0xFF);
assert(byte == 0x01);
ice_spi_read_blocking(data, data_size);
ice_spi_chip_deselect(ICE_FPGA_CSN_PIN);
}

// Write protocol:
// Write: 00 | AA | AA | AA | AA | VV | VV | VV | VV
// [Wishbone Operation]
// Read: 00
void ice_fpga_write(uint32_t addr, const uint8_t *data, size_t data_size) {
uint8_t header[5] = {
0x00,
(addr >> 24) & 0xFF,
(addr >> 16) & 0xFF,
(addr >> 8) & 0xFF,
(addr >> 0) & 0xFF,
};
uint8_t byte;

ice_spi_chip_select(ICE_FPGA_CSN_PIN);
ice_spi_write_blocking(header, sizeof header);
ice_spi_write_blocking(data, data_size);
while (ice_spi_read_blocking(&byte, 1), byte == 0xFF);
ice_spi_chip_deselect(ICE_FPGA_CSN_PIN);
assert(byte == 0x00);
}
145 changes: 0 additions & 145 deletions src/ice_wishbone.c

This file was deleted.

0 comments on commit 88b3e2a

Please sign in to comment.