forked from jackhumbert/pinebook-pro-keyboard-updater
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupdater.h
29 lines (21 loc) · 721 Bytes
/
updater.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <libusb-1.0/libusb.h>
extern libusb_device_handle *devh;
extern libusb_context *ctx;
extern int devintf;
#define MAX_BINLEN (14*1024)
int open_usb(int vid, int pid, int indf);
void close_usb();
int open_user_mode();
int open_boot_mode();
int open_touchpad_mode();
int switch_to_boot_mode();
int reset_device();
int read_bulk(unsigned char *data, int length);
int write_bulk(unsigned char *data, int length);
int write_kb_fw(const unsigned char *data, int data_length);
int convert_hex_data(const unsigned char *data, int data_length, const char *output_filename);
int write_tp_fw(const unsigned char *data, int data_length);