1
0
mirror of https://github.com/preble/libpinproc synced 2026-02-24 18:25:23 +01:00

Hardcoded number cleanup and more.

Made the hard coded number cleanup changes Gerry requested.
Also changed FillLEDWriteCommand to FillPDBCommand, now it can be used
filling out any PDB command (extra constants in PRHardware.h).
This commit is contained in:
Roy Eltham
2013-03-01 09:59:37 -08:00
parent cd9b88dea6
commit 0c975d372b
3 changed files with 74 additions and 51 deletions

View File

@@ -344,9 +344,12 @@ int32_t CreateJTAGShiftTDODataBurst ( uint32_t * burst, uint16_t numBits, bool_t
return kPRSuccess;
}
void FillLEDWriteCommand(uint8_t boardAddr, PRLEDRegisterType reg, uint8_t value, uint32_t * pData)
void FillPDBCommand(uint8_t command, uint8_t boardAddr, PRLEDRegisterType reg, uint8_t data, uint32_t * buffer)
{
pData[0] = (0x1 << 24) | (boardAddr << 16) | (reg << 8) | value;
buffer[0] = (command << P_ROC_DRIVER_PDB_COMMAND_SHIFT) |
(boardAddr << P_ROC_DRIVER_PDB_BOARD_ADDR_SHIFT) |
(reg << P_ROC_DRIVER_PDB_REGISTER_SHIFT) |
(data << P_ROC_DRIVER_PDB_DATA_SHIFT);
}