Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mmMicky committed Oct 24, 2022
1 parent 51aeaa1 commit 3e7ab91
Show file tree
Hide file tree
Showing 4,095 changed files with 1,989,124 additions and 1 deletion.
The diff you're trying to view is too large. We only load the first 3000 changed files.
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,34 @@
# T-Embed
<h1 align = "center">🌟LilyGo T-Embed🌟</h1>
An ESP32S3 development board that can freely use WIFI, BLE, TF, LED, TFT_LCD functions.

# Introduce
![](image/T-Embed.jpg)
![](image/details.jpg)

## Product 📷

| Product | Product Link |
| :--------: | :---------: |
| T-Embed | [aliexpress]() |


# Quick Start
## Arduino
> Arduino:
>- Click "File" in the upper left corner -> Preferences -> Additional Development >Board Manager URL -> Enter the URL in the input box.
(ESP32S3 is a new chip, and the SDK version needs to be version 2.0.3 or above)
> `https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json`
>- Click OK and the software will be installed by itself. After installation, restart the Arduino IDE software.
>- Search for ESP32 in Tools->Board Manager and install ESP32-Arduino SDK
![](image/Arduino_board.png)
>- Copy all files in the lib folder to `\Arduino\libraries`
>- Select the settings as shown. Note that the FLASH size partition and size may be modified depending on the board.
![](image/Arduino_Config.png)

> PlatfromIO:
> - PlatformIO plug-in installation: Click on the extension on the left column -> search platformIO -> install the first plug-in
> - Click Platforms -> Embedded -> search Espressif 32 in the input box -> select the corresponding firmware installation
> ESP-IDF:
> - The installation method is also inconsistent depending on the system, it is recommended to refer to the [official manual](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html) for installation
Binary file added doc/esp32-s3_datasheet_cn.pdf
Binary file not shown.
Binary file added doc/esp32-s3_datasheet_en.pdf
Binary file not shown.
Binary file added doc/esp32-s3_technical_reference_manual_cn.pdf
Binary file not shown.
Binary file added doc/esp32-s3_technical_reference_manual_en.pdf
Binary file not shown.
19 changes: 19 additions & 0 deletions example/factory/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
# ref: https://clang.llvm.org/docs/ClangFormatStyleOptions.html
# 语言: None, Cpp, Java, JavaScript, ObjC, Proto, TableGen, TextProto
Language: Cpp
# BasedOnStyle: LLVM

# 每行字符的限制,0表示没有限制
ColumnLimit: 150

# 预处理器指令的缩进样式
IndentPPDirectives: None

MacroBlockBegin: Without

# 宏定义对齐
AlignConsecutiveMacros: AcrossEmptyLinesAndComments
# Enabled: true
# AcrossEmptyLines: false
# AcrossComments: true
5 changes: 5 additions & 0 deletions example/factory/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
Binary file added example/factory/data/ring_1.mp3
Binary file not shown.
Binary file added example/factory/data/ring_setup.mp3
Binary file not shown.
Binary file added example/factory/data/ui/knob_img.bin
Binary file not shown.
1 change: 1 addition & 0 deletions example/factory/lib/APA102/APA102.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// This file is intentionally left blank.
216 changes: 216 additions & 0 deletions example/factory/lib/APA102/APA102.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
// Copyright Pololu Corporation. For more information, see http://www.pololu.com/

#pragma once

/*! \file APA102.h
* This is the main header file for the APA102 library. */

#include <Arduino.h>

namespace Pololu
{
#ifndef _POLOLU_RGB_COLOR
#define _POLOLU_RGB_COLOR
/*! A struct that can be used to represent colors. Each field is a number
* between 0 and 255 that represents the brightness of a component of the
* color. */
typedef struct rgb_color
{
uint8_t red, green, blue;
rgb_color() {};
rgb_color(uint8_t r, uint8_t g, uint8_t b) : red(r), green(g), blue(b) {};
} rgb_color;
#endif

/*! An abstract base class for APA102. This class is useful if you want
* to have a pointer that can point to different APA102 objects.
*
* The only virtual function provided by this class is write() because making
* the low-level functions be virtual causes a noticeable slowdown.
*/
class APA102Base
{
public:
/*! Writes the specified colors to the LED strip.
*
* @param colors A pointer to an array of colors.
* @param count The number of colors to write.
* @param brightness A 5-bit brightness value (between 0 and 31) that will
* be written to each LED.
*/
virtual void write(rgb_color * colors, uint16_t count, uint8_t brightness = 31) = 0;
};

/*! A template class that represents an APA102 or SK9822 LED strip controlled
* by a particular clock and data pin.
*
* @param dataPin The Arduino pin number or name for the pin that will be
* used to control the data input.
*
* @param clockPin The Arduino pin number or name for the pin that will be
* used to control the clock input.
*/
template<uint8_t dataPin, uint8_t clockPin> class APA102 : public APA102Base
{
public:

virtual void write(rgb_color * colors, uint16_t count, uint8_t brightness = 31)
{
startFrame();
for(uint16_t i = 0; i < count; i++)
{
sendColor(colors[i], brightness);
}
endFrame(count);
}

/*! Initializes the I/O lines and sends a "Start Frame" signal to the LED
* strip.
*
* This is part of the low-level interface provided by this class, which
* allows you to send LED colors as you are computing them instead of
* storing them in an array. To use the low-level interface, first call
* startFrame(), then call sendColor() some number of times, then call
* endFrame(). */
void startFrame()
{
init();
transfer(0);
transfer(0);
transfer(0);
transfer(0);
}

/*! Sends an "End Frame" signal to the LED strip. This is the last step in
* updating the LED strip if you are using the low-level interface described
* in the startFrame() documentation.
*
* After this function returns, the clock and data lines will both be
* outputs that are driving low. This makes it easier to use one clock pin
* to control multiple LED strips. */
void endFrame(uint16_t count)
{
/* The data stream seen by the last LED in the chain will be delayed by
* (count - 1) clock edges, because each LED before it inverts the clock
* line and delays the data by one clock edge. Therefore, to make sure
* the last LED actually receives the data we wrote, the number of extra
* edges we send at the end of the frame must be at least (count - 1).
*
* Assuming we only want to send these edges in groups of size K, the
* C/C++ expression for the minimum number of groups to send is:
*
* ((count - 1) + (K - 1)) / K
*
* The C/C++ expression above is just (count - 1) divided by K,
* rounded up to the nearest whole number if there is a remainder.
*
* We set K to 16 and use the formula above as the number of frame-end
* bytes to transfer. Each byte has 16 clock edges.
*
* We are ignoring the specification for the end frame in the APA102
* datasheet, which says to send 0xFF four times, because it does not work
* when you have 66 LEDs or more, and also it results in unwanted white
* pixels if you try to update fewer LEDs than are on your LED strip. */

for (uint16_t i = 0; i < (count + 14)/16; i++)
{
transfer(0);
}

/* We call init() here to make sure we leave the data line driving low
* even if count is 0 or 1. */
init();
}

/*! Sends a single 24-bit color and an optional 5-bit brightness value.
* This is part of the low-level interface described in the startFrame()
* documentation. */
void sendColor(uint8_t red, uint8_t green, uint8_t blue, uint8_t brightness = 31)
{
transfer(0b11100000 | brightness);
transfer(blue);
transfer(green);
transfer(red);
}

/*! Sends a single 24-bit color and an optional 5-bit brightness value.
* This is part of the low-level interface described in the startFrame()
* documentation. */
void sendColor(rgb_color color, uint8_t brightness = 31)
{
sendColor(color.red, color.green, color.blue, brightness);
}

protected:
void init()
{
#ifdef APA102_USE_FAST_GPIO
FastGPIO::Pin<dataPin>::setOutputLow();
FastGPIO::Pin<clockPin>::setOutputLow();
#else
digitalWrite(dataPin, LOW);
pinMode(dataPin, OUTPUT);
digitalWrite(clockPin, LOW);
pinMode(clockPin, OUTPUT);
#endif
}

void transfer(uint8_t b)
{
#ifdef APA102_USE_FAST_GPIO
FastGPIO::Pin<dataPin>::setOutputValue(b >> 7 & 1);
FastGPIO::Pin<clockPin>::setOutputValueHigh();
FastGPIO::Pin<clockPin>::setOutputValueLow();
FastGPIO::Pin<dataPin>::setOutputValue(b >> 6 & 1);
FastGPIO::Pin<clockPin>::setOutputValueHigh();
FastGPIO::Pin<clockPin>::setOutputValueLow();
FastGPIO::Pin<dataPin>::setOutputValue(b >> 5 & 1);
FastGPIO::Pin<clockPin>::setOutputValueHigh();
FastGPIO::Pin<clockPin>::setOutputValueLow();
FastGPIO::Pin<dataPin>::setOutputValue(b >> 4 & 1);
FastGPIO::Pin<clockPin>::setOutputValueHigh();
FastGPIO::Pin<clockPin>::setOutputValueLow();
FastGPIO::Pin<dataPin>::setOutputValue(b >> 3 & 1);
FastGPIO::Pin<clockPin>::setOutputValueHigh();
FastGPIO::Pin<clockPin>::setOutputValueLow();
FastGPIO::Pin<dataPin>::setOutputValue(b >> 2 & 1);
FastGPIO::Pin<clockPin>::setOutputValueHigh();
FastGPIO::Pin<clockPin>::setOutputValueLow();
FastGPIO::Pin<dataPin>::setOutputValue(b >> 1 & 1);
FastGPIO::Pin<clockPin>::setOutputValueHigh();
FastGPIO::Pin<clockPin>::setOutputValueLow();
FastGPIO::Pin<dataPin>::setOutputValue(b >> 0 & 1);
FastGPIO::Pin<clockPin>::setOutputValueHigh();
FastGPIO::Pin<clockPin>::setOutputValueLow();
#else
digitalWrite(dataPin, b >> 7 & 1);
digitalWrite(clockPin, HIGH);
digitalWrite(clockPin, LOW);
digitalWrite(dataPin, b >> 6 & 1);
digitalWrite(clockPin, HIGH);
digitalWrite(clockPin, LOW);
digitalWrite(dataPin, b >> 5 & 1);
digitalWrite(clockPin, HIGH);
digitalWrite(clockPin, LOW);
digitalWrite(dataPin, b >> 4 & 1);
digitalWrite(clockPin, HIGH);
digitalWrite(clockPin, LOW);
digitalWrite(dataPin, b >> 3 & 1);
digitalWrite(clockPin, HIGH);
digitalWrite(clockPin, LOW);
digitalWrite(dataPin, b >> 2 & 1);
digitalWrite(clockPin, HIGH);
digitalWrite(clockPin, LOW);
digitalWrite(dataPin, b >> 1 & 1);
digitalWrite(clockPin, HIGH);
digitalWrite(clockPin, LOW);
digitalWrite(dataPin, b >> 0 & 1);
digitalWrite(clockPin, HIGH);
digitalWrite(clockPin, LOW);
#endif
}

};
}

using namespace Pololu;
13 changes: 13 additions & 0 deletions example/factory/lib/APA102/Doxyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Doxygen configuration file for generating documentation.
# We don't actually publish this documentation anywhere though,
# because the README is good enough for a library like this.

PROJECT_NAME = "APA102 library"
OUTPUT_DIRECTORY = docs
INLINE_INHERITED_MEMB = YES
INPUT = .
USE_MDFILE_AS_MAINPAGE = README.md
RECURSIVE = YES
SOURCE_BROWSER = YES
USE_MATHJAX = YES
GENERATE_LATEX = NO
25 changes: 25 additions & 0 deletions example/factory/lib/APA102/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Copyright (c) 2015-2017 Pololu Corporation. For more information, see

http://www.pololu.com/
http://forum.pololu.com/

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Loading

0 comments on commit 3e7ab91

Please sign in to comment.