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.
Dependents: MBED_LIN_RGB_Master_Example
Diff: LinMaster.h
- Revision:
- 7:53b2cded83f3
- Parent:
- 6:0827e5003e17
- Child:
- 8:63d341e53cce
diff -r 0827e5003e17 -r 53b2cded83f3 LinMaster.h
--- a/LinMaster.h Thu Jun 25 06:33:06 2015 +0000
+++ b/LinMaster.h Mon Jun 08 11:59:35 2020 +0000
@@ -38,9 +38,16 @@
*
* int main() {
* (void)lin.init();
- * (void)MyLinMaster.tx_frame(&M2Sframe);
+ *
+ * (void)MyLinMaster.send_frame(&M2Sframe);
* while(MyLinMaster.status() != LinMaster::IDLE);
- * void)MyLinMaster.rx_frame(&S2Mframe);
+ *
+ * (void)MyLinMaster.send_frame(&S2Mframe);
+ * while(MyLinMaster.status() != LinMaster::IDLE);
+ * if (MyLinMaster.get_rx_data(S2Mframe) == true)
+ * {
+ * }
+ * else { }
* }
* @endcode
*/
@@ -99,7 +106,23 @@
* The current LIN driver status
*/
DriverStatus_t status(void) {return ( DriverState );};
-
+
+ /** Error code type */
+ enum FrameError_t {
+ NoError, /* No error */
+ NoSlaveResp, /* No slave response, LIN message has timed out */
+ FramingErr, /* Framing error */
+ CollisionErr, /* Collision error */
+ BusVoltage /* Bus voltage to low */
+ };
+
+ /** Get the last error detected
+ *
+ * @return
+ * The last error detected
+ */
+ FrameError_t last_error(void) {return ( LastError );};
+
/** Frame Direction Type */
enum FrameType_t {
S2M,
@@ -151,14 +174,6 @@
void PinEventHndl(void);
private:
- enum FrameError_t {
- NoError, /* No error */
- NoSlaveResp, /* No slave response, LIN message has timed out */
- FramingErr, /* Framing error */
- CollisionErr, /* Collision error */
- BusVoltage /* Bus voltage to low */
- };
-
enum FrameStatus_t {
FStart,
Break_OK,