tillitis-key/hw/usb_interface/ch552_fw/inc/gpio.h
Mikael Ågren 1e20dba10a
fpga/ch552: Swap fpga_cts and ch552_cts pins
The FPGA uwg30 package cannot use B3 as an input when an instance of
SB_PLL40_CORE is placed. We swap fpga_cts and ch552_cts to make B3 (from
here on fpga_cts) an output.

For more info check out:
FPGA-TN-02052-1-4-iCE40-sysCLOCK-PLL-Design-User-Guide.pdf chapter "5.1
PLL Placement Rules"
2025-05-19 08:55:26 +02:00

21 lines
418 B
C

// SPDX-FileCopyrightText: 2024 Tillitis AB <tillitis.se>
// SPDX-License-Identifier: MIT
#ifndef __GPIO_H__
#define __GPIO_H__
#include <stdint.h>
#define PIN_P1_4 0x10
#define PIN_P1_5 0x20
#define PIN_FPGA_CTS PIN_P1_5
#define PIN_CH552_CTS PIN_P1_4
void gpio_set(uint8_t pin);
void gpio_unset(uint8_t pin);
uint8_t gpio_get(uint8_t pin);
void gpio_dir_in(uint8_t pin);
void gpio_dir_out(uint8_t pin);
#endif