irlock: simplify driver

Remove ioctl calls by always starting cycling
Remove unused orb variables and includes
Remove unused angle from irlock_s structure
Add test and set I2C address to pixy default
Reduce max num objects to 5
Add read errors reporting via nsh
This commit is contained in:
Randy Mackay
2015-03-01 16:32:58 +09:00
parent 210ad9e36c
commit 10139400d5
2 changed files with 283 additions and 320 deletions
+15 -19
View File
@@ -32,34 +32,30 @@
****************************************************************************/
/*
* drv_irlock.h
* @file drv_irlock.h
*
* Created on: Nov 12, 2014
* Author: MLandes
* IR-Lock device API
*/
#ifndef _DRV_IRLOCK_H
#define _DRV_IRLOCK_H
#pragma once
#include <stdint.h>
#include <sys/ioctl.h>
#include "drv_sensor.h" // include sensor driver interfaces
#include "drv_orb_dev.h"
#define IRLOCK_DEVICE_PATH "/dev/irlock"
#define IRLOCK_BASE_DEVICE_PATH "/dev/irlock"
#define IRLOCK0_DEVICE_PATH "/dev/irlock0"
/*
* ObjDev tag for irlock data.
*/
ORB_DECLARE(irlock_data);
#define IRLOCK_OBJECTS_MAX 5 /* up to 5 objects can be detected/reported */
/*
* ioctl() definitions
*
* custom irlock sensor driver interface (none currently)
*/
#define _IRLOCKIOCBASE (0x7800)
#define __IRLOCKIOC(_n) (_IOC(_IRLOCKIOCBASE, _n))
/* irlock_s structure returned from read calls */
struct irlock_s {
uint64_t timestamp; // microseconds since system start
#endif /* _DRV_IRLOCK_H */
uint16_t signature;
uint16_t center_x;
uint16_t center_y;
uint16_t width;
uint16_t height;
};
File diff suppressed because it is too large Load Diff