CrossCore XA
Revision: 1.0
Programmers Guide
Date: Jul 1, 10
uint8 surveillance_strategy; // bit-or'ed surveillance strategie(s) to arm
// high gain threshold mode stuff (see SMB380 datasheet for more details)
uint16 HG_thres;
uint16 HG_hyst;
uint16 HG_dur;
uint16 HG_debounce_mode;
// any motion mode stuff (see SMB380 datasheet for more details)
uint8 any_motion_dur;
uint8 any_motion_thres;
} __attribute__((packed)) smb380face;
8.3.
Interface functions
open
Opens the accelerometer device
close
Closes the accelerometer device
mmap
Maps accelerometer device into memory
8.3.1.
open
Description
Opens the accelerometer device. The call will return a file descriptor used in subsequent calls such
as mmap(), close().
Include files
#include <fctnl.h>
Syntax
int open(
const char *pathname,
int flags
)
Parameters
pathname
Path to the device file
flags
Parameter flag must include following access modes: O_RDWR and O_SYNC
Return value
The new file descriptor if successful. In case of errors, -1 is returned and errno is set appropriately.
Example
See example of mmap.
8.3.2.
close
Description
Closes the file descriptor.
www.crosscontrol.com
43