-/** @file sys_main.c \r
-* @brief Application main file\r
-* @date 15.Mar.2012\r
-* @version 03.01.00\r
-*\r
-* This file contains an empty main function,\r
-* which can be used for the application.\r
-*/\r
-\r
-/* (c) Texas Instruments 2009-2012, All rights reserved. */\r
-\r
-/* USER CODE BEGIN (0) */\r
-/* USER CODE END */\r
+/*\r
+ * Copyright (C) 2012-2013 Czech Technical University in Prague\r
+ *\r
+ * Created on: 15.3.2012\r
+ *\r
+ * Authors:\r
+ * - Michal Horn\r
+ * - Carlos Jenkins <carlos@jenkins.co.cr>\r
+ *\r
+ * This program is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.\r
+ *\r
+ * File : main.c\r
+ *\r
+ * Abstract:\r
+ * This file contains main function and Hook functions used by IDLE task.\r
+ *\r
+ */\r
\r
/* Include Files */\r
#include "rpp/rpp.h"\r
\r
/** @fn void main(void)\r
* @brief Application main function\r
-* @note This function is empty by default.\r
*\r
* This function is called after startup.\r
-* The user can use this function to implement the application.\r
*/\r
-\r
-/* USER CODE BEGIN (2) */\r
-/* USER CODE END */\r
-\r
-\r
-\r
void main(void)\r
{\r
-/* USER CODE BEGIN (3) */\r
rpp_init();\r
_enable_IRQ();\r
initCmdProc(0, (uint8_t*)"\r\n----\r\n Rapid Prototyping Platform v00.02-001\r\n Porsche Engineering 06/2013\r\n----\r\n\r\nType commands", (uint8_t *)"\r\n--> ");\r
//We should never get here\r
while(1)\r
;\r
-/* USER CODE END */\r
}\r
\r
#if configUSE_MALLOC_FAILED_HOOK == 1\r
#endif\r
}\r
#endif\r
-\r
-\r
-\r
-/* USER CODE BEGIN (4) */\r
-/* USER CODE END */\r
-/** @file cmd_proc_freertos_tms570.c
-* @brief Texas Instrument SCI FreeRTOS cmdProc implementation
-* @date 1.August.2012
-*
-* Implements main task of command processing.
-*
-*/
+/*
+ * Copyright (C) 2012-2013 Czech Technical University in Prague
+ *
+ * Created on: 1.8.2012
+ *
+ * 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/>.
+ *
+ * File : cmd_proc_freertos_tms570.c
+ *
+ * Abstract:
+ * This file contains main command processor task function and initialization of CMDPROC
+ *
+ */
/* Include files */
#include "cmdproc_freertos_tms570.h"
extern cmd_io_t cmd_io_std_line;
+/**
+ * @brief Entry function to start main CMDPROC
+ * @param priority Priority of CMDPROC task (0 is the highest priority)
+ * @param introText Text which will be printed when CMDPROC launches
+ * @param promptText Text printed when CMDPROC is ready to read new command
+ *
+ */
void initCmdProc(unsigned portBASE_TYPE priority, uint8_t * introText, uint8_t * promptText) {
prompt = NULL;
if (promptText != NULL) {
rpp_sci_printf("%s", prompt);
}
+/**
+ * @brief CMDPROC task procedure
+ * @param pvParameters Not used, task receives no parameters
+ */
void processCmd(void *pvParameters ) {
for (;;) {
cmd_processor_run(&cmd_io_std_line, cmd_list_main);
+/*******************************************************************
+ Components for embedded applications builded for
+ laboratory and medical instruments firmware
+
+ cmd_proc_io.c - IO functions for CMDPROC
+
+ Copyright (C) 2001-2009 by Pavel Pisa pisa@cmp.felk.cvut.cz
+ (C) 2002-2009 by PiKRON Ltd. http://www.pikron.com
+ (C) 2007 by Michal Sojka <sojkam1@fel.cvut.cz>
+ (C) 2012 by Michal Horn <hornmich@fel.cvut.cz>
+
+ This file can be used and copied according to next
+ license alternatives
+ - MPL - Mozilla Public License
+ - GPL - GNU Public License
+ - other license provided by project originators
+ *******************************************************************/
#include "cmdproc.h"
#include <string.h>
#include <stdint.h>
return ret;
}
+/**
+ * Blocking call to print a set of characters.
+ *
+ * @param cmd_io cmd_io structure.
+ * @param buf Pointer to character buffer.
+ * @param count Maximum number of character to be printed
+ *
+ * @return Upon successful completion, a non-negative number shall return.
+ * In case of error, negative number is returned.
+ */
int cmd_io_write_bychar(cmd_io_t *cmd_io,const void *buf,int count)
{
int cn=0;
return cn;
}
+/**
+ * Blocking call to read set of character
+ *
+ * @param cmd_io cmd_io structure.
+ * @param buf Pointer to character buffer.
+ * @param count Maximum number of character to be read
+ *
+ * @return Upon successful completion, a non-negative number shall return.
+ * In case of error, negative number is returned.
+ */
int cmd_io_read_bychar(cmd_io_t *cmd_io,void *buf,int count)
{
int cn=0;
-/** @file cmdio_tisci.c
-* @brief Texas Instrument SCI IO for cmdProc
-* @date 17.July.2012
-*
-* Definition of IO. This implementation uses queues as buffers, which are than used for input and output.
-*
-*/
+/*******************************************************************
+ Components for embedded applications builded for
+ laboratory and medical instruments firmware
+
+ cmd_proc_io_tisci.c - IO layer functions for SCI on TMS570 and FreeRTOS
+
+ Copyright (C) 2001-2009 by Pavel Pisa pisa@cmp.felk.cvut.cz
+ (C) 2002-2009 by PiKRON Ltd. http://www.pikron.com
+ (C) 2007 by Michal Sojka <sojkam1@fel.cvut.cz>
+ (C) 2012 by Michal Horn <hornmich@fel.cvut.cz>
+
+ This file can be used and copied according to next
+ license alternatives
+ - MPL - Mozilla Public License
+ - GPL - GNU Public License
+ - other license provided by project originators
+ *******************************************************************/
+
/* Include files */
#include "cmdproc_io_tisci.h"
#include "types.h"
#include "rpp/rpp.h"
+/**
+ * @brief Print character on SCI
+ * @param cmd_io cmd_io structure
+ * @param ch character to be printed
+ * @return always 1
+ *
+ */
int tisci_putc(cmd_io_t *cmd_io, int ch) {
rpp_sci_putc((uint8_t)ch);
return 1;
}
+/**
+ * @brief Read character from SCI
+ * @param cmd_io cmd_io structure
+ * @return character ASCII code
+ *
+ */
int tisci_getc(cmd_io_t *cmd_io) {
int ret = '\0';
ret = rpp_sci_getc();
}
return ret;
}
+
+/**
+ * @brief Print string on SCI
+ * @param cmd_io cmd_io structure
+ * @param buf String buffer to be printed
+ * @param count maximum character number to be printed
+ * @return number of printed characters
+ *
+ */
int tisci_write(cmd_io_t *cmd_io, const void *buf, int count) {
const char *tmpBuf = buf;
return rpp_sci_printf("%s", tmpBuf);
}
+
+/**
+ * @brief Read string from SCI
+ * @param cmd_io cmd_io structure
+ * @param buf String buffer
+ * @param count maximum character number to be read
+ * @return SUCCESS
+ */
int tisci_read(cmd_io_t *cmd_io, void *buf, int count) {
uint8_t* tmpBuf = buf;
return rpp_sci_read(count, tmpBuf);
}
-/* Setting io stack for cmdProc */
+/**
+ * IO stack for cmdProc
+ */
cmd_io_t cmd_io_buf={
tisci_putc,
tisci_getc,
-/** @file commands.c
-* @brief Command definitions file
-* @date 31.July.2012
-*
-* Command is defined by its function. The function and others parameters are stored as list element.
-* All commands represented as elements are stored in lists connected into one main list.
-*/
+/*
+ * Copyright (C) 2012-2013 Czech Technical University in Prague
+ *
+ * Created on: 31.7.2012
+ *
+ * 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/>.
+ *
+ * File : cmd.c
+ *
+ * Abstract:
+ * This file contains root of the list of the commands.
+ *
+ */
/* Include files */
#include "rpp/rpp.h"
/*
- * cmd_can.c
+ * Copyright (C) 2012-2013 Czech Technical University in Prague
*
- * Created on: 28.2.2013
- * Author: Michal Horn
+ * Created on: 28.2.2013
+ *
+ * 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/>.
+ *
+ * File : cmd_can.c
+ *
+ * Abstract:
+ * This file contains commands for CAN test
*
- * Commands for CAN control
*/
#include "rpp/rpp.h"
+/*
+ * Copyright (C) 2012-2013 Czech Technical University in Prague
+ *
+ * Created on: 28.2.2013
+ *
+ * Authors:
+ * - Rostislav LisovĂ˝
+ *
+ * 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/>.
+ *
+ * File : cmd_emac.c
+ *
+ * Abstract:
+ * Test command for Ethernet PHY
+ *
+ */
#include "commands/cmd_emac.h"
#include "rpp/rpp.h"
#include "sys/sys.h"
/*
- * cmd_fray.c
+ * Copyright (C) 2012-2013 Czech Technical University in Prague
*
- * Created on: 28.2.2013
- * Author: Michal Horn
+ * Created on: 28.2.2013
*
+ * 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/>.
+ *
+ * File : cmd_fray.c
+ *
+ * Abstract:
* Commands for control FlexRay
* - Getting status of FlexRay from chips on SPI
* - Sending test data on FRAY
* Node B receives short message from frame 1 to buffer 1 and longer message from frame 9 to buffer 9.
* Commands are counting number of received messages, number of errors in messages and they print results at the end.
* After 100 transmissions both nodes are halted.
+ *
*/
#include "commands/cmd_fray.h"
/*
- * cmd_hout.c
+ * Copyright (C) 2012-2013 Czech Technical University in Prague
+ *
+ * Created on: 28.2.2013
+ *
+ * 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/>.
+ *
+ * File : cmd_hout.c
+ *
+ * Abstract:
+ * This file contains commands for HOUT control.
*
- * Created on: 28.2.2013
- * Author: Michal Horn
*/
#include "commands/cmd_hout.h"
/*
- * cmd_lin.c
+ * Copyright (C) 2012-2013 Czech Technical University in Prague
*
- * Created on: 28.2.2013
- * Author: Michal Horn
+ * Created on: 28.2.2013
+ *
+ * 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/>.
+ *
+ * File : cmd_lin.c
+ *
+ * Abstract:
+ * This file contains commands for LIN control.
*
- * Commands for LIN control.
*/
+
#include "rpp/rpp.h"
#include "sys/sys.h"
#include "hal/hal.h"
/*
- * cmd_motor_example.c
+ * Copyright (C) 2012-2013 Czech Technical University in Prague
*
- * Created on: 16.5.2013
- * Author: Michal Horn
+ * Created on: 16.5.2013
*
- * Example commands for motor controlling over FlexRay. First board has connected control panel
- * with two buttons and variable resistor, second board has DC motor connected to H-bridge. Both
- * boards are connected by FlexRay and user can drive motor by the control pannel (speed, direction
- * and enabling).
+ * 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/>.
+ *
+ * File : cmd_pin.c
+ *
+ * Abstract:
+ * Example commands for motor controlling over FlexRay. First board has connected control panel
+ * with two buttons and variable resistor, second board has DC motor connected to H-bridge. Both
+ * boards are connected by FlexRay and user can drive motor by the control panel (speed, direction
+ * and enabling).
*/
#include "commands/cmd_motor_example.h"
/*
- * cmd_pin.c
+ * Copyright (C) 2012-2013 Czech Technical University in Prague
*
- * Created on: 28.2.2013
- * Author: Michal Horn
+ * Created on: 28.2.2013
*
- * Commands for pin controlling
- * - Printing list of available pins
- * - Setting and getting value to pins
- * - Setting and getting pins direction
+ * 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/>.
+ *
+ * File : cmd_pin.c
+ *
+ * Abstract:
+ * Commands for pin controlling
+ * - Printing list of available pins
+ * - Setting and getting value to pins
+ * - Setting and getting pins direction
*/
#include "commands/cmd_pin.h"
/*
- * cmd_port.c
+ * Copyright (C) 2012-2013 Czech Technical University in Prague
*
- * Created on: 28.2.2013
- * Author: Michal Horn
+ * Created on: 28.2.2013
*
- * Commands for port controlling
- * - Printing list of available ports (not yet available)
- * - Setting/getting port value
+ * 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/>.
+ *
+ * File : cmd_port.c
+ *
+ * Abstract:
+ * Commands for port controlling
+ * - Printing list of available ports (not yet available)
+ * - Setting/getting port value*
*/
#include "commands/cmd_port.h"
cmd_do_port_val, (void *)&cmd_list_port
};
+/** Command descriptor for port list printout */
+cmd_des_t const cmd_des_port_list={
+ 0, 0,
+ "portlist","Print list of port names",
+ cmd_do_port_list, (void *)&cmd_list_port
+};
+
/** List of commands for port, defined as external */
cmd_des_t const *cmd_list_port[]={
&cmd_des_port_val,
/*
- * cmd_spi.c
+ * Copyright (C) 2012-2013 Czech Technical University in Prague
*
- * Created on: 28.2.2013
- * Author: Michal Horn
+ * Created on: 28.2.2013
+ *
+ * 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/>.
+ *
+ * File : cmd_spi.c
+ *
+ * Abstract:
+ * Command for processing data from SPI and
+ * lowlevel command for sending data on SPI
*
- * Command for processing data from SPI and
- * lowlevel command for sending data on SPI
*/
#include "commands/cmd_spi.h"
/*
- * cmd_vbat.c
+ * Copyright (C) 2012-2013 Czech Technical University in Prague
*
- * Created on: 28.2.2013
- * Author: Michal Horn
+ * Created on: 28.2.2013
+ *
+ * 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/>.
+ *
+ * File : cmd_vbat.c
+ *
+ * Abstract:
+ * Commands for VBAT control
+ * - Power VBAT1 on and off using PWM to charge capacitors
*
- * Commands for VBAT control
- * - Power VBAT1 on and off using PWM to charge capacitors
*/
#include "rpp/rpp.h"