Electronics and Software
Engineering Innovation
ArmsysApi  0.12.18

#include <BGpio.h>

Public Types

enum  Mode { ModeInput = 0x00, ModeOutput = 0x01, ModeAlternate = 0x02, ModeAnalog = 0x03 }
 
enum  OutType { OutTypePushPull = 0x00, OutTypeOpenDrain = 0x01 }
 
enum  Pull { PullNone = 0x00, PullUp = 0x01, PullDown = 0x02 }
 
enum  Speed { Speed1MHz = 0x00, Speed25MHz = 0x01, Speed50MHz = 0x02, Speed100MHz = 0x03 }
 
enum  Source {
  Source0 = 0x00, Source1 = 0x01, Source2 = 0x02, Source3 = 0x03,
  Source4 = 0x04, Source5 = 0x05, Source6 = 0x06, Source7 = 0x07,
  Source8 = 0x08, Source9 = 0x09, Source10 = 0x0a, Source11 = 0x0b,
  Source12 = 0x0c, Source13 = 0x0d, Source14 = 0x0e, Source15 = 0x0f,
  SourceTim1 = 0x01, SourceTim2 = 0x01, SourceTim3 = 0x02, SourceTim4 = 0x02,
  SourceTim5 = 0x02, SourceTim8 = 0x03, SourceTim9 = 0x03, SourceTim10 = 0x03,
  SourceTim11 = 0x03, SourceTim12 = 0x09, SourceTim13 = 0x09, SourceTim14 = 0x09,
  SourceSpi1 = 0x05, SourceSpi2 = 0x05, SourceSpi3 = 0x06, SourceI2c1 = 0x04,
  SourceI2c2 = 0x04, SourceI2c3 = 0x04, SourceUart123 = 0x07, SourceUart456 = 0x08,
  SourceCan = 0x09, SourceFsmc = 0x0c, SourceSdio = 0x0c
}
 

Public Member Functions

 BGpio ()
 
void init ()
 Initialise the gpio system. More...
 
void initPin (Pin pin, Mode mode, OutType outType=OutTypePushPull, Pull pull=PullNone, Speed speed=Speed100MHz, Source source=Source0)
 Set the pins mode. More...
 
void setAlternateSource (Pin pin, Source source)
 Set the pins alternate source. More...
 
void setPin (Pin pin, UInt8 state)
 Set the ping to the given state, Off = 0, On = 1. More...
 
void togglePin (Pin pin)
 Toggle the pins state. More...
 
UInt8 getPin (Pin pin)
 Get the pins state. More...
 

Member Enumeration Documentation

◆ Mode

Enumerator
ModeInput 
ModeOutput 
ModeAlternate 
ModeAnalog 

◆ OutType

Enumerator
OutTypePushPull 
OutTypeOpenDrain 

◆ Pull

Enumerator
PullNone 
PullUp 
PullDown 

◆ Source

Enumerator
Source0 
Source1 
Source2 
Source3 
Source4 
Source5 
Source6 
Source7 
Source8 
Source9 
Source10 
Source11 
Source12 
Source13 
Source14 
Source15 
SourceTim1 
SourceTim2 
SourceTim3 
SourceTim4 
SourceTim5 
SourceTim8 
SourceTim9 
SourceTim10 
SourceTim11 
SourceTim12 
SourceTim13 
SourceTim14 
SourceSpi1 
SourceSpi2 
SourceSpi3 
SourceI2c1 
SourceI2c2 
SourceI2c3 
SourceUart123 
SourceUart456 
SourceCan 
SourceFsmc 
SourceSdio 

◆ Speed

Enumerator
Speed1MHz 
Speed25MHz 
Speed50MHz 
Speed100MHz 

Constructor & Destructor Documentation

◆ BGpio()

BGpio::BGpio ( )

Member Function Documentation

◆ getPin()

UInt8 BGpio::getPin ( Pin  pin)

Get the pins state.

◆ init()

void BGpio::init ( )

Initialise the gpio system.

◆ initPin()

void BGpio::initPin ( Pin  pin,
Mode  mode,
OutType  outType = OutTypePushPull,
Pull  pull = PullNone,
Speed  speed = Speed100MHz,
Source  source = Source0 
)

Set the pins mode.

◆ setAlternateSource()

void BGpio::setAlternateSource ( Pin  pin,
Source  source 
)

Set the pins alternate source.

◆ setPin()

void BGpio::setPin ( Pin  pin,
UInt8  state 
)

Set the ping to the given state, Off = 0, On = 1.

◆ togglePin()

void BGpio::togglePin ( Pin  pin)

Toggle the pins state.


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