RTEMS: bsps/arm/atsam/include/libchip/include/pio_it.h File Reference

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
Functions
pio_it.h File Reference
`#include "pio.h"`
`#include <rtems.h>`

Go to the source code of this file.

## Functions
void | PIO_InitializeInterrupts (uint32_t dwPriority)
void | PIO_ConfigureIt (const Pin *pPin, void(*handler)(const Pin *, void *arg), void *arg)
rtems_status_code | PIO_RemoveIt (const Pin *pPin, void(*handler)(const Pin *, void *arg), void *arg)
void | PIO_IT_InterruptHandler (void)
void | PioInterruptHandler (uint32_t id, Pio *pPio)
void | PIO_CaptureHandler (void)
| The PIO_CaptureHandler must be called by the PIO Capture Interrupt Service Routine with the corresponding PIO Capture instance.

## Detailed Description

Purpose

Configuration and handling of interrupts on PIO status changes. The API provided here have several advantages over the traditional PIO interrupt configuration approach:

- It is highly portable
- It automatically demultiplexes interrupts when multiples pins have been configured on a single PIO controller
- It allows a group of pins to share the same interrupt

However, it also has several minor drawbacks that may prevent from using it in particular applications:

- It enables the clocks of all PIO controllers
- PIO controllers all share the same interrupt handler, which does the demultiplexing and can be slower than direct configuration
- It reserves space for a fixed number of interrupts, which can be increased by modifying the appropriate constant in pio_it.c.

Usage

1. Initialize the PIO interrupt mechanism using PIO_InitializeInterrupts() with the desired priority (0 ... 7).
2. Configure a status change interrupt on one or more pin(s) with PIO_ConfigureIt().
3. Enable & disable interrupts on pins using PIO_EnableIt() and PIO_DisableIt().

## Function Documentation

## ◆ PIO_ConfigureIt()

void PIO_ConfigureIt | ( | const Pin * | pPin,
|  | void(*)(const Pin *, void *arg) | handler,
|  | void * | arg
| ) |  |

Configures a PIO or a group of PIO to generate an interrupt on status change. The provided interrupt handler will be called with the triggering pin as its parameter (enabling different pin instances to share the same handler).

Parameters

  pPin | Pointer to a Pin instance.
  handler | Interrupt handler function pointer.
  arg | Pointer to interrupt handler argument

## ◆ PIO_RemoveIt()

rtems_status_code PIO_RemoveIt | ( | const Pin * | pPin,
|  | void(*)(const Pin *, void *arg) | handler,
|  | void * | arg
| ) |  |

Search for a PIO interrupt and remove it if it is there.

Parameters

  pPin | Pointer to a Pin instance.
  handler | Interrupt handler function pointer.
  arg | Pointer to interrupt handler argument

Returns
  RTEMS_SUCCESSFUL if removed.
  RTEMS_UNSATISFIED if the handler couldn't be found