Write 8 bits to port 00
#include "Ifx_Types.h"
#include "IfxCpu.h"
#include "IfxScuWdt.h"
#include "IfxPort_PinMap.h"
#include "IfxPort_Io.h"
IFX_ALIGN(4) IfxCpu_syncEvent g_cpuSyncEvent = 0;
/*array with pins initializations as digital ouput pushpull speed level 1*/
static const IfxPort_Io_ConfigPin Gpio_Pins_Table[] =
{
{ &IfxPort_P00_5, IfxPort_Mode_outputPushPullGeneral, IfxPort_PadDriver_cmosAutomotiveSpeed1 },
{ &IfxPort_P00_6, IfxPort_Mode_outputPushPullGeneral, IfxPort_PadDriver_cmosAutomotiveSpeed1 },
{ &IfxPort_P00_7, IfxPort_Mode_outputPushPullGeneral, IfxPort_PadDriver_cmosAutomotiveSpeed1 },
{ &IfxPort_P00_8, IfxPort_Mode_outputPushPullGeneral, IfxPort_PadDriver_cmosAutomotiveSpeed1 },
{ &IfxPort_P00_9, IfxPort_Mode_outputPushPullGeneral, IfxPort_PadDriver_cmosAutomotiveSpeed1 },
{ &IfxPort_P00_10, IfxPort_Mode_outputPushPullGeneral, IfxPort_PadDriver_cmosAutomotiveSpeed1 },
{ &IfxPort_P00_11, IfxPort_Mode_outputPushPullGeneral, IfxPort_PadDriver_cmosAutomotiveSpeed1 },
{ &IfxPort_P00_12, IfxPort_Mode_outputPushPullGeneral, IfxPort_PadDriver_cmosAutomotiveSpeed1 }
};
/*in order to use the pins array is necesary to pass th following structure to include the
number of pins*/
static const IfxPort_Io_Config Gpio_Pin_ConfigTable =
{
sizeof( Gpio_Pins_Table ) / sizeof( IfxPort_Io_ConfigPin ),
( IfxPort_Io_ConfigPin* )Gpio_Pins_Table
};
void core0_main(void)
{
IfxCpu_enableInterrupts();
/* !!WATCHDOG0 AND SAFETY WATCHDOG ARE DISABLED HERE!!
* Enable the watchdogs and service them periodically if it is required */
IfxScuWdt_disableCpuWatchdog( IfxScuWdt_getCpuWatchdogPassword() );
IfxScuWdt_disableSafetyWatchdog( IfxScuWdt_getSafetyWatchdogPassword() );
/* Wait for CPU sync event */
IfxCpu_emitEvent( &g_cpuSyncEvent );
IfxCpu_waitEvent( &g_cpuSyncEvent, 1 );
/*configure the pin */
IfxPort_Io_initModule( &Gpio_Pin_ConfigTable );
/*on port 33 write on bits from 0 to 7 the value 0x42, it means only leds 1 and 6 will be on*/
IfxPort_setGroupState( &MODULE_P33, 0, 0xff, 0x42 );
while(1)
{
}
}