Skip to content

Commit

Permalink
Restructured epd driver interface, support for UC-based tags
Browse files Browse the repository at this point in the history
  • Loading branch information
jjwbruijn committed Nov 12, 2023
1 parent 246b234 commit 220b4ae
Show file tree
Hide file tree
Showing 20 changed files with 205 additions and 353 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "zigbee.h"
#include "epd_spi.h"
#include "eeprom_spi.h"
#include "epd_driver/epd_interface.h"

#define RADIO_FIRST_CHANNEL (11) // 2.4-GHz channels start at 11

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
// hw types
#define HW_TYPE SOLUM_M3_BWR_22

#include "../include/ssd1619.h"

#define SCREEN_WIDTH 160
#define SCREEN_HEIGHT 296
#define SCREEN_XOFFSET 8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
// hw types
#define HW_TYPE SOLUM_M3_BWR_29

#include "../include/ssd1619.h"

#define SCREEN_WIDTH 168
#define SCREEN_HEIGHT 384
#define SCREEN_XOFFSET 8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

// hw type
#define HW_TYPE SOLUM_M3_BWR_43
#include "../include/uc_variant_043.h"

#define SCREEN_WIDTH 152
#define SCREEN_HEIGHT 522
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
// hw type
#define HW_TYPE SOLUM_M3_BWR_60

#include "../include/uc8159.h"

#define SCREEN_WIDTH 600
#define SCREEN_HEIGHT 448
#define SCREEN_XOFFSET 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
// hw type
#define HW_TYPE SOLUM_M3_BWR_75

#include "../include/uc8179.h"

#define SCREEN_WIDTH 800
#define SCREEN_HEIGHT 480
#define SCREEN_XOFFSET 0
Expand Down
5 changes: 2 additions & 3 deletions ARM_Tag_FW/Newton_M3_nRF52811/include/hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "../hal/Newton_M3_nRF52811/Newton_M3_nRF52811_22_BWR.h"
#include "../hal/Newton_M3_nRF52811/HAL_Newton_M3.h"
#endif

#ifdef BUILD_NEWTON_M3_29_BWR
#include "../hal/Newton_M3_nRF52811/Newton_M3_nRF52811_29_BWR.h"
#include "../hal/Newton_M3_nRF52811/HAL_Newton_M3.h"
Expand All @@ -12,7 +13,6 @@
#include "../hal/Newton_M3_nRF52811/HAL_Newton_M3.h"
#endif


#ifdef BUILD_NEWTON_M3_60_BWR
#include "../hal/Newton_M3_nRF52811/Newton_M3_nRF52811_60_BWR.h"
#include "../hal/Newton_M3_nRF52811/HAL_Newton_M3.h"
Expand All @@ -21,5 +21,4 @@
#ifdef BUILD_NEWTON_M3_75_BWR
#include "../hal/Newton_M3_nRF52811/Newton_M3_nRF52811_75_BWR.h"
#include "../hal/Newton_M3_nRF52811/HAL_Newton_M3.h"
#endif

#endif
23 changes: 0 additions & 23 deletions ARM_Tag_FW/Newton_M3_nRF52811/include/uc8159.h

This file was deleted.

24 changes: 0 additions & 24 deletions ARM_Tag_FW/Newton_M3_nRF52811/include/uc8179.h

This file was deleted.

23 changes: 0 additions & 23 deletions ARM_Tag_FW/Newton_M3_nRF52811/include/uc_variant_043.h

This file was deleted.

25 changes: 20 additions & 5 deletions ARM_Tag_FW/Newton_M3_nRF52811/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,44 +20,59 @@ extra_scripts = post:preparefiles.py
build_flags =
${env.build_flags}
-D BUILD_NEWTON_M3_22_BWR
-D EPD_DRIVER=SSD1619
-Tnrf52811_bootloader.ld
build_src_filter =
+<*>-<uc_variant_043.cpp>-<uc8179.cpp>-<uc8159.cpp>+<../hal/Newton_M3_nRF52811/*>
+<*>-<epd_driver/*>+<../hal/Newton_M3_nRF52811/*>

[env:Newton_M3_29_BWR]
board_build.ldscript = nrf52811_bootloader.ld
build_flags =
${env.build_flags}
-D BUILD_NEWTON_M3_29_BWR
-D EPD_DRIVER=SSD1619
-Tnrf52811_bootloader.ld
build_src_filter =
+<*>-<uc_variant_043.cpp>-<uc8179.cpp>-<uc8159.cpp>+<../hal/Newton_M3_nRF52811/*>
+<*>-<epd_driver/*>+<../hal/Newton_M3_nRF52811/*>

[env:Newton_M3_29_VAR1_BWR]
board_build.ldscript = nrf52811_bootloader.ld
build_flags =
${env.build_flags}
-D BUILD_NEWTON_M3_29_BWR
-D EPD_DRIVER=UCVARIANT029
-Tnrf52811_bootloader.ld
build_src_filter =
+<*>-<epd_driver/*>+<../hal/Newton_M3_nRF52811/*>

[env:Newton_M3_43_BWR]
board_build.ldscript = nrf52811_bootloader.ld
build_flags =
-Wunused-macros
${env.build_flags}
-D BUILD_NEWTON_M3_43_BWR
-D EPD_DRIVER=UCVARIANT043
-Tnrf52811_bootloader.ld
build_src_filter =
+<*>-<ssd1619.cpp>-<uc8179.cpp>-<uc8159.cpp>+<../hal/Newton_M3_nRF52811/*>
+<*>-<epd_driver/*>+<../hal/Newton_M3_nRF52811/*>

[env:Newton_M3_60_BWR]
board_build.ldscript = nrf52811_bootloader.ld
build_flags =
${env.build_flags}
-Tnrf52811_bootloader.ld
-D BUILD_NEWTON_M3_60_BWR
-D EPD_DRIVER=UC8159
build_src_filter =
+<*>-<uc_variant_043.cpp>-<ssd1619.cpp>-<ssd1619.cpp>-<uc8179.cpp>+<../hal/Newton_M3_nRF52811/*>
+<*>-<epd_driver/*>+<../hal/Newton_M3_nRF52811/*>

[env:Newton_M3_75_BWR]
board_build.ldscript = nrf52811_bootloader.ld
build_flags =
${env.build_flags}
-Tnrf52811_bootloader.ld
-D BUILD_NEWTON_M3_75_BWR
-D EPD_DRIVER=UC8179
build_src_filter =
+<*>-<uc_variant_043.cpp>-<ssd1619.cpp>-<uc8159.cpp>+<../hal/Newton_M3_nRF52811/*>
+<*>-<epd_driver/*>+<../hal/Newton_M3_nRF52811/*>

25 changes: 25 additions & 0 deletions ARM_Tag_FW/Newton_M3_nRF52811/src/epd.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#define SSD1619 0
#define UCVARIANT029 1
#define UCVARIANT043 2
#define UC8159 3
#define UC8179 4

#if EPD_DRIVER == SSD1619
#include "epd_driver/ssd1619.cpp"
#endif

#if EPD_DRIVER == UCVARIANT029
#include "epd_driver/uc_variant_029.cpp"
#endif

#if EPD_DRIVER == UCVARIANT043
#include "epd_driver/uc_variant_043.cpp"
#endif

#if EPD_DRIVER == UC8159
#include "epd_driver/uc8159.cpp"
#endif

#if EPD_DRIVER == UC8179
#include "epd_driver/uc8179.cpp"
#endif
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
#ifndef _JSCREEN_H_
#define _JSCREEN_H_
#ifndef _EPD_IFACE_H_
#define _EPD_IFACE_H_

#include <stdbool.h>
#include <stdint.h>

#define EPD_SSD1619

#define epdSend spi_write

#define EPD_LUT_DEFAULT 0
#define EPD_LUT_NO_REPEATS 1
#define EPD_LUT_FAST_NO_REDS 2
#define EPD_LUT_FAST 3
#define EPD_LUT_OTA 0x10

void epdSetup();
void epdEnterSleep();

extern uint8_t dispLutSize;
extern uint8_t customLUT[];

void draw();
void drawNoWait();
void drawWithSleep();
void epdWaitRdy();

#define EPD_LUT_DEFAULT 0
#define EPD_LUT_NO_REPEATS 1
#define EPD_LUT_FAST_NO_REDS 2
#define EPD_LUT_FAST 3

void selectLUT(uint8_t lut);

#endif
#endif
Loading

0 comments on commit 220b4ae

Please sign in to comment.