-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheink.h
78 lines (64 loc) · 1.71 KB
/
eink.h
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
* File: eink.h
* Author: [email protected]
*
* Created on 1. April 2023, 20:48
*/
#ifndef EINK_H
#define EINK_H
#include <stdbool.h>
#define DRIVER_OUTPUT_CONTROL 0x01
#define BOOSTER_SOFT_START_CONTROL 0x0c
#define DEEP_SLEEP_MODE 0x10
#define DATA_ENTRY_MODE_SETTING 0x11
#define SW_RESET 0x12
#define TEMP_SENSOR_CONTROL 0x18
#define WRITE_TO_TEMP_REGISTER 0x1a
#define MASTER_ACTIVATION 0x20
#define DISPLAY_UPDATE_CONTROL2 0x22
#define WRITE_RAM_BW 0x24
#define WRITE_RAM_RED 0x26
#define BORDER_WAVEFORM_CONTROL 0x3c
#define RAM_X_ADDRESS_POSITION 0x44
#define RAM_Y_ADDRESS_POSITION 0x45
#define RAM_X_ADDRESS_COUNTER 0x4e
#define RAM_Y_ADDRESS_COUNTER 0x4f
#define DISPLAY_WIDTH 250
#define DISPLAY_HEIGHT 122
#define DISPLAY_H_BYTES ((DISPLAY_HEIGHT + 8 - DISPLAY_HEIGHT % 8) >> 3)
#define RAM_X_OFFSET 1
/**
* Sets display to send a command.
*/
void displaySetCmd(void);
/**
* Sets display to send data.
*/
void displaySetData(void);
/**
* Sends the given command to the display.
*/
void displayCmd(uint8_t cmd);
/**
* Sends the given data to the display.
*/
void displayData(uint8_t data);
/**
* Resets the display and initializes it either for fast or full update.
*/
void initDisplay(bool fast);
/**
* Sets the RAM address pointer to the starting position.
*/
void resetAddressCounter(void);
/**
* Appends the given 8 pixels (0 = Black, 1 = White) to display RAM.
* @param data
*/
void imageWrite(uint8_t data);
/**
* Updates the display either in fast or full update mode
* and puts it in deep sleep mode.
*/
void updateDisplay(bool fast);
#endif /* EINK_H */