Mouse code for the MacroRat

Dependencies:   ITG3200 QEI

Committer:
sahilmgandhi
Date:
Fri May 26 17:21:04 2017 +0000
Revision:
34:69342782fb68
Parent:
18:6a4db94011d3
Added small reverse turns before the break so that we can stop faster.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sahilmgandhi 18:6a4db94011d3 1 /* mbed Microcontroller Library
sahilmgandhi 18:6a4db94011d3 2 * Copyright (c) 2016 u-blox
sahilmgandhi 18:6a4db94011d3 3 *
sahilmgandhi 18:6a4db94011d3 4 * Licensed under the Apache License, Version 2.0 (the "License");
sahilmgandhi 18:6a4db94011d3 5 * you may not use this file except in compliance with the License.
sahilmgandhi 18:6a4db94011d3 6 * You may obtain a copy of the License at
sahilmgandhi 18:6a4db94011d3 7 *
sahilmgandhi 18:6a4db94011d3 8 * http://www.apache.org/licenses/LICENSE-2.0
sahilmgandhi 18:6a4db94011d3 9 *
sahilmgandhi 18:6a4db94011d3 10 * Unless required by applicable law or agreed to in writing, software
sahilmgandhi 18:6a4db94011d3 11 * distributed under the License is distributed on an "AS IS" BASIS,
sahilmgandhi 18:6a4db94011d3 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
sahilmgandhi 18:6a4db94011d3 13 * See the License for the specific language governing permissions and
sahilmgandhi 18:6a4db94011d3 14 * limitations under the License.
sahilmgandhi 18:6a4db94011d3 15 */
sahilmgandhi 18:6a4db94011d3 16
sahilmgandhi 18:6a4db94011d3 17 #ifndef MBED_OBJECTS_H
sahilmgandhi 18:6a4db94011d3 18 #define MBED_OBJECTS_H
sahilmgandhi 18:6a4db94011d3 19
sahilmgandhi 18:6a4db94011d3 20 #include "cmsis.h"
sahilmgandhi 18:6a4db94011d3 21 #include "PortNames.h"
sahilmgandhi 18:6a4db94011d3 22 #include "PeripheralNames.h"
sahilmgandhi 18:6a4db94011d3 23 #include "PinNames.h"
sahilmgandhi 18:6a4db94011d3 24 #include "stdbool.h"
sahilmgandhi 18:6a4db94011d3 25
sahilmgandhi 18:6a4db94011d3 26 #ifdef __cplusplus
sahilmgandhi 18:6a4db94011d3 27 extern "C" {
sahilmgandhi 18:6a4db94011d3 28 #endif
sahilmgandhi 18:6a4db94011d3 29
sahilmgandhi 18:6a4db94011d3 30 typedef enum {
sahilmgandhi 18:6a4db94011d3 31 IRQ_NOT_SET,
sahilmgandhi 18:6a4db94011d3 32 IRQ_ON,
sahilmgandhi 18:6a4db94011d3 33 IRQ_OFF
sahilmgandhi 18:6a4db94011d3 34 } irq_setting_t;
sahilmgandhi 18:6a4db94011d3 35
sahilmgandhi 18:6a4db94011d3 36 struct port_s {
sahilmgandhi 18:6a4db94011d3 37 __IO uint32_t *reg_dir;
sahilmgandhi 18:6a4db94011d3 38 __IO uint32_t *reg_out;
sahilmgandhi 18:6a4db94011d3 39 __IO uint32_t *reg_val;
sahilmgandhi 18:6a4db94011d3 40 __IO uint32_t *reg_drv;
sahilmgandhi 18:6a4db94011d3 41 PortName port;
sahilmgandhi 18:6a4db94011d3 42 uint32_t mask;
sahilmgandhi 18:6a4db94011d3 43 };
sahilmgandhi 18:6a4db94011d3 44
sahilmgandhi 18:6a4db94011d3 45 struct gpio_irq_s {
sahilmgandhi 18:6a4db94011d3 46 /* Don't bother with having a port number here as there's only one */
sahilmgandhi 18:6a4db94011d3 47 uint32_t ch; /* Corresponds to the interrupt pin */
sahilmgandhi 18:6a4db94011d3 48 };
sahilmgandhi 18:6a4db94011d3 49
sahilmgandhi 18:6a4db94011d3 50 struct serial_s {
sahilmgandhi 18:6a4db94011d3 51 SerialConfig config;
sahilmgandhi 18:6a4db94011d3 52 PinName rx_pin;
sahilmgandhi 18:6a4db94011d3 53 PinName tx_pin;
sahilmgandhi 18:6a4db94011d3 54 volatile uart_ctrl_t *reg_base;
sahilmgandhi 18:6a4db94011d3 55 uint8_t index;
sahilmgandhi 18:6a4db94011d3 56 uint32_t baud_rate;
sahilmgandhi 18:6a4db94011d3 57 bool format_set; /* If true then the struct that follows is populated */
sahilmgandhi 18:6a4db94011d3 58 struct {
sahilmgandhi 18:6a4db94011d3 59 uint8_t stop_bits;
sahilmgandhi 18:6a4db94011d3 60 uint8_t data_bits;
sahilmgandhi 18:6a4db94011d3 61 uint8_t parity;
sahilmgandhi 18:6a4db94011d3 62 } format;
sahilmgandhi 18:6a4db94011d3 63 irq_setting_t irq_rx_setting;
sahilmgandhi 18:6a4db94011d3 64 irq_setting_t irq_tx_setting;
sahilmgandhi 18:6a4db94011d3 65 };
sahilmgandhi 18:6a4db94011d3 66
sahilmgandhi 18:6a4db94011d3 67 #include "gpio_object.h"
sahilmgandhi 18:6a4db94011d3 68
sahilmgandhi 18:6a4db94011d3 69 #ifdef __cplusplus
sahilmgandhi 18:6a4db94011d3 70 }
sahilmgandhi 18:6a4db94011d3 71 #endif
sahilmgandhi 18:6a4db94011d3 72
sahilmgandhi 18:6a4db94011d3 73 #endif