phs fan
/
PHSShield_f405bridge
Hack the PHS Shield, serial bridge
Fork of PHSShield_F405hack by
Diff: phs_f405.h
- Revision:
- 1:9cb4854ab263
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phs_f405.h Wed Jul 01 00:45:54 2015 +0000 @@ -0,0 +1,38 @@ +#ifndef _phs_f405_h_ +#define _phs_f405_h_ + +#include "mbed.h" + +class PhsReset { +public: + void write (int value); + int read (); + + PhsReset& operator= (int value) { + write(value); + return *this; + } + + PhsReset& operator= (PhsReset& rhs) { + write(rhs.read()); + return *this; + } + + operator int() { + return read(); + } +}; + + +class ShieldSerial { +public: + ShieldSerial (int baud); + int getc (); + int putc (int c); + int readable (); + int writeable (); +protected: + UART_HandleTypeDef UartHandle; +}; + +#endif