Licence compliance, adding Copyright 2023 The Periph Authors. All rights reserved....

pull/66/head
bpds 2 years ago
parent 7e0a946901
commit 99ce1e25a3
No known key found for this signature in database
GPG Key ID: B666D5C1144EADD6

@ -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 package adxl345
import ( import (
"encoding/binary" "encoding/binary"
"fmt" "fmt"
"periph.io/x/conn/v3/mmr"
"periph.io/x/conn/v3/physic" "periph.io/x/conn/v3/physic"
"periph.io/x/conn/v3/spi" "periph.io/x/conn/v3/spi"
) )
@ -85,6 +90,7 @@ type Opts struct {
// Dev is a driver for the ADXL345 accelerometer // Dev is a driver for the ADXL345 accelerometer
// It uses the SPI interface to communicate with the device. // It uses the SPI interface to communicate with the device.
type Dev struct { type Dev struct {
c mmr.Dev16
name string name string
s spi.Conn s spi.Conn
// The sensitivity of the device (2G, 4G, 8G, 16G) // 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 { func (d *Dev) ReadAndCombine(reg1, reg2 byte) int16 {
low, _ := d.Read(reg1) low, _ := d.Read(reg1)
high, _ := d.Read(reg2) high, _ := d.Read(reg2)
return int16(uint16(high)<<8) | int16(low) return int16(uint16(high)<<8) | int16(low)
} }

@ -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 // Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file. // that can be found in the LICENSE file.

@ -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 package example
import ( import (

Loading…
Cancel
Save