LTlib LaurTec Library
4.0.3
Open Source C Library for Microchip Microcontrollers based on XC8 Compiler
|
#include "LTlib.h"
Go to the source code of this file.
Macros | |
#define | IO_PORTA 0x01 |
#define | IO_PORTB 0x02 |
#define | IO_PORTC 0x03 |
#define | IO_PORTD 0x04 |
#define | IO_PORTE 0x05 |
#define | IO_BIT0 0x01 |
#define | IO_BIT1 0x02 |
#define | IO_BIT2 0x04 |
#define | IO_BIT3 0x08 |
#define | IO_BIT4 0x10 |
#define | IO_BIT5 0x20 |
#define | IO_BIT6 0x40 |
#define | IO_BIT7 0x80 |
#define | IO_ALL_PORT_OUTPUT 0x00 |
#define | IO_ALL_PORT_INPUT 0xFF |
#define | IO_BIT0_IN 0x01 |
#define | IO_BIT1_IN 0x02 |
#define | IO_BIT2_IN 0x04 |
#define | IO_BIT3_IN 0x08 |
#define | IO_BIT4_IN 0x10 |
#define | IO_BIT5_IN 0x20 |
#define | IO_BIT6_IN 0x40 |
#define | IO_BIT7_IN 0x80 |
#define | IO_BIT0_OUT 0b11111110 |
#define | IO_BIT1_OUT 0b11111101 |
#define | IO_BIT2_OUT 0b11111011 |
#define | IO_BIT3_OUT 0b11110111 |
#define | IO_BIT4_OUT 0b11101111 |
#define | IO_BIT5_OUT 0b11011111 |
#define | IO_BIT6_OUT 0b10111111 |
#define | IO_BIT7_OUT 0b01111111 |
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) |
#define IO_ALL_PORT_INPUT 0xFF |
Definition at line 73 of file module_IO.h.
#define IO_ALL_PORT_OUTPUT 0x00 |
Definition at line 72 of file module_IO.h.
#define IO_BIT0 0x01 |
Definition at line 63 of file module_IO.h.
#define IO_BIT0_IN 0x01 |
Definition at line 75 of file module_IO.h.
#define IO_BIT0_OUT 0b11111110 |
Definition at line 84 of file module_IO.h.
#define IO_BIT1 0x02 |
Definition at line 64 of file module_IO.h.
#define IO_BIT1_IN 0x02 |
Definition at line 76 of file module_IO.h.
#define IO_BIT1_OUT 0b11111101 |
Definition at line 85 of file module_IO.h.
#define IO_BIT2 0x04 |
Definition at line 65 of file module_IO.h.
#define IO_BIT2_IN 0x04 |
Definition at line 77 of file module_IO.h.
#define IO_BIT2_OUT 0b11111011 |
Definition at line 86 of file module_IO.h.
#define IO_BIT3 0x08 |
Definition at line 66 of file module_IO.h.
#define IO_BIT3_IN 0x08 |
Definition at line 78 of file module_IO.h.
#define IO_BIT3_OUT 0b11110111 |
Definition at line 87 of file module_IO.h.
#define IO_BIT4 0x10 |
Definition at line 67 of file module_IO.h.
#define IO_BIT4_IN 0x10 |
Definition at line 79 of file module_IO.h.
#define IO_BIT4_OUT 0b11101111 |
Definition at line 88 of file module_IO.h.
#define IO_BIT5 0x20 |
Definition at line 68 of file module_IO.h.
#define IO_BIT5_IN 0x20 |
Definition at line 80 of file module_IO.h.
#define IO_BIT5_OUT 0b11011111 |
Definition at line 89 of file module_IO.h.
#define IO_BIT6 0x40 |
Definition at line 69 of file module_IO.h.
#define IO_BIT6_IN 0x40 |
Definition at line 81 of file module_IO.h.
#define IO_BIT6_OUT 0b10111111 |
Definition at line 90 of file module_IO.h.
#define IO_BIT7 0x80 |
Definition at line 70 of file module_IO.h.
#define IO_BIT7_IN 0x80 |
Definition at line 82 of file module_IO.h.
#define IO_BIT7_OUT 0b01111111 |
Definition at line 91 of file module_IO.h.
#define IO_PORTA 0x01 |
Definition at line 57 of file module_IO.h.
#define IO_PORTB 0x02 |
Definition at line 58 of file module_IO.h.
#define IO_PORTC 0x03 |
Definition at line 59 of file module_IO.h.
#define IO_PORTD 0x04 |
Definition at line 60 of file module_IO.h.
#define IO_PORTE 0x05 |
Definition at line 61 of file module_IO.h.
port_size IO_read_port | ( | unsigned char | mcu_port | ) |
This function reads the data from the port.
mcu_port | Port from which you want to read the data. |
Definition at line 307 of file module_IO.c.
References IO_PORTA, IO_PORTB, IO_PORTC, IO_PORTD, and IO_PORTE.
This function reads bit from the selected port.
mcu_port | Port from which you want to read the data. |
bit_mask | Selected bit to be read out of the port. |
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
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.
mcu_port | port for which you want to enable the pull-up resistors |
port_direction | Each bit set the proper bit direction |
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.
mcu_port | Port to which you want to write the data. |
port_data | Data to be sent out |
Definition at line 217 of file module_IO.c.
References IO_PORTA, IO_PORTB, IO_PORTC, IO_PORTD, and IO_PORTE.