nvsram3 2.0.0.0
|
API for configuring and manipulating nvSRAM 3 Click driver. More...
Topics | |
nvSRAM 3 Registers List | |
List of registers of nvSRAM 3 Click driver. | |
nvSRAM 3 Registers Settings | |
Settings for registers of nvSRAM 3 Click driver. | |
nvSRAM 3 MikroBUS Map | |
MikroBUS pin mapping of nvSRAM 3 Click driver. | |
Status | |
Functions | |
void | nvsram3_cfg_setup (nvsram3_cfg_t *cfg) |
nvSRAM 3 configuration object setup function. | |
err_t | nvsram3_init (nvsram3_t *ctx, nvsram3_cfg_t *cfg) |
nvSRAM 3 initialization function. | |
err_t | nvsram3_default_cfg (nvsram3_t *ctx) |
nvSRAM 3 default configuration function. | |
err_t | nvsram3_generic_write (nvsram3_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len) |
nvSRAM 3 I2C writing function. | |
err_t | nvsram3_generic_read (nvsram3_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len) |
nvSRAM 3 I2C reading function. | |
err_t | nvsram3_send_cmd (nvsram3_t *ctx, uint8_t cmd) |
nvSRAM 3 send command function. | |
err_t | nvsram3_memory_write (nvsram3_t *ctx, uint32_t mem_addr, uint8_t *data_in, uint8_t n_bytes) |
nvSRAM 3 write memory function. | |
err_t | nvsram3_memory_read (nvsram3_t *ctx, uint32_t mem_addr, uint8_t *data_out, uint8_t n_bytes) |
nvSRAM 3 read memory function. | |
uint32_t | nvsram3_get_device_id (nvsram3_t *ctx) |
nvSRAM 3 get device ID function. | |
err_t | nvsram3_rtc_read_reg (nvsram3_t *ctx, uint8_t rtc_reg, uint8_t *data_out) |
nvSRAM 3 RTC read register function. | |
err_t | nvsram3_rtc_write_reg (nvsram3_t *ctx, uint8_t rtc_reg, uint8_t data_in) |
nvSRAM 3 RTC write register function. | |
void | nvsram3_get_rtc_time (nvsram3_t *ctx, nvsram3_rtc_time_t *rtc_time) |
nvSRAM 3 get RTC time function. | |
err_t | nvsram3_set_rtc_time (nvsram3_t *ctx, nvsram3_rtc_time_t rtc_time) |
nvSRAM 3 set RTC time function. | |
void | nvsram3_get_rtc_date (nvsram3_t *ctx, nvsram3_rtc_date_t *rtc_date) |
nvSRAM 3 get RTC date function. | |
err_t | nvsram3_set_rtc_date (nvsram3_t *ctx, nvsram3_rtc_date_t rtc_date) |
nvSRAM 3 set RTC date function. | |
void | nvsram3_get_rtc_alarm (nvsram3_t *ctx, nvsram3_rtc_alarm_t *rtc_alarm) |
nvSRAM 3 get RTC alarm function. | |
err_t | nvsram3_set_rtc_alarm (nvsram3_t *ctx, nvsram3_rtc_alarm_t rtc_alarm) |
nvSRAM 3 set RTC alarm function. | |
err_t | nvsram3_hardware_store (nvsram3_t *ctx, uint8_t state) |
nvSRAM 3 hardware store function. | |
err_t | nvsram3_hw_write_protection (nvsram3_t *ctx, uint8_t state) |
nvSRAM 3 write protection function. | |
API for configuring and manipulating nvSRAM 3 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void nvsram3_cfg_setup | ( | nvsram3_cfg_t * | cfg | ) |
nvSRAM 3 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See nvsram3_cfg_t object definition for detailed explanation. |
err_t nvsram3_default_cfg | ( | nvsram3_t * | ctx | ) |
nvSRAM 3 default configuration function.
This function executes a default configuration of nvSRAM 3 click board.
[in] | ctx | : Click context object. See nvsram3_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t nvsram3_generic_read | ( | nvsram3_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rx_buf, | ||
uint8_t | rx_len ) |
nvSRAM 3 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 nvsram3_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 nvsram3_generic_write | ( | nvsram3_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | tx_buf, | ||
uint8_t | tx_len ) |
nvSRAM 3 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 nvsram3_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.uint32_t nvsram3_get_device_id | ( | nvsram3_t * | ctx | ) |
nvSRAM 3 get device ID function.
This function reads the device ID register.
[in] | ctx | : Click context object. See nvsram3_t object definition for detailed explanation. |
void nvsram3_get_rtc_alarm | ( | nvsram3_t * | ctx, |
nvsram3_rtc_alarm_t * | rtc_alarm ) |
nvSRAM 3 get RTC alarm function.
This function get RTC alarm structure.
[in] | ctx | : Click context object. See nvsram3_t object definition for detailed explanation. |
[out] | rtc_alarm | : RTC alarm context object. |
See #err_t definition for detailed explanation.
void nvsram3_get_rtc_date | ( | nvsram3_t * | ctx, |
nvsram3_rtc_date_t * | rtc_date ) |
nvSRAM 3 get RTC date function.
This function get RTC date data structure.
[in] | ctx | : Click context object. See nvsram3_t object definition for detailed explanation. |
[out] | rtc_date | : RTC date context object. |
See #err_t definition for detailed explanation.
void nvsram3_get_rtc_time | ( | nvsram3_t * | ctx, |
nvsram3_rtc_time_t * | rtc_time ) |
nvSRAM 3 get RTC time function.
This function get RTC time data structure.
[in] | ctx | : Click context object. See nvsram3_t object definition for detailed explanation. |
[out] | rtc_time | : RTC time context object. |
See #err_t definition for detailed explanation.
err_t nvsram3_hardware_store | ( | nvsram3_t * | ctx, |
uint8_t | state ) |
nvSRAM 3 hardware store function.
This function set hardware store by setting the HSB pin state.
[in] | ctx | : Click context object. See nvsram3_t object definition for detailed explanation. |
[in] | state | :
|
0
- Success, -1
- Error.err_t nvsram3_hw_write_protection | ( | nvsram3_t * | ctx, |
uint8_t | state ) |
nvSRAM 3 write protection function.
This function set write protection by setting the WP pin state.
[in] | ctx | : Click context object. See nvsram3_t object definition for detailed explanation. |
[in] | state | :
|
0
- Success, -1
- Error.err_t nvsram3_init | ( | nvsram3_t * | ctx, |
nvsram3_cfg_t * | cfg ) |
nvSRAM 3 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See nvsram3_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See nvsram3_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t nvsram3_memory_read | ( | nvsram3_t * | ctx, |
uint32_t | mem_addr, | ||
uint8_t * | data_out, | ||
uint8_t | n_bytes ) |
nvSRAM 3 read memory function.
This function reads a desired number of data bytes starting from the selected memory address by using I2C serial interface.
[in] | ctx | : Click context object. See nvsram3_t object definition for detailed explanation. |
[in] | mem_addr | : Start memory address. |
[out] | data_out | : Output read data. |
[in] | n_bytes | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t nvsram3_memory_write | ( | nvsram3_t * | ctx, |
uint32_t | mem_addr, | ||
uint8_t * | data_in, | ||
uint8_t | n_bytes ) |
nvSRAM 3 write memory function.
This function write a desired number of data bytes starting from the selected memory address by using I2C serial interface.
[in] | ctx | : Click context object. See nvsram3_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.err_t nvsram3_rtc_read_reg | ( | nvsram3_t * | ctx, |
uint8_t | rtc_reg, | ||
uint8_t * | data_out ) |
nvSRAM 3 RTC read register function.
This function reads data byte from the selected RTC register by using I2C serial interface.
[in] | ctx | : Click context object. See nvsram3_t object definition for detailed explanation. |
[in] | rtc_reg | : RTC register address. |
[out] | data_out | : data read from the selected register. |
0
- Success, -1
- Error.err_t nvsram3_rtc_write_reg | ( | nvsram3_t * | ctx, |
uint8_t | rtc_reg, | ||
uint8_t | data_in ) |
nvSRAM 3 RTC write register function.
This function writes data byte to the selected RTC register by using I2C serial interface.
[in] | ctx | : Click context object. See nvsram3_t object definition for detailed explanation. |
[in] | rtc_reg | : RTC register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error.err_t nvsram3_send_cmd | ( | nvsram3_t * | ctx, |
uint8_t | cmd ) |
nvSRAM 3 send command function.
This function writes a desired command by using I2C serial interface.
[in] | ctx | : Click context object. See nvsram3_t object definition for detailed explanation. |
[in] | cmd | : Desired command. |
0
- Success, -1
- Error.err_t nvsram3_set_rtc_alarm | ( | nvsram3_t * | ctx, |
nvsram3_rtc_alarm_t | rtc_alarm ) |
nvSRAM 3 set RTC alarm function.
This function set RTC date alarm structure.
[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 nvsram3_set_rtc_date | ( | nvsram3_t * | ctx, |
nvsram3_rtc_date_t | rtc_date ) |
nvSRAM 3 set RTC date function.
This function set RTC date data structure.
[in] | ctx | : Click context object. See nvsram3_t object definition for detailed explanation. |
[in] | rtc_date | : RTC date context object. |
0
- Success, -1
- Error.err_t nvsram3_set_rtc_time | ( | nvsram3_t * | ctx, |
nvsram3_rtc_time_t | rtc_time ) |
nvSRAM 3 set RTC time function.
This function set RTC time data structure.
[in] | ctx | : Click context object. See nvsram3_t object definition for detailed explanation. |
[in] | rtc_time | : RTC time context object. |
0
- Success, -1
- Error.