X-Git-Url: http://rtime.felk.cvut.cz/gitweb/pes-rpp/rpp-lib.git/blobdiff_plain/8a2657a15be4033871c2498f94ee483ef0c3f957..0c7e8bbf51446ad69e5c6ffdbff80514c176ec65:/rpp/include/rpp/gio.h diff --git a/rpp/include/rpp/gio.h b/rpp/include/rpp/gio.h index a5edd60..0ffc842 100644 --- a/rpp/include/rpp/gio.h +++ b/rpp/include/rpp/gio.h @@ -23,9 +23,35 @@ #define RPP_GIO_PORT_NHET1 0x8 #define RPP_GIO_PORT_ALL (RPP_GIO_PORT_GIOA|RPP_GIO_PORT_GIOB|RPP_GIO_PORT_NHET1) +/** + * Intialize GIO ports. + * + * The ports are initialized according to the definition in gio_def.h. + * + * @param[in] init_ports Specifies which ports to initialize. + * RPP_GIO_PORT_ALL causes all ports to be initialized. + * + * @return SUCCESS if successful, FAILURE otherwise. + */ int8_t rpp_gio_init(uint32_t init_ports); +/** + * Sets GIO output pin to a value. + * + * @param pin Pin to set + * @param value Value to the pin to. + * + * @return SUCCESS if successful, FAILURE otherwise. + */ int8_t rpp_gio_set(enum pin_name pin, boolean_t value); + +/** + * Reads the value of a GIO pin. + * + * @param pin Pin to read. + * + * @return Pin value (0 or 1) in case of success, FAILURE otherwise. + */ int8_t rpp_gio_get(enum pin_name pin); /** GIO pin input mode */ @@ -42,7 +68,7 @@ enum rpp_gio_io { }; /** - * Configure GIO pin + * Configure GIO pin. * * @param pin Pin to configure * @param io Configure the pin as input or output.