Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
SoftSerialSendOnry.cpp
00001 #include "SoftSerialSendOnry.h" 00002 00003 SoftSerialSendOnry::SoftSerialSendOnry(PinName TX, const char* name) { 00004 tx_en = false; 00005 if (TX != NC) { 00006 tx = new DigitalOut(TX); 00007 tx_en = true; 00008 tx->write(1); 00009 tx_bit = -1; 00010 txticker.attach(this, &SoftSerialSendOnry::tx_handler); 00011 } 00012 00013 baud(9600); 00014 format(); 00015 } 00016 00017 SoftSerialSendOnry::~SoftSerialSendOnry() { 00018 if (tx_en) 00019 delete(tx); 00020 } 00021 00022 void SoftSerialSendOnry::baud(int baudrate) { 00023 bit_period = 1000000 / baudrate; 00024 } 00025 00026 void SoftSerialSendOnry::format(int bits, Parity parity, int stop_bits) { 00027 _bits = bits; 00028 _parity = parity; 00029 _stop_bits = stop_bits; 00030 _total_bits = 1 + _bits + _stop_bits + (bool)_parity; 00031 } 00032 00033 int SoftSerialSendOnry::_getc() 00034 { 00035 return(0); 00036 }
Generated on Wed Jul 13 2022 01:59:28 by
