keybrd library is an open source library for creating custom-keyboard firmware.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

ColPort_AVR.cpp 433B

1234567891011121314151617
  1. #include "ColPort_AVR.h"
  2. /*
  3. configures column port's DDRx and PORTx.
  4. */
  5. ColPort_AVR::ColPort_AVR(volatile unsigned char& DDRx, volatile unsigned char& PORTx,
  6. volatile unsigned char& PINx, const uint8_t colPins)
  7. : ColPort(colPins), DDR(DDRx = ~colPins), PORT(PORTx = colPins), PIN(PINx)
  8. {}
  9. /*
  10. Saves all port-pin values to portState.
  11. */
  12. void ColPort_AVR::read()
  13. {
  14. portState = PIN;
  15. }