X-Git-Url: https://git.ao2.it/libam7xxx.git/blobdiff_plain/9f782560906451c1d059b456db80de6857db7c86..90247e36e90bebe6c8b80393d2a037b054808597:/src/am7xxx.h diff --git a/src/am7xxx.h b/src/am7xxx.h index 51f9324..885cef2 100644 --- a/src/am7xxx.h +++ b/src/am7xxx.h @@ -105,6 +105,24 @@ typedef enum { } am7xxx_power_mode; /** + * 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). + */ +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_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. @@ -238,6 +256,26 @@ int am7xxx_send_image(am7xxx_device *dev, */ int am7xxx_set_power_mode(am7xxx_device *dev, am7xxx_power_mode mode); +/** + * Set the zoom mode of an am7xxx device. + * + * @note When setting the mode to AM7XXX_ZOOM_TEST, the calling program might + * want to skip displaying actual images. + * + * @note It looks like that power mode and zoom mode are related somehow wrt. + * resetting the operational mode after AM7XXX_POWER_OFF, applications can + * restore the display properly using this combination: + * - Off: power mode 0, zoom mode 3 + * - On: power mode != 0, zoom mode != 3 + * + * @param[in] dev A pointer to the structure representing the device to set zoom mode to + * @param[in] zoom The zoom mode to put the device in (see #am7xxx_zoom_mode enum) + * + * @return 0 on success, a negative value on error + * + */ +int am7xxx_set_zoom_mode(am7xxx_device *dev, am7xxx_zoom_mode zoom); + #ifdef __cplusplus } #endif