initial commit
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
#ifndef NANOBAKE_H
|
||||
#define NANOBAKE_H
|
||||
|
||||
#include "nb_platform.h"
|
||||
|
||||
#endif //NANOBAKE_H
|
||||
@@ -0,0 +1,27 @@
|
||||
#ifndef NANOBAKE_NB_DISPLAY_H
|
||||
#define NANOBAKE_NB_DISPLAY_H
|
||||
|
||||
#include <esp_lcd_panel_io.h>
|
||||
|
||||
typedef struct nb_display nb_display_t;
|
||||
|
||||
struct nb_display {
|
||||
bool io_initialized;
|
||||
uint16_t horizontal_resolution;
|
||||
uint16_t vertical_resolution;
|
||||
uint16_t draw_buffer_height;
|
||||
uint16_t bits_per_pixel;
|
||||
esp_lcd_panel_io_handle_t io_handle;
|
||||
esp_lcd_panel_handle_t display_handle;
|
||||
};
|
||||
|
||||
typedef struct nb_display_driver nb_display_driver_t;
|
||||
|
||||
struct nb_display_driver {
|
||||
const char name[32];
|
||||
esp_err_t (*create_display)(nb_display_t* display);
|
||||
};
|
||||
|
||||
extern esp_err_t nb_display_create(nb_display_driver_t driver, nb_display_t* display);
|
||||
|
||||
#endif // NANOBAKE_NB_DISPLAY_H
|
||||
@@ -0,0 +1,22 @@
|
||||
#ifndef NANOBAKE_NB_PLATFORM_H
|
||||
#define NANOBAKE_NB_PLATFORM_H
|
||||
|
||||
#include "nb_display.h"
|
||||
#include "nb_touch.h"
|
||||
#include <esp_err.h>
|
||||
|
||||
typedef struct nb_platform_config nb_platform_config_t;
|
||||
struct nb_platform_config {
|
||||
nb_display_driver_t display_driver;
|
||||
nb_touch_driver_t touch_driver;
|
||||
};
|
||||
|
||||
typedef struct nb_platform nb_platform_t;
|
||||
struct nb_platform {
|
||||
nb_display_t display;
|
||||
nb_touch_t touch;
|
||||
};
|
||||
|
||||
esp_err_t nb_platform_create(nb_platform_config_t config, nb_platform_t* platform);
|
||||
|
||||
#endif // NANOBAKE_NB_PLATFORM_H
|
||||
@@ -0,0 +1,24 @@
|
||||
#ifndef NANOBAKE_NB_TOUCH_H
|
||||
#define NANOBAKE_NB_TOUCH_H
|
||||
|
||||
#include "esp_lcd_touch.h"
|
||||
#include <esp_lcd_panel_io.h>
|
||||
|
||||
typedef struct nb_touch_driver nb_touch_driver_t;
|
||||
|
||||
struct nb_touch_driver {
|
||||
const char name[32];
|
||||
esp_err_t (*init_io)(esp_lcd_panel_io_handle_t* io_handle);
|
||||
esp_err_t (*create_touch)(esp_lcd_panel_io_handle_t io_handle, esp_lcd_touch_handle_t* touch_handle);
|
||||
};
|
||||
|
||||
typedef struct nb_touch nb_touch_t;
|
||||
|
||||
struct nb_touch {
|
||||
esp_lcd_panel_io_handle_t io_handle;
|
||||
esp_lcd_touch_handle_t touch_handle;
|
||||
};
|
||||
|
||||
esp_err_t nb_touch_create(nb_touch_driver_t driver, nb_touch_t* touch);
|
||||
|
||||
#endif // NANOBAKE_NB_TOUCH_H
|
||||
Reference in New Issue
Block a user