Skip to content

Commit

Permalink
Merge pull request #53 from CapibaraZero/develop/0.5.1
Browse files Browse the repository at this point in the history
Develop/0.5.1
  • Loading branch information
andreock authored Nov 30, 2024
2 parents 74bfd27 + 08dd307 commit c1ce616
Show file tree
Hide file tree
Showing 135 changed files with 3,230 additions and 1,971 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ to discuss what you would like to change.

If you wanna port project to other ESP boards, we have made a little guide here: https://capibarazero.github.io/docs/docs/development/porting_to_others_boards/new_porting

## Social

- [Matrix server](https://matrix.to/#/#capibarazero:capibarazero.com)
- [Discord-Matrix bridge](https://discord.gg/77f3BHvnhf)

## License

[GPL-3](https://www.gnu.org/licenses/gpl-3.0.html)
[GPL-3](https://www.gnu.org/licenses/gpl-3.0.html)
1 change: 1 addition & 0 deletions format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ files=$(find . -type f)
for file in $files
do
if [[ $file != *".git"* && $file != *".vscode"* && $file != *".pio"* && $file != *"Library"* && $file != *"BusIO"* && $file != *".csv"* && ($file == *".c"* || $file == *".h"*) ]]; then
echo "Formatting $file"
clang-format -style=Google -i "$file"
fi
done
11 changes: 6 additions & 5 deletions include/battery_level.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#define MIN_ANALOG_VALUE 0 // Low analog value, read using analogRead()
#define MAX_ANALOG_VALUE 3300 // High analog value, read using analogRead()
#define MIN_LEVEL 0 // Minimium battery level in percentage
#define MAX_LEVEL 100 // Maximium battery level in percentage
#define TASK_POLLING_RATE 10000 // Level updater timeout in milliseconds(it will update every x ms)
#define MIN_ANALOG_VALUE 0 // Low analog value, read using analogRead()
#define MAX_ANALOG_VALUE 3300 // High analog value, read using analogRead()
#define MIN_LEVEL 0 // Minimium battery level in percentage
#define MAX_LEVEL 100 // Maximium battery level in percentage
#define TASK_POLLING_RATE \
10000 // Level updater timeout in milliseconds(it will update every x ms)
56 changes: 56 additions & 0 deletions include/boards/arduino_nano_esp32/pins.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* This file is part of the Capibara zero (https://github.com/CapibaraZero/fw or
* https://capibarazero.github.io/). Copyright (c) 2024 Andrea Canale.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

// Set your display resolution here
#define DISPLAY_WIDTH 240
#define DISPLAY_HEIGHT 240

// Define buttons pins
#define OK_BTN_PIN A3
#define UP_BTN_PIN A5
#define DOWN_BTN_PIN A2
#define LEFT_BTN_PIN A4
#define RIGHT_BTN_PIN A1

// Display pins
#define TFT_CS D6
#define TFT_DC D5
#define TFT_RST -1
#define TFT_MOSI D2
#define TFT_MISO -1
#define TFT_SCLK D4

// SD card
#define SD_CARD_CS D10
#define SD_CARD_MOSI D11
#define SD_CARD_MISO D12
#define SD_CARD_SCK D13

// SX1276(SubGHZ)
#define SX1276_DIO1 D0
#define SX1276_NSS D7
#define SX1276_DIO2 D1
#define SX1276_MISO D9

// PN532(NFC)
#define PN532_SCL A6
#define PN532_SDA A7

#define BATTERY_MONITOR A0

#define IR_RECEIVER_PIN D8
#define IR_EMITTER_PIN D3
54 changes: 54 additions & 0 deletions include/boards/esp32_s3_devkitc/pins.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* This file is part of the Capibara zero (https://github.com/CapibaraZero/fw or
* https://capibarazero.github.io/). Copyright (c) 2024 Andrea Canale.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

// Set your display resolution here
#define DISPLAY_WIDTH 240
#define DISPLAY_HEIGHT 240

// Define buttons pins
#define OK_BTN_PIN 40
#define UP_BTN_PIN 47
#define DOWN_BTN_PIN 41
#define LEFT_BTN_PIN 39
#define RIGHT_BTN_PIN 42

// Display pins
#define TFT_RST 4
#define TFT_DC 5
#define TFT_CS 10
#define TFT_MOSI 11
#define TFT_MISO -1
#define TFT_SCLK 12

// SD card
#define SD_CARD_CS 13
#define SD_CARD_MOSI 35
#define SD_CARD_SCK 36
#define SD_CARD_MISO 37

#define SX1276_NSS 1
#define SX1276_DIO2 15
#define SX1276_DIO1 16
#define SX1276_MISO 7

#define PN532_SDA 8
#define PN532_SCL 9

#define BATTERY_MONITOR 2

#define IR_RECEIVER_PIN 6
#define IR_EMITTER_PIN 14
66 changes: 66 additions & 0 deletions include/boards/lilygo_t_embed_cc1101/pins.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* This file is part of the Capibara zero (https://github.com/CapibaraZero/fw or
* https://capibarazero.github.io/). Copyright (c) 2024 Andrea Canale.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

// Set your display resolution here
#define DISPLAY_WIDTH 170
#define DISPLAY_HEIGHT 320

// Define buttons pins
#define OK_BTN_PIN 0

#define ENCODER_A_PIN 4
#define ENCODER_B_PIN 5

#define STANDBY_BTN 6
#define WAKEUP_PIN 0

// Display pins
#define TFT_CS 41
#define TFT_DC 16
#define TFT_RST -1
#define TFT_MOSI 9
#define TFT_MISO 10
#define TFT_SCLK 11
#define TFT_BLK 21

// SD card
#define SD_CARD_CS 13
#define SD_CARD_MOSI 9
#define SD_CARD_MISO 10
#define SD_CARD_SCK 11

// SX1276(SubGHZ)
#define CC1101_MOSI 9
#define CC1101_MISO 10
#define CC1101_SCK 11
#define CC1101_CS 12
#define CC1101_IO2 38
#define CC1101_IO0 3
#define CC1101_SW1 47
#define CC1101_SW0 48

// PN532(NFC)
#define NFC_BUS_SCL 18
#define NFC_BUS_SDA 8
#define NFC_RST 45
#define NFC_IRQ 17

#define BOARD_PWR_EN 15
#define BQ27220_BATTERY

#define IR_RECEIVER_PIN 1
#define IR_EMITTER_PIN 2
6 changes: 3 additions & 3 deletions include/debug.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifdef ARDUINO_NANO_ESP32
#define SERIAL_DEVICE Serial
#else
#ifdef ESP32S3_DEVKITC_BOARD
#define SERIAL_DEVICE Serial0
#else
#define SERIAL_DEVICE Serial
#endif

#define LOG_ERROR(reason) SERIAL_DEVICE.printf("\e[31m%s\e[0m", reason)
Expand Down
2 changes: 1 addition & 1 deletion include/device_info.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define VERSION "0.5.0" // Current FW version
#define VERSION "0.5.1" // Current FW version

/* Device that we are building */
#ifdef CONFIG_IDF_TARGET_ESP32
Expand Down
8 changes: 4 additions & 4 deletions include/icons/file/file.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "Arduino.h"

// From Icons8
const uint8_t file_icon[] = {
0x00, 0x00, 0x00, 0x00, 0x0f, 0xfe, 0x0f, 0xff, 0x0f, 0xfd, 0x0f,
0xfc, 0x0f, 0xfc, 0x0f, 0xfc, 0x0f, 0xff, 0x0f, 0xff, 0x0f, 0xff,
0x0f, 0xff, 0x0f, 0xff, 0x0f, 0xff, 0x0f, 0xff, 0x0f, 0xff};
const uint8_t file_icon[] = {0x00, 0x00, 0x00, 0x00, 0x0f, 0xfe, 0x0f, 0xff,
0x0f, 0xfd, 0x0f, 0xfc, 0x0f, 0xfc, 0x0f, 0xfc,
0x0f, 0xff, 0x0f, 0xff, 0x0f, 0xff, 0x0f, 0xff,
0x0f, 0xff, 0x0f, 0xff, 0x0f, 0xff, 0x0f, 0xff};
68 changes: 4 additions & 64 deletions include/pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,74 +17,14 @@

#ifdef ESP32S3_DEVKITC_BOARD

// Define buttons pins
#define OK_BTN_PIN 40
#define UP_BTN_PIN 47
#define DOWN_BTN_PIN 41
#define LEFT_BTN_PIN 39
#define RIGHT_BTN_PIN 42

// Display pins
#define TFT_RST 4
#define TFT_DC 5
#define TFT_CS 10
#define TFT_MOSI 11
#define TFT_SCLK 12

// SD card
#define SD_CARD_CS 13
#define SD_CARD_MOSI 35
#define SD_CARD_SCK 36
#define SD_CARD_MISO 37

#define SX1276_NSS 1
#define SX1276_DIO2 15
#define SX1276_DIO1 16
#define SX1276_MISO 7

#define PN532_SDA 8
#define PN532_SCL 9

#define BATTERY_MONITOR 2

#define IR_RECEIVER_PIN 6
#define IR_EMITTER_PIN 14
#include "boards/esp32_s3_devkitc/pins.h"

#elif ARDUINO_NANO_ESP32

// Define buttons pins
#define OK_BTN_PIN A3
#define UP_BTN_PIN A5
#define DOWN_BTN_PIN A2
#define LEFT_BTN_PIN A4
#define RIGHT_BTN_PIN A1

// Display pins
#define TFT_CS D6
#define TFT_DC D5
#define TFT_RST -1
#define TFT_MOSI D2
#define TFT_SCLK D4

// SD card
#define SD_CARD_CS D10
#define SD_CARD_MOSI D11
#define SD_CARD_MISO D12
#define SD_CARD_SCK D13

// SX1276(SubGHZ)
#define SX1276_DIO1 D0
#define SX1276_NSS D7
#define SX1276_DIO2 D1
#define SX1276_MISO D9

// PN532(NFC)
#define PN532_SCL A6
#define PN532_SDA A7
#include "boards/arduino_nano_esp32/pins.h"

#define BATTERY_MONITOR A0
#elif LILYGO_T_EMBED_CC1101

#define IR_RECEIVER_PIN D8
#define IR_EMITTER_PIN D3
#include "boards/lilygo_t_embed_cc1101/pins.h"

#endif
Loading

0 comments on commit c1ce616

Please sign in to comment.