Write a value of four bits on a group of Dio channels
Port
Port:
General:
Post Build Variant Used: true
Config Variant: VariantPostBuild
...
PortContainer: "PortContainer_0"
General:
PortNumberOfPortPins: 4
PortPin: "C8_BIT0"
PortPin Pcr: 72
PortPin Direction: PORT_PIN_OUT
PortPin Level Value: PORT_PIN_LEVEL_LOW #init value after reset
...
PortPin: "C9_BIT1"
PortPin Pcr: 73
PortPin Direction: PORT_PIN_OUT
PortPin Level Value: PORT_PIN_LEVEL_LOW #init value after reset
...
PortPin: "C10_BIT2"
PortPin Pcr: 74
PortPin Direction: PORT_PIN_OUT
PortPin Level Value: PORT_PIN_LEVEL_LOW #init value after reset
...
PortPin: "C11_BIT3"
PortPin Pcr: 75
PortPin Direction: PORT_PIN_OUT
PortPin Level Value: PORT_PIN_LEVEL_LOW #init value after reset
...
Dio
Dio:
...
DioPort: "PORTC"
General:
DioPortId: 2
DioChannelGroup: "PORTD_LEDS"
General:
Dio Channel Group Identification: "LedsGroup"
Dio Port Bit Number: 4
Dio Port Offset: 8
Dio Port Mask: 0xf00
...
main.c
#include "Mcu.h"
#include "Port.h"
#include "Dio.h"
void EcuM_Init( void );
int main( void )
{
EcuM_Init();
while(1)
{
Dio_WriteChannelGroup( DioConf_DioChannelGroup_PORTD_LEDS, 0x05u );
/*dummy delay*/
for( uint32 i = 0u ; i < 500000u ; i++ );
Dio_WriteChannelGroup( DioConf_DioChannelGroup_PORTD_LEDS, 0x00u );
/*dummy delay*/
for( uint32 i = 0u ; i < 500000u ; i++ );
}
return 0;
}
void EcuM_Init( void )
{
Mcu_Init( &Mcu_Config );
/* Initialize the clock tree with no PLL active*/
Mcu_InitClock( McuClockSettingConfig_0 );
Mcu_SetMode( McuModeSettingConf_0 );
/*Init ports from C8 to C11*/
Port_Init( &Port_Config );
}