Documentation
¶
Overview ¶
Package power provides interface to the power managemnt peripheral.
Index ¶
- func ClearRAMPOWER(n int, mask RAMPower)
- func ClearRESETREAS(mask ResetReas)
- func DisableIRQ(mask te.EventMask)
- func EnableIRQ(mask te.EventMask)
- func GPREGRET(n int) *mmio.U32
- func IRQ() rtos.IRQ
- func IRQEnabled() te.EventMask
- func LoadDCDCEN() bool
- func LoadRESET() bool
- func SetRAMPOWER(n int, mask RAMPower)
- func SetSYSTEMOFF()
- func StoreDCDCEN(en bool)
- func StorePOFCON(pofcon POFCon)
- func StoreRAMON(on, retain RAMBlocks)
- func StoreRAMPOWER(n int, val RAMPower)
- func StoreRESET(pinreset bool)
- type Event
- type POFCon
- type RAMBlocks
- type RAMPower
- type ResetReas
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearRAMPOWER ¶
ClearRAMPOWER sets off power configuration of RAM block n according to mask (nRF52).
func ClearRESETREAS ¶
func ClearRESETREAS(mask ResetReas)
ClearRESETREAS clears reset reason bits specified by mask.
func DisableIRQ ¶
DisableIRQ disables generating interrupts by events specified by mask
func GPREGRET ¶
GPREGRET returns pointer to n-th general purpose retention register. nRF51 supports one, nRF52 supports two. Only lowest 8 bits can be used.
func IRQEnabled ¶
IRQEnabled returns EventMask that lists events that have enabled generating interrupts..
func LoadRESET ¶
func LoadRESET() bool
LoadRESET reports wheter pin reset is enabled in debug mode (nRF51).
func SetRAMPOWER ¶
SetRAMPOWER sets on power configuration of RAM block n according to mask (nRF52).
func StorePOFCON ¶
func StorePOFCON(pofcon POFCon)
StorePOFCON sets power failure comparator configuration.
func StoreRAMON ¶
func StoreRAMON(on, retain RAMBlocks)
StoreRAMON sets configuration of four RAM blocks. On lists RAM blocks that should be kept on in system ON mode, retain lists RAM blocks that should be retained in system off mode.
func StoreRAMPOWER ¶
LoadRAMPOWER power configuration of RAM block n (nRF52).
func StoreRESET ¶
func StoreRESET(pinreset bool)
StoreRESET enables/disables pin reset in debug mode (nRF51).
Types ¶
type POFCon ¶
type POFCon byte
POFCon is power failure comparator configuration.
const ( POF POFCon = 1 << 0 // Set if power failure comparoator is enabled. THRESHOLD POFCon = 15 << 1 // Power failure comparator threshold mask. V2_1 POFCon = 0 << 1 // Threshold: 2.1 V (nrF51). V2_3 POFCon = 1 << 1 // Threshold: 2.3 V (nrF51). V2_5 POFCon = 2 << 1 // Threshold: 2.5 V (nrF51). V2_7 POFCon = 3 << 1 // Threshold: 2.5 V (nrF51). V17 POFCon = 4 << 1 // Threshold: 1.7 V (nRF52). V18 POFCon = 5 << 1 // Threshold: 1.8 V (nRF52). V19 POFCon = 6 << 1 // Threshold: 1.9 V (nRF52). V20 POFCon = 7 << 1 // Threshold: 2.0 V (nRF52). V21 POFCon = 8 << 1 // Threshold: 2.1 V (nRF52). V22 POFCon = 9 << 1 // Threshold: 2.2 V (nRF52). V23 POFCon = 10 << 1 // Threshold: 2.3 V (nRF52). V24 POFCon = 11 << 1 // Threshold: 2.4 V (nRF52). V25 POFCon = 12 << 1 // Threshold: 2.5 V (nRF52). V26 POFCon = 13 << 1 // Threshold: 2.6 V (nRF52). V27 POFCon = 14 << 1 // Threshold: 2.7 V (nRF52). V28 POFCon = 15 << 1 // Threshold: 2.8 V (nRF52). )
func LoadPOFCON ¶
func LoadPOFCON() POFCon
LoadPOFCON returns power failure comparator configuration.
type RAMBlocks ¶
type RAMBlocks byte
RAMBlocks is a bitfield that describes RAM blocks.
func LoadRAMON ¶
func LoadRAMON() (on, retain RAMBlocks)
LoadRAMON returns configuration of four RAM blocks. On lists RAM blocks that are kept on in system ON mode, retain lists RAM blocks that should be retained when RAM block is off.
func LoadRAMSTATUS ¶
func LoadRAMSTATUS() RAMBlocks
LoadRAMSTATUS returns bitfield that lists RAM blocks that are powered up.
type RAMPower ¶
type RAMPower uint32
RAMPower describes power configuration for two sections of RAM block (nRF52).
func LoadRAMPOWER ¶
LoadRAMPOWER returns power configuration of RAM block n (nRF52).
type ResetReas ¶
type ResetReas uint32
ResetReas is a bitfield that describes reset reason.
const ( RESETPIN ResetReas = 1 << 0 // Reset from pin-reset. DOG ResetReas = 1 << 1 // Reset from watchdog. SREQ ResetReas = 1 << 2 // Reset from AIRCR.SYSRESETREQ. LOCKUP ResetReas = 1 << 3 // Reset from CPU lock-up. OFF ResetReas = 1 << 16 // Wake up from OFF mode by GPIO DETECT. LPCOMP ResetReas = 1 << 17 // Wake up from OFF mode by LPCOMP ANADETECT. DIF ResetReas = 1 << 18 // Wake up from OFF mode by debug interface. NFC ResetReas = 1 << 19 // Wake up from OFF mode by NFC. )