ARM/Microchip/SAM4L/src/iopincfg_sam4l.c
void IOPinDisable(int PortNo, int PinNo)
{
	if (PortNo == -1 || PinNo == -1)
		return;

	GpioPort *reg = (GpioPort *)((uint32_t)&SAM4L_GPIO->GPIO_PORT[PortNo]);

	uint32_t pinmask = 1 << PinNo;

	reg->GPIO_GPERS = pinmask;
	reg->GPIO_PUERC = pinmask;
	reg->GPIO_PDERC = pinmask;
	reg->GPIO_ODERC = pinmask;
}
/**
 * @brief	Disable I/O pin
 *
 * Some hardware such as low power mcu allow I/O pin to be disconnected
 * in order to save power. There is no enable function. Reconfigure the
 * I/O pin to re-enable it.
 *
 * @param	PortNo 	: Port number
 * @param	PinNo	: Pin Number
 */
@brief       Disable I/O pin
Some hardware such as low power mcu allow I/O pin to be disconnected
in order to save power. There is no enable function. Reconfigure the
I/O pin to re-enable it.

@param       PortNo  : Port number
@param       PinNo   : Pin Number
@brief Disable I / O pin Some hardware such as low power mcu allow I / O pin to be disconnected in order to save power . There is no enable function . Reconfigure the I / O pin to re - enable it . @param PortNo : Port number @param PinNo : Pin Number
void IOPinDisable(int PortNo, int PinNo)
{
	if (PortNo == -1 || PinNo == -1)
		return;
	GpioPort *reg = (GpioPort *)((uint32_t)&SAM4L_GPIO->GPIO_PORT[PortNo]);
	uint32_t pinmask = 1 << PinNo;
	reg->GPIO_GPERS = pinmask;
	reg->GPIO_PUERC = pinmask;
	reg->GPIO_PDERC = pinmask;
	reg->GPIO_ODERC = pinmask;
}
void IOPinDisable ( int PortNo , int PinNo ) { if ( PortNo == -1 || PinNo == -1 ) return ; GpioPort * reg = ( GpioPort * ) ( ( uint32_t ) & SAM4L_GPIO -> GPIO_PORT [ PortNo ] ) ; uint32_t pinmask = 1 << PinNo ; reg -> GPIO_GPERS = pinmask ; reg -> GPIO_PUERC = pinmask ; reg -> GPIO_PDERC = pinmask ; reg -> GPIO_ODERC = pinmask ; }
@brief       Disable I/O pin
 Some hardware such as low power mcu allow I/O pin to be disconnected
 in order to save power.
@brief Disable I / O pin Some hardware such as low power mcu allow I / O pin to be disconnected in order to save power .