X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fcc1111%2Fao_arch.h;h=847ac1a65ec1e438df2a884e1c271c1a7cf08346;hb=f952f9c285e2718a433c8c720c9b5d9c369e7036;hp=001165fafd9bae0b592a4be9f1da975ce8f6e9eb;hpb=b132eefc5f63412bb4a98a4bb72b9055e40d5d42;p=fw%2Faltos diff --git a/src/cc1111/ao_arch.h b/src/cc1111/ao_arch.h index 001165fa..847ac1a6 100644 --- a/src/cc1111/ao_arch.h +++ b/src/cc1111/ao_arch.h @@ -45,7 +45,7 @@ ao_delay(AO_SEC_TO_TICKS(2)); \ } while (0) -#define ao_arch_nop() _asm nop _endasm +#define ao_arch_nop() __asm nop __endasm #define ao_arch_interrupt(n) __interrupt n #define ao_arch_naked_declare __naked @@ -106,7 +106,7 @@ extern __code __at (0x00a6) uint32_t ao_radio_cal; /* Save current context */ #define ao_arch_save_regs() \ - _asm \ + __asm \ /* Push ACC first, as when restoring the context it must be restored \ * last (it is used to set the IE register). */ \ push ACC \ @@ -125,11 +125,11 @@ extern __code __at (0x00a6) uint32_t ao_radio_cal; push ar0 \ push ar1 \ push PSW \ - _endasm; \ + __endasm; \ PSW = 0; \ - _asm \ + __asm \ push _bp \ - _endasm + __endasm #define ao_arch_save_stack() { \ uint8_t stack_len; \ @@ -166,7 +166,7 @@ extern __code __at (0x00a6) uint32_t ao_radio_cal; *stack_ptr++ = *save_ptr++; \ while (--stack_len); \ \ - _asm \ + __asm \ pop _bp \ pop PSW \ pop ar1 \ @@ -193,7 +193,7 @@ extern __code __at (0x00a6) uint32_t ao_radio_cal; /* Finally pop off the ACC, which was the first register saved. */ \ pop ACC \ ret \ - _endasm; \ + __endasm; \ } #define ao_arch_critical(b) __critical { b } @@ -231,6 +231,9 @@ ao_button_init(void); char ao_button_get(void) __critical; +void +ao_button_clear(void) __critical; + /* ao_string.c */ void @@ -248,4 +251,47 @@ _ao_xmemcmp(__xdata void *a, __xdata void *b, uint8_t count); #define ao_xmemcmp(d,s,c) _ao_xmemcmp((d), (s), (c)) +struct ao_serial_speed { + uint8_t baud; + uint8_t gcr; +}; + +extern const __code struct ao_serial_speed ao_serial_speeds[]; + +/* + * ao_dma.c + */ + +/* Allocate a DMA channel. the 'done' parameter will be set when the + * dma is finished and will be used to wakeup any waiters + */ + +uint8_t +ao_dma_alloc(__xdata uint8_t * done); + +/* Setup a DMA channel */ +void +ao_dma_set_transfer(uint8_t id, + void __xdata *srcaddr, + void __xdata *dstaddr, + uint16_t count, + uint8_t cfg0, + uint8_t cfg1); + +/* Start a DMA channel */ +void +ao_dma_start(uint8_t id); + +/* Manually trigger a DMA channel */ +void +ao_dma_trigger(uint8_t id); + +/* Abort a running DMA transfer */ +void +ao_dma_abort(uint8_t id); + +/* DMA interrupt routine */ +void +ao_dma_isr(void) ao_arch_interrupt(8); + #endif /* _AO_ARCH_H_ */