Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NFC_Eink #245

Closed
wants to merge 29 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
003a618
Initial commit of Nfc Eink
RebornedBrain Sep 26, 2024
979e452
Assets added
RebornedBrain Sep 29, 2024
421d820
nfc_eink_app_i.h added
RebornedBrain Sep 29, 2024
eb6f8e3
All screen types are now aligned
RebornedBrain Sep 29, 2024
de3d95e
New goodisplay poller logic
RebornedBrain Sep 29, 2024
a7bc6d5
Merge branch 'dev' into nfc_eink
skotopes Oct 19, 2024
4e001b0
Merge branch 'dev' into nfc_eink
skotopes Oct 19, 2024
cd24df9
New api fix
RebornedBrain Oct 21, 2024
950decf
New error processing logic and api
RebornedBrain Oct 21, 2024
84f9ae5
Waceshare poller fixes and retry mechanism
RebornedBrain Oct 21, 2024
86beeca
Scenes adjustments according to new error logic in eink screens
RebornedBrain Oct 21, 2024
72d4933
Merge branch 'nfc_eink' of github.com:RebornedBrain/flipperzero-good-…
RebornedBrain Oct 21, 2024
4ac1053
Merge branch 'dev' into nfc_eink
skotopes Nov 1, 2024
00fed42
strcat replaced to strlcat
RebornedBrain Nov 14, 2024
e6b5ad1
Reworked logic of descriptors handling and filtering
RebornedBrain Nov 25, 2024
dffa04d
Now eink screen inits using name instead of screen type
RebornedBrain Nov 25, 2024
3540281
Waveshare screen config logic reworked
RebornedBrain Nov 25, 2024
b95d462
Goodisplay screen config logic reworked
RebornedBrain Nov 25, 2024
108064c
Now file load function can return 3 different states, depending on us…
RebornedBrain Nov 25, 2024
01c89f2
All scenes with init screen adjusted
RebornedBrain Nov 25, 2024
3e54943
Scene transition logic adjusted to show error if failed to load
RebornedBrain Nov 25, 2024
f15b9d5
Waveshare poller send data functions now return three statuses instea…
RebornedBrain Nov 26, 2024
5711a11
Additional poller state for reading some pages, possibly might help t…
RebornedBrain Nov 26, 2024
879a8c9
Removed read steps
RebornedBrain Nov 27, 2024
7d6f64a
Delays adjusted and some cmd fixes
RebornedBrain Nov 27, 2024
d87d7e2
Select type cmd now uses bigger timeout for big displays
RebornedBrain Nov 27, 2024
17ffe06
Some cleanups
RebornedBrain Nov 27, 2024
fc9babe
Merge branch 'dev' into nfc_eink
skotopes Jan 16, 2025
2d67d17
Fixed 3.71 inch issue when phone app sends more data then needed, now…
RebornedBrain Jan 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
All screen types are now aligned
RebornedBrain committed Sep 29, 2024
commit eb6f8e366692bca6d14ad9fb75edabe58ff864b0
29 changes: 12 additions & 17 deletions nfc_eink/nfc_eink_screen/goodisplay/eink_goodisplay_config.c
Original file line number Diff line number Diff line change
@@ -3,13 +3,13 @@
#define TAG "GD_Config"

const uint8_t default_config[] = {
0x03, 0xf0, 0xdb, 0x00, 0x00, 0x67, 0xa0, 0x06, 0x00, 0x20, 0x00, 128, 0x01, 0x28, 0xa4, 0x01,
0x0c, 0xa5, 0x02, 0x00, 0x0a, 0xa4, 0x01, 0x08, 0xa5, 0x02, 0x00, 0x0a, 0xa4, 0x01, 0x0c, 0xa5,
0x02, 0x00, 0x0a, 0xa4, 0x01, 0x02, 0xa1, 0x01, 0x12, 0xa4, 0x01, 0x02, 0xa1, 0x04, 0x01, 0x27,
0x01, 0x01, 0xa1, 0x02, 0x11, 0x01, 0xa1, 0x03, 0x44, 0x00, 0x0f, 0xa1, 0x05, 0x45, 0x27, 0x01,
0x00, 0x00, 0xa1, 0x02, 0x3c, 0x05, 0xa1, 0x03, 0x21, 0x00, 0x80, 0xa1, 0x02, 0x18, 0x80, 0xa1,
0x02, 0x4e, 0x00, 0xa1, 0x03, 0x4f, 0x27, 0x01, 0xa3, 0x01, 0x24, 0xa2, 0x02, 0x22, 0xf7, 0xa2,
0x01, 0x20, 0xa4, 0x01, 0x02, 0xa2, 0x02, 0x10, 0x01, 0xa5, 0x02, 0x00, 0x0a};
0xf0, 0xdb, 0x00, 0x00, 0x67, 0xa0, 0x06, 0x00, 0x20, 0x00, 128, 0x01, 0x28, 0xa4, 0x01, 0x0c,
0xa5, 0x02, 0x00, 0x0a, 0xa4, 0x01, 0x08, 0xa5, 0x02, 0x00, 0x0a, 0xa4, 0x01, 0x0c, 0xa5, 0x02,
0x00, 0x0a, 0xa4, 0x01, 0x02, 0xa1, 0x01, 0x12, 0xa4, 0x01, 0x02, 0xa1, 0x04, 0x01, 0x27, 0x01,
0x01, 0xa1, 0x02, 0x11, 0x01, 0xa1, 0x03, 0x44, 0x00, 0x0f, 0xa1, 0x05, 0x45, 0x27, 0x01, 0x00,
0x00, 0xa1, 0x02, 0x3c, 0x05, 0xa1, 0x03, 0x21, 0x00, 0x80, 0xa1, 0x02, 0x18, 0x80, 0xa1, 0x02,
0x4e, 0x00, 0xa1, 0x03, 0x4f, 0x27, 0x01, 0xa3, 0x01, 0x24, 0xa2, 0x02, 0x22, 0xf7, 0xa2, 0x01,
0x20, 0xa4, 0x01, 0x02, 0xa2, 0x02, 0x10, 0x01, 0xa5, 0x02, 0x00, 0x0a};

EinkGoodisplayConfigPack* eink_goodisplay_config_pack_alloc(size_t* config_length) {
furi_assert(config_length);
@@ -67,19 +67,14 @@ NfcEinkScreenType
const EinkGoodisplaySizeConfigPack* config = (EinkGoodisplaySizeConfigPack*)(data);

if(config->screen_data.screen_resolution == NfcEinkGoodisplayScreenResolution2n13inch) {
/* screen_type = screen_config->screen_channel ==
NfcEinkGoodisplayScreenChannelBlackWhite ?
NfcEinkScreenTypeGoodisplay2n13inch :
NfcEinkScreenTypeUnknown; */
screen_type = NfcEinkScreenTypeGoodisplay2n13inch;
screen_type = NfcEinkScreenTypeGoodisplayEY2Color2n13inch;
} else if(config->screen_data.screen_resolution == NfcEinkGoodisplayScreenResolution2n9inch) {
screen_type = NfcEinkScreenTypeGoodisplay2n9inch;
screen_type = NfcEinkScreenTypeGoodisplayEY2Color2n9inch;
} else if(config->screen_data.screen_resolution == NfcEinkGoodisplayScreenResolution1n54inch) {
screen_type = NfcEinkScreenTypeGoodisplay1n54inch;
screen_type = NfcEinkScreenTypeGoodisplayEY2Color1n54inch;
} else if(config->screen_data.screen_resolution == NfcEinkGoodisplayScreenResolution3n71inch) {
screen_type = NfcEinkScreenTypeGoodisplay3n71inch;
} else
screen_type = NfcEinkScreenTypeUnknown;
screen_type = NfcEinkScreenTypeGoodisplayEY2Color3n71inch;
}

return screen_type;
}
Original file line number Diff line number Diff line change
@@ -98,7 +98,6 @@ typedef struct {
} FURI_PACKED EinkGoodisplayResetSequence;

typedef struct {
uint8_t command_code;
APDU_Header apdu;
uint8_t data_length;
EinkGoodisplaySizeConfigPack eink_size_config;
18 changes: 9 additions & 9 deletions nfc_eink/nfc_eink_screen/nfc_eink_screen_infos.c
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ static const NfcEinkScreenInfo screen_descriptors[] = {
.height = 122,
.screen_size = NfcEinkScreenSize2n13inch,
.screen_manufacturer = NfcEinkManufacturerWaveshare,
.screen_type = NfcEinkScreenTypeWaveshare2n13inch,
.screen_type = NfcEinkScreenTypeWaveshare2Color2n13inch,
.data_block_size = 16,
},
{
@@ -29,7 +29,7 @@ static const NfcEinkScreenInfo screen_descriptors[] = {
.height = 176,
.screen_size = NfcEinkScreenSize2n7inch,
.screen_manufacturer = NfcEinkManufacturerWaveshare,
.screen_type = NfcEinkScreenTypeWaveshare2n7inch,
.screen_type = NfcEinkScreenTypeWaveshare2Color2n7inch,
.data_block_size = 121,
},
{
@@ -38,7 +38,7 @@ static const NfcEinkScreenInfo screen_descriptors[] = {
.height = 128,
.screen_size = NfcEinkScreenSize2n9inch,
.screen_manufacturer = NfcEinkManufacturerWaveshare,
.screen_type = NfcEinkScreenTypeWaveshare2n9inch,
.screen_type = NfcEinkScreenTypeWaveshare2Color2n9inch,
.data_block_size = 16,
},
{
@@ -47,7 +47,7 @@ static const NfcEinkScreenInfo screen_descriptors[] = {
.height = 400,
.screen_size = NfcEinkScreenSize4n2inch,
.screen_manufacturer = NfcEinkManufacturerWaveshare,
.screen_type = NfcEinkScreenTypeWaveshare4n2inch,
.screen_type = NfcEinkScreenTypeWaveshare2Color4n2inch,
.data_block_size = 100,
},
{
@@ -56,7 +56,7 @@ static const NfcEinkScreenInfo screen_descriptors[] = {
.height = 800,
.screen_size = NfcEinkScreenSize7n5inch,
.screen_manufacturer = NfcEinkManufacturerWaveshare,
.screen_type = NfcEinkScreenTypeWaveshare7n5inch,
.screen_type = NfcEinkScreenTypeWaveshare2Color7n5inch,
.data_block_size = 120,
},
{
@@ -65,7 +65,7 @@ static const NfcEinkScreenInfo screen_descriptors[] = {
.height = 200,
.screen_size = NfcEinkScreenSize1n54inch,
.screen_manufacturer = NfcEinkManufacturerGoodisplay,
.screen_type = NfcEinkScreenTypeGoodisplay1n54inch,
.screen_type = NfcEinkScreenTypeGoodisplayEY2Color1n54inch,
.data_block_size = 0xFA,
},
{
@@ -74,7 +74,7 @@ static const NfcEinkScreenInfo screen_descriptors[] = {
.height = 122,
.screen_size = NfcEinkScreenSize2n13inch,
.screen_manufacturer = NfcEinkManufacturerGoodisplay,
.screen_type = NfcEinkScreenTypeGoodisplay2n13inch,
.screen_type = NfcEinkScreenTypeGoodisplayEY2Color2n13inch,
.data_block_size = 0xFA,
},
{
@@ -83,7 +83,7 @@ static const NfcEinkScreenInfo screen_descriptors[] = {
.height = 128,
.screen_size = NfcEinkScreenSize2n9inch,
.screen_manufacturer = NfcEinkManufacturerGoodisplay,
.screen_type = NfcEinkScreenTypeGoodisplay2n9inch,
.screen_type = NfcEinkScreenTypeGoodisplayEY2Color2n9inch,
.data_block_size = 0xFA,
},
{
@@ -92,7 +92,7 @@ static const NfcEinkScreenInfo screen_descriptors[] = {
.height = 240,
.screen_size = NfcEinkScreenSize3n71inch,
.screen_manufacturer = NfcEinkManufacturerGoodisplay,
.screen_type = NfcEinkScreenTypeGoodisplay3n71inch,
.screen_type = NfcEinkScreenTypeGoodisplayEY2Color3n71inch,
.data_block_size = 0xFA,
},
};
45 changes: 30 additions & 15 deletions nfc_eink/nfc_eink_screen/nfc_eink_screen_infos.h
Original file line number Diff line number Diff line change
@@ -23,22 +23,38 @@ typedef enum {
NfcEinkManufacturerUnknown
} NfcEinkManufacturer;

/// TODO: Align all screens here by manufacturers before release
typedef enum {
NfcEinkScreenTypeUnknown,
NfcEinkScreenTypeGoodisplay2n13inch,
NfcEinkScreenTypeGoodisplay2n9inch,

//NfcEinkTypeGoodisplay4n2inch,

NfcEinkScreenTypeWaveshare2n13inch,
NfcEinkScreenTypeWaveshare2n9inch,
NfcEinkScreenTypeGoodisplay1n54inch,
NfcEinkScreenTypeGoodisplay3n71inch,

NfcEinkScreenTypeWaveshare2n7inch,
NfcEinkScreenTypeWaveshare4n2inch,
NfcEinkScreenTypeWaveshare7n5inch,
NfcEinkScreenTypeGoodisplayEY2Color1n54inch,
NfcEinkScreenTypeGoodisplayEY2Color2n13inch,
NfcEinkScreenTypeGoodisplayEY2Color2n9inch,
NfcEinkScreenTypeGoodisplayEY2Color3n71inch,
NfcEinkScreenTypeGoodisplayEY2Color4n2inch,

NfcEinkScreenTypeGoodisplayEW2Color1n54inch,
NfcEinkScreenTypeGoodisplayEW2Color2n13inch,
NfcEinkScreenTypeGoodisplayEW2Color2n9inch,
NfcEinkScreenTypeGoodisplayEW2Color4n2inch,

NfcEinkScreenTypeGoodisplayEY3Color1n54inch,
NfcEinkScreenTypeGoodisplayEY3Color2n13inch,
NfcEinkScreenTypeGoodisplayEY3Color2n9inch,
NfcEinkScreenTypeGoodisplayEY3Color4n2inch,

NfcEinkScreenTypeGoodisplayEW3Color2n13inch,
NfcEinkScreenTypeGoodisplayEW3Color2n9inch,
NfcEinkScreenTypeGoodisplayEQ3Color4n2inch,
//-----------------------------------------------
NfcEinkScreenTypeWaveshare2Color2n13inch,
NfcEinkScreenTypeWaveshare2Color2n7inch,
NfcEinkScreenTypeWaveshare2Color2n9inch,
NfcEinkScreenTypeWaveshare2Color4n2inch,
NfcEinkScreenTypeWaveshare2Color7n5inch,
NfcEinkScreenTypeWaveshare2ColorHD7n5inch,

NfcEinkScreenTypeWaveshare3Color1n54inch,
NfcEinkScreenTypeWaveshare3Color2n9inch,
//All new screens can be added here

NfcEinkScreenTypeNum
} NfcEinkScreenType;
@@ -63,7 +79,6 @@ typedef struct {
free((void*)old); \
} while(false)

//#define M_SET(a, b) (M_INIT(a); memcpy(a, b, M_ARRAY_SIZE))
#define M_CLEAR(a) (free((void*)a))

#define M_DESCRIPTOR_ARRAY_OPLIST \
24 changes: 11 additions & 13 deletions nfc_eink/nfc_eink_screen/waveshare/eink_waveshare_config.c
Original file line number Diff line number Diff line change
@@ -5,15 +5,15 @@
EinkScreenTypeWaveshare
eink_waveshare_config_translate_screen_type_to_protocol(NfcEinkScreenType common_screen_type) {
switch(common_screen_type) {
case NfcEinkScreenTypeWaveshare2n13inch:
case NfcEinkScreenTypeWaveshare2Color2n13inch:
return EinkScreenTypeWaveshare2n13inch;
case NfcEinkScreenTypeWaveshare2n7inch:
case NfcEinkScreenTypeWaveshare2Color2n7inch:
return EinkScreenTypeWaveshare2n7inch;
case NfcEinkScreenTypeWaveshare2n9inch:
case NfcEinkScreenTypeWaveshare2Color2n9inch:
return EinkScreenTypeWaveshare2n9inch;
case NfcEinkScreenTypeWaveshare4n2inch:
case NfcEinkScreenTypeWaveshare2Color4n2inch:
return EinkScreenTypeWaveshare4n2inch;
case NfcEinkScreenTypeWaveshare7n5inch:
case NfcEinkScreenTypeWaveshare2Color7n5inch:
return EinkScreenTypeWaveshare7n5inch;
default:
FURI_LOG_E(TAG, "Unknown waveshare screen type 0x%02X", common_screen_type);
@@ -26,17 +26,15 @@ NfcEinkScreenType eink_waveshare_config_translate_protocol_to_screen_type(
NfcEinkScreenType common_type = NfcEinkScreenTypeUnknown;

if(protocol_screen_type == EinkScreenTypeWaveshare2n13inch) {
common_type = NfcEinkScreenTypeWaveshare2n13inch;
common_type = NfcEinkScreenTypeWaveshare2Color2n13inch;
} else if(protocol_screen_type == EinkScreenTypeWaveshare2n9inch) {
common_type = NfcEinkScreenTypeWaveshare2n9inch;
common_type = NfcEinkScreenTypeWaveshare2Color2n9inch;
} else if(protocol_screen_type == EinkScreenTypeWaveshare2n7inch) {
common_type = NfcEinkScreenTypeWaveshare2n7inch;
common_type = NfcEinkScreenTypeWaveshare2Color2n7inch;
} else if(protocol_screen_type == EinkScreenTypeWaveshare4n2inch) {
common_type = NfcEinkScreenTypeWaveshare4n2inch;
} else if(
protocol_screen_type == EinkScreenTypeWaveshare7n5inch ||
protocol_screen_type == EinkScreenTypeWaveshare7n5inchV2) {
common_type = NfcEinkScreenTypeWaveshare7n5inch;
common_type = NfcEinkScreenTypeWaveshare2Color4n2inch;
} else if(protocol_screen_type == EinkScreenTypeWaveshare7n5inch) {
common_type = NfcEinkScreenTypeWaveshare2Color7n5inch;
}

return common_type;
4 changes: 2 additions & 2 deletions nfc_eink/nfc_eink_screen/waveshare/eink_waveshare_config.h
Original file line number Diff line number Diff line change
@@ -6,8 +6,8 @@ typedef enum {
EinkScreenTypeWaveshare2n7inch = 16,
EinkScreenTypeWaveshare2n9inch = 7,
EinkScreenTypeWaveshare4n2inch = 10,
EinkScreenTypeWaveshare7n5inch = 12,
EinkScreenTypeWaveshare7n5inchV2 = 14,
EinkScreenTypeWaveshare7n5inchHD = 12,
EinkScreenTypeWaveshare7n5inch = 14,
} EinkScreenTypeWaveshare;

EinkScreenTypeWaveshare