- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Using Psoc Creator 4.1 and CY84247 module on the CYKit-042. I am using P3.5 as uart tx via SCB1. Everything works fine w the UART, but I need to pull down the TX line for ~1sec to reset comms then turn back to UART TX. How do I reconfigure the P3.5 TX line as a GPIO line and then back to a TX line programmatically at runtime?
Thanks
Wayne
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks to e.pratt pointing me in the right direction I found reconfigure thread that has the same requirement as myself. I'm able to successfully;
-Set P3.5 (TX) to GPIO =
//reset required bits to make GPIO, note this changes RX pin to GPIO as well
CY_SET_REG32(CYREG_HSIOM_PORT_SEL3,CY_GET_REG32(CYREG_HSIOM_PORT_SEL3) & 0xFF00FFFF);
//next set desired mode
UART_tx_SetDriveMode(UART_tx_DM_STRONG);
-Drive P3.5 low =
//set drive level as desired
UART_tx_Write(0);
-Set P3.5 to UART TX =
//set required bits to revert GPIO back to UART
//prior to GPIO change CYREG_HSIOM_PORT_SEL3 was 0x00990000 per cyfitter.h
CY_SET_REG32(CYREG_HSIOM_PORT_SEL3,CY_GET_REG32(CYREG_HSIOM_PORT_SEL3) | 0x00990000);