aboutsummaryrefslogtreecommitdiffstats
path: root/ports/MSP430
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-02-06 22:07:17 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-02-06 22:07:17 +0000
commitd5f443f74d551831ef4f93c043f70b53d9b1008b (patch)
tree599b517e171ed7258776d3960ac6e3908855a1aa /ports/MSP430
parent35b0454ddb7ac3b9a7b4142c7c04be4570a29798 (diff)
downloadChibiOS-d5f443f74d551831ef4f93c043f70b53d9b1008b.tar.gz
ChibiOS-d5f443f74d551831ef4f93c043f70b53d9b1008b.tar.bz2
ChibiOS-d5f443f74d551831ef4f93c043f70b53d9b1008b.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@732 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'ports/MSP430')
-rw-r--r--ports/MSP430/msp430_serial.c10
-rw-r--r--ports/MSP430/msp430_serial.h17
2 files changed, 19 insertions, 8 deletions
diff --git a/ports/MSP430/msp430_serial.c b/ports/MSP430/msp430_serial.c
index 60cd00af6..69351b19d 100644
--- a/ports/MSP430/msp430_serial.c
+++ b/ports/MSP430/msp430_serial.c
@@ -102,7 +102,7 @@ static void OutNotify1(void) {
* @param ctl The value for the @p U0CTL register.
* @note Does not reset the I/O queues.
*/
-void msp430_set_usart0(uint16_t div, uint8_t mod, uint8_t ctl) {
+void usart0_setup(uint16_t div, uint8_t mod, uint8_t ctl) {
U0CTL = SWRST; /* Resets the USART, it should already be */
/* USART init */
@@ -176,7 +176,7 @@ static void OutNotify2(void) {
* @note Must be invoked with interrupts disabled.
* @note Does not reset the I/O queues.
*/
-void msp430_set_usart1(uint16_t div, uint8_t mod, uint8_t ctl) {
+void usart1_setup(uint16_t div, uint8_t mod, uint8_t ctl) {
U1CTL = SWRST; /* Resets the USART, it should already be */
/* USART init */
@@ -199,17 +199,17 @@ void msp430_set_usart1(uint16_t div, uint8_t mod, uint8_t ctl) {
* @brief Serial driver initialization.
* @note The serial ports are initialized at @p 38400-8-N-1 by default.
*/
-void msp430_serial_init(void) {
+void serial_init(void) {
/* I/O queues setup.*/
#if USE_MSP430_USART0
chFDDInit(&COM1, ib1, sizeof ib1, NULL, ob1, sizeof ob1, OutNotify1);
- msp430_set_usart0(UBR(38400), 0, CHAR);
+ usart0_setup(UBR(DEFAULT_USART_BITRATE), 0, CHAR);
#endif
#if USE_MSP430_USART1
chFDDInit(&COM2, ib2, sizeof ib2, NULL, ob2, sizeof ob2, OutNotify2);
- msp430_set_usart1(UBR(38400), 0, CHAR);
+ usart1_setup(UBR(DEFAULT_USART_BITRATE), 0, CHAR);
#endif
}
diff --git a/ports/MSP430/msp430_serial.h b/ports/MSP430/msp430_serial.h
index 3ea1730a7..5057a5524 100644
--- a/ports/MSP430/msp430_serial.h
+++ b/ports/MSP430/msp430_serial.h
@@ -38,6 +38,17 @@
#endif
/**
+ * @brief Default bit rate.
+ * @details Configuration parameter, at startup the UARTs are configured at
+ * this speed.
+ * @note It is possible to use @p SetUART() in order to change the working
+ * parameters at runtime.
+ */
+#if !defined(DEFAULT_USART_BITRATE) || defined(__DOXYGEN__)
+#define DEFAULT_USART_BITRATE 38400
+#endif
+
+/**
* @brief USART0 driver enable switch.
* @details If set to @p TRUE the support for USART0 is included.
* @note The default is @p TRUE.
@@ -64,9 +75,9 @@
#ifdef __cplusplus
extern "C" {
#endif
- void msp430_serial_init(void);
- void msp430_set_usart0(uint16_t div, uint8_t mod, uint8_t ctl);
- void msp430_set_usart1(uint16_t div, uint8_t mod, uint8_t ctl);
+ void serial_init(void);
+ void usart0_setup(uint16_t div, uint8_t mod, uint8_t ctl);
+ void usart1_setup(uint16_t div, uint8_t mod, uint8_t ctl);
#ifdef __cplusplus
}
#endif