nuttx/boards/arm/kinetis/teensy-3.x/src/teensy-3x.h

109 lines
3.7 KiB
C
Raw Normal View History

/****************************************************************************
* boards/arm/kinetis/teensy-3.x/src/teensy-3x.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
#ifndef __BOARDS_ARM_KINETIS_TEENSY_3X_SRC_TEENSY_3X_H
#define __BOARDS_ARM_KINETIS_TEENSY_3X_SRC_TEENSY_3X_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <nuttx/compiler.h>
#include <stdint.h>
2015-09-08 18:19:34 +02:00
#include <arch/kinetis/chip.h>
2016-08-13 23:57:50 +02:00
#include <nuttx/i2c/i2c_master.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* How many SPI modules does this chip support? The LM3S6918 supports 2 SPI
* modules (others may support more -- in such case, the following must be
* expanded).
*/
#if KINETIS_NSPI < 1
# undef CONFIG_KINETIS_SPI1
# undef CONFIG_KINETIS_SPI2
#elif KINETIS_NSPI < 2
# undef CONFIG_KINETIS_SPI2
#endif
/* Teensy 3.1 GPIOs *********************************************************/
/* A single LED is available driven by PTC5.
* The LED is grounded so bringing PTC5 high will illuminate the LED.
*/
#define GPIO_LED (GPIO_HIGHDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTC | PIN5)
#ifndef __ASSEMBLY__
/****************************************************************************
* Public Functions Definitions
****************************************************************************/
/****************************************************************************
* Name: kinetis_spidev_initialize
*
* Description:
* Called to configure SPI chip select GPIO pins for the KwikStik-K40
* board.
*
****************************************************************************/
extern void weak_function kinetis_spidev_initialize(void);
/****************************************************************************
* Name: kinetis_i2cdev_initialize
*
* Description:
* Called to configure I2C
*
****************************************************************************/
2016-08-09 19:01:27 +02:00
void kinetis_i2cdev_initialize(void);
/****************************************************************************
* Name: kinetis_usbinitialize
*
* Description:
* Called to setup USB-related GPIO pins for the KwikStik-K40 board.
*
****************************************************************************/
extern void weak_function kinetis_usbinitialize(void);
/****************************************************************************
* Name: kinetis_pwm_setup
*
* Description:
* Initialize PWM and register the PWM device.
*
****************************************************************************/
#ifdef CONFIG_PWM
int kinetis_pwm_setup(void);
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_ARM_KINETIS_TEENSY_3X_SRC_TEENSY_3X_H */