128x64 EasyC OLED Display 1.0.0
This is a library for Soldered OLED Display
Loading...
Searching...
No Matches
Adafruit_BusIO_RegisterBits Class Reference

The class which defines a slice of bits from within a device register (a location to read/write data from) More...

#include <Adafruit_BusIO_Register.h>

Public Member Functions

 Adafruit_BusIO_RegisterBits (Adafruit_BusIO_Register *reg, uint8_t bits, uint8_t shift)
 Create a slice of the register that we can address without touching other bits.
 
bool write (uint32_t value)
 Write 4 bytes of data to the register.
 
uint32_t read (void)
 Read 4 bytes of data from the register.
 

Private Attributes

Adafruit_BusIO_Register_register
 
uint8_t _bits
 
uint8_t _shift
 

Detailed Description

The class which defines a slice of bits from within a device register (a location to read/write data from)

Constructor & Destructor Documentation

◆ Adafruit_BusIO_RegisterBits()

Adafruit_BusIO_RegisterBits::Adafruit_BusIO_RegisterBits ( Adafruit_BusIO_Register * reg,
uint8_t bits,
uint8_t shift )

Create a slice of the register that we can address without touching other bits.

Parameters
regThe Adafruit_BusIO_Register which defines the bus/register
bitsThe number of bits wide we are slicing
shiftThe number of bits that our bit-slice is shifted from LSB

Member Function Documentation

◆ read()

uint32_t Adafruit_BusIO_RegisterBits::read ( void )

Read 4 bytes of data from the register.

Returns
data The 4 bytes to read

◆ write()

bool Adafruit_BusIO_RegisterBits::write ( uint32_t data)

Write 4 bytes of data to the register.

Parameters
dataThe 4 bytes to write
Returns
True on successful write (only really useful for I2C as SPI is uncheckable)

Member Data Documentation

◆ _bits

uint8_t Adafruit_BusIO_RegisterBits::_bits
private

◆ _register

Adafruit_BusIO_Register* Adafruit_BusIO_RegisterBits::_register
private

◆ _shift

uint8_t Adafruit_BusIO_RegisterBits::_shift
private

The documentation for this class was generated from the following files: