NHS31xx SW API

Detailed Description

These 'defines' capture the diversity settings of the compound. It keeps the settings about 'sensing groups', it actually holds the configurations of the demo board/smart blister.

Principle
This principle is based on GPIO functionality, each pill has a unique combination of Drive/Sense pins. By putting a Pull-up resistor on the sense line (input) (SW configurable), and Pulling the Drive line LOW (output), the logic level on the sense line indicates the absence of a pill.
Limitations
There is one limitation for this principle, all SENSE lines need to have pull-up resistors. Most pins have the possibility to configure them in SW (in chip pull-up), however, PIO0_4 and PIO0_5 (I2C) do not have this feature, hence they can only be used as drive line OR in combination with an external pull-up.
Setup
There are 2 possible setups, which both use the same sensing principle:
  1. No extra components; there are 12 GPIO pins available, at least 1 shall be used as drive line.
    Setup:
    GPIO DRIVE o---------------------- ...
    | | | |
    p1 p2 p3 p4 ...
    | | | |
    GPIO SENSE1 o-- | | |
    GPIO SENSE2 o-------- | |
    GPIO SENSE3 o-------------- |
    GPIO SENSE4 o--------------------
    ...
    This setup results in a maximum of 11 manageable pills.
  2. diode matrix; by adding 1 diode per pill, a matrix can be formed.
    Setup:
    GPIO DRIVE2 o-------------------------------- ...
    GPIO DRIVE1 o-------- ... | |
    ... | | | |
    _ _ _ _
    ^ ^ ^ ^
    | | | |
    p1.1 p1.2 ... p2.1 p2.2 ...
    | | | |
    | | | |
    | --o GPIO SENSE1 o-- |
    --------o GPIO SENSE2 o--------
    ...
    This setup results in a maximum of 36 manageable pills, a matrix of 6 drive and 6 sense lines.

Modules

 Configuration settings
 

Data Structures

struct  GROUP_PROPERTIES_T
 

Data Structure Documentation

◆ GROUP_PROPERTIES_T

struct GROUP_PROPERTIES_T

Defines all properties of a GROUP this module requires to know to sense the pills in an uniform way.

Data Fields
IOCON_PIN_T IO_drivePin

The drive pin used in the group.

IOCON_PIN_T IO_sensePin[4]

A sense pill for each pill in this group.

uint8_t pills

Amount of pills initially present in the group.