#include <system.h>#include "config.h"


Go to the source code of this file.
Defines | |
| #define | change_pin(port, pin, value) |
| #define | clear_pin(port, pin) |
| #define | end_crit_sec() intcon.GIE = store_gie |
| #define | int16 int |
| #define | int8 char |
| #define | kill_interrupts() |
| #define | MAGIC_BOOSTBLOADER_REQUEST 4 |
| #define | make_input(port, pin) set_bit(tris_array[port - PORTA], pin) |
| #define | make_output(port, pin) clear_bit(tris_array[port - PORTA], pin) |
| #define | set_pin(port, pin) |
| #define | start_crit_sec() |
| #define | test_pin(port, pin) ((port_array[port - PORTA] & (1 << pin)) != 0) |
| #define | test_pin_var(port, pin) test_pin(port, pin) |
| #define | toggle_pin(port, pin) |
| #define | turn_analog_intputs_off() |
| #define | turn_global_ints_off() clear_bit(intcon, GIE) |
| #define | turn_global_ints_on() set_bit(intcon, GIE) |
| #define | turn_peripheral_ints_off() clear_bit(intcon, PEIE) |
| #define | turn_peripheral_ints_on() set_bit(intcon, PEIE) |
| #define | uns16 unsigned int |
| #define | uns8 unsigned char |
Functions | |
| void | change_pin_var (uns8 port, uns8 pin, bit value) |
| void | clear_pin_var (uns8 port, uns8 pin) |
| void | set_pin_var (uns8 port, uns8 pin) |
| void | toggle_pin_var (uns8 port, uns8 pin) |
Variables | |
| uns8 | port_shadow [NUMBER_PORTS] |
| volatile uns8 port_array[NUMBER_PORTS] | PORTA |
| volatile uns8 tris_array[NUMBER_PORTS] | TRISA |
| #define change_pin | ( | port, | |||
| pin, | |||||
| value | ) |
Value:
Definition at line 128 of file pic_utils.h.
Referenced by i2c_send_byte(), lcd_write_nibble(), pic_rf_send_byte(), pic_rf_send_byte_int(), pic_rf_set_mode(), sht15_send_byte(), spi_pulse_0(), spi_pulse_1(), spi_write(), spi_write_lsb(), and spi_write_sure().
| #define clear_pin | ( | port, | |||
| pin | ) |
Value:
clear_bit(port_shadow[port - PORTA], pin); \ port_array[port - PORTA] = port_shadow[port - PORTA];
Definition at line 116 of file pic_utils.h.
Referenced by i2c_read_eeprom(), i2c_read_eeprom_16bit(), i2c_receive_byte(), i2c_send_byte(), i2c_start(), i2c_stop(), lcd_setup(), lcd_toggle_e(), lcd_wait_busy(), lcd_write_command(), lcd_write_data(), lcd_write_data_str(), pic_rf_handle_irq_receive(), pic_rf_init(), pic_rf_quick_init(), pic_rf_read_register(), pic_rf_read_register_inline(), pic_rf_read_register_int(), pic_rf_receive(), pic_rf_send_byte(), pic_rf_send_byte_int(), pic_rf_send_command(), pic_rf_send_command_inline(), pic_rf_set_channel(), pic_rf_set_mode(), pic_rf_setup(), pic_rf_transmit(), pwm_handle(), sht15_read_byte16(), sht15_send_byte(), sht15_start(), spi_pulse_0(), spi_pulse_1(), spi_write(), spi_write_lsb(), spi_write_sure(), and sure_7seg_write_str().
| #define end_crit_sec | ( | ) | intcon.GIE = store_gie |
Definition at line 169 of file pic_utils.h.
Referenced by pic_rf_init(), pic_rf_set_channel(), pic_rf_set_mode(), pic_rf_transmit(), and serial_getc().
| #define int16 int |
| #define int8 char |
Definition at line 43 of file pic_utils.h.
| #define kill_interrupts | ( | ) |
Value:
do { \ bit store_gie; \ intcon.GIE = 0; \ } while (intcon.GIE != 0)
Definition at line 158 of file pic_utils.h.
Referenced by pic_rf_receive(), pic_rf_set_channel(), pic_rf_set_mode(), pic_rf_transmit(), serial_putc(), serial_setup(), sht15_read_byte16(), and tick_get_count().
| #define MAGIC_BOOSTBLOADER_REQUEST 4 |
Definition at line 209 of file pic_utils.h.
| #define make_input | ( | port, | |||
| pin | ) | set_bit(tris_array[port - PORTA], pin) |
| #define make_output | ( | port, | |||
| pin | ) | clear_bit(tris_array[port - PORTA], pin) |
Definition at line 147 of file pic_utils.h.
Referenced by i2c_setup(), lcd_setup(), pic_rf_init(), pic_rf_quick_init(), pic_rf_set_mode(), pic_rf_setup(), pic_rf_transmit(), and pwm_setup().
| #define set_pin | ( | port, | |||
| pin | ) |
Value:
set_bit(port_shadow[port - PORTA], pin); \ port_array[port - PORTA] = port_shadow[port - PORTA];
Definition at line 112 of file pic_utils.h.
Referenced by i2c_read_eeprom(), i2c_read_eeprom_16bit(), i2c_receive_byte(), i2c_send_byte(), i2c_stop(), lcd_toggle_e(), lcd_wait_busy(), lcd_write_data(), lcd_write_data_str(), pic_rf_handle_irq_receive(), pic_rf_init(), pic_rf_read_register(), pic_rf_read_register_inline(), pic_rf_read_register_int(), pic_rf_receive(), pic_rf_send_byte(), pic_rf_send_byte_int(), pic_rf_send_command(), pic_rf_send_command_inline(), pic_rf_set_channel(), pic_rf_set_mode(), pic_rf_setup(), pic_rf_transmit(), pwm_handle(), sht15_read_byte16(), sht15_send_byte(), sht15_start(), spi_pulse_0(), spi_pulse_1(), spi_write(), spi_write_lsb(), spi_write_sure(), and sure_7seg_write_str().
| #define start_crit_sec | ( | ) |
Value:
bit store_gie = intcon.GIE; \
kill_interrupts()
Definition at line 164 of file pic_utils.h.
Referenced by pic_rf_init(), pic_rf_set_channel(), pic_rf_set_mode(), pic_rf_transmit(), and serial_getc().
| #define test_pin | ( | port, | |||
| pin | ) | ((port_array[port - PORTA] & (1 << pin)) != 0) |
Definition at line 125 of file pic_utils.h.
Referenced by i2c_ack_polling(), i2c_receive_byte(), lcd_wait_busy(), pic_rf_receive(), pic_rf_send_byte(), pic_rf_send_byte_int(), sht15_read_byte16(), and sht15_send_byte().
| #define test_pin_var | ( | port, | |||
| pin | ) | test_pin(port, pin) |
Definition at line 138 of file pic_utils.h.
| #define toggle_pin | ( | port, | |||
| pin | ) |
Value:
port_shadow[port - PORTA] ^= (1 << (pin)); \ port_array[port - PORTA] = port_shadow[port - PORTA];
Definition at line 120 of file pic_utils.h.
| #define turn_analog_intputs_off | ( | ) |
Definition at line 77 of file pic_utils.h.
| #define turn_global_ints_off | ( | ) | clear_bit(intcon, GIE) |
Definition at line 154 of file pic_utils.h.
| #define turn_global_ints_on | ( | ) | set_bit(intcon, GIE) |
Definition at line 153 of file pic_utils.h.
| #define turn_peripheral_ints_off | ( | ) | clear_bit(intcon, PEIE) |
Definition at line 151 of file pic_utils.h.
| #define turn_peripheral_ints_on | ( | ) | set_bit(intcon, PEIE) |
Definition at line 150 of file pic_utils.h.
| #define uns16 unsigned int |
Definition at line 45 of file pic_utils.h.
Referenced by i2c_read_eeprom_16bit(), pkt_init(), pkt_process_rf_data(), pkt_process_tx_queue(), sht15_fix_humidity_l(), sht15_read(), sht15_read_byte16(), sht15_read_humidity(), sht15_read_temperature(), and tick_get_count().
| #define uns8 unsigned char |
Definition at line 44 of file pic_utils.h.
Referenced by change_pin_var(), clear_pin_var(), hc4led_write_str(), i2c_read_eeprom(), i2c_receive_byte(), i2c_send_byte(), pic_rf_handle_irq_receive(), pic_rf_init(), pic_rf_quick_init(), pic_rf_read_register(), pic_rf_read_register_inline(), pic_rf_read_register_int(), pic_rf_receive(), pic_rf_send_byte(), pic_rf_send_byte_int(), pic_rf_send_bytes(), pic_rf_send_bytes_inline(), pic_rf_send_command(), pic_rf_send_command_inline(), pic_rf_set_mode(), pic_rf_transmit(), pkt_calc_check_byte(), pkt_check_check_byte(), pkt_init(), pkt_print_packet(), pkt_process_rf_data(), pkt_process_tx_queue(), pkt_queue_packet(), pkt_seen(), pkt_send_packet(), pkt_send_payload(), pwm_handle(), serial_getc(), serial_print_int(), serial_print_str(), serial_putc(), serial_rx_isr(), serial_tx_isr(), set_pin_var(), sht15_read_byte16(), sht15_send_byte(), spi_write(), spi_write_lsb(), spi_write_sure(), sure_7seg_write_str(), and toggle_pin_var().
| void change_pin_var | ( | uns8 | port, | |
| uns8 | pin, | |||
| bit | value | |||
| ) |
| void clear_pin_var | ( | uns8 | port, | |
| uns8 | pin | |||
| ) |
| void set_pin_var | ( | uns8 | port, | |
| uns8 | pin | |||
| ) |
| void toggle_pin_var | ( | uns8 | port, | |
| uns8 | pin | |||
| ) |
| uns8 port_shadow[NUMBER_PORTS] |
Referenced by change_pin_var(), clear_pin_var(), set_pin_var(), and toggle_pin_var().
| volatile uns8 port_array [NUMBER_PORTS] PORTA |
Definition at line 52 of file pic_utils.h.
Referenced by change_pin_var(), clear_pin_var(), lcd_wait_busy(), pic_rf_set_channel(), set_pin_var(), sht15_setup(), spi_setup(), and toggle_pin_var().
| volatile uns8 tris_array [NUMBER_PORTS] TRISA |
Definition at line 53 of file pic_utils.h.
1.5.5