libdragon
Loading...
Searching...
No Matches
eeprom.h
Go to the documentation of this file.
1
7#ifndef __LIBDRAGON_EEPROM_H
8#define __LIBDRAGON_EEPROM_H
9
32#include <stdint.h>
33
47
51#define EEPROM_BLOCK_SIZE 8
52
53#ifdef __cplusplus
54extern "C" {
55#endif
56
66
73size_t eeprom_total_blocks( void );
74
84void eeprom_read( uint8_t block, uint8_t * dest );
85
97uint8_t eeprom_write( uint8_t block, const uint8_t * src );
98
112void eeprom_read_bytes( uint8_t * dest, size_t start, size_t len );
113
137void eeprom_write_bytes( const uint8_t * src, size_t start, size_t len );
138
139#ifdef __cplusplus
140}
141#endif
142
143#endif
eeprom_type_t
EEPROM Probe Values.
Definition eeprom.h:39
@ EEPROM_16K
16 kilobit (256-block) EEPROM present
Definition eeprom.h:45
@ EEPROM_NONE
No EEPROM present.
Definition eeprom.h:41
@ EEPROM_4K
4 kilobit (64-block) EEPROM present
Definition eeprom.h:43
void eeprom_write_bytes(const uint8_t *src, size_t start, size_t len)
Write a buffer of bytes to EEPROM.
Definition eeprom.c:140
void eeprom_read(uint8_t block, uint8_t *dest)
Read a block from EEPROM.
Definition eeprom.c:67
void eeprom_read_bytes(uint8_t *dest, size_t start, size_t len)
Read a buffer of bytes from EEPROM.
Definition eeprom.c:109
size_t eeprom_total_blocks(void)
Determine how many blocks of EEPROM exist on the cartridge.
Definition eeprom.c:57
eeprom_type_t eeprom_present(void)
Probe the EEPROM interface on the cartridge.
Definition eeprom.c:47
uint8_t eeprom_write(uint8_t block, const uint8_t *src)
Write a block to EEPROM.
Definition eeprom.c:87