How do I use the HSIOM to set pins to SCB SPI mode? | Cypress Semiconductor
How do I use the HSIOM to set pins to SCB SPI mode?
I am very new to using a PSoC or any cypress product for that matter.
Here's the datasheet for the device I'm using: http://www.cypress.com/file/137466/download (Page 15 is where the pertinent pins are listed)
The pins I want to use are: P4_0, P4_1, P5_0, P5_1. They are all dedicated to the SCB1_SPI peripheral. The "mode" they correspond to is Deep-Sleep #1 (value = 15).
My question is this: How do I use this information to actually connect the pins to perform their SPI functions? I have been unable to find a single well-explained resource that can tell me how to use the HSIOM register to manipulate the ports, their pins, and perform a peripheral selection.
Like I know I should be starting with CYREG_HSIOM_PORT_SEL4, but what do I set it equal to? How do I select a pin and a "mode"?
EDIT: I came across the CY_SET_XTND_REG32 function which'll let me set the CYREG_HSIOM_PORT_SELx registers. But I don't know what value I set the register to.
EDIT 2: Okay. Is this how it's done?
/*For pin P4_0: x = 4, y = 0. Configure bits 3:0 to value 15 for deep sleep mode 3 */
/*Bits 3:0 are selected because 4y+3:4y*/