Skip to content
This repository has been archived by the owner on Nov 13, 2021. It is now read-only.

Commit

Permalink
TSL256x: Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
leinardi committed Feb 4, 2018
1 parent 1116568 commit 93951bd
Show file tree
Hide file tree
Showing 22 changed files with 1,340 additions and 1 deletion.
1 change: 1 addition & 0 deletions driver-tsl256x/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
4 changes: 4 additions & 0 deletions driver-tsl256x/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Change Log

## [0.1] - 2018-01-30
- initial version
58 changes: 58 additions & 0 deletions driver-tsl256x/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# TSL256x sensor driver for Android Things

[![Maven metadata URI](https://img.shields.io/maven-metadata/v/http/jcenter.bintray.com/com/leinardi/android/things/driver-tsl256x/maven-metadata.xml.svg?style=plastic)](https://jcenter.bintray.com/com/leinardi/android/things/driver-tsl256x/maven-metadata.xml)
[![Build Status](https://img.shields.io/travis/leinardi/androidthings-drivers/master.svg?style=plastic)](https://travis-ci.org/leinardi/androidthings-drivers)
[![GitHub license](https://img.shields.io/github/license/leinardi/androidthings-drivers.svg?style=plastic)](https://github.com/leinardi/androidthings-drivers/blob/master/LICENSE)

This driver supports sensor peripherals built on the TSL256x chip.

NOTE: these drivers are not production-ready. They are offered as sample
implementations of Android Things user space drivers for common peripherals
as part of the Developer Preview release. There is no guarantee
of correctness, completeness or robustness.

This driver is based on the [Adafruit_TSL256x driver from adafruit](https://github.com/adafruit/Adafruit_TSL256x),
the [Adafruit_CircuitPython_TSL256x driver from adafruit](https://github.com/adafruit/Adafruit_CircuitPython_TSL256x)
and the [TSL256x_RaspberryPi_Library driver from akimach](https://github.com/akimach/TSL256x_RaspberryPi_Library)

## How to use the driver

### Gradle dependency

To use the `tsl256x` driver, simply add the line below to your project's `build.gradle`,
where `<version>` matches the last version of the driver available on [jcenter][jcenter].

```
dependencies {
implementation 'com.leinardi.android.things:driver-tsl256x:<version>'
}
```

### Sample usage

```java
// TBD
```

To use it with the `SensorManager` check the [sample project](https://github.com/leinardi/androidthings-drivers/tree/tsl256x/sample-tsl256x).

## License

Copyright 2018 Roberto Leinardi

Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements. See the NOTICE file distributed with this work for
additional information regarding copyright ownership. The ASF licenses this
file to you under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.

[jcenter]: https://bintray.com/leinardi/androidthings/driver-tsl256x/_latestVersion
55 changes: 55 additions & 0 deletions driver-tsl256x/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright 2018 Roberto Leinardi.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

apply plugin: 'com.android.library'
apply from: rootProject.file('checkstyle.gradle')

android {
compileSdkVersion build_versions.target_sdk
buildToolsVersion build_versions.build_tools

apply from: 'mavenConfig.gradle'

defaultConfig {
minSdkVersion build_versions.min_sdk
targetSdkVersion build_versions.target_sdk
versionCode build_versions.version_code
versionName mvn_config.version as String
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

compileOptions {
sourceCompatibility build_versions.java_version
targetCompatibility build_versions.java_version
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

}

dependencies {
compileOnly deps.androidthings
implementation deps.support.annotations

testImplementation deps.androidthings
testImplementation deps.powermock.module_junit4
testImplementation deps.powermock.api_mockito
}
Binary file added driver-tsl256x/docs/TSL2560-61.pdf
Binary file not shown.
Binary file added driver-tsl256x/docs/TSL2560-61_DS000110_2-00.pdf
Binary file not shown.
Binary file added driver-tsl256x/docs/TSL2562-63.pdf
Binary file not shown.
37 changes: 37 additions & 0 deletions driver-tsl256x/mavenConfig.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright 2018 Roberto Leinardi.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

def mvn_config = [:]
mvn_config.repository = 'androidthings'
mvn_config.group_id = 'com.leinardi.android.things'
mvn_config.artifact_id = 'driver-tsl256x'
mvn_config.version = '0.4'
mvn_config.licenses = 'Apache-2.0' // Comma separated
mvn_config.website = 'https://github.com/leinardi/androidthings-drivers'
mvn_config.issue_tracker_url = 'https://github.com/leinardi/androidthings-drivers/issues'
mvn_config.vcs_url = 'https://github.com/leinardi/androidthings-drivers.git'
mvn_config.description = 'TSL256x driver for Android Things'
mvn_config.tags = 'tsl2560,tsl2561,tsl2562,tsl2563,android-things,android,raspberry-pi' // Comma separated
mvn_config.githubRepo = 'leinardi/androidthings-drivers'
mvn_config.inception_year = '2017'
mvn_config.dryRun = false
mvn_config.publish = false
mvn_config.override = true

ext.mvn_config = mvn_config

apply from: rootProject.file('maven.gradle')
apply from: rootProject.file('bintray.gradle')
21 changes: 21 additions & 0 deletions driver-tsl256x/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
25 changes: 25 additions & 0 deletions driver-tsl256x/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!--
~ Copyright 2018 Roberto Leinardi.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<manifest package="com.leinardi.android.things.driver.tsl256x"
xmlns:android="http://schemas.android.com/apk/res/android">

<application>
<uses-library
android:name="com.google.android.things"
android:required="false" />
</application>
</manifest>
Loading

0 comments on commit 93951bd

Please sign in to comment.