GPIO
Posted: Mon 19. Feb 2024, 12:44
Hello
I am trying to use the GPIO Pins as Output based on CAN Signals. I already did the CAN Message part but now I am stuck with the configuration of the Output. I downloaded the DevPack from [0] and found a function HW_GetDIN in hardware.c and also a HW_SetDOUT in hardware.h but there is no such function in hardware.c. From the HW_GetDIN-Function I assume that the GPIOS are connected to the pin 4,5,6, and 7 of the register K. However setting the Mode Register and the Ouput register
GPIOK->MODER |= 0x00005500;
GPIOK->ODR = GPIOK->ODR | 0x000000F0;
did not help. Can you please help?
Regards
Jakob
--- hardware.c ---------------------------------------------------------------
--------------------------------------------------------------------------------
[0] link to WEB Page removed...** ADMIN **
I am trying to use the GPIO Pins as Output based on CAN Signals. I already did the CAN Message part but now I am stuck with the configuration of the Output. I downloaded the DevPack from [0] and found a function HW_GetDIN in hardware.c and also a HW_SetDOUT in hardware.h but there is no such function in hardware.c. From the HW_GetDIN-Function I assume that the GPIOS are connected to the pin 4,5,6, and 7 of the register K. However setting the Mode Register and the Ouput register
GPIOK->MODER |= 0x00005500;
GPIOK->ODR = GPIOK->ODR | 0x000000F0;
did not help. Can you please help?
Regards
Jakob
--- hardware.c ---------------------------------------------------------------
Code: Select all
//! @brief get DINs 3...0 from I/O pins
//! @param[out] buffer result buffer (single uint32_t)
HWResult_t HW_GetDIN ( uint32_t *buffer)
{
if ( buffer == NULL)
{ return HW_ERR_ILLPARAMVAL;}
buffer[0] = (( GPIOK->IDR >> 4) & 0xF) ^ 0xF;
return HW_ERR_OK;
}[0] link to WEB Page removed...** ADMIN **