LTlib LaurTec Library
4.0.3
Open Source C Library for Microchip Microcontrollers based on XC8 Compiler
|
#include <xc.h>
#include "LTlib.h"
#include "module_IO.h"
#include "module_IO.c"
#include "module_I2C.h"
#include "module_I2C.c"
Go to the source code of this file.
Macros | |
#define | SLAVE_ADDRESS 0xA6 |
#define | READ 0x01 |
#define | WRITE 0x00 |
#define | BUTTON_MASK 0xF0 |
#define | BUTTON_1 0x01 |
#define | BUTTON_2 0x02 |
#define | BUTTON_3 0x04 |
#define | BUTTON_4 0x08 |
#define | BUTTON_1_PRESSED 0b11100000 |
#define | BUTTON_2_PRESSED 0b11010000 |
#define | BUTTON_3_PRESSED 0b10110000 |
#define | BUTTON_4_PRESSED 0b01110000 |
#define | I2C_MODULE_1 |
#define | I2C_Module_open I2C1_open |
#define | I2C_Module_baud_rate I2C1_baud_rate |
#define | I2C_Module_wait_bus_IDLE I2C1_wait_bus_IDLE |
#define | I2C_Module_start_bit I2C1_start_bit |
#define | I2C_Module_read_byte I2C1_read_byte |
#define | I2C_Module_reset_write_collision_flag I2C1_reset_write_collision_flag |
#define | I2C_Module_write_byte I2C1_write_byte |
#define | I2C_Module_stop_bit I2C1_stop_bit |
Functions | |
void | write_data (unsigned char data) |
int | main (void) |
#define I2C_Module_baud_rate I2C1_baud_rate |
#define I2C_Module_read_byte I2C1_read_byte |
#define I2C_Module_reset_write_collision_flag I2C1_reset_write_collision_flag |
#define I2C_Module_start_bit I2C1_start_bit |
#define I2C_Module_stop_bit I2C1_stop_bit |
#define I2C_Module_wait_bus_IDLE I2C1_wait_bus_IDLE |
#define I2C_Module_write_byte I2C1_write_byte |
int main | ( | void | ) |
Definition at line 66 of file main.c.
References BUTTON_1, BUTTON_1_PRESSED, BUTTON_2, BUTTON_2_PRESSED, BUTTON_3, BUTTON_3_PRESSED, BUTTON_4, BUTTON_4_PRESSED, BUTTON_MASK, I2C_MASTER, I2C_Module_baud_rate, I2C_Module_open, IO_BIT4, IO_BIT5, IO_BIT6, IO_BIT7, IO_enable_pull_up_resistors(), IO_PORTB, IO_set_all_ports_as_inputs(), and write_data().
void write_data | ( | unsigned char | data | ) |
Definition at line 103 of file main.c.
References I2C_Module_read_byte, I2C_Module_reset_write_collision_flag, I2C_Module_start_bit, I2C_Module_stop_bit, I2C_Module_wait_bus_IDLE, I2C_Module_write_byte, SLAVE_ADDRESS, and WRITE.