Skip to content

Instantly share code, notes, and snippets.

View yatharthb97's full-sized avatar

Yatharth Bhasin yatharthb97

View GitHub Profile
@yatharthb97
yatharthb97 / udcounter.py
Last active September 29, 2022 22:49
Describes a class `UDCounter` or "Up - Down Counter" which is a multi-modal bidirectional counter object.
"""
Up or Down (Bimodal) Counting Object
Author - Yatharth Bhasin (github → yatharthb97)
Describes a class `UDCounter` or "Up - Down Counter" which is a multi-modal bidirectional counter object.
The design of this class was inspired by Hardware counters/timers.
`isr` : interrupt service routine
"""
@yatharthb97
yatharthb97 / PITController.hpp
Created September 28, 2021 18:09
First Commit
/**
Author : *Yatharth Bhasin* (Github → yatharthb97)
License: *MIT open-source license* (https://opensource.org/licenses/mit-license.php)
This piece of software was released on GistHub :
@brief This file describes a class to control the `Periodic Interrupt Timer (PIT)` of a **PJRC Teensy 4.1** microcontroller.
\par (Documentation)
{
@yatharthb97
yatharthb97 / pit_lifetime_timer.hpp
Created September 28, 2021 18:15
Interface for using the "Life Time Timer" functionality of the Periodic Interrupt Timer on Teensy 4.1 microcontrollers.
#pragma once
#include <imxrt.h>
#include <cstint>
/** @brief Interface for using the "Life Time Timer" functionality of the Periodic Interrut Timer on Teensy 4.1 microcontrollers. The module uses Channel 0 and 1 of the 4 PIT channels.
* \attention The module has no checks on the use of CH0 and CH1 by external drivers, however, the interface enforces a singleton template and can only be constructed once.
* \attention The module does not set the clock frequency and uses either the default or the one set globally (as is the only use case) by external drivers outside its scope.
* \attention Source : Code adapted from IMXRT Manual Page 2977.
* \todo Resolve Singleton template - constexpr static issue. */
class PIT_LifetimeTimer
@yatharthb97
yatharthb97 / README.md
Last active March 11, 2022 06:43
PyQtGraphStack is a wrapper around the pyqtgraph API for rapid prototyping, focused around creation of multiple plots with multiple curves.
@yatharthb97
yatharthb97 / config_serial_port.c
Last active November 13, 2021 06:57
Contains code to configure any terminal type to a simple serial port on Linux systems.
/** \brief Contains code to configure any terminal type to a simple serial port on Linux systems.
* \author Yatharth Bhasin (yatharth1997@gmail.com)
* \attribution The code has directly been copied from: https://blog.mbedded.ninja/programming/operating-systems/linux/linux-serial-ports-using-c-cpp/ */
// C library headers
#include <stdio.h>
#include <string.h>
@yatharthb97
yatharthb97 / data_store.py
Last active March 11, 2022 08:00
DataStore is utility object that can be used to effectively create and manage a directory of files for any generic use case.
"""
Author : *Yatharth Bhasin* (Github → yatharthb97)
License: *MIT open-source license* (https://opensource.org/licenses/mit-license.php)
This piece of software was released on GistHub : https://gist.github.com/yatharthb97/a0b3a2665f065d982e7b0e2b2dd274b0
→ Use `git mv <oldname> <newname>` to properly change the repo folder name to something relevant.
DataStore is utility object that can be used to effectively create and manage a
directory of files for any generic use case.
@yatharthb97
yatharthb97 / macro_modes.hpp
Created December 2, 2021 13:15
Macro mode manager is a simple utility that helps in managing MACROS in C++, especially feature macros.
/* M A C R O M O D E S
• Macro Mode Manager → Modes
Describes a namespace `Modes`. It is declared as a namespace and not a class because Macros are global and cannot be scoped.
High level Macro Info Manager. Provides an interface to Declare, Check, and Raise Constraint Conflicts for better Program/Feature Management.
This approach also helps in debugging as it catches Macro errors in as a compiler error.
---
Author : Yatharth Bhasin
Licence : MIT Licence (Text → https://opensource.org/licenses/MIT)
---
*/
@yatharthb97
yatharthb97 / circular_buffer.hpp
Created January 7, 2022 19:16
Implementation of simple Circular Buffer with bounded index random accessor.
#pragma once
#include <sstream>
/* CIRCULAR BUFFER
Implementation of simple Circular Buffer with bounded index random accessor.
---
Author : Yatharth Bhasin
Licence : MIT Licence (Text → https://opensource.org/licenses/MIT)
---
*/
@yatharthb97
yatharthb97 / metadata.py
Last active April 12, 2023 23:05
Object that is specialized to collect, store, and export metadata for any generic application.
#!/usr/bin/env python3
#!/usr/bin/env python
"""
Metadata aggregator
Object that is specialized to collect, store, and export metadata for any generic application.
Author : *Yatharth Bhasin* (Github → yatharthb97)
License: *MIT open-source license* (https://opensource.org/licenses/mit-license.php)
This piece of software was released on GistHub : TODO
@yatharthb97
yatharthb97 / configr.py
Created February 26, 2022 11:08
Tool to import, verify, and generate config files {json and yaml} for python.
# -*- coding: utf-8 -*-
#!/usr/bin/env python3
#!/usr/bin/env python
"""
Configuration file manager for yaml and json.
Tool to import, verify, and generate config files {json and yaml} for python.
Author : *Yatharth Bhasin* (Github → yatharthb97)