Professional Documents
Culture Documents
SR_Write_Init
Parameters: CustomPin_t RCLKPin, CustomPin_t SCLKPin, CustomPin_t DataPin
SR_GetCurrentRegister
Return LocalRegisterImage
End of SR_GetCurrentRegister
SR_Write
Parameters: uint8_t NewValue, CustomPin_t RCLKPin, CustomPin_t SCLKPin, CustomPin_t DataPin
Set LocalRegisterImage to NewValue
Lower the register clock
For every bit in NewValue
Set bit to the MSB of NewValue
If bit is 0
Lower the DataPin
Else
Raise the DataPin
EndIf
Raise SCLKPin
Lower SCLKPin
Get next bit of NewValue into MSB
EndFor
Raise the register clock to latch the new data
End of SR_Write
End of ShiftRegisterWrite