mirror of
https://gitee.com/muyuchl/nrf51_2in13_epd.git
synced 2025-12-06 14:12:49 +08:00
adapt pins to 2.13 inch esl, now can show text
This commit is contained in:
9
USER/EventRecorderStub.scvd
Normal file
9
USER/EventRecorderStub.scvd
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<component_viewer schemaVersion="0.1" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="Component_Viewer.xsd">
|
||||||
|
|
||||||
|
<component name="EventRecorderStub" version="1.0.0"/> <!--name and version of the component-->
|
||||||
|
<events>
|
||||||
|
</events>
|
||||||
|
|
||||||
|
</component_viewer>
|
||||||
@@ -120,7 +120,7 @@
|
|||||||
<SetRegEntry>
|
<SetRegEntry>
|
||||||
<Number>0</Number>
|
<Number>0</Number>
|
||||||
<Key>DLGUARM</Key>
|
<Key>DLGUARM</Key>
|
||||||
<Name>?</Name>
|
<Name></Name>
|
||||||
</SetRegEntry>
|
</SetRegEntry>
|
||||||
<SetRegEntry>
|
<SetRegEntry>
|
||||||
<Number>0</Number>
|
<Number>0</Number>
|
||||||
|
|||||||
@@ -46,13 +46,13 @@ extern "C" {
|
|||||||
//#define BAT_IN 4
|
//#define BAT_IN 4
|
||||||
|
|
||||||
//#define EPD_CTL 2
|
//#define EPD_CTL 2
|
||||||
#define EPD_BS 6
|
#define EPD_BS 5
|
||||||
#define EPD_BUSY 5
|
#define EPD_BUSY 4
|
||||||
#define EPD_RST 4
|
#define EPD_RST 3
|
||||||
#define EPD_DC 3
|
#define EPD_DC 2
|
||||||
#define EPD_CS 2
|
#define EPD_CS 1
|
||||||
#define EPD_SCLK 1
|
#define EPD_SCLK 0
|
||||||
#define EPD_SDI 0
|
#define EPD_SDI 30
|
||||||
|
|
||||||
//#define RX_PIN_NUMBER 20
|
//#define RX_PIN_NUMBER 20
|
||||||
//#define TX_PIN_NUMBER 19
|
//#define TX_PIN_NUMBER 19
|
||||||
|
|||||||
21
USER/main.c
21
USER/main.c
@@ -32,23 +32,26 @@ void EPD_PinConfig(void) {
|
|||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
/* Configure board. */
|
/* Configure board. */
|
||||||
bsp_board_leds_init();
|
// bsp_board_leds_init();
|
||||||
|
|
||||||
EPD_PinConfig();
|
EPD_PinConfig();
|
||||||
|
|
||||||
EPD_2IN66_Init();
|
EPD_2IN66_Init();
|
||||||
EPD_2IN66_Clear();
|
EPD_2IN66_Clear();
|
||||||
EPD_2IN66_Init_Partial();
|
EPD_2IN66_Init_Partial();
|
||||||
EPD_DrawFonts(116 + 5, 1, 10, ":", (const epdFONT_ascii *)&Ascii_DigitalDismay_47X80, NULL, NEW_RAM | OLD_RAM);
|
// EPD_DrawFonts(116 + 5, 1, 10, ":", (const epdFONT_ascii *)&Ascii_DigitalDismay_47X80, NULL, NEW_RAM | OLD_RAM);
|
||||||
sprintf(buf, "%02d", 20);
|
|
||||||
EPD_DrawFonts(20 + 5, 1, 10, buf, (const epdFONT_ascii *)&Ascii_DigitalDismay_47X80, NULL, NEW_RAM | OLD_RAM);
|
sprintf(buf, "%02d", 21);
|
||||||
sprintf(buf, "%02d", 47);
|
EPD_DrawFonts(0, 0, 10, buf, (const epdFONT_ascii *)&Ascii_DigitalDismay_47X80, NULL, NEW_RAM | OLD_RAM);
|
||||||
EPD_DrawFonts(155 + 5, 1, 10, buf, (const epdFONT_ascii *)&Ascii_DigitalDismay_47X80, NULL, NEW_RAM | OLD_RAM);
|
|
||||||
|
// sprintf(buf, "%02d", 47);
|
||||||
|
// EPD_DrawFonts(155 + 5, 1, 10, buf, (const epdFONT_ascii *)&Ascii_DigitalDismay_47X80, NULL, NEW_RAM | OLD_RAM);
|
||||||
|
|
||||||
//static struct Lunar_Date Lunar;
|
//static struct Lunar_Date Lunar;
|
||||||
// LUNAR_SolarToLunar(&Lunar, (uint16_t)(23 + 2000), 2, 27);
|
// LUNAR_SolarToLunar(&Lunar, (uint16_t)(23 + 2000), 2, 27);
|
||||||
sprintf(buf, "2024-06-21");
|
sprintf(buf, "2025-04-28");
|
||||||
|
|
||||||
EPD_DrawFonts(64, 12, 1, buf, (const epdFONT_ascii *)&Ascii_YouYuan_8x16, (const epdFONT_utf8 *)&utf8_CN_16x16, NEW_RAM | OLD_RAM);
|
EPD_DrawFonts(8, 10, 1, buf, (const epdFONT_ascii *)&Ascii_YouYuan_8x16, (const epdFONT_utf8 *)&utf8_CN_16x16, NEW_RAM | OLD_RAM);
|
||||||
|
|
||||||
EPD_2IN66_TurnOnDisplay();
|
EPD_2IN66_TurnOnDisplay();
|
||||||
EPD_2IN66_Sleep();
|
EPD_2IN66_Sleep();
|
||||||
@@ -58,7 +61,7 @@ int main(void)
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < LEDS_NUMBER; i++)
|
for (int i = 0; i < LEDS_NUMBER; i++)
|
||||||
{
|
{
|
||||||
bsp_board_led_invert(i);
|
// bsp_board_led_invert(i);
|
||||||
nrf_delay_ms(500);
|
nrf_delay_ms(500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,11 +27,16 @@
|
|||||||
#define EPD_RST_H nrf_gpio_pin_set(EPD_RST)
|
#define EPD_RST_H nrf_gpio_pin_set(EPD_RST)
|
||||||
#define EPD_READ_BUSY nrf_gpio_pin_read(EPD_BUSY)
|
#define EPD_READ_BUSY nrf_gpio_pin_read(EPD_BUSY)
|
||||||
|
|
||||||
#define EPD_2IN66_WIDTH 152
|
//#define EPD_2IN66_WIDTH 152
|
||||||
#define EPD_2IN66_HEIGHT 296
|
//#define EPD_2IN66_HEIGHT 296
|
||||||
|
|
||||||
|
// wf0213t50cz16 GDEW0213T5 212 x 104
|
||||||
|
#define EPD_2IN66_WIDTH 104
|
||||||
|
#define EPD_2IN66_HEIGHT 212
|
||||||
|
|
||||||
#define NEW_RAM (0x01)
|
#define NEW_RAM (0x01)
|
||||||
#define OLD_RAM (0x02)
|
#define OLD_RAM (0x02)
|
||||||
|
|
||||||
void DelayMS(uint msec);
|
void DelayMS(uint msec);
|
||||||
void SendByte_softSPI(uint8 sdbyte);
|
void SendByte_softSPI(uint8 sdbyte);
|
||||||
void EPD_2IN66_SendCommand(uint8 cmd);
|
void EPD_2IN66_SendCommand(uint8 cmd);
|
||||||
|
|||||||
Reference in New Issue
Block a user