tesseract  5.0.0-alpha-619-ge9db
BITS16 Class Reference

#include <bits16.h>

Public Member Functions

 BITS16 ()=default
 
 BITS16 (uint16_t init)
 
void turn_on_bit (uint8_t bit_num)
 
void turn_off_bit (uint8_t bit_num)
 
void set_bit (uint8_t bit_num, bool value)
 
bool bit (uint8_t bit_num) const
 

Public Attributes

uint16_t val = 0
 

Detailed Description

Definition at line 24 of file bits16.h.

Constructor & Destructor Documentation

◆ BITS16() [1/2]

BITS16::BITS16 ( )
default

◆ BITS16() [2/2]

BITS16::BITS16 ( uint16_t  init)
inline

Definition at line 44 of file bits16.h.

44 { // value to flip to

Member Function Documentation

◆ bit()

bool BITS16::bit ( uint8_t  bit_num) const
inline

Definition at line 65 of file bits16.h.

◆ set_bit()

void BITS16::set_bit ( uint8_t  bit_num,
bool  value 
)
inline

Definition at line 56 of file bits16.h.

◆ turn_off_bit()

void BITS16::turn_off_bit ( uint8_t  bit_num)
inline

Definition at line 51 of file bits16.h.

52  { // bit to access
53  return (val >> bit_num) & 01;
54  }

◆ turn_on_bit()

void BITS16::turn_on_bit ( uint8_t  bit_num)
inline

Definition at line 46 of file bits16.h.

52  { // bit to access

Member Data Documentation

◆ val

uint16_t BITS16::val = 0

Definition at line 41 of file bits16.h.


The documentation for this class was generated from the following file:
BITS16::val
uint16_t val
Definition: bits16.h:41