Skip to content

Commit

Permalink
Improve existing README.md to cover more folders (projects)
Browse files Browse the repository at this point in the history
  • Loading branch information
eric15342335 committed Aug 29, 2024
1 parent 239fd8f commit 010ec61
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/Doxyfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PROJECT_NAME = "CH32V003 InspireMatrix"
INPUT = data emulator i2c-comm movingnum paint-cursor paint-exe rv rv-dis testing tic-tac-toe README.md
INPUT = data emulator ch32v003_stt eeprom i2c-comm inspire3d-demo movingnum movingcar paint paint-cursor rv-asm rv-dis save-rvasm savepaint snake-game testing tic-tac-toe README.md
RECURSIVE = YES
USE_MDFILE_AS_MAINPAGE = README.md
BUILTIN_STL_SUPPORT = YES
Expand Down
75 changes: 67 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,87 @@
# InspireMatrix + CH32V003

## Description
This repository contains various projects and utilities for
working with the CH32V003 microcontroller.

Projects:
Older hardware (InspireMatrix):
![InspireMatrix](inspire_matrix.jpeg)

## Project Structure

* `.github`:
* `workflows`: GitHub Actions workflows.
* `Doxyfile`: Doxygen configuration.

* `.vscode`:
* `settings.json`: VSCode settings:

```json
"C_Cpp.default.compilerPath": "riscv-none-elf-gcc",
```

To set the default compiler to `riscv-none-elf-gcc` for IDE integration.

* `ch32v003_stt`
* Simple spoken digit recognition.
* Originally from <https://github.com/brian-smith-github/ch32v003_stt>
* Read its [README.md](ch32v003_stt/STT-README.md) for more information.

* `ch32v003fun`
* `driver.h`: Contains the most frequently used functions for the CH32V003.
* `i2c_events.h`: Contains some frequently used I2C functions.
* Originally from <https://github.com/cnlohr/ch32v003fun>
* `i2c_events.h`: Contains some frequently used I2C functions written manually.
* `i2c_tx.c`, `i2c_tx.h`, `oled_min.c`, `oled_min.h`: Contains some frequently used functions for the SSD1306 OLED display. Comes from <https://github.com/eric15342335/inspirelab-game>
* `ws2812b_simple.h`: Contains one function for controlling the WS2812B LEDs.
You need to declare the following variables in your code:
In `funconfig.h`:

```c
#define FUNCONF_SYSTICK_USE_HCLK 1
```

In your code (e.g. `main.c`):

```c
#define WS2812BSIMPLE_IMPLEMENTATION
// ...
#include "ws2812b_simple.h"
```

* Originally from the `extralibs` folder in <https://github.com/cnlohr/ch32v003fun>

* `data`
* `buttons.h`: Button ADC calibration data.
* `colors.h`: RGB color data for WS2812B LEDs.

Contains two sets of data, one for the first prototype
`InspireMatrix` and one for the second prototype `InspireComputer` (which uses two ADC channels for buttons). If you are using the `InspireComputer`, declare the following in `funconfig.h`:

```c
#define INTERNAL_INSPIRE_MATRIX
```

* `colors.h`: Contains the color palette for the `InspireMatrix` or `InspireComputer`.

One global variable `led_array[]` act as buffer to store the color data to be displayed.
Provides functions to manipulate the `led_array[]` buffer.

* `fonts.h`: Display numbers and characters in the size of 3x5 on WS2812B LEDs.

* `music.h`: Frequencies, durations and functions for playing music using a buzzer.
To play sound, use `JOY_sound()`.

* `emulator`
* Support development of basic embedded system software on Windows/MacOS without requiring
physical hardware.
* Aims to achieve function compatibility with the `ch32v003fun` library.

* `i2c-comm` (Working in progress)
* Communication between two boards using I2C.
* `i2c-comm`
* Communication between two boards using I2C protocol. The code contains a master and a slave.

* `misc`
* `libgcc.a` required by the `ch32v003fun` library on MacOS. See [here](misc/README.md) for more information.

* `movingnum`
* Animations of numbers moving from right to left, bottom to top. Uses math instead of hard coding.
Demonstrates the use of `fonts.h`.

* `paint-cursor`
* Draw images on `InspireMatrix` with direction buttons and matrix buttons
Expand All @@ -44,7 +94,7 @@ Projects:

* `rv-asm`
* Coding RISC-V Compressed instructions on a board with buttons, and showing the result on the matrix.
* Originally from <https://github.com/brian-smith-github/rv>
* Originally from <https://github.com/mnurzia/rv>

* `rv-dis` (Working in progress)
* Disassemble RISC-V compressed instructions and print the result on an external OLED display (e.g. SSD1306).
Expand All @@ -54,6 +104,15 @@ Projects:
* This folder contains a bunch of test programs that are subject to change, and are not guaranteed to work for
your specific hardware.

* `savepaint`
* Todo

* `save-rvasm`
* Todo

* `snake-game`
* Porting the classic snake game to `InspireMatrix`, which has `8x8`=`64` LEDs and `up / down / left / right` controls.

* `tic-tac-toe`
* Play tic-tac-toe with a bot
* Press button to start
Expand Down
2 changes: 1 addition & 1 deletion data/colors.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ color_t color_divide(color_t color, uint8_t divider) {

#define smaller(x, y) ((x) < (y) ? (x) : (y))
void set_color(uint8_t led, color_t color) {
uint8_t divider = 8;
uint8_t divider = 1;
led_array[led].r = smaller(color.r, color.r / divider);
led_array[led].g = smaller(color.g, color.g / divider);
led_array[led].b = smaller(color.b, color.b / divider);
Expand Down

0 comments on commit 010ec61

Please sign in to comment.