distortos
v0.7.0
object-oriented C++ RTOS for microcontrollers
|
Typedefs | |
using | CommandWithAddressBuffer = std::array< uint8_t, 4 > |
buffer for command and address More... | |
Functions | |
SpiMasterTransfer | getCommandWithAddress (const size_t capacity, const uint8_t command, const uint32_t address, CommandWithAddressBuffer &buffer) |
Combines command with address into a SpiMasterTransfer. More... | |
Variables | |
constexpr uint8_t | rdsrCommand {0x5} |
RDSR (read status register) command. More... | |
constexpr uint8_t | readCommand {0x3} |
READ command. More... | |
constexpr uint8_t | wrenCommand {0x6} |
WREN (write enable) command. More... | |
constexpr uint8_t | writeCommand {0x2} |
WRITE command. More... | |
constexpr uint8_t | statusRegisterWip {1 << 0} |
mask of WIP (write in progress) bit in status register More... | |
using distortos::devices::anonymous_namespace{SpiEeprom.cpp}::CommandWithAddressBuffer = typedef std::array<uint8_t, 4> |
buffer for command and address
SpiMasterTransfer distortos::devices::anonymous_namespace{SpiEeprom.cpp}::getCommandWithAddress | ( | const size_t | capacity, |
const uint8_t | command, | ||
const uint32_t | address, | ||
CommandWithAddressBuffer & | buffer | ||
) |
Combines command with address into a SpiMasterTransfer.
The address for READ and WRITE commands is encoded into variable number of bytes, depending on capacity of EEPROM chip:
The address is always big-endian.
[in] | capacity | is the capacity of EEPROM, bytes |
[in] | command | is the command that will be combined with address into buffer, {readCommand, writeCommand} |
[in] | address | is the address that will be combined with command into buffer |
[out] | buffer | is a reference to buffer into which command and address will be combined |
constexpr uint8_t distortos::devices::anonymous_namespace{SpiEeprom.cpp}::rdsrCommand {0x5} |
RDSR (read status register) command.
constexpr uint8_t distortos::devices::anonymous_namespace{SpiEeprom.cpp}::readCommand {0x3} |
READ command.
constexpr uint8_t distortos::devices::anonymous_namespace{SpiEeprom.cpp}::statusRegisterWip {1 << 0} |
mask of WIP (write in progress) bit in status register
constexpr uint8_t distortos::devices::anonymous_namespace{SpiEeprom.cpp}::wrenCommand {0x6} |
WREN (write enable) command.
constexpr uint8_t distortos::devices::anonymous_namespace{SpiEeprom.cpp}::writeCommand {0x2} |
WRITE command.