![]() |
128x64 EasyC OLED Display 1.0.0
This is a library for Soldered OLED Display
|
The class which defines a device register (a location to read/write data from) More...
#include <Adafruit_BusIO_Register.h>
Public Member Functions | |
Adafruit_BusIO_Register (Adafruit_I2CDevice *i2cdevice, uint16_t reg_addr, uint8_t width=1, uint8_t byteorder=LSBFIRST, uint8_t address_width=1) | |
Create a register we access over an I2C Device (which defines the bus and address) | |
Adafruit_BusIO_Register (Adafruit_SPIDevice *spidevice, uint16_t reg_addr, Adafruit_BusIO_SPIRegType type, uint8_t width=1, uint8_t byteorder=LSBFIRST, uint8_t address_width=1) | |
Create a register we access over an SPI Device (which defines the bus and CS pin) | |
Adafruit_BusIO_Register (Adafruit_I2CDevice *i2cdevice, Adafruit_SPIDevice *spidevice, Adafruit_BusIO_SPIRegType type, uint16_t reg_addr, uint8_t width=1, uint8_t byteorder=LSBFIRST, uint8_t address_width=1) | |
Create a register we access over an I2C or SPI Device. This is a handy function because we can pass in NULL for the unused interface, allowing libraries to mass-define all the registers. | |
bool | read (uint8_t *buffer, uint8_t len) |
Read a buffer of data from the register location. | |
bool | read (uint8_t *value) |
Read 1 byte of data from the register location. | |
bool | read (uint16_t *value) |
Read 2 bytes of data from the register location. | |
uint32_t | read (void) |
Read data from the register location. This does not do any error checking! | |
uint32_t | readCached (void) |
Read cached data from last time we wrote to this register. | |
bool | write (uint8_t *buffer, uint8_t len) |
Write a buffer of data to the register location. | |
bool | write (uint32_t value, uint8_t numbytes=0) |
Write up to 4 bytes of data to the register location. | |
uint8_t | width (void) |
The width of the register data, helpful for doing calculations. | |
void | setWidth (uint8_t width) |
Set the default width of data. | |
void | setAddress (uint16_t address) |
Set register address. | |
void | setAddressWidth (uint16_t address_width) |
Set the width of register address. | |
void | print (Stream *s=&Serial) |
Pretty printer for this register. | |
void | println (Stream *s=&Serial) |
Pretty printer for this register. | |
Private Attributes | |
Adafruit_I2CDevice * | _i2cdevice |
Adafruit_SPIDevice * | _spidevice |
Adafruit_BusIO_SPIRegType | _spiregtype |
uint16_t | _address |
uint8_t | _width |
uint8_t | _addrwidth |
uint8_t | _byteorder |
uint8_t | _buffer [4] |
uint32_t | _cached = 0 |
The class which defines a device register (a location to read/write data from)
Adafruit_BusIO_Register::Adafruit_BusIO_Register | ( | Adafruit_I2CDevice * | i2cdevice, |
uint16_t | reg_addr, | ||
uint8_t | width = 1, | ||
uint8_t | byteorder = LSBFIRST, | ||
uint8_t | address_width = 1 ) |
Create a register we access over an I2C Device (which defines the bus and address)
i2cdevice | The I2CDevice to use for underlying I2C access |
reg_addr | The address pointer value for the I2C/SMBus register, can be 8 or 16 bits |
width | The width of the register data itself, defaults to 1 byte |
byteorder | The byte order of the register (used when width is > 1), defaults to LSBFIRST |
address_width | The width of the register address itself, defaults to 1 byte |
Adafruit_BusIO_Register::Adafruit_BusIO_Register | ( | Adafruit_SPIDevice * | spidevice, |
uint16_t | reg_addr, | ||
Adafruit_BusIO_SPIRegType | type, | ||
uint8_t | width = 1, | ||
uint8_t | byteorder = LSBFIRST, | ||
uint8_t | address_width = 1 ) |
Create a register we access over an SPI Device (which defines the bus and CS pin)
spidevice | The SPIDevice to use for underlying SPI access |
reg_addr | The address pointer value for the SPI register, can be 8 or 16 bits |
type | The method we use to read/write data to SPI (which is not as well defined as I2C) |
width | The width of the register data itself, defaults to 1 byte |
byteorder | The byte order of the register (used when width is > 1), defaults to LSBFIRST |
address_width | The width of the register address itself, defaults to 1 byte |
Adafruit_BusIO_Register::Adafruit_BusIO_Register | ( | Adafruit_I2CDevice * | i2cdevice, |
Adafruit_SPIDevice * | spidevice, | ||
Adafruit_BusIO_SPIRegType | type, | ||
uint16_t | reg_addr, | ||
uint8_t | width = 1, | ||
uint8_t | byteorder = LSBFIRST, | ||
uint8_t | address_width = 1 ) |
Create a register we access over an I2C or SPI Device. This is a handy function because we can pass in NULL for the unused interface, allowing libraries to mass-define all the registers.
i2cdevice | The I2CDevice to use for underlying I2C access, if NULL we use SPI |
spidevice | The SPIDevice to use for underlying SPI access, if NULL we use I2C |
reg_addr | The address pointer value for the I2C/SMBus/SPI register, can be 8 or 16 bits |
type | The method we use to read/write data to SPI (which is not as well defined as I2C) |
width | The width of the register data itself, defaults to 1 byte |
byteorder | The byte order of the register (used when width is > 1), defaults to LSBFIRST |
address_width | The width of the register address itself, defaults to 1 byte |
void Adafruit_BusIO_Register::print | ( | Stream * | s = &Serial | ) |
Pretty printer for this register.
s | The Stream to print to, defaults to &Serial |
void Adafruit_BusIO_Register::println | ( | Stream * | s = &Serial | ) |
Pretty printer for this register.
s | The Stream to print to, defaults to &Serial |
bool Adafruit_BusIO_Register::read | ( | uint16_t * | value | ) |
Read 2 bytes of data from the register location.
value | Pointer to uint16_t variable to read into |
bool Adafruit_BusIO_Register::read | ( | uint8_t * | buffer, |
uint8_t | len ) |
Read a buffer of data from the register location.
buffer | Pointer to data to read into |
len | Number of bytes to read |
bool Adafruit_BusIO_Register::read | ( | uint8_t * | value | ) |
Read 1 byte of data from the register location.
value | Pointer to uint8_t variable to read into |
uint32_t Adafruit_BusIO_Register::read | ( | void | ) |
Read data from the register location. This does not do any error checking!
uint32_t Adafruit_BusIO_Register::readCached | ( | void | ) |
Read cached data from last time we wrote to this register.
void Adafruit_BusIO_Register::setAddress | ( | uint16_t | address | ) |
Set register address.
address | the address from register |
void Adafruit_BusIO_Register::setAddressWidth | ( | uint16_t | address_width | ) |
Set the width of register address.
address_width | the width for register address |
void Adafruit_BusIO_Register::setWidth | ( | uint8_t | width | ) |
Set the default width of data.
width | the default width of data read from register |
uint8_t Adafruit_BusIO_Register::width | ( | void | ) |
The width of the register data, helpful for doing calculations.
bool Adafruit_BusIO_Register::write | ( | uint32_t | value, |
uint8_t | numbytes = 0 ) |
Write up to 4 bytes of data to the register location.
value | Data to write |
numbytes | How many bytes from 'value' to write |
bool Adafruit_BusIO_Register::write | ( | uint8_t * | buffer, |
uint8_t | len ) |
Write a buffer of data to the register location.
buffer | Pointer to data to write |
len | Number of bytes to write |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |