device/class/icu.h header reference
[Devices support library module]

The source code of this header can be browsed online.

Description  

Members  

Types  

  • typedef struct dev_irq_sink_s *(dev_icu_get_sink_t)(struct device_icu_s *accessor, uint_fast8_t id)
  • typedef error_t (dev_icu_link_t)(struct device_icu_s *accessor, struct dev_irq_sink_s *sink, struct dev_irq_src_s *src, dev_irq_route_t *route_mask, struct dev_irq_src_s **bypass)
  • struct device_icu_s
  • struct driver_icu_s

Functions  

  • error_t device_icu_dummy_link(struct device_icu_s *accessor, struct dev_irq_sink_s *sink, struct dev_irq_src_s *src, dev_irq_route_t *route_mask, struct dev_irq_src_s **bypass)
  • error_t device_icu_irq_bind(struct dev_irq_src_s *source, const char *icu_name, uint_fast16_t sink_id, uint8_t irq_id, enum dev_irq_sense_modes_e trig_mode, dev_irq_route_t route_mask)
  • struct device_accessor_s * device_icu_s_base(struct device_icu_s *x)
  • struct device_icu_s * device_icu_s_cast(struct device_accessor_s *x)

Macros  

Members detail  

#define DEV_ICU_GET_SINK(n)  

This macro is declared in device/class/icu.h source file, line 46.

See also dev_icu_get_sink_t.

#define DEV_ICU_LINK(n)  

This macro is declared in device/class/icu.h source file, line 54.

See also dev_icu_link_t.

#define DRIVER_ICU_METHODS(prefix)  

This macro is declared in device/class/icu.h source file, line 103.

ICU device class methods

See also struct driver_icu_s.

#define __DEVICE_ICU_H__  

This macro is declared in device/class/icu.h source file, line 31.

typedef struct dev_irq_sink_s *(dev_icu_get_sink_t)(struct device_icu_s *accessor, uint_fast8_t id)   

This typedef is declared in device/class/icu.h source file, line 51.

This typedef returns the interrupt sink endpoint with given id. This typedef returns NULL if no endpoint is available with the passed id.

This declaration involves expansion of the DEV_ICU_GET_SINK macro.

typedef error_t (dev_icu_link_t)(struct device_icu_s *accessor, struct dev_irq_sink_s *sink, struct dev_irq_src_s *src, dev_irq_route_t *route_mask, struct dev_irq_src_s **bypass)   

This typedef is declared in device/class/icu.h source file, line 93.

This typedef configure the hardware when a link between a sink and a source endpoint has changed. This is called after linking from the device_irq_source_link function and before unlinking from the device_irq_source_unlink functions.

This typedef is called with a NULL pointer for the route_mask parameter when a link between two endpoint is to be broken. When two endpoints have been linked, this parameter indicates which source endpoints of this interrupt controller can be used to route the interrupt.

When *bypass is NULL, a link has changed between the sink endpoint of this interrupt controller and the src endpoint of a device.

When CONFIG_DEVICE_IRQ_BYPASS is defined and *bypass is not NULL, a link has changed between the sink endpoint of an other interrupt controller in the chain to the device and the src endpoint of a device. This happens when the next interrupt controller allows to be bypassed. In this case, it is possible to either ignore this request or keep a link to the src endpoint so that the processing function of the src endpoint can be called directly when an interrupt occurs.

The return value of this function indicates if the interrupt link has been successfully configured; this is the case if the function return -EAGAIN or 0. If the interrupt controller accept to be bypassed, the function have to update the content of the bypass, irq_id and route_mask parameters, then return -EAGAIN. In this case the bypass parameter must be updated to point to the source endpoint which may be passed. In any case the interrupt controller must be able to handle interrupts by providing a suitable dev_irq_src_process_t function for its source endpoints.

This declaration involves expansion of the DEV_ICU_LINK macro.

error_t device_icu_dummy_link(struct device_icu_s *accessor, struct dev_irq_sink_s *sink, struct dev_irq_src_s *src, dev_irq_route_t *route_mask, struct dev_irq_src_s **bypass)  

This function does nothing and is successful.

error_t device_icu_irq_bind(struct dev_irq_src_s *source, const char *icu_name, uint_fast16_t sink_id, uint8_t irq_id, enum dev_irq_sense_modes_e trig_mode, dev_irq_route_t route_mask)  

This function is used to bind an initialized source endpoint to the sink endpoint of in a icu device. This can be used to setup an irq handler without a device driver.

Parameter list:

  • source: Endpoint to bind, may be defined outside a device
  • icu_name: Name of ICU device to lookup in device tree
  • sink_id: ICU sink endpoint index
  • irq_id: the logical id of the irq to enable.

The return value is 0 on success or a negative error

This is available when CONFIG_DEVICE_IRQ is defined.

struct device_icu_s  

This struct is declared in DRIVER_CLASS_TYPES function like macro expansion, line 19 in device/class/icu.h source file, line 101.

This struct is the device accessor object type for the icu device class. This accessor must be initialized by calling the device_get_accessor function.

See also DRIVER_CLASS_ICU, struct device_accessor_s and Device accessor.

FieldDescription
union <anonymous> {
struct device_accessor_s base;
struct <anonymous> {
struct device_s * dev;
struct driver_icu_s * api;
uint_fast8_t number;
};
};

struct device_accessor_s * device_icu_s_base(struct device_icu_s *x)  

This function is declared in DRIVER_CLASS_TYPES function like macro expansion, line 40 in device/class/icu.h source file, line 101.

This function casts a icu device accessor to a generic device accessor

struct device_icu_s * device_icu_s_cast(struct device_accessor_s *x)  

This function is declared in DRIVER_CLASS_TYPES function like macro expansion, line 33 in device/class/icu.h source file, line 101.

This function casts a generic device accessor to a icu device accessor

struct driver_icu_s  

This struct is declared in DRIVER_CLASS_TYPES function like macro expansion, line 5 in device/class/icu.h source file, line 101.

This struct is the driver API descriptor for the icu device class.

See also DRIVER_CLASS_ICU and struct driver_class_s.

Valid XHTML 1.0 StrictGenerated by diaxen on Wed Oct 17 21:18:38 2018 using MkDoc