mram 2.0.0.0
|
Functions | |
void | mram_cfg_setup (mram_cfg_t *cfg) |
Config Object Initialization function. | |
err_t | mram_init (mram_t *ctx, mram_cfg_t *cfg) |
Initialization function. | |
void | mram_default_cfg (mram_t *ctx) |
Click Default Configuration function. | |
void | mram_generic_transfer (mram_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len) |
Generic transfer function. | |
uint8_t | mram_read_status_reg (mram_t *ctx) |
Read status reg. | |
uint8_t | mram_check_status_bit (mram_t *ctx, uint8_t status_bit) |
Check status bit. | |
uint8_t | mram_enable_write (mram_t *ctx) |
Enable write. | |
uint8_t | mram_disable_write (mram_t *ctx) |
Disable write. | |
void | mram_write_status_reg (mram_t *ctx, uint8_t transfer_data) |
Write status reg. | |
void | mram_read_data_bytes (mram_t *ctx, const uint16_t address, uint8_t *buffer, const uint16_t n_bytes) |
Read n byte data. | |
void | mram_write_data_bytes (mram_t *ctx, const uint16_t address, uint8_t *buffer, const uint16_t n_bytes) |
Write n byte data. | |
void | mram_enter_sleep_mode (mram_t *ctx) |
Sleep mode. | |
void | mram_wake_up_mode (mram_t *ctx) |
Wake up. | |
void | mram_enable_write_protect (mram_t *ctx, uint8_t state) |
Enable write protection. | |
void | mram_enable_hold_mode (mram_t *ctx, uint8_t state) |
Enable hold mode. | |
void mram_cfg_setup | ( | mram_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
This function initializes click configuration structure to init state.
uint8_t mram_check_status_bit | ( | mram_t * | ctx, |
uint8_t | status_bit ) |
Check status bit.
ctx | Click object. |
status_bit | Bit to be checked. |
Function return 0x01 or 0x00 depending on the status_bit.
void mram_default_cfg | ( | mram_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
This function executes default configuration for MRAM click.
uint8_t mram_disable_write | ( | mram_t * | ctx | ) |
Disable write.
ctx | Click object. |
Function disables write and returs if disabling was successful.
void mram_enable_hold_mode | ( | mram_t * | ctx, |
uint8_t | state ) |
Enable hold mode.
ctx | Click object. |
state | State to be changed for hold mode. |
Function enables or disables hold mode.
uint8_t mram_enable_write | ( | mram_t * | ctx | ) |
Enable write.
ctx | Click object. |
Function enables write and returs if enabling was successful.
void mram_enable_write_protect | ( | mram_t * | ctx, |
uint8_t | state ) |
Enable write protection.
ctx | Click object. |
state | State to be changed for write protect. |
Function enables or disables write protect.
void mram_enter_sleep_mode | ( | mram_t * | ctx | ) |
Sleep mode.
ctx | Click object. |
Function puts click board into sleep mode.
void mram_generic_transfer | ( | mram_t * | ctx, |
uint8_t * | wr_buf, | ||
uint16_t | wr_len, | ||
uint8_t * | rd_buf, | ||
uint16_t | rd_len ) |
Generic transfer function.
ctx | Click object. |
wr_buf | Write data buffer |
wr_len | Number of byte in write data buffer |
rd_buf | Read data buffer |
rd_len | Number of byte in read data buffer |
Generic SPI transfer, for sending and receiving packages
err_t mram_init | ( | mram_t * | ctx, |
mram_cfg_t * | cfg ) |
Initialization function.
mram | Click object. |
cfg | Click configuration structure. |
This function initializes all necessary pins and peripherals used for this click.
void mram_read_data_bytes | ( | mram_t * | ctx, |
const uint16_t | address, | ||
uint8_t * | buffer, | ||
const uint16_t | n_bytes ) |
Read n byte data.
ctx | Click object. |
address | Adress. |
buffer | Buffer holding read data. |
n_bytes | Number of bytes to be read. |
Function reads n bytes of data and saves it in buffer.
uint8_t mram_read_status_reg | ( | mram_t * | ctx | ) |
Read status reg.
ctx | Click object. |
Function read status register.
void mram_wake_up_mode | ( | mram_t * | ctx | ) |
Wake up.
ctx | Click object. |
Function wakes up the click board.
void mram_write_data_bytes | ( | mram_t * | ctx, |
const uint16_t | address, | ||
uint8_t * | buffer, | ||
const uint16_t | n_bytes ) |
Write n byte data.
ctx | Click object. |
address | Adress. |
buffer | Buffer holding data to be written. |
n_bytes | Number of bytes to be written. |
Function writes n bytes of data from the buffer.
void mram_write_status_reg | ( | mram_t * | ctx, |
uint8_t | transfer_data ) |
Write status reg.
ctx | Click object. |
transfer_data | Data to be written. |
Function writes data in status reg.