ds1307

package module
v0.0.0-...-f64633d Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Overview

Package ds1307 provides support for the DS1307 device as found in the RTC Pi Plus (https://www.abelectronics.co.uk/p/52/RTC-Pi-Plus).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RTC

type RTC struct {
	// contains filtered or unexported fields
}

RTC represents a DS1307 real time clock.

func Open

func Open(o driver.Opener) (*RTC, error)

Open opens a new RTC. An RTC must be closed when no longer used.

func (*RTC) Close

func (c *RTC) Close() error

Close frees the underlying resources. It must be called once the RTC is no longer in use.

func (*RTC) Now

func (c *RTC) Now() (time.Time, error)

Now returns the current time, accurate to the nearest second.

func (*RTC) Set

func (c *RTC) Set(t time.Time) error

Set sets the current time. It returns an error if the time is not within the 21st century.

Jump to

Keyboard shortcuts

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