Loading...
Searching...
No Matches

Data Structures

struct  Flash
 

Functions

DeviceHandle_t Flash_init (Flash *, char[DEVICE_NAME_LENGTH], GPIO_TypeDef *, unsigned long, int, long)
 Initialise flash struct.
 
void Flash_readPage (Flash *, uint32_t, volatile uint8_t *)
 Read from flash.
 
void Flash_writePage (Flash *, uint32_t, uint8_t *)
 Write page to flash.
 
void Flash_erase (Flash *)
 Erase flash chip.
 
void _Flash_writeEnable (Flash *)
 Send Write Enable instruction to the flash device.
 
void _Flash_readStatus1 (Flash *, uint8_t *)
 Read from Status Register 1.
 
void _Flash_readStatus2 (Flash *, uint8_t *)
 Read from Status Register 2.
 
void _Flash_readStatus3 (Flash *, uint8_t *)
 Read from Status Register 3.
 

Detailed Description

Author
Matt Ricci

Function Documentation

◆ Flash_init()

DeviceHandle_t Flash_init ( Flash * flash,
char name[DEVICE_NAME_LENGTH],
GPIO_TypeDef * port,
unsigned long cs,
int pageSize,
long pageCount )

Initialise flash struct.

Parameters
*flashPointer to Flash struct.
*portPointer to GPIO port.
csAddress to flash chip select.
Returns
NULL.

Definition at line 33 of file flash.c.

◆ Flash_readPage()

void Flash_readPage ( Flash * flash,
uint32_t address,
volatile uint8_t * data )

Read from flash.

Parameters
*flashPointer to Flash struct.
addressAddress in memory to write to.
*dataPointer to start of page buffer to read to.
Returns
NULL.

Definition at line 202 of file flash.c.

◆ Flash_writePage()

void Flash_writePage ( Flash * flash,
uint32_t address,
uint8_t * data )

Write page to flash.

Parameters
*flashPointer to Flash struct.
addressAddress in memory to write to.
*dataPointer to start of page buffer to write.
Returns
NULL.

Definition at line 166 of file flash.c.

◆ Flash_erase()

void Flash_erase ( Flash * flash)

Erase flash chip.

Parameters
*flashPointer to Flash struct.
Returns
NULL.

Definition at line 140 of file flash.c.

◆ _Flash_writeEnable()

void _Flash_writeEnable ( Flash * flash)

Send Write Enable instruction to the flash device.

Parameters
*flashPointer to Flash struct.
Returns
NULL.

Definition at line 66 of file flash.c.

◆ _Flash_readStatus1()

void _Flash_readStatus1 ( Flash * flash,
uint8_t * status )

Read from Status Register 1.

Parameters
*flashPointer to Flash struct.
*statusPointer to status output variable.
Returns
NULL.

Definition at line 83 of file flash.c.

◆ _Flash_readStatus2()

void _Flash_readStatus2 ( Flash * flash,
uint8_t * status )

Read from Status Register 2.

Parameters
*flashPointer to Flash struct.
*statusPointer to status output variable.
Returns
NULL.

Definition at line 101 of file flash.c.

◆ _Flash_readStatus3()

void _Flash_readStatus3 ( Flash * flash,
uint8_t * status )

Read from Status Register 3.

Parameters
*flashPointer to Flash struct.
*statusPointer to status output variable.
Returns
NULL.

Definition at line 119 of file flash.c.