rcc 1.0
RCC - RGB LED Color Cube Documentation
Loading...
Searching...
No Matches
main.h File Reference

Main header file for RCC firmware. More...

#include <avr/io.h>
#include <avr/sleep.h>
#include <avr/interrupt.h>
#include <avr/eeprom.h>
#include <util/delay.h>
#include "./hal/avr0/system/system.h"
#include "./battery/battery.h"
#include "./led/led.h"
Include dependency graph for main.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define F_CPU   20000000UL
 System clock frequency definition.
#define SWITCH   PIN7_bm
 Pin mask for the user switch/button input.
#define SWITCH_COMMAND_EXECUTE_MS   3000UL
 Time window to finalize switch command execution in milliseconds.
#define SWITCH_SYSTEM_OFF_TIME_MS   3000UL
 Duration of button press to trigger system shutdown, in milliseconds.
#define COLOR_FADE_DELAY_MS   10UL
 Delay duration for color fading effect in milliseconds.
#define COLOR_INTENSITY_DELAY_MS   350UL
 Delay duration for intensity changes in milliseconds.
#define ENABLE_EEPROM_WRITE
 Enables EEPROM write support.

Detailed Description

Main header file for RCC firmware.

Defines core macros, includes, and configuration constants used throughout the RCC embedded system project. This header provides CPU frequency, switch timing constants, delay intervals, and feature switches. It also includes key AVR libraries and modular headers for system, battery, and LED functionality.

Author
g.raf
Date
2025-09-28
Version
1.0 Release
Note
This file is part of the RCC AVR embedded project and subject to the repository license. For updates and revision history, please visit the GitHub repository.
See also
https://github.com/0x007e/rcc "RCC - RGB LED Color Cube"

Macro Definition Documentation

◆ COLOR_FADE_DELAY_MS

#define COLOR_FADE_DELAY_MS   10UL

Delay duration for color fading effect in milliseconds.

Controls the time interval between incremental color changes during LED color fading operations.

◆ COLOR_INTENSITY_DELAY_MS

#define COLOR_INTENSITY_DELAY_MS   350UL

Delay duration for intensity changes in milliseconds.

Defines the interval timing for changes in LED intensity during brightness adjustment routines.

◆ ENABLE_EEPROM_WRITE

#define ENABLE_EEPROM_WRITE

Enables EEPROM write support.

When defined, the firmware supports writing updated LED configuration data to EEPROM. If undefined, EEPROM writes are disabled to protect memory from unnecessary wear.

◆ F_CPU

#define F_CPU   20000000UL

System clock frequency definition.

This macro defines the operating frequency of the microcontroller's clock in Hertz. It is used by delay functions and timing calculations. The value should match the actual hardware clock frequency to ensure correct timing behavior in the software.

◆ SWITCH

#define SWITCH   PIN7_bm

Pin mask for the user switch/button input.

Defines the bit mask for the hardware input pin connected to the user switch. It is used to detect button press events in the firmware.

◆ SWITCH_COMMAND_EXECUTE_MS

#define SWITCH_COMMAND_EXECUTE_MS   3000UL

Time window to finalize switch command execution in milliseconds.

Defines the maximum duration to wait for button press sequences before executing the corresponding command. Used to handle multi-press functionality within this millisecond timeout.

◆ SWITCH_SYSTEM_OFF_TIME_MS

#define SWITCH_SYSTEM_OFF_TIME_MS   3000UL

Duration of button press to trigger system shutdown, in milliseconds.

If the user holds the button for this time period, the system initiates a controlled shutdown sequence.