# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""Pin definitions for the Khadas VIM3."""

from adafruit_blinka.microcontroller.amlogic.a311d import pin

GPIOAO_0 = pin.GPIO496
GPIOAO_1 = pin.GPIO497
GPIOAO_2 = pin.GPIO498
GPIOAO_3 = pin.GPIO499
GPIOAO_4 = pin.GPIO500
GPIOAO_5 = pin.GPIO501
GPIOAO_6 = pin.GPIO502
GPIOAO_7 = pin.GPIO503
GPIOAO_8 = pin.GPIO504
GPIOAO_9 = pin.GPIO505
GPIOAO_10 = pin.GPIO506
GPIOAO_11 = pin.GPIO507

GPIOE_0 = pin.GPIO508
GPIOE_1 = pin.GPIO509
GPIOE_2 = pin.GPIO510

GPIOZ_0 = pin.GPIO427
GPIOZ_1 = pin.GPIO428
GPIOZ_2 = pin.GPIO429
GPIOZ_3 = pin.GPIO430
GPIOZ_4 = pin.GPIO431
GPIOZ_5 = pin.GPIO432
GPIOZ_6 = pin.GPIO433
GPIOZ_7 = pin.GPIO434
GPIOZ_8 = pin.GPIO435
GPIOZ_9 = pin.GPIO436
GPIOZ_10 = pin.GPIO437
GPIOZ_11 = pin.GPIO438
GPIOZ_12 = pin.GPIO439
GPIOZ_13 = pin.GPIO440
GPIOZ_14 = pin.GPIO441
GPIOZ_15 = pin.GPIO442

GPIOH_0 = pin.GPIO443
GPIOH_1 = pin.GPIO444
GPIOH_2 = pin.GPIO445
GPIOH_3 = pin.GPIO446
GPIOH_4 = pin.GPIO447
GPIOH_5 = pin.GPIO448
GPIOH_6 = pin.GPIO449
GPIOH_7 = pin.GPIO450
GPIOH_8 = pin.GPIO451

BOOT_0 = pin.GPIO452
BOOT_1 = pin.GPIO453
BOOT_2 = pin.GPIO454
BOOT_3 = pin.GPIO455
BOOT_4 = pin.GPIO456
BOOT_5 = pin.GPIO457
BOOT_6 = pin.GPIO458
BOOT_7 = pin.GPIO459
BOOT_8 = pin.GPIO460
BOOT_9 = pin.GPIO461
BOOT_10 = pin.GPIO462
BOOT_11 = pin.GPIO463
BOOT_12 = pin.GPIO464
BOOT_13 = pin.GPIO465
BOOT_14 = pin.GPIO466
BOOT_15 = pin.GPIO467

GPIOC_0 = pin.GPIO468
GPIOC_1 = pin.GPIO469
GPIOC_2 = pin.GPIO470
GPIOC_3 = pin.GPIO471
GPIOC_4 = pin.GPIO472
GPIOC_5 = pin.GPIO473
GPIOC_6 = pin.GPIO474
GPIOC_7 = pin.GPIO475

GPIOA_0 = pin.GPIO460
GPIOA_1 = pin.GPIO461
GPIOA_2 = pin.GPIO462
GPIOA_3 = pin.GPIO463
GPIOA_4 = pin.GPIO464
GPIOA_5 = pin.GPIO465
GPIOA_6 = pin.GPIO466
GPIOA_7 = pin.GPIO467
GPIOA_8 = pin.GPIO468
GPIOA_9 = pin.GPIO469
GPIOA_10 = pin.GPIO470
GPIOA_11 = pin.GPIO471
GPIOA_12 = pin.GPIO472
GPIOA_13 = pin.GPIO473
GPIOA_14 = pin.GPIO474
GPIOA_15 = pin.GPIO475

GPIOX_0 = pin.GPIO476
GPIOX_1 = pin.GPIO477
GPIOX_2 = pin.GPIO478
GPIOX_3 = pin.GPIO479
GPIOX_4 = pin.GPIO480
GPIOX_5 = pin.GPIO481
GPIOX_6 = pin.GPIO482
GPIOX_7 = pin.GPIO483
GPIOX_8 = pin.GPIO484
GPIOX_9 = pin.GPIO485
GPIOX_10 = pin.GPIO486
GPIOX_11 = pin.GPIO487
GPIOX_12 = pin.GPIO488
GPIOX_13 = pin.GPIO489
GPIOX_14 = pin.GPIO490
GPIOX_15 = pin.GPIO491
GPIOX_16 = pin.GPIO492
GPIOX_17 = pin.GPIO493
GPIOX_18 = pin.GPIO494
GPIOX_19 = pin.GPIO495

SCL = pin.GPIOX_18
SDA = pin.GPIOX_17

SCLK = pin.SPI0_SCLK
MCLK0 = pin.SPI0_MCLK0
MISO = pin.SPI0_SDO
MOSI = pin.SPI0_SDI

D0 = GPIOAO_10  # PIN_13
D1 = GPIOH_6  # PIN_15
D2 = GPIOH_7  # PIN_16
D3 = GPIOAO_1  # PIN_18
D4 = GPIOAO_2  # PIN_19
D5 = GPIOA_15  # PIN_22
D6 = GPIOA_14  # PIN_23
D7 = GPIOAO_2  # PIN_25
D8 = GPIOAO_3  # PIN_26
D9 = GPIOA_1  # PIN_29
D10 = GPIOA_0  # PIN_30
D11 = GPIOA_3  # PIN_31
D12 = GPIOA_2  # PIN_32
D13 = GPIOA_4  # PIN_33
D14 = GPIOH_5  # PIN_35
D15 = GPIOH_4  # PIN_37
D16 = GPIOZ_15  # PIN_39
