MAX3100, an external serial device to add additional serial ports via SPI
Dependents: FLIGHT_CONTROL_AND_COMMUNICATIONS_SYSTEM
Diff: MAX3100.h
- Revision:
- 1:46c8c60e744a
- Parent:
- 0:055897ab699b
- Child:
- 2:2a49171453d5
--- a/MAX3100.h Sun Jan 16 18:27:44 2011 +0000 +++ b/MAX3100.h Mon Jan 17 01:14:16 2011 +0000 @@ -112,6 +112,11 @@ int _device; int _parity; + uint32_t _irqMask0, _irqMask2; + + void irqDisable(void); + void irqEnable(void); + virtual int _putc(int c) { return putc(c); } virtual int _getc() { return getc(); } @@ -143,7 +148,7 @@ // calculate byte parity. int parityCal(uint8_t c); - + // http://mbed.org/forum/bugs-suggestions/topic/1498 void topic_1498(PinName p); @@ -290,6 +295,13 @@ */ void flushRxBuffer(void) { rx_buffer_in = rx_buffer_out = 0; rx_buffer_full = false; } + /** irqMask + * Setup the mask for enable/disable interrupts. + * @see example3.h + * @param PinName p The InterruptIn pin. + */ + void irqMask(PinName p); + /** attach_cs * Attach a C style callback function pointer. Used if an external function * is controlling the chip CS line. @@ -303,7 +315,9 @@ * @param method The method within the object to call. */ template<class T> - void attach_cs(T* item, void (T::*method)(int, int)) { _cs_obj = (MAX3100Dummy *)item; _cs_method = (void (MAX3100Dummy::*)(int, int))method; } + void attach_cs(T* item, void (T::*method)(int, int)) { + _cs_obj = (MAX3100Dummy *)item; _cs_method = (void (MAX3100Dummy::*)(int, int))method; + } };