summaryrefslogtreecommitdiff
path: root/src/core/ao.h
Commit message (Collapse)AuthorAge
* altos: Rename 'core' to 'kernel'Keith Packard2014-04-05
| | | | | | | core remains a bad name to use -- dirvish skips files (and directories, it seems) with that name. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Report battery, apogee and main voltages over APRSKeith Packard2014-01-15
| | | | | | This makes APRS more usable when you mute the RF audio on the HT. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: IMU accel calibration values need to be signedKeith Packard2013-10-27
| | | | | | The MPU6000 reports signed values. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Calibrate IMU accelerometers tooKeith Packard2013-10-25
| | | | | | | | Average the IMU accelerometer values pointing up and down so that we have a zero-g offset for all three axes. This can then be used to compute which direction the rocket is pointing while sitting on the pad. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Merge GPS logging into a single functionKeith Packard2013-10-14
| | | | | | | | | | | | Create a new global, ao_gps_new, which indicates new GPS position and satellite data. Use ao_gps_new as the new sleep/wakeup address. Merge the separate gps position/satellite logging tasks into a single function which waits for new data and writes out the changed values. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make TeleMini v2.0 fitKeith Packard2013-08-25
| | | | | | Mash lots of storage locations and code around to shrink stuff down to size Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add fast-timer API. Use for quadrature and button driversKeith Packard2013-06-09
| | | | | | | This splits the fast-timer portion out of the debounce helper code and shares that with the quadrature driver which now uses it directly. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add pyro operations to regular ignite commandsKeith Packard2013-05-26
| | | | | | Instead of having separate commands, just mix the two sets together. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Allow architecture to define the type of port registersKeith Packard2013-05-18
| | | | | | LPC11U14 has 32-bit ports, STM32 has 16 bit ports. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add 'g' command to ublox GPS code.Keith Packard2013-05-15
| | | | | | | | Take the gps_dump function from ao_gps_skytraq.c and move it to a new file so it can be shared with the u-blox driver. That affects every skytraq and u-blox user as they need to include the new file. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Move ao_notask to coreKeith Packard2013-05-07
| | | | | | | The STM flash loader wants to be taskless too, share this very simple implementation of sleep/wakeup. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Compute "real" RSSI value in radio code as neededKeith Packard2013-05-07
| | | | | | | | | Instead of dragging around the weird CC1111 RSSI values, just compute a dBm value in a signed 8-bit integer, ao_radio_rssi. Use that everywhere we need RSSI internally. We leave the weird CC1111 value in the packet reply as that's what the host expects. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Provide timeout value to ao_radio_recvKeith Packard2013-05-07
| | | | | | | | | Instead of using ao_alarm around calls to ao_radio_recv, provide an explicit timeout value as needed by radio functions with more complicated system interaction than the cc1111. The timeout is 8 bits of clock ticks. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Expose ao_put_string functionKeith Packard2013-05-07
| | | | | | This works like puts, except it doesn't add a trailing newline. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib/altosui: Carry receiver status around in AltosListenerStateKeith Packard2013-04-09
| | | | | | | | | | This moves the crc_errors into the new structure and adds a receiver battery voltage value there as well. Now the receiver status can be monitored separately from the flight status. That also means that code receiving state updates should be prepared to accept missing listener or flight state values. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Do not release interrupts from any pollchar functionKeith Packard2013-03-31
| | | | | | | | | | | getchar relies on interrupts being blocked across the pollchar calls and into the sleep call or it may go to sleep with data pending. This prefixes all pollchar functions with _ to indicate that they are to be called with interrupts blocked and eliminates all interrupt manipulation calls from within the pollchar functions. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Get CC115L radio working.Keith Packard2013-03-29
| | | | | | | | | | | | | | | | This involved figuring out which GPIO signal would reliably indicate that the transmitter was finished; I ended up using the PA_PD bit for this. This also converts all of the radio users to the long packet support as the CC115L has only a 64-byte fifo, not large enough to hold either an RDF tone or a regular AltOS telemetry packet. This also renames the public API for sending APRS packets from ao_radio_send_lots to ao_radio_send_aprs, which is at least more accurate. The workings of that API haven't changed, just the name. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add temporary RF power settingsKeith Packard2013-03-29
| | | | | | | | | | These expose the raw cc115l and rfpa0133 register settings so that we can calibrate them against measured power outputs. I've tested them to verify that they change how much power the board consumes, so they're clearly doing something... Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add new panic flag for bufio misuseKeith Packard2013-03-27
| | | | | | Allow the bufio code to signal a fatal error if someone misuses the API Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Allow radio recv and xmit to be separately configuredKeith Packard2013-03-26
| | | | | | | The CC115L is xmit only, so split out the functions and provide defines to check for xmit or recv separately as needed. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add RFPA0133 amplifier driverKeith Packard2013-03-26
| | | | | | No configuration of power level yet, just the bare driver. Signed-off-by: Keith Packard <keithp@keithp.com>
* Update avr ao_spi_slave code to match API changesKeith Packard2013-01-13
| | | | | | Made the interface use void * for pointers and uint16_t for lengths Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make APRS interval configurableKeith Packard2012-12-07
| | | | | | | This provides a separate configuration value for APRS, allowing the interval between APRS reports to vary. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Allow telemetry, rdf and APRS to be individually controlledKeith Packard2012-12-06
| | | | | | | But, only when APRS is available so that TeleMetrum and TeleMini don't change behaviour Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Hook APRS up to the radioKeith Packard2012-12-06
| | | | | | | This adds an arbitrary-length packet writing function to the radio code. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make stdio 8-bit clean by making pollchar return intKeith Packard2012-11-30
| | | | | | | | | | We were stealing one value (0xff) in the return value from pollchar to indicate 'not ready yet'. Instead of doing that, use the integer value -1 and have pollchar return an int instead of a char. That necessitated cleaning a few other bits to make sure that 0xff wouldn't get promoted to -1 on accident. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Share getnibble functionKeith Packard2012-11-30
| | | | | | | Two implementations of the same function, one in cc1111/ao_dbg.c and the other in core/ao_send_packet.c. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Remove legacy telemetry from ao_monitor when not neededKeith Packard2012-11-01
| | | | | | | For products not supporting LEGACY_MONITOR, remove the (undefined) structs from the ao_monitor union. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add stack-guard code. Uses STM MPU to trap stack overflow.Keith Packard2012-10-25
| | | | | | | | This marks the lowest portion of the stack as inaccessible to the CPU, causing the processor to fault when it reaches it. The fault then generates a panic message so that the user can know what happened. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Replace __critical usage with ao_arch_critical as neededKeith Packard2012-10-25
| | | | | | | | | | | | | sdcc offers __critical as a machine-independent way to block interrupts, but as gcc doesn't, we need to use a compiler-independent construct instead. ao_arch_critical has been around since the AVR port, but some old __critical usages remained. This fixes a bunch of random hangs when communicating with MM over USB or the radio as the various stdio loops were running without interrupts blocked between the test and the sleep. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Use alt_t for all Pascal-based altitude dataKeith Packard2012-10-12
| | | | | | | This allows alt_t to be overridden for systems using the MS5607/MS5611 sensors Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Allow for other mutex implementationsKeith Packard2012-10-12
| | | | | | Allow projects to replace ao_mutex_get and ao_mutex_put with macros Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Allow projects to specify clock at other than 100HzKeith Packard2012-10-12
| | | | | | Leave the default at 100Hz, but allow it to be overridden Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Split task definitions out to ao_task.hKeith Packard2012-10-12
| | | | | | And only include them if using tasks Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: include ao_arch_funcs.h at the very end of ao.hKeith Packard2012-09-09
| | | | | | Move it below the definition of the ms5607 init function Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add custom panic noise for self-test failuresKeith Packard2012-08-31
| | | | | | Make it easier to tell which component is failing self test Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Note changes to configured AES key for SPI radio convenienceKeith Packard2012-08-29
| | | | | | | Keep a sequence number to mark when the AES key is changed so that the radio code can avoid sending the key before every CMAC radio operation. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Clean up radio APIsKeith Packard2012-08-27
| | | | | | | Move api to ao_radio_cmac.h include file. Expose ao_radio_test as standard API. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add button driver and event queueKeith Packard2012-08-06
| | | | | | | With this, a single task can wait for any button or quadrature input device. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add telefire-v0.1Keith Packard2012-07-29
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make ao_tick_count visibleKeith Packard2012-07-16
| | | | | | | Necessary to fetch it when interrupts are already disabled as we can't call ao_time then. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add arbitrary pyro channel supportKeith Packard2012-07-14
| | | | | | | Programmed by specifying a conjunction of flight conditions that trigger the igniter to fire. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Create macros to convert from/to radio RSSI representationKeith Packard2012-07-11
| | | | | | | | AO_RSSI_FROM_RADIO and AO_RADIO_FROM_RSSI. Removes a bunch of open-coded versions of the same function. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Force 434.550Mhz by connecting debug gnd and clk (trac #41)Keith Packard2012-07-10
| | | | | | | | Check for pin P2_2 low at startup and set the frequency to 434.550MHz. This value won't get written to flash, so rebooting again will restore the configured frequency. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Signal continuity over radio in pad mode (trac #40)Keith Packard2012-07-10
| | | | | | | This is especially useful for telemini which has no beeper, allowing you to hear the continuity signal while at the pad over the air. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Clean up radio CRC handlingKeith Packard2012-06-27
| | | | | | | Make the FEC code just set the CRC_OK bit like the cc1111 radio does; eliminates a bunch of weird conventions across the FEC API. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add GPS logging code for MegaMetrumKeith Packard2012-06-26
| | | | | | | MM uses a different logging format with larger log blocks, so restructure the GPS logging code to fill them up Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make cc1111 radio control functions staticKeith Packard2012-06-26
| | | | | | No need to publish these; they're all private to cc1111 Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add full MM telemetryKeith Packard2012-06-21
| | | | | | | | Create two new telemetry packets to hold all of the MM data. This patch also splits the telemetry structures out of ao.h Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add telemetry to megametrumKeith Packard2012-06-17
| | | | | | Now that the radio works Signed-off-by: Keith Packard <keithp@keithp.com>