AT25040B Driver 0.1.0
API reference
Loading...
Searching...
No Matches
Typedefs | Functions | Variables
at25040b::reg Namespace Reference

Opcodes and bit masks of the chip, as constexpr values. More...

Typedefs

using StatusBp = detail::Field< uint8_t, kStatusBpShift, 2U >
 BP1:BP0 as a field of the status byte (Table 6-4): two bits from bit 2.
 

Functions

constexpr bool IsIdleStatus (uint8_t status) noexcept
 True for a status byte an idle chip can return: bits 7 to 4 clear and RDY clear (Table 6-3). A busy chip returns kStatusBusyByte instead; anything else is not a status.
 

Variables

constexpr uint8_t kWren = 0x06
 WREN: set the write enable latch.
 
constexpr uint8_t kWrdi = 0x04
 WRDI: reset the write enable latch.
 
constexpr uint8_t kRdsr = 0x05
 RDSR: read the status register.
 
constexpr uint8_t kWrsr = 0x01
 WRSR: write the status register (BP1, BP0).
 
constexpr uint8_t kRead = 0x03
 READ: read data from the array.
 
constexpr uint8_t kWrite = 0x02
 WRITE: write data to the array.
 
constexpr uint8_t kOpcodeA8 = 0x08
 Bit of a READ or WRITE opcode that carries address bit A8 (AT25040B only, Table 6-1 note 1).
 
constexpr uint16_t kAddressA8 = 0x100
 Address bit that goes into the opcode instead of the address byte.
 
constexpr uint16_t kAddressLowMask = 0xFF
 Address bits A7 to A0: the address byte of READ and WRITE (Figures 7-6 and 7-7).
 
constexpr uint16_t kAddressMax = 0x1FF
 The highest address any part of the family decodes (A8 to A0, AT25040B).
 
constexpr uint8_t kStatusRdy = 0x01
 RDY: 1 while a write cycle runs.
 
constexpr uint8_t kStatusWen = 0x02
 WEN: 1 when the write enable latch is set.
 
constexpr uint8_t kStatusBp0 = 0x04
 BP0: block protection, low bit.
 
constexpr uint8_t kStatusBp1 = 0x08
 BP1: block protection, high bit.
 
constexpr uint8_t kStatusBpMask = 0x0C
 BP1 and BP0 together.
 
constexpr uint8_t kStatusBpShift = 2
 Position of BP0.
 
constexpr uint8_t kStatusUnused = 0xF0
 Bits 7 to 4: 0 when no write cycle runs.
 
constexpr uint8_t kStatusBusyByte = 0xFF
 Every bit reads 1 during a write cycle.
 

Detailed Description

Opcodes and bit masks of the chip, as constexpr values.

Function Documentation

◆ IsIdleStatus()

constexpr bool at25040b::reg::IsIdleStatus ( uint8_t  status)
constexprnoexcept

True for a status byte an idle chip can return: bits 7 to 4 clear and RDY clear (Table 6-3). A busy chip returns kStatusBusyByte instead; anything else is not a status.

Parameters
statusThe byte RDSR returned.
Returns
Whether it is an idle status.