81
Sample to setting GP33, 32, 31, 30 output 1mS low pulse signal.
Initial internal F75111
Enable/Disable WDT
PULSE mode
{
this->Write_Byte(F75111_INTERNAL_ADDR, GPIO3X_PULSE_CONTROL, 0x00); //This is setting low pulse output
this->Write_Byte(F75111_INTERNAL_ADDR, GPIO3X_PULSE_WIDTH_CONTROL, 0x01); //This selects the pulse width to 1mS
this->Write_Byte(F75111_INTERNAL_ADDR, GPIO3X_CONTROL_MODE, 0x0F); //This is setting the GP33, 32, 31, 30 to output function.
this->Write_Byte(F75111_INTERNAL_ADDR, GPIO3X_Output_Data , 0x0F); //This is setting the GP33, 32, 31, 30 output data.
}
void F75111::InitInternalF75111()
{
this->Write_Byte(F75111_INTERNAL_ADDR,GPIO1X_CONTROL_MODE ,0x00); //set GPIO1X to Input function
this->Write_Byte(F75111_INTERNAL_ADDR,GPIO3X_CONTROL_MODE ,0x00); //set GPIO3X to Input function
this->Write_Byte(F75111_INTERNAL_ADDR,GPIO2X_CONTROL_MODE ,0xFF); //set GPIO2X to Output function
this->Write_Byte(F75111_INTERNAL_ADDR,F75111_CONFIGURATION, 0x03); //Enable WDT OUT function
}
Enable : F75111_SetWDTEnable (BYTE byteTimer)
Disable: F75111_SetWDTDisable ()
Set output value
void F75111::InterDigitalOutput(BYTE byteValue)
{
BYTE byteData = 0;
byteData = (byteData & 0x01 )? byt 0x01 : byteValue;
byteData = (byteData & 0x02 )? byt 0x02 : byteValue;
byteData = (byteData & 0x04 )? byt 0x04 : byteValue;
byteData = (byteData & 0x80 )? byt 0x08 : byteValue;
byteData = (byteData & 0x40 )? byt 0x10 : byteValue;
byteData = (byteData & 0x20 )? byt 0x20 : byteValue;
byteData = (byteData & 0x10 )? byt 0x40 : byteValue;
byteData = (byteData & 0x08 )? byt 0x80 : byteValue; // get value bit by bit
this->Write_Byte(F75111_INTERNAL_ADDR,GPIO2X_OUTPUT_DATA,byteData); // write byteData value via GPIO2X output pin
}