fram6 2.0.0.0
fram6.h File Reference

This file contains API for FRAM 6 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"
#include "spi_specifics.h"

Go to the source code of this file.

Data Structures

struct  fram6_t
 FRAM 6 Click context object. More...
 
struct  fram6_cfg_t
 FRAM 6 Click configuration object. More...
 

Macros

#define FRAM6_OPCODE_WREN   0x06
 FRAM 6 Opcode Commands list.
 
#define FRAM6_OPCODE_WRDI   0x04
 
#define FRAM6_OPCODE_RDSR   0x05
 
#define FRAM6_OPCODE_WRSR   0x01
 
#define FRAM6_OPCODE_READ   0x03
 
#define FRAM6_OPCODE_FSTRD   0x0B
 
#define FRAM6_OPCODE_WRITE   0x02
 
#define FRAM6_OPCODE_SLEEP   0xB9
 
#define FRAM6_OPCODE_RDID   0x9F
 
#define FRAM6_WEL_BIT_MASK   0x02
 FRAM 6 status register bits mask.
 
#define FRAM6_BLOCK_PROTECT_BITS_MASK   0x0C
 
#define FRAM6_BLOCK_PROTECT_NONE   0x00
 
#define FRAM6_BLOCK_PROTECT_UPPER_QUARTER   0x04
 
#define FRAM6_BLOCK_PROTECT_UPPER_HALF   0x08
 
#define FRAM6_BLOCK_PROTECT_ALL   0x0C
 
#define FRAM6_WPEN_BIT_MASK   0x80
 
#define FRAM6_MIN_ADDRESS   0x00000
 FRAM 6 memory address range.
 
#define FRAM6_MAX_ADDRESS   0x3FFFF
 
#define FRAM6_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define FRAM6_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define FRAM6_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  fram6_return_value_t { FRAM6_OK = 0 , FRAM6_ERROR = -1 }
 FRAM 6 Click return value data. More...
 

Functions

void fram6_cfg_setup (fram6_cfg_t *cfg)
 FRAM 6 configuration object setup function.
 
err_t fram6_init (fram6_t *ctx, fram6_cfg_t *cfg)
 FRAM 6 initialization function.
 
err_t fram6_default_cfg (fram6_t *ctx)
 FRAM 6 default configuration function.
 
err_t fram6_write_opcode (fram6_t *ctx, uint8_t opcode)
 FRAM 6 write opcode function.
 
err_t fram6_read_opcode (fram6_t *ctx, uint8_t opcode, uint8_t *data_out, uint8_t len)
 FRAM 6 read opcode function.
 
err_t fram6_check_communication (fram6_t *ctx)
 FRAM 6 check communication function.
 
void fram6_set_wp_pin (fram6_t *ctx, uint8_t state)
 FRAM 6 set WP pin function.
 
void fram6_set_hld_pin (fram6_t *ctx, uint8_t state)
 FRAM 6 set HLD pin function.
 
err_t fram6_enable_write (fram6_t *ctx)
 FRAM 6 enable write function.
 
err_t fram6_disable_write (fram6_t *ctx)
 FRAM 6 disable write function.
 
err_t fram6_set_block_protection (fram6_t *ctx, uint8_t block_protect)
 FRAM 6 set block protection function.
 
err_t fram6_write_status (fram6_t *ctx, uint8_t status)
 FRAM 6 write status function.
 
err_t fram6_read_status (fram6_t *ctx, uint8_t *status)
 FRAM 6 read status function.
 
err_t fram6_enter_sleep_mode (fram6_t *ctx)
 FRAM 6 enter sleep mode function.
 
void fram6_wakeup_from_sleep (fram6_t *ctx)
 FRAM 6 wake up from sleep function.
 
err_t fram6_memory_write (fram6_t *ctx, uint32_t address, uint8_t *data_in, uint16_t len)
 FRAM 6 memory write function.
 
err_t fram6_memory_read (fram6_t *ctx, uint32_t address, uint8_t *data_out, uint16_t len)
 FRAM 6 memory read function.
 
err_t fram6_memory_read_fast (fram6_t *ctx, uint32_t address, uint8_t *data_out, uint16_t len)
 FRAM 6 memory read fast function.
 

Detailed Description

This file contains API for FRAM 6 Click Driver.

Enumeration Type Documentation

◆ fram6_return_value_t

FRAM 6 Click return value data.

Predefined enum values for driver return values.

Enumerator
FRAM6_OK 
FRAM6_ERROR