Test program done

This commit is contained in:
Luca Lizaranzu
2026-03-20 11:41:44 -07:00
parent 303a554595
commit 1b29371fff
20 changed files with 1037 additions and 114 deletions

View File

@@ -17,31 +17,33 @@ class SHAL_GPIO{
public:
void toggle() volatile;
void toggle() const volatile;
//TODO replace stupid offset hack from APB
void setHigh();
void setLow();
void setHigh() const;
void setLow() const;
/// Uses the ADC to read an analog voltage value
/// \param sampleTime The amount of clock cycles to use for the ADC
/// \return ADC result
//uint16_t analogRead(SHAL_ADC_SampleTime sampleTime = SHAL_ADC_SampleTime::C8); TODO Reimplement
uint16_t digitalRead();
uint16_t digitalRead() const;
void setAlternateFunction(GPIO_Alternate_Function AF) volatile;
void setAlternateFunction(GPIO_Alternate_Function AF) const volatile;
//void setAlternateFunction(GPIO_Alternate_Function_Mapping AF) volatile; //TODO reimplement?
void setOutputType(PinType type) volatile;
void setOutputType(PinType type) const volatile;
void setOutputSpeed(OutputSpeed speed) volatile;
void setOutputSpeed(OutputSpeed speed) const volatile;
void setInternalResistor(InternalResistorType type) volatile;
void setInternalResistor(InternalResistorType type) const volatile;
//void useAsExternalInterrupt(TriggerMode mode, EXTICallback callback); TODO reimplement
SHAL_Result setPinMode(PinMode mode) volatile;
SHAL_Result setPinMode(PinMode mode) const volatile;
[[nodiscard]] GPIO_Key getKey() const {return m_GPIO_KEY;};
private:
@@ -73,6 +75,9 @@ class GPIOManager{
public:
static SHAL_GPIO& get(GPIO_Key);
static SHAL_GPIO& get(uint8_t portNum, uint8_t pinNum);
static void initGPIO(GPIO_Key key);
//static SHAL_ADC getGPIOADC(){ return m_GPIO_ADC;} TODO Reimplement