The PPS
module allows dynamic mapping of peripheral inputs and outputs to various GPIO pins on Microchip PIC16F series microcontrollers. It provides functions for configuring pin mappings for peripherals such as UART, SPI, PWM, and I2C, which can be assigned to different GPIO pins using the Peripheral Pin Select (PPS) functionality.
File Information #
- Files:
pps.h
,pps.c
- Version: 1.0.1
PPS Interface #
The PPS
instance provides access to functions for mapping GPIO pins to specific peripheral outputs, bidirectional communication, and inputs.
Functions in the PPS Interface #
MapOutput(GPIO_Ports_t PortPin, PPSOutputPeripheralEnum_t PPS_Device)
- Description: Maps a specified peripheral’s output function to a specific GPIO pin. This is useful for assigning peripherals such as UART transmit (TX), SPI data out, or PWM outputs.
MapBiDirection(GPIO_Ports_t PortPin, PPSOutputPeripheralEnum_t PPS_Device, volatile uint8_t *regPPC_Input_ptr)
- Description: Maps a peripheral that requires bidirectional communication to a GPIO pin. This is typically used for communication peripherals like I2C (SCL/SDA) or SPI (SCK/MOSI/MISO), where input and output functions are required on the same pin.
MapInput(GPIO_Ports_t PortPin, volatile uint8_t *regPPC_Input_ptr)
- Description: Maps a peripheral input function to a specific GPIO pin. This is typically used for peripherals like UART receive (RX) or SPI MISO, which only require input from the GPIO pin.