LTlib LaurTec Library  4.0.1
Open Source C Library for Microchip Microcontrollers based on XC8 Compiler
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
module_IO.c File Reference
#include "module_IO.h"

Go to the source code of this file.

Functions

void IO_set_all_ports_as_inputs (void)
 
void IO_set_port_direction (unsigned char mcu_port, port_size port_direction)
 
void IO_write_port (unsigned char mcu_port, port_size port_data)
 
port_size IO_read_port (unsigned char mcu_port)
 
port_size IO_read_port_bit (unsigned char mcu_port, port_size bit_mask)
 
void IO_enable_pull_up_resistors (unsigned char mcu_port, port_size resistors_to_enable)
 

Function Documentation

void IO_enable_pull_up_resistors ( unsigned char  mcu_port,
port_size  resistors_to_enable 
)

Definition at line 418 of file module_IO.c.

References IO_PORTB, PULL_UP_ENABLE_BIT, and PULL_UP_ENABLE_REGISTER_B.

port_size IO_read_port ( unsigned char  mcu_port)

This function reads the data from the port.

Parameters
mcu_portPort from which you want to read the data.
Returns
Data from the selected port
Note
For the port name use the defined constants to allow future improvements.
To properly use the function you need to call the IO_set_all_ports_as_inputs first. Indeed this function handles all the Analog inputs.

Definition at line 307 of file module_IO.c.

References IO_PORTA, IO_PORTB, IO_PORTC, IO_PORTD, and IO_PORTE.

port_size IO_read_port_bit ( unsigned char  mcu_port,
port_size  bit_mask 
)

This function reads bit from the selected port.

Parameters
mcu_portPort from which you want to read the data.
bit_maskSelected bit to be read out of the port.
Returns
Bit data from the selected port
Note
For the port name use the defined constants to allow future improvements.
To properly use the function you need to call the IO_set_all_ports_as_inputs first. Indeed this function handles all the Analog inputs.

Definition at line 356 of file module_IO.c.

References IO_PORTA, IO_PORTB, IO_PORTC, IO_PORTD, and IO_PORTE.

void IO_set_all_ports_as_inputs ( void  )

This function initialize all the PORTs as inputs

Parameters
void
Returns
void

Definition at line 47 of file module_IO.c.

void IO_set_port_direction ( unsigned char  mcu_port,
port_size  port_direction 
)

This function set the MCU port direction.

Parameters
mcu_portport for which you want to enable the pull-up resistors
port_directionEach bit set the proper bit direction
Returns
void
Note
For the port name use the defined constants to allow future improvements.
To properly use the function you need to call the IO_set_all_ports_as_inputs first. Indeed this function handles all the Analog inputs.

Definition at line 168 of file module_IO.c.

References IO_PORTA, IO_PORTB, IO_PORTC, IO_PORTD, and IO_PORTE.

void IO_write_port ( unsigned char  mcu_port,
port_size  port_data 
)

This function writes the data to the port.

Parameters
mcu_portPort to which you want to write the data.
port_dataData to be sent out
Returns
void
Note
For the port name use the defined constants to allow future improvements.
To properly use the function you need to call the IO_set_all_ports_as_inputs first. Indeed this function handles all the Analog inputs.

Definition at line 217 of file module_IO.c.

References IO_PORTA, IO_PORTB, IO_PORTC, IO_PORTD, and IO_PORTE.