nvsram4 2.0.0.0
|
API for configuring and manipulating nvSRAM 4 Click driver. More...
Topics | |
nvSRAM 4 Registers List | |
List of registers of nvSRAM 4 Click driver. | |
nvSRAM 4 Registers Settings | |
Settings for registers of nvSRAM 4 Click driver. | |
nvSRAM 4 MikroBUS Map | |
MikroBUS pin mapping of nvSRAM 4 Click driver. | |
Status | |
Functions | |
void | nvsram4_cfg_setup (nvsram4_cfg_t *cfg) |
nvSRAM 4 configuration object setup function. | |
err_t | nvsram4_init (nvsram4_t *ctx, nvsram4_cfg_t *cfg) |
nvSRAM 4 initialization function. | |
void | nvsram4_default_cfg (nvsram4_t *ctx) |
nvSRAM 4 default configuration function. | |
err_t | nvsram4_generic_write (nvsram4_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
nvSRAM 4 data writing function. | |
err_t | nvsram4_generic_read (nvsram4_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
nvSRAM 4 data reading function. | |
err_t | nvsram4_set_cmd (nvsram4_t *ctx, uint8_t cmd) |
nvSRAM 4 set command function. | |
uint8_t | nvsram4_read_status (nvsram4_t *ctx) |
nvSRAM 4 read status function. | |
void | nvsram4_write_status (nvsram4_t *ctx, uint8_t st_data) |
nvSRAM 4 write status function. | |
err_t | nvsram4_burst_read_memory (nvsram4_t *ctx, uint32_t mem_addr, uint8_t *data_out, uint8_t n_bytes) |
nvSRAM 4 burst read memory function. | |
err_t | nvsram4_burst_write_memory (nvsram4_t *ctx, uint32_t mem_addr, uint8_t *data_in, uint8_t n_bytes) |
nvSRAM 4 burst write memory function. | |
uint32_t | nvsram4_read_id (nvsram4_t *ctx) |
nvSRAM 4 read device ID function. | |
uint8_t | nvsram4_rtc_read_reg (nvsram4_t *ctx, uint8_t rtc_reg) |
nvSRAM 4 rtc read register function. | |
void | nvsram4_rtc_write_reg (nvsram4_t *ctx, uint8_t rtc_reg, uint8_t data_in) |
nvSRAM 4 rtc write register function. | |
void | nvsram4_enable_rtc_write (nvsram4_t *ctx) |
nvSRAM 4 enable rtc register write function. | |
void | nvsram4_disable_rtc_write (nvsram4_t *ctx) |
nvSRAM 4 disable rtc register write function. | |
void | nvsram4_get_rtc_time (nvsram4_t *ctx, nvsram4_rtc_time_t *rtc_time) |
nvSRAM 4 get RTC time function. | |
err_t | nvsram4_set_rtc_time (nvsram4_t *ctx, nvsram4_rtc_time_t rtc_time) |
nvSRAM 4 set RTC time function. | |
void | nvsram4_get_rtc_date (nvsram4_t *ctx, nvsram4_rtc_date_t *rtc_date) |
nvSRAM 4 get RTC date function. | |
err_t | nvsram4_set_rtc_date (nvsram4_t *ctx, nvsram4_rtc_date_t rtc_date) |
nvSRAM 4 set RTC date function. | |
void | nvsram4_get_rtc_alarm (nvsram4_t *ctx, nvsram4_rtc_alarm_t *rtc_alarm) |
nvSRAM 4 get RTC alarm function. | |
err_t | nvsram4_set_rtc_alarm (nvsram4_t *ctx, nvsram4_rtc_alarm_t rtc_alarm) |
nvSRAM 4 set RTC alarm function. | |
err_t | nvsram4_hold (nvsram4_t *ctx, uint8_t en_hold) |
nvSRAM 4 set hold function. | |
err_t | nvsram4_hardware_store (nvsram4_t *ctx, uint8_t en_hw_store) |
nvSRAM 4 hardware store function. | |
err_t | nvsram4_hw_write_protection (nvsram4_t *ctx, uint8_t en_wp) |
nvSRAM 4 write protection function. | |
API for configuring and manipulating nvSRAM 4 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 nvsram4_burst_read_memory | ( | nvsram4_t * | ctx, |
uint32_t | mem_addr, | ||
uint8_t * | data_out, | ||
uint8_t | n_bytes ) |
nvSRAM 4 burst read memory function.
This function reads a desired memory address of data bytes starting from the selected register by using SPI serial interface of the CY14B101P, 1-Mbit (128K × 8) Serial (SPI) nvSRAM with Real-Time Clock on the nvSRAM 4 click.
[in] | ctx | : Click context object. See nvsram4_t object definition for detailed explanation. |
[in] | mem_addr | : Start memory address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t nvsram4_burst_write_memory | ( | nvsram4_t * | ctx, |
uint32_t | mem_addr, | ||
uint8_t * | data_in, | ||
uint8_t | n_bytes ) |
nvSRAM 4 burst write memory function.
This function burst write memory a desired number address of data bytes starting from the selected memory address by using SPI serial interface of the CY14B101P, 1-Mbit (128K × 8) Serial (SPI) nvSRAM with Real-Time Clock on the nvSRAM 4 click.
[in] | ctx | : Click context object. See nvsram4_t object definition for detailed explanation. |
[in] | mem_addr | : Start memory address. |
[in] | data_in | : Data to be written. |
[in] | n_bytes | : Number of bytes to be written. |
0
- Success, -1
- Error.void nvsram4_cfg_setup | ( | nvsram4_cfg_t * | cfg | ) |
nvSRAM 4 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See nvsram4_cfg_t object definition for detailed explanation. |
void nvsram4_default_cfg | ( | nvsram4_t * | ctx | ) |
nvSRAM 4 default configuration function.
This function executes a default configuration of nvSRAM 4 click board.
[in] | ctx | : Click context object. See nvsram4_t object definition for detailed explanation. |
void nvsram4_disable_rtc_write | ( | nvsram4_t * | ctx | ) |
nvSRAM 4 disable rtc register write function.
This function disable write rtc register of the CY14B101P, 1-Mbit (128K × 8) Serial (SPI) nvSRAM with Real-Time Clock on the nvSRAM 4 click.
[in] | ctx | : Click context object. See nvsram4_t object definition for detailed explanation. |
See #err_t definition for detailed explanation.
void nvsram4_enable_rtc_write | ( | nvsram4_t * | ctx | ) |
nvSRAM 4 enable rtc register write function.
This function enable write rtc register of the CY14B101P, 1-Mbit (128K × 8) Serial (SPI) nvSRAM with Real-Time Clock on the nvSRAM 4 click.
[in] | ctx | : Click context object. See nvsram4_t object definition for detailed explanation. |
See #err_t definition for detailed explanation.
err_t nvsram4_generic_read | ( | nvsram4_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
nvSRAM 4 data reading function.
This function reads a desired number of data bytes starting from the selected register by using SPI serial interface of the CY14B101P, 1-Mbit (128K × 8) Serial (SPI) nvSRAM with Real-Time Clock on the nvSRAM 4 click.
[in] | ctx | : Click context object. See nvsram4_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 nvsram4_generic_write | ( | nvsram4_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
nvSRAM 4 data writing function.
This function writes a desired number of data bytes starting from the selected register by using SPI serial interface of the CY14B101P, 1-Mbit (128K × 8) Serial (SPI) nvSRAM with Real-Time Clock on the nvSRAM 4 click.
[in] | ctx | : Click context object. See nvsram4_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 nvsram4_get_rtc_alarm | ( | nvsram4_t * | ctx, |
nvsram4_rtc_alarm_t * | rtc_alarm ) |
nvSRAM 4 get RTC alarm function.
This function get RTC alarm structure of the CY14B101P, 1-Mbit (128K × 8) Serial (SPI) nvSRAM with Real-Time Clock on the nvSRAM 4 click.
[in] | ctx | : Click context object. See nvsram4_t object definition for detailed explanation. |
[out] | rtc_alarm | : RTC alarm context object. |
See #err_t definition for detailed explanation.
void nvsram4_get_rtc_date | ( | nvsram4_t * | ctx, |
nvsram4_rtc_date_t * | rtc_date ) |
nvSRAM 4 get RTC date function.
This function get RTC date data structure of the CY14B101P, 1-Mbit (128K × 8) Serial (SPI) nvSRAM with Real-Time Clock on the nvSRAM 4 click.
[in] | ctx | : Click context object. See nvsram4_t object definition for detailed explanation. |
[out] | rtc_date | : RTC date context object. |
See #err_t definition for detailed explanation.
void nvsram4_get_rtc_time | ( | nvsram4_t * | ctx, |
nvsram4_rtc_time_t * | rtc_time ) |
nvSRAM 4 get RTC time function.
This function get RTC time data structure of the CY14B101P, 1-Mbit (128K × 8) Serial (SPI) nvSRAM with Real-Time Clock on the nvSRAM 4 click.
[in] | ctx | : Click context object. See nvsram4_t object definition for detailed explanation. |
[out] | rtc_time | : RTC time context object. |
See #err_t definition for detailed explanation.
err_t nvsram4_hardware_store | ( | nvsram4_t * | ctx, |
uint8_t | en_hw_store ) |
nvSRAM 4 hardware store function.
This function set hardware store by setting the HSB pin state of the CY14B101P, 1-Mbit (128K × 8) Serial (SPI) nvSRAM with Real-Time Clock on the nvSRAM 4 click.
[in] | ctx | : Click context object. See nvsram4_t object definition for detailed explanation. |
[in] | en_hw_store | :
|
0
- Success, -1
- Error.err_t nvsram4_hold | ( | nvsram4_t * | ctx, |
uint8_t | en_hold ) |
nvSRAM 4 set hold function.
This function set hold by setting the HLD pin state of the CY14B101P, 1-Mbit (128K × 8) Serial (SPI) nvSRAM with Real-Time Clock on the nvSRAM 4 click.
[in] | ctx | : Click context object. See nvsram4_t object definition for detailed explanation. |
[in] | en_hold | :
|
0
- Success, -1
- Error.err_t nvsram4_hw_write_protection | ( | nvsram4_t * | ctx, |
uint8_t | en_wp ) |
nvSRAM 4 write protection function.
This function set write protection by setting the WP pin state of the CY14B101P, 1-Mbit (128K × 8) Serial (SPI) nvSRAM with Real-Time Clock on the nvSRAM 4 click.
[in] | ctx | : Click context object. See nvsram4_t object definition for detailed explanation. |
[in] | en_wp | :
|
0
- Success, -1
- Error.err_t nvsram4_init | ( | nvsram4_t * | ctx, |
nvsram4_cfg_t * | cfg ) |
nvSRAM 4 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See nvsram4_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See nvsram4_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.uint32_t nvsram4_read_id | ( | nvsram4_t * | ctx | ) |
nvSRAM 4 read device ID function.
This function reads a device ID by using SPI serial interface of the CY14B101P, 1-Mbit (128K × 8) Serial (SPI) nvSRAM with Real-Time Clock on the nvSRAM 4 click.
[in] | ctx | : Click context object. See nvsram4_t object definition for detailed explanation. |
See #err_t definition for detailed explanation.
uint8_t nvsram4_read_status | ( | nvsram4_t * | ctx | ) |
nvSRAM 4 read status function.
This function reads a status register by using SPI serial interface.
[in] | ctx | : Click context object. See nvsram4_t object definition for detailed explanation. |
See #err_t definition for detailed explanation.
uint8_t nvsram4_rtc_read_reg | ( | nvsram4_t * | ctx, |
uint8_t | rtc_reg ) |
nvSRAM 4 rtc read register function.
This function reads a desired the bytes of data from the selected rtc register by using SPI serial interface of the CY14B101P, 1-Mbit (128K × 8) Serial (SPI) nvSRAM with Real-Time Clock on the nvSRAM 4 click.
[in] | ctx | : Click context object. See nvsram4_t object definition for detailed explanation. |
[in] | rtc_reg | : RTC register address. |
See #err_t definition for detailed explanation.
void nvsram4_rtc_write_reg | ( | nvsram4_t * | ctx, |
uint8_t | rtc_reg, | ||
uint8_t | data_in ) |
nvSRAM 4 rtc write register function.
This function writes a desired the bytes of data from the selected rtc register by using SPI serial interface of the CY14B101P, 1-Mbit (128K × 8) Serial (SPI) nvSRAM with Real-Time Clock on the nvSRAM 4 click.
[in] | ctx | : Click context object. See nvsram4_t object definition for detailed explanation. |
[in] | rtc_reg | : RTC register address. |
[in] | data_in | : Data to be written. |
See #err_t definition for detailed explanation.
err_t nvsram4_set_cmd | ( | nvsram4_t * | ctx, |
uint8_t | cmd ) |
nvSRAM 4 set command function.
This function writes a desired command by using SPI serial interface.
[in] | ctx | : Click context object. See nvsram4_t object definition for detailed explanation. |
[in] | cmd | : Desired command. |
0
- Success, -1
- Error.err_t nvsram4_set_rtc_alarm | ( | nvsram4_t * | ctx, |
nvsram4_rtc_alarm_t | rtc_alarm ) |
nvSRAM 4 set RTC alarm function.
This function set RTC date alarm structure of the CY14B101P, 1-Mbit (128K × 8) Serial (SPI) nvSRAM with Real-Time Clock on the nvSRAM 4 click.
[in] | ctx | : Click context object. See nvsram4_t object definition for detailed explanation. |
[in] | rtc_alarm | : RTC alarm context object. |
0
- Success, -1
- Error.err_t nvsram4_set_rtc_date | ( | nvsram4_t * | ctx, |
nvsram4_rtc_date_t | rtc_date ) |
nvSRAM 4 set RTC date function.
This function set RTC date data structure of the CY14B101P, 1-Mbit (128K × 8) Serial (SPI) nvSRAM with Real-Time Clock on the nvSRAM 4 click.
[in] | ctx | : Click context object. See nvsram4_t object definition for detailed explanation. |
[in] | rtc_date | : RTC date context object. |
0
- Success, -1
- Error.err_t nvsram4_set_rtc_time | ( | nvsram4_t * | ctx, |
nvsram4_rtc_time_t | rtc_time ) |
nvSRAM 4 set RTC time function.
This function set RTC time data structure of the CY14B101P, 1-Mbit (128K × 8) Serial (SPI) nvSRAM with Real-Time Clock on the nvSRAM 4 click.
[in] | ctx | : Click context object. See nvsram4_t object definition for detailed explanation. |
[in] | rtc_time | : RTC time context object. |
0
- Success, -1
- Error.void nvsram4_write_status | ( | nvsram4_t * | ctx, |
uint8_t | st_data ) |
nvSRAM 4 write status function.
This function writes a status register by using SPI serial interface.
[in] | ctx | : Click context object. See nvsram4_t object definition for detailed explanation. |
[in] | st_data | : Status data. |
See #err_t definition for detailed explanation.