/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2022 Kentaro Sekimoto
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 * This file is part of the TinyUSB stack.
 */

#ifndef PROJECTS_CDC_HID_SRC_MCP2221_H_
#define PROJECTS_CDC_HID_SRC_MCP2221_H_

// Status Set Parameters
#define MCP2221_STATUS_SET_PARAMS       0x10

// Read Flash Data
#define MCP2221_RFD                     0xb0
#define MCP2221_RFD_READ_CHIP_SETTINGS  0x00
#define MCP2221_RFD_READ_GP_SETTINGS    0x01
#define MCP2221_RFD_READ_MF_DESC_STR    0x02
#define MCP2221_RFD_READ_PR_DESC_STR    0x03
#define MCP2221_RFD_READ_SN_DESC_STR    0x04
#define MCP2221_RFD_READ_CHIP_SN        0x05

// Write Flash Data
#define MCP2221_WFD                     0xb1
// Send Flash Access Password
#define MCP2221_SFAP                    0xb2
// I2C Write Data
#define MCP2221_I2C_WD                  0x90
// I2C Write Data Repeated-START
#define MCP2221_I2C_WD_RS               0x92
// I2C Write Data No Stop
#define MCP2221_I2C_WD_NS               0x94
// I2C Read Data
#define MCP2221_I2C_RD                  0x91
// I2C Read Data Repeated-START
#define MCP2221_I2C_RD_RS               0x93
// I2C Read Data Get I2C Data
#define MCP2221_I2C_RD_GET_I2C_DATA     0x40
// Set GPIO Output Values
#define MCP2221_SET_GPIO_OUTPUT_VALUES  0x50
// Get GPIO Values
#define MCP2221_GET_GPIO_VALUES         0x51
// Set SRAM settings
#define MCP2221_SET_SRAM_SETTINGS       0x60
// Get SRAM settings
#define MCP2221_GET_SRAM_SETTINGS       0x61
// Reset Chip
#define MCP2221_RESET_CHIP              0x70

#endif /* PROJECTS_CDC_HID_SRC_MCP2221_H_ */
