|
1 | | -; PlatformIO Project Configuration File for UIRB V0.2 Basic Example |
| 1 | +; PlatformIO Project Configuration File for UIRB Basic Example |
2 | 2 | ; |
3 | | -; **Requirements:** |
4 | | -; - Ensure the custom UIRB V0.2 board definition is installed in PlatformIO. |
| 3 | +; **Overview:** |
| 4 | +; This configuration file sets up build and environment settings for the Universal Infrared Blaster (UIRB) |
| 5 | +; project using the UIRBcore library. It supports a custom UIRB V0.2 board along with other Arduino-compatible |
| 6 | +; boards. Key features include customizable pin configurations, high-speed serial communication, and support |
| 7 | +; for debugging. |
5 | 8 | ; |
6 | | -; **Features:** |
7 | | -; - Target Platform: Atmel AVR |
8 | | -; - Framework: Arduino |
9 | | -; - Dependencies: UIRBcore library |
10 | | -; - Upload and Serial Monitor speed set to 1000000 baud for fast communication. |
11 | | -; - Includes a time filter for the serial monitor to display timestamps alongside output. |
| 9 | +; **Project Details:** |
| 10 | +; - Targets Atmel AVR microcontrollers using the Arduino framework. |
| 11 | +; - Focuses on the UIRB V0.2 board with expansion capabilities and a custom pin layout. |
| 12 | +; - Provides examples for Uno, Nano, and Pro series boards with reusable configurations. |
| 13 | +; - Ensures consistency across environments using shared `custom_pin_config`. |
12 | 14 | ; |
13 | | -; **Documentation:** |
14 | | -; - PlatformIO Options: https://docs.platformio.org/page/projectconf.html |
15 | | -; - UIRB Library and Examples: https://github.com/DjordjeMandic/UIRBcorelib |
16 | | -[env:uirb-v02-atmega328p] |
17 | | -platform = atmelavr |
18 | | -board = uirb-v02-atmega328p ; Custom UIRB-v02 board definition must be installed |
19 | | -framework = arduino |
| 15 | +; **Usage Notes:** |
| 16 | +; - Ensure the UIRBcore library is installed (https://github.com/DjordjeMandic/UIRBcorelib). |
| 17 | +; - For UIRB V0.2, confirm the board definition (`uirb-v02-atmega328p`) is installed. |
| 18 | +; - Review and modify the `custom_pin_config` section for specific hardware setups. |
| 19 | +; |
| 20 | +; **References:** |
| 21 | +; - UIRBcore Library Documentation: https://github.com/DjordjeMandic/UIRBcorelib |
| 22 | +; - PlatformIO Documentation: https://docs.platformio.org/ |
| 23 | +; - UIRB PlatformIO Project Example Details: https://github.com/DjordjeMandic/UIRBpio |
| 24 | +; |
| 25 | +; **Supported Environments:** |
| 26 | +; - [env:uirb-v02]: Default environment for UIRB V0.2 hardware. |
| 27 | +; - [env:uirb-v02-usbasp]: Uses USBasp for firmware uploads on the UIRB V0.2. |
| 28 | +; - [env:uno], [env:nano], [env:pro-16mhz-328], [env:pro-8mhz-328p]: Arduino-compatible boards. |
| 29 | + |
| 30 | +; General PlatformIO settings |
| 31 | +[platformio] |
| 32 | +name = UIRB Basic Example |
| 33 | +description = Basic example demonstrating the use of the UIRBcore library. |
| 34 | +default_envs = uirb-v02 ; Default environment to use for builds (specified below) |
| 35 | + |
| 36 | +; Common settings for all environments |
| 37 | +[env] |
| 38 | +platform = atmelavr ; Specifies the Atmel AVR platform (used for ATmega microcontrollers) |
| 39 | +framework = arduino ; Utilizes the Arduino framework for development |
20 | 40 | lib_deps = |
21 | | - djordjemandic/UIRBcorelib @ ^1.1.1 ; Depend on the latest 1.x stable version |
22 | | -upload_speed = 1000000 ; High upload speed for faster programming |
23 | | -monitor_speed = 1000000 ; Serial monitor baud rate |
24 | | -monitor_filters = time ; Adds timestamps to serial monitor output |
| 41 | + djordjemandic/UIRBcorelib @ ^1.2.0 ; UIRBcore library for Universal IR Blaster (GitHub: https://github.com/DjordjeMandic/UIRBcorelib) |
| 42 | +monitor_speed = 1000000 ; Serial monitor baud rate (1M) |
| 43 | +monitor_filters = default, time, colorize ; Serial monitor: default output, timestamps, and colorized text |
| 44 | +build_src_flags = |
| 45 | + -DMONITOR_SPEED=${env.monitor_speed} ; Define monitor speed as a preprocessor macro |
| 46 | + |
| 47 | +; Default environment for the UIRB V0.2 board with urboot bootloader |
| 48 | +[env:uirb-v02] |
| 49 | +board = uirb-v02-atmega328p ; Board configuration for UIRB V0.2 hardware (ATmega328P). |
| 50 | + ; For details, see https://github.com/DjordjeMandic/UIRBpio |
| 51 | +build_type = release ; Specifies release build type |
| 52 | +; upload_speed = 57600 ; Uncomment if bootloader has issues with the default upload speed |
| 53 | +; upload_port = COM6 ; Uncomment and set this to specify a fixed upload port. |
| 54 | + ; Ports are automatically detected using hardware IDs (hwids). |
| 55 | + |
| 56 | +; Environment for the UIRB V0.2 board using USBasp as the programmer |
| 57 | +[env:uirb-v02-usbasp] |
| 58 | +extends = env:uirb-v02 ; Inherit settings from the default UIRB V0.2 environment |
| 59 | +upload_protocol = usbasp ; Use USBasp for uploading firmware |
| 60 | +upload_flags = ; Additional configuration for USBasp: |
| 61 | + -PUSB ; Specify USB as the upload port |
| 62 | + -B8 ; Set SPI clock speed (divide by 8) for stable uploads |
| 63 | + |
| 64 | +; Custom pin configuration section |
| 65 | +[custom_pin_config] |
| 66 | +build_flags = |
| 67 | + -DPIN_USB_IO3=4 ; Define USB I/O pin |
| 68 | + -DPIN_BUTTON_WAKEUP=2 ; Define button wakeup pin |
| 69 | + -DPIN_BUTTON_OPTION_1=A1 ; Define first option button pin |
| 70 | + -DPIN_BUTTON_OPTION_2=A2 ; Define second option button pin |
| 71 | + -DPIN_BUTTON_OPTION_3=A3 ; Define third option button pin |
| 72 | + -DPIN_PULLDOWN_RESISTOR=5 ; Define pulldown resistor pin |
| 73 | + -DPIN_TX=1 ; Define UART TX pin |
| 74 | + -DPIN_RX=0 ; Define UART RX pin |
| 75 | + -DBUTTON_PIN_ACTIVE_STATE=0 ; Define active state for buttons (0 = LOW) |
| 76 | + -DPIN_STAT_LED=LED_BUILTIN ; Define status LED pin (shared with SPI SCK) |
| 77 | + -DPIN_IR_LED=3 ; Define IR LED pin for IR transmission |
| 78 | + -DPIN_IR_CAPTURE=8 ; Define input capture pin for IR raw signal |
| 79 | + -DIR_CAPTURE_PIN_PULLUP=0 ; Disable pull-up resistor for IR capture pin |
| 80 | + -DPIN_IR_RECEIVE=12 ; Define demodulating IR receiver pin |
| 81 | + -DIR_RECEIVE_PIN_PULLUP=1 ; Enable pull-up resistor for IR receive pin |
| 82 | + -DPIN_PROG=A0 ; Define pin for the PROG line (TP4057 charger monitoring and control) |
| 83 | + |
| 84 | +; Arduino Uno environment |
| 85 | +[env:uno] |
| 86 | +board = uno ; Board definition for Arduino Uno |
| 87 | +build_flags = |
| 88 | + ${custom_pin_config.build_flags} ; Reuse custom pin configuration |
| 89 | + |
| 90 | +; Arduino Nano environment |
| 91 | +[env:nano] |
| 92 | +board = nano ; Board definition for Arduino Nano |
| 93 | +build_flags = |
| 94 | + ${custom_pin_config.build_flags} ; Reuse custom pin configuration |
| 95 | + |
| 96 | +; Arduino Pro 16MHz environment with ATmega328 |
| 97 | +[env:pro-16mhz-328] |
| 98 | +board = pro16MHzatmega328 ; Board definition for Arduino Pro 16MHz |
| 99 | +build_flags = |
| 100 | + ${custom_pin_config.build_flags} ; Reuse custom pin configuration |
| 101 | + |
| 102 | +; Arduino Pro 8MHz environment with ATmega328P |
| 103 | +[env:pro-8mhz-328p] |
| 104 | +board = pro8MHzatmega328 ; Board definition for Arduino Pro 8MHz |
| 105 | +build_flags = |
| 106 | + ${custom_pin_config.build_flags} ; Reuse custom pin configuration |
0 commit comments