sram4 2.0.0.0
|
API for configuring and manipulating SRAM 4 Click driver. More...
Topics | |
SRAM 4 Registers List | |
List of registers of SRAM 4 Click driver. | |
SRAM 4 Registers Settings | |
Settings for registers of SRAM 4 Click driver. | |
SRAM 4 MikroBUS Map | |
MikroBUS pin mapping of SRAM 4 Click driver. | |
Functions | |
void | sram4_cfg_setup (sram4_cfg_t *cfg) |
SRAM 4 configuration object setup function. | |
err_t | sram4_init (sram4_t *ctx, sram4_cfg_t *cfg) |
SRAM 4 initialization function. | |
err_t | sram4_default_cfg (sram4_t *ctx) |
SRAM 4 default configuration function. | |
err_t | sram4_generic_command (sram4_t *ctx, uint8_t cmd) |
SRAM 4 command writing function. | |
err_t | sram4_generic_write (sram4_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
SRAM 4 data writing function. | |
err_t | sram4_generic_read (sram4_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
SRAM 4 data reading function. | |
err_t | sram4_generic_write_then_read (sram4_t *ctx, uint8_t *data_in, uint8_t in_len, uint8_t *data_out, uint8_t out_len) |
SRAM 4 data writing and reading function. | |
err_t | sram4_memory_write (sram4_t *ctx, uint16_t memory_adr, uint8_t *write_data, uint8_t write_len) |
Write data to memory. | |
err_t | sram4_memory_read (sram4_t *ctx, uint16_t memory_adr, uint8_t *read_data, uint8_t read_len) |
Read data from memory. | |
void | sram4_set_hold (sram4_t *ctx, uint8_t state) |
Set HOLD pin state. | |
API for configuring and manipulating SRAM 4 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void sram4_cfg_setup | ( | sram4_cfg_t * | cfg | ) |
SRAM 4 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See sram4_cfg_t object definition for detailed explanation. |
err_t sram4_default_cfg | ( | sram4_t * | ctx | ) |
SRAM 4 default configuration function.
This function executes a default configuration of SRAM 4 click board.
[in] | ctx | : Click context object. See sram4_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t sram4_generic_command | ( | sram4_t * | ctx, |
uint8_t | cmd ) |
SRAM 4 command writing function.
This function writes a data byte by using SPI serial interface.
[in] | ctx | : Click context object. See sram4_t object definition for detailed explanation. |
[in] | cmd | : Command to send. |
0
- Success, -1
- Error.err_t sram4_generic_read | ( | sram4_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
SRAM 4 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 sram4_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 sram4_generic_write | ( | sram4_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
SRAM 4 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 sram4_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.err_t sram4_generic_write_then_read | ( | sram4_t * | ctx, |
uint8_t * | data_in, | ||
uint8_t | in_len, | ||
uint8_t * | data_out, | ||
uint8_t | out_len ) |
SRAM 4 data writing and reading function.
This function writes a desired number of data bytes, and then reads a desired number of data bytes by using SPI serial interface.
[in] | ctx | : Click context object. See sram4_t object definition for detailed explanation. |
[in] | data_in | : Data to be written. |
[in] | in_len | : Number of bytes to be written. |
[out] | data_out | : Output read data. |
[in] | out_len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t sram4_init | ( | sram4_t * | ctx, |
sram4_cfg_t * | cfg ) |
SRAM 4 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See sram4_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See sram4_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t sram4_memory_read | ( | sram4_t * | ctx, |
uint16_t | memory_adr, | ||
uint8_t * | read_data, | ||
uint8_t | read_len ) |
Read data from memory.
This function reads a data starting from selected memory address.
[in] | ctx | : Click context object. See sram4_t object definition for detailed explanation. |
[in] | memory_adr | : Memory address to start reading data from. |
[out] | read_data | : Read data. |
[in] | read_len | : Number of bytes to read starting from selected memory address. |
0
- Success, -1
- Error.err_t sram4_memory_write | ( | sram4_t * | ctx, |
uint16_t | memory_adr, | ||
uint8_t * | write_data, | ||
uint8_t | write_len ) |
Write data to memory.
This function writes a data starting from selected memory address.
[in] | ctx | : Click context object. See sram4_t object definition for detailed explanation. |
[in] | memory_adr | : Memory address to start writeing data to. |
[in] | write_data | : Data to write. |
[in] | write_len | : Number of bytes to write starting from selected memory address. |
0
- Success, -1
- Error.