osd-contiki/cpu/cc2430/dev/uart0.h

32 lines
828 B
C
Raw Normal View History

2012-03-05 17:28:06 +01:00
#ifndef UART_0_H
#define UART_0_H
#include "contiki-conf.h"
#include "cc2430_sfr.h"
#include "8051def.h"
#include "uart.h"
/*---------------------------------------------------------------------------*/
/* UART0 Enable - Disable */
#ifdef UART_ZERO_CONF_ENABLE
#define UART_ZERO_ENABLE UART_ZERO_CONF_ENABLE
#else
#define UART_ZERO_ENABLE 0
#endif
/*---------------------------------------------------------------------------*/
/* UART0 Function Declarations */
#if UART_ZERO_ENABLE
void uart0_init();
void uart0_writeb(uint8_t byte);
2012-12-16 13:44:44 +01:00
void uart0_set_input(int (* input)(unsigned char c));
2012-03-05 17:28:06 +01:00
2012-12-16 13:44:44 +01:00
void uart0_rx_ISR(void) __interrupt(URX0_VECTOR);
void uart0_tx_ISR(void) __interrupt(UTX0_VECTOR);
2012-03-05 17:28:06 +01:00
/* Macro to turn on / off UART RX Interrupt */
2012-12-16 13:44:44 +01:00
#define UART0_RX_INT(v) do { IEN0_URX0IE = v; } while(0)
2012-03-05 17:28:06 +01:00
#endif
#endif /* UART_0_H */