Code for our FYDP -only one IMU works right now -RTOS is working

Dependencies:   mbed

Committer:
majik
Date:
Wed Mar 18 22:23:48 2015 +0000
Revision:
0:964eb6a2ef00
This is our FYDP code, but only one IMU works with the RTOS.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
majik 0:964eb6a2ef00 1 /*
majik 0:964eb6a2ef00 2
majik 0:964eb6a2ef00 3 To add another device some functions/macros need to be defined.
majik 0:964eb6a2ef00 4 The Device folder shows examples of other devices.
majik 0:964eb6a2ef00 5
majik 0:964eb6a2ef00 6 1. In MACROS.h the include to the macro file need to be added.
majik 0:964eb6a2ef00 7
majik 0:964eb6a2ef00 8 2. A <NameOfYourFile.h> file needs to be added, it needs to include the ifdef(target) statement, and definitions for:
majik 0:964eb6a2ef00 9 MODSERIAL_IRQ_REG --- register which enables/disables serial IRQs
majik 0:964eb6a2ef00 10 DISABLE_TX_IRQ --- macro that disables TX IRQs
majik 0:964eb6a2ef00 11 DISABLE_RX_IRQ --- macro that disables RX IRQs
majik 0:964eb6a2ef00 12 ENABLE_TX_IRQ --- macro that enables TX IRQs
majik 0:964eb6a2ef00 13 ENABLE_RX_IRQ --- macro that enables RX IRQs
majik 0:964eb6a2ef00 14
majik 0:964eb6a2ef00 15 RESET_TX_FIFO --- macro that resets TX FIFO buffer, if applicable. If not, something like while(1==0) won't do anything and doesn't generate compiler warnings
majik 0:964eb6a2ef00 16 RESET_RX_FIFO --- macro that resets RX FIFO buffer, if no hardware options, you can also read data until no more data is available
majik 0:964eb6a2ef00 17
majik 0:964eb6a2ef00 18 MODSERIAL_READ_REG --- register where RX data is in
majik 0:964eb6a2ef00 19 MODSERIAL_WRITE_REG --- register where TX data is in (can be same as previous)
majik 0:964eb6a2ef00 20 MODSERIAL_READABLE --- returns true if new data is available in read_reg
majik 0:964eb6a2ef00 21 MODSERIAL_WRITABLE --- returns true if we may write new data in write_reg
majik 0:964eb6a2ef00 22
majik 0:964eb6a2ef00 23 RX_IRQ_ENABLED --- checks if RX IRQs are enabled by MODSERIAL. Only required if the device has no registers that tell which IRQ fired. If those registers are available (LPCs have then), may just be 'true'
majik 0:964eb6a2ef00 24 TX_IRQ_ENABLED --- checks if TX IRQs are enabled by MODSERIAL. See previous
majik 0:964eb6a2ef00 25
majik 0:964eb6a2ef00 26 3. A <NameOfYourFile.cpp> file needs to be added, it needs to include the ifdef(target) statement, and functions for:
majik 0:964eb6a2ef00 27 void setBase(void) --- function that sets _base pointer to point to correct UART, and _IRQ pointer to point to correct IRQ.
majik 0:964eb6a2ef00 28
majik 0:964eb6a2ef00 29 void initDevice(void)--- function that allows for setting registers after everything else is initialized, if required
majik 0:964eb6a2ef00 30
majik 0:964eb6a2ef00 31 bool txIsBusy(void) --- function that returns true as long as long as device isn't done with transmitting
majik 0:964eb6a2ef00 32
majik 0:964eb6a2ef00 33 */
majik 0:964eb6a2ef00 34