I need bare simple metal code to set/clear M18 gpio0[1]
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi Alex,
Do you use AM335x TI board (EVM, StarterKit, ICE, BBB) or custom board?
For how to set/clear GPIO pin (bare metal) example, you can refer to AM335x TI PSDK RTOS package:
http://software-dl.ti.com/processor-sdk-rtos/esd/AM335X/latest/index_FDS.html
You can refer to AM335x EVM, gpio1[23] example, and reuse this code for gpio0[1] pin.
pdk_am335x_1_0_15/packages/ti/board/diag/buzzer/
You can also refer to below AM335x (BBB, ICE, SK) bare metal GPIO LED test:
pdk_am335x_1_0_15/packages/ti/board/diag/led/
Regards,
Pavel
Thank you so much for responding Pavel. However, I'm having trouble finding the example(s). Can you send me the URL(s)?
Best Regards,
Alex
Pavel, the API
GPIOSetDirMode(SOC_GPIO_0_REGS, pin number, GPIO_DIRECTION_OUTPUT); This is from TI's gpio.c gpio.h
It is also named GPIODirModeSet elsewhere.
I don't know what pin number to use. I want control M18 .
Alex,
In pdk_am335x_1_0_15/packages/ti/board/diag/buzzer//build/evmAM335x/GPIO_Buzzer_config.c, GPIO1_23 T15 pin is defined as:
/* Port and pin number mask for Green LED.
Bits 7-0: Pin number and Bits 15-8: Port number */
#define BUZZER_PIN (0x0217)
Thus we have [7:0] = 0x17 (23) for pin number and [15:8] = 0x2 (port number)
For gpio0_1 you need to have 0x0101 instead of 0x0217.
Check also below e2e thread:
Regards,
Pavel