add some paper api

This commit is contained in:
Gitshaoxiang
2020-11-25 16:54:10 +08:00
parent 4ceda69fe1
commit ce3ffd5b78
41 changed files with 1248 additions and 93 deletions
+2
View File
@@ -20,6 +20,8 @@ Ink_Sprite InkPageSprite(&M5.M5Ink);
**Description: create image area, configure whether to get image data buff from screen driver (default is to save true)**.
?>The `x` coordinate of the >create image area must be an integer multiple of 8. (eg: 0 , 8 , 16...) Otherwise, the display will not work properly.
**Example:**
```arduino
+23
View File
@@ -82,8 +82,31 @@ M5.update();
M5.Speaker.tone(2700);
```
## RTC
?> Please use `M5.begin();` to initialize RTC related functions before using
```
typedef struct RTC_Time
{
int8_t Hours;
int8_t Minutes;
int8_t Seconds;
RTC_Time() : Hours(),Minutes(),Seconds(){}
RTC_Time(int8_t h,int8_t m,int8_t s) : Hours(h),Minutes(m),Seconds(s){}
} RTC_TimeTypeDef;
typedef struct RTC_Date
{
int8_t WeekDay;
int8_t Month;
int8_t Date;
int16_t Year;
RTC_Date() : WeekDay(),Month(),Date(),Year(){}
RTC_Date(int8_t w,int8_t m,int8_t d, int16_t y) : WeekDay(w),Month(m),Date(d),Year(y){}
} RTC_DateTypeDef;
```
## SetTime()
**Syntax:**
+3 -2
View File
@@ -309,6 +309,7 @@ None
M5.Lcd.drawBmpFile(SD, "/p2.bmp",0,0);
```
?>We provide a script that can be used to convert `jpg` images -> `.c` files, you can use it to convert some personal images and draw them on the screen using the following API.[bin2code.py](https://github.com/m5stack/M5Stack/tree/master/tools)
## drawJpg()
@@ -1583,7 +1584,7 @@ M5.begin();
M5.Lcd.drawCentreString("hello", 160, 0, 2);
```
##drawRightString()
## drawRightString()
**Description:**
@@ -1612,7 +1613,7 @@ M5.begin();
M5.Lcd.drawRightString("hello", 160, 0, 2);
```
##int16_t fontHeight()
## int16_t fontHeight()
**Description:**