From 34afa025aa2f6b0cf04f2ded84dc2dbb4e33ab26 Mon Sep 17 00:00:00 2001 From: jake Date: Sat, 8 Mar 2025 17:06:49 -0800 Subject: [PATCH] Added header for regedit --- inc/RegEdit.h | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 inc/RegEdit.h diff --git a/inc/RegEdit.h b/inc/RegEdit.h new file mode 100644 index 0000000..4956b42 --- /dev/null +++ b/inc/RegEdit.h @@ -0,0 +1,71 @@ +/** + * @brief Module/Interface for editing AVR registers + * @details This file is an interface to AVR registers or the avr/io.h + * @author Jake G + * @date 2024 + * @copyright None + * @file RegEdit.h + */ + +#ifndef REGEDIT_H +#define REGEDIT_H + +#include +#include + + +/** + * @brief Sets the value of the register to 0xFF. + * @param reg A pointer to a register + */ +void RegEdit_SetRegister(void *reg); + +/** + * @brief Sets the value of the register to 0x00. + * @param reg A pointer to a register + */ +void RegEdit_ClearRegister(void *reg); + +/** + * @brief Sets a single bit in the register. + * @param reg A pointer to a register + * @param The bit's index or number in the register + */ +void RegEdit_SetBit(void *reg, uint8_t bit_num); + +/** + * @brief Clears a single bit in the register. + * @param reg A pointer to a register + * @param The bit's index or number in the register + */ +void RegEdit_ClearBit(void *reg, uint8_t bit_num); + +/** + * @brief Checks if a single bit is set in the register. + * @param reg A pointer to a register + * @param The bit's index or number in the register + */ +bool RegEdit_IsBitSet(void *reg, uint8_t bit_num); + +/** + * @brief Preforms logical OR Equals with the passed num. + * @param reg A pointer to a register + * @param The bit's index or number in the register + */ +void RegEdit_OR_Num(void *reg, uint8_t num); + +/** + * @brief Preforms logical AND Equals with the passed num. + * @param reg A pointer to a register + * @param The bit's index or number in the register + */ +void RegEdit_AND_Num(void *reg, uint8_t num); + +/** + * @brief Sets the register to the passed number value. + * @param reg A pointer to a register + * @param The bit's index or number in the register + */ +void RegEdit_SetNum(void *reg, uint8_t num); + +#endif //REGEDIT_H