libeasymcp2221 2.0.3
mcp2221_flash.h
Go to the documentation of this file.
1
6#ifndef MCP2221_FLASH_H
7#define MCP2221_FLASH_H
8
9#include <stddef.h>
10#include <stdint.h>
11
12#include "mcp2221.h"
13
15
39MCP2221_API mcp2221_error_code_t mcp2221_flash_read(mcp2221_t *dev, uint8_t section, uint8_t out[60]);
40
66MCP2221_API mcp2221_error_code_t mcp2221_flash_write(mcp2221_t *dev, uint8_t section, const uint8_t data[60]);
67
98 mcp2221_t *dev, uint8_t section,
99 const uint8_t *data, size_t data_len);
100
125
127#endif // MCP2221_FLASH_H
Core MCP2221 device and I2C master API.
struct mcp2221_device mcp2221_t
Opaque MCP2221 device handle.
Definition: mcp2221.h:28
mcp2221_error_code_t
Error codes used by libeasymcp2221.
#define MCP2221_API
Export or import a public libeasymcp2221 API symbol.
#define MCP2221_END_DECLS
End a block started by MCP2221_BEGIN_DECLS.
#define MCP2221_BEGIN_DECLS
Begin a block of declarations using C linkage.
mcp2221_error_code_t mcp2221_flash_read(mcp2221_t *dev, uint8_t section, uint8_t out[60])
Read one MCP2221 flash section.
mcp2221_error_code_t mcp2221_flash_write_ex(mcp2221_t *dev, uint8_t section, const uint8_t *data, size_t data_len)
Write a length-delimited MCP2221 Write Flash Data payload.
mcp2221_error_code_t mcp2221_flash_write(mcp2221_t *dev, uint8_t section, const uint8_t data[60])
Write one MCP2221 flash section using the legacy 60-byte payload.
mcp2221_error_code_t mcp2221_flash_send_password(mcp2221_t *dev, const uint8_t pwd[8])
Send the eight-byte flash access password.