blob: 657d6f0dee8dd5fcfdecb88e7aba74a684b2028f [file]
// Copyright 2022 Google LLC.
// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
#ifndef MATCHA_SW_DEVICE_LIB_TESTING_PINMUX_TESTUTILS_H_
#define MATCHA_SW_DEVICE_LIB_TESTING_PINMUX_TESTUTILS_H_
#include <stdint.h>
#include "sw/device/lib/dif/dif_gpio.h"
#include "sw/device/lib/dif/dif_pinmux.h"
/**
* Default pinmux initialization.
*
* Initializes GPIOs to map to the lowest-numbered MIOs, except where it
* conflicts with UARTs. Then initializes 2 UART mappings to (IOC3,IOC10) and
* (IOC4,IOC10), denoted as (RX pin,TX pin).
*
* This function is specific to top_matcha
*/
void pinmux_testutils_init(dif_pinmux_t *pinmux);
extern const dif_pinmux_index_t kPinmuxTestutilsGpioInselPins[kDifGpioNumPins];
extern const dif_pinmux_index_t kPinmuxTestutilsGpioMioOutPins[kDifGpioNumPins];
/**
* Returns the mask of testable GPIO pins.
*
* Returns a simulation-device-specific mask that enables testing of only a
* subset of GPIOs depending on the IO allocation limitations.
*/
uint32_t pinmux_testutils_get_testable_gpios_mask(void);
#endif // MATCHA_SW_DEVICE_LIB_TESTING_PINMUX_TESTUTILS_H_