+/**
+ * The display zoom modes.
+ *
+ * An am7xxx device can display images using several zoom modes.
+ *
+ * @note Changing the zoom mode can change the aspect ratio of the displayed
+ * image.
+ *
+ * @note On the zoom test screen the version of the firmware running on the
+ * device is shown as well (e.g SPI_V21.0.0_2011.03.18).
+ *
+ * @note The Tele mode is available only on some PicoPix models, when using it
+ * the image is distorted like if a different lens was used, but the global
+ * aspect ratio of the image does not change.
+ */
+typedef enum {
+ AM7XXX_ZOOM_ORIGINAL = 0, /**< Original Size, as retrieved via #am7xxx_device_info. */
+ AM7XXX_ZOOM_H = 1, /**< Zoom 1: H Scale (changes aspect ratio). */
+ AM7XXX_ZOOM_H_V = 2, /**< Zoom 2: H/V Scale (changes aspect ratio). */
+ AM7XXX_ZOOM_TEST = 3, /**< Zoom test screen, the firmware version is shown as well. */
+ AM7XXX_ZOOM_TELE = 4, /**< Zoom Tele: available on some PicoPix models. */
+} am7xxx_zoom_mode;
+
+/**
+ * Initialize the library context and data structures, and scan for devices.
+ *
+ * @param[out] ctx A pointer to the context the library will be used in.
+ *
+ * @return 0 on success, a negative value on error
+ */
+int am7xxx_init(am7xxx_context **ctx);
+
+/**
+ * Cleanup the library data structures and free the context.
+ *
+ * @param[in,out] ctx The context to free.
+ */
+void am7xxx_shutdown(am7xxx_context *ctx);
+
+/**
+ * Set verbosity level of log messages.
+ *
+ * @note The level is per-context.
+ *
+ * @note Messages of level AM7XXX_LOG_FATAL are always shown, regardless
+ * of the value of the log_level parameter.
+ *
+ * @param[in] ctx The context to set the log level for
+ * @param[in] log_level The verbosity level to use in the context (see @link am7xxx_log_level @endlink)
+ */
+void am7xxx_set_log_level(am7xxx_context *ctx, am7xxx_log_level log_level);
+
+/**
+ * Open an am7xxx_device according to a index.
+ *
+ * The semantics of the 'device_index' argument follows the order
+ * of the devices as found when scanning the bus at am7xxx_init() time.
+ *
+ * @note When the user tries to open a device already opened the function
+ * returns -EBUSY and the device is left open.
+ *
+ * @param[in] ctx The context to open the device in
+ * @param[out] dev A pointer to the structure representing the device to open
+ * @param[in] device_index The index of the device on the bus
+ *
+ * @return 0 on success, a negative value on error
+ */
+int am7xxx_open_device(am7xxx_context *ctx,
+ am7xxx_device **dev,
+ unsigned int device_index);