CY14NVSRAMKIT-001 nvSRAM Development Kit User Guide, Doc. # 002-03522 Rev. *A
42
Kit Example Firmware
6.2
nvSRAM Access APIs
This section lists the nvSRAM access application programming interface (API) functions that are
used in the FM4 MCU example firmware. nvSRAM APIs are defined in
CY14B116.c
. See
6.1 Exam-
ple Firmware Structure
for file description and access path.
The following sections provide details on the nvSRAM APIs.
6.2.1
nvSRAMRead (uint32_t address, uint8_t length, uint8_t *txData)
/******************************************************************************
** \param address - memory address
** \param length - number of bytes to read
** \param txData - read data buffer
**
Table 6-2. nvSRAM Access APIs (
CY14B116.h
and
CY14B116.c
)
Functions
Description
Modes
nvSRAMRead (uint32_t address, uint8_t
length, uint8_t *txData)
Read from the nvSRAM, 1 to 255
bytes
None
nvSRAMWrite (uint32_t address,
uint16_t data)
Write to the nvSRAM, one address
location
nvSRAMWriteFullMem (uint16_t data1,
uint16_t data2)
Write the entire memory array (00000
to FFFEF) with 16-bit dataword1
(data1) and dataword2 (data2) at
consecutive address locations
nvSRAMReadRTC (uint8_t address,
uint8_t length, uint8_t *txData)
Read RTC registers
nvSRAMWriteRTC (uint8_t address,
uint8_t data)
Write to RTC registers
HSBStoreIF (void)
Triggers hardware store by toggling
the HSB# pin low
write_data_pattern (uint8_t pat, uint16_t
data)
Writes a test pattern to the full
nvSRAM array.
"pat" sets the data pattern to be
written. The pattern can be one of the
four patterns: Data, Data_bar,
Address, Address_bar. Data and
Address are values set by the user to
execute this function
DATA_PAT,
DATAB_PAT,
ADDR_PAT,
ADDRB_PAT
AutoStore (boolean_t enable)
Enable/Disable Auto Store in
nvSRAM
AUTOSTORE_ENABLE,
AUTOSTORE_DISABLE
SoftwareStoreRecall (boolean_t mode)
Trigger a Software Store/Recall
function in nvSRAM
SOFTSTORE,
SOFTRECALL
SleepIF (boolean_t mode)
Enters nvSRAM sleep mode by
toggling the ZZ# pin low
SLEEP_ENTRY,
SLEEP_EXIT
SquareWave (uint8_t mode)
Set the squarewave output on the INT
pin. By setting the correct mode, the
square wave output can either be
disabled or enabled with one of four
output frequencies: 1 Hz, 512 Hz,
4096 Hz, or 32768 Hz
DISABLE_SQ_WAVE,
ENABLE_1HZ,
ENABLE_512HZ,
ENABLE_4096HZ,
ENABLE_32768HZ
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from