| Xmega IEC60730 Class B Library 1.0 |

All Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
Functions
Interrupt Monitor

## Detailed Description

Functions related to the interrupt monitor.

## Functions
void | classb_intmon_set_state (enum classb_int_identifiers identifier, enum classb_int_states state)
| Set a state for the specified interrupt.
void | classb_intmon_reg_int (enum classb_int_identifiers identifier, uint16_t interrupt_counter, uint8_t tolerance_percent)
| Registers an interrupt.
void | classb_intmon_increase (enum classb_int_identifiers identifier)
| Increases the interrupt counter of the specified interrupt.
void | classb_intmon_callback (void)
| The interrupt monitor.

## Function Documentation

void classb_intmon_set_state | ( | enum classb_int_identifiers | identifier,
|  | enum classb_int_states | state
| ) |  |

Set a state for the specified interrupt.

This function should be called from the main application to enable or disable monitoring this interrupt. The application can only set the state to ENABLE or DISABLE, otherwise the error handler will be called. i.e. only the monitor can set `ON` and `OFF` states. Further, if CLASSB_STRICT is defined, it is not allowed to enable an interrupt in the `ON` state, or disable an interrupt in the `OFF` state.

Parameters:

  identifier | Interrupt identifier. Use symbol declared in classb_int_identifiers.
  state | Interrupt state. Use symbol declared in classb_int_states.

Definition at line 113 of file classb_interrupt_monitor.c.

References CLASSB_CONDITION1_INTERRUPT, CLASSB_ERROR_HANDLER_INTERRUPT, DISABLE, ENABLE, and monitored_interrupts.

Referenced by ISR().

Here is the caller graph for this function:

void classb_intmon_reg_int | ( | enum classb_int_identifiers | identifier,
|  | uint16_t | reference,
|  | uint8_t | tolerance
| ) |  |

Registers an interrupt.

This function registers the information that the monitor needs in order to check an interrupt. It should be called from the main application. Interrupts must be declared in classb_int_identifiers in the configuration file. Note that by default the interrupt is not active for monitoring, i.e. the state is `OFF`.

Parameters:

  identifier | Interrupt identifier. Use symbol declared in classb_int_identifiers
  reference | Number of expected executions for the interrupt within an RTC period: `F_INT (Hz) * CLASSB_RTC_INT_PERIOD / CLASSB_RTC_FREQ (Hz)`
  tolerance | The allowed deviation (%) with respect to interrupt_counter for the interrupt counter.

Definition at line 74 of file classb_interrupt_monitor.c.

References monitored_interrupts.

void classb_intmon_increase | ( | enum classb_int_identifiers | identifier | ) |

Increases the interrupt counter of the specified interrupt.

This is called from the interrupt routine and it will increases the counter if the interrupt is `ON`.

Parameters:

  identifier | Interrupt identifier. Use symbol declared in classb_int_identifiers

Definition at line 93 of file classb_interrupt_monitor.c.

References monitored_interrupts.

Referenced by ISR().

Here is the caller graph for this function:

void classb_intmon_callback | ( | void |  | ) |

The interrupt monitor.

For each registered interrupt, this function compares the counter with the expected value. There is an error if the difference is greater than the limit or if the interrupt is disabled and the counter is different than zero. If CLASSB_CONDITION2_INTERRUPT is true, the monitor will stop immediately, i.e. the remaining interrupts are not checked.

Note:
  This should be called back from the RTC interrupt. See Real Time Counter Driver.

Definition at line 167 of file classb_interrupt_monitor.c.

References CLASSB_CONDITION2_INTERRUPT, CLASSB_ERROR_HANDLER_INTERRUPT, DISABLE, ENABLE, monitored_interrupts, and N_INTERRUPTS.

Referenced by ISR().

Here is the caller graph for this function: