Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Driver for the SST25Vxxxx flash chips. More...
#include "sst25vfxxxx.h"
Go to the source code of this file.
Functions | |
void | sst25vfxxxx_init (struct SST25VFxxxx *sst, struct spi_periph *spi_p, const uint8_t slave_idx, SPICallback spi_cb) |
Initializing the sst25vfxxxx chip. More... | |
void | sst25vfxxxx_after_cb (struct SST25VFxxxx *sst) |
Callback of the SPI after going one level higher for gathering the sst pointer. More... | |
void | sst25vfxxxx_read_id (struct SST25VFxxxx *sst) |
Read the chip identifier. More... | |
void | sst25vfxxxx_block_write_en (struct SST25VFxxxx *sst) |
Enable block writing. More... | |
void | sst25vfxxxx_chip_erase (struct SST25VFxxxx *sst) |
Full chip erase. More... | |
void | sst25vfxxxx_write (struct SST25VFxxxx *sst, uint8_t *transfer_buffer, uint8_t transfer_length) |
Write bytes. More... | |
void | sst25vfxxxx_read (struct SST25VFxxxx *sst, uint8_t *transfer_buffer, uint8_t transfer_length) |
Read bytes Need 5 more extra bytes because of SPI overhead. More... | |
Driver for the SST25Vxxxx flash chips.
Definition in file sst25vfxxxx.c.
void sst25vfxxxx_after_cb | ( | struct SST25VFxxxx * | sst | ) |
Callback of the SPI after going one level higher for gathering the sst pointer.
Definition at line 64 of file sst25vfxxxx.c.
References SST25VFxxxx::flash_addr, spi_transaction::input_buf, SST25VFxxxx::input_buf, spi_transaction::input_length, SST25VFxxxx::output_buf, spi_transaction::output_length, SST25VFxxxx::spi_p, spi_submit(), SST25VFxxxx::spi_t, SST25VFXXXX_AAI_PROG, SST25VFXXXX_BYTE_PROG, SST25VFXXXX_CHIP_ERASE, SST25VFXXXX_ERASE_CHIP, SST25VFXXXX_IDLE, SST25VFXXXX_RDSR, SST25VFXXXX_READ_BYTES, SST25VFXXXX_WRDI, SST25VFXXXX_WRITE_BYTES, SST25VFXXXX_WRITE_EN, SST25VFXXXX_WRSR, SST25VFxxxx::status, SST25VFxxxx::status_idx, SST25VFxxxx::transfer_buf, SST25VFxxxx::transfer_idx, and SST25VFxxxx::transfer_length.
Referenced by direct_memory_spi_cb().
void sst25vfxxxx_block_write_en | ( | struct SST25VFxxxx * | sst | ) |
Enable block writing.
Definition at line 240 of file sst25vfxxxx.c.
References spi_transaction::input_length, SST25VFxxxx::output_buf, spi_transaction::output_length, SST25VFxxxx::spi_p, spi_submit(), SST25VFxxxx::spi_t, SST25VFXXXX_EWSR, SST25VFXXXX_IDLE, SST25VFXXXX_WRITE_EN, SST25VFxxxx::status, and SST25VFxxxx::status_idx.
Referenced by sst25vfxxxx_init().
void sst25vfxxxx_chip_erase | ( | struct SST25VFxxxx * | sst | ) |
Full chip erase.
Definition at line 258 of file sst25vfxxxx.c.
References spi_transaction::input_length, SST25VFxxxx::output_buf, spi_transaction::output_length, SST25VFxxxx::spi_p, spi_submit(), SST25VFxxxx::spi_t, SST25VFXXXX_CHIP_ERASE, SST25VFXXXX_IDLE, SST25VFXXXX_WREN, SST25VFxxxx::status, and SST25VFxxxx::status_idx.
Referenced by direct_memory_logger_set().
void sst25vfxxxx_init | ( | struct SST25VFxxxx * | sst, |
struct spi_periph * | spi_p, | ||
const uint8_t | slave_idx, | ||
SPICallback | spi_cb | ||
) |
Initializing the sst25vfxxxx chip.
Definition at line 34 of file sst25vfxxxx.c.
References spi_transaction::after_cb, spi_transaction::bitorder, spi_transaction::cdiv, spi_transaction::cpha, spi_transaction::cpol, spi_transaction::dss, SST25VFxxxx::flash_addr, spi_transaction::input_buf, SST25VFxxxx::input_buf, spi_transaction::input_length, spi_transaction::output_buf, SST25VFxxxx::output_buf, spi_transaction::output_length, spi_transaction::select, spi_transaction::slave_idx, SST25VFxxxx::spi_p, SST25VFxxxx::spi_t, SPICphaEdge1, SPICpolIdleLow, SPIDiv32, SPIDss8bit, SPIMSBFirst, SPISelectUnselect, SPITransDone, sst25vfxxxx_block_write_en(), SST25VFXXXX_IDLE, spi_transaction::status, and SST25VFxxxx::status.
Referenced by direct_memory_logger_init().
void sst25vfxxxx_read | ( | struct SST25VFxxxx * | sst, |
uint8_t * | transfer_buffer, | ||
uint8_t | transfer_length | ||
) |
Read bytes Need 5 more extra bytes because of SPI overhead.
Definition at line 300 of file sst25vfxxxx.c.
References SST25VFxxxx::flash_addr, spi_transaction::input_buf, spi_transaction::input_length, SST25VFxxxx::output_buf, spi_transaction::output_length, SST25VFxxxx::spi_p, spi_submit(), SST25VFxxxx::spi_t, SST25VFXXXX_HGIH_SPEAD_READ, SST25VFXXXX_IDLE, SST25VFXXXX_READ_BYTES, SST25VFxxxx::status, and SST25VFxxxx::status_idx.
Referenced by direct_memory_logger_periodic(), and direct_memory_logger_set().
void sst25vfxxxx_read_id | ( | struct SST25VFxxxx * | sst | ) |
Read the chip identifier.
Definition at line 220 of file sst25vfxxxx.c.
References spi_transaction::input_length, SST25VFxxxx::output_buf, spi_transaction::output_length, SST25VFxxxx::spi_p, spi_submit(), SST25VFxxxx::spi_t, SST25VFXXXX_IDLE, SST25VFXXXX_RDID, SST25VFXXXX_READ_ID, and SST25VFxxxx::status.
void sst25vfxxxx_write | ( | struct SST25VFxxxx * | sst, |
uint8_t * | transfer_buffer, | ||
uint8_t | transfer_length | ||
) |
Write bytes.
Definition at line 276 of file sst25vfxxxx.c.
References spi_transaction::input_length, SST25VFxxxx::output_buf, spi_transaction::output_length, SST25VFxxxx::spi_p, spi_submit(), SST25VFxxxx::spi_t, SST25VFXXXX_IDLE, SST25VFXXXX_WREN, SST25VFXXXX_WRITE_BYTES, SST25VFxxxx::status, SST25VFxxxx::status_idx, SST25VFxxxx::transfer_buf, SST25VFxxxx::transfer_idx, and SST25VFxxxx::transfer_length.
Referenced by direct_memory_logger_periodic(), and direct_memory_logger_set().