mram3 2.0.0.0
|
API for configuring and manipulating MRAM 3 Click driver. More...
Topics | |
MRAM 3 Registers List | |
List of registers of MRAM 3 Click driver. | |
MRAM 3 Registers Settings | |
Settings for registers of MRAM 3 Click driver. | |
MRAM 3 MikroBUS Map | |
MikroBUS pin mapping of MRAM 3 Click driver. | |
Functions | |
void | mram3_cfg_setup (mram3_cfg_t *cfg) |
MRAM 3 configuration object setup function. | |
err_t | mram3_init (mram3_t *ctx, mram3_cfg_t *cfg) |
MRAM 3 initialization function. | |
err_t | mram3_default_cfg (mram3_t *ctx) |
MRAM 3 default configuration function. | |
err_t | mram3_write_cmd (mram3_t *ctx, uint8_t cmd) |
MRAM 3 write cmd function. | |
err_t | mram3_write_cmd_data (mram3_t *ctx, uint8_t cmd, uint8_t *data_in, uint8_t len) |
MRAM 3 write cmd data function. | |
err_t | mram3_read_cmd_data (mram3_t *ctx, uint8_t cmd, uint8_t *data_out, uint8_t len) |
MRAM 3 read cmd data function. | |
err_t | mram3_write_cmd_address_data (mram3_t *ctx, uint8_t cmd, uint32_t address, uint8_t *data_in, uint32_t len) |
MRAM 3 write cmd address data function. | |
err_t | mram3_read_cmd_address_data (mram3_t *ctx, uint8_t cmd, uint32_t address, uint8_t *data_out, uint32_t len) |
MRAM 3 read cmd address data function. | |
err_t | mram3_memory_write (mram3_t *ctx, uint32_t address, uint8_t *data_in, uint32_t len) |
MRAM 3 memory write function. | |
err_t | mram3_memory_read (mram3_t *ctx, uint32_t address, uint8_t *data_out, uint32_t len) |
MRAM 3 memory read function. | |
err_t | mram3_aug_memory_write (mram3_t *ctx, uint8_t address, uint8_t *data_in, uint8_t len) |
MRAM 3 aug memory write function. | |
err_t | mram3_aug_memory_read (mram3_t *ctx, uint8_t address, uint8_t *data_out, uint8_t len) |
MRAM 3 aug memory read function. | |
err_t | mram3_check_communication (mram3_t *ctx) |
MRAM 3 check communication function. | |
err_t | mram3_write_protect (mram3_t *ctx) |
MRAM 3 write protect function. | |
err_t | mram3_write_enable (mram3_t *ctx) |
MRAM 3 write enable function. | |
err_t | mram3_soft_reset (mram3_t *ctx) |
MRAM 3 soft reset function. | |
err_t | mram3_write_status (mram3_t *ctx, uint8_t status) |
MRAM 3 write status function. | |
err_t | mram3_read_status (mram3_t *ctx, uint8_t *status) |
MRAM 3 read status function. | |
API for configuring and manipulating MRAM 3 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
err_t mram3_aug_memory_read | ( | mram3_t * | ctx, |
uint8_t | address, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
MRAM 3 aug memory read function.
This function reads a desired number of data bytes starting from the selected augmented memory address.
[in] | ctx | : Click context object. See mram3_t object definition for detailed explanation. |
[in] | address | : Starting memory address [0x00-0xFF]. |
[out] | data_out | : Read data output. |
[in] | len | : Number of data bytes. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t mram3_aug_memory_write | ( | mram3_t * | ctx, |
uint8_t | address, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
MRAM 3 aug memory write function.
This function writes a desired number of data bytes starting from the selected augmented memory address.
[in] | ctx | : Click context object. See mram3_t object definition for detailed explanation. |
[in] | address | : Starting memory address [0x00-0xFF]. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of data bytes. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void mram3_cfg_setup | ( | mram3_cfg_t * | cfg | ) |
MRAM 3 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See mram3_cfg_t object definition for detailed explanation. |
err_t mram3_check_communication | ( | mram3_t * | ctx | ) |
MRAM 3 check communication function.
This function checks the communication by reading and verifying the device ID.
[in] | ctx | : Click context object. See mram3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t mram3_default_cfg | ( | mram3_t * | ctx | ) |
MRAM 3 default configuration function.
This function executes a default configuration of MRAM 3 click board.
[in] | ctx | : Click context object. See mram3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t mram3_init | ( | mram3_t * | ctx, |
mram3_cfg_t * | cfg ) |
MRAM 3 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See mram3_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See mram3_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t mram3_memory_read | ( | mram3_t * | ctx, |
uint32_t | address, | ||
uint8_t * | data_out, | ||
uint32_t | len ) |
MRAM 3 memory read function.
This function reads a desired number of data bytes starting from the selected memory address.
[in] | ctx | : Click context object. See mram3_t object definition for detailed explanation. |
[in] | address | : Starting memory address [0x00000-0x1FFFF]. |
[out] | data_out | : Read data output. |
[in] | len | : Number of data bytes. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t mram3_memory_write | ( | mram3_t * | ctx, |
uint32_t | address, | ||
uint8_t * | data_in, | ||
uint32_t | len ) |
MRAM 3 memory write function.
This function writes a desired number of data bytes starting from the selected memory address.
[in] | ctx | : Click context object. See mram3_t object definition for detailed explanation. |
[in] | address | : Starting memory address [0x00000-0x1FFFF]. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of data bytes. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t mram3_read_cmd_address_data | ( | mram3_t * | ctx, |
uint8_t | cmd, | ||
uint32_t | address, | ||
uint8_t * | data_out, | ||
uint32_t | len ) |
MRAM 3 read cmd address data function.
This function reads a desired number of data bytes starting from a desired address of the selected instruction command by using SPI serial interface.
[in] | ctx | : Click context object. See mram3_t object definition for detailed explanation. |
[in] | cmd | : Instruction command opcode. |
[in] | address | : Memory address (up to 0x1FFFF). |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t mram3_read_cmd_data | ( | mram3_t * | ctx, |
uint8_t | cmd, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
MRAM 3 read cmd data function.
This function reads a desired number of data bytes from the selected instruction command by using SPI serial interface.
[in] | ctx | : Click context object. See mram3_t object definition for detailed explanation. |
[in] | cmd | : Instruction command opcode. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read (up to 8). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t mram3_read_status | ( | mram3_t * | ctx, |
uint8_t * | status ) |
MRAM 3 read status function.
This function reads data from the status register.
[in] | ctx | : Click context object. See mram3_t object definition for detailed explanation. |
[out] | status | : Status data read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t mram3_soft_reset | ( | mram3_t * | ctx | ) |
MRAM 3 soft reset function.
This function executes the soft reset command.
[in] | ctx | : Click context object. See mram3_t object definition for detailed explanation. |
err_t mram3_write_cmd | ( | mram3_t * | ctx, |
uint8_t | cmd ) |
MRAM 3 write cmd function.
This function writes a desired instruction command by using SPI serial interface.
[in] | ctx | : Click context object. See mram3_t object definition for detailed explanation. |
[in] | cmd | : Instruction command opcode. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t mram3_write_cmd_address_data | ( | mram3_t * | ctx, |
uint8_t | cmd, | ||
uint32_t | address, | ||
uint8_t * | data_in, | ||
uint32_t | len ) |
MRAM 3 write cmd address data function.
This function writes a desired number of data bytes starting from a desired address of the selected instruction command by using SPI serial interface.
[in] | ctx | : Click context object. See mram3_t object definition for detailed explanation. |
[in] | cmd | : Instruction command opcode. |
[in] | address | : Memory address (up to 0x1FFFF). |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t mram3_write_cmd_data | ( | mram3_t * | ctx, |
uint8_t | cmd, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
MRAM 3 write cmd data function.
This function writes a desired number of data bytes to the selected instruction command by using SPI serial interface.
[in] | ctx | : Click context object. See mram3_t object definition for detailed explanation. |
[in] | cmd | : Instruction command opcode. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written (up to 8). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t mram3_write_enable | ( | mram3_t * | ctx | ) |
MRAM 3 write enable function.
This function disables memory write-protect via the WP pin and WREN command.
[in] | ctx | : Click context object. See mram3_t object definition for detailed explanation. |
err_t mram3_write_protect | ( | mram3_t * | ctx | ) |
MRAM 3 write protect function.
This function write protects the entire memory via the WP pin and WRDI command.
[in] | ctx | : Click context object. See mram3_t object definition for detailed explanation. |
err_t mram3_write_status | ( | mram3_t * | ctx, |
uint8_t | status ) |
MRAM 3 write status function.
This function writes data to the status register.
[in] | ctx | : Click context object. See mram3_t object definition for detailed explanation. |
[in] | status | : Status data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.