ENTS-tock
Environmental NeTworked Sensor firmware on Tock OS
Loading...
Searching...
No Matches
mb85rc1mt.c File Reference

FRAM driver for MB85RC1MT using TockOS I2C master syscalls. More...

#include "mb85rc1mt.h"
#include <libtock/peripherals/i2c_master.h>
#include <string.h>
#include "fram.h"

Go to the source code of this file.

Data Structures

struct  mb85rc1mt_address
 Internal representation of the MB85RC1MT I2C address. More...
 

Functions

fram_status mb85rc1mt_wakeup (mb85rc1mt_address addr)
 Put the chip into sleep mode.
 
fram_status mb85rc1mt_sleep (mb85rc1mt_address addr)
 Wake up device from sleep.
 
fram_status mb85rc1mt_write (fram_addr addr, const uint8_t *data, size_t len)
 Write bytes to FRAM at the given address.
 
fram_status mb85rc1mt_read (fram_addr addr, size_t len, uint8_t *data)
 Read bytes from FRAM at the given address.
 
fram_addr mb85rc1mt_size (void)
 Get the total size of FRAM in bytes.
 

Detailed Description

FRAM driver for MB85RC1MT using TockOS I2C master syscalls.

Ported from stm32/lib/storage/src/mb85rc1mt.c. Replaces HAL_I2C_Mem_Write/Read with libtock-c i2c_master_write_sync and i2c_master_write_read_sync.

The MB85RC1MT is a 128KB (1 Mbit) FRAM with I2C interface. Memory is accessed via a 17-bit address:

  • Bit 16 is encoded in the device address (A0 bit position)
  • Bits 15:0 are sent as a 16-bit memory address
Author
Pritish Mahato
Date
2026-02-25

Copyright (c) 2026 jLab, UCSC

Definition in file mb85rc1mt.c.

Function Documentation

◆ mb85rc1mt_sleep()

fram_status mb85rc1mt_sleep ( mb85rc1mt_address  addr)

Wake up device from sleep.

Returns

Definition at line 239 of file mb85rc1mt.c.

References FRAM_OK.

Referenced by mb85rc1mt_read(), and mb85rc1mt_write().

◆ mb85rc1mt_wakeup()

fram_status mb85rc1mt_wakeup ( mb85rc1mt_address  addr)

Put the chip into sleep mode.

Definition at line 231 of file mb85rc1mt.c.

References FRAM_OK.

Referenced by mb85rc1mt_read(), and mb85rc1mt_write().