43 strncmp((
const char *)(bit_file->
raw_bit.
data + pos),
"Part: ", 6) == 0) {
82 for (
size_t i = bit_file->
offset; i < bit_file->raw_bit.length; i++)
90 if (!filename || !bit_file)
94 const char *file_suffix_pos = strrchr(filename,
'.');
95 if (!file_suffix_pos) {
96 LOG_ERROR(
"Unable to detect filename suffix");
100 if (strcasecmp(file_suffix_pos,
".bit") == 0)
uint32_t flip_u32(uint32_t value, unsigned int num)
Inverts the ordering of bits inside a 32-bit word (e.g.
Support functions to access arbitrary bits in a byte array.
#define ERROR_COMMAND_SYNTAX_ERROR
static int lattice_read_bit_file(struct lattice_bit_file *bit_file, const char *filename, enum lattice_family_e family)
int lattice_read_file(struct lattice_bit_file *bit_file, const char *filename, enum lattice_family_e family)
#define LOG_ERROR(expr ...)
#define LOG_INFO(expr ...)
#define ERROR_PLD_FILE_LOAD_FAILED
int cpld_read_raw_bit_file(struct raw_bit_file *bit_file, const char *filename)
struct raw_bit_file raw_bit
static uint32_t be_to_h_u32(const uint8_t *buf)