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.
bsp.h@0:7225ff529d1c, 2011-04-27 (annotated)
- Committer:
- t_lark
- Date:
- Wed Apr 27 17:11:08 2011 +0000
- Revision:
- 0:7225ff529d1c
.00000001
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| t_lark | 0:7225ff529d1c | 1 | ////////////////////////////////////////////////////////////////////////////// |
| t_lark | 0:7225ff529d1c | 2 | // Model: Network.qm |
| t_lark | 0:7225ff529d1c | 3 | // File: ./bsp.h |
| t_lark | 0:7225ff529d1c | 4 | // |
| t_lark | 0:7225ff529d1c | 5 | // This file has been generated automatically by QP Modeler (QM). |
| t_lark | 0:7225ff529d1c | 6 | // DO NOT EDIT THIS FILE MANUALLY. |
| t_lark | 0:7225ff529d1c | 7 | // |
| t_lark | 0:7225ff529d1c | 8 | // Please visit www.state-machine.com/qm for more information. |
| t_lark | 0:7225ff529d1c | 9 | ////////////////////////////////////////////////////////////////////////////// |
| t_lark | 0:7225ff529d1c | 10 | #ifndef bsp_h |
| t_lark | 0:7225ff529d1c | 11 | #define bsp_h |
| t_lark | 0:7225ff529d1c | 12 | |
| t_lark | 0:7225ff529d1c | 13 | #include "mbed.h" |
| t_lark | 0:7225ff529d1c | 14 | |
| t_lark | 0:7225ff529d1c | 15 | // System clock tick rate [Hz] |
| t_lark | 0:7225ff529d1c | 16 | #define BSP_TICKS_PER_SEC 100 |
| t_lark | 0:7225ff529d1c | 17 | |
| t_lark | 0:7225ff529d1c | 18 | enum BSP_CarsSignal { |
| t_lark | 0:7225ff529d1c | 19 | CARS_RED, CARS_YELLOW, CARS_GREEN, CARS_BLANK |
| t_lark | 0:7225ff529d1c | 20 | }; |
| t_lark | 0:7225ff529d1c | 21 | |
| t_lark | 0:7225ff529d1c | 22 | enum BSP_PedsSignal { |
| t_lark | 0:7225ff529d1c | 23 | PEDS_DONT_WALK, PEDS_WALK, PEDS_BLANK |
| t_lark | 0:7225ff529d1c | 24 | }; |
| t_lark | 0:7225ff529d1c | 25 | |
| t_lark | 0:7225ff529d1c | 26 | enum BSP_SenseSignal { |
| t_lark | 0:7225ff529d1c | 27 | SENSE_1_CON, SENSE_1_DIS, SENSE |
| t_lark | 0:7225ff529d1c | 28 | }; |
| t_lark | 0:7225ff529d1c | 29 | |
| t_lark | 0:7225ff529d1c | 30 | void BSP_init(void); |
| t_lark | 0:7225ff529d1c | 31 | void BSP_signalCars(BSP_CarsSignal sig); |
| t_lark | 0:7225ff529d1c | 32 | void BSP_signalPeds(BSP_PedsSignal sig); |
| t_lark | 0:7225ff529d1c | 33 | void BSP_showState(char const *state); |
| t_lark | 0:7225ff529d1c | 34 | |
| t_lark | 0:7225ff529d1c | 35 | void BSP_signalSense(BSP_SenseSignal sig); |
| t_lark | 0:7225ff529d1c | 36 | |
| t_lark | 0:7225ff529d1c | 37 | void BSP_chk_io(); |
| t_lark | 0:7225ff529d1c | 38 | |
| t_lark | 0:7225ff529d1c | 39 | |
| t_lark | 0:7225ff529d1c | 40 | class N4S2 { |
| t_lark | 0:7225ff529d1c | 41 | |
| t_lark | 0:7225ff529d1c | 42 | public: |
| t_lark | 0:7225ff529d1c | 43 | static const int N_FACES = 4; |
| t_lark | 0:7225ff529d1c | 44 | static const int S_FACES = 2; |
| t_lark | 0:7225ff529d1c | 45 | |
| t_lark | 0:7225ff529d1c | 46 | static DigitalIn geomSenses[N_FACES]; // geomSenses [face], face = 1-4 |
| t_lark | 0:7225ff529d1c | 47 | static DigitalOut geomTxs[S_FACES]; // geomTxs [face], face = 1-*2* |
| t_lark | 0:7225ff529d1c | 48 | |
| t_lark | 0:7225ff529d1c | 49 | static SerialHalfDuplex sPort1; |
| t_lark | 0:7225ff529d1c | 50 | static SerialHalfDuplex sPort2; |
| t_lark | 0:7225ff529d1c | 51 | static SerialHalfDuplex sPorts[2]; //seg ports in array format |
| t_lark | 0:7225ff529d1c | 52 | static SerialHalfDuplex nPort;//common n bus |
| t_lark | 0:7225ff529d1c | 53 | |
| t_lark | 0:7225ff529d1c | 54 | static DigitalOut sPort1ETx; // enable Tx for sPort 1 |
| t_lark | 0:7225ff529d1c | 55 | static DigitalOut sPort2ETx; // enable Tx for sPort 2 |
| t_lark | 0:7225ff529d1c | 56 | static DigitalOut nPortETx; // enable Tx for nPort |
| t_lark | 0:7225ff529d1c | 57 | static DigitalOut sPortETxs[S_FACES]; //seg ports enables in array format |
| t_lark | 0:7225ff529d1c | 58 | |
| t_lark | 0:7225ff529d1c | 59 | static DigitalOut leds[]; |
| t_lark | 0:7225ff529d1c | 60 | |
| t_lark | 0:7225ff529d1c | 61 | N4S2(){} |
| t_lark | 0:7225ff529d1c | 62 | |
| t_lark | 0:7225ff529d1c | 63 | |
| t_lark | 0:7225ff529d1c | 64 | protected: |
| t_lark | 0:7225ff529d1c | 65 | }; |
| t_lark | 0:7225ff529d1c | 66 | |
| t_lark | 0:7225ff529d1c | 67 | #endif // bsp_h |