Skip to content

Commit

Permalink
Synchronize Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Apehaenger committed Jul 29, 2024
1 parent db60b39 commit b873fda
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ git clone --recurse-submodules --jobs 8 https://github.com/modm-io/modm.git

## Microcontrollers

modm can create a HAL for <!--allcount-->3798<!--/allcount--> devices of these vendors:
modm can create a HAL for <!--allcount-->3828<!--/allcount--> devices of these vendors:

- STMicroelectronics STM32: <!--stmcount-->2993<!--/stmcount--> devices.
- STMicroelectronics STM32: <!--stmcount-->3023<!--/stmcount--> devices.
- Microchip SAM: <!--samcount-->416<!--/samcount--> devices.
- Microchip AVR: <!--avrcount-->388<!--/avrcount--> devices.
- Raspberry Pi: <!--rpicount-->1<!--/rpicount--> device.
Expand Down
22 changes: 13 additions & 9 deletions examples/stm32c0x/adc/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,29 +48,33 @@ main()
Adc1::initialize<Board::SystemClock, Adc1::ClockMode::Asynchronous, 3_MHz>();

uint16_t vref = Adc1::readInternalVoltageReference();
MODM_LOG_INFO << modm::endl << "vref=" << vref << "mV" << modm::endl;
MODM_LOG_INFO << modm::endl << "vref=" << vref << "mV";
int16_t Temp = Adc1::readTemperature(vref);
MODM_LOG_INFO << "Temp=" << Temp << modm::endl;
MODM_LOG_INFO << " Temp=" << Temp << "Deg.C" << modm::endl << modm::flush;

Adc1::setChannels(std::array{Adc1::Channel::In1, Adc1::Channel::In2});
//Adc1::setChannels(std::array{Adc1::Channel::In1, Adc1::Channel::In2});
Adc1::setResolution(Adc1::Resolution::Bits12);
Adc1::setRightAdjustResult();
Adc1::setSampleTime(Adc1::SampleTime::Cycles160_5);
Adc1::enableFreeRunningMode();
//Adc1::enableFreeRunningMode();
// Adc1::enableOversampling(Adc1::OversampleRatio::x256, Adc1::OversampleShift::Div256);

Adc1::enableInterruptVector(5);
Adc1::enableInterrupt(Adc1::Interrupt::EndOfConversion);
// Adc1::enableInterrupt(Adc1::Interrupt::EndOfConversion | Adc1::Interrupt::EndOfSequence);
AdcInterrupt1::attachInterruptHandler(printAdc);
Adc1::startConversion();
//Adc1::enableInterruptVector(5);
//Adc1::enableInterrupt(Adc1::Interrupt::EndOfConversion);
//Adc1::enableInterrupt(Adc1::Interrupt::EndOfConversion | Adc1::Interrupt::EndOfSequence);
//AdcInterrupt1::attachInterruptHandler(printAdc);
//Adc1::startConversion();

while (true)
{
LedGn::toggle();
modm::delay(500ms);

// MODM_LOG_INFO << "mV=" << (vref * Adc1::getValue() / 4095ul) << modm::endl;
vref = Adc1::readInternalVoltageReference();
MODM_LOG_INFO << "vref=" << vref << "mV";
Temp = Adc1::readTemperature(vref);
MODM_LOG_INFO << " Temp=" << Temp << "deg.C" << modm::endl << modm::flush;
}

return 0;
Expand Down

0 comments on commit b873fda

Please sign in to comment.