NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
Loading...
Searching...
No Matches
twi_flash.c File Reference

TWI flash driver. More...

#include <neorv32.h>
#include <config.h>
#include <twi_flash.h>

Functions

int twi_flash_read_word (uint32_t addr, uint32_t *rdata)
 
int twi_flash_write_byte (uint32_t addr, uint8_t wdata, int stop)
 
int twi_flash_write_word (uint32_t addr, uint32_t wdata)
 
void twi_flash_delay_twi_tick (int tick_count)
 Keeps TWI Peripheral in IDLE for 'tick_count' TWI clock ticks.
 

Detailed Description

TWI flash driver.

Function Documentation

◆ twi_flash_delay_twi_tick()

void twi_flash_delay_twi_tick ( int tick_count)

Keeps TWI Peripheral in IDLE for 'tick_count' TWI clock ticks.

Parameters
tick_countAmount of TWI NOP ticks to wait

◆ twi_flash_read_word()

int twi_flash_read_word ( uint32_t addr,
uint32_t * rdata )

Read 32-bit word from word-aligned TWI flash address.

Parameters
[in]addrWord-aligned address.
[in,out]rdataPointer for returned data (uint32_t).
Returns
0 if success, != 0 if error

◆ twi_flash_write_byte()

int twi_flash_write_byte ( uint32_t addr,
uint8_t wdata,
int stop )

Write single byte to TWI flash.

Parameters
addrTWI flash write address.
wdataTWI flash write data.
stopSend TWI stop command at end of transmission
Returns
0 if success, !=0 if error

◆ twi_flash_write_word()

int twi_flash_write_word ( uint32_t addr,
uint32_t wdata )

Write word to TWI flash.

Parameters
addrTWI flash write address.
wdataTWI flash write data.
Returns
0 if success, !=0 if error