Skyward boardcore
Loading...
Searching...
No Matches
Boardcore::DipSwitch Class Reference

Dip switch driver to read the current status of the switch. More...

#include <DipSwitch.h>

Public Member Functions

 DipSwitch (miosix::GpioPin &sh, miosix::GpioPin &clk, miosix::GpioPin &qh, std::chrono::microseconds microSecClk)
 
uint8_t read ()
 Performs a read of the dipSwitch.
 

Detailed Description

Dip switch driver to read the current status of the switch.

Definition at line 33 of file DipSwitch.h.

Constructor & Destructor Documentation

◆ DipSwitch()

Boardcore::DipSwitch::DipSwitch ( miosix::GpioPin & sh,
miosix::GpioPin & clk,
miosix::GpioPin & qh,
std::chrono::microseconds microSecClk )
inline

Definition at line 36 of file DipSwitch.h.

Member Function Documentation

◆ read()

uint8_t Boardcore::DipSwitch::read ( )

Performs a read of the dipSwitch.

Returns
uint8_t the read of the dip switch in big endian order. Dip 1 as most significant value, dip 8 as less significant.
Note
The order may depend on the dipswitch
visually the order in a 8bit word is: dip order: [ 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 ] bits order: 12345678

Definition at line 28 of file DipSwitch.cpp.


The documentation for this class was generated from the following files: