# APCI-3600 Kernel Samples

**WARNING!**

Some of these samples wait for events in kernel mode. They were developed to test the card. The system can be very slow (the driver will use 100% of CPU resources) or freeze (the sample waits for an interrupt without timeout). The events could be a rising edge on an input, a hardware interrupt, etc.

If you don't know how to use these samples (your configuration may not be correct), you may have to reboot your system.

## Description

10 samples are available. They are named `sampleXX`.

The samples named `sample00` to `sample13` are in kernel mode. They are modules. The sample begins at initialization of the module.

### Available Samples

- **Sample00**: Get Board Information
- **Sample03**: Reads 8 digital Inputs
- **Sample06**: Sets 8 digital Outputs
- **Sample07**: Writes 1 Analog Output
- **Sample08**: Uses 1 Analog Output in free Mode
- **Sample09**: Uses 1 Analog Output in Ring Buffer Mode
- **Sample10**: Reads 1 Chronometer -> Single read
- **Sample11**: Reads 1 Chronometer in Auto-Stop/Ring Buffer Mode
- **Sample12**: Reads 1 Analog Input -> Single conversion
- **Sample13**: Reads 1 Analog Input in Auto-Stop/Ring Buffer Mode

## Build

To build them, go into the `samples/` subdirectory (of the driver sources directory):

```bash
make -f _makefile sampleXX
```

Or to compile all:

```bash
make -f _makefile samples
```

There may be warnings. These come from the module generation process of the kernel. This is not fatal.

## Launch

To launch the kernel mode sample, you can run `testsample.sh` (check that the execution rights are set).

To run all samples:
```bash
testsample.sh
```

To run a set of samples (0,3,9):
```bash
testsample.sh 0,3,9
```

The outputs of the samples are logged in the kernel log. You can access it through `/var/log/messages` under a Debian system (`man tail` will help you). `dmesg` may be used too.
