nvsram2 2.0.0.0
|
API for configuring and manipulating nvSRAM 2 Click driver. More...
Topics | |
nvSRAM 2 Registers List | |
List of registers of nvSRAM 2 Click driver. | |
nvSRAM 2 MikroBUS Map | |
MikroBUS pin mapping of nvSRAM 2 Click driver. | |
Nvsram2_set | |
Functions | |
void | nvsram2_cfg_setup (nvsram2_cfg_t *cfg) |
nvSRAM 2 configuration object setup function. | |
err_t | nvsram2_init (nvsram2_t *ctx, nvsram2_cfg_t *cfg) |
nvSRAM 2 initialization function. | |
err_t | nvsram2_default_cfg (nvsram2_t *ctx) |
nvSRAM 2 default configuration function. | |
err_t | nvsram2_generic_write (nvsram2_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
nvSRAM 2 data writing function. | |
err_t | nvsram2_generic_read (nvsram2_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
nvSRAM 2 data reading function. | |
void | nvsram2_hold (nvsram2_t *ctx, uint8_t en_hold) |
nvSRAM 2 data enable hold operation function. | |
void | nvsram2_set_cmd (nvsram2_t *ctx, uint8_t cmd) |
nvSRAM 2 send command function. | |
uint8_t | nvsram2_read_status (nvsram2_t *ctx) |
nvSRAM 2 read status register function. | |
uint8_t | nvsram2_fast_read_status (nvsram2_t *ctx) |
nvSRAM 2 fast read status register function. | |
void | nvsram2_write_status (nvsram2_t *ctx, uint8_t data_byte) |
nvSRAM 2 write status register function. | |
void | nvsram2_burst_read (nvsram2_t *ctx, uint32_t mem_addr, uint8_t *p_rx_data, uint8_t n_bytes) |
nvSRAM 2 burst read function. | |
void | nvsram2_burst_write (nvsram2_t *ctx, uint32_t mem_addr, uint8_t *p_tx_data, uint8_t n_bytes) |
nvSRAM 2 burst write function. | |
uint32_t | nvsram2_read_id (nvsram2_t *ctx) |
nvSRAM 2 read ID function. | |
API for configuring and manipulating nvSRAM 2 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void nvsram2_burst_read | ( | nvsram2_t * | ctx, |
uint32_t | mem_addr, | ||
uint8_t * | p_rx_data, | ||
uint8_t | n_bytes ) |
nvSRAM 2 burst read function.
The function reads a sequential data starting from the targeted 17-bit register address of the CY14B101Q2A memory on nvSRAM 2 click board.
[in] | ctx | : Click context object. See nvsram2_t object definition for detailed explanation. |
[in] | mem_addr | : 17-bit memory address. |
[in] | p_rx_data | : Pointer to the memory address from which data is read. |
[in] | n_bytes | : 8-bit number of bytes to be read. |
See #err_t definition for detailed explanation.
void nvsram2_burst_write | ( | nvsram2_t * | ctx, |
uint32_t | mem_addr, | ||
uint8_t * | p_tx_data, | ||
uint8_t | n_bytes ) |
nvSRAM 2 burst write function.
The function writes a sequential data starting from the targeted 17-bit register address of the CY14B101Q2A memory on nvSRAM 2 click board.
[in] | ctx | : Click context object. See nvsram2_t object definition for detailed explanation. |
[in] | mem_addr | : 17-bit memory address. |
[in] | p_rx_data | : Pointer to the memory address from which data is read. |
[in] | n_bytes | : 8-bit number of bytes to be read. |
See #err_t definition for detailed explanation.
void nvsram2_cfg_setup | ( | nvsram2_cfg_t * | cfg | ) |
nvSRAM 2 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See nvsram2_cfg_t object definition for detailed explanation. |
err_t nvsram2_default_cfg | ( | nvsram2_t * | ctx | ) |
nvSRAM 2 default configuration function.
This function executes a default configuration of nvSRAM 2 click board.
[in] | ctx | : Click context object. See nvsram2_t object definition for detailed explanation. |
0
- Success, -1
- Error.uint8_t nvsram2_fast_read_status | ( | nvsram2_t * | ctx | ) |
nvSRAM 2 fast read status register function.
The function reads status register for faster SPI speeds from the CY14B101Q2A memory on nvSRAM 2 click board.
[in] | ctx | : Click context object. See nvsram2_t object definition for detailed explanation. |
See #err_t definition for detailed explanation.
err_t nvsram2_generic_read | ( | nvsram2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
nvSRAM 2 data reading function.
This function reads a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See nvsram2_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t nvsram2_generic_write | ( | nvsram2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
nvSRAM 2 data writing function.
This function writes a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See nvsram2_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error.void nvsram2_hold | ( | nvsram2_t * | ctx, |
uint8_t | en_hold ) |
nvSRAM 2 data enable hold operation function.
The function enables hold operation by setting the state of the HOLD ( PWM ) pin depending on the function argument.
[in] | ctx | : Click context object. See nvsram2_t object definition for detailed explanation. |
[in] | en_hold | : Resume/pause serial communications with the device. |
See #err_t definition for detailed explanation.
err_t nvsram2_init | ( | nvsram2_t * | ctx, |
nvsram2_cfg_t * | cfg ) |
nvSRAM 2 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See nvsram2_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See nvsram2_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.uint32_t nvsram2_read_id | ( | nvsram2_t * | ctx | ) |
nvSRAM 2 read ID function.
The function performs the device ID read of the CY14B101Q2A memory on nvSRAM 2 click board.
[in] | ctx | : Click context object. See nvsram2_t object definition for detailed explanation. |
See #err_t definition for detailed explanation.
uint8_t nvsram2_read_status | ( | nvsram2_t * | ctx | ) |
nvSRAM 2 read status register function.
The function reads status register from the CY14B101Q2A memory on nvSRAM 2 click board.
[in] | ctx | : Click context object. See nvsram2_t object definition for detailed explanation. |
See #err_t definition for detailed explanation.
void nvsram2_set_cmd | ( | nvsram2_t * | ctx, |
uint8_t | cmd ) |
nvSRAM 2 send command function.
The function sends desired command to the CY14B101Q2A memory on nvSRAM 2 click board.
[in] | ctx | : Click context object. See nvsram2_t object definition for detailed explanation. |
[in] | cmd | : 8-bit command. |
See #err_t definition for detailed explanation.
void nvsram2_write_status | ( | nvsram2_t * | ctx, |
uint8_t | data_byte ) |
nvSRAM 2 write status register function.
The function writes status data to the CY14B101Q2A memory on nvSRAM 2 click board.
[in] | ctx | : Click context object. See nvsram2_t object definition for detailed explanation. |
[in] | data_byte | : 8-bit write status data. |
See #err_t definition for detailed explanation.