Declarations of Moneta functions.
Definition in file moneta.h.
#include "cmd_defs.h"
#include "spi_driver.h"
#include "helper_functions.h"
#include <stdio.h>
#include <stdlib.h>
Go to the source code of this file.
|
void | monetaWaitOnReady () |
| : Wait while Read/Busy Status bit in SRB is 1 (device is busy). More...
|
|
void | monetaWriteEnable () |
| OPCODE: 0x06
Sends opcode to enable writing. More...
|
|
void | monetaWriteDisable () |
| OPCODE: 0x04
Sends opcode to disable writing. More...
|
|
void | monetaReadSR (uint8_t *rxBuffer) |
| OPCODE: 0x05
Reads the value in the status registers. More...
|
|
void | monetaWriteSRB1 (uint8_t data) |
| OPCODE: 0x01
Writes the value in data to status register byte 1. More...
|
|
void | monetaWriteSRB2 (uint8_t data) |
| OPCODE: 0x31
Writes the value in data to status register byte 2. More...
|
|
void | monetaReadArray (uint16_t address, uint8_t *rxBuffer, uint32_t rxNumBytes) |
| OPCODE: 0x03
Reads rxNumBytes starting from location 'address' and stores the data in the byte array rx. More...
|
|
void | monetaWriteArray (uint16_t address, uint8_t *txBuffer, uint32_t txNumBytes) |
| OPCODE: 0x02
Writes txNumBytes bytes of data starting at the address indicated by address. More...
|
|
void | monetaReadMID (uint8_t *rxBuffer) |
| OPCODE: 0x9F
Reads the manufacturer ID and stores the data in rxBuffer. More...
|
|
void | monetaUDPDMode1 () |
| OPCODE: 0x79
Sends the device into Ultra Deep Power Down Mode 1. Exit UDPD Mode 1 by power cycling the device or calling function monetaEUDPDHardwareReset() which performs a JEDEC reset. More...
|
|
void | monetaHardwareReset () |
| Exits Ultra Deep Power Down mode using the hardware reset option. More...
|
|
◆ monetaHardwareReset()
void monetaHardwareReset |
( |
| ) |
|
Exits Ultra Deep Power Down mode using the hardware reset option.
- Return values
-
Definition at line 177 of file moneta.c.
◆ monetaReadArray()
void monetaReadArray |
( |
uint16_t |
address, |
|
|
uint8_t * |
rxBuffer, |
|
|
uint32_t |
rxNumBytes |
|
) |
| |
OPCODE: 0x03
Reads rxNumBytes starting from location 'address' and stores the data in the byte array rx.
- Parameters
-
address | 2 byte address starting from which the data in memory will be read. |
rxBuffer | Pointer to the byte array in which the read data will be stored. Must have at least rxNumBytes elements. |
rxNumBytes | Number of bytes to be read from the memory. rxBuffer must have a minimum of this many elements. |
- Return values
-
Definition at line 121 of file moneta.c.
◆ monetaReadMID()
void monetaReadMID |
( |
uint8_t * |
rxBuffer | ) |
|
OPCODE: 0x9F
Reads the manufacturer ID and stores the data in rxBuffer.
- Parameters
-
rxBuffer | Pointer to a byte array in which the data will be stored. Minimum of 8 bytes required. |
- Return values
-
Definition at line 157 of file moneta.c.
◆ monetaReadSR()
void monetaReadSR |
( |
uint8_t * |
rxBuffer | ) |
|
OPCODE: 0x05
Reads the value in the status registers.
- Parameters
-
rxBuffer | Pointer to the byte array in which the read data will be stored. Must have at least 2 elements. |
- Return values
-
Definition at line 86 of file moneta.c.
◆ monetaUDPDMode1()
OPCODE: 0x79
Sends the device into Ultra Deep Power Down Mode 1. Exit UDPD Mode 1 by power cycling the device or calling function monetaEUDPDHardwareReset() which performs a JEDEC reset.
- Return values
-
Definition at line 167 of file moneta.c.
◆ monetaWaitOnReady()
void monetaWaitOnReady |
( |
| ) |
|
: Wait while Read/Busy Status bit in SRB is 1 (device is busy).
- Return values
-
Definition at line 53 of file moneta.c.
◆ monetaWriteArray()
void monetaWriteArray |
( |
uint16_t |
address, |
|
|
uint8_t * |
txBuffer, |
|
|
uint32_t |
txNumBytes |
|
) |
| |
OPCODE: 0x02
Writes txNumBytes bytes of data starting at the address indicated by address.
- Parameters
-
address | The 2 bytes address indicating the first location to be written to. Note page restrictions in manual. |
txBuffer | Pointer to the tx bytes that will be stored in memory. Must have a minimum of txNumBytes elements. |
txNumBytes | Number of bytes to be written to the device. txBuffer must have a minimum of this many elements. |
- Return values
-
- Warning
- Check datasheet for the maximum number of bytes that can be written, as well as the device behavior if writing goes beyond the page boundary.
Definition at line 134 of file moneta.c.
◆ monetaWriteDisable()
void monetaWriteDisable |
( |
| ) |
|
OPCODE: 0x04
Sends opcode to disable writing.
- Return values
-
Definition at line 75 of file moneta.c.
◆ monetaWriteEnable()
void monetaWriteEnable |
( |
| ) |
|
OPCODE: 0x06
Sends opcode to enable writing.
- Return values
-
Definition at line 64 of file moneta.c.
◆ monetaWriteSRB1()
void monetaWriteSRB1 |
( |
uint8_t |
data | ) |
|
OPCODE: 0x01
Writes the value in data to status register byte 1.
- Parameters
-
data | Byte of data to be written into status register byte 1. |
- Return values
-
Definition at line 97 of file moneta.c.
◆ monetaWriteSRB2()
void monetaWriteSRB2 |
( |
uint8_t |
data | ) |
|
OPCODE: 0x31
Writes the value in data to status register byte 2.
- Parameters
-
data | Byte of data to be written into status register byte 2. |
- Return values
-
Definition at line 109 of file moneta.c.
◆ txMonetaInternalBuffer