Skip to content
Mallikarjunarao Kosuri edited this page Jul 15, 2024 · 7 revisions

Welcome to the bitops Wiki!

The bitops library provides a collection of efficient bitwise operations in C, designed to simplify and optimize low-level operations. Below is an overview of the available APIs and their integration use cases.

Getting Started

Before proceeding, please familiarize yourself with binary operations

API Documentation

Explore detailed documentation for each API function:

Integration with STM32, ARM, and Raayan Mini Development Boards

Usage

To integrate bitops into your STM32, ARM, or Raayan Mini projects:

  1. Clone the Repository: Clone the repository into your project directory.

    git clone https://github.com/vkosuri/bitops.git
  2. Include the Library: Include the necessary header files (bitops.h) in your source files where bitwise operations are required.

  3. Build Configuration: Ensure the library is included in your build system (e.g., Makefile or IDE configuration).

Example

#include "bitops.h"

// Example usage
int main() {
    uint8_t x = 0b10101010;
    uint8_t p = 3;
    
    x = set_bit(x, p);
    // Perform other operations

    return 0;
}

Arduino Boards and Custom Boards

Usage

For Arduino and custom boards, integrate bitops similarly:

  1. Download and Include: Download the repository or add it as a submodule in your Arduino project.

  2. Include Headers: Include bitops.h in your Arduino sketch or project files.

  3. Compile and Upload: Compile and upload your sketch to the Arduino board using the Arduino IDE or CLI.

Example

#include "bitops.h"

// Example usage
void setup() {
    uint8_t x = 0b10101010;
    uint8_t p = 2;
    
    x = toggle_bit(x, p);
    // Continue with your Arduino code
}

void loop() {
    // Your Arduino loop
}