gpio

package
v0.0.0-...-b76d47b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2021 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BsrNoAction bsrrState = 0b00 // No action on the corresponding ODRx bit
	BsrAction   bsrrState = 0b01 // Set/Reset the corresponding ODRx bit
)
View Source
const (
	ModeInput  modeState = 0b00 // Input (reset state)
	ModeOutput modeState = 0b01 // General purpose output mode
	ModeAltFun modeState = 0b10 // Alternate function mode
	ModeAnalog modeState = 0b11 // Analog mode
)
View Source
const (
	ModerResetA moder = 0xA800_0000
	ModerResetB moder = 0x0280
	ModerReset  moder = 0
)
View Source
const (
	OspeedLow      ospeedrState = 0b00 // Low speed
	OspeedMedium   ospeedrState = 0b01 // Medium speed
	OspeedHigh     ospeedrState = 0b10 // High speed
	OspeedVeryHigh ospeedrState = 0b11 // Very high speed
)
View Source
const (
	OspeedrResetA ospeedr = 0x0C00_0000
	OspeedrResetB ospeedr = 0x00C0
	OspeedrReset  ospeedr = 0
)
View Source
const (
	OtypePushPull  otyperState = 0b00 // Output push-pull (reset state)
	OtypeOpenDrain otyperState = 0b01 // Output open-drain
)
View Source
const (
	BaseAddressPortA uint32 = 0x4002_0000
	BaseAddressPortB uint32 = 0x4002_0400
	BaseAddressPortC uint32 = 0x4002_0800
	BaseAddressPortD uint32 = 0x4002_0C00
	BaseAddressPortE uint32 = 0x4002_1000
	BaseAddressPortF uint32 = 0x4002_1400
	BaseAddressPortG uint32 = 0x4002_1800
	BaseAddressPortH uint32 = 0x4002_1C00
	BaseAddressPortI uint32 = 0x4002_2000
	BaseAddressPortJ uint32 = 0x4002_2400
	BaseAddressPortK uint32 = 0x4002_2800
)
View Source
const (
	PupdNoPullUp pupdrState = 0b00 // No pull-up, pull-down
	PupdPullUp   pupdrState = 0b01 // Pull-up
	PupdPullDown pupdrState = 0b10 // Pull-down
	PupdReserved pupdrState = 0b11 // Reserved
)
View Source
const (
	PupdrResetA pupdr = 0x6400_0000
	PupdrResetB pupdr = 0x0100
	PupdrReset  pupdr = 0
)
View Source
const AfrReset afr = 0
View Source
const BsrrReset bsrr = 0
View Source
const IdrReset idr = 0
View Source
const LckrReset lckr = 0
View Source
const ModePinSize uint8 = 2
View Source
const OdrReset odr = 0
View Source
const OspeedPinSize uint8 = 2
View Source
const OtyperReset otyper = 0
View Source
const PupdrPinSize uint8 = 2

Variables

This section is empty.

Functions

This section is empty.

Types

type Port

type Port struct {
	Moder       moder
	Otyper      otyper
	Ospeedr     ospeedr
	Pupdr       pupdr
	Idr         idr
	Odr         odr
	Bsrr        bsrr
	Lckr        lckr
	Afr         [2]afr
	BaseAddress uint32
}

func (Port) MarshalBinary

func (p Port) MarshalBinary() ([]byte, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL