mirror of
https://github.com/preble/libpinproc
synced 2026-02-24 18:25:23 +01:00
Added delay param to aux_output commands
This commit is contained in:
@@ -108,7 +108,7 @@ void display(PRHandle proc, char * string_1, char * string_2)
|
||||
|
||||
for (i=0; i<16; i++) {
|
||||
// Assert the STB line
|
||||
PRDriverAuxPrepareOutput(&(auxCommands[cmd_index++]), i, 0, DIS_STB, false);
|
||||
PRDriverAuxPrepareOutput(&(auxCommands[cmd_index++]), i, 0, DIS_STB, false, 0);
|
||||
|
||||
char_a = string_1[i];
|
||||
char_b = string_2[i];
|
||||
@@ -120,17 +120,17 @@ void display(PRHandle proc, char * string_1, char * string_2)
|
||||
printf("\nchar_a: %x, segs_a: %x", char_a, segs_a);
|
||||
printf("\nchar_b: %x, segs_b: %x", char_b, segs_b);
|
||||
|
||||
PRDriverAuxPrepareOutput(&(auxCommands[cmd_index++]), segs_a & 0xff, 0, STB_1, false);
|
||||
PRDriverAuxPrepareOutput(&(auxCommands[cmd_index++]), (segs_a >> 8) & 0xff, 0, STB_2, false);
|
||||
PRDriverAuxPrepareOutput(&(auxCommands[cmd_index++]), segs_b & 0xff, 0, STB_3, false);
|
||||
PRDriverAuxPrepareOutput(&(auxCommands[cmd_index++]), (segs_b >> 8) & 0xff, 0, STB_4, false);
|
||||
PRDriverAuxPrepareOutput(&(auxCommands[cmd_index++]), segs_a & 0xff, 0, STB_1, false, 0);
|
||||
PRDriverAuxPrepareOutput(&(auxCommands[cmd_index++]), (segs_a >> 8) & 0xff, 0, STB_2, false, 0);
|
||||
PRDriverAuxPrepareOutput(&(auxCommands[cmd_index++]), segs_b & 0xff, 0, STB_3, false, 0);
|
||||
PRDriverAuxPrepareOutput(&(auxCommands[cmd_index++]), (segs_b >> 8) & 0xff, 0, STB_4, false, 0);
|
||||
|
||||
PRDriverAuxPrepareDelay(&auxCommands[cmd_index++],350);
|
||||
|
||||
PRDriverAuxPrepareOutput(&(auxCommands[cmd_index++]), 0, 0, STB_1, false);
|
||||
PRDriverAuxPrepareOutput(&(auxCommands[cmd_index++]), 0, 0, STB_2, false);
|
||||
PRDriverAuxPrepareOutput(&(auxCommands[cmd_index++]), 0, 0, STB_3, false);
|
||||
PRDriverAuxPrepareOutput(&(auxCommands[cmd_index++]), 0, 0, STB_4, false);
|
||||
PRDriverAuxPrepareOutput(&(auxCommands[cmd_index++]), 0, 0, STB_1, false, 0);
|
||||
PRDriverAuxPrepareOutput(&(auxCommands[cmd_index++]), 0, 0, STB_2, false, 0);
|
||||
PRDriverAuxPrepareOutput(&(auxCommands[cmd_index++]), 0, 0, STB_3, false, 0);
|
||||
PRDriverAuxPrepareOutput(&(auxCommands[cmd_index++]), 0, 0, STB_4, false, 0);
|
||||
|
||||
PRDriverAuxPrepareDelay(&auxCommands[cmd_index++],40);
|
||||
}
|
||||
@@ -163,8 +163,8 @@ void display(PRHandle proc, char * string_1, char * string_2)
|
||||
void UpdateAlphaDisplay(PRHandle proc, int counter)
|
||||
{
|
||||
|
||||
char string_1a[] = "P-ROC CAN DRIVE ";
|
||||
char string_1b[] = "ALPHANUMERICS ";
|
||||
char string_1a[] = " P-ROC ";
|
||||
char string_1b[] = " V1.17 D3 ";
|
||||
|
||||
display(proc, string_1a, string_1b);
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ PR_EXPORT PRResult PRDriverPulsedPatter(PRHandle handle, uint16_t driverNum, uin
|
||||
* Prepares an Aux Command to drive the Aux bus.
|
||||
* This function is provided for convenience.
|
||||
*/
|
||||
PR_EXPORT void PRDriverAuxPrepareOutput(PRDriverAuxCommand *auxCommand, uint8_t data, uint8_t extraData, uint8_t enables, bool_t muxEnables);
|
||||
PR_EXPORT void PRDriverAuxPrepareOutput(PRDriverAuxCommand *auxCommand, uint8_t data, uint8_t extraData, uint8_t enables, bool_t muxEnables, uint16_t delayTime);
|
||||
/**
|
||||
* Prepares an Aux Command to delay the Aux logic.
|
||||
* This function is provided for convenience.
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
|
||||
PRDevice::PRDevice(PRMachineType machineType) : machineType(machineType)
|
||||
{
|
||||
@@ -531,6 +532,7 @@ PRResult PRDevice::DriverAuxSendCommands(PRDriverAuxCommand * commands, uint8_t
|
||||
for (k=0; k<numCommands; k++) {
|
||||
convertedCommand = CreateDriverAuxCommand(commands[k]);
|
||||
commandBuffer[k+1] = convertedCommand;
|
||||
printf("\nAux command: %d is %x", k,convertedCommand);
|
||||
}
|
||||
|
||||
return PrepareWriteData(commandBuffer, numCommands+1);
|
||||
|
||||
@@ -150,6 +150,8 @@ uint32_t CreateDriverAuxCommand ( PRDriverAuxCommand command) {
|
||||
switch (command.command) {
|
||||
case (kPRDriverAuxCmdOutput) : {
|
||||
return ((command.active & 1) << P_ROC_DRIVER_AUX_ENTRY_ACTIVE_SHIFT) |
|
||||
((command.delayTime & P_ROC_DRIVER_AUX_OUTPUT_DELAY_MASK) <<
|
||||
P_ROC_DRIVER_AUX_OUTPUT_DELAY_SHIFT) |
|
||||
((command.muxEnables & 1) << P_ROC_DRIVER_AUX_MUX_ENABLES_SHIFT) |
|
||||
((command.command & P_ROC_DRIVER_AUX_COMMAND_MASK) <<
|
||||
P_ROC_DRIVER_AUX_COMMAND_SHIFT) |
|
||||
|
||||
@@ -174,9 +174,11 @@ const uint32_t P_ROC_DRIVER_CONFIG_PATTER_ENABLE_SHIFT = 30;
|
||||
const uint32_t P_ROC_DRIVER_CONFIG_TABLE_DRIVER_NUM_SHIFT = 1;
|
||||
|
||||
const uint32_t P_ROC_DRIVER_AUX_ENTRY_ACTIVE_SHIFT = 31;
|
||||
const uint32_t P_ROC_DRIVER_AUX_OUTPUT_DELAY_SHIFT = 20;
|
||||
const uint32_t P_ROC_DRIVER_AUX_OUTPUT_DELAY_MASK = 0x7ff;
|
||||
const uint32_t P_ROC_DRIVER_AUX_MUX_ENABLES_SHIFT = 19;
|
||||
const uint32_t P_ROC_DRIVER_AUX_COMMAND_SHIFT = 16;
|
||||
const uint32_t P_ROC_DRIVER_AUX_COMMAND_MASK = 0x67;
|
||||
const uint32_t P_ROC_DRIVER_AUX_COMMAND_MASK = 0x3;
|
||||
const uint32_t P_ROC_DRIVER_AUX_ENABLES_SHIFT = 12;
|
||||
const uint32_t P_ROC_DRIVER_AUX_ENABLES_MASK = 0xF;
|
||||
const uint32_t P_ROC_DRIVER_AUX_EXTRA_DATA_SHIFT = 8;
|
||||
|
||||
@@ -215,7 +215,7 @@ PR_EXPORT PRResult PRDriverAuxSendCommands(PRHandle handle, PRDriverAuxCommand *
|
||||
return handleAsDevice->DriverAuxSendCommands(commands, numCommands, startingAddr);
|
||||
}
|
||||
|
||||
PR_EXPORT void PRDriverAuxPrepareOutput(PRDriverAuxCommand *auxCommand, uint8_t data, uint8_t extraData, uint8_t enables, bool_t muxEnables)
|
||||
PR_EXPORT void PRDriverAuxPrepareOutput(PRDriverAuxCommand *auxCommand, uint8_t data, uint8_t extraData, uint8_t enables, bool_t muxEnables, uint16_t delayTime)
|
||||
{
|
||||
auxCommand->active = true;
|
||||
auxCommand->data = data;
|
||||
@@ -223,6 +223,7 @@ PR_EXPORT void PRDriverAuxPrepareOutput(PRDriverAuxCommand *auxCommand, uint8_t
|
||||
auxCommand->enables = enables;
|
||||
auxCommand->muxEnables = muxEnables;
|
||||
auxCommand->command = kPRDriverAuxCmdOutput;
|
||||
auxCommand->delayTime = delayTime;
|
||||
}
|
||||
|
||||
PR_EXPORT void PRDriverAuxPrepareDelay(PRDriverAuxCommand *auxCommand, uint16_t delayTime)
|
||||
|
||||
Reference in New Issue
Block a user