diff options
| author | Bdale Garbee <bdale@gag.com> | 2014-12-06 15:39:53 -0700 | 
|---|---|---|
| committer | Bdale Garbee <bdale@gag.com> | 2014-12-06 15:39:53 -0700 | 
| commit | 7339d2379713b5b7e4c4fe6bad89ed93f9d39e82 (patch) | |
| tree | 41e653c4014940a0d78900fddd433514b9dbfc66 /src/lpc/ao_arch_funcs.h | |
| parent | d1f9121593fe30b924223e89ef4d596b5bec2b25 (diff) | |
| parent | b6462ca3a7e99fe390ec97f94c23d36fab8c294d (diff) | |
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
Diffstat (limited to 'src/lpc/ao_arch_funcs.h')
| -rw-r--r-- | src/lpc/ao_arch_funcs.h | 16 | 
1 files changed, 14 insertions, 2 deletions
diff --git a/src/lpc/ao_arch_funcs.h b/src/lpc/ao_arch_funcs.h index 21a7a8e5..69f2cbfb 100644 --- a/src/lpc/ao_arch_funcs.h +++ b/src/lpc/ao_arch_funcs.h @@ -30,8 +30,19 @@  #define ao_gpio_get(port, bit, pin) 	(lpc_gpio.byte[lpc_all_bit(port,bit)]) +#define PORT0_JTAG_REGS	((1 << 11) | (1 << 12) | (1 << 14)) + +static inline void lpc_set_gpio(int port, int bit) { +	if (port == 0 && (1 << bit) & (PORT0_JTAG_REGS)) { +		vuint32_t *_ioconf = &lpc_ioconf.pio0_0 + ((port)*24+(bit)); + +		*_ioconf = (*_ioconf & ~LPC_IOCONF_FUNC_MASK) | LPC_IOCONF_FUNC_PIO0_11; +	} +} +  #define ao_enable_output(port,bit,pin,v) do {			\  		ao_enable_port(port);				\ +		lpc_set_gpio(port,bit);				\  		ao_gpio_set(port, bit, pin, v);			\  		lpc_gpio.dir[port] |= (1 << bit);		\  	} while (0) @@ -52,6 +63,7 @@  #define ao_enable_input(port,bit,mode) do {				\  		ao_enable_port(port);					\ +		lpc_set_gpio(port,bit);					\  		lpc_gpio.dir[port] &= ~(1 << bit);			\  		ao_gpio_set_mode(port,bit,mode);			\  	} while (0) @@ -201,7 +213,7 @@ void  ao_spi_put(uint8_t spi_index);  void -ao_spi_send(void *block, uint16_t len, uint8_t spi_index); +ao_spi_send(const void *block, uint16_t len, uint8_t spi_index);  void  ao_spi_send_fixed(uint8_t value, uint16_t len, uint8_t spi_index); @@ -210,7 +222,7 @@ void  ao_spi_recv(void *block, uint16_t len, uint8_t spi_index);  void -ao_spi_duplex(void *out, void *in, uint16_t len, uint8_t spi_index); +ao_spi_duplex(const void *out, void *in, uint16_t len, uint8_t spi_index);  extern uint16_t	ao_spi_speed[LPC_NUM_SPI];  | 
