From 99ce1e25a332448094519cc257c2ee64414ed390 Mon Sep 17 00:00:00 2001 From: bpds Date: Thu, 28 Dec 2023 16:21:17 +0100 Subject: [PATCH] Licence compliance, adding Copyright 2023 The Periph Authors. All rights reserved.... --- adxl345/adxl345.go | 7 +++++++ adxl345/doc.go | 2 +- adxl345/example/example.go | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/adxl345/adxl345.go b/adxl345/adxl345.go index 186869b..c4f60ba 100644 --- a/adxl345/adxl345.go +++ b/adxl345/adxl345.go @@ -1,8 +1,13 @@ +// Copyright 2023 The Periph Authors. All rights reserved. +// Use of this source code is governed under the Apache License, Version 2.0 +// that can be found in the LICENSE file. + package adxl345 import ( "encoding/binary" "fmt" + "periph.io/x/conn/v3/mmr" "periph.io/x/conn/v3/physic" "periph.io/x/conn/v3/spi" ) @@ -85,6 +90,7 @@ type Opts struct { // Dev is a driver for the ADXL345 accelerometer // It uses the SPI interface to communicate with the device. type Dev struct { + c mmr.Dev16 name string s spi.Conn // The sensitivity of the device (2G, 4G, 8G, 16G) @@ -174,6 +180,7 @@ func (d *Dev) Update() Acceleration { func (d *Dev) ReadAndCombine(reg1, reg2 byte) int16 { low, _ := d.Read(reg1) high, _ := d.Read(reg2) + return int16(uint16(high)<<8) | int16(low) } diff --git a/adxl345/doc.go b/adxl345/doc.go index 9c2e32e..2fa3231 100644 --- a/adxl345/doc.go +++ b/adxl345/doc.go @@ -1,4 +1,4 @@ -// Copyright 2018 The Periph Authors. All rights reserved. +// Copyright 2032 The Periph Authors. All rights reserved. // Use of this source code is governed under the Apache License, Version 2.0 // that can be found in the LICENSE file. diff --git a/adxl345/example/example.go b/adxl345/example/example.go index 01bbc3d..7490af8 100644 --- a/adxl345/example/example.go +++ b/adxl345/example/example.go @@ -1,3 +1,7 @@ +// Copyright 2023 The Periph Authors. All rights reserved. +// Use of this source code is governed under the Apache License, Version 2.0 +// that can be found in the LICENSE file. + package example import (