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: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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