Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
M25P16 Class Reference

#include <M25P16.h>

Public Member Functions

void init (SPI *_spi)
 
 M25P16 ()
 
void read (uint8_t *data, uint8_t len)
 
bool read_config (uint8_t *data, uint32_t len)
 
bool write_config (const uint8_t *data, const uint32_t len)
 
void write_page (uint8_t *data)
 

Private Types

enum  {
  WRITE_ENABLE = 0x06, WRITE_DISABLE = 0x04, READ_IDENTIFICATION = 0x9F, READ_IDENTIFICATION2 = 0x9E,
  READ_STATUS = 0x05, WRITE_STATUS = 0x01, READ_DATA = 0x03, READ_DATA_HIGH_SPEED = 0x0B,
  PAGE_PROGRAM = 0x02, SECTOR_ERASE = 0xD8, BULK_ERASE = 0xC7, DEEP_POWER_DOWN = 0xB9,
  RELEASE_DEEP_POWER_DOWN = 0xAB, STATUS_WEL_BIT = 0x02, STATUS_WIP_BIT = 0x01, STATUS_BLOCK_PROTECT_BITS = 0x1C,
  STATUS_SRWD_BIT = 0x80
}
 

Private Member Functions

uint8_t get_status ()
 

Private Attributes

uint32_t config_size_
 
GPIO cs_
 
uint32_t current_page_
 
uint32_t current_position_
 
uint32_t num_pages_for_config_
 
SPIspi_
 
uint8_t write_buffer_ [260]
 

Detailed Description

Definition at line 36 of file M25P16.h.

Member Enumeration Documentation

anonymous enum
private
Enumerator
WRITE_ENABLE 
WRITE_DISABLE 
READ_IDENTIFICATION 
READ_IDENTIFICATION2 
READ_STATUS 
WRITE_STATUS 
READ_DATA 
READ_DATA_HIGH_SPEED 
PAGE_PROGRAM 
SECTOR_ERASE 
BULK_ERASE 
DEEP_POWER_DOWN 
RELEASE_DEEP_POWER_DOWN 
STATUS_WEL_BIT 
STATUS_WIP_BIT 
STATUS_BLOCK_PROTECT_BITS 
STATUS_SRWD_BIT 

Definition at line 46 of file M25P16.h.

Constructor & Destructor Documentation

M25P16::M25P16 ( )

Definition at line 36 of file M25P16.cpp.

Member Function Documentation

uint8_t M25P16::get_status ( )
private

Definition at line 48 of file M25P16.cpp.

void M25P16::init ( SPI _spi)

Definition at line 38 of file M25P16.cpp.

void M25P16::read ( uint8_t *  data,
uint8_t  len 
)
bool M25P16::read_config ( uint8_t *  data,
uint32_t  len 
)

Definition at line 60 of file M25P16.cpp.

bool M25P16::write_config ( const uint8_t *  data,
const uint32_t  len 
)

Definition at line 77 of file M25P16.cpp.

void M25P16::write_page ( uint8_t *  data)

Member Data Documentation

uint32_t M25P16::config_size_
private

Definition at line 43 of file M25P16.h.

GPIO M25P16::cs_
private

Definition at line 40 of file M25P16.h.

uint32_t M25P16::current_page_
private

Definition at line 41 of file M25P16.h.

uint32_t M25P16::current_position_
private

Definition at line 42 of file M25P16.h.

uint32_t M25P16::num_pages_for_config_
private

Definition at line 44 of file M25P16.h.

SPI* M25P16::spi_
private

Definition at line 39 of file M25P16.h.

uint8_t M25P16::write_buffer_[260]
private

Definition at line 67 of file M25P16.h.


The documentation for this class was generated from the following files:


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Fri Oct 9 2020 03:17:21