X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=src%2Fcc1111%2Fao_arch_funcs.h;h=5e2fc13db1ab808f8a6e5eda1607d5fe871626d5;hp=0737e7abeb2c113449e9ee839d4a68328d5dc265;hb=a27b9b5c36cf748e415ba210c8d8ae72d8227a98;hpb=0cfd22baa6af44e053428c30c1a95cf5551b68af diff --git a/src/cc1111/ao_arch_funcs.h b/src/cc1111/ao_arch_funcs.h index 0737e7ab..5e2fc13d 100644 --- a/src/cc1111/ao_arch_funcs.h +++ b/src/cc1111/ao_arch_funcs.h @@ -29,6 +29,15 @@ extern __xdata uint8_t ao_spi_mutex; UxGCR_ORDER_MSB | \ ((speed) << UxGCR_BAUD_E_SHIFT))) +#define ao_spi_get_slave(bus) do { \ + ao_mutex_get(&ao_spi_mutex); \ + ao_spi_set_speed(AO_SPI_SPEED_FAST); \ + } while (0) + +#define ao_spi_put_slave(bus) do { \ + ao_mutex_put(&ao_spi_mutex); \ + } while (0) + #define ao_spi_get_mask(reg,mask,bus,speed) do { \ ao_mutex_get(&ao_spi_mutex); \ ao_spi_set_speed(speed); \ @@ -88,3 +97,4 @@ ao_spi_init(void); #define token_paster(x,y) x ## y #define token_evaluator(x,y) token_paster(x,y) #define ao_enable_output(port,bit,pin,v) cc1111_enable_output(port,token_evaluator(port,DIR), token_evaluator(port,SEL), pin, bit, v) +#define ao_gpio_set(port, bit, pin, v) ((pin) = (v))