#ifndef DOCGEN
#include "cmdproc_utils.h"
-#include "drv/fr_tms570.h"
+#include "drv/drv.h"
#include "rpp/rpp.h"
#include "hal/hal.h"
#include "stdio.h"
+/**
+ * This structure contains global FlexRay configuration.
+ * All nodes in the network have to use the same values for
+ * all parameters of this structure.
+ */
Fr_TMS570LS_ClusterConfigType Fr_cluster_config = {
.gColdStartAttempts = 0x2,
.gListenNoise = 0xF,
.gdWakeupSymbolTxLow = 60
};
+/**
+ * This structure contains local configuration of the FlexRay node A.
+ * All nodes in the network shall have their own local configuraion,
+ * but it does not matters if they share some together, until their
+ * buffer configuration differs.
+ */
Fr_TMS570LS_NodeConfigType Fr_node_A_config = {
.pAllowHaltDueToClock = 0,
.pAllowPassiveToActive = FALSE,
.pDecodingCorrection = 0x33
};
+/**
+ * This structure contains local configuration of the FlexRay node B.
+ * All nodes in the network shall have their own local configuraion,
+ * but it does not matters if they share some together, until their
+ * buffer configuration differs.
+ */
Fr_TMS570LS_NodeConfigType Fr_node_B_config = {
.pAllowHaltDueToClock = 0,
.pAllowPassiveToActive = FALSE,
.pDecodingCorrection = 0x33
};
+/**
+ * Macro for selecting default FlexRay configuration or user FlexRay configuration.
+ *
+ * If the macro is defined, the commands are using predefined cluster, nodes and buffers configuration. The commands for manual buffers settings are disabled.
+ *
+ * If the macro is commented, predefined cluster and nodes configurations are used, but no default buffers are configured. The commands for manual buffers settings are enabled.
+ *
+ */
+#define CMD_FR_BT_USE_DEFAULT_CONFIG
+
+#ifdef CMD_FR_BT_USE_DEFAULT_CONFIG
Fr_TMS570LS_MsgRAMConfig Fr_node_A_msgRAM_config = {
.dynSegmentBufferCount = 3,
.fifoBufferCount = 5,
.nodeConfiguration = &Fr_node_B_config,
.staticBufferConfigs = Fr_node_B_static_buffers_config
};
+#else
+#define CMD_FR_BT_MAX_STAT_BUFFERS 32
+#define CMD_FR_BT_MAX_DYN_BUFFERS 32
+#define CMD_FR_BT_MAX_FIFO_BUFFERS 32
+
+Fr_TMS570LS_BufferConfigType Fr_static_buffers_config[CMD_FR_BT_MAX_STAT_BUFFERS];
+Fr_TMS570LS_BufferConfigType Fr_dynamic_buffers_config[CMD_FR_BT_MAX_DYN_BUFFERS];
+Fr_TMS570LS_BufferConfigType Fr_fifo_buffers_config[CMD_FR_BT_MAX_FIFO_BUFFERS];
+#endif
/**
*/
int cmd_do_fr_init(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
const Fr_ConfigType* Fr_ConfigPtr = NULL;
- Std_ReturnType retVal = ERR_PARAM_NO_ERROR;
+ int8_t retVal = SUCCESS;
+ uint32_t error = ERR_PARAM_NO_ERROR;
if (*param[1] == 'A') {
Fr_ConfigPtr = &Fr_config_node_A;
return -CMDERR_BADPAR;
}
- Fr_Init(Fr_ConfigPtr);
- rpp_sci_printf("FlexRay driver initialized.\r\n");
-
- retVal = Fr_ControllerInit(0);
- if (retVal & E_OK) {
- rpp_sci_printf("FlexRay controller initialized.\r\n");
+ retVal = rpp_fr_init_driver(Fr_ConfigPtr, &error);
+ if (retVal == SUCCESS) {
+ rpp_sci_printf("FlexRay driver initialized.\r\n");
}
else {
- if (retVal & FR_INIT_ERR_CLUSTER_CONFIG) {
- rpp_sci_printf("Cluster configuration data error: %x\r\n", (retVal & 0x3FFFFFE) >> 1 );
- }
- else if (retVal & FR_INIT_ERR_NODE_CONFIG) {
- rpp_sci_printf("Node configuration data error: %x\r\n", (retVal & 0x3FFFFFE) >> 1 );
- }
- else if (retVal & FR_INIT_ERR_MSGRAM_CONFIG) {
- rpp_sci_printf("Message RAM configuration data error: %x\r\n", (retVal & 0x3FFFFFE) >> 1 );
- }
- else if (retVal & FR_INIT_ERR_BUFFPARAM_CONFIG) {
- rpp_sci_printf("Buffer configuration data error: %x\r\n", (retVal & 0x3FFFFFE) >> 1 );
- }
- else if (retVal & (uint32_t)FR_INIT_ERR_BUFF_CONFIG) {
- rpp_sci_printf("Buffer configuration error: %x\r\n", (retVal & 0x3FFFFFE) >> 1 );
- }
- else {
- rpp_sci_printf("POC state switching error.\r\n");
- }
+ rpp_sci_printf("FlexRay needs to be configured before initialization.\r\n");
return -CMDERR_BADCFG;
}
- return 0;
-}
-/**
- * @brief Initialize the device FlexRay controller.
- *
- * @param[in] cmd_io Pointer to IO stack
- * @param[in] des Pointer to command descriptor
- * @param[in] param Parameters of command
- * @return 0 when OK or error code
- */
-int cmd_do_fr_ctrlinit(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
- Std_ReturnType retVal = ERR_PARAM_NO_ERROR;
- retVal = Fr_ControllerInit(0);
- if (retVal & E_OK) {
+ retVal = rpp_fr_init_controller(0, &error);
+ if (retVal == SUCCESS) {
rpp_sci_printf("FlexRay controller initialized.\r\n");
}
else {
- if (retVal & FR_INIT_ERR_CLUSTER_CONFIG) {
+ if (error & FR_INIT_ERR_CLUSTER_CONFIG) {
rpp_sci_printf("Cluster configuration data error: %x\r\n", (retVal & 0x3FFFFFE) >> 1 );
}
- else if (retVal & FR_INIT_ERR_NODE_CONFIG) {
+ else if (error & FR_INIT_ERR_NODE_CONFIG) {
rpp_sci_printf("Node configuration data error: %x\r\n", (retVal & 0x3FFFFFE) >> 1 );
}
- else if (retVal & FR_INIT_ERR_MSGRAM_CONFIG) {
+ else if (error & FR_INIT_ERR_MSGRAM_CONFIG) {
rpp_sci_printf("Message RAM configuration data error: %x\r\n", (retVal & 0x3FFFFFE) >> 1 );
}
- else if (retVal & FR_INIT_ERR_BUFFPARAM_CONFIG) {
+ else if (error & FR_INIT_ERR_BUFFPARAM_CONFIG) {
rpp_sci_printf("Buffer configuration data error: %x\r\n", (retVal & 0x3FFFFFE) >> 1 );
}
- else if (retVal & (uint32_t)FR_INIT_ERR_BUFF_CONFIG) {
+ else if (error & (uint32_t)FR_INIT_ERR_BUFF_CONFIG) {
rpp_sci_printf("Buffer configuration error: %x\r\n", (retVal & 0x3FFFFFE) >> 1 );
}
else {
* @return 0 when OK or error code
*/
int cmd_do_fr_start(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
- Std_ReturnType retVal = ERR_PARAM_NO_ERROR;
- retVal = Fr_StartCommunication(0);
- if (retVal & E_OK) {
+ int8_t retVal = SUCCESS;
+ uint32_t error = ERR_PARAM_NO_ERROR;
+
+ retVal = rpp_fr_start_communication(0, &error);
+ if (retVal == SUCCESS) {
rpp_sci_printf("FlexRay communication is running.\r\n");
}
else {
- if (retVal & FR_STARTUP_ERR_SW_STUP_FOLLOW) {
+ if (error & FR_STARTUP_ERR_SW_STUP_FOLLOW) {
rpp_sci_printf("Can not switch POC to RUN state.\r\n");
}
- else if (retVal & FR_STARTUP_ERR_CSINH_DIS) {
+ else if (error & FR_STARTUP_ERR_CSINH_DIS) {
rpp_sci_printf("Cold start inhibit disabled error.\r\n");
}
- else if (retVal & FR_STARTUP_ERR_SW_STUP_READY) {
+ else if (error & FR_STARTUP_ERR_SW_STUP_READY) {
rpp_sci_printf("Can not switch back to READY from STARTUP.\r\n");
}
- else if (retVal & FR_STARTUP_ERR_SW_STUP_AS_NCOLD) {
+ else if (error & FR_STARTUP_ERR_SW_STUP_AS_NCOLD) {
rpp_sci_printf("Can not switch to STARTUP as non-coldstarter.\r\n");
}
else {
* @return 0 when OK or error code
*/
int cmd_do_fr_allslots(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
- Std_ReturnType retVal = ERR_PARAM_NO_ERROR;
- retVal = Fr_AllSlots(0);
- if (retVal & E_OK) {
+ int8_t retVal = ERR_PARAM_NO_ERROR;
+ retVal = rpp_fr_all_slots(0);
+ if (retVal == SUCCESS) {
rpp_sci_printf("FlexRay node is communicating in all slots.\r\n");
}
else {
* @return 0 when OK or error code
*/
int cmd_do_fr_halt(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
- Std_ReturnType retVal = ERR_PARAM_NO_ERROR;
- retVal = Fr_HaltCommunication(0);
- if (retVal & E_OK) {
+ int8_t retVal = ERR_PARAM_NO_ERROR;
+ retVal = rpp_fr_halt_communication(0);
+ if (retVal == SUCCESS) {
rpp_sci_printf("FlexRay node communication halted.\r\n");
}
else {
* @return 0 when OK or error code
*/
int cmd_do_fr_abort(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
- Std_ReturnType retVal = ERR_PARAM_NO_ERROR;
- retVal = Fr_AbortCommunication(0);
- if (retVal & E_OK) {
+ int8_t retVal = ERR_PARAM_NO_ERROR;
+ retVal = rpp_fr_abort_communication(0);
+ if (retVal == SUCCESS) {
rpp_sci_printf("FlexRay node communication aborted.\r\n");
}
else {
* @return 0 when OK or error code
*/
int cmd_do_fr_sendwup(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
- Std_ReturnType retVal = ERR_PARAM_NO_ERROR;
- retVal = Fr_SendWUP(0);
- if (retVal & E_OK) {
+ int8_t retVal = ERR_PARAM_NO_ERROR;
+ retVal = rpp_fr_send_wup(0);
+ if (retVal == SUCCESS) {
rpp_sci_printf("Wake up pattern has been sent.\r\n");
}
else {
* @return 0 when OK or error code
*/
int cmd_do_fr_setwuchannel(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
- Std_ReturnType retVal = ERR_PARAM_NO_ERROR;
+ int8_t retVal = ERR_PARAM_NO_ERROR;
Fr_ChannelType channel = FR_CHANNEL_A;
if (*param[1] == 'A') {
else {
return -CMDERR_BADPAR;
}
- retVal = Fr_SetWakeupChannel(0, channel);
- if (retVal & E_OK) {
+ retVal = rpp_fr_set_wu_channel(0, channel);
+ if (retVal == SUCCESS) {
rpp_sci_printf("Wake up channel has been set.\r\n");
}
else {
* @return 0 when OK or error code
*/
int cmd_do_fr_getpocstatus(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
- Std_ReturnType retVal = ERR_PARAM_NO_ERROR;
+ int8_t retVal = ERR_PARAM_NO_ERROR;
Fr_POCStatusType status;
char* ErrorModeStrings[] = {"ACTIVE", "HALT", "PASSIVE"};
char* SlotModeStrings[] = {"KEYSLOT", "ALL_PENDING", "ALL"};
"COLLISION_WUP", "COLLISION_UNKNOWN", "TRANSMITTED"
};
- retVal = Fr_GetPOCStatus(0, &status);
- if (retVal & E_OK) {
+ retVal = rpp_fr_get_poc_status(0, &status);
+ if (retVal == SUCCESS) {
rpp_sci_printf("POC status:\r\n");
rpp_sci_printf("CHIHaltRequest: %s\r\n", (status.CHIHaltRequest == TRUE) ? "TRUE" : "FALSE");
rpp_sci_printf("CHIReadyRequest: %s\r\n", (status.CHIReadyRequest == TRUE) ? "TRUE" : "FALSE");
* @return 0 when OK or error code
*/
int cmd_do_fr_transmittxlpdu(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
- Std_ReturnType retVal = ERR_PARAM_NO_ERROR;
+ int8_t retVal = ERR_PARAM_NO_ERROR;
uint32_t slotID;
uint8_t dataLength;
int values[MAX_PARAM_VALUES_NUM];
dataLength++;
}
- retVal = Fr_TransmitTxLPdu(0, slotID, data, dataLength);
- if (retVal & E_OK) {
+ retVal = rpp_fr_transmit_lpdu(0, slotID, data, dataLength);
+ if (retVal == SUCCESS) {
rpp_sci_printf("Data were sent.\r\n");
}
else {
* @return 0 when OK or error code
*/
int cmd_do_fr_canceltxlpdu(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
- Std_ReturnType retVal = ERR_PARAM_NO_ERROR;
+ int8_t retVal = ERR_PARAM_NO_ERROR;
uint32_t slotID;
if (sscanf(param[1], "%d", &slotID) != 1) {
return -CMDERR_BADPAR;
}
- retVal = Fr_CancelTxLPdu(0, slotID);
- if (retVal & E_OK) {
+ retVal = rpp_fr_cancel_transmit_lpdu(0, slotID);
+ if (retVal == SUCCESS) {
rpp_sci_printf("Transmission canceled.\r\n");
}
else {
* @return 0 when OK or error code
*/
int cmd_do_fr_receiverxlpdu(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
- Std_ReturnType retVal = ERR_PARAM_NO_ERROR;
+ int8_t retVal = ERR_PARAM_NO_ERROR;
uint32_t slotID;
uint8_t data[cPayloadLengthMax];
Fr_RxLPduStatusType status;
return -CMDERR_BADPAR;
}
- retVal = Fr_ReceiveRxLPdu(0, slotID, data, &status, &receivedLength);
- if (retVal & E_OK) {
+ retVal = rpp_fr_receive_lpdu(0, slotID, data, &status, &receivedLength);
+ if (retVal == SUCCESS) {
switch (status) {
case FR_RECEIVED_MORE_DATA_AVAILABLE:
rpp_sci_printf("More messages are still in FIFO:\r\n");
* @return 0 when OK or error code
*/
int cmd_do_fr_checktxlpdustatus(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
- Std_ReturnType retVal = ERR_PARAM_NO_ERROR;
+ int8_t retVal = ERR_PARAM_NO_ERROR;
uint32_t slotID;
Fr_TxLPduStatusType status;
char* statusStrings[] = {"is not", "is"};
return -CMDERR_BADPAR;
}
- retVal = Fr_CheckTxLPduStatus(0, slotID, &status);
- if (retVal & E_OK) {
+ retVal = rpp_fr_check_tx_lpdu_status(0, slotID, &status);
+ if (retVal == SUCCESS) {
rpp_sci_printf("Message transmission %s pending.\r\n", statusStrings[status]);
}
else {
* @return 0 when OK or error code
*/
int cmd_do_fr_disablelpdu(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
- Std_ReturnType retVal = ERR_PARAM_NO_ERROR;
+ int8_t retVal = ERR_PARAM_NO_ERROR;
uint32_t slotID;
if (sscanf(param[1], "%d", &slotID) != 1) {
return -CMDERR_BADPAR;
}
- retVal = Fr_DisableLPdu(0, slotID);
- if (retVal & E_OK) {
+ retVal = rpp_fr_disable_lpdu(0, slotID);
+ if (retVal == SUCCESS) {
rpp_sci_printf("Buffer disabled.\r\n");
}
else {
* @return 0 when OK or error code
*/
int cmd_do_fr_getglobaltime(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
- Std_ReturnType retVal = ERR_PARAM_NO_ERROR;
+ int8_t retVal = ERR_PARAM_NO_ERROR;
uint8_t cycle = 0;
uint16_t macroTick = 0;
- retVal = Fr_GetGlobalTime(0, &cycle, ¯oTick);
- if (retVal & E_OK) {
+ retVal = rpp_fr_get_global_time(0, &cycle, ¯oTick);
+ if (retVal == SUCCESS) {
rpp_sci_printf("Cycle number: %d\r\nMacrotick number: %d\r\n", cycle, macroTick);
}
else {
* @return 0 when OK or error code
*/
int cmd_do_fr_getnmvector(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
- Std_ReturnType retVal = ERR_PARAM_NO_ERROR;
+ int8_t retVal = ERR_PARAM_NO_ERROR;
uint8_t nmVector[12];
uint8_t i;
- retVal = Fr_GetNmVector(0, nmVector);
- if (retVal & E_OK) {
+ retVal = rpp_fr_get_network_management_vector(0, nmVector);
+ if (retVal == SUCCESS) {
rpp_sci_printf("Network management vector:");
for (i = 0; i < Fr_cluster_config.gNetworkManagementVectorLength; i++) {
rpp_sci_printf(" %x", nmVector[i]);
* @return 0 when OK or error code
*/
int cmd_do_fr_getchannelstatus(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
- Std_ReturnType retVal = ERR_PARAM_NO_ERROR;
+ int8_t retVal = ERR_PARAM_NO_ERROR;
uint8_t index;
uint8_t channel;
char* decodeStrings[] = {
char* boolStrings[] = {"FALSE", "TRUE"};
uint16_t channelStatuses[2];
- retVal = Fr_GetChannelStatus(0, &channelStatuses[0], &channelStatuses[1]);
- if (retVal & E_OK) {
+ retVal = rpp_fr_get_channel_status(0, &channelStatuses[0], &channelStatuses[1]);
+ if (retVal == SUCCESS) {
for (channel = 0; channel < 2; channel++) {
rpp_sci_printf("Channel %s status:\r\n", channelNames[channel]);
for (index = 0; index < 16; index++) {
* @return 0 when OK or error code
*/
int cmd_do_fr_getclockcorrection(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
- Std_ReturnType retVal = ERR_PARAM_NO_ERROR;
+ int8_t retVal = ERR_PARAM_NO_ERROR;
int16_t rateCorrection;
int32_t offsetCorrection;
- retVal = Fr_GetClockCorrection(0, &rateCorrection, &offsetCorrection);
- if (retVal & E_OK) {
+ retVal = rpp_fr_get_clock_correction(0, &rateCorrection, &offsetCorrection);
+ if (retVal == SUCCESS) {
rpp_sci_printf("Rate correction: %d\r\nOffset correction: %d\r\n", rateCorrection, offsetCorrection);
}
else {
* @return 0 when OK or error code
*/
int cmd_do_fr_getsyncframelist(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
- Std_ReturnType retVal = ERR_PARAM_NO_ERROR;
+ int8_t retVal = ERR_PARAM_NO_ERROR;
uint16_t channelAEvenList[FR_MAX_SYNC_FRAME_LIST_SIZE];
uint16_t channelBEvenList[FR_MAX_SYNC_FRAME_LIST_SIZE];
uint16_t channelAOddList[FR_MAX_SYNC_FRAME_LIST_SIZE];
return -CMDERR_BADPAR;
}
- retVal = Fr_GetSyncFrameList(0, listSize, channelAEvenList, channelBEvenList, channelAOddList, channelBOddList);
- if (retVal & E_OK) {
+ retVal = rpp_fr_get_sync_frame_list(0, listSize, channelAEvenList, channelBEvenList, channelAOddList, channelBOddList);
+ if (retVal == SUCCESS) {
rpp_sci_printf("| Channel A even | channel B even | channel A odd | channel B odd |\r\n");
rpp_sci_printf("|----------------|----------------|----------------|----------------|\r\n");
for (i = 0; i < listSize; i++) {
* @return 0 when OK or error code
*/
int cmd_do_fr_getwakeuprxstatus(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
- Std_ReturnType retVal = ERR_PARAM_NO_ERROR;
+ int8_t retVal = ERR_PARAM_NO_ERROR;
uint8_t status = 0;
char* statusStrings[] = {"was not yet", "was"};
char* channelNames[] = {"A", "B"};
uint8_t i;
- retVal = Fr_GetWakeupRxStatus(0, &status);
- if (retVal & E_OK) {
+ retVal = rpp_fr_get_wakeup_rx_status(0, &status);
+ if (retVal == SUCCESS) {
for (i = 0; i < 2; i++) {
rpp_sci_printf("Wake up pattern %s received on channel %s.\r\n", statusStrings[(status >> i) & 0x1], channelNames[i]);
}
* @return 0 when OK or error code
*/
int cmd_do_fr_settimer(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
- Std_ReturnType retVal = ERR_PARAM_NO_ERROR;
+ int8_t retVal = ERR_PARAM_NO_ERROR;
int timer = 0;
int cycle = 0;
int offset = 0;
return -CMDERR_BADPAR;
}
- retVal = Fr_SetAbsoluteTimer(0, timer, cycle, offset);
- if (retVal & E_OK) {
+ retVal = rpp_fr_set_timer(0, timer, cycle, offset);
+ if (retVal == SUCCESS) {
rpp_sci_printf("Timer was set.\r\n");
}
else {
* @return 0 when OK or error code
*/
int cmd_do_fr_canceltimer(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
- Std_ReturnType retVal = ERR_PARAM_NO_ERROR;
+ int8_t retVal = ERR_PARAM_NO_ERROR;
int timer = 0;
if (sscanf(param[1], "%d", &timer) != 1) {
return -CMDERR_BADPAR;
}
- retVal = Fr_CancelAbsoluteTimer(0, timer);
- if (retVal & E_OK) {
+ retVal = rpp_fr_cancel_timer(0, timer);
+ if (retVal == SUCCESS) {
rpp_sci_printf("Timer was canceled.\r\n");
}
else {
* @return 0 when OK or error code
*/
int cmd_do_fr_timerirq(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
- Std_ReturnType retVal = ERR_PARAM_NO_ERROR;
+ int8_t retVal = ERR_PARAM_NO_ERROR;
int timer = 0;
char str[4];
boolean_t status = FALSE;
}
if (param[2] == NULL) { // Get timer IRQ
- retVal = Fr_GetAbsoluteTimerIRQStatus(0, timer, &status);
- if (retVal & E_OK) {
+ retVal = rpp_fr_get_timer_irq_status(0, timer, &status);
+ if (retVal == SUCCESS) {
rpp_sci_printf("IRQ = %s\r\n", boolStrings[status]);
}
else {
return -CMDERR_BADPAR;
}
if (strcmp(str, "EN") == 0) { // Enable IRQ
- retVal = Fr_EnableAbsoluteTimerIRQ(0, timer);
+ retVal = SUCCESS; // No interrupts imlemented
}
else if (strcmp(str, "DIS") == 0) { // Disable IRQ
- retVal = Fr_DisableAbsoluteTimerIRQ(0, timer);
+ retVal = SUCCESS; // No interrupts implemented
}
else if (strcmp(str, "ACK") == 0) { // Clear IRQ
- retVal = Fr_AckAbsoluteTimerIRQ(0, timer);
+ retVal = rpp_fr_clear_timer_irq(0, timer);
}
else { // Bad argument
return -CMDERR_BADPAR;
}
- if (retVal & E_OK) {
+ if (retVal == SUCCESS) {
rpp_sci_printf("OK\r\n");
}
else {
int cmd_do_fr_getversioninfo(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
Std_VersionInfoType versionInfo;
- Fr_GetVersionInfo(&versionInfo);
+ rpp_fr_get_driver_version(&versionInfo);
rpp_sci_printf("vendorID: %#x\r\n", versionInfo.vendorID);
rpp_sci_printf("moduleID: %#x\r\n", versionInfo.moduleID);
rpp_sci_printf("sw_major_version: %#x\r\n", versionInfo.sw_major_version);
* @return 0 when OK or error code
*/
int cmd_do_fr_readcconfig(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
- Std_ReturnType retVal = ERR_PARAM_NO_ERROR;
+ int8_t retVal = ERR_PARAM_NO_ERROR;
int index = 0;
uint32_t value = 0;
return -CMDERR_BADPAR;
}
- retVal = Fr_ReadCCConfig(0, index, &value);
- if (retVal & E_OK) {
+ retVal = rpp_fr_read_com_ctrl_config(0, index, &value);
+ if (retVal == SUCCESS) {
rpp_sci_printf("Value = %#x\r\n", value);
}
else {
/** Command descriptor for FlexRay get sync frame list command */
cmd_des_t const cmd_des_fr_getsyncframelist={
0, 0,
- "frbtgetsyncfrlist*","Prints list of sync frames transmitted on both channels via the odd and even communication cycle.\n",
+ "frbtgetsyncfrlist*","Prints list of sync frames transmitted on both channels via the odd and even communication cycle",
"=== Command syntax ===\n"
"\n"
" frbtgetsyncfrlist<LENGTH>\n"