Skip to content

MiP_EEPROM

github-actions[bot] edited this page Aug 10, 2026 · 9 revisions

Class MiP_EEPROM

Manages access to MiP's EEPROM for reading and writing.

Public Members & Functions

MIP_CMD_SET_USER_DATA

Signature: constexpr uint8_t MIP_CMD_SET_USER_DATA

MiP protocol command bytes used by the EEPROM subsystem.

Details:

These values are placed in the first byte of requests sent to the MiP (and appear in the corresponding responses). See the official MiP BLE Protocol for the complete list.


MIP_CMD_GET_USER_DATA

Signature: constexpr uint8_t MIP_CMD_GET_USER_DATA


BASE_EEPROM_ADDRESS

Signature: constexpr uint8_t BASE_EEPROM_ADDRESS

The EEPROM boundaries. Attempts to write outside these addresses will fail.


LAST_EEPROM_ADDRESS

Signature: constexpr uint8_t LAST_EEPROM_ADDRESS


MiP_EEPROM

Signature: MiP_EEPROM(MiP &mip)

Constructs the EEPROM manager.

Parameters:

Parameter Description
mip A reference to the main MiP object to access core services.

read

Signature: uint8_t read(uint8_t addressOffset)

Reads a byte from the MiP's user EEPROM area.

Details:

Performs a verified read with retries on communication errors.

Parameters:

Parameter Description
addressOffset Offset from BASE_EEPROM_ADDRESS (0-15).

Returns: The stored byte value, or 0 on error.


write

Signature: void write(uint8_t addressOffset, uint8_t userData)

Writes a byte to the MiP's user EEPROM area and verifies it.

Details:

This function performs a verified write: it sends the data, reads it back, and retries (up to MIP_MAX_RETRIES) if the value doesn't match or an error occurs.

Parameters:

Parameter Description
addressOffset Offset from BASE_EEPROM_ADDRESS (0-15).
userData Byte value to store (0-255).

Clone this wiki locally