mirror of
https://github.com/m5stack/m5-docs.git
synced 2026-05-20 10:23:01 -07:00
Merge branch 'master' of github.com:m5stack/m5-docs
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>run()</mark>
|
||||
`run()`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -13,7 +13,7 @@ this function must be called inside loop()
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>int setInterval(long d, timer_callback f)</mark>
|
||||
`int setInterval(long d, timer_callback f)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -52,7 +52,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>int setTimeout(long d, timer_callback f)</mark>
|
||||
`int setTimeout(long d, timer_callback f)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -92,7 +92,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>int setTimer(long d, timer_callback f, int n);</mark>
|
||||
`int setTimer(long d, timer_callback f, int n);`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -133,7 +133,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void Enable(int numTimer)</mark>
|
||||
`void Enable(int numTimer)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -172,7 +172,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>boolean isEnabled(int numTimer)</mark>
|
||||
`boolean isEnabled(int numTimer)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -211,7 +211,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void Disable(int numTimer)</mark>
|
||||
`void Disable(int numTimer)`
|
||||
|
||||
**Description:**
|
||||
|
||||
|
||||
+13
-13
@@ -6,7 +6,7 @@
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void SetLed(uint8_t state);</mark>
|
||||
`void SetLed(uint8_t state);`
|
||||
|
||||
**Description:Setting LED power indicator**
|
||||
|
||||
@@ -26,7 +26,7 @@ void loop() {}
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void SetCHGCurrent(uint8_t state);</mark>
|
||||
`void SetCHGCurrent(uint8_t state);`
|
||||
|
||||
**Description: Set charging current.**
|
||||
|
||||
@@ -48,7 +48,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void SetSpkEnable(uint8_t state);</mark>
|
||||
`void SetSpkEnable(uint8_t state);`
|
||||
|
||||
**Description:Enable speaker。**
|
||||
|
||||
@@ -69,7 +69,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void SetBusPowerMode(uint8_t state);</mark>
|
||||
`void SetBusPowerMode(uint8_t state);`
|
||||
|
||||
**Description:Enable bus power output**
|
||||
|
||||
@@ -90,7 +90,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void SetLcdVoltage(uint16_t voltage)</mark>
|
||||
`void SetLcdVoltage(uint16_t voltage)`
|
||||
|
||||
**Description: Setting screen backlight voltage.**
|
||||
|
||||
@@ -113,7 +113,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void SetLDOEnable(uint8_t number, bool state)</mark>
|
||||
`void SetLDOEnable(uint8_t number, bool state)`
|
||||
|
||||
**Description: Enable LDO Pin**
|
||||
|
||||
@@ -138,7 +138,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void SetLDOVoltage(uint8_t number, uint16_t voltage);</mark>
|
||||
`void SetLDOVoltage(uint8_t number, uint16_t voltage);`
|
||||
|
||||
**Description: Config LDO voltage**
|
||||
|
||||
@@ -161,7 +161,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>bool isACIN()</mark>
|
||||
`bool isACIN()`
|
||||
|
||||
**Description:Determine whether the external power supply is connected**
|
||||
|
||||
@@ -186,7 +186,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>uint16_t GetVapsData(void);</mark>
|
||||
`uint16_t GetVapsData(void);`
|
||||
|
||||
**Description: Get battery capacity.**
|
||||
|
||||
@@ -213,7 +213,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>uint16_t GetTempData(void);</mark>
|
||||
`uint16_t GetTempData(void);`
|
||||
|
||||
**Description: Get AXP192 chip temperature.**
|
||||
|
||||
@@ -242,7 +242,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>uint16_t GetIdischargeData(void);</mark>
|
||||
`uint16_t GetIdischargeData(void);`
|
||||
|
||||
**Description: Obtain discharge current.**
|
||||
|
||||
@@ -271,7 +271,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>uint16_t GetIinData(void);</mark>
|
||||
`uint16_t GetIinData(void);`
|
||||
|
||||
**Description: Get input current.**
|
||||
|
||||
@@ -296,7 +296,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>uint16_t GetIusbinData(void);</mark>
|
||||
`uint16_t GetIusbinData(void);`
|
||||
|
||||
**Description:Get USB current.**
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void begin(void);</mark>
|
||||
`void begin(void);`
|
||||
|
||||
**Description: Initialize the AXP192.**
|
||||
|
||||
@@ -25,7 +25,7 @@ void loop() {}
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>uint8_t GetWarningLeve(void);</mark>
|
||||
`uint8_t GetWarningLeve(void);`
|
||||
|
||||
**Description: get current warning level.**
|
||||
|
||||
@@ -49,7 +49,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void LightSleep(uint64_t time_in_us = 0)</mark>
|
||||
`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:**
|
||||
|
||||
<mark>void SetSleep(void);</mark>
|
||||
`void SetSleep(void);`
|
||||
|
||||
**Description: control external device into Sleep Mode,Press power switch to wakeup.**
|
||||
|
||||
@@ -112,7 +112,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void DeepSleep(uint64_t time_in_us = 0)</mark>
|
||||
`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:**
|
||||
|
||||
<mark>void ScreenBreath(uint8_t brightness);</mark>
|
||||
`void ScreenBreath(uint8_t brightness);`
|
||||
|
||||
**Description: Change the LDO3 output voltage of the AXP192 chip.**
|
||||
|
||||
@@ -173,7 +173,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>uint16_t GetVbatData(void);</mark>
|
||||
`uint16_t GetVbatData(void);`
|
||||
|
||||
**Description: Get the battery voltage value.**
|
||||
|
||||
@@ -201,7 +201,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>uint16_t GetIchargeData(void);</mark>
|
||||
`uint16_t GetIchargeData(void);`
|
||||
|
||||
**Description: Get the battery charging current.**
|
||||
|
||||
@@ -229,7 +229,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>uint32_t GetPowerbatData(void);</mark>
|
||||
`uint32_t GetPowerbatData(void);`
|
||||
|
||||
**Description: Get Current Power.**
|
||||
|
||||
@@ -258,7 +258,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>uint16_t GetVapsData(void);</mark>
|
||||
`uint16_t GetVapsData(void);`
|
||||
|
||||
**Description: Get battery capacity.**
|
||||
|
||||
@@ -286,7 +286,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>uint16_t GetTempData(void);</mark>
|
||||
`uint16_t GetTempData(void);`
|
||||
|
||||
**Description: Get battery capacity.**
|
||||
|
||||
@@ -314,7 +314,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>uint16_t GetIinData(void);</mark>
|
||||
`uint16_t GetIinData(void);`
|
||||
|
||||
**Description: ACIN current.**
|
||||
|
||||
@@ -339,7 +339,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>uint16_t GetIdischargeData(void);</mark>
|
||||
`uint16_t GetIdischargeData(void);`
|
||||
|
||||
**Description: Get battery output current.**
|
||||
|
||||
@@ -367,7 +367,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>uint16_t GetIusbinData(void);</mark>
|
||||
`uint16_t GetIusbinData(void);`
|
||||
|
||||
**Description: Get USB vin current.**
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>uint8_t read()</mark>
|
||||
`uint8_t read()`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -30,7 +30,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>uint8_t isPressed()</mark>
|
||||
`uint8_t isPressed()`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -60,7 +60,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>uint8_t wasPressed()</mark>
|
||||
`uint8_t wasPressed()`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -90,7 +90,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>uint8_t releasedFor(uint32_t ms)</mark>
|
||||
`uint8_t releasedFor(uint32_t ms)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -124,7 +124,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>uint8_t pressedFor(uint32_t ms);</mark>
|
||||
`uint8_t pressedFor(uint32_t ms);`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -158,7 +158,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>uint32_t lastChange(void);</mark>
|
||||
`uint32_t lastChange(void);`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -185,7 +185,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>uint8_t wasReleasefor(uint32_t ms);</mark>
|
||||
`uint8_t wasReleasefor(uint32_t ms);`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -219,7 +219,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>uint8_t wasReleased(void)</mark>
|
||||
`uint8_t wasReleased(void)`
|
||||
|
||||
**Description:**
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ I2C communication needs to be initialized in advance by M5.Begin().
|
||||
## writeCommand()
|
||||
|
||||
**Syntax:**
|
||||
<mark>bool writeCommand(uint8_t address, uint8_t subAddress);</mark>
|
||||
`bool writeCommand(uint8_t address, uint8_t subAddress);`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -31,7 +31,7 @@ Used when there are no parameters.
|
||||
## writeByte()
|
||||
|
||||
**Syntax:**
|
||||
<mark>bool writeByte(uint8_t address, uint8_t subAddress, uint8_t data);</mark>
|
||||
`bool writeByte(uint8_t address, uint8_t subAddress, uint8_t data);`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -58,7 +58,7 @@ Used when there is one parameter.
|
||||
## writeBytes()
|
||||
|
||||
**Syntax:**
|
||||
<mark> bool writeBytes(uint8_t address, uint8_t subAddress, uint8_t *data,uint8_t length);</mark>
|
||||
` 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:**
|
||||
<mark> bool readByte(uint8_t address, uint8_t *result);</mark>
|
||||
` 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:**
|
||||
<mark>bool readByte(uint8_t address, uint8_t subAddress,uint8_t *result);</mark>
|
||||
`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:**
|
||||
<mark>bool readBytes(uint8_t address, uint8_t count,uint8_t * dest);</mark>
|
||||
`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:**
|
||||
<mark>bool readBytes(uint8_t address, uint8_t subAddress, uint8_t count, uint8_t * dest);</mark>
|
||||
`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:**
|
||||
<mark>bool readBytes(bool *result);</mark>
|
||||
`bool readBytes(bool *result);`
|
||||
|
||||
**Description:**
|
||||
|
||||
|
||||
@@ -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;}`
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
```
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>EEPROM.begin(size)</mark>
|
||||
`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:**
|
||||
|
||||
<mark>EEPROM.write(addr, data)</mark>
|
||||
`EEPROM.write(addr, data)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -37,7 +37,7 @@ Write data to storage space.
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>EEPROM.commit()</mark>
|
||||
`EEPROM.commit()`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -51,7 +51,7 @@ None
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>EEPROM.read(addr)</mark>
|
||||
`EEPROM.read(addr)`
|
||||
|
||||
**Description:**
|
||||
|
||||
|
||||
+24
-24
@@ -48,7 +48,7 @@
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>int digitalRead(uint8_t pin)</mark>
|
||||
`int digitalRead(uint8_t pin)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -81,7 +81,7 @@ pin21_data = digitalRead(21);
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void digitalWrite(uint8_t pin, uint8_t val)</mark>
|
||||
`void digitalWrite(uint8_t pin, uint8_t val)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -115,7 +115,7 @@ digitalWrite(2,1);
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void pinMode(uint8_t pin, uint8_t mode)</mark>
|
||||
`void pinMode(uint8_t pin, uint8_t mode)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -149,7 +149,7 @@ pinMode(2,INPUT);
|
||||
## analogRead()
|
||||
|
||||
**Syntax:**
|
||||
<mark>uint16_t analogRead(uint8_t pin)</mark>
|
||||
`uint16_t analogRead(uint8_t pin)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -180,7 +180,7 @@ ret=analogRead(35);
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void dacWrite(uint8_t pin, uint8_t value)</mark>
|
||||
`void dacWrite(uint8_t pin, uint8_t value)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -211,7 +211,7 @@ dacWrite(25,0x40);
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>double ledcSetup(uint8_t channel, double freq, uint8_t resolution_bits)</mark>
|
||||
`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:**
|
||||
|
||||
<mark>void ledcAttachPin(uint8_t pin, uint8_t chan)</mark>
|
||||
`void ledcAttachPin(uint8_t pin, uint8_t chan)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -262,7 +262,7 @@ None.
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void ledcWrite(uint8_t chan, uint32_t duty)</mark>
|
||||
`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:**
|
||||
|
||||
<mark>void ledcDetachPin(uint8_t pin)</mark>
|
||||
`void ledcDetachPin(uint8_t pin)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -310,7 +310,7 @@ None.
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void analogSetCycles(uint8_t cycles)</mark>
|
||||
`void analogSetCycles(uint8_t cycles)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -330,7 +330,7 @@ None
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void analogSetWidth(uint8_t bits)</mark>
|
||||
`void analogSetWidth(uint8_t bits)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -350,7 +350,7 @@ None
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void analogReadResolution(uint8_t bits)</mark>
|
||||
`void analogReadResolution(uint8_t bits)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -370,7 +370,7 @@ None
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void analogSetSamples(uint8_t samples)</mark>
|
||||
`void analogSetSamples(uint8_t samples)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -390,7 +390,7 @@ None
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void analogSetAttenuation(adc_attenuation_t attenuation)</mark>
|
||||
`void analogSetAttenuation(adc_attenuation_t attenuation)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -410,7 +410,7 @@ None
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void analogSetPinAttenuation(uint8_t pin, adc_attenuation_t attenuation)</mark>
|
||||
`void analogSetPinAttenuation(uint8_t pin, adc_attenuation_t attenuation)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -432,7 +432,7 @@ None
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>int hallRead(void));</mark>
|
||||
`int hallRead(void));`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -450,7 +450,7 @@ int.
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void attachInterrupt(pin, ISR(callback function), interrupt type/mode)</mark>
|
||||
`void attachInterrupt(pin, ISR(callback function), interrupt type/mode)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -472,7 +472,7 @@ None.
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void detachInterrupt(pin)</mark>
|
||||
`void detachInterrupt(pin)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -492,7 +492,7 @@ None.
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>double ledcReadFreq(uint8_t channel)</mark>
|
||||
`double ledcReadFreq(uint8_t channel)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -512,7 +512,7 @@ current frequency
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>uint32_t ledcRead(uint8_t channel)</mark>
|
||||
`uint32_t ledcRead(uint8_t channel)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -532,7 +532,7 @@ duty cycle
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>bool adcAttachPin(uint8_t pin)</mark>
|
||||
`bool adcAttachPin(uint8_t pin)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -553,7 +553,7 @@ Return 1 if boot succeeds
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>bool adcStart(uint8_t pin)</mark>
|
||||
`bool adcStart(uint8_t pin)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -573,7 +573,7 @@ Return 1 if boot succeeds
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>bool adcBusy(uint8_t pin)</mark>
|
||||
`bool adcBusy(uint8_t pin)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -593,7 +593,7 @@ Conversion returning 1
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>uint16_t adcEnd(uint8_t pin)</mark>
|
||||
`uint16_t adcEnd(uint8_t pin)`
|
||||
|
||||
**Description:**
|
||||
|
||||
|
||||
+5
-5
@@ -6,7 +6,7 @@
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>int Init(void);</mark>
|
||||
`int Init(void);`
|
||||
|
||||
**Description:initialize IMU**
|
||||
|
||||
@@ -26,7 +26,7 @@ void loop() {}
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void getGyroData(float *gx, float *gy, float *gz);</mark>
|
||||
`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:**
|
||||
|
||||
<mark>void getAccelData(float *ax, float *ay, float *az);</mark>
|
||||
`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:**
|
||||
|
||||
<mark>void getAhrsData(float *pitch, float *roll, float *yaw);</mark>
|
||||
`void getAhrsData(float *pitch, float *roll, float *yaw);`
|
||||
|
||||
**Description:Get the attitude of the IMU chip.**
|
||||
|
||||
@@ -104,7 +104,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void getTempData(float *t);</mark>
|
||||
`void getTempData(float *t);`
|
||||
|
||||
**Description:Get the temperature of the IMU chip.**
|
||||
|
||||
|
||||
+80
-80
File diff suppressed because it is too large
Load Diff
+12
-12
@@ -6,7 +6,7 @@
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void ScreenBreath(uint8_t brightness);</mark>
|
||||
`void ScreenBreath(uint8_t brightness);`
|
||||
|
||||
**Description: Adjust the brightness of the screen backlight.**
|
||||
|
||||
@@ -38,7 +38,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>fillScreen(uint16_t color);</mark>
|
||||
`fillScreen(uint16_t color);`
|
||||
|
||||
**Description: Fills the entire screen with the specified color.**
|
||||
|
||||
@@ -64,7 +64,7 @@ void loop() {}
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>setTextColor(uint16_t color, [uint16_t backgroundcolor]);</mark>
|
||||
`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:**
|
||||
|
||||
<mark>setCursor(int16_t x0, int16_t y0, uint8_t font);</mark>
|
||||
`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:**
|
||||
|
||||
<mark>drawPixel(int16_t x, int16_t y, [uint16_t color]);</mark>
|
||||
`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:**
|
||||
|
||||
<mark>drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, [uint16_t color]);</mark>
|
||||
`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:**
|
||||
|
||||
<mark>drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, [uint16_t color]);</mark>
|
||||
`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:**
|
||||
|
||||
<mark>fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, [uint16_t color]);</mark>
|
||||
`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:**
|
||||
|
||||
<mark>drawRect(int16_t x, int16_t y, int16_t w, int16_t h, [uint16_t color]);</mark>
|
||||
`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:**
|
||||
|
||||
<mark>fillRect(int16_t x, int16_t y, int16_t w, int16_t h, [uint16_t color]);</mark>
|
||||
`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:**
|
||||
|
||||
<mark>drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color);</mark>
|
||||
`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:**
|
||||
|
||||
<mark>print();</mark>
|
||||
`print();`
|
||||
|
||||
**Description: Printing text (string) at the current cursor position of the screen.**
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void initMPU9250();</mark>
|
||||
`void initMPU9250();`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -34,7 +34,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void initAK8963(float * destination);</mark>
|
||||
`void initAK8963(float * destination);`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -78,7 +78,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void calibrateMPU9250(float * gyroBias, float * accelBias);</mark>
|
||||
`void calibrateMPU9250(float * gyroBias, float * accelBias);`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -127,7 +127,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>uint8_t readByte(uint8_t address, uint8_t subAddress)</mark>;
|
||||
`uint8_t readByte(uint8_t address, uint8_t subAddress)`;
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -162,7 +162,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void readGyroData(int16_t * destination);</mark>
|
||||
`void readGyroData(int16_t * destination);`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -214,7 +214,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void readAccelData(int16_t * destination);</mark>
|
||||
`void readAccelData(int16_t * destination);`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -266,7 +266,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>int16_t readTempData(void);</mark>
|
||||
`int16_t readTempData(void);`
|
||||
|
||||
**Description:**
|
||||
|
||||
|
||||
+25
-25
@@ -18,7 +18,7 @@ Use initialization, communication check, and control in this order, as shown in
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void begin()</mark>
|
||||
`void begin()`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -37,7 +37,7 @@ No return value.
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>bool setPowerBoostOnOff(bool en)</mark>
|
||||
`bool setPowerBoostOnOff(bool en)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -62,7 +62,7 @@ The power does not turn off when connected via USB.
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>bool setPowerBoostSet(bool en)</mark>
|
||||
`bool setPowerBoostSet(bool en)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -87,7 +87,7 @@ The power does not turn off when connected via USB.
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>bool setPowerVin(bool en)</mark>
|
||||
`bool setPowerVin(bool en)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -112,7 +112,7 @@ Decide whether to turn on the power again.
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>bool setPowerWLEDSet(bool en)</mark>
|
||||
`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:**
|
||||
|
||||
<mark>bool setPowerBtnEn(bool en)</mark>
|
||||
`bool setPowerBtnEn(bool en)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -168,7 +168,7 @@ If the power is not supplied, the power can not be turned on.
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>bool setLowPowerShutdownTime(ShutdownTime time)</mark>
|
||||
`bool setLowPowerShutdownTime(ShutdownTime time)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -195,7 +195,7 @@ Set the waiting time until IP5306 makes the energy saving judgment and the power
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>bool setPowerBoostKeepOn(bool en)</mark>
|
||||
`bool setPowerBoostKeepOn(bool en)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -219,7 +219,7 @@ This function sets/unsets always boost output mode.
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>bool setKeepLightLoad(bool en)</mark>
|
||||
`bool setKeepLightLoad(bool en)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -245,7 +245,7 @@ This function sets/unsets to disable the automatic shutdown.
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>bool setLowPowerShutdown(bool en)</mark>
|
||||
`bool setLowPowerShutdown(bool en)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -271,7 +271,7 @@ Set the power saving automatic shutdown function.
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>bool setAutoBootOnLoad(bool en)</mark>
|
||||
`bool setAutoBootOnLoad(bool en)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -296,7 +296,7 @@ Set whether to automatically start when power consumption occurs on the secondar
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>bool setCharge(bool en)</mark>
|
||||
`bool setCharge(bool en)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -322,7 +322,7 @@ try set charge enable->disable->enable, It can be recharged.
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>bool isChargeFull()</mark>
|
||||
`bool isChargeFull()`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -344,7 +344,7 @@ No argument.
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>bool canControl()</mark>
|
||||
`bool canControl()`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -366,7 +366,7 @@ No argument.
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>bool isCharging()</mark>
|
||||
`bool isCharging()`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -388,7 +388,7 @@ No argument.
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>int8_t getBatteryLevel()</mark>
|
||||
`int8_t getBatteryLevel()`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -408,7 +408,7 @@ Returns -1 if it can not communicate with the controller.
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void setWakeupButton(uint8_t button)</mark>
|
||||
`void setWakeupButton(uint8_t button)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -434,7 +434,7 @@ setWakeupButton(BUTTON_A_PIN);
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void reset();</mark>
|
||||
`void reset();`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -452,7 +452,7 @@ No return value.
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>bool isResetbySoftware()</mark>
|
||||
`bool isResetbySoftware()`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -474,7 +474,7 @@ No argument,
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>bool isResetbyWatchdog()</mark>
|
||||
`bool isResetbyWatchdog()`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -495,7 +495,7 @@ No argument,
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>bool isResetbyDeepsleep()</mark>
|
||||
`bool isResetbyDeepsleep()`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -516,7 +516,7 @@ No argument,
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>bool isResetbyPowerSW()</mark>
|
||||
`bool isResetbyPowerSW()`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -538,7 +538,7 @@ No argument,
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void deepSleep(uint64_t time_in_us)</mark>
|
||||
`void deepSleep(uint64_t time_in_us)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -557,7 +557,7 @@ deepSleep(SLEEP_SEC(5));
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void lightSleep(uint64_t time_in_us)</mark>
|
||||
`void lightSleep(uint64_t time_in_us)`
|
||||
|
||||
**Description:**
|
||||
This function shifts to deep sleep mode.
|
||||
@@ -577,7 +577,7 @@ lightSleep(SLEEP_SEC(5));
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void powerOFF()</mark>
|
||||
`void powerOFF()`
|
||||
|
||||
**Description:**
|
||||
Turn off the power.
|
||||
|
||||
+3
-3
@@ -6,7 +6,7 @@
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void ledcSetup(uint8_t channel, double freq, uint8_t resolution_bits);</mark>
|
||||
`void ledcSetup(uint8_t channel, double freq, uint8_t resolution_bits);`
|
||||
|
||||
**Description:Set the PWM channel, frequency and resolution.**
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void ledcAttachPin(uint8_t pin, uint8_t channel);</mark>
|
||||
`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:**
|
||||
|
||||
<mark>void ledcWrite(uint8_t channel, uint32_t duty);</mark>
|
||||
`void ledcWrite(uint8_t channel, uint32_t duty);`
|
||||
|
||||
**Description:Output waveform to the channel channel according to the specified duty cycle.**
|
||||
|
||||
|
||||
+4
-4
@@ -2,7 +2,7 @@
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void SetTime(RTC_TimeTypeDef* RTC_TimeStruct)</mark>
|
||||
`void SetTime(RTC_TimeTypeDef* RTC_TimeStruct)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -29,7 +29,7 @@ void loop(){};
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void GetTime(RTC_TimeTypeDef* RTC_TimeStruct)</mark>
|
||||
`void GetTime(RTC_TimeTypeDef* RTC_TimeStruct)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -69,7 +69,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void SetData(RTC_TimeTypeDef* RTC_DateStruct)</mark>
|
||||
`void SetData(RTC_TimeTypeDef* RTC_DateStruct)`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -100,7 +100,7 @@ void loop(){};
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void GetData(RTC_TimeTypeDef* RTC_DateStruct)</mark>
|
||||
`void GetData(RTC_TimeTypeDef* RTC_DateStruct)`
|
||||
|
||||
**Description:**
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void Init();</mark>
|
||||
`void Init();`
|
||||
|
||||
**Description: It initialize the SH200Q.**
|
||||
|
||||
@@ -29,7 +29,7 @@ void loop() {}
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void getGyroData(int16_t* gx, int16_t* gy, int16_t* gz);</mark>
|
||||
`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:**
|
||||
|
||||
<mark>void getAccelData(int16_t* ax, int16_t* ay, int16_t* az);</mark>
|
||||
`void getAccelData(int16_t* ax, int16_t* ay, int16_t* az);`
|
||||
|
||||
**Description: It get SH200Q acceleration data.**
|
||||
|
||||
@@ -90,7 +90,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void getTempData(float* t);</mark>
|
||||
`void getTempData(float* t);`
|
||||
|
||||
**Description: It get SH200Q tempurature data.**
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ Initialize the speaker.
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>begin();</mark>
|
||||
`begin();`
|
||||
|
||||
**Function argument:**
|
||||
|
||||
@@ -26,7 +26,7 @@ Mute the speakers and stop the output.
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>end();</mark>
|
||||
`end();`
|
||||
|
||||
**Function argument:**
|
||||
|
||||
@@ -41,7 +41,7 @@ None
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>tone(uint16_t freq, [uint32_t duration]);</mark>
|
||||
`tone(uint16_t freq, [uint32_t duration]);`
|
||||
|
||||
**Description: Set the pitch of speaker.**
|
||||
|
||||
@@ -68,7 +68,7 @@ Set the beep sound.
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>setBeep(uint16_t freq, uint16_t duration);</mark>
|
||||
`setBeep(uint16_t freq, uint16_t duration);`
|
||||
|
||||
| Argument | Description | Type |
|
||||
| --- | --- | --- |
|
||||
@@ -93,7 +93,7 @@ Mute the sound .
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void mute(void);</mark>
|
||||
`void mute(void);`
|
||||
|
||||
**Example of use:**
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void begin(bool LCDEnable=true, bool SDEnable=true, bool SerialEnable=true,bool I2CEnable=false);</mark>
|
||||
`void begin(bool LCDEnable=true, bool SDEnable=true, bool SerialEnable=true,bool I2CEnable=false);`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -71,7 +71,7 @@ void M5Stack::update() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void update();</mark>
|
||||
`void update();`
|
||||
|
||||
**Description:**
|
||||
|
||||
@@ -112,7 +112,7 @@ void loop() {
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void powerOFF();</mark>
|
||||
`void powerOFF();`
|
||||
|
||||
**Description:**
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>void begin(bool LCDEnable=true, bool PowerEnable=true, bool SerialEnable=true);</mark>
|
||||
`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:**
|
||||
|
||||
<mark>void GetBm8563Time(void);</mark>
|
||||
`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.**
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user