From 3b5be209b27d3e553dc21706f4eaeab594dd6c4f Mon Sep 17 00:00:00 2001 From: Gitshaoxiang <1026025056@qq.com> Date: Thu, 5 Nov 2020 11:39:06 +0800 Subject: [PATCH] add CoreInk API --- docs/en/api/M5Timer.md | 14 +- docs/en/api/axp192_core2.md | 26 ++-- docs/en/api/axp192_m5stickc.md | 28 ++-- docs/en/api/button.md | 16 +- docs/en/api/commutil.md | 16 +- docs/en/api/coreink/eink_api.md | 191 +++++++++++++++++++++++ docs/en/api/coreink/system_api.md | 178 ++++++++++++++++++++++ docs/en/api/eeprom.md | 8 +- docs/en/api/gpio.md | 48 +++--- docs/en/api/imu.md | 10 +- docs/en/api/lcd.md | 160 ++++++++++---------- docs/en/api/lcd_m5stickc.md | 24 +-- docs/en/api/mpu9250.md | 14 +- docs/en/api/power.md | 50 +++--- docs/en/api/pwm.md | 6 +- docs/en/api/rtc.md | 8 +- docs/en/api/sh200q_m5stickc.md | 8 +- docs/en/api/speaker.md | 10 +- docs/en/api/system.md | 6 +- docs/en/api/system_m5stickc.md | 4 +- docs/en/api/tf.md | 4 +- docs/en/api/ticker.md | 12 +- docs/en/api/touch.md | 8 +- docs/en/api/wifi.md | 56 +++---- docs/en/arduino/arduino_home_page.md | 11 +- docs/en/core/basic.md | 4 + docs/en/core/core2.md | 4 + docs/en/core/coreink.md | 3 + docs/en/core/face_kit.md | 3 + docs/en/core/fire.md | 4 + docs/en/core/gray.md | 3 + docs/en/core/m5go.md | 4 + docs/en/core/m5go_lite.md | 4 + docs/en/core/m5paper.md | 3 + docs/en/core/m5stickc.md | 3 + docs/en/core/m5stickc_plus.md | 4 + docs/zh_CN/api/axp192_core2.md | 26 ++-- docs/zh_CN/api/axp192_m5stickc.md | 28 ++-- docs/zh_CN/api/button.md | 16 +- docs/zh_CN/api/commutil.md | 16 +- docs/zh_CN/api/coreink/eink_api.md | 192 ++++++++++++++++++++++++ docs/zh_CN/api/coreink/system_api.md | 179 ++++++++++++++++++++++ docs/zh_CN/api/eeprom.md | 8 +- docs/zh_CN/api/gpio.md | 48 +++--- docs/zh_CN/api/imu.md | 10 +- docs/zh_CN/api/lcd.md | 152 +++++++++---------- docs/zh_CN/api/lcd_m5stickc.md | 32 ++-- docs/zh_CN/api/mpu9250.md | 26 ++-- docs/zh_CN/api/power.md | 50 +++--- docs/zh_CN/api/pwm.md | 6 +- docs/zh_CN/api/rtc.md | 10 +- docs/zh_CN/api/sh200q_m5stickc.md | 6 +- docs/zh_CN/api/speaker.md | 12 +- docs/zh_CN/api/system.md | 12 +- docs/zh_CN/api/system_m5stickc.md | 6 +- docs/zh_CN/api/tf.md | 4 +- docs/zh_CN/api/ticker.md | 12 +- docs/zh_CN/api/touch.md | 8 +- docs/zh_CN/api/wifi.md | 56 +++---- docs/zh_CN/arduino/arduino_home_page.md | 11 +- docs/zh_CN/core/basic.md | 4 + docs/zh_CN/core/core2.md | 3 + docs/zh_CN/core/coreink.md | 4 + docs/zh_CN/core/face_kit.md | 4 + docs/zh_CN/core/fire.md | 4 + docs/zh_CN/core/gray.md | 4 + docs/zh_CN/core/m5go.md | 4 + docs/zh_CN/core/m5go_lite.md | 4 + docs/zh_CN/core/m5paper.md | 3 + docs/zh_CN/core/m5stickc.md | 4 + docs/zh_CN/core/m5stickc_plus.md | 4 + 71 files changed, 1382 insertions(+), 541 deletions(-) create mode 100644 docs/en/api/coreink/eink_api.md create mode 100644 docs/en/api/coreink/system_api.md create mode 100644 docs/zh_CN/api/coreink/eink_api.md create mode 100644 docs/zh_CN/api/coreink/system_api.md diff --git a/docs/en/api/M5Timer.md b/docs/en/api/M5Timer.md index d5ac2cf1..0d33f0b8 100644 --- a/docs/en/api/M5Timer.md +++ b/docs/en/api/M5Timer.md @@ -2,7 +2,7 @@ **Syntax:** -run() +`run()` **Description:** @@ -13,7 +13,7 @@ this function must be called inside loop() **Syntax:** -int setInterval(long d, timer_callback f) +`int setInterval(long d, timer_callback f)` **Description:** @@ -52,7 +52,7 @@ void loop() { **Syntax:** -int setTimeout(long d, timer_callback f) +`int setTimeout(long d, timer_callback f)` **Description:** @@ -92,7 +92,7 @@ void loop() { **Syntax:** -int setTimer(long d, timer_callback f, int n); +`int setTimer(long d, timer_callback f, int n);` **Description:** @@ -133,7 +133,7 @@ void loop() { **Syntax:** -void Enable(int numTimer) +`void Enable(int numTimer)` **Description:** @@ -172,7 +172,7 @@ void loop() { **Syntax:** -boolean isEnabled(int numTimer) +`boolean isEnabled(int numTimer)` **Description:** @@ -211,7 +211,7 @@ void loop() { **Syntax:** -void Disable(int numTimer) +`void Disable(int numTimer)` **Description:** diff --git a/docs/en/api/axp192_core2.md b/docs/en/api/axp192_core2.md index 86178b67..2f727904 100644 --- a/docs/en/api/axp192_core2.md +++ b/docs/en/api/axp192_core2.md @@ -6,7 +6,7 @@ **Syntax:** -void SetLed(uint8_t state); +`void SetLed(uint8_t state);` **Description:Setting LED power indicator** @@ -26,7 +26,7 @@ void loop() {} **Syntax:** -void SetCHGCurrent(uint8_t state); +`void SetCHGCurrent(uint8_t state);` **Description: Set charging current.** @@ -48,7 +48,7 @@ void loop() { **Syntax:** -void SetSpkEnable(uint8_t state); +`void SetSpkEnable(uint8_t state);` **Description:Enable speaker。** @@ -69,7 +69,7 @@ void loop() { **Syntax:** -void SetBusPowerMode(uint8_t state); +`void SetBusPowerMode(uint8_t state);` **Description:Enable bus power output** @@ -90,7 +90,7 @@ void loop() { **Syntax:** -void SetLcdVoltage(uint16_t voltage) +`void SetLcdVoltage(uint16_t voltage)` **Description: Setting screen backlight voltage.** @@ -113,7 +113,7 @@ void loop() { **Syntax:** -void SetLDOEnable(uint8_t number, bool state) +`void SetLDOEnable(uint8_t number, bool state)` **Description: Enable LDO Pin** @@ -138,7 +138,7 @@ void loop() { **Syntax:** -void SetLDOVoltage(uint8_t number, uint16_t voltage); +`void SetLDOVoltage(uint8_t number, uint16_t voltage);` **Description: Config LDO voltage** @@ -161,7 +161,7 @@ void loop() { **Syntax:** -bool isACIN() +`bool isACIN()` **Description:Determine whether the external power supply is connected** @@ -186,7 +186,7 @@ void loop() { **Syntax:** -uint16_t GetVapsData(void); +`uint16_t GetVapsData(void);` **Description: Get battery capacity.** @@ -213,7 +213,7 @@ void loop() { **Syntax:** -uint16_t GetTempData(void); +`uint16_t GetTempData(void);` **Description: Get AXP192 chip temperature.** @@ -242,7 +242,7 @@ void loop() { **Syntax:** -uint16_t GetIdischargeData(void); +`uint16_t GetIdischargeData(void);` **Description: Obtain discharge current.** @@ -271,7 +271,7 @@ void loop() { **Syntax:** -uint16_t GetIinData(void); +`uint16_t GetIinData(void);` **Description: Get input current.** @@ -296,7 +296,7 @@ void loop() { **Syntax:** -uint16_t GetIusbinData(void); +`uint16_t GetIusbinData(void);` **Description:Get USB current.** diff --git a/docs/en/api/axp192_m5stickc.md b/docs/en/api/axp192_m5stickc.md index f40b4193..6ad831a7 100644 --- a/docs/en/api/axp192_m5stickc.md +++ b/docs/en/api/axp192_m5stickc.md @@ -6,7 +6,7 @@ **Syntax:** -void begin(void); +`void begin(void);` **Description: Initialize the AXP192.** @@ -25,7 +25,7 @@ void loop() {} **Syntax:** -uint8_t GetWarningLeve(void); +`uint8_t GetWarningLeve(void);` **Description: get current warning level.** @@ -49,7 +49,7 @@ void loop() { **Syntax:** -void LightSleep(uint64_t time_in_us = 0) +`void LightSleep(uint64_t time_in_us = 0)` **Description: control ESP32 into LightSleep Mode ,Press power swith to wakeup.** @@ -84,7 +84,7 @@ void loop() { **Syntax:** -void SetSleep(void); +`void SetSleep(void);` **Description: control external device into Sleep Mode,Press power switch to wakeup.** @@ -112,7 +112,7 @@ void loop() { **Syntax:** -void DeepSleep(uint64_t time_in_us = 0) +`void DeepSleep(uint64_t time_in_us = 0)` **Description: control external device into DeepSleep Mode,When timeout device auto wakeup.** @@ -143,7 +143,7 @@ void loop() { **Syntax:** -void ScreenBreath(uint8_t brightness); +`void ScreenBreath(uint8_t brightness);` **Description: Change the LDO3 output voltage of the AXP192 chip.** @@ -173,7 +173,7 @@ void loop() { **Syntax:** -uint16_t GetVbatData(void); +`uint16_t GetVbatData(void);` **Description: Get the battery voltage value.** @@ -201,7 +201,7 @@ void loop() { **Syntax:** -uint16_t GetIchargeData(void); +`uint16_t GetIchargeData(void);` **Description: Get the battery charging current.** @@ -229,7 +229,7 @@ void loop() { **Syntax:** -uint32_t GetPowerbatData(void); +`uint32_t GetPowerbatData(void);` **Description: Get Current Power.** @@ -258,7 +258,7 @@ void loop() { **Syntax:** -uint16_t GetVapsData(void); +`uint16_t GetVapsData(void);` **Description: Get battery capacity.** @@ -286,7 +286,7 @@ void loop() { **Syntax:** -uint16_t GetTempData(void); +`uint16_t GetTempData(void);` **Description: Get battery capacity.** @@ -314,7 +314,7 @@ void loop() { **Syntax:** -uint16_t GetIinData(void); +`uint16_t GetIinData(void);` **Description: ACIN current.** @@ -339,7 +339,7 @@ void loop() { **Syntax:** -uint16_t GetIdischargeData(void); +`uint16_t GetIdischargeData(void);` **Description: Get battery output current.** @@ -367,7 +367,7 @@ void loop() { **Syntax:** -uint16_t GetIusbinData(void); +`uint16_t GetIusbinData(void);` **Description: Get USB vin current.** diff --git a/docs/en/api/button.md b/docs/en/api/button.md index ee10e50f..c8688470 100644 --- a/docs/en/api/button.md +++ b/docs/en/api/button.md @@ -4,7 +4,7 @@ **Syntax:** -uint8_t read() +`uint8_t read()` **Description:** @@ -30,7 +30,7 @@ void loop() { **Syntax:** -uint8_t isPressed() +`uint8_t isPressed()` **Description:** @@ -60,7 +60,7 @@ void loop() { **Syntax:** -uint8_t wasPressed() +`uint8_t wasPressed()` **Description:** @@ -90,7 +90,7 @@ void loop() { **Syntax:** -uint8_t releasedFor(uint32_t ms) +`uint8_t releasedFor(uint32_t ms)` **Description:** @@ -124,7 +124,7 @@ void loop() { **Syntax:** -uint8_t pressedFor(uint32_t ms); +`uint8_t pressedFor(uint32_t ms);` **Description:** @@ -158,7 +158,7 @@ void loop() { **Syntax:** -uint32_t lastChange(void); +`uint32_t lastChange(void);` **Description:** @@ -185,7 +185,7 @@ void loop() { **Syntax:** -uint8_t wasReleasefor(uint32_t ms); +`uint8_t wasReleasefor(uint32_t ms);` **Description:** @@ -219,7 +219,7 @@ void loop() { **Syntax:** -uint8_t wasReleased(void) +`uint8_t wasReleased(void)` **Description:** diff --git a/docs/en/api/commutil.md b/docs/en/api/commutil.md index bac0a7ef..c958f465 100644 --- a/docs/en/api/commutil.md +++ b/docs/en/api/commutil.md @@ -6,7 +6,7 @@ I2C communication needs to be initialized in advance by M5.Begin(). ## writeCommand() **Syntax:** -bool writeCommand(uint8_t address, uint8_t subAddress); +`bool writeCommand(uint8_t address, uint8_t subAddress);` **Description:** @@ -31,7 +31,7 @@ Used when there are no parameters. ## writeByte() **Syntax:** -bool writeByte(uint8_t address, uint8_t subAddress, uint8_t data); +`bool writeByte(uint8_t address, uint8_t subAddress, uint8_t data);` **Description:** @@ -58,7 +58,7 @@ Used when there is one parameter. ## writeBytes() **Syntax:** - bool writeBytes(uint8_t address, uint8_t subAddress, uint8_t *data,uint8_t length); +` bool writeBytes(uint8_t address, uint8_t subAddress, uint8_t *data,uint8_t length);` **Description:** @@ -85,7 +85,7 @@ Use when there are multiple parameters. ## readByte() **Syntax:** - bool readByte(uint8_t address, uint8_t *result); +` bool readByte(uint8_t address, uint8_t *result);` **Description:** @@ -110,7 +110,7 @@ It is used when there is no data to send before reading and the response is 1 by ## readByte() **Syntax:** -bool readByte(uint8_t address, uint8_t subAddress,uint8_t *result); +`bool readByte(uint8_t address, uint8_t subAddress,uint8_t *result);` **Description:** @@ -136,7 +136,7 @@ It is used when the data to be sent before reading is only the functional addres ## readBytes() **Syntax:** -bool readBytes(uint8_t address, uint8_t count,uint8_t * dest); +`bool readBytes(uint8_t address, uint8_t count,uint8_t * dest);` **Description:** @@ -161,7 +161,7 @@ Use when there is no data to send before reading and there are multiple response ## readBytes() **Syntax:** -bool readBytes(uint8_t address, uint8_t subAddress, uint8_t count, uint8_t * dest); +`bool readBytes(uint8_t address, uint8_t subAddress, uint8_t count, uint8_t * dest);` **Description:** @@ -189,7 +189,7 @@ It is used when the data to be sent before reading is only the functional addres ## scanID() **Syntax:** -bool readBytes(bool *result); +`bool readBytes(bool *result);` **Description:** diff --git a/docs/en/api/coreink/eink_api.md b/docs/en/api/coreink/eink_api.md new file mode 100644 index 00000000..084201a4 --- /dev/null +++ b/docs/en/api/coreink/eink_api.md @@ -0,0 +1,191 @@ +# E-Ink + +?>Before using the E-Ink screen manipulation function, you need to create an instance and pass in the screen driver address. + +``` +#include "M5CoreInk.h" +Ink_Sprite InkPageSprite(&M5.M5Ink); +``` + +## creatSprite + +**Syntax:** + +`int creatSprite(uint16_t posX, + uint16_t posY, + uint16_t width = 200, + uint16_t height = 200, + bool copyFromMem = true); +` + +**Description: create image area, configure whether to get image data buff from screen driver (default is to save true)**. + +**Example:** + +```arduino + +if( InkPageSprite.creatSprite(0,0,200,200,true) != 0 ) +{ + Serial.printf"Ink Sprite creat faild"); +} + +Serial.printf("Ink Sprite creat successful"); + +``` + +## clear + +**Syntax:** + +`void clear( int cleanFlag = CLEAR_DRAWBUFF );` + +**Description: Clear the content of the image area, CLEAR_DRAWBUFF (clear the image data that has not yet been pushed) CLEAR_LASTBUFF (clear the cache area of ​​the image data refreshed last time, and refresh the screen completely when it is pushed again)** + +**Example:** + +```arduino + +InkPageSprite.clear(); + +``` + + +## deleteSprite + +**Syntax:** + +`int deleteSprite();` + +**Description: Release the created image area** + +**Example:** + +```arduino + +InkPageSprite.clear(); + +``` + +## pushSprite + +**Syntax:** + +`int pushSprite();` + +**Description: Push the edited image data to the image area (after using the drawing API to operate, you need to push to refresh the screen)** + +**Example:** + +```arduino +InkPageSprite.drawString(10,50,"Hello World!",&AsciiFont8x16); +InkPageSprite.pushSprite(); +``` + +## drawPix + +**Syntax:** + +`void drawPix(uint16_t posX,uint16_t posY,uint8_t pixBit);` + +**Description: draw a single pixel(the parameter pixBit is black when 0 is passed in, and white when 1 is passed in)** + +**Example:** + +```arduino +InkPageSprite.drawPix(100,100,0); +InkPageSprite.pushSprite(); +``` + + +## FillRect + +**Syntax:** + +`void FillRect(uint16_t posX, + uint16_t posY, + uint16_t width, + uint16_t height, + uint8_t pixBit);` + +**Description: draw a rectangle (the parameter pixBit is black when 0 is passed in, and white when 1 is passed in)** + +**Example:** + +```arduino +InkPageSprite.FillRect(0,0,100,100,0); +InkPageSprite.pushSprite(); +``` + + +## drawFullBuff + +**Syntax:** + +`void drawFullBuff(uint8_t* buff, bool bitMode = true);` + +` void drawBuff(uint16_t posX, + uint16_t posY, + uint16_t width, + uint16_t height, + uint8_t* imageDataptr);` + + +**Description: To draw the entire page, you need to pass in the complete page Buff** + + +## drawChar + +**Syntax:** + +`void drawChar(uint16_t posX,uint16_t posY,char charData,Ink_eSPI_font_t* fontPtr);` + + +**Description: draw characters** + +**Example:** + +```arduino +InkPageSprite.drawChar(35,50,'M'); +InkPageSprite.pushSprite(); +``` + +## drawString + +**Syntax:** + +`void drawString(uint16_t posX,uint16_t posY,const char* charData,Ink_eSPI_font_t* fontPtr = &AsciiFont8x16);` + + +**Description: draw string** + +**Example:** + +```arduino +InkPageSprite.drawString(35,50,"Hello World!"); +InkPageSprite.pushSprite(); +``` + +## getSpritePtr + +**Syntax:** + +**Description: Get image buff data** + +`uint8_t* getSpritePtr(){ return _spriteBuff;}` + +**Description: Get image width coordinate data** + +`uint16_t width(){ return _width;}` + +**Description: Get image height coordinate data** + +`uint16_t height(){ return _height;}` + +**Description: Get image X coordinate data** + +`uint16_t posX(){ return _posX;}` + +**Description: Get Y coordinate data of image area** + +`uint16_t posY(){ return _posY;}` + diff --git a/docs/en/api/coreink/system_api.md b/docs/en/api/coreink/system_api.md new file mode 100644 index 00000000..7dd99a89 --- /dev/null +++ b/docs/en/api/coreink/system_api.md @@ -0,0 +1,178 @@ +# System & Button & RTC + +## begin() + +**Syntax:** + +`int begin(bool InkEnable = true, bool wireEnable = false);` + +**Description: Initialize E-Ink, RTC, I2C, Speaker** + + +**Example:** + +```arduino +#include "M5CoreInk.h" + +void setup() { + M5.begin(true,false); +} +``` + +## update() + +**Syntax:** + +`void update();` + +**Description: refresh device button/buzzer status** + +**Example:** + +```arduino + +if( M5.BtnPWR.wasPressed()) +{ + Serial.printf("Btn wasPressed!"); +} +M5.update(); + +``` + +## Button + +**Description: detects the device key state** + +`M5.BtnUP.wasPressed()` + +`M5.BtnDOWN.wasPressed()` + +`M5.BtnMID.wasPressed()` + +`M5.BtnEXT.wasPressed()` + +`M5.BtnPWR.wasPressed()` + +## Speaker + +**Description: Buzzer Drive** + +`void end();` +`void mute();` +`void tone(uint16_t frequency);` +`void tone(uint16_t frequency, uint32_t duration);` +`void beep();` +`void setBeep(uint16_t frequency, uint16_t duration);` +`void update();` +`void write(uint8_t value);` +`void setVolume(uint8_t volume);` +`void playMusic(const uint8_t *music_data, uint16_t sample_rate);` + +``` +M5.Speaker.tone(2700); +``` + +?> Please use `M5.begin();` to initialize RTC related functions before using + +## SetTime() + +**Syntax:** + +`void SetTime(RTC_TimeTypeDef* RTC_TimeStruct)` + +**Description:** + +Set RTC Time Struct + +## GetTime() + +**Syntax:** + +`void GetTime(RTC_TimeTypeDef* RTC_TimeStruct)` + +**Description:** + +Get RTC Time Struct + +## SetData() + +**Syntax:** + +`void SetData(RTC_TimeTypeDef* RTC_DateStruct)` + +**Description:** + +Set RTC Date Struct + + +## GetData() + +**Syntax:** + +`void GetData(RTC_TimeTypeDef* RTC_DateStruct)` + +**Description:** + +Get RTC Date Struct + +**Example:** + +``` +#include "M5CoreInk.h" + +Ink_Sprite InkPageSprite(&M5.M5Ink); + +RTC_TimeTypeDef RTCtime; +RTC_DateTypeDef RTCDate; + +char timeStrbuff[64]; + +void flushTime(){ + M5.rtc.GetTime(&RTCtime); + M5.rtc.GetData(&RTCDate); + + sprintf(timeStrbuff,"%d/%02d/%02d %02d:%02d:%02d", + RTCDate.Year,RTCDate.Month,RTCDate.Date, + RTCtime.Hours,RTCtime.Minutes,RTCtime.Seconds); + + InkPageSprite.drawString(10,100,timeStrbuff); + InkPageSprite.pushSprite(); +} + +void setupTime(){ + + RTCtime.Hours = 23; + RTCtime.Minutes = 33; + RTCtime.Seconds = 33; + M5.rtc.SetTime(&RTCtime); + + RTCDate.Year = 2020; + RTCDate.Month = 11; + RTCDate.Date = 6; + M5.rtc.SetData(&RTCDate); +} + +void setup() { + + M5.begin(); + if( !M5.M5Ink.isInit()) + { + Serial.printf("Ink Init faild"); + while (1) delay(100); + } + M5.M5Ink.clear(); + delay(1000); + //creat ink refresh Sprite + if( InkPageSprite.creatSprite(0,0,200,200,true) != 0 ) + { + Serial.printf("Ink Sprite creat faild"); + } + setupTime(); +} + +void loop() { + flushTime(); + delay(15000); +} +``` + diff --git a/docs/en/api/eeprom.md b/docs/en/api/eeprom.md index e77a10c7..094c3b37 100644 --- a/docs/en/api/eeprom.md +++ b/docs/en/api/eeprom.md @@ -2,7 +2,7 @@ **Syntax:** -EEPROM.begin(size) +`EEPROM.begin(size)` **Description:** @@ -20,7 +20,7 @@ Open EEPROM,Size is the maximum address + 1 of the data bytes to be read and wri **Syntax:** -EEPROM.write(addr, data) +`EEPROM.write(addr, data)` **Description:** @@ -37,7 +37,7 @@ Write data to storage space. **Syntax:** -EEPROM.commit() +`EEPROM.commit()` **Description:** @@ -51,7 +51,7 @@ None **Syntax:** -EEPROM.read(addr) +`EEPROM.read(addr)` **Description:** diff --git a/docs/en/api/gpio.md b/docs/en/api/gpio.md index 6a5be357..5d9a360a 100644 --- a/docs/en/api/gpio.md +++ b/docs/en/api/gpio.md @@ -48,7 +48,7 @@ **Syntax:** -int digitalRead(uint8_t pin) +`int digitalRead(uint8_t pin)` **Description:** @@ -81,7 +81,7 @@ pin21_data = digitalRead(21); **Syntax:** -void digitalWrite(uint8_t pin, uint8_t val) +`void digitalWrite(uint8_t pin, uint8_t val)` **Description:** @@ -115,7 +115,7 @@ digitalWrite(2,1); **Syntax:** -void pinMode(uint8_t pin, uint8_t mode) +`void pinMode(uint8_t pin, uint8_t mode)` **Description:** @@ -149,7 +149,7 @@ pinMode(2,INPUT); ## analogRead() **Syntax:** -uint16_t analogRead(uint8_t pin) +`uint16_t analogRead(uint8_t pin)` **Description:** @@ -180,7 +180,7 @@ ret=analogRead(35); **Syntax:** -void dacWrite(uint8_t pin, uint8_t value) +`void dacWrite(uint8_t pin, uint8_t value)` **Description:** @@ -211,7 +211,7 @@ dacWrite(25,0x40); **Syntax:** -double ledcSetup(uint8_t channel, double freq, uint8_t resolution_bits) +`double ledcSetup(uint8_t channel, double freq, uint8_t resolution_bits)` **Description:** @@ -241,7 +241,7 @@ It is good to recognize that it is a number to memorize the setting. **Syntax:** -void ledcAttachPin(uint8_t pin, uint8_t chan) +`void ledcAttachPin(uint8_t pin, uint8_t chan)` **Description:** @@ -262,7 +262,7 @@ None. **Syntax:** -void ledcWrite(uint8_t chan, uint32_t duty) +`void ledcWrite(uint8_t chan, uint32_t duty)` **Description:** @@ -289,7 +289,7 @@ When specifying with 8 bits, specifying 0xFF results in 100% output. **Syntax:** -void ledcDetachPin(uint8_t pin) +`void ledcDetachPin(uint8_t pin)` **Description:** @@ -310,7 +310,7 @@ None. **Syntax:** -void analogSetCycles(uint8_t cycles) +`void analogSetCycles(uint8_t cycles)` **Description:** @@ -330,7 +330,7 @@ None **Syntax:** -void analogSetWidth(uint8_t bits) +`void analogSetWidth(uint8_t bits)` **Description:** @@ -350,7 +350,7 @@ None **Syntax:** -void analogReadResolution(uint8_t bits) +`void analogReadResolution(uint8_t bits)` **Description:** @@ -370,7 +370,7 @@ None **Syntax:** -void analogSetSamples(uint8_t samples) +`void analogSetSamples(uint8_t samples)` **Description:** @@ -390,7 +390,7 @@ None **Syntax:** -void analogSetAttenuation(adc_attenuation_t attenuation) +`void analogSetAttenuation(adc_attenuation_t attenuation)` **Description:** @@ -410,7 +410,7 @@ None **Syntax:** -void analogSetPinAttenuation(uint8_t pin, adc_attenuation_t attenuation) +`void analogSetPinAttenuation(uint8_t pin, adc_attenuation_t attenuation)` **Description:** @@ -432,7 +432,7 @@ None **Syntax:** -int hallRead(void)); +`int hallRead(void));` **Description:** @@ -450,7 +450,7 @@ int. **Syntax:** -void attachInterrupt(pin, ISR(callback function), interrupt type/mode) +`void attachInterrupt(pin, ISR(callback function), interrupt type/mode)` **Description:** @@ -472,7 +472,7 @@ None. **Syntax:** -void detachInterrupt(pin) +`void detachInterrupt(pin)` **Description:** @@ -492,7 +492,7 @@ None. **Syntax:** -double ledcReadFreq(uint8_t channel) +`double ledcReadFreq(uint8_t channel)` **Description:** @@ -512,7 +512,7 @@ current frequency **Syntax:** -uint32_t ledcRead(uint8_t channel) +`uint32_t ledcRead(uint8_t channel)` **Description:** @@ -532,7 +532,7 @@ duty cycle **Syntax:** -bool adcAttachPin(uint8_t pin) +`bool adcAttachPin(uint8_t pin)` **Description:** @@ -553,7 +553,7 @@ Return 1 if boot succeeds **Syntax:** -bool adcStart(uint8_t pin) +`bool adcStart(uint8_t pin)` **Description:** @@ -573,7 +573,7 @@ Return 1 if boot succeeds **Syntax:** -bool adcBusy(uint8_t pin) +`bool adcBusy(uint8_t pin)` **Description:** @@ -593,7 +593,7 @@ Conversion returning 1 **Syntax:** -uint16_t adcEnd(uint8_t pin) +`uint16_t adcEnd(uint8_t pin)` **Description:** diff --git a/docs/en/api/imu.md b/docs/en/api/imu.md index a26a377a..f94c87b3 100644 --- a/docs/en/api/imu.md +++ b/docs/en/api/imu.md @@ -6,7 +6,7 @@ **Syntax:** -int Init(void); +`int Init(void);` **Description:initialize IMU** @@ -26,7 +26,7 @@ void loop() {} **Syntax:** -void getGyroData(float *gx, float *gy, float *gz); +`void getGyroData(float *gx, float *gy, float *gz);` **Description:Obtain the three-axis gyroscope data of the IMU chip.** @@ -52,7 +52,7 @@ void loop() { **Syntax:** -void getAccelData(float *ax, float *ay, float *az); +`void getAccelData(float *ax, float *ay, float *az);` **Description:Obtain the three-axis accelerometer data of the IMU chip.** @@ -78,7 +78,7 @@ void loop() { **Syntax:** -void getAhrsData(float *pitch, float *roll, float *yaw); +`void getAhrsData(float *pitch, float *roll, float *yaw);` **Description:Get the attitude of the IMU chip.** @@ -104,7 +104,7 @@ void loop() { **Syntax:** -void getTempData(float *t); +`void getTempData(float *t);` **Description:Get the temperature of the IMU chip.** diff --git a/docs/en/api/lcd.md b/docs/en/api/lcd.md index cf94d1ba..acce5eb4 100644 --- a/docs/en/api/lcd.md +++ b/docs/en/api/lcd.md @@ -34,7 +34,7 @@ Initialize it for use. **Syntax:** -begin(); +`begin();` **Function argument:** @@ -57,7 +57,7 @@ Switch the display to energy saving mode **Syntax:** -sleep(); +`sleep();` **Function argument:** @@ -90,7 +90,7 @@ Restore the display from energy saving mode **Syntax:** -wakeup(); +`wakeup();` **Function argument:** @@ -121,7 +121,7 @@ Adjust the display backlight. **Syntax:** -setBrightness(uint8_t brightness); +`setBrightness(uint8_t brightness);` **Function argument:** @@ -156,7 +156,7 @@ Display a bar that shows the progress. **Syntax:** -progressBar(int x, int y, int w, int h, uint8_t val); +`progressBar(int x, int y, int w, int h, uint8_t val);` **Function argument:** @@ -197,9 +197,9 @@ Generate a QR code. **Syntax:** -qrcode(const char *string, uint16_t x, uint16_t y, uint8_t width, uint8_t version); +`qrcode(const char *string, uint16_t x, uint16_t y, uint8_t width, uint8_t version);` -qrcode(const String &string, uint16_t x, uint16_t y, uint8_t width, uint8_t version); +`qrcode(const String &string, uint16_t x, uint16_t y, uint8_t width, uint8_t version);` **Function argument:** @@ -238,15 +238,15 @@ Draw a bitmap **Syntax:** -drawBitmap(int16_t x0, int16_t y0, int16_t w, int16_t h, const uint16_t *data); +`drawBitmap(int16_t x0, int16_t y0, int16_t w, int16_t h, const uint16_t *data);` -drawBitmap(int16_t x0, int16_t y0, int16_t w, int16_t h, uint16_t *data); +`drawBitmap(int16_t x0, int16_t y0, int16_t w, int16_t h, uint16_t *data);` -drawBitmap(int16_t x0, int16_t y0, int16_t w, int16_t h, const uint16_t *data, uint16_t transparent); +`drawBitmap(int16_t x0, int16_t y0, int16_t w, int16_t h, const uint16_t *data, uint16_t transparent);` -drawBitmap(int16_t x0, int16_t y0, int16_t w, int16_t h, const uint8_t *data); +`drawBitmap(int16_t x0, int16_t y0, int16_t w, int16_t h, const uint8_t *data);` -drawBitmap(int16_t x0, int16_t y0, int16_t w, int16_t h, uint8_t *data); +`drawBitmap(int16_t x0, int16_t y0, int16_t w, int16_t h, uint8_t *data);` **Function argument:** @@ -281,7 +281,7 @@ Read a bitmap from a file and draw it. **Syntax:** -drawBmpFile(fs::FS &fs, const char *path, uint16_t x, uint16_t y); +`drawBmpFile(fs::FS &fs, const char *path, uint16_t x, uint16_t y);` **Function argument:** @@ -318,10 +318,10 @@ Read JPEG data from memory and draw it. **Syntax:** -void drawJpg(const uint8_t *jpg_data, size_t jpg_len, uint16_t x = 0, +`void drawJpg(const uint8_t *jpg_data, size_t jpg_len, uint16_t x = 0, uint16_t y = 0, uint16_t maxWidth = 0, uint16_t maxHeight = 0, uint16_t offX = 0, uint16_t offY = 0, - jpeg_div_t scale = JPEG_DIV_NONE); + jpeg_div_t scale = JPEG_DIV_NONE);` **Function argument:** @@ -367,10 +367,10 @@ Read JPEG data from a file and draw it. **Syntax:** -void drawJpgFile(fs::FS &fs, const char *path, uint16_t x = 0, uint16_t y = 0, +`void drawJpgFile(fs::FS &fs, const char *path, uint16_t x = 0, uint16_t y = 0, uint16_t maxWidth = 0, uint16_t maxHeight = 0, uint16_t offX = 0, uint16_t offY = 0, - jpeg_div_t scale = JPEG_DIV_NONE); + jpeg_div_t scale = JPEG_DIV_NONE);` **Function argument:** @@ -412,7 +412,7 @@ None **Syntax:** -fillScreen(uint16_t color); +`fillScreen(uint16_t color);` **Function: Fill the entire screen with the specified color.** @@ -437,13 +437,13 @@ from m5ui import * lcd.fillScreen(lcd.RED) ``` --> - + ## setTextColor() **Syntax:** -setTextColor(uint16_t color, uint16_t backgroundcolor); +`setTextColor(uint16_t color, uint16_t `backgroundcolor); **Function: Set the foreground color and background color of the displayed text.** @@ -476,7 +476,7 @@ lcd.setTextColor(lcd.ORANGE, lcd.DARKCYAN) **Syntax:** -setCursor(uint16_t x0, uint16_t y0); +`setCursor(uint16_t x0, uint16_t y0);` @@ -504,9 +504,9 @@ lcd.drawPixel(22,22,lcd.RED) **Syntax:** -uint16_t getCursorX(void); +`uint16_t getCursorX(void);` - + **Function: get the cursor of x.** @@ -528,9 +528,9 @@ M5.Lcd.print(X); **Syntax:** -uint16_t getCursorY(void); +`uint16_t getCursorY(void);` - + **Function: get the cursor of y.** @@ -553,9 +553,9 @@ M5.Lcd.print(Y); **Syntax:** -setTextSize(uint8_t); +`setTextSize(uint8_t);` - + **Function: set the Size of Text.** @@ -575,9 +575,9 @@ M5.Lcd.print("Hello"); **Syntax:** -void clear(uint16_t color); +`void clear(uint16_t color);` - + **Function: fill color use of clear screen.** @@ -599,7 +599,7 @@ M5.Lcd.clear(BLACK); **Syntax:** -drawPixel(int16_t x, int16_t y, uint16_t color); +`drawPixel(int16_t x, int16_t y, uint16_t color);` **Function: Draw a point at position (x, y).** @@ -635,7 +635,7 @@ Blend foreground and background and return new colour. **Syntax:** -uint16_t alphaBlend(uint8_t alpha, uint16_t fgc, uint16_t bgc); +`uint16_t alphaBlend(uint8_t alpha, uint16_t fgc, uint16_t bgc);` **Function argument:** @@ -667,7 +667,7 @@ Draws a straight line of the specified color from the specified start point to t **Syntax:** -drawChar(int32_t x, int32_t y, uint16_t c, uint32_t color, uint32_t bg, uint8_t size); +`drawChar(int32_t x, int32_t y, uint16_t c, uint32_t color, uint32_t bg, uint8_t size);` **Function argument:** @@ -697,7 +697,7 @@ Draws a straight line of the specified start point to the end point. **Syntax:** -drawChar(int16_t uniCode, int32_t x, uint16_t y, uint8_t font); +`drawChar(int16_t uniCode, int32_t x, uint16_t y, uint8_t font);` **Function argument:** @@ -725,7 +725,7 @@ draw a long integer. **Syntax:** -drawNumber(long long_num, int32_t poX, int32_t poY); +`drawNumber(long long_num, int32_t poX, int32_t poY);` **Function argument:** @@ -751,7 +751,7 @@ drawFloat, prints 7 non zero digits maximum **Syntax:** -int16_t drawFloat(float floatNumber, uint8_t dp, int32_t poX, int32_t poY); +`int16_t drawFloat(float floatNumber, uint8_t dp, int32_t poX, int32_t poY);` **Function argument:** @@ -778,7 +778,7 @@ Draw a vertical line from X to Y. **Syntax:** -drawFastVLine(int32_t x, int32_t y, int32_t h, uint32_t color); +`drawFastVLine(int32_t x, int32_t y, int32_t h, uint32_t color);` **Function argument:** @@ -805,7 +805,7 @@ Draw a horizontal line from X to Y. **Syntax:** -drawFastHLine(int32_t x, int32_t y, int32_t w, uint32_t color); +`drawFastHLine(int32_t x, int32_t y, int32_t w, uint32_t color);` **Function argument:** @@ -829,7 +829,7 @@ M5.Lcd.drawFastHLine(0, 0, 12, TFT_GREEN); **Syntax:** -drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color); +`drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color); ` **Function: Draw the line from point (x,y) to point (x1,y1).** @@ -860,7 +860,7 @@ lcd.drawLine(0,0,12,12,lcd.WHITE) **Syntax:** -drawCircleHelper( int32_t x0, int32_t y0, int32_t r, uint8_t cornername, uint32_t color); +`drawCircleHelper( int32_t x0, int32_t y0, int32_t r, uint8_t cornername, uint32_t color);` **Function: Draw a quarter circle with the center at the point x0 and y0, with radius r, and a quarter C, and a color from 0 to 65535** @@ -894,7 +894,7 @@ lcd.drawLine(0,0,12,12,lcd.WHITE) **Syntax:** -drawCircle(int32_t x0, int32_t y0, int32_t r, uint32_t color); +`drawCircle(int32_t x0, int32_t y0, int32_t r, uint32_t color);` **Function: Draw a circle on point(x0, y0), Radis is r with color** @@ -919,7 +919,7 @@ M5.Lcd.drawCircle(160, 120, 30, 0XFF00FF); **Syntax:** -fillCircle(int32_t x0, int32_t y0, int32_t r, uint32_t color); +`fillCircle(int32_t x0, int32_t y0, int32_t r, uint32_t color);` **Function: Draw a filled circle on point(x0, y0), Radis is r with color** @@ -944,7 +944,7 @@ M5.Lcd.fillCircle(160, 120, 30, 0XFF00FF); **Syntax:** -drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color); +`drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color); ` **Function: Draw the triangel between points (x,y), (x1,y1) and (x2,y2).** @@ -975,7 +975,7 @@ lcd.drawLine(0,0,12,12,lcd.WHITE) **Syntax:** -fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color); +`fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color); ` **Function: Fill the triangel between points (x,y), (x1,y1) and (x2,y2).** @@ -1006,7 +1006,7 @@ lcd.drawLine(0,0,12,12,lcd.WHITE) **Syntax:** -drawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color); +`drawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color); ` **Function: Draw the rectangle from the upper left point at (x,y) and width and height.** @@ -1039,7 +1039,7 @@ lcd.drawLine(0,0,12,12,lcd.WHITE) **Syntax:** -fillRect(int16_t x, int16_t y, int16_t w, int16_t h,uint16_t color); +`fillRect(int16_t x, int16_t y, int16_t w, int16_t h,uint16_t color); ` **Function: Fill the rectangle from the upper left point at (x,y) and width and height.** @@ -1072,7 +1072,7 @@ lcd.drawLine(0,0,12,12,lcd.WHITE) **Syntax:** -drawRoundRect(int16_t x0, int16_t y0, int16_t w,int16_t h, int16_t radius, uint16_t color); +`drawRoundRect(int16_t x0, int16_t y0, int16_t w,int16_t h, int16_t radius, uint16_t color); ` **Function: Draw the rectangle with rounded corners from the upper left point at (x,y) and width and height. Corner radius is given by radius argument.** @@ -1112,7 +1112,7 @@ Draw a filled square with the upper left point (x, y) and width and height. **Syntax:** -fillRoundRect(int16_t x, int16_t y, int16_t w, int16_t h, int16_t r, [uint16_t color]); +`fillRoundRect(int16_t x, int16_t y, int16_t w, int16_t h, int16_t r, [uint16_t color]);` **Function argument:** @@ -1143,7 +1143,7 @@ Draw an ellipse with the top left point (x, y) and the width and height. **Syntax:** -drawEllipse(int16_t x0, int16_t y0, int32_t rx, int32_t ry, uint16_t color); +`drawEllipse(int16_t x0, int16_t y0, int32_t rx, int32_t ry, uint16_t color);` **Function argument:** @@ -1171,7 +1171,7 @@ Draw a filled ellipse, specifying the top left point (x, y) and the width and he **Syntax:** -fillEllipse(int16_t x0, int16_t y0, int32_t rx, int32_t ry, uint16_t color); +`fillEllipse(int16_t x0, int16_t y0, int32_t rx, int32_t ry, uint16_t color);` **Function argument:** @@ -1200,7 +1200,7 @@ Change to the color code (rgb 565) used in the function. **Syntax:** -color565(uint8_t red, uint8_t green, uint8_t blue); +`color565(uint8_t red, uint8_t green, uint8_t blue);` **Function argument:** @@ -1233,7 +1233,7 @@ Rotate the screen. **Syntax:** -setRotation(uint8_t r); +`setRotation(uint8_t r);` **Function argument:** @@ -1265,7 +1265,7 @@ Reverse the screen color in negative / positive. **Syntax:** -invertDisplay(boolean i); +`invertDisplay(boolean i);` **Function argument:** @@ -1292,7 +1292,7 @@ Load a font **Syntax:** -loadFont(String fontName, fs::FS &ffs); +`loadFont(String fontName, fs::FS &ffs);` **Function argument:** @@ -1317,7 +1317,7 @@ Whether to automatically wrap the display **Syntax:** -setTextWrap(boolean wrapX, boolean wrapY) +`setTextWrap(boolean wrapX, boolean wrapY)` **Function argument:** @@ -1342,7 +1342,7 @@ Set the text position reference datum **Syntax:** -setTextDatum(uint8_t datum) +`setTextDatum(uint8_t datum)` **Function argument:** @@ -1378,7 +1378,7 @@ text background padding some pixel to over-write the old text **Syntax:** -setTextPadding(uint16_t x_width) +`setTextPadding(uint16_t x_width)` **Function argument:** @@ -1410,7 +1410,7 @@ Return the rotation value (as used by setRotation()) **Syntax:** -uint8_t getRotation(void) +`uint8_t getRotation(void)` **Function argument:** @@ -1434,7 +1434,7 @@ Return the pixel width of display (per current rotation) **Syntax:** -int16_t width(void) +`int16_t width(void)` **Function argument:** @@ -1458,7 +1458,7 @@ Return the pixel height of display (per current rotation) **Syntax:** -int16_t height(void) +`int16_t height(void)` **Function argument:** @@ -1482,7 +1482,7 @@ Return the width in pixels of a string in a given font **Syntax:** -int16_t textWidth(const String& string) +`int16_t textWidth(const String& string)` **Function argument:** @@ -1512,7 +1512,7 @@ Return the text datum value (as used by setTextDatum()) **Syntax:** -uint8_t setRotation(void) +`uint8_t setRotation(void)` **Function argument:** @@ -1538,7 +1538,7 @@ rn the height of a font (yAdvance for free fonts) **Syntax:** -int16_t fontHeight(void) +`int16_t fontHeight(void)` **Function argument:** @@ -1562,7 +1562,7 @@ draw string centred on dX **Syntax:** -int16_t drawCentreString(const String& string, int32_t dX, int32_t poY, uint8_t font) +`int16_t drawCentreString(const String& string, int32_t dX, int32_t poY, uint8_t font)` **Function argument:** @@ -1591,7 +1591,7 @@ draw string right justified to dX,deprecated, use setTextDatum() **Syntax:** -int16_t drawRightString(const String& string, int32_t dX, int32_t poY, uint8_t font) +`int16_t drawRightString(const String& string, int32_t dX, int32_t poY, uint8_t font)` **Function argument:** @@ -1620,7 +1620,7 @@ rn the height of a font (yAdvance for free fonts) **Syntax:** -int16_t fontHeight(void) +`int16_t fontHeight(void)` **Function argument:** @@ -1644,7 +1644,7 @@ Finish using a font **Syntax:** -unloadFont(); +`unloadFont();` **Function argument:** @@ -1666,7 +1666,7 @@ Returns whether you are loading a font **Syntax:** -fontsLoaded(); +`fontsLoaded();` **Function argument:** @@ -1695,7 +1695,7 @@ if(M5.Lcd.unloadFont()){ **Syntax:** -print(); +`print();` **Function: Start printing text at the current position of the screen.** @@ -1726,13 +1726,13 @@ Draw a character **Syntax:** -drawString(const char *string, int32_t poX, int32_t poY, uint8_t font); +`drawString(const char *string, int32_t poX, int32_t poY, uint8_t font);` -drawString(const char *string, int32_t poX, int32_t poY); +`drawString(const char *string, int32_t poX, int32_t poY);` -drawString(const String& string, int32_t poX, int32_t poY, uint8_t font); +`drawString(const String& string, int32_t poX, int32_t poY, uint8_t font);` -drawString(const String& string, int32_t poX, int32_t poY); +`drawString(const String& string, int32_t poX, int32_t poY);` **Function argument:** @@ -1759,7 +1759,7 @@ Draw the specified string. **Syntax:** -printf("Format specification",arg1...); +`printf("Format specification",arg1...);` **Note:** @@ -1783,7 +1783,7 @@ M5.Lcd.printf("A=%d",a); **Syntax:** -void* createSprite(int16_t w, int16_t h) +`void* createSprite(int16_t w, int16_t h)` **Function argument:** @@ -1812,7 +1812,7 @@ img.createSprite(70, 80); **Syntax:** -deleteSprite(void) +`deleteSprite(void)` **Function argument:** @@ -1840,7 +1840,7 @@ img.deleteSprite(); **Syntax:** -void setColorDepth(int8_t bit) +`void setColorDepth(int8_t bit)` **Function argument:** @@ -1870,7 +1870,7 @@ Fill the whole sprite with defined colour **Syntax:** -void fillSprite(uint32_t color) +`void fillSprite(uint32_t color)` **Function argument:** @@ -1900,7 +1900,7 @@ Push the sprite to the TFT at x, y,Optionally a "transparent" colour can be defi **Syntax:** -void pushSprite(int32_t x, int32_t y, uint16_t transparent) +`void pushSprite(int32_t x, int32_t y, uint16_t transparent)` **Function argument:** @@ -1933,7 +1933,7 @@ Return the width of the sprite **Syntax:** -int16_t width(void) +`int16_t width(void)` **Function argument:** @@ -1961,7 +1961,7 @@ Return the height of the sprite **Syntax:** -int16_t height(void) +`int16_t height(void)` **Function argument:** diff --git a/docs/en/api/lcd_m5stickc.md b/docs/en/api/lcd_m5stickc.md index 5fd514e8..ef4399f8 100644 --- a/docs/en/api/lcd_m5stickc.md +++ b/docs/en/api/lcd_m5stickc.md @@ -6,7 +6,7 @@ **Syntax:** -void ScreenBreath(uint8_t brightness); +`void ScreenBreath(uint8_t brightness);` **Description: Adjust the brightness of the screen backlight.** @@ -38,7 +38,7 @@ void loop() { **Syntax:** -fillScreen(uint16_t color); +`fillScreen(uint16_t color);` **Description: Fills the entire screen with the specified color.** @@ -64,7 +64,7 @@ void loop() {} **Syntax:** -setTextColor(uint16_t color, [uint16_t backgroundcolor]); +`setTextColor(uint16_t color, [uint16_t backgroundcolor]);` **Description: Sets the foreground color and background color of the displayed text.** @@ -94,7 +94,7 @@ void loop() {} **Syntax:** -setCursor(int16_t x0, int16_t y0, uint8_t font); +`setCursor(int16_t x0, int16_t y0, uint8_t font);` **Description: Move the cursor position to (x0, y0).** @@ -119,7 +119,7 @@ void loop(){} **Syntax:** -drawPixel(int16_t x, int16_t y, [uint16_t color]); +`drawPixel(int16_t x, int16_t y, [uint16_t color]);` **Description: Draw a pixel at the position (x, y).** @@ -147,7 +147,7 @@ void loop() {} **Syntax:** -drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, [uint16_t color]); +`drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, [uint16_t color]);` **Description: Draw a line from the point (x, y) to the point (x1, y1) in the specified color.** @@ -175,7 +175,7 @@ void loop() {} **Syntax:** -drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, [uint16_t color]); +`drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, [uint16_t color]);` **Description: Draw a triangle with the specified color, with vertices of (x, y), (x1, y1), and (x2, y2).** @@ -203,7 +203,7 @@ void loop() {} **Syntax:** -fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, [uint16_t color]); +`fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, [uint16_t color]);` **Description: Fill a triangle with the specified color, with vertices of (x, y), (x1, y1) and (x2, y2).** @@ -231,7 +231,7 @@ void loop() {} **Syntax:** -drawRect(int16_t x, int16_t y, int16_t w, int16_t h, [uint16_t color]); +`drawRect(int16_t x, int16_t y, int16_t w, int16_t h, [uint16_t color]);` **Description: Draws a rectangle with a specified color, where the coordinates of the upper left corner of the rectangle are (x, y), and the width and height.** @@ -261,7 +261,7 @@ void loop() {} **Syntax:** -fillRect(int16_t x, int16_t y, int16_t w, int16_t h, [uint16_t color]); +`fillRect(int16_t x, int16_t y, int16_t w, int16_t h, [uint16_t color]);` **Description: Fill a rectangle with the specified color. The coordinates of the upper left corner are (x, y), and the width and height.** @@ -291,7 +291,7 @@ void loop() {} **Syntax:** -drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color); +`drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color);` **Description: Draw a rounded corner rectangle with the specified color, where the coordinates of the upper left corner of the rectangle are (x, y), the width, the height and the radius of the fillet.** @@ -322,7 +322,7 @@ void loop() {} **Syntax:** -print(); +`print();` **Description: Printing text (string) at the current cursor position of the screen.** diff --git a/docs/en/api/mpu9250.md b/docs/en/api/mpu9250.md index ed3dfd0b..12ed3e08 100644 --- a/docs/en/api/mpu9250.md +++ b/docs/en/api/mpu9250.md @@ -6,7 +6,7 @@ **Syntax:** -void initMPU9250(); +`void initMPU9250();` **Description:** @@ -34,7 +34,7 @@ void loop() { **Syntax:** -void initAK8963(float * destination); +`void initAK8963(float * destination);` **Description:** @@ -78,7 +78,7 @@ void loop() { **Syntax:** -void calibrateMPU9250(float * gyroBias, float * accelBias); +`void calibrateMPU9250(float * gyroBias, float * accelBias);` **Description:** @@ -127,7 +127,7 @@ void loop() { **Syntax:** -uint8_t readByte(uint8_t address, uint8_t subAddress); +`uint8_t readByte(uint8_t address, uint8_t subAddress)`; **Description:** @@ -162,7 +162,7 @@ void loop() { **Syntax:** -void readGyroData(int16_t * destination); +`void readGyroData(int16_t * destination);` **Description:** @@ -214,7 +214,7 @@ void loop() { **Syntax:** -void readAccelData(int16_t * destination); +`void readAccelData(int16_t * destination);` **Description:** @@ -266,7 +266,7 @@ void loop() { **Syntax:** -int16_t readTempData(void); +`int16_t readTempData(void);` **Description:** diff --git a/docs/en/api/power.md b/docs/en/api/power.md index 32be9a1b..47dcda80 100644 --- a/docs/en/api/power.md +++ b/docs/en/api/power.md @@ -18,7 +18,7 @@ Use initialization, communication check, and control in this order, as shown in **Syntax:** -void begin() +`void begin()` **Description:** @@ -37,7 +37,7 @@ No return value. **Syntax:** -bool setPowerBoostOnOff(bool en) +`bool setPowerBoostOnOff(bool en)` **Description:** @@ -62,7 +62,7 @@ The power does not turn off when connected via USB. **Syntax:** -bool setPowerBoostSet(bool en) +`bool setPowerBoostSet(bool en)` **Description:** @@ -87,7 +87,7 @@ The power does not turn off when connected via USB. **Syntax:** -bool setPowerVin(bool en) +`bool setPowerVin(bool en)` **Description:** @@ -112,7 +112,7 @@ Decide whether to turn on the power again. **Syntax:** -bool setPowerWLEDSet(bool en) +`bool setPowerWLEDSet(bool en)` **Description:** @@ -137,7 +137,7 @@ In addition, IP5306 of M5GO is not wired and can not be controlled by this funct **Syntax:** -bool setPowerBtnEn(bool en) +`bool setPowerBtnEn(bool en)` **Description:** @@ -168,7 +168,7 @@ If the power is not supplied, the power can not be turned on. **Syntax:** -bool setLowPowerShutdownTime(ShutdownTime time) +`bool setLowPowerShutdownTime(ShutdownTime time)` **Description:** @@ -195,7 +195,7 @@ Set the waiting time until IP5306 makes the energy saving judgment and the power **Syntax:** -bool setPowerBoostKeepOn(bool en) +`bool setPowerBoostKeepOn(bool en)` **Description:** @@ -219,7 +219,7 @@ This function sets/unsets always boost output mode. **Syntax:** -bool setKeepLightLoad(bool en) +`bool setKeepLightLoad(bool en)` **Description:** @@ -245,7 +245,7 @@ This function sets/unsets to disable the automatic shutdown. **Syntax:** -bool setLowPowerShutdown(bool en) +`bool setLowPowerShutdown(bool en)` **Description:** @@ -271,7 +271,7 @@ Set the power saving automatic shutdown function. **Syntax:** -bool setAutoBootOnLoad(bool en) +`bool setAutoBootOnLoad(bool en)` **Description:** @@ -296,7 +296,7 @@ Set whether to automatically start when power consumption occurs on the secondar **Syntax:** -bool setCharge(bool en) +`bool setCharge(bool en)` **Description:** @@ -322,7 +322,7 @@ try set charge enable->disable->enable, It can be recharged. **Syntax:** -bool isChargeFull() +`bool isChargeFull()` **Description:** @@ -344,7 +344,7 @@ No argument. **Syntax:** -bool canControl() +`bool canControl()` **Description:** @@ -366,7 +366,7 @@ No argument. **Syntax:** -bool isCharging() +`bool isCharging()` **Description:** @@ -388,7 +388,7 @@ No argument. **Syntax:** -int8_t getBatteryLevel() +`int8_t getBatteryLevel()` **Description:** @@ -408,7 +408,7 @@ Returns -1 if it can not communicate with the controller. **Syntax:** -void setWakeupButton(uint8_t button) +`void setWakeupButton(uint8_t button)` **Description:** @@ -434,7 +434,7 @@ setWakeupButton(BUTTON_A_PIN); **Syntax:** -void reset(); +`void reset();` **Description:** @@ -452,7 +452,7 @@ No return value. **Syntax:** -bool isResetbySoftware() +`bool isResetbySoftware()` **Description:** @@ -474,7 +474,7 @@ No argument, **Syntax:** -bool isResetbyWatchdog() +`bool isResetbyWatchdog()` **Description:** @@ -495,7 +495,7 @@ No argument, **Syntax:** -bool isResetbyDeepsleep() +`bool isResetbyDeepsleep()` **Description:** @@ -516,7 +516,7 @@ No argument, **Syntax:** -bool isResetbyPowerSW() +`bool isResetbyPowerSW()` **Description:** @@ -538,7 +538,7 @@ No argument, **Syntax:** -void deepSleep(uint64_t time_in_us) +`void deepSleep(uint64_t time_in_us)` **Description:** @@ -557,7 +557,7 @@ deepSleep(SLEEP_SEC(5)); **Syntax:** -void lightSleep(uint64_t time_in_us) +`void lightSleep(uint64_t time_in_us)` **Description:** This function shifts to deep sleep mode. @@ -577,7 +577,7 @@ lightSleep(SLEEP_SEC(5)); **Syntax:** -void powerOFF() +`void powerOFF()` **Description:** Turn off the power. diff --git a/docs/en/api/pwm.md b/docs/en/api/pwm.md index 88b090ef..31de1941 100644 --- a/docs/en/api/pwm.md +++ b/docs/en/api/pwm.md @@ -6,7 +6,7 @@ **Syntax:** -void ledcSetup(uint8_t channel, double freq, uint8_t resolution_bits); +`void ledcSetup(uint8_t channel, double freq, uint8_t resolution_bits);` **Description:Set the PWM channel, frequency and resolution.** @@ -14,7 +14,7 @@ **Syntax:** -void ledcAttachPin(uint8_t pin, uint8_t channel); +`void ledcAttachPin(uint8_t pin, uint8_t channel);` **Description:Bind the LEDC channel to the specified IO port to achieve output.** @@ -22,7 +22,7 @@ **Syntax:** -void ledcWrite(uint8_t channel, uint32_t duty); +`void ledcWrite(uint8_t channel, uint32_t duty);` **Description:Output waveform to the channel channel according to the specified duty cycle.** diff --git a/docs/en/api/rtc.md b/docs/en/api/rtc.md index d9a972ea..942be53a 100644 --- a/docs/en/api/rtc.md +++ b/docs/en/api/rtc.md @@ -2,7 +2,7 @@ **Syntax:** -void SetTime(RTC_TimeTypeDef* RTC_TimeStruct) +`void SetTime(RTC_TimeTypeDef* RTC_TimeStruct)` **Description:** @@ -29,7 +29,7 @@ void loop(){}; **Syntax:** -void GetTime(RTC_TimeTypeDef* RTC_TimeStruct) +`void GetTime(RTC_TimeTypeDef* RTC_TimeStruct)` **Description:** @@ -69,7 +69,7 @@ void loop() { **Syntax:** -void SetData(RTC_TimeTypeDef* RTC_DateStruct) +`void SetData(RTC_TimeTypeDef* RTC_DateStruct)` **Description:** @@ -100,7 +100,7 @@ void loop(){}; **Syntax:** -void GetData(RTC_TimeTypeDef* RTC_DateStruct) +`void GetData(RTC_TimeTypeDef* RTC_DateStruct)` **Description:** diff --git a/docs/en/api/sh200q_m5stickc.md b/docs/en/api/sh200q_m5stickc.md index 14b0eaa9..560165c7 100644 --- a/docs/en/api/sh200q_m5stickc.md +++ b/docs/en/api/sh200q_m5stickc.md @@ -6,7 +6,7 @@ **Syntax:** -void Init(); +`void Init();` **Description: It initialize the SH200Q.** @@ -29,7 +29,7 @@ void loop() {} **Syntax:** -void getGyroData(int16_t* gx, int16_t* gy, int16_t* gz); +`void getGyroData(int16_t* gx, int16_t* gy, int16_t* gz);` **Description: It get gyro data of SH200Q.** @@ -59,7 +59,7 @@ void loop() { **Syntax:** -void getAccelData(int16_t* ax, int16_t* ay, int16_t* az); +`void getAccelData(int16_t* ax, int16_t* ay, int16_t* az);` **Description: It get SH200Q acceleration data.** @@ -90,7 +90,7 @@ void loop() { **Syntax:** -void getTempData(float* t); +`void getTempData(float* t);` **Description: It get SH200Q tempurature data.** diff --git a/docs/en/api/speaker.md b/docs/en/api/speaker.md index 90fbb7fb..43d2a591 100644 --- a/docs/en/api/speaker.md +++ b/docs/en/api/speaker.md @@ -8,7 +8,7 @@ Initialize the speaker. **Syntax:** -begin(); +`begin();` **Function argument:** @@ -26,7 +26,7 @@ Mute the speakers and stop the output. **Syntax:** -end(); +`end();` **Function argument:** @@ -41,7 +41,7 @@ None **Syntax:** -tone(uint16_t freq, [uint32_t duration]); +`tone(uint16_t freq, [uint32_t duration]);` **Description: Set the pitch of speaker.** @@ -68,7 +68,7 @@ Set the beep sound. **Syntax:** -setBeep(uint16_t freq, uint16_t duration); +`setBeep(uint16_t freq, uint16_t duration);` | Argument | Description | Type | | --- | --- | --- | @@ -93,7 +93,7 @@ Mute the sound . **Syntax:** -void mute(void); +`void mute(void);` **Example of use:** diff --git a/docs/en/api/system.md b/docs/en/api/system.md index adc7b12a..4826f313 100644 --- a/docs/en/api/system.md +++ b/docs/en/api/system.md @@ -4,7 +4,7 @@ **Syntax:** -void begin(bool LCDEnable=true, bool SDEnable=true, bool SerialEnable=true,bool I2CEnable=false); +`void begin(bool LCDEnable=true, bool SDEnable=true, bool SerialEnable=true,bool I2CEnable=false);` **Description:** @@ -71,7 +71,7 @@ void M5Stack::update() { **Syntax:** -void update(); +`void update();` **Description:** @@ -112,7 +112,7 @@ void loop() { **Syntax:** -void powerOFF(); +`void powerOFF();` **Description:** diff --git a/docs/en/api/system_m5stickc.md b/docs/en/api/system_m5stickc.md index f7d14839..5cee3e5a 100644 --- a/docs/en/api/system_m5stickc.md +++ b/docs/en/api/system_m5stickc.md @@ -4,7 +4,7 @@ **Syntax:** -void begin(bool LCDEnable=true, bool PowerEnable=true, bool SerialEnable=true); +`void begin(bool LCDEnable=true, bool PowerEnable=true, bool SerialEnable=true);` **Description: Clear the serial port buffer, set the serial port baud rate to 115200; initialize the LCD; initialize the power management chip AXP192.** @@ -58,7 +58,7 @@ void loop() {} **Syntax:** -void GetBm8563Time(void); +`void GetBm8563Time(void);` **Description: Get the current hour, minute, and second value and save it to M5.Rtc.Hour, M5.Rtc.Minute, M5.Rtc.Second, in ASCII format.** diff --git a/docs/en/api/tf.md b/docs/en/api/tf.md index 95574c03..6522bf6d 100644 --- a/docs/en/api/tf.md +++ b/docs/en/api/tf.md @@ -4,7 +4,7 @@ **Syntax:** -boolean begin(uint8_t cspin); +`boolean begin(uint8_t cspin);` **Description:** @@ -28,7 +28,7 @@ void setup() { **Syntax:** -File open(const char *filename, uint8_t mode = FILE_READ); +`File open(const char *filename, uint8_t mode = FILE_READ);` **Description:** diff --git a/docs/en/api/ticker.md b/docs/en/api/ticker.md index cc42fc11..e888c449 100644 --- a/docs/en/api/ticker.md +++ b/docs/en/api/ticker.md @@ -2,7 +2,7 @@ **Syntax:** -void once(float seconds, callback_t callback) +`void once(float seconds, callback_t callback)` **Description:** @@ -21,7 +21,7 @@ Execute a command in seconds, which is executed only once. **Syntax:** -void once_ms(uint32_t milliseconds, callback_t callback) +`void once_ms(uint32_t milliseconds, callback_t callback)` **Description:** @@ -40,7 +40,7 @@ Execute a command in milliseconds, which is executed only once. **Syntax:** -void attach(float seconds, void (*callback)(TArg), TArg arg) +`void attach(float seconds, void (*callback)(TArg), TArg arg)` **Description:** @@ -60,7 +60,7 @@ Execute commands with parameters after every seconds. **Syntax:** -void attach_ms(uint32_t milliseconds, void (*callback)(TArg), TArg arg) +`void attach_ms(uint32_t milliseconds, void (*callback)(TArg), TArg arg)` **Description:** @@ -80,7 +80,7 @@ Execute commands with parameters after every milliseconds. **Syntax:** -void attach(float seconds, callback_t callback) +`void attach(float seconds, callback_t callback)` **Description:** @@ -99,7 +99,7 @@ Execute the command after every second with no parameters. **Syntax:** -void attach_ms(uint32_t milliseconds, callback_t callback) +`void attach_ms(uint32_t milliseconds, callback_t callback)` **Description:** diff --git a/docs/en/api/touch.md b/docs/en/api/touch.md index 7937e766..195baae8 100644 --- a/docs/en/api/touch.md +++ b/docs/en/api/touch.md @@ -8,7 +8,7 @@ Get touch coordinates **Syntax** -TouchPoint_t getPressPoint(); +`TouchPoint_t getPressPoint();` ```arduino #include @@ -31,7 +31,7 @@ Check that the screen is pressed **Syntax** -bool ispressed(); +`bool ispressed();` **Example** @@ -57,7 +57,7 @@ Create a touch hotzone **Syntax** -HotZone_t* creatHotZone(uint16_t x0, uint16_t y0, uint16_t w, uint16_t h, void (*fun)() = nullptr ); +`HotZone_t* creatHotZone(uint16_t x0, uint16_t y0, uint16_t w, uint16_t h, void (*fun)() = nullptr );` **Example** @@ -89,7 +89,7 @@ Determine if it is in the hot zone **Syntax** -bool inHotZone(TouchPoint_t point); +`bool inHotZone(TouchPoint_t point);` **Example** diff --git a/docs/en/api/wifi.md b/docs/en/api/wifi.md index 422ec1d9..34813372 100644 --- a/docs/en/api/wifi.md +++ b/docs/en/api/wifi.md @@ -2,7 +2,7 @@ **Syntax:** -bool WiFi.softAP(const char* ssid, const char* passphrase, int channel, int ssid_hidden, int max_connection) +`bool WiFi.softAP(const char* ssid, const char* passphrase, int channel, int ssid_hidden, int max_connection)` **Description:** @@ -23,7 +23,7 @@ Use this method to open AP mode and return true after successful opening **Syntax:** -bool softAPConfig(IPAddress local_ip, IPAddress gateway, IPAddress subnet) +`bool softAPConfig(IPAddress local_ip, IPAddress gateway, IPAddress subnet)` **Description:** @@ -41,7 +41,7 @@ set AP IP address **Syntax:** -bool softAPdisconnect(bool wifioff = false) +`bool softAPdisconnect(bool wifioff = false)` **Description:** @@ -57,7 +57,7 @@ Turn off the current AP and restore the network settings if wifioff is true **Syntax:** -uint8_t softAPgetStationNum() +`uint8_t softAPgetStationNum()` **Description:** @@ -71,7 +71,7 @@ None **Syntax:** -IPAddress softAPIP() +`IPAddress softAPIP()` **Description:** @@ -85,7 +85,7 @@ None **Syntax:** -bool softAPsetHostname(const char * hostname) +`bool softAPsetHostname(const char * hostname)` **Description:** @@ -101,7 +101,7 @@ Set Hostname if success return true **Syntax:** -const char * softAPgetHostname() +`const char * softAPgetHostname()` **Description:** @@ -115,7 +115,7 @@ None **Syntax:** -String softAPmacAddress(void) +`String softAPmacAddress(void)` **Description:** @@ -129,7 +129,7 @@ None **Syntax:** -wl_status_t begin(const char* ssid, const char *passphrase = NULL, int32_t channel = 0, const uint8_t* bssid = NULL, bool connect = true) +`wl_status_t begin(const char* ssid, const char *passphrase = NULL, int32_t channel = 0, const uint8_t* bssid = NULL, bool connect = true)` **Description:** @@ -149,7 +149,7 @@ This method is used to access the network .If connect equals true, it will conne **Syntax:** -bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = (uint32_t)0x00000000, IPAddress dns2 = (uint32_t)0x00000000) +`bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = (uint32_t)0x00000000, IPAddress dns2 = (uint32_t)0x00000000)` **Description:** @@ -170,7 +170,7 @@ set network addresses. **Syntax:** -bool disconnect(bool wifioff = false, bool eraseap = false) +`bool disconnect(bool wifioff = false, bool eraseap = false)` **Description:** @@ -187,7 +187,7 @@ If wifioff is true, the network settings will be restored. If eraseap is true, t **Syntax:** -bool isConnected() +`bool isConnected()` **Description:** @@ -201,7 +201,7 @@ None **Syntax:** -bool setAutoReconnect(bool autoReconnect) +`bool setAutoReconnect(bool autoReconnect)` **Description:** @@ -215,7 +215,7 @@ None **Syntax:** -bool getAutoReconnect() +`bool getAutoReconnect()` **Description:** @@ -229,7 +229,7 @@ None **Syntax:** -IPAddress localIP() +`IPAddress localIP()` **Description:** @@ -243,7 +243,7 @@ None **Syntax:** -IPAddress subnetMask() +`IPAddress subnetMask()` **Description:** @@ -257,7 +257,7 @@ None **Syntax:** -IPAddress gatewayIP() +`IPAddress gatewayIP()` **Description:** @@ -271,7 +271,7 @@ None **Syntax:** -IPAddress dnsIP(uint8_t dns_no = 0) +`IPAddress dnsIP(uint8_t dns_no = 0)` **Description:** @@ -285,7 +285,7 @@ None **Syntax:** -String macAddress() +`String macAddress()` **Description:** @@ -299,7 +299,7 @@ None **Syntax:** -const char * getHostname() +`const char * getHostname()` **Description:** @@ -313,7 +313,7 @@ None **Syntax:** -wl_status_t status() +`wl_status_t status()` **Description:** @@ -337,7 +337,7 @@ Return WIFI status. **Syntax:** -int16_t scanNetworks(bool async = false, bool show_hidden = false, bool passive = false, uint32_t max_ms_per_chan = 300) +`int16_t scanNetworks(bool async = false, bool show_hidden = false, bool passive = false, uint32_t max_ms_per_chan = 300)` **Description:** @@ -351,7 +351,7 @@ None **Syntax:** -int16_t scanComplete() +`int16_t scanComplete()` **Description:** @@ -370,7 +370,7 @@ Asynchronous mode is used to obtain the number of scanned networks. If the retur **Syntax:** -void scanDelete() +`void scanDelete()` **Description:** @@ -384,7 +384,7 @@ None **Syntax:** -String SSID(uint8_t networkItem) +`String SSID(uint8_t networkItem)` **Description:** @@ -401,7 +401,7 @@ Returns the scanned network name. **Syntax:** -wifi_auth_mode_t encryptionType(uint8_t networkItem) +`wifi_auth_mode_t encryptionType(uint8_t networkItem)` **Description:** @@ -417,7 +417,7 @@ Returns the type of network encryption scanned. **Syntax:** -int32_t RSSI(uint8_t networkItem) +`int32_t RSSI(uint8_t networkItem)` **Description:** @@ -433,7 +433,7 @@ Return the scanned network signal strength. **Syntax:** -int32_t channel(uint8_t networkItem) +`int32_t channel(uint8_t networkItem)` **Description:** diff --git a/docs/en/arduino/arduino_home_page.md b/docs/en/arduino/arduino_home_page.md index 22d0d88a..fa8d8406 100644 --- a/docs/en/arduino/arduino_home_page.md +++ b/docs/en/arduino/arduino_home_page.md @@ -13,7 +13,7 @@ -
+
{{item.title}} @@ -79,6 +79,14 @@ const m5core2_api = { } }; +const coreink_api = { + 'title':"CoreInk API", + 'item':{ + 'System & Button & RTC & Speaker':'#/en/api/coreink/system_api', + 'E-Ink':'#/en/api/coreink/eink_api' + } +}; + var arduino_home_page = new Vue({ el:'#arduino_home_page', @@ -89,6 +97,7 @@ var arduino_home_page = new Vue({ m5core_api: m5core_api, m5stickc_api: m5stickc_api, m5core2_api: m5core2_api, + coreink_api: coreink_api } }; } diff --git a/docs/en/core/basic.md b/docs/en/core/basic.md index 3314b44f..93e6edee 100644 --- a/docs/en/core/basic.md +++ b/docs/en/core/basic.md @@ -356,6 +356,10 @@ For more information about Pin assignment and Pin Remapping, Please refer to [ES - [ESP32](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/esp32_datasheet_en.pdf) - [IP5306](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/IIC_IP5306_REG_V1.4_cn.pdf) +- **API** + + - [Arduino API](en/arduino/arduino_home_page) + ## Schematic - [Schematic](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/schematic/Core/M5-Core-Schematic(20171206).pdf) diff --git a/docs/en/core/core2.md b/docs/en/core/core2.md index b471b961..38986c46 100644 --- a/docs/en/core/core2.md +++ b/docs/en/core/core2.md @@ -346,6 +346,10 @@ For more information about Pin assignment and Pin Remapping, Please refer to [ES - [SY7088](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/SY7088-Silergy.pdf) - [AXP192](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/AXP192_datasheet_en.pdf) +- **API** + + - [Arduino API](en/arduino/arduino_home_page) + ## Schematic diff --git a/docs/en/core/coreink.md b/docs/en/core/coreink.md index 90a824a2..566b7a2f 100644 --- a/docs/en/core/coreink.md +++ b/docs/en/core/coreink.md @@ -217,6 +217,9 @@ For more info on specific pin functions refer to the official ESP32 Docs[ESP32 d - [SY7088](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/SY7088-Silergy.pdf) - [GDEW0154M09](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/CoreInk-K048-GDEW0154M09%20V2.0%20Specification.pdf) +- **API** + + - [Arduino API](en/arduino/arduino_home_page) ## Schematic diff --git a/docs/en/core/face_kit.md b/docs/en/core/face_kit.md index 4e7512fb..84fcd80f 100644 --- a/docs/en/core/face_kit.md +++ b/docs/en/core/face_kit.md @@ -357,7 +357,10 @@ For more information about Pin assignment and Pin Remapping, Please refer to [ES - [BMM150](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/BMM150_datasheet_en.pdf) - [IP5306](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/IIC_IP5306_REG_V1.4_cn.pdf) +- **API** + - [Arduino API](en/arduino/arduino_home_page) + ## Schematic - [Schematic](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/schematic/Core/M5-Core-Schematic(20171206).pdf) diff --git a/docs/en/core/fire.md b/docs/en/core/fire.md index a1215ca8..c08735c6 100644 --- a/docs/en/core/fire.md +++ b/docs/en/core/fire.md @@ -353,6 +353,10 @@ For more information about Pin assignment and Pin Remapping, Please refer to [ES - [SH200Q](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/SH200Q_en.pdf) - [IP5306](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/IIC_IP5306_REG_V1.4_cn.pdf) +- **API** + + - [Arduino API](en/arduino/arduino_home_page) + ## Version Change
diff --git a/docs/en/core/gray.md b/docs/en/core/gray.md index 9e232c3f..1656f5df 100644 --- a/docs/en/core/gray.md +++ b/docs/en/core/gray.md @@ -332,7 +332,10 @@ For more information about Pin assignment and Pin Remapping, Please refer to [ES - [MPU6886](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/MPU-6886-000193%2Bv1.1_GHIC_en.pdf) - [BMM150](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/BMM150_datasheet_en.pdf) - [IP5306](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/IIC_IP5306_REG_V1.4_cn.pdf) + +- **API** + - [Arduino API](en/arduino/arduino_home_page) ## Example diff --git a/docs/en/core/m5go.md b/docs/en/core/m5go.md index 2da09ae9..07f8151d 100644 --- a/docs/en/core/m5go.md +++ b/docs/en/core/m5go.md @@ -337,6 +337,10 @@ To complete schematic, click [here](https://github.com/m5stack/M5-Schematic/tree - [BMM150](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/BMM150_datasheet_en.pdf) - [IP5306](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/IIC_IP5306_REG_V1.4_cn.pdf) +- **API** + + - [Arduino API](en/arduino/arduino_home_page) + ## Schematic - [Schematic](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/schematic/Core/M5-Core-Schematic(20171206).pdf) diff --git a/docs/en/core/m5go_lite.md b/docs/en/core/m5go_lite.md index 889cc792..ca61b505 100644 --- a/docs/en/core/m5go_lite.md +++ b/docs/en/core/m5go_lite.md @@ -330,6 +330,10 @@ For more information about Pin assignment and Pin Remapping, Please refer to [ES - [BMM150](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/BMM150_datasheet_en.pdf) - [IP5306](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/IIC_IP5306_REG_V1.4_cn.pdf) +- **API** + + - [Arduino API](en/arduino/arduino_home_page) + ## Schematic - [Schematic](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/schematic/Core/M5-Core-Schematic(20171206).pdf) diff --git a/docs/en/core/m5paper.md b/docs/en/core/m5paper.md index 56d6ab41..f793a0c0 100644 --- a/docs/en/core/m5paper.md +++ b/docs/en/core/m5paper.md @@ -209,6 +209,9 @@ For more info on specific pin functions refer to the official ESP32 Docs[ESP32 d - [GT911-datasheet](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/m5paper/gt911_datasheet.pdf) +- **API** + + - [Arduino API](en/arduino/arduino_home_page) ## Schematic diff --git a/docs/en/core/m5stickc.md b/docs/en/core/m5stickc.md index a024e9b0..2536cd0c 100644 --- a/docs/en/core/m5stickc.md +++ b/docs/en/core/m5stickc.md @@ -261,6 +261,9 @@ Resolution:80 * 160 - [AXP192](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/AXP192_datasheet_en.pdf) - [SPM1423](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/SPM1423HM4H-B_datasheet_en.pdf) +- **API** + + - [Arduino API](en/arduino/arduino_home_page) ## structural-design-file diff --git a/docs/en/core/m5stickc_plus.md b/docs/en/core/m5stickc_plus.md index fb67e466..b9d39f02 100644 --- a/docs/en/core/m5stickc_plus.md +++ b/docs/en/core/m5stickc_plus.md @@ -265,6 +265,10 @@ Resolution:135 * 240 - [AXP192](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/AXP192_datasheet_en.pdf) - [SPM1423](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/SPM1423HM4H-B_datasheet_en.pdf) +- **API** + + - [Arduino API](en/arduino/arduino_home_page) + - **Arduino Library** - [M5StickC_PLUS Library](https://github.com/m5stack/M5StickC-Plus) diff --git a/docs/zh_CN/api/axp192_core2.md b/docs/zh_CN/api/axp192_core2.md index 368c900a..8afad9ec 100644 --- a/docs/zh_CN/api/axp192_core2.md +++ b/docs/zh_CN/api/axp192_core2.md @@ -6,7 +6,7 @@ **函数原型:** -void SetLed(uint8_t state); +`void SetLed(uint8_t state);` **功能:设置LED电源指示灯。** @@ -25,7 +25,7 @@ void loop() {} **函数原型:** -void SetCHGCurrent(uint8_t state); +`void SetCHGCurrent(uint8_t state);` **功能: 设置充电电流.** @@ -47,7 +47,7 @@ void loop() { **函数原型:** -void SetSpkEnable(uint8_t state); +`void SetSpkEnable(uint8_t state);` **功能:使能扬声器。** @@ -68,7 +68,7 @@ void loop() { **函数原型:** -void SetBusPowerMode(uint8_t state); +`void SetBusPowerMode(uint8_t state);` **功能:使能总线电源输出** @@ -89,7 +89,7 @@ void loop() { **函数原型:** -void SetLcdVoltage(uint16_t voltage) +`void SetLcdVoltage(uint16_t voltage)` **功能: 设置屏幕背光电压.** @@ -112,7 +112,7 @@ void loop() { **函数原型:** -void SetLDOEnable(uint8_t number, bool state) +`void SetLDOEnable(uint8_t number, bool state)` **功能: 使能LDO引脚** @@ -137,7 +137,7 @@ void loop() { **函数原型:** -void SetLDOVoltage(uint8_t number, uint16_t voltage); +`void SetLDOVoltage(uint8_t number, uint16_t voltage);` **功能: 配置LDO引脚电压** @@ -160,7 +160,7 @@ void loop() { **函数原型:** -bool isACIN() +`bool isACIN()` **功能:判断是否外接供电** @@ -185,7 +185,7 @@ void loop() { **函数原型:** -uint16_t GetVapsData(void); +`uint16_t GetVapsData(void);` **功能: 获取电池容量.** @@ -212,7 +212,7 @@ void loop() { **函数原型:** -uint16_t GetTempData(void); +`uint16_t GetTempData(void);` **功能: 获取芯片温度.** @@ -241,7 +241,7 @@ void loop() { **函数原型:** -uint16_t GetIdischargeData(void); +`uint16_t GetIdischargeData(void);` **功能: 获取放电电流.** @@ -270,7 +270,7 @@ void loop() { **函数原型:** -uint16_t GetIinData(void); +`uint16_t GetIinData(void);` **功能: 获取输入电流.** @@ -295,7 +295,7 @@ void loop() { **函数原型:** -uint16_t GetIusbinData(void); +`uint16_t GetIusbinData(void);` **功能:获取USB电流.** diff --git a/docs/zh_CN/api/axp192_m5stickc.md b/docs/zh_CN/api/axp192_m5stickc.md index 54cc086d..e099517c 100644 --- a/docs/zh_CN/api/axp192_m5stickc.md +++ b/docs/zh_CN/api/axp192_m5stickc.md @@ -6,7 +6,7 @@ **函数原型:** -void begin(void); +`void begin(void);` **功能:初始化 AXP192 芯片。** @@ -24,7 +24,7 @@ void loop() {} **函数原型:** -uint8_t GetWarningLeve(void); +`uint8_t GetWarningLeve(void);` **功能: 获取当前报警等级.** @@ -49,7 +49,7 @@ void loop() { **函数原型:** -void ScreenBreath(uint8_t brightness); +`void ScreenBreath(uint8_t brightness);` **功能:改变 AXP192 芯片的LDO3输出电压。** @@ -78,7 +78,7 @@ void loop() { **函数原型:** -uint16_t GetVbatData(void); +`uint16_t GetVbatData(void);` **功能:获取电池电压值。** @@ -105,7 +105,7 @@ void loop() { **函数原型:** -void LightSleep(uint64_t time_in_us = 0) +`void LightSleep(uint64_t time_in_us = 0)` **功能: 控制ESP32进入轻度睡眠模式,开机键唤醒.** @@ -140,7 +140,7 @@ void loop() { **函数原型:** -void DeepSleep(uint64_t time_in_us = 0) +`void DeepSleep(uint64_t time_in_us = 0)` **功能: 控制外设进入休眠模式,到达时间自动唤醒.** @@ -171,7 +171,7 @@ void loop() { **函数原型:** -void SetSleep(void); +`void SetSleep(void);` **功能: 控制外设进入休眠模式,按下电源键唤醒.** @@ -200,7 +200,7 @@ void loop() { **函数原型:** -uint16_t GetIchargeData(void); +`uint16_t GetIchargeData(void);` **功能:获取电池充电电流值。** @@ -228,7 +228,7 @@ void loop() { **函数原型:** -uint32_t GetPowerbatData(void); +`uint32_t GetPowerbatData(void);` **功能: 当前电源功率.** @@ -257,7 +257,7 @@ void loop() { **函数原型:** -uint16_t GetVapsData(void); +`uint16_t GetVapsData(void);` **功能: 获取电池容量.** @@ -285,7 +285,7 @@ void loop() { **函数原型:** -uint16_t GetTempData(void); +`uint16_t GetTempData(void);` **功能: 获取芯片温度.** @@ -314,7 +314,7 @@ void loop() { **函数原型:** -uint16_t GetIdischargeData(void); +`uint16_t GetIdischargeData(void);` **功能: 获取放电电流.** @@ -343,7 +343,7 @@ void loop() { **函数原型:** -uint16_t GetIinData(void); +`uint16_t GetIinData(void);` **功能: 获取输入电流.** @@ -368,7 +368,7 @@ void loop() { **函数原型:** -uint16_t GetIusbinData(void); +`uint16_t GetIusbinData(void);` **功能:获取USB电流.** diff --git a/docs/zh_CN/api/button.md b/docs/zh_CN/api/button.md index 7251f323..b4cb0189 100644 --- a/docs/zh_CN/api/button.md +++ b/docs/zh_CN/api/button.md @@ -4,7 +4,7 @@ **函数原型:** -read(); // for arduino +`read();` // for arduino **功能:返回按键状态。1:按下;0:松开。** @@ -27,7 +27,7 @@ void loop() { **函数原型:** -isPressed(); // for arduino +`isPressed();` // for arduino **功能:返回键值。如果按键按下,总是返回true,否则总是返回false** @@ -54,7 +54,7 @@ void loop() { **函数原型:** -uint32_t lastChange(void); +`uint32_t lastChange(void);` **功能:** @@ -81,7 +81,7 @@ void loop() { **函数原型:** -wasPressed(); // for arduino +`wasPressed();` // for arduino **功能:返回键值。如果指定按键按下,则返回 1 一次,然后置位为0,否则一直返回 0。** @@ -108,7 +108,7 @@ void loop() { **函数原型:** -pressedFor(uint32_t ms); // for arduino +`pressedFor(uint32_t ms);` // for arduino **功能:返回键值。如果指定按键按下超过指定时间之后,则返回 1,否则返回 0。** @@ -139,7 +139,7 @@ void loop() { **函数原型:** -uint8_t releasedFor(uint32_t ms) +`uint8_t releasedFor(uint32_t ms)` **功能:** @@ -169,7 +169,7 @@ void loop() { **函数原型:** -uint8_t wasReleased(void) +`uint8_t wasReleased(void)` **功能:** @@ -199,7 +199,7 @@ void loop() { **函数原型:** -uint8_t wasReleasefor(uint32_t ms); +`uint8_t wasReleasefor(uint32_t ms);` **功能:** diff --git a/docs/zh_CN/api/commutil.md b/docs/zh_CN/api/commutil.md index 9a055011..bdbb76b0 100644 --- a/docs/zh_CN/api/commutil.md +++ b/docs/zh_CN/api/commutil.md @@ -6,7 +6,7 @@ ## writeCommand() **構文:** -bool writeCommand(uint8_t address, uint8_t subAddress); +`bool writeCommand(uint8_t address, uint8_t subAddress);` **功能:** @@ -32,7 +32,7 @@ ## writeByte() **構文:** -bool writeByte(uint8_t address, uint8_t subAddress, uint8_t data); +`bool writeByte(uint8_t address, uint8_t subAddress, uint8_t data);` **功能:** @@ -58,7 +58,7 @@ ## writeBytes() **構文:** - bool writeBytes(uint8_t address, uint8_t subAddress, uint8_t *data,uint8_t length); +` bool writeBytes(uint8_t address, uint8_t subAddress, uint8_t *data,uint8_t length);` **功能:** @@ -84,7 +84,7 @@ ## readByte() **構文:** - bool readByte(uint8_t address, uint8_t *result); +` bool readByte(uint8_t address, uint8_t *result);` **功能:** @@ -108,7 +108,7 @@ ## readByte() **構文:** -bool readByte(uint8_t address, uint8_t subAddress,uint8_t *result); +`bool readByte(uint8_t address, uint8_t subAddress,uint8_t *result);` **功能:** @@ -134,7 +134,7 @@ ## readBytes() **構文:** -bool readBytes(uint8_t address, uint8_t count,uint8_t * dest); +`bool readBytes(uint8_t address, uint8_t count,uint8_t * dest);` **功能:** @@ -159,7 +159,7 @@ ## readBytes() **構文:** -bool readBytes(uint8_t address, uint8_t subAddress, uint8_t count, uint8_t * dest); +`bool readBytes(uint8_t address, uint8_t subAddress, uint8_t count, uint8_t * dest);` **功能:** @@ -186,7 +186,7 @@ ## scanID() **構文:** -bool readBytes(bool *result); +`bool readBytes(bool *result);` **功能:** diff --git a/docs/zh_CN/api/coreink/eink_api.md b/docs/zh_CN/api/coreink/eink_api.md new file mode 100644 index 00000000..07201f0b --- /dev/null +++ b/docs/zh_CN/api/coreink/eink_api.md @@ -0,0 +1,192 @@ +# E-Ink + +?>使用E-Ink屏幕操作函数前,需要创建实例并传入屏幕驱动地址. + +``` +#include "M5CoreInk.h" +Ink_Sprite InkPageSprite(&M5.M5Ink); +``` + +## creatSprite + +**函数原型:** + +`int creatSprite(uint16_t posX, + uint16_t posY, + uint16_t width = 200, + uint16_t height = 200, + bool copyFromMem = true); +` + +**功能:创建图像区域,配置是否从屏幕驱动获取图像数据buff(默认为保存true)** + +**例程** + +```arduino + +if( InkPageSprite.creatSprite(0,0,200,200,true) != 0 ) +{ + Serial.printf"Ink Sprite creat faild"); +} + +Serial.printf("Ink Sprite creat successful"); + +``` + +## clear + +**函数原型:** + +`void clear( int cleanFlag = CLEAR_DRAWBUFF );` + +**功能:清除图像区域内容,CLEAR_DRAWBUFF(清除尚未Push的图像数据) CLEAR_LASTBUFF(清除上一次刷新的图像数据的缓存区,当再次push时将完整刷新屏幕)** + + +**例程** + +```arduino + +InkPageSprite.clear(); + +``` + + +## deleteSprite + +**函数原型:** + +`int deleteSprite();` + +**功能:释放已经创建的图像区域** + +**例程** + +```arduino + +InkPageSprite.clear(); + +``` + +## pushSprite + +**函数原型:** + +`int pushSprite();` + +**功能:推送已经编辑的图像数据到图像区域(使用绘图API进行操作后,都需要进行Push刷新屏幕)** + +**例程** + +```arduino +InkPageSprite.drawString(10,50,"Hello World!",&AsciiFont8x16); +InkPageSprite.pushSprite(); +``` + +## drawPix + +**函数原型:** + +`void drawPix(uint16_t posX,uint16_t posY,uint8_t pixBit);` + +**功能:绘制单个像素点 (参数pixBit传入0时为黑色,传入1时为白色)** + +**例程** + +```arduino +InkPageSprite.drawPix(100,100,0); +InkPageSprite.pushSprite(); +``` + + +## FillRect + +**函数原型:** + +`void FillRect(uint16_t posX, + uint16_t posY, + uint16_t width, + uint16_t height, + uint8_t pixBit);` + +**功能:绘制矩形 (参数pixBit传入0时为黑色,传入1时为白色)** + +**例程** + +```arduino +InkPageSprite.FillRect(0,0,100,100,0); +InkPageSprite.pushSprite(); +``` + + +## drawFullBuff + +**函数原型:** + +`void drawFullBuff(uint8_t* buff, bool bitMode = true);` + +` void drawBuff(uint16_t posX, + uint16_t posY, + uint16_t width, + uint16_t height, + uint8_t* imageDataptr);` + + +**功能:绘制整个页面, 需要传入完整页面Buff** + + +## drawChar + +**函数原型:** + +`void drawChar(uint16_t posX,uint16_t posY,char charData,Ink_eSPI_font_t* fontPtr);` + + +**功能:绘制字符** + +**例程** + +```arduino +InkPageSprite.drawChar(35,50,'M'); +InkPageSprite.pushSprite(); +``` + +## drawString + +**函数原型:** + +`void drawString(uint16_t posX,uint16_t posY,const char* charData,Ink_eSPI_font_t* fontPtr = &AsciiFont8x16);` + + +**功能:绘制字符串** + +**例程** + +```arduino +InkPageSprite.drawString(35,50,"Hello World!"); +InkPageSprite.pushSprite(); +``` + +## getSpritePtr + +**函数原型:** + +**功能:获取图像Buff数据** + +`uint8_t* getSpritePtr(){ return _spriteBuff;}` + +**功能:获取图像宽度度坐标数据** + +`uint16_t width(){ return _width;}` + +**功能:获取图像高度坐标数据** + +`uint16_t height(){ return _height;}` + +**功能:获取图像X坐标数据** + +`uint16_t posX(){ return _posX;}` + +**功能:获取图像区域Y坐标数据** + +`uint16_t posY(){ return _posY;}` + diff --git a/docs/zh_CN/api/coreink/system_api.md b/docs/zh_CN/api/coreink/system_api.md new file mode 100644 index 00000000..33f1d886 --- /dev/null +++ b/docs/zh_CN/api/coreink/system_api.md @@ -0,0 +1,179 @@ +# System & Button & RTC + +## begin() + +**函数原型:** + +`int begin(bool InkEnable = true, bool wireEnable = false);` + +**功能:初始化 E-Ink ,RTC , I2C , Speaker** + + +**例程** + +```arduino +#include "M5CoreInk.h" + +void setup() { + M5.begin(true,false); +} +``` + +## update() + +**函数原型:** + +`void update();` + +**功能:刷新设备按键/蜂鸣器状态** + +**例程:** +```arduino + +if( M5.BtnPWR.wasPressed()) +{ + Serial.printf("Btn wasPressed!"); +} +M5.update(); + +``` + +## Button + +**功能:检测设备按键状态** + +`M5.BtnUP.wasPressed()` + +`M5.BtnDOWN.wasPressed()` + +`M5.BtnMID.wasPressed()` + +`M5.BtnEXT.wasPressed()` + +`M5.BtnPWR.wasPressed()` + +?>RTC相关函数使用前请使用`M5.begin();`进行初始化 + +## Speaker + +**功能:蜂鸣器驱动** + +`void end();` +`void mute();` +`void tone(uint16_t frequency);` +`void tone(uint16_t frequency, uint32_t duration);` +`void beep();` +`void setBeep(uint16_t frequency, uint16_t duration);` +`void update();` +`void write(uint8_t value);` +`void setVolume(uint8_t volume);` +`void playMusic(const uint8_t *music_data, uint16_t sample_rate);` + +``` +M5.Speaker.tone(2700); +``` + +## SetTime() + +**函数原型:** + +`void SetTime(RTC_TimeTypeDef* RTC_TimeStruct)` + +**函数参数:** + +设置结构体变量时间 + + +## GetTime() + +**函数原型:** + +`void GetTime(RTC_TimeTypeDef* RTC_TimeStruct)` + +**函数参数:** + +获取结构体时间 + + +## SetData() + +**函数原型:** + +`void SetData(RTC_TimeTypeDef* RTC_DateStruct)` + +**函数参数:** + +设置结构体变量日期 + + +## GetData() + +**函数原型:** + +`void GetData(RTC_TimeTypeDef* RTC_DateStruct)` + +**函数参数:** + +获取结构体变量日期 + +**使用示例:** + +``` +#include "M5CoreInk.h" + +Ink_Sprite InkPageSprite(&M5.M5Ink); + +RTC_TimeTypeDef RTCtime; +RTC_DateTypeDef RTCDate; + +char timeStrbuff[64]; + +void flushTime(){ + M5.rtc.GetTime(&RTCtime); + M5.rtc.GetData(&RTCDate); + + sprintf(timeStrbuff,"%d/%02d/%02d %02d:%02d:%02d", + RTCDate.Year,RTCDate.Month,RTCDate.Date, + RTCtime.Hours,RTCtime.Minutes,RTCtime.Seconds); + + InkPageSprite.drawString(10,100,timeStrbuff); + InkPageSprite.pushSprite(); +} + +void setupTime(){ + + RTCtime.Hours = 23; + RTCtime.Minutes = 33; + RTCtime.Seconds = 33; + M5.rtc.SetTime(&RTCtime); + + RTCDate.Year = 2020; + RTCDate.Month = 11; + RTCDate.Date = 6; + M5.rtc.SetData(&RTCDate); +} + +void setup() { + + M5.begin(); + if( !M5.M5Ink.isInit()) + { + Serial.printf("Ink Init faild"); + while (1) delay(100); + } + M5.M5Ink.clear(); + delay(1000); + //creat ink refresh Sprite + if( InkPageSprite.creatSprite(0,0,200,200,true) != 0 ) + { + Serial.printf("Ink Sprite creat faild"); + } + setupTime(); +} + +void loop() { + flushTime(); + delay(15000); +} +``` + diff --git a/docs/zh_CN/api/eeprom.md b/docs/zh_CN/api/eeprom.md index fd24affc..3d201a89 100644 --- a/docs/zh_CN/api/eeprom.md +++ b/docs/zh_CN/api/eeprom.md @@ -2,7 +2,7 @@ **函数原型:** -EEPROM.begin(size) +`EEPROM.begin(size)` **功能:** @@ -20,7 +20,7 @@ **函数原型:** -EEPROM.write(addr, data) +`EEPROM.write(addr, data)` **功能:** @@ -37,7 +37,7 @@ **函数原型:** -EEPROM.commit() +`EEPROM.commit()` **功能:** @@ -51,7 +51,7 @@ None **函数原型:** -EEPROM.read(addr) +`EEPROM.read(addr)` **功能:** diff --git a/docs/zh_CN/api/gpio.md b/docs/zh_CN/api/gpio.md index 6a89c2b9..5ed51bed 100644 --- a/docs/zh_CN/api/gpio.md +++ b/docs/zh_CN/api/gpio.md @@ -48,7 +48,7 @@ **函数原型:** -int digitalRead(uint8_t pin); +`int digitalRead(uint8_t pin);` **功能:** @@ -81,7 +81,7 @@ pin21_data = digitalRead(21); **函数原型:** -void digitalWrite(uint8_t pin, uint8_t val); +`void digitalWrite(uint8_t pin, uint8_t val);` **功能:** @@ -114,7 +114,7 @@ digitalWrite(2,1); **函数原型:** -void pinMode(uint8_t pin, uint8_t mode); +`void pinMode(uint8_t pin, uint8_t mode);` **功能:** @@ -148,7 +148,7 @@ pinMode(2,INPUT); ## analogRead() **函数原型:** -uint16_t analogRead(uint8_t pin); +`uint16_t analogRead(uint8_t pin);` **功能:** @@ -179,7 +179,7 @@ ret=analogRead(35); **函数原型:** -void dacWrite(uint8_t pin, uint8_t value); +`void dacWrite(uint8_t pin, uint8_t value);` **功能:** @@ -210,7 +210,7 @@ dacWrite(25,0x40); **函数原型:** -double ledcSetup(uint8_t channel, double freq, uint8_t resolution_bits); +`double ledcSetup(uint8_t channel, double freq, uint8_t resolution_bits);` **功能:** @@ -239,7 +239,7 @@ Actual output frequency. **函数原型:** -void ledcAttachPin(uint8_t pin, uint8_t chan); +`void ledcAttachPin(uint8_t pin, uint8_t chan);` **功能:** @@ -261,7 +261,7 @@ Actual output frequency. **函数原型:** -void ledcWrite(uint8_t chan, uint32_t duty); +`void ledcWrite(uint8_t chan, uint32_t duty);` **功能:** @@ -289,7 +289,7 @@ Actual output frequency. **函数原型:** -void ledcDetachPin(uint8_t pin); +`void ledcDetachPin(uint8_t pin);` **功能:** @@ -310,7 +310,7 @@ Actual output frequency. **函数原型:** -bool adcAttachPin(uint8_t pin) +`bool adcAttachPin(uint8_t pin)` **功能:** @@ -330,7 +330,7 @@ Actual output frequency. **函数原型:** -bool adcBusy(uint8_t pin) +`bool adcBusy(uint8_t pin)` **功能:** @@ -350,7 +350,7 @@ Actual output frequency. **函数原型:** -uint16_t adcEnd(uint8_t pin) +`uint16_t adcEnd(uint8_t pin)` **功能:** @@ -370,7 +370,7 @@ Actual output frequency. **函数原型:** -bool adcStart(uint8_t pin) +`bool adcStart(uint8_t pin)` **功能:** @@ -391,7 +391,7 @@ Actual output frequency. **函数原型:** -void analogReadResolution(uint8_t bits) +`void analogReadResolution(uint8_t bits)` **功能:** @@ -411,7 +411,7 @@ None **函数原型:** -void analogSetAttenuation(adc_attenuation_t attenuation) +`void analogSetAttenuation(adc_attenuation_t attenuation)` **功能:** @@ -431,7 +431,7 @@ None **函数原型:** -void analogSetCycles(uint8_t cycles) +`void analogSetCycles(uint8_t cycles)` **功能:** @@ -451,7 +451,7 @@ None **函数原型:** -void analogSetPinAttenuation(uint8_t pin, adc_attenuation_t attenuation) +`void analogSetPinAttenuation(uint8_t pin, adc_attenuation_t attenuation)` **功能:** @@ -472,7 +472,7 @@ None **函数原型:** -void analogSetSamples(uint8_t samples) +`void analogSetSamples(uint8_t samples)` **功能:** @@ -492,7 +492,7 @@ None **函数原型:** -void analogSetWidth(uint8_t bits) +`void analogSetWidth(uint8_t bits)` **功能:** @@ -512,7 +512,7 @@ None **函数原型:** -void attachInterrupt(pin, ISR(callback function), interrupt type/mode) +`void attachInterrupt(pin, ISR(callback function), interrupt type/mode)` **功能:** @@ -534,7 +534,7 @@ None. **函数原型:** -void detachInterrupt(pin) +`void detachInterrupt(pin)` **功能:** @@ -554,7 +554,7 @@ None. **函数原型:** -int hallRead(void)); +`int hallRead(void));` **功能:** @@ -572,7 +572,7 @@ int. **函数原型:** -uint32_t ledcRead(uint8_t channel) +`uint32_t ledcRead(uint8_t channel)` **功能:** @@ -592,7 +592,7 @@ int. **函数原型:** -double ledcReadFreq(uint8_t channel) +`double ledcReadFreq(uint8_t channel)` **功能:** diff --git a/docs/zh_CN/api/imu.md b/docs/zh_CN/api/imu.md index 3e74d403..bba89f8e 100644 --- a/docs/zh_CN/api/imu.md +++ b/docs/zh_CN/api/imu.md @@ -6,7 +6,7 @@ **函数原型:** -int Init(void); +`int Init(void);` **功能:初始化 IMU 芯片。** @@ -26,7 +26,7 @@ void loop() {} **函数原型:** -void getGyroData(float *gx, float *gy, float *gz); +`void getGyroData(float *gx, float *gy, float *gz);` **功能:获取 IMU 芯片的三轴陀螺仪数据。** @@ -52,7 +52,7 @@ void loop() { **函数原型:** -void getAccelData(float *ax, float *ay, float *az); +`void getAccelData(float *ax, float *ay, float *az);` **功能:获取 IMU 芯片的三轴加速度计数据。** @@ -78,7 +78,7 @@ void loop() { **函数原型:** -void getAccelData(float *pitch, float *roll, float *yaw); +`void getAccelData(float *pitch, float *roll, float *yaw);` **功能:获取 IMU 芯片的姿态。** @@ -104,7 +104,7 @@ void loop() { **函数原型:** -void getTempData(float *t); +`void getTempData(float *t);` **功能:获取 IMU 芯片的温度。** diff --git a/docs/zh_CN/api/lcd.md b/docs/zh_CN/api/lcd.md index 7973c578..aeb762f4 100644 --- a/docs/zh_CN/api/lcd.md +++ b/docs/zh_CN/api/lcd.md @@ -34,7 +34,7 @@ **函数原型:** -begin(); +`begin();` **参数:** @@ -57,7 +57,7 @@ **函数原型:** -sleep(); +`sleep();` **参数:** @@ -90,7 +90,7 @@ M5.Lcd.setBrightness(0); **Syntax:** -uint16_t alphaBlend(uint8_t alpha, uint16_t fgc, uint16_t bgc); +`uint16_t alphaBlend(uint8_t alpha, uint16_t fgc, uint16_t bgc);` **Function argument:** @@ -123,7 +123,7 @@ M5.Lcd.print(val); **函数原型:** -wakeup(); +`wakeup();` **参数:** @@ -154,7 +154,7 @@ M5.Lcd.setBrightness(200); **函数原型:** -setBrightness(uint8_t brightness); +`setBrightness(uint8_t brightness);` **参数:** @@ -189,7 +189,7 @@ M5.Lcd.setBrightness(200); **函数原型:** -progressBar(int x, int y, int w, int h, uint8_t val); +`progressBar(int x, int y, int w, int h, uint8_t val);` **参数:** @@ -230,9 +230,9 @@ Generate a QR code. **函数原型:** -qrcode(const char *string, uint16_t x, uint16_t y, uint8_t width, uint8_t version); +`qrcode(const char *string, uint16_t x, uint16_t y, uint8_t width, uint8_t version);` -qrcode(const String &string, uint16_t x, uint16_t y, uint8_t width, uint8_t version); +`qrcode(const String &string, uint16_t x, uint16_t y, uint8_t width, uint8_t version);` **参数:** @@ -271,15 +271,15 @@ Generate a QR code. **函数原型:** -drawBitmap(int16_t x0, int16_t y0, int16_t w, int16_t h, const uint16_t *data); +`drawBitmap(int16_t x0, int16_t y0, int16_t w, int16_t h, const uint16_t *data);` -drawBitmap(int16_t x0, int16_t y0, int16_t w, int16_t h, uint16_t *data); +`drawBitmap(int16_t x0, int16_t y0, int16_t w, int16_t h, uint16_t *data);` -drawBitmap(int16_t x0, int16_t y0, int16_t w, int16_t h, const uint16_t *data, uint16_t transparent); +`drawBitmap(int16_t x0, int16_t y0, int16_t w, int16_t h, const uint16_t *data, uint16_t transparent);` -drawBitmap(int16_t x0, int16_t y0, int16_t w, int16_t h, const uint8_t *data); +`drawBitmap(int16_t x0, int16_t y0, int16_t w, int16_t h, const uint8_t *data);` -drawBitmap(int16_t x0, int16_t y0, int16_t w, int16_t h, uint8_t *data); +`drawBitmap(int16_t x0, int16_t y0, int16_t w, int16_t h, uint8_t *data);` **参数:** @@ -313,7 +313,7 @@ Generate a QR code. **函数原型:** -drawChar(int16_t uniCode, int32_t x, uint16_t y, uint8_t font); +`drawChar(int16_t uniCode, int32_t x, uint16_t y, uint8_t font);` **函数参数:** @@ -341,7 +341,7 @@ Generate a QR code. **函数原型:** -drawBmpFile(fs::FS &fs, const char *path, uint16_t x, uint16_t y); +`drawBmpFile(fs::FS &fs, const char *path, uint16_t x, uint16_t y);` **参数:** @@ -378,10 +378,10 @@ Generate a QR code. **函数原型:** -void drawJpg(const uint8_t *jpg_data, size_t jpg_len, uint16_t x = 0, +`void drawJpg(const uint8_t *jpg_data, size_t jpg_len, uint16_t x = 0, uint16_t y = 0, uint16_t maxWidth = 0, uint16_t maxHeight = 0, uint16_t offX = 0, uint16_t offY = 0, - jpeg_div_t scale = JPEG_DIV_NONE。); + jpeg_div_t scale = JPEG_DIV_NONE。);` **参数:** @@ -427,10 +427,10 @@ Generate a QR code. **函数原型:** -void drawJpgFile(fs::FS &fs, const char *path, uint16_t x = 0, uint16_t y = 0, +`void drawJpgFile(fs::FS &fs, const char *path, uint16_t x = 0, uint16_t y = 0, uint16_t maxWidth = 0, uint16_t maxHeight = 0, uint16_t offX = 0, uint16_t offY = 0, - jpeg_div_t scale = JPEG_DIV_NONE); + jpeg_div_t scale = JPEG_DIV_NONE);` **参数:** @@ -472,9 +472,9 @@ Generate a QR code. **函数原型:** -fillScreen(uint16_t color); +`fillScreen(uint16_t color);` - + **功能:以指定的颜色填充整个屏幕。** @@ -500,7 +500,7 @@ lcd.fillScreen(lcd.RED) * * * - - + ## setTextColor() **函数原型:** -setTextColor(uint16_t color, uint16_t backgroundcolor); +`setTextColor(uint16_t color, uint16_t backgroundcolor);` - + **功能:设置显示文本的前景颜色和背景颜色。** @@ -561,9 +561,9 @@ lcd.setTextColor(lcd.ORANGE, lcd.DARKCYAN) **函数原型:** -setCursor(uint16_t x0, uint16_t y0); +`setCursor(uint16_t x0, uint16_t y0);` - + **功能:移动光标位置到 (x0, y0) 处。** @@ -590,7 +590,7 @@ lcd.drawPixel(22,22,lcd.RED) **函数原型:** -drawPixel(int16_t x, int16_t y, uint16_t color); +`drawPixel(int16_t x, int16_t y, uint16_t color);` **功能:在位置(x,y)处画点。** @@ -627,7 +627,7 @@ lcd.drawPixel(22,22,lcd.RED) **函数原型:** -drawChar(int32_t x, int32_t y, uint16_t c, uint32_t color, uint32_t bg, uint8_t size); +`drawChar(int32_t x, int32_t y, uint16_t c, uint32_t color, uint32_t bg, uint8_t size);` **参数:** @@ -658,7 +658,7 @@ lcd.drawPixel(22,22,lcd.RED) **函数原型:** -drawFastVLine(int32_t x, int32_t y, int32_t h, uint32_t color); +`drawFastVLine(int32_t x, int32_t y, int32_t h, uint32_t color);` **参数:** @@ -685,7 +685,7 @@ M5.Lcd.drawFastHLine(0, 0, 12, TFT_GREEN); **函数原型:** -drawFastHLine(int32_t x, int32_t y, int32_t w, uint32_t color); +`drawFastHLine(int32_t x, int32_t y, int32_t w, uint32_t color);` **参数:** @@ -712,7 +712,7 @@ M5.Lcd.drawFastHLine(0, 0, 12, TFT_GREEN); **函数原型:** -drawNumber(long long_num, int32_t poX, int32_t poY); +`drawNumber(long long_num, int32_t poX, int32_t poY);` **Function argument:** @@ -734,7 +734,7 @@ M5.Lcd.drawNumber(12345, 160, 120); **函数原型:** -drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color); +`drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color);` **功能:以指定的颜色从点(x,y)到点(x1,y1)画直线。** @@ -766,7 +766,7 @@ lcd.drawLine(0,0,12,12,lcd.WHITE) **函数原型:** -drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color); +`drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);` **功能:以指定颜色画三角形,顶点分别为(x,y),(x1,y1)和(x2,y2)。** @@ -798,9 +798,9 @@ lcd.drawLine(0,0,12,12,lcd.WHITE) **函数原型:** -fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color); +`fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);` -**功能:以指定颜色画填充形式的三角形,顶点分别为(x,y),(x1,y1)和(x2,y2)。** +**功能:以指定颜色画`填充形式`的三角形,顶点分别为(x,y),(x1,y1)和(x2,y2)。** | 参数 | 描述 | | --- | --- | @@ -830,7 +830,7 @@ lcd.drawLine(0,0,12,12,lcd.WHITE) **函数原型:** -fillCircle(int32_t x0, int32_t y0, int32_t r, uint32_t color); +`fillCircle(int32_t x0, int32_t y0, int32_t r, uint32_t color);` **功能: Draw a filled circle on point(x0, y0), Radis is r with color** @@ -861,7 +861,7 @@ M5.Lcd.fillCircle(160, 120, 30, 0XFF00FF); **函数原型:** -void fillSprite(uint32_t color) +`void fillSprite(uint32_t color)` **函数参数:** @@ -889,9 +889,9 @@ img.fillSprite(WHITE); **函数原型:** -uint16_t getCursorX(void); +`uint16_t getCursorX(void);` - + **功能: 获取x坐标.** @@ -913,9 +913,9 @@ M5.Lcd.print(X); **函数原型:** -uint16_t getCursorY(void); +`uint16_t getCursorY(void);` - + **功能: 获取y坐标.** @@ -940,7 +940,7 @@ M5.Lcd.print(Y); **函数原型:** -drawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color); +`drawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);` **功能:以指定颜色画矩形,其中矩形左上角坐标为(x,y),宽高分别为width和height。** @@ -974,9 +974,9 @@ lcd.drawLine(0,0,12,12,lcd.WHITE) **函数原型:** -fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color); +`fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);` -**功能:以指定颜色画填充形式的矩形,其左上角坐标为(x,y),宽高分别为width和height。** +**功能:以指定颜色画`填充形式`的矩形,其左上角坐标为(x,y),宽高分别为width和height。** | 参数 | 描述 | | --- | --- | @@ -1013,7 +1013,7 @@ lcd.drawLine(0,0,12,12,lcd.WHITE) **函数原型:** -uint8_t getRotation(void) +`uint8_t getRotation(void)` **Function argument:** @@ -1038,7 +1038,7 @@ M5.Lcd.print(M5.Lcd.getRotation()); **函数原型:** -int16_t textWidth(const String& string) +`int16_t textWidth(const String& string)` **函数参数:** @@ -1070,7 +1070,7 @@ M5.Lcd.print(M5.Lcd.textWidth(text)); **函数原型:** -uint8_t setRotation(void) +`uint8_t setRotation(void)` **函数参数:** @@ -1098,7 +1098,7 @@ M5.Lcd.print(M5.Lcd.getTextDatum()); **函数原型:** -setTextDatum(uint8_t datum) +`setTextDatum(uint8_t datum)` **函数参数:** @@ -1136,7 +1136,7 @@ M5.Lcd.drawString("hello", 160, 120, 2); **函数原型:** -int16_t height(void) +`int16_t height(void)` **函数参数:** @@ -1166,7 +1166,7 @@ M5.Lcd.print(img.height()); **函数原型:** -setTextPadding(uint16_t x_width) +`setTextPadding(uint16_t x_width)` **Function argument:** @@ -1200,7 +1200,7 @@ M5.Lcd.drawString("Orbitron 32 with padding", 160, 60, 2); **函数原型:** -setTextWrap(boolean wrapX, boolean wrapY) +`setTextWrap(boolean wrapX, boolean wrapY)` **函数参数:** @@ -1226,7 +1226,7 @@ M5.Lcd.setTextWrap(ture, true); **函数原型:** -int16_t height(void) +`int16_t height(void)` **函数参数:** @@ -1252,7 +1252,7 @@ M5.Lcd.print(M5.Lcd.height()); **函数原型:** -void pushSprite(int32_t x, int32_t y, uint16_t transparent) +`void pushSprite(int32_t x, int32_t y, uint16_t transparent)` **函数参数:** @@ -1283,9 +1283,9 @@ img.pushSprite(35, 40, WHITE); **函数原型:** -drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color); +`drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color);` -**功能:以指定颜色画圆角矩形,其中矩形左上角坐标为(x,y),宽高分别为width和height,圆角半径为radius。** +**功能:以指定颜色画`圆角`矩形,其中矩形左上角坐标为(x,y),宽高分别为width和height,圆角半径为radius。** | 参数 | 描述 | | --- | --- | @@ -1322,7 +1322,7 @@ lcd.drawLine(0,0,12,12,lcd.WHITE) **函数原型:** -int16_t width(void) +`int16_t width(void)` **函数参数:** @@ -1348,7 +1348,7 @@ M5.Lcd.print(M5.Lcd.width()); **函数原型:** -fillRoundRect(int16_t x, int16_t y, int16_t w, int16_t h, int16_t r, [uint16_t color]); +`fillRoundRect(int16_t x, int16_t y, int16_t w, int16_t h, int16_t r, [uint16_t color]);` **参数:** @@ -1379,7 +1379,7 @@ M5.Lcd.fillRoundRect(180, 70, 122, 10, 4, BLUE); **函数原型:** -int16_t width(void) +`int16_t width(void)` **函数参数:** @@ -1407,7 +1407,7 @@ M5.Lcd.print(img.width()); **函数原型:** -int16_t drawFloat(float floatNumber, uint8_t dp, int32_t poX, int32_t poY); +`int16_t drawFloat(float floatNumber, uint8_t dp, int32_t poX, int32_t poY);` **函数参数:** @@ -1434,7 +1434,7 @@ M5.Lcd.drawFloat(12.345, 3, 160, 120); **函数原型:** -drawEllipse(int16_t x0, int16_t y0, int32_t rx, int32_t ry, uint16_t color); +`drawEllipse(int16_t x0, int16_t y0, int32_t rx, int32_t ry, uint16_t color);` **参数:** @@ -1462,7 +1462,7 @@ M5.Lcd.drawEllipse(100,100,20,30, TFT_GREEN); **函数原型:** -fillEllipse(int16_t x0, int16_t y0, int32_t rx, int32_t ry, uint16_t color); +`fillEllipse(int16_t x0, int16_t y0, int32_t rx, int32_t ry, uint16_t color);` **参数:** @@ -1492,7 +1492,7 @@ M5.Lcd.drawEllipse(100,100,20,30, TFT_GREEN); **函数原型:** -color565(uint8_t red, uint8_t green, uint8_t blue); +`color565(uint8_t red, uint8_t green, uint8_t blue);` **参数:** @@ -1525,7 +1525,7 @@ M5.Lcd.drawEllipse(100,100,20,30, TFT_GREEN); **函数原型:** -deleteSprite(void) +`deleteSprite(void)` **函数参数:** @@ -1553,7 +1553,7 @@ img.deleteSprite(); **函数原型:** -setRotation(uint8_t r); +`setRotation(uint8_t r);` **参数:** @@ -1584,7 +1584,7 @@ img.deleteSprite(); **函数原型:** -invertDisplay(boolean i); +`invertDisplay(boolean i);` **参数:** @@ -1611,7 +1611,7 @@ img.deleteSprite(); **函数原型:** -loadFont(String fontName, fs::FS &ffs); +`loadFont(String fontName, fs::FS &ffs);` **参数:** @@ -1636,7 +1636,7 @@ M5.Lcd.loadFont("filename", SD); **函数原型:** -unloadFont(); +`unloadFont();` **参数:** @@ -1658,7 +1658,7 @@ M5.Lcd.unloadFont(); **函数原型:** -fontsLoaded(); +`fontsLoaded();` **参数:** @@ -1686,7 +1686,7 @@ if(M5.Lcd.unloadFont()){ **函数原型:** -print(); +`print();` **功能:在屏幕的当前位置开始打印文本(字符串)text。** @@ -1717,13 +1717,13 @@ lcd.drawLine(0,0,12,12,lcd.WHITE) **函数原型:** -drawString(const char *string, int32_t poX, int32_t poY, uint8_t font); +`drawString(const char *string, int32_t poX, int32_t poY, uint8_t font);` -drawString(const char *string, int32_t poX, int32_t poY); +`drawString(const char *string, int32_t poX, int32_t poY);` -drawString(const String& string, int32_t poX, int32_t poY, uint8_t font); +`drawString(const String& string, int32_t poX, int32_t poY, uint8_t font);` -drawString(const String& string, int32_t poX, int32_t poY); +`drawString(const String& string, int32_t poX, int32_t poY);` **参数:** @@ -1750,7 +1750,7 @@ lcd.drawLine(0,0,12,12,lcd.WHITE) **函数原型:** -printf("格式规范",arg1...); +`printf("格式规范",arg1...);` **情報:** @@ -1769,7 +1769,7 @@ M5.Lcd.printf("A=%d",a); * * * - + **功能:移动光标位置到 (x0, y0) 处。** @@ -117,7 +117,7 @@ void loop(){} **函数原型:** -drawPixel(int16_t x, int16_t y, uint16_t color); +`drawPixel(int16_t x, int16_t y, uint16_t color);` **功能:在位置(x,y)处画点。** @@ -144,7 +144,7 @@ void loop() {} **函数原型:** -drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color); +`drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color);` **功能:以指定的颜色从点(x,y)到点(x1,y1)画直线。** @@ -171,7 +171,7 @@ void loop() {} **函数原型:** -drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color); +`drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);` **功能:以指定颜色画三角形,顶点分别为(x,y),(x1,y1)和(x2,y2)。** @@ -198,9 +198,9 @@ void loop() {} **函数原型:** -fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color); +`fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);` -**功能:以指定颜色画填充形式的三角形,顶点分别为(x,y),(x1,y1)和(x2,y2)。** +**功能:以指定颜色画`填充形式`的三角形,顶点分别为(x,y),(x1,y1)和(x2,y2)。** | 参数 | 描述 | | --- | --- | @@ -225,7 +225,7 @@ void loop() {} **函数原型:** -drawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color); +`drawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);` **功能:以指定颜色画矩形,其中矩形左上角坐标为(x,y),宽高分别为width和height。** @@ -254,9 +254,9 @@ void loop() {} **函数原型:** -fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color); +`fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);` -**功能:以指定颜色画填充形式的矩形,其左上角坐标为(x,y),宽高分别为width和height。** +**功能:以指定颜色画`填充形式`的矩形,其左上角坐标为(x,y),宽高分别为width和height。** | 参数 | 描述 | | --- | --- | @@ -283,9 +283,9 @@ void loop() {} **函数原型:** -drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color); +`drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color);` -**功能:以指定颜色画圆角矩形,其中矩形左上角坐标为(x,y),宽高分别为width和height,圆角半径为radius。** +**功能:以指定颜色画`圆角`矩形,其中矩形左上角坐标为(x,y),宽高分别为width和height,圆角半径为radius。** | 参数 | 描述 | | --- | --- | @@ -313,7 +313,7 @@ void loop() {} **函数原型:** -print(); +`print();` **功能:在屏幕的当前位置开始打印文本(字符串) text。** diff --git a/docs/zh_CN/api/mpu9250.md b/docs/zh_CN/api/mpu9250.md index b2654251..f25754ec 100644 --- a/docs/zh_CN/api/mpu9250.md +++ b/docs/zh_CN/api/mpu9250.md @@ -6,9 +6,9 @@ **函数原型:** -void initMPU9250(); +`void initMPU9250();` - + **功能:初始化 MPU6500 芯片。** @@ -33,9 +33,9 @@ void setup(){ **函数原型:** -void initAK8963(float * destination); +`void initAK8963(float * destination);` - + **功能:初始化 AK8963 芯片。** @@ -74,9 +74,9 @@ void setup(){ **函数原型:** -void calibrateMPU9250(float * gyroBias, float * accelBias); +`void calibrateMPU9250(float * gyroBias, float * accelBias);` - + **功能:初始化芯片后,执行该函数以读取静止状态下的陀螺仪和加速度值偏移,并保存到各自的偏移寄存器。** @@ -127,9 +127,9 @@ void loop(){ **函数原型:** -uint8_t readByte(uint8_t address, uint8_t subAddress); +`uint8_t readByte(uint8_t address, uint8_t subAddress);` - + **功能:读取指定寄存器内数据。返回值:寄存器值,长度为8 位。** @@ -158,9 +158,9 @@ void setup(){ **函数原型:** -void readGyroData(int16_t * destination); +`void readGyroData(int16_t * destination);` - + **功能:读取三个方向的陀螺仪值。** @@ -210,9 +210,9 @@ void loop(){ **函数原型:** -void readAccelData(int16_t * destination); +`void readAccelData(int16_t * destination);` - + **功能:读取三个方向的加速度值。** @@ -262,7 +262,7 @@ void loop(){ **函数原型:** -int16_t readTempData(void); +`int16_t readTempData(void);` **功能:** diff --git a/docs/zh_CN/api/power.md b/docs/zh_CN/api/power.md index dc29b323..174749e6 100644 --- a/docs/zh_CN/api/power.md +++ b/docs/zh_CN/api/power.md @@ -18,7 +18,7 @@ **函数原型:** -void begin() +`void begin()` **功能:** @@ -36,7 +36,7 @@ Performs initialization of Power class. **函数原型:** -bool setPowerBoostOnOff(bool en) +`bool setPowerBoostOnOff(bool en)` **功能:** @@ -61,7 +61,7 @@ Performs initialization of Power class. **函数原型:** -bool setPowerBoostKeepOn(bool en) +`bool setPowerBoostKeepOn(bool en)` **功能:** @@ -84,7 +84,7 @@ Performs initialization of Power class. **函数原型:** -bool setPowerVin(bool en) +`bool setPowerVin(bool en)` **功能:** @@ -109,7 +109,7 @@ Performs initialization of Power class. **函数原型:** -bool setPowerWLEDSet(bool en) +`bool setPowerWLEDSet(bool en)` **功能:** @@ -134,7 +134,7 @@ M5GO的IP5306没有接线,无法通过此功能进行控制。 **函数原型:** -bool setPowerBtnEn(bool en) +`bool setPowerBtnEn(bool en)` **功能:** @@ -163,7 +163,7 @@ M5GO的IP5306没有接线,无法通过此功能进行控制。 **函数原型:** -bool setLowPowerShutdownTime(ShutdownTime time) +`bool setLowPowerShutdownTime(ShutdownTime time)` **功能:** @@ -190,7 +190,7 @@ M5GO的IP5306没有接线,无法通过此功能进行控制。 **函数原型:** -bool setPowerBoostKeepOn(bool en) +`bool setPowerBoostKeepOn(bool en)` **功能:** @@ -214,7 +214,7 @@ M5GO的IP5306没有接线,无法通过此功能进行控制。 **函数原型:** -bool setKeepLightLoad(bool en) +`bool setKeepLightLoad(bool en)` **功能:** @@ -240,7 +240,7 @@ M5GO的IP5306没有接线,无法通过此功能进行控制。 **函数原型:** -bool setLowPowerShutdown(bool en) +`bool setLowPowerShutdown(bool en)` **功能:** @@ -266,7 +266,7 @@ M5GO的IP5306没有接线,无法通过此功能进行控制。 **函数原型:** -bool setAutoBootOnLoad(bool en) +`bool setAutoBootOnLoad(bool en)` **功能:** @@ -291,7 +291,7 @@ M5GO的IP5306没有接线,无法通过此功能进行控制。 **函数原型:** -bool setCharge(bool en) +`bool setCharge(bool en)` **功能:** @@ -316,7 +316,7 @@ M5GO的IP5306没有接线,无法通过此功能进行控制。 **函数原型:** -bool isChargeFull() +`bool isChargeFull()` **说明:** @@ -338,7 +338,7 @@ M5GO的IP5306没有接线,无法通过此功能进行控制。 **函数原型:** -bool canControl() +`bool canControl()` **功能:** @@ -360,7 +360,7 @@ M5GO的IP5306没有接线,无法通过此功能进行控制。 **函数原型:** -bool isCharging() +`bool isCharging()` **功能:确认是否正在充电** @@ -380,7 +380,7 @@ M5GO的IP5306没有接线,无法通过此功能进行控制。 **函数原型:** -int8_t getBatteryLevel() +`int8_t getBatteryLevel()` **功能:** @@ -400,7 +400,7 @@ M5GO的IP5306没有接线,无法通过此功能进行控制。 **函数原型:** -void setWakeupButton(uint8_t button) +`void setWakeupButton(uint8_t button)` **功能:设置睡眠返回端口** @@ -424,7 +424,7 @@ setWakeupButton(BUTTON_A_PIN); **函数原型:** -void reset() +`void reset()` **功能:执行CPU重置** @@ -440,7 +440,7 @@ setWakeupButton(BUTTON_A_PIN); **函数原型:** -bool isResetbySoftware() +`bool isResetbySoftware()` **功能:** @@ -462,7 +462,7 @@ setWakeupButton(BUTTON_A_PIN); **函数原型:** -bool isResetbyWatchdog() +`bool isResetbyWatchdog()` **功能:** @@ -483,7 +483,7 @@ setWakeupButton(BUTTON_A_PIN); **函数原型:** -bool isResetbyDeepsleep() +`bool isResetbyDeepsleep()` **功能:** @@ -504,7 +504,7 @@ setWakeupButton(BUTTON_A_PIN); **函数原型:** -bool isResetbyPowerSW() +`bool isResetbyPowerSW()` **功能:** @@ -526,7 +526,7 @@ setWakeupButton(BUTTON_A_PIN); **函数原型:** -void deepSleep() +`void deepSleep()` **功能:** 此功能转换为深度睡眠模式。 @@ -542,7 +542,7 @@ deepSleep(SLEEP_SEC(5)); **函数原型:** -void lightSleep(uint64_t time_in_us) +`void lightSleep(uint64_t time_in_us)` **功能:** 此功能转换为深度睡眠模式。 @@ -560,7 +560,7 @@ lightSleep(SLEEP_SEC(5)); **函数原型:** -void powerOFF() +`void powerOFF()` **功能:** 关掉电源。 diff --git a/docs/zh_CN/api/pwm.md b/docs/zh_CN/api/pwm.md index 89c0a7cf..c17f938b 100644 --- a/docs/zh_CN/api/pwm.md +++ b/docs/zh_CN/api/pwm.md @@ -6,7 +6,7 @@ **函数原型:** -void ledcSetup(uint8_t channel, double freq, uint8_t resolution_bits); +`void ledcSetup(uint8_t channel, double freq, uint8_t resolution_bits);` **功能:设置PWM通道,频率和分辨率。** @@ -14,7 +14,7 @@ **函数原型:** -void ledcAttachPin(uint8_t pin, uint8_t channel); +`void ledcAttachPin(uint8_t pin, uint8_t channel);` **功能:将 LEDC 通道绑定到指定 IO 口上以实现输出** @@ -22,7 +22,7 @@ **函数原型:** -void ledcWrite(uint8_t channel, uint32_t duty); +`void ledcWrite(uint8_t channel, uint32_t duty);` **功能:向channel通道写入duty%占空比。** diff --git a/docs/zh_CN/api/rtc.md b/docs/zh_CN/api/rtc.md index ec705dd0..d152b543 100644 --- a/docs/zh_CN/api/rtc.md +++ b/docs/zh_CN/api/rtc.md @@ -1,8 +1,10 @@ + + ## SetTime() **函数原型:** -void SetTime(RTC_TimeTypeDef* RTC_TimeStruct) +`void SetTime(RTC_TimeTypeDef* RTC_TimeStruct)` **函数参数:** @@ -30,7 +32,7 @@ void loop(){}; **函数原型:** -void GetTime(RTC_TimeTypeDef* RTC_TimeStruct) +`void GetTime(RTC_TimeTypeDef* RTC_TimeStruct)` **函数参数:** @@ -70,7 +72,7 @@ void loop() { **函数原型:** -void SetData(RTC_TimeTypeDef* RTC_DateStruct) +`void SetData(RTC_TimeTypeDef* RTC_DateStruct)` **函数参数:** @@ -102,7 +104,7 @@ void loop(){}; **函数原型:** -void GetData(RTC_TimeTypeDef* RTC_DateStruct) +`void GetData(RTC_TimeTypeDef* RTC_DateStruct)` **函数参数:** diff --git a/docs/zh_CN/api/sh200q_m5stickc.md b/docs/zh_CN/api/sh200q_m5stickc.md index 2ac8aa5f..1428c4e9 100644 --- a/docs/zh_CN/api/sh200q_m5stickc.md +++ b/docs/zh_CN/api/sh200q_m5stickc.md @@ -6,7 +6,7 @@ **函数原型:** -void Init(); +`void Init();` **功能:初始化 SH200Q 芯片。** @@ -28,7 +28,7 @@ void loop() {} **函数原型:** -void getGyroData(int16_t* gx, int16_t* gy, int16_t* gz); +`void getGyroData(int16_t* gx, int16_t* gy, int16_t* gz);` **功能:获取 SH200Q 芯片的三轴陀螺仪数据。** @@ -57,7 +57,7 @@ void loop() { **函数原型:** -void getAccelData(int16_t* ax, int16_t* ay, int16_t* az); +`void getAccelData(int16_t* ax, int16_t* ay, int16_t* az);` **功能:获取 SH200Q 芯片的三轴加速度计数据。** diff --git a/docs/zh_CN/api/speaker.md b/docs/zh_CN/api/speaker.md index 75cb205c..5915cb02 100644 --- a/docs/zh_CN/api/speaker.md +++ b/docs/zh_CN/api/speaker.md @@ -8,7 +8,7 @@ Initialize the speaker. **函数原型:** -begin(); +`begin();` **参数:** @@ -26,7 +26,7 @@ Mute the speakers and stop the output. **函数原型:** -end(); +`end();` **参数:** @@ -54,10 +54,10 @@ M5.Speaker.tone(100); **函数原型:** -tone(uint16_t freq); // for arduino +`tone(uint16_t freq);` // for arduino -tone(uint16_t freq, uint32_t duration); // for arduino - +`tone(uint16_t freq, uint32_t duration);` // for arduino + **功能:喇叭响指定频率的声音持续指定时间。** @@ -85,7 +85,7 @@ Set the beep sound. **函数原型:** -setBeep(uint16_t freq, uint16_t duration); +`setBeep(uint16_t freq, uint16_t duration);` | 参数 |描述 | 型 | | --- | --- |---| diff --git a/docs/zh_CN/api/system.md b/docs/zh_CN/api/system.md index 0a10e25f..6adc7045 100644 --- a/docs/zh_CN/api/system.md +++ b/docs/zh_CN/api/system.md @@ -4,9 +4,9 @@ **函数原型:** -void begin(bool LCDEnable=true, bool SDEnable=true, bool SerialEnable=true,bool I2CEnable=false); +`void begin(bool LCDEnable=true, bool SDEnable=true, bool SerialEnable=true,bool I2CEnable=false);` - + **功能:清串口缓冲区,设置串口波特率为 115200;初始化 LCD;初始化 SD 卡;初始化 I2C;设置按键 A 是睡眠唤醒按键。** @@ -81,9 +81,9 @@ void setup() { **函数原型:** -void update(); +`void update();` - + **功能:读取按键 A, B, C 的状态。** @@ -122,9 +122,9 @@ void loop() { **函数原型:** -void powerOFF(); +`void powerOFF();` - + **功能:系统进入深度睡眠状态。** diff --git a/docs/zh_CN/api/system_m5stickc.md b/docs/zh_CN/api/system_m5stickc.md index b3113849..4b4dff15 100644 --- a/docs/zh_CN/api/system_m5stickc.md +++ b/docs/zh_CN/api/system_m5stickc.md @@ -4,9 +4,9 @@ **函数原型:** -void begin(bool LCDEnable=true, bool PowerEnable=true, bool SerialEnable=true); +`void begin(bool LCDEnable=true, bool PowerEnable=true, bool SerialEnable=true);` - + **功能:清串口缓冲区,设置串口波特率为 115200;初始化 LCD;初始化电源管理芯片 AXP192。** @@ -62,7 +62,7 @@ void setup() { **函数原型:** -void GetBm8563Time(void); +`void GetBm8563Time(void);` **功能:获取当前时分秒的值,并保存到 M5.Rtc.Hour,M5.Rtc.Minute,M5.Rtc.Second 中,ASCII 格式。** diff --git a/docs/zh_CN/api/tf.md b/docs/zh_CN/api/tf.md index afdf04ac..94eff47b 100644 --- a/docs/zh_CN/api/tf.md +++ b/docs/zh_CN/api/tf.md @@ -4,7 +4,7 @@ **函数原型:** -begin(cspin); +`begin(cspin);` **功能:TF 卡初始化。** @@ -25,7 +25,7 @@ void setup() { **函数原型:** -File open(const char *filepath, uint8_t mode; +`File open(const char *filepath, uint8_t mode;` **功能:以指定模式打开指定文件。返回值:文件句柄。** diff --git a/docs/zh_CN/api/ticker.md b/docs/zh_CN/api/ticker.md index ff6f21ad..4399e09d 100644 --- a/docs/zh_CN/api/ticker.md +++ b/docs/zh_CN/api/ticker.md @@ -2,7 +2,7 @@ **函数原型:** -void once(float seconds, callback_t callback) +`void once(float seconds, callback_t callback)` **功能:** @@ -21,7 +21,7 @@ **函数原型:** -void once_ms(uint32_t milliseconds, callback_t callback) +`void once_ms(uint32_t milliseconds, callback_t callback)` **功能:** @@ -40,7 +40,7 @@ **函数原型:** -void attach(float seconds, void (*callback)(TArg), TArg arg) +`void attach(float seconds, void (*callback)(TArg), TArg arg)` **功能:** @@ -60,7 +60,7 @@ **函数原型:** -void attach_ms(uint32_t milliseconds, void (*callback)(TArg), TArg arg) +`void attach_ms(uint32_t milliseconds, void (*callback)(TArg), TArg arg)` **功能:** @@ -80,7 +80,7 @@ **函数原型:** -void attach(float seconds, callback_t callback) +`void attach(float seconds, callback_t callback)` **功能:** @@ -99,7 +99,7 @@ **函数原型:** -void attach_ms(uint32_t milliseconds, callback_t callback) +`void attach_ms(uint32_t milliseconds, callback_t callback)` **功能:** diff --git a/docs/zh_CN/api/touch.md b/docs/zh_CN/api/touch.md index 4fe5c6bd..8ea542e4 100644 --- a/docs/zh_CN/api/touch.md +++ b/docs/zh_CN/api/touch.md @@ -8,7 +8,7 @@ **函数原型:** -TouchPoint_t getPressPoint(); +`TouchPoint_t getPressPoint();` ```arduino #include @@ -31,7 +31,7 @@ void loop() { **函数原型:** -bool ispressed(); +`bool ispressed();` **Example** @@ -57,7 +57,7 @@ void loop() { **函数原型:** -HotZone_t* creatHotZone(uint16_t x0, uint16_t y0, uint16_t w, uint16_t h, void (*fun)() = nullptr ); +`HotZone_t* creatHotZone(uint16_t x0, uint16_t y0, uint16_t w, uint16_t h, void (*fun)() = nullptr );` **Example** @@ -89,7 +89,7 @@ void loop() { **函数原型:** -bool inHotZone(TouchPoint_t point); +`bool inHotZone(TouchPoint_t point);` **Example** diff --git a/docs/zh_CN/api/wifi.md b/docs/zh_CN/api/wifi.md index 85beca90..25efba1e 100644 --- a/docs/zh_CN/api/wifi.md +++ b/docs/zh_CN/api/wifi.md @@ -2,7 +2,7 @@ **函数原型:** -bool WiFi.softAP(const char* ssid, const char* passphrase, int channel, int ssid_hidden, int max_connection) +`bool WiFi.softAP(const char* ssid, const char* passphrase, int channel, int ssid_hidden, int max_connection)` **功能:** @@ -23,7 +23,7 @@ **函数原型:** -bool softAPConfig(IPAddress local_ip, IPAddress gateway, IPAddress subnet) +`bool softAPConfig(IPAddress local_ip, IPAddress gateway, IPAddress subnet)` **功能:** @@ -41,7 +41,7 @@ **函数原型:** -bool softAPdisconnect(bool wifioff = false) +`bool softAPdisconnect(bool wifioff = false)` **功能:** @@ -57,7 +57,7 @@ **函数原型:** -uint8_t softAPgetStationNum() +`uint8_t softAPgetStationNum()` **功能:** @@ -71,7 +71,7 @@ None **函数原型:** -IPAddress softAPIP() +`IPAddress softAPIP()` **功能:** @@ -85,7 +85,7 @@ None **函数原型:** -bool softAPsetHostname(const char * hostname) +`bool softAPsetHostname(const char * hostname)` **功能:** @@ -101,7 +101,7 @@ None **函数原型:** -const char * softAPgetHostname() +`const char * softAPgetHostname()` **功能:** @@ -115,7 +115,7 @@ None **函数原型:** -String softAPmacAddress(void) +`String softAPmacAddress(void)` **功能:** @@ -129,7 +129,7 @@ None **函数原型:** -wl_status_t begin(const char* ssid, const char *passphrase = NULL, int32_t channel = 0, const uint8_t* bssid = NULL, bool connect = true) +`wl_status_t begin(const char* ssid, const char *passphrase = NULL, int32_t channel = 0, const uint8_t* bssid = NULL, bool connect = true)` **功能:** @@ -149,7 +149,7 @@ None **函数原型:** -bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = (uint32_t)0x00000000, IPAddress dns2 = (uint32_t)0x00000000) +`bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = (uint32_t)0x00000000, IPAddress dns2 = (uint32_t)0x00000000)` **功能:** @@ -170,7 +170,7 @@ None **函数原型:** -bool disconnect(bool wifioff = false, bool eraseap = false) +`bool disconnect(bool wifioff = false, bool eraseap = false)` **功能:** @@ -187,7 +187,7 @@ None **函数原型:** -bool isConnected() +`bool isConnected()` **功能:** @@ -201,7 +201,7 @@ None **函数原型:** -bool setAutoReconnect(bool autoReconnect) +`bool setAutoReconnect(bool autoReconnect)` **功能:** @@ -215,7 +215,7 @@ None **函数原型:** -bool getAutoReconnect() +`bool getAutoReconnect()` **功能:** @@ -229,7 +229,7 @@ None **函数原型:** -IPAddress localIP() +`IPAddress localIP()` **功能:** @@ -243,7 +243,7 @@ None **函数原型:** -IPAddress subnetMask() +`IPAddress subnetMask()` **功能:** @@ -257,7 +257,7 @@ None **函数原型:** -IPAddress gatewayIP() +`IPAddress gatewayIP()` **功能:** @@ -271,7 +271,7 @@ None **函数原型:** -IPAddress dnsIP(uint8_t dns_no = 0) +`IPAddress dnsIP(uint8_t dns_no = 0)` **功能:** @@ -285,7 +285,7 @@ None **函数原型:** -String macAddress() +`String macAddress()` **功能:** @@ -299,7 +299,7 @@ None **函数原型:** -const char * getHostname() +`const char * getHostname()` **功能:** @@ -313,7 +313,7 @@ None **函数原型:** -wl_status_t status() +`wl_status_t status()` **功能:** @@ -337,7 +337,7 @@ None **函数原型:** -int16_t scanNetworks(bool async = false, bool show_hidden = false, bool passive = false, uint32_t max_ms_per_chan = 300) +`int16_t scanNetworks(bool async = false, bool show_hidden = false, bool passive = false, uint32_t max_ms_per_chan = 300)` **功能:** @@ -356,7 +356,7 @@ None **函数原型:** -int16_t scanComplete() +`int16_t scanComplete()` **功能:** @@ -370,7 +370,7 @@ None **函数原型:** -void scanDelete() +`void scanDelete()` **功能:** @@ -384,7 +384,7 @@ None **函数原型:** -String SSID(uint8_t networkItem) +`String SSID(uint8_t networkItem)` **功能:** @@ -401,7 +401,7 @@ None **函数原型:** -wifi_auth_mode_t encryptionType(uint8_t networkItem) +`wifi_auth_mode_t encryptionType(uint8_t networkItem)` **功能:** @@ -417,7 +417,7 @@ None **函数原型:** -int32_t RSSI(uint8_t networkItem) +`int32_t RSSI(uint8_t networkItem)` **功能:** @@ -433,7 +433,7 @@ None **函数原型:** -int32_t channel(uint8_t networkItem) +`int32_t channel(uint8_t networkItem)` **功能:** diff --git a/docs/zh_CN/arduino/arduino_home_page.md b/docs/zh_CN/arduino/arduino_home_page.md index 508ee419..7af45ad4 100644 --- a/docs/zh_CN/arduino/arduino_home_page.md +++ b/docs/zh_CN/arduino/arduino_home_page.md @@ -13,7 +13,7 @@
-
+
{{item.title}} @@ -78,6 +78,14 @@ const m5stickc_api = { } }; +const coreink_api = { + 'title':"CoreInk API", + 'item':{ + 'System & Button & RTC & Speaker':'#/zh_CN/api/coreink/system_api', + 'E-Ink':'#/zh_CN/api/coreink/eink_api' + } +}; + var arduino_home_page = new Vue({ el:'#arduino_home_page', @@ -88,6 +96,7 @@ var arduino_home_page = new Vue({ m5core_api: m5core_api, m5stickc_api: m5stickc_api, m5core2_api: m5core2_api, + coreink_api: coreink_api } }; } diff --git a/docs/zh_CN/core/basic.md b/docs/zh_CN/core/basic.md index 4d668d2d..a8095004 100644 --- a/docs/zh_CN/core/basic.md +++ b/docs/zh_CN/core/basic.md @@ -294,6 +294,10 @@ TF 卡最大支持 16GB - [ESP32](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/esp32_datasheet_cn.pdf) - [IP5306](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/IIC_IP5306_REG_V1.4_cn.pdf) +- **API** + + - [Arduino API](zh_CN/arduino/arduino_home_page) + ## 原理图 - [原理图](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/schematic/Core/M5-Core-Schematic(20171206).pdf) diff --git a/docs/zh_CN/core/core2.md b/docs/zh_CN/core/core2.md index da3a3357..f6db51a7 100644 --- a/docs/zh_CN/core/core2.md +++ b/docs/zh_CN/core/core2.md @@ -337,7 +337,10 @@ TF 卡最大支持 16GB - [SY7088](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/SY7088-Silergy.pdf) - [AXP192](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/AXP192_datasheet_en.pdf) +- **API** + - [Arduino API](zh_CN/arduino/arduino_home_page) + ## 原理图 diff --git a/docs/zh_CN/core/coreink.md b/docs/zh_CN/core/coreink.md index e453e8a9..c75a7672 100644 --- a/docs/zh_CN/core/coreink.md +++ b/docs/zh_CN/core/coreink.md @@ -213,6 +213,10 @@ - [SY7088](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/SY7088-Silergy.pdf) - [GDEW0154M09](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/CoreInk-K048-GDEW0154M09%20V2.0%20Specification.pdf) +- **API** + + - [Arduino API](zh_CN/arduino/arduino_home_page) + ## 原理图 diff --git a/docs/zh_CN/core/face_kit.md b/docs/zh_CN/core/face_kit.md index 400024ea..877608de 100644 --- a/docs/zh_CN/core/face_kit.md +++ b/docs/zh_CN/core/face_kit.md @@ -265,6 +265,10 @@ - [BMM150](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/BMM150_datasheet_en.pdf) - [IP5306](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/IIC_IP5306_REG_V1.4_cn.pdf) +- **API** + + - [Arduino API](zh_CN/arduino/arduino_home_page) + ## 原理图 - [原理图](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/schematic/Core/M5-Core-Schematic(20171206).pdf) diff --git a/docs/zh_CN/core/fire.md b/docs/zh_CN/core/fire.md index 6c1e0fc9..74b73028 100644 --- a/docs/zh_CN/core/fire.md +++ b/docs/zh_CN/core/fire.md @@ -353,6 +353,10 @@ BMM150 I2C address 0x10 - [SH200Q](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/SH200Q_en.pdf) - [IP5306](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/IIC_IP5306_REG_V1.4_cn.pdf) +- **API** + + - [Arduino API](zh_CN/arduino/arduino_home_page) + ## 原理图 - [原理图](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/schematic/Core/M5-Core-Schematic(20171206).pdf) diff --git a/docs/zh_CN/core/gray.md b/docs/zh_CN/core/gray.md index ae3a4b41..93c326b7 100644 --- a/docs/zh_CN/core/gray.md +++ b/docs/zh_CN/core/gray.md @@ -324,6 +324,10 @@ BMM150 I2C 地址为 0x10 - [BMM150](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/BMM150_datasheet_en.pdf) - [IP5306](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/IIC_IP5306_REG_V1.4_cn.pdf) +- **API** + + - [Arduino API](zh_CN/arduino/arduino_home_page) + ## 原理图 - [原理图](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/schematic/Core/M5-Core-Schematic(20171206).pdf) diff --git a/docs/zh_CN/core/m5go.md b/docs/zh_CN/core/m5go.md index ad3c0f5b..e95c025b 100644 --- a/docs/zh_CN/core/m5go.md +++ b/docs/zh_CN/core/m5go.md @@ -342,6 +342,10 @@ BMM150 I2C address 0x10 - [BMM150](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/BMM150_datasheet_en.pdf) - [IP5306](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/IIC_IP5306_REG_V1.4_cn.pdf) +- **API** + + - [Arduino API](zh_CN/arduino/arduino_home_page) + ## 原理图 - [原理图](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/schematic/Core/M5-Core-Schematic(20171206).pdf) diff --git a/docs/zh_CN/core/m5go_lite.md b/docs/zh_CN/core/m5go_lite.md index a61f71f0..1c822e97 100644 --- a/docs/zh_CN/core/m5go_lite.md +++ b/docs/zh_CN/core/m5go_lite.md @@ -344,6 +344,10 @@ BMM150 I2C address 0x10 - [BMM150](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/BMM150_datasheet_en.pdf) - [IP5306](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/IIC_IP5306_REG_V1.4_cn.pdf) +- **API** + + - [Arduino API](zh_CN/arduino/arduino_home_page) + ## 原理图 - [原理图](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/schematic/Core/M5-Core-Schematic(20171206).pdf) diff --git a/docs/zh_CN/core/m5paper.md b/docs/zh_CN/core/m5paper.md index c85112f4..ca6087ad 100644 --- a/docs/zh_CN/core/m5paper.md +++ b/docs/zh_CN/core/m5paper.md @@ -206,6 +206,9 @@ - [GT911-datasheet](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/m5paper/gt911_datasheet.pdf) +- **API** + + - [Arduino API](zh_CN/arduino/arduino_home_page) ## 原理图 diff --git a/docs/zh_CN/core/m5stickc.md b/docs/zh_CN/core/m5stickc.md index 7faf0834..cf47492b 100644 --- a/docs/zh_CN/core/m5stickc.md +++ b/docs/zh_CN/core/m5stickc.md @@ -263,6 +263,10 @@ M5StickC 是 M5Stack 产品系列中的核心设备之一,该产品系列建 - [AXP192](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/AXP192_datasheet_cn.pdf) - [SPM1423](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/SPM1423HM4H-B_datasheet_en.pdf) +- **API** + + - [Arduino API](zh_CN/arduino/arduino_home_page) + ## 结构设计文件 >[点击此处,获取M5StickC开源结构设计文件](https://github.com/m5stack/m5-structural-design-file/tree/master/M5StickC) diff --git a/docs/zh_CN/core/m5stickc_plus.md b/docs/zh_CN/core/m5stickc_plus.md index 5da88207..68c8a413 100644 --- a/docs/zh_CN/core/m5stickc_plus.md +++ b/docs/zh_CN/core/m5stickc_plus.md @@ -269,6 +269,10 @@ setup() - **Arduino Library** - [M5StickC_PLUS Library](https://github.com/m5stack/M5StickC-Plus) +- **API** + + - [Arduino API](zh_CN/arduino/arduino_home_page) + ## 案例程序 ### ArduinoIDE