F439_CPP_TX-RX_LoRa_Project

Loading...
Searching...
No Matches
Macros | Functions
ada1897_mb85rs64b.h File Reference
Firmware Architecture » Persistence Layer

MB85RS64B SPI FRAM public interface. More...

`#include "main.h"`
`#include "stdbool.h"`
Include dependency graph for ada1897_mb85rs64b.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Macros
#define | FRAM_CS_ENABLE HAL_GPIO_WritePin(SPI1_FRAM_CS_GPIO_Port, SPI1_FRAM_CS_Pin, 0);
| Assert the FRAM chip-select line.
#define | FRAM_CS_DISABLE HAL_GPIO_WritePin(SPI1_FRAM_CS_GPIO_Port, SPI1_FRAM_CS_Pin, 1);
| Deassert the FRAM chip-select line.

## Functions
void | FRAM_init (SPI_HandleTypeDef *hspix)
| Initialize the MB85RS64B driver instance.
bool | FRAM_write (uint16_t address, uint8_t byte)
| Write a single byte to FRAM.
bool | FRAM_read (uint16_t address, uint8_t *byte)
| Read a single byte from FRAM.
bool | FRAM_WriteBytes (uint16_t address, uint8_t *pData, uint16_t size)
| Write a contiguous byte range to FRAM.
bool | FRAM_ReadBytes (uint16_t address, uint8_t *pData, uint16_t size)
| Read a contiguous byte range from FRAM.

## Detailed Description

MB85RS64B SPI FRAM public interface.

## Macro Definition Documentation

## ◆ FRAM_CS_DISABLE

#define FRAM_CS_DISABLE HAL_GPIO_WritePin(SPI1_FRAM_CS_GPIO_Port, SPI1_FRAM_CS_Pin, 1);

Deassert the FRAM chip-select line.

## ◆ FRAM_CS_ENABLE

#define FRAM_CS_ENABLE HAL_GPIO_WritePin(SPI1_FRAM_CS_GPIO_Port, SPI1_FRAM_CS_Pin, 0);

Assert the FRAM chip-select line.

## Function Documentation

## ◆ FRAM_init()

void FRAM_init | ( | SPI_HandleTypeDef * | hspix | ) |

Initialize the MB85RS64B driver instance.

Parameters

  hspix | SPI handle used for FRAM transactions.

Initialize the MB85RS64B driver instance.

## ◆ FRAM_read()

bool FRAM_read | ( | uint16_t | address,
|  | uint8_t * | byte )

Read a single byte from FRAM.

Parameters

  address | FRAM byte address.
  byte | Output pointer for the returned byte.

Returns
  true if the transaction succeeded, otherwise false.

## ◆ FRAM_ReadBytes()

bool FRAM_ReadBytes | ( | uint16_t | address,
|  | uint8_t * | pData,
|  | uint16_t | size )

Read a contiguous byte range from FRAM.

Parameters

  address | Starting FRAM address.
  pData | Pointer to the destination buffer.
  size | Number of bytes to read.

Returns
  true if the transaction succeeded, otherwise false.

Read a contiguous byte range from FRAM.

## ◆ FRAM_write()

bool FRAM_write | ( | uint16_t | address,
|  | uint8_t | byte )

Write a single byte to FRAM.

Parameters

  address | FRAM byte address.
  byte | Data byte to write.

Returns
  true if the transaction succeeded, otherwise false.

## ◆ FRAM_WriteBytes()

bool FRAM_WriteBytes | ( | uint16_t | address,
|  | uint8_t * | pData,
|  | uint16_t | size )

Write a contiguous byte range to FRAM.

Parameters

  address | Starting FRAM address.
  pData | Pointer to the source buffer.
  size | Number of bytes to write.

Returns
  true if the transaction succeeded, otherwise false.

Write a contiguous byte range to FRAM.