Commit 25e78f0c authored by Alejandro Mery's avatar Alejandro Mery
Browse files

script: moved script_bin_* structs from bin2fex.h to script.h

parent 85d240fa
......@@ -14,6 +14,7 @@ clean:
$(TOOLS): Makefile sunxi-tools.h
fex2bin: script.c script.h
bin2fex: script.h
%: %.c %.h
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(filter %.c,$^) $(LIBS)
......
......@@ -18,39 +18,6 @@
#define _SUNXI_TOOLS_BIN2FEX_H
#include <stdint.h>
#include "script.h"
struct script_bin_section {
char name[32];
int32_t length;
int32_t offset;
};
struct script_bin_head {
int32_t sections;
int32_t version[3];
struct script_bin_section section[];
};
struct script_bin_entry {
char name[32];
int32_t offset;
int32_t pattern;
};
struct script_bin_gpio_value {
int32_t port;
int32_t port_num;
int32_t mul_sel;
int32_t pull;
int32_t drv_level;
int32_t data;
};
enum script_value_type {
SCRIPT_VALUE_TYPE_SINGLE_WORD = 1,
SCRIPT_VALUE_TYPE_STRING,
SCRIPT_VALUE_TYPE_MULTI_WORD,
SCRIPT_VALUE_TYPE_GPIO,
SCRIPT_VALUE_TYPE_NULL,
};
#endif
......@@ -75,6 +75,37 @@ struct script_gpio_entry {
int32_t data[4];
};
/** binary representation of the head of a section */
struct script_bin_section {
char name[32];
int32_t length;
int32_t offset;
};
/** binary representation of the head of the script file */
struct script_bin_head {
int32_t sections;
int32_t version[3];
struct script_bin_section section[];
};
/** binary representation of the head of an entry */
struct script_bin_entry {
char name[32];
int32_t offset;
int32_t pattern;
};
/** binary representation of a GPIO */
struct script_bin_gpio_value {
int32_t port;
int32_t port_num;
int32_t mul_sel;
int32_t pull;
int32_t drv_level;
int32_t data;
};
/** create a new script tree */
struct script *script_new(void);
/** deletes a tree recursively */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment