Thingmagic Mercury xPRESS Platform v1.7 Manual de usuario Pagina 69

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 144
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 68
Status Indication Through GPI Lines
A DIVISION OF TRIMBLE
Using the Optional Modules 69
Status Indication Through GPI Lines
Most XBee modules provide GPO status outputs, which we can monitor through xPRESS
GPI inputs..
Common functionality in the GPI manager includes:
Configuring GPI pins; i.e., calling gpio_configure_pin with the appropriate
arguments
Monitoring the state of a GPI, either by regular polling or by registering interrupt
handlers
Detecting state changes
You can print debug messages every time a GPI state changes
You can also call callbacks if some other code wants to be triggered when a GPI
state changes
Measuring frequency of state changes
For example, the RN-42 Bluetooth module blinks its GPIO5 at different rates,
depending on its internal state. This rate measurement could be useful in
other places, too, so we don’t limit its association to the Bluetooth driver.
Consumers of the GPI manager API can use the following subroutines to obtain the
status of a GPI input.
To monitor a pin: GPIMGR_registerPin(GPIO_IDX)
To stop monitoring a pin: GPIMGR_unregisterPin(GPIO_IDX)
The current state of a pin: GPIMGR_getValue(GPIO_IDX)
The current frequency of a pin’s blinking: GPIMGR_getTogglePeriodMs(GPIO_IDX)
To call back on state changes: GPIMGR_addStateListener(GPIO_IDX,
my_handler)
The GPI Manager runs in interrupt mode and the functions listed below are added as part
of the GPI Manager implementation.
bool GPIMGR_registerPin(uint32_t gpio_idx)
Used to register the GPI line that is being monitored
For the Bluetooth module, it is used to monitor connection status and the toggle
period
Vista de pagina 68
1 2 ... 64 65 66 67 68 69 70 71 72 73 74 ... 143 144

Comentarios a estos manuales

Sin comentarios