Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 

49 linhas
1.5 KiB

  1. /*
  2. * mcp23016:
  3. * Copyright (c) 2012-2013 Gordon Henderson
  4. *
  5. * Header file for code using the MCP23016 GPIO expander
  6. * chip.
  7. ***********************************************************************
  8. * This file is part of wiringPi:
  9. * https://github.com/WiringPi/WiringPi/
  10. *
  11. * wiringPi is free software: you can redistribute it and/or modify
  12. * it under the terms of the GNU Lesser General Public License as
  13. * published by the Free Software Foundation, either version 3 of the
  14. * License, or (at your option) any later version.
  15. *
  16. * wiringPi is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU Lesser General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU Lesser General Public
  22. * License along with wiringPi.
  23. * If not, see <http://www.gnu.org/licenses/>.
  24. ***********************************************************************
  25. */
  26. // MCP23016 Registers
  27. #define MCP23016_GP0 0x00
  28. #define MCP23016_GP1 0x01
  29. #define MCP23016_OLAT0 0x02
  30. #define MCP23016_OLAT1 0x03
  31. #define MCP23016_IPOL0 0x04
  32. #define MCP23016_IPOL1 0x05
  33. #define MCP23016_IODIR0 0x06
  34. #define MCP23016_IODIR1 0x07
  35. #define MCP23016_INTCAP0 0x08
  36. #define MCP23016_INTCAP1 0x09
  37. #define MCP23016_IOCON0 0x0A
  38. #define MCP23016_IOCON1 0x0B
  39. // Bits in the IOCON register
  40. #define IOCON_IARES 0x01
  41. // Default initialisation mode
  42. #define IOCON_INIT 0