fram6 2.0.0.0
|
API for configuring and manipulating FRAM 6 Click driver. More...
Topics | |
FRAM 6 Opcode Commands List | |
List of Opcode Commands of FRAM 6 Click driver. | |
FRAM 6 Registers Settings | |
Settings for registers of FRAM 6 Click driver. | |
FRAM 6 MikroBUS Map | |
MikroBUS pin mapping of FRAM 6 Click driver. | |
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. | |
API for configuring and manipulating FRAM 6 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void fram6_cfg_setup | ( | fram6_cfg_t * | cfg | ) |
FRAM 6 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See fram6_cfg_t object definition for detailed explanation. |
err_t fram6_check_communication | ( | fram6_t * | ctx | ) |
FRAM 6 check communication function.
This function checks the communication by reading and verifying the device ID.
[in] | ctx | : Click context object. See fram6_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t fram6_default_cfg | ( | fram6_t * | ctx | ) |
FRAM 6 default configuration function.
This function executes a default configuration of FRAM 6 click board.
[in] | ctx | : Click context object. See fram6_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t fram6_disable_write | ( | fram6_t * | ctx | ) |
FRAM 6 disable write function.
This function disables write by issuing the WRDI command and checking the WEL bit.
[in] | ctx | : Click context object. See fram6_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t fram6_enable_write | ( | fram6_t * | ctx | ) |
FRAM 6 enable write function.
This function enables write by issuing the WREN command and checking the WEL bit.
[in] | ctx | : Click context object. See fram6_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t fram6_enter_sleep_mode | ( | fram6_t * | ctx | ) |
FRAM 6 enter sleep mode function.
This function enters to the sleep mode by issuing the SLEEP command.
[in] | ctx | : Click context object. See fram6_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t fram6_init | ( | fram6_t * | ctx, |
fram6_cfg_t * | cfg ) |
FRAM 6 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See fram6_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See fram6_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t fram6_memory_read | ( | fram6_t * | ctx, |
uint32_t | address, | ||
uint8_t * | data_out, | ||
uint16_t | len ) |
FRAM 6 memory read function.
This function reads a desired number of data bytes starting from the selected memory address.
[in] | ctx | : Click context object. See fram6_t object definition for detailed explanation. |
[in] | address | : Starting memory address [0x00000-0x3FFFF]. |
[out] | data_out | : Read data output. |
[in] | len | : Number of data bytes. |
0
- Success, -1
- Error.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.
This function fast reads a desired number of data bytes starting from the selected memory address.
[in] | ctx | : Click context object. See fram6_t object definition for detailed explanation. |
[in] | address | : Starting memory address [0x00000-0x3FFFF]. |
[out] | data_out | : Read data output. |
[in] | len | : Number of data bytes. |
0
- Success, -1
- Error.err_t fram6_memory_write | ( | fram6_t * | ctx, |
uint32_t | address, | ||
uint8_t * | data_in, | ||
uint16_t | len ) |
FRAM 6 memory write function.
This function writes a desired number of data bytes starting from the selected memory address.
[in] | ctx | : Click context object. See fram6_t object definition for detailed explanation. |
[in] | address | : Starting memory address [0x00000-0x3FFFF]. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of data bytes. |
0
- Success, -1
- Error.err_t fram6_read_opcode | ( | fram6_t * | ctx, |
uint8_t | opcode, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
FRAM 6 read opcode function.
This function reads a desired number of data bytes from the selected opcode by using SPI serial interface.
[in] | ctx | : Click context object. See fram6_t object definition for detailed explanation. |
[in] | opcode | : Opcode command. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t fram6_read_status | ( | fram6_t * | ctx, |
uint8_t * | status ) |
FRAM 6 read status function.
This function reads the Status register.
[in] | ctx | : Click context object. See fram6_t object definition for detailed explanation. |
[out] | status | : Read data output. |
0
- Success, -1
- Error.err_t fram6_set_block_protection | ( | fram6_t * | ctx, |
uint8_t | block_protect ) |
FRAM 6 set block protection function.
This function sets the block protection bits of the Status register.
[in] | ctx | : Click context object. See fram6_t object definition for detailed explanation. |
[in] | block_protect | :
|
0
- Success, -1
- Error.void fram6_set_hld_pin | ( | fram6_t * | ctx, |
uint8_t | state ) |
FRAM 6 set HLD pin function.
This function sets the HOLD (HLD) pin logic state.
[in] | ctx | : Click context object. See fram6_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
void fram6_set_wp_pin | ( | fram6_t * | ctx, |
uint8_t | state ) |
FRAM 6 set WP pin function.
This function sets the Write Protect (WP) pin logic state.
[in] | ctx | : Click context object. See fram6_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
void fram6_wakeup_from_sleep | ( | fram6_t * | ctx | ) |
FRAM 6 wake up from sleep function.
This function wakes up from sleep mode by toggling the CS pin.
[in] | ctx | : Click context object. See fram6_t object definition for detailed explanation. |
err_t fram6_write_opcode | ( | fram6_t * | ctx, |
uint8_t | opcode ) |
FRAM 6 write opcode function.
This function writes a desired opcode command byte by using SPI serial interface.
[in] | ctx | : Click context object. See fram6_t object definition for detailed explanation. |
[in] | opcode | : Opcode command. |
0
- Success, -1
- Error.err_t fram6_write_status | ( | fram6_t * | ctx, |
uint8_t | status ) |
FRAM 6 write status function.
This function writes a desired data to the Status register.
[in] | ctx | : Click context object. See fram6_t object definition for detailed explanation. |
[in] | status | : Data to be written. |
0
- Success, -1
- Error.