M95P32 Part Driver API Documentation - Core ¶
This page documents the API of the Core component of the M95P32 part driver.
An overview of the driver is also available here: main_doc .
Functions ¶
Functions
-
int32_t
m95p32_drv_init
(
m95p32_object_t
*
pObj
,
uint32_t
dev_id
)
¶
-
Initialize the M95P32 EEPROM.
- Parameters :
-
pObj – the device instance object
dev_id – the device id
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_deinit
(
m95p32_object_t
*
pObj
)
¶
-
Deinitialize the M95P32 EEPROM.
- Parameters :
-
pObj – the device instance object
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_write_enable
(
m95p32_object_t
*
pObj
)
¶
-
Write enable sets the write enable latch (WEL) bit in the Status register to a 1.
- Parameters :
-
pObj – : pointer to memory object
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_write_disable
(
m95p32_object_t
*
pObj
)
¶
-
Write disable resets the write enable latch (WEL) bit in the Status register to a 0.
- Parameters :
-
pObj – : pointer to memory object
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_read_status_register
(
m95p32_object_t
*
pObj
,
uint8_t
*
pData
)
¶
-
Read status register allow the 8-bit Status registers to be read.
- Parameters :
-
pObj – : pointer to memory object
pData – : pointer to data buffer
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_single_read
(
m95p32_object_t
*
pObj
,
uint8_t
*
pData
,
uint32_t
TarAddr
,
uint32_t
Size
)
¶
-
Read data allows one or more data bytes to be sequentially read from the memory.
- Parameters :
-
pObj – : pointer to memory object
pData – : pointer to data buffer
TarAddr – : Starting address of the read command
Size – : Number of Bytes of data to be read
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_fast_read
(
m95p32_object_t
*
pObj
,
uint8_t
*
pData
,
uint32_t
TarAddr
,
uint32_t
Size
)
¶
-
Fast_Read allows one or more data bytes to be sequentially read from the memory but addition of eight dummy clocks after the 24-bit address it can operate at the highest possible frequency.
- Parameters :
-
pObj – : pointer to memory object
pData – : pointer to data buffer
TarAddr – : Starting address of the read command
Size – : Number of Bytes of data to be read
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_fast_dread
(
m95p32_object_t
*
pObj
,
uint8_t
*
pData
,
uint32_t
TarAddr
,
uint32_t
Size
)
¶
-
Dual_Fast_Read allows one or more data bytes to be sequentially read from the memory but addition of eight dummy clocks after the 24-bit address it can operate at the highest possible frequency. The data is output on pins DQ0 and DQ1.
- Parameters :
-
pObj – : pointer to memory object
pData – : pointer to data buffer
TarAddr – : Starting address of the read command
Size – : Number of Bytes of data to be read
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_fast_qread
(
m95p32_object_t
*
pObj
,
uint8_t
*
pData
,
uint32_t
TarAddr
,
uint32_t
Size
)
¶
-
Quad_Fast_Read allows one or more data bytes to be sequentially read from the memory but addition of eight dummy clocks after the 24-bit address it can operate at the highest possible frequency. The data is output on four pins (DQ0, DQ1, DQ2 and DQ3).
- Parameters :
-
pObj – : pointer to memory object
pData – : pointer to data buffer
TarAddr – : Starting address of the read command
Size – : Number of Bytes of data to be read
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_page_write
(
m95p32_object_t
*
pObj
,
uint8_t
*
pData
,
uint32_t
TarAddr
,
uint32_t
Size
)
¶
-
Page write allows data to be written in a single instruction (auto erase + program) leaving the other bytes of the page unchanged.
- Parameters :
-
pObj – : pointer to memory object
pData – : pointer to data buffer
TarAddr – : Starting address of the write command
Size – : Number of Bytes of data to be written
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_page_prog
(
m95p32_object_t
*
pObj
,
uint8_t
*
pData
,
uint32_t
TarAddr
,
uint32_t
Size
)
¶
-
The Page program allows data initially in the erased state (FFh), to be written.
- Parameters :
-
pObj – : pointer to memory object
pData – : pointer to data buffer
TarAddr – : Starting address of the write command
Size – : Number of Bytes of data to be written
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_page_erase
(
m95p32_object_t
*
pObj
,
uint32_t
TarAddr
)
¶
-
Page erase sets a page of 512 bytes within the device to the erased state of all 1s (FFh).
- Parameters :
-
pObj – : pointer to memory object
TarAddr – : Starting address of the erase command
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_sector_erase
(
m95p32_object_t
*
pObj
,
uint32_t
TarAddr
)
¶
-
Sector erase sets all memory bits within a specified sector (4 Kbytes) to the erased state of all 1s(FFh).
- Parameters :
-
pObj – : pointer to memory object
TarAddr – : Starting address of the erase command
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_block_erase
(
m95p32_object_t
*
pObj
,
uint32_t
TarAddr
)
¶
-
Block erase sets all memory bits within a specified block (64 Kbytes) to the erased state of all 1s(FFh).
- Parameters :
-
pObj – : pointer to memory object
TarAddr – : Starting address of the erase command
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_chip_erase
(
m95p32_object_t
*
pObj
)
¶
-
Chip erase sets all memory bits within the device to the erased state of all 1s(FFh).
- Parameters :
-
pObj – : pointer to memory object
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_read_id
(
m95p32_object_t
*
pObj
,
uint8_t
*
pData
,
uint32_t
TarAddr
,
uint32_t
Size
)
¶
-
Read identification allows one or more data bytes in the identification pages to be sequentially read.
- Parameters :
-
pObj – : pointer to memory object
pData – : pointer to data buffer
TarAddr – : Starting address of the read command
Size – : Number of Bytes of data to be read
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_fast_read_id
(
m95p32_object_t
*
pObj
,
uint8_t
*
pData
,
uint32_t
TarAddr
,
uint32_t
Size
)
¶
-
Fast read identification allows one or more data bytes in the two identification pages to be sequentially read but by addition of eight dummy clocks after the 24-bit address it can operate at the highest possible frequency.
- Parameters :
-
pObj – : pointer to memory object
pData – : pointer to data buffer
TarAddr – : Starting address of the read command
Size – : Number of Bytes of data to be read
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_read_volatile_register
(
m95p32_object_t
*
pObj
,
uint8_t
*
pData
)
¶
-
The Read Volatile register allow the 8-bit Volatile register to be read.
- Parameters :
-
pObj – : pointer to memory object
pData – : pointer to data buffer
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_write_volatile_register
(
m95p32_object_t
*
pObj
,
uint8_t
pData
)
¶
-
The Write volatile register allows the volatile register to be written. The writable volatile register bits include BUFEN and BUFLD.
- Parameters :
-
pObj – : pointer to memory object
pData – : Value to be written in volatile register
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_read_config_safety_register
(
m95p32_object_t
*
pObj
,
uint8_t
*
pData
,
uint32_t
Size
)
¶
-
The RDCR reads the two bytes of Configuration and Safety registers (one for each register).
- Parameters :
-
pObj – : pointer to memory object
pData – : pointer to data buffer
Size – : Number of Bytes of data to be written
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_write_status_config_register
(
m95p32_object_t
*
pObj
,
uint8_t
*
pData
,
uint32_t
Size
)
¶
-
Write status register allows the status and configuration register to be written.
- Parameters :
-
pObj – : pointer to memory object
pData – : pointer to data buffer
Size – : Number of Bytes of data to be read
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_clear_safety_flag
(
m95p32_object_t
*
pObj
)
¶
-
The Clear Safety register resets all the bits of the Safety register.
- Parameters :
-
pObj – : pointer to memory object
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_read_sfdp
(
m95p32_object_t
*
pObj
,
uint8_t
*
pData
,
uint32_t
TarAddr
,
uint32_t
Size
)
¶
-
The Read SFDP allows the SFDP register format to be read.
- Parameters :
-
pObj – : pointer to memory object
pData – : pointer to data buffer
TarAddr – : Starting address of the write command
Size – : Number of Bytes of data to be read
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_write_id_page
(
m95p32_object_t
*
pObj
,
uint8_t
*
pData
,
uint32_t
TarAddr
,
uint32_t
Size
)
¶
-
Write identification page instruction (WRID) allows the identification page to be written.
- Parameters :
-
pObj – : pointer to memory object
pData – : pointer to data buffer
TarAddr – : Starting address of the read command
Size – : Number of Bytes of data to be written
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_deep_power_down
(
m95p32_object_t
*
pObj
)
¶
-
The deep power-down enter allows to put the device in a very low consumption state in which a limited number of commands are available.
- Parameters :
-
pObj – : pointer to memory object
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_deep_power_down_release
(
m95p32_object_t
*
pObj
)
¶
-
The deep power-down release allows to release the device from the deep power-down state to a standby-mode state.
- Parameters :
-
pObj – : pointer to memory object
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_read_jedec
(
m95p32_object_t
*
pObj
,
uint8_t
*
pData
,
uint32_t
Size
)
¶
-
The JEDEC identification allows to read in loop mode the three device identification bytes in loop mode.
- Parameters :
-
pObj – : pointer to memory object
pData – : pointer to data buffer
Size – : Number of Bytes of data to be read
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_reset_enable
(
m95p32_object_t
*
pObj
)
¶
-
The enable reset initiate the reset the device.
- Parameters :
-
pObj – : pointer to memory object
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_soft_reset
(
m95p32_object_t
*
pObj
)
¶
-
The Software reset initiate the reset the device.
- Parameters :
-
pObj – : pointer to memory object
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_transmit_data_polling
(
m95p32_object_t
*
pObj
)
¶
-
This function polls WIP bit of status register.
- Parameters :
-
pObj – : pointer to memory object
- Return values :
-
0 – in case of success, an error code otherwise
-
int32_t
m95p32_drv_config_get_wp
(
m95p32_object_t
*
pObj
,
uint8_t
*
status
)
¶
-
Get the status of write protect pin.
- Parameters :
-
pObj – M95P32 context object.
status – The status value
-
int32_t
m95p32_drv_config_set_wp
(
m95p32_object_t
*
pObj
,
uint8_t
status
)
¶
-
Set the status of write protect pin.
- Parameters :
-
pObj – M95P32 context object.
status – The value to be set
-
int32_t
m95p32_drv_config_get_hold
(
m95p32_object_t
*
pObj
,
uint8_t
*
status
)
¶
-
Get the status of hold pin.
- Parameters :
-
pObj – M95P32 context object.
status – The status value
-
int32_t
m95p32_drv_config_set_hold
(
m95p32_object_t
*
pObj
,
uint8_t
status
)
¶
-
Set the status of hold pin.
- Parameters :
-
pObj – M95P32 context object.
status – The value to be set