nvsram 2.0.0.0
|
API for configuring and manipulating nvSRAM Click driver. More...
Topics | |
nvSRAM Registers List | |
List of registers of nvSRAM Click driver. | |
nvSRAM Registers Settings | |
Settings for registers of nvSRAM Click driver. | |
nvSRAM MikroBUS Map | |
MikroBUS pin mapping of nvSRAM Click driver. | |
Functions | |
void | nvsram_cfg_setup (nvsram_cfg_t *cfg) |
nvSRAM configuration object setup function. | |
err_t | nvsram_init (nvsram_t *ctx, nvsram_cfg_t *cfg) |
nvSRAM initialization function. | |
err_t | nvsram_generic_write (nvsram_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len) |
nvSRAM I2C writing function. | |
err_t | nvsram_generic_read (nvsram_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len) |
nvSRAM I2C reading function. | |
void | nvsram_reg_write (nvsram_t *ctx, uint8_t reg, uint8_t tx_data) |
Generic write the byte of data function. | |
uint8_t | nvsram_reg_read (nvsram_t *ctx, uint8_t reg) |
Generic read the byte of data function. | |
void | nvsram_burst_reg_write (nvsram_t *ctx, uint8_t reg, uint8_t *p_tx_data, uint8_t n_bytes) |
Burst register write function. | |
void | nvsram_burst_reg_read (nvsram_t *ctx, uint8_t reg, uint8_t *p_rx_data, uint8_t n_bytes) |
Burst register read function. | |
void | nvsram_send_cmd (nvsram_t *ctx, uint8_t cmd) |
Send command function. | |
uint32_t | nvsram_read_dev_id (nvsram_t *ctx) |
Read device ID function. | |
void | nvsram_memory_write (nvsram_t *ctx, uint32_t mem_adr, uint8_t *p_tx_data, uint16_t n_bytes) |
Write memory function. | |
void | nvsram_memory_read (nvsram_t *ctx, uint32_t mem_adr, uint8_t *p_rx_data, uint16_t n_bytes) |
Read memory function. | |
void | nvsram_enable_memory_write (nvsram_t *ctx, uint8_t en_wr_mem) |
Enable memory write function. | |
API for configuring and manipulating nvSRAM Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void nvsram_burst_reg_read | ( | nvsram_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | p_rx_data, | ||
uint8_t | n_bytes ) |
Burst register read function.
The function read a sequential data starting from the targeted 8-bit register address of the CY14B101J2 1-Mbit (128K � 8) Serial (I2C) nvSRAM on nvSRAM click board.
[in] | ctx | : Click context object. See nvsram_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | p_rx_data | : Pointer to the memory location where data be stored. |
[in] | n_bytes | : number of bytes to be read. |
void nvsram_burst_reg_write | ( | nvsram_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | p_tx_data, | ||
uint8_t | n_bytes ) |
Burst register write function.
The function writes a sequential data starting of the targeted 8-bit register address of the CY14B101J2 1-Mbit (128K � 8) Serial (I2C) nvSRAM on nvSRAM click board.
[in] | ctx | : Click context object. See nvsram_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | p_tx_data | : Pointer to the data to be written. |
[in] | n_bytes | : Number of bytes to be written. |
void nvsram_cfg_setup | ( | nvsram_cfg_t * | cfg | ) |
nvSRAM configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See nvsram_cfg_t object definition for detailed explanation. |
void nvsram_enable_memory_write | ( | nvsram_t * | ctx, |
uint8_t | en_wr_mem ) |
Enable memory write function.
The function enable write depending on the function argument of the CY14B101J2 1-Mbit (128K � 8) Serial (I2C) nvSRAM on nvSRAM click board.
[in] | ctx | : Click context object. See nvsram_t object definition for detailed explanation. |
[in] | en_wr_mem | : Write enable or disable. |
err_t nvsram_generic_read | ( | nvsram_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rx_buf, | ||
uint8_t | rx_len ) |
nvSRAM I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See nvsram_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | rx_buf | : Output read data. |
[in] | rx_len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t nvsram_generic_write | ( | nvsram_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | tx_buf, | ||
uint8_t | tx_len ) |
nvSRAM I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See nvsram_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | tx_buf | : Data to be written. |
[in] | tx_len | : Number of bytes to be written. |
0
- Success, -1
- Error.err_t nvsram_init | ( | nvsram_t * | ctx, |
nvsram_cfg_t * | cfg ) |
nvSRAM initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See nvsram_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See nvsram_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.void nvsram_memory_read | ( | nvsram_t * | ctx, |
uint32_t | mem_adr, | ||
uint8_t * | p_rx_data, | ||
uint16_t | n_bytes ) |
Read memory function.
The function read a sequential data starting from the targeted 17-bit memory address of the CY14B101J2 1-Mbit (128K � 8) Serial (I2C) nvSRAM on nvSRAM click board.
[in] | ctx | : Click context object. See nvsram_t object definition for detailed explanation. |
[in] | mem_adr | : 17-bit start memory address. |
[out] | p_rx_data | : Pointer to the memory location where data be stored. |
[in] | n_bytes | : Number of bytes to be read. |
void nvsram_memory_write | ( | nvsram_t * | ctx, |
uint32_t | mem_adr, | ||
uint8_t * | p_tx_data, | ||
uint16_t | n_bytes ) |
Write memory function.
The function writes a sequential data starting of the targeted 17-bit memory address of the CY14B101J2 1-Mbit (128K � 8) Serial (I2C) nvSRAM on nvSRAM click board.
[in] | ctx | : Click context object. See nvsram_t object definition for detailed explanation. |
[in] | mem_adr | : 17-bit start memory address. |
[in] | p_tx_data | : Pointer to the data to be written. |
[in] | n_bytes | : Number of bytes to be written. |
uint32_t nvsram_read_dev_id | ( | nvsram_t * | ctx | ) |
Read device ID function.
The function read a device ID of the CY14B101J2 1-Mbit (128K � 8) Serial (I2C) nvSRAM on nvSRAM click board.
[in] | ctx | : Click context object. See nvsram_t object definition for detailed explanation. |
uint8_t nvsram_reg_read | ( | nvsram_t * | ctx, |
uint8_t | reg ) |
Generic read the byte of data function.
The function read a the byte of data from the targeted 8-bit register address of the CY14B101J2 1-Mbit (128K � 8) Serial (I2C) nvSRAM on nvSRAM click board.
[in] | ctx | : Click context object. See nvsram_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
void nvsram_reg_write | ( | nvsram_t * | ctx, |
uint8_t | reg, | ||
uint8_t | tx_data ) |
Generic write the byte of data function.
The function writes the byte of data to the targeted 8-bit register address of the CY14B101J2 1-Mbit (128K � 8) Serial (I2C) nvSRAM on nvSRAM click board.
[in] | ctx | : Click context object. See nvsram_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | tx_data | : Data to be written. |
void nvsram_send_cmd | ( | nvsram_t * | ctx, |
uint8_t | cmd ) |
Send command function.
The function sends the desired command to the CY14B101J2 1-Mbit (128K � 8) Serial (I2C) nvSRAM on nvSRAM click board.
[in] | ctx | : Click context object. See nvsram_t object definition for detailed explanation. |
[in] | cmd | : Command that is being sent. |