예제 #1
0
static void init_control_pins(void) {
	/*configure control pins*/
	REG_STORE(AT91C_PIOA_PPUDR, CONFIG_NXT_BT_CMD_PIN);
	pin_config_output(CONFIG_NXT_BT_CS_PIN | CONFIG_NXT_BT_RST_PIN | CONFIG_NXT_BT_CMD_PIN);
	pin_set_output(CONFIG_NXT_BT_CS_PIN | CONFIG_NXT_BT_RST_PIN);
	pin_clear_output(CONFIG_NXT_BT_CMD_PIN);

}
예제 #2
0
void bluetooth_hw_hard_reset(void) {
	pin_config_output(BTM_BT_RST_PIN);
	pin_set_output(BTM_BT_RST_PIN);
	ksleep(1000);

	pin_clear_output(BTM_BT_RST_PIN);
	ksleep(5000);

	pin_config_input(BTM_BT_LINK_PIN);
	REG_STORE(AT91C_PIOA_PPUER, BTM_BT_LINK_PIN);
	REG_STORE(AT91C_PIOA_MDDR, BTM_BT_LINK_PIN);
}