HF-MAX22200 Driver 0.1.0-dev
HF-MAX22200 C++ Driver
Loading...
Searching...
No Matches
max22200::CommandReg Namespace Reference

Command Register bit field definitions and helper functions. More...

Functions

constexpr uint8_t build (uint8_t bank, bool write, bool mode8=false)
 

Variables

constexpr uint8_t RBW_POS = 7
 Read/Write bit position.
 
constexpr uint8_t RBW_READ = 0x00
 Read operation (bit 7 = 0)
 
constexpr uint8_t RBW_WRITE = 0x80
 Write operation (bit 7 = 1)
 
constexpr uint8_t A_BNK_POS = 1
 Bank address bit position (bits 4:1)
 
constexpr uint8_t A_BNK_MASK = 0x1E
 Bank address mask (bits 4:1)
 
constexpr uint8_t MODE_8BIT = 0x01
 8-bit MSB only access (bit 0 = 1)
 
constexpr uint8_t MODE_32BIT = 0x00
 32-bit full access (bit 0 = 0)
 

Detailed Description

Command Register bit field definitions and helper functions.

The Command Register is 8-bit, write-only, and must be written with CMD pin HIGH before any register access. It determines the type and format of the follow-on SPI transfer.

Bit Layout

Bit: 7 6 5 4 3 2 1 0
Definition max22200.hpp:133

Protocol Sequence

  1. Set CMD pin HIGH
  2. Write Command Register (1 byte transfer)
    • Device responds with STATUS[7:0] on SDO (Fault Flag Byte)
    • Check for communication error: STATUS[7:0] = 0x04 (COMER flag)
  3. Set CMD pin LOW
  4. Perform data transfer (1 byte for 8-bit mode, 4 bytes for 32-bit mode)
Note
Once the Command Register is written, all subsequent SPI transfers remain of the same type (8-bit or 32-bit) until the Command Register is rewritten.
The CMD pin must be held HIGH during the rising edge of CSB (chip select).

Function Documentation

◆ build()

constexpr uint8_t max22200::CommandReg::build ( uint8_t bank,
bool write,
bool mode8 = false )
constexpr

Variable Documentation

◆ A_BNK_MASK

constexpr uint8_t max22200::CommandReg::A_BNK_MASK = 0x1E
constexpr

◆ A_BNK_POS

constexpr uint8_t max22200::CommandReg::A_BNK_POS = 1
constexpr

◆ MODE_32BIT

constexpr uint8_t max22200::CommandReg::MODE_32BIT = 0x00
constexpr

◆ MODE_8BIT

constexpr uint8_t max22200::CommandReg::MODE_8BIT = 0x01
constexpr

◆ RBW_POS

constexpr uint8_t max22200::CommandReg::RBW_POS = 7
constexpr

◆ RBW_READ

constexpr uint8_t max22200::CommandReg::RBW_READ = 0x00
constexpr

◆ RBW_WRITE

constexpr uint8_t max22200::CommandReg::RBW_WRITE = 0x80
constexpr