MBot Software Library  v1.0
An API documentation to mbot_firmware repository
fram.h
1 #ifndef MBOT_FRAM_H
2 #define MBOT_FRAM_H
3 
4 #include <stdio.h>
5 #include <stdint.h>
6 
7 #include <hardware/i2c.h>
8 #include <pico/stdlib.h>
9 
10 #define FUJITSU_MANUF_ID 0x00A
11 
12 #define MAXADDRESS 512
13 #define PROD_ID_MB85RC04V 0x010 // 4k version
14 #define DENSITY_MB85RC04V 0x0 // 4k version
15 #define MB85RC_ADDRESS_A00 0x50
16 #define MB85RC_ADDRESS_A01 0x52
17 #define MB85RC_ADDRESS_A10 0x54
18 #define MB85RC_ADDRESS_A11 0x56
19 #define MB85RC_DEFAULT_ADDRESS MB85RC_ADDRESS_A00
20 
21 #define MASTER_CODE 0xF8
22 
23 #define I2C_FRAM i2c0
24 
32 int mbot_init_fram();
33 
41 int mbot_read_fram(uint16_t addr, size_t length, uint8_t* data);
42 
50 int mbot_write_fram(uint16_t addr, size_t length, uint8_t* data);
51 
59 int mbot_read_word_fram(uint16_t addr, uint16_t* data);
60 
68 int mbot_write_word_fram(uint16_t addr, uint16_t data);
69 
77 int mbot_erase_fram(void);
78 
79 #endif