2021-04-04 21:04:12 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
#include <optional>
|
|
|
|
|
|
2023-08-13 15:47:51 +01:00
|
|
|
namespace Targets::Microchip::Avr::Avr8Bit
|
2021-04-04 21:04:12 +01:00
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Pin configurations for AVR8 targets may vary across target variants. This is why we must differentiate a pin
|
|
|
|
|
* to a pad. A pin is mapped to a pad, but this mapping is variant specific. For example, pin 4 on
|
|
|
|
|
* the ATmega328P-PN (DIP variant) is mapped to a GPIO pad (PORTD/PIN2), but on the QFN variant (ATmega328P-MN),
|
|
|
|
|
* pin 4 is mapped to a GND pad.
|
|
|
|
|
*
|
|
|
|
|
* PadDescriptor describes a single pad on an AVR8 target. On target configuration, PadDescriptors are
|
2021-05-31 01:01:14 +01:00
|
|
|
* generated from the AVR8 target description file. These descriptors are mapped to pad names.
|
2021-04-04 21:04:12 +01:00
|
|
|
* See Avr8::loadPadDescriptors() for more.
|
|
|
|
|
*/
|
|
|
|
|
struct PadDescriptor
|
|
|
|
|
{
|
|
|
|
|
std::string name;
|
|
|
|
|
|
|
|
|
|
std::optional<std::uint8_t> gpioPinNumber;
|
2022-06-22 22:23:00 +01:00
|
|
|
std::optional<std::uint16_t> gpioPortAddress;
|
2021-04-04 21:04:12 +01:00
|
|
|
std::optional<std::uint16_t> gpioPortInputAddress;
|
2022-06-22 22:23:00 +01:00
|
|
|
std::optional<std::uint16_t> gpioDdrAddress;
|
2021-04-04 21:04:12 +01:00
|
|
|
};
|
|
|
|
|
}
|