~ruther/CTU-FEE-B0B35APO-Semestral-project

ref: bf6fdbf6fa10f949bf9af21d5acadbbf4a167707 CTU-FEE-B0B35APO-Semestral-project/mzapo-sdl/include/mzapo_sdl.h -rw-r--r-- 1.0 KiB
bf6fdbf6 — František Boháček chore: add sdl project directly 1 year, 10 months ago
                                                                                
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef __MZAPO_SDL_H__
#define __MZAPO_SDL_H__

#include <stdint.h>

#define RGB_LEDS_COUNT 2

typedef struct {
  uint8_t r;
  uint8_t g;
  uint8_t b;
} __attribute__((__packed__)) mzapo_sdl_rgb_led;

typedef struct {
  mzapo_sdl_rgb_led left;
  uint8_t offset;
  mzapo_sdl_rgb_led right;
} __attribute__((__packed__)) mzapo_sdl_rgb_leds;

typedef uint32_t mzapo_sdl_ledstrip;

typedef void (*display_command_fn)(uint16_t cmd);
typedef void (*display_data_fn)(uint16_t data);

typedef struct {
  display_command_fn cmd;
  display_data_fn data;
} __attribute__((__packed__)) mzapo_sdl_display;

typedef struct {
  uint32_t offset1;
  
  mzapo_sdl_ledstrip ledstrip;
  uint64_t offset2;
  mzapo_sdl_rgb_leds leds;
  uint8_t offset3;
  uint32_t reg_kbdrd_direct;
  uint64_t offset4;
  uint32_t reg_knobs_direct;
  uint32_t reg_knobs_8bit;
} __attribute__((__packed__)) mzapo_sdl_knobs_keyboard_rgb;

void mzapo_sdl_init();
void mzapo_sdl_deinit();

void *mzapo_sdl_map_phys(uint64_t region_base, uint64_t region_size);

#endif // __MZAPO_SDL_H__
Do not follow this link