Restructure files

This commit is contained in:
Lexi / Zoe 2021-04-03 17:40:17 +02:00
parent 8c7b62dc2d
commit b5f86d5972
Signed by: binaryDiv
GPG key ID: F8D4956E224DA232
13 changed files with 29 additions and 20 deletions

View file

@ -1,44 +0,0 @@
/**
* BitIO.h
* @author Andi Dittrich <http://andidittrich.de>
* @version 1.0
* @license MIT Style X11 License
*/
#include <inttypes.h>
#include <stdbool.h>
#ifndef BITIO_H_
#define BITIO_H_
// set bit
static inline void BIT_SET(volatile uint8_t *target, uint8_t bit) __attribute__((always_inline));
static inline void BIT_SET(volatile uint8_t *target, uint8_t bit){
*target |= (1<<bit);
};
// set clear
static inline void BIT_CLEAR(volatile uint8_t *target, uint8_t bit) __attribute__((always_inline));
static inline void BIT_CLEAR(volatile uint8_t *target, uint8_t bit){
*target &= ~(1<<bit);
};
// bit toogle
static inline void BIT_TOGGLE(volatile uint8_t *target, uint8_t bit) __attribute__((always_inline));
static inline void BIT_TOGGLE(volatile uint8_t *target, uint8_t bit){
*target ^= (1<<bit);
};
// set bit by boolean
static inline void BIT_BOOL_SET(volatile uint8_t *target, uint8_t bit, bool enable) __attribute__((always_inline));
static inline void BIT_BOOL_SET(volatile uint8_t *target, uint8_t bit, bool enable){
if (enable){
BIT_SET(target, bit);
}else{
BIT_CLEAR(target, bit);
}
};
#endif /* BITIO_H_ */