Created
December 25, 2016 18:31
-
-
Save dekuNukem/624891b6a977d6fcccc6d93baa1a8d0b to your computer and use it in GitHub Desktop.
FAP port read code snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// loads a port for CPU to read | |
void load16(uint8_t address, uint8_t data) | |
{ | |
// put the address and data onto STM32-CPLD bus | |
uint16_t value = 0; | |
value = (address & 0xf) << 8; | |
value = value | data; | |
CPLD_DATA_PORT->ODR &= 0xf000; | |
CPLD_DATA_PORT->ODR |= value; | |
data_output(); | |
addr_output(); | |
// load the latch | |
latch16_activate(); | |
latch16_deactivate(); | |
data_input(); | |
addr_input(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment