* Authors:
* - Michal Horn
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * This document contains proprietary information belonging to Czech
+ * Technical University in Prague. Passing on and copying of this
+ * document, and communication of its contents is not permitted
+ * without prior written authorization.
*
* File : cmd_lout.c
*
* Abstract:
- * This file contains commands for testing LOUT (8x100mA Digital output).
+ * This file contains commands for testing LOUT (8x100mA Digital output).
*
*/
#include "rpp/rpp.h"
#include "cmdproc_utils.h"
-#include "drv/drv.h"
/**
* @brief Set digital value to LOUT pin
* @param[in] param Parameters of command
* @return 0 when OK or error code lower than 0
*/
-int cmd_do_lout_set(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
+int cmd_do_lout_set(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
int pin;
- char *p=param[1];
+ char *p = param[1];
char spareParams;
int val;
int ret;
- if (sscanf(p, "%d %d %1s", &pin, &val, &spareParams) != 2) {
+ if (sscanf(p, "%d %d %1s", &pin, &val, &spareParams) != 2)
return -CMDERR_BADPAR;
- }
ret = rpp_lout_set(pin, val);
if (ret == -1) {
rpp_sci_printf("Pin out of range.");
* @param[in] param Parameters of command
* @return 0 when OK or error code lower than 0
*/
-int cmd_do_lout_diag(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
+int cmd_do_lout_diag(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
int pin;
- char *p=param[1];
+ char *p = param[1];
char spareParams;
int ret;
- if (sscanf(p, "%d %1s", &pin, &spareParams) != 1) {
+ if (sscanf(p, "%d %1s", &pin, &spareParams) != 1)
return -CMDERR_BADPAR;
- }
if (rpp_lout_update() == FAILURE) {
rpp_sci_printf("LOUT update failed.");
return 0;
}
-#endif /* DOCGEN */
+#endif /* DOCGEN */
/** Command descriptor for lout set port value */
-cmd_des_t const cmd_des_lout_set={
+cmd_des_t const cmd_des_lout_set = {
0, 0,
"loutset*","Set a value of the LOUT pin",
"### Command syntax ###\n"
};
/** Command descriptor for lout get pin diag value */
-cmd_des_t const cmd_des_lout_diag={
+cmd_des_t const cmd_des_lout_diag = {
0, 0,
"loutdiag*","Read a diagnostic value from an LOUT pin",
"### Command syntax ###\n"
/** List of commands for hout, defined as external */
-cmd_des_t const *cmd_list_lout[]={
- &cmd_des_lout_set,
- &cmd_des_lout_diag,
- NULL
+cmd_des_t const *cmd_list_lout[] = {
+ &cmd_des_lout_set,
+ &cmd_des_lout_diag,
+ NULL
};