picoos-ow
1.xxxx
|
#define | OWCFG_READ_IN() ( (P2IN & BIT6) ? 1 : 0 ) |
#define | OWCFG_OUT_LOW() P2OUT &= ~BIT6; P2DIR |= BIT6 |
#define | OWCFG_OUT_HIGH() P2OUT |= BIT6; P2DIR |= BIT6 |
#define | OWCFG_DIR_IN() P2DIR &= ~(BIT6) |
#define | OWCFG_DIR_OUT() P2DIR |= BIT6 |
#define | OWCFG_POWER_ON() P2DIR |= BIT7; P2OUT |= BIT7 |
#define | OWCFG_POWER_OFF() P2OUT &= ~BIT7 |
#define OWCFG_READ_IN | ( | ) | ( (P2IN & BIT6) ? 1 : 0 ) |
Configure GPIO operation to be used when library wants to read bus state.
#define OWCFG_OUT_LOW | ( | ) | P2OUT &= ~BIT6; P2DIR |= BIT6 |
Configure GPIO operation to be used when library wants to drive bus low. This operation should also put pin to output mode (note that order of changing pin value and direction is chip dependent).
#define OWCFG_OUT_HIGH | ( | ) | P2OUT |= BIT6; P2DIR |= BIT6 |
Configure GPIO operation to be used when library wants to drive bus high to deliver strong pull-up. This operation should also put pin to output mode (note that order of changing pin value and direction is chip dependent).
#define OWCFG_DIR_IN | ( | ) | P2DIR &= ~(BIT6) |
Configure GPIO operation to be used when library wants to change bus pin into input (floating).
#define OWCFG_DIR_OUT | ( | ) | P2DIR |= BIT6 |
#define OWCFG_POWER_ON | ( | ) | P2DIR |= BIT7; P2OUT |= BIT7 |
Configure GPIO operation to be used when library wants to turn power on for 1-Wire bus pull-up resistor. This is optional. If not configured, it is assumed that pull-up is always powered.
#define OWCFG_POWER_OFF | ( | ) | P2OUT &= ~BIT7 |
Configure GPIO operation to be used when library wants to turn power off for 1-Wire bus pull-up resistor. This is optional. If not configured, it is assumed that pull-up is always powered.
This can be used to save power in battery-powered systems.