Proof-of-concept driver added

This commit is contained in:
2023-09-19 15:06:41 +02:00
parent 0543d56dd5
commit c2ae875a82
7 changed files with 72 additions and 13 deletions

12
drivers/Makefile Normal file
View File

@@ -0,0 +1,12 @@
SUBDIRS := $(wildcard */.)
BUILD_DIR=../build/
all: $(BUILD_DIR)/drivers/ $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -C $@
.PHONY: all $(SUBDIRS)
$(BUILD_DIR)/drivers/:
mkdir -p $(BUILD_DIR)/drivers/

View File

@@ -0,0 +1,7 @@
SUBDIRS := $(wildcard */.)
all: $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -C $@
.PHONY: all $(SUBDIRS)

View File

@@ -0,0 +1,10 @@
CC=gcc
CFLAGS=$(shell pkg-config --cflags libusb-1.0) -O3 -Wall -shared
LDFLAGS=$(shell pkg-config --libs libusb-1.0)
BUILD_DIR=../../../build/
all: $(BUILD_DIR)/drivers/gwolves-htx.so
$(BUILD_DIR)/drivers/gwolves-htx.so: htx.c | $(BUILD_DIR)/drivers/
gcc $(CFLAGS) -o $@ $^

View File

@@ -0,0 +1,26 @@
#include <stdlib.h>
#include <stdint.h>
#include <stddef.h>
#include <stdio.h>
#define DEVICE_NAME "HTX 4K"
void driver_init(void)
{
printf("Hello from G-Wolves HTX driver !\n");
}
uint32_t driver_getkey(void)
{
return 0;
}
char* driver_get_name(void)
{
return DEVICE_NAME;
}
char* driver_get_image(void)
{
return "g-wolves/htx/htx_0.png";
}