4 * Copyright 2005 Develer S.r.l. (http://www.develer.com/)
9 * \brief MCP41 hardware-specific definitions
12 * \author Francesco Sacchi <batt@develer.com>
18 #include <mcp41_map.h>
19 #include <cfg/compiler.h>
23 extern const uint16_t mcp41_ports[MCP41_CNT];
24 extern const uint8_t mcp41_pins[MCP41_CNT];
27 * Set MCP41 port associated with \a dev to output.
29 INLINE void SET_MCP41_DDR(Mcp41Dev dev)
31 /* DDR port is 1 address before PORT */
32 ATOMIC(_SFR_IO8(mcp41_ports[dev] - 1) |= mcp41_pins[dev]);
35 INLINE void MCP41_ON(Mcp41Dev i)
37 ATOMIC(_SFR_IO8(mcp41_ports[i]) &= ~mcp41_pins[i]);
40 INLINE void MCP41_OFF(Mcp41Dev i)
42 ATOMIC(_SFR_IO8(mcp41_ports[i]) |= mcp41_pins[i]);
46 #endif /* HW_MCP41_H */