2020-02-07 13:53:40 +01:00
|
|
|
/****************************************************************************
|
2021-09-14 15:36:53 +02:00
|
|
|
* boards/arm/s32k1xx/ucans32k146/src/ucans32k146.h
|
2020-02-07 13:53:40 +01:00
|
|
|
*
|
2021-03-17 18:14:12 +01:00
|
|
|
* 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
|
2020-02-07 13:53:40 +01:00
|
|
|
*
|
2021-03-17 18:14:12 +01:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2020-02-07 13:53:40 +01:00
|
|
|
*
|
2021-03-17 18:14:12 +01:00
|
|
|
* 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.
|
2020-02-07 13:53:40 +01:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2021-09-14 15:36:53 +02:00
|
|
|
#ifndef __BOARDS_ARM_S32K1XX_UCANS32K146_SRC_UCANS32K146_H
|
|
|
|
#define __BOARDS_ARM_S32K1XX_UCANS32K146_SRC_UCANS32K146_H
|
2020-02-07 13:53:40 +01:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
#include <nuttx/compiler.h>
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#include "hardware/s32k1xx_pinmux.h"
|
|
|
|
#include "s32k1xx_periphclocks.h"
|
2021-09-16 15:45:09 +02:00
|
|
|
#include "s32k1xx_pin.h"
|
2020-02-07 13:53:40 +01:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Pre-processor Definitions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/* Configuration ************************************************************/
|
|
|
|
|
2021-09-14 15:36:53 +02:00
|
|
|
/* UCANS32K146 GPIOs ********************************************************/
|
2020-02-07 13:53:40 +01:00
|
|
|
|
2021-09-14 15:36:53 +02:00
|
|
|
/* LEDs. The UCANS32K146 has one RGB LED:
|
2020-02-07 13:53:40 +01:00
|
|
|
*
|
2021-09-16 15:45:09 +02:00
|
|
|
* RedLED PTD15 (FTM0 CH0)
|
|
|
|
* GreenLED PTD16 (FTM0 CH1)
|
|
|
|
* BlueLED PTD0 (FTM0 CH2)
|
2020-02-07 13:53:40 +01:00
|
|
|
*
|
2021-09-16 15:45:09 +02:00
|
|
|
* An output of '0' illuminates the LED.
|
2020-02-07 13:53:40 +01:00
|
|
|
*/
|
|
|
|
|
2021-09-16 15:45:09 +02:00
|
|
|
#define GPIO_LED_R (PIN_PTD15 | GPIO_LOWDRIVE | GPIO_OUTPUT_ONE)
|
|
|
|
#define GPIO_LED_G (PIN_PTD16 | GPIO_LOWDRIVE | GPIO_OUTPUT_ONE)
|
|
|
|
#define GPIO_LED_B (PIN_PTD0 | GPIO_LOWDRIVE | GPIO_OUTPUT_ONE)
|
2020-02-07 13:53:40 +01:00
|
|
|
|
2021-09-14 15:36:53 +02:00
|
|
|
/* Buttons. The UCANS32K146 supports one button:
|
2020-02-07 13:53:40 +01:00
|
|
|
*
|
2020-06-15 10:24:23 +02:00
|
|
|
* SW3 PTC14
|
2020-02-07 13:53:40 +01:00
|
|
|
*/
|
|
|
|
|
2020-06-15 10:24:23 +02:00
|
|
|
#define GPIO_SW3 (PIN_PTC14 | PIN_INT_BOTH)
|
2020-02-07 13:53:40 +01:00
|
|
|
|
2021-09-16 15:45:09 +02:00
|
|
|
/* SE050 Secure Element enable pin */
|
2020-02-07 13:53:40 +01:00
|
|
|
|
|
|
|
#define GPIO_SE050_EN (PIN_PTA6 | GPIO_LOWDRIVE)
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Data
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
|
|
|
|
/* User peripheral configuration structure 0 */
|
|
|
|
|
|
|
|
extern const struct peripheral_clock_config_s g_peripheral_clockconfig0[];
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Function Prototypes
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: s32k1xx_bringup
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Perform architecture-specific initialization
|
|
|
|
*
|
|
|
|
* CONFIG_BOARD_LATE_INITIALIZE=y :
|
|
|
|
* Called from board_late_initialize().
|
|
|
|
*
|
2021-08-01 09:00:54 +02:00
|
|
|
* CONFIG_BOARD_LATE_INITIALIZE=y && CONFIG_BOARDCTL=y :
|
2020-02-07 13:53:40 +01:00
|
|
|
* Called from the NSH library
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
int s32k1xx_bringup(void);
|
|
|
|
|
2021-09-16 15:45:09 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Name: s32k1xx_i2cdev_initialize
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Initialize I2C driver and register /dev/i2cN devices.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
int s32k1xx_i2cdev_initialize(void);
|
|
|
|
|
2020-02-07 13:53:40 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* Name: s32k1xx_spidev_initialize
|
|
|
|
*
|
|
|
|
* Description:
|
2021-09-16 15:45:09 +02:00
|
|
|
* Configure chip select pins, initialize the SPI driver and register
|
|
|
|
* /dev/spiN devices.
|
2020-02-07 13:53:40 +01:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2021-09-16 15:45:09 +02:00
|
|
|
int s32k1xx_spidev_initialize(void);
|
2020-02-07 13:53:40 +01:00
|
|
|
|
2023-05-12 10:43:26 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Name: s32k1xx_se05x_initialize
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Initialize SE05x chip and register /dev/se05x
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
int s32k1xx_se05x_initialize(void);
|
|
|
|
|
2020-02-07 13:53:40 +01:00
|
|
|
#endif /* __ASSEMBLY__ */
|
2021-09-14 15:36:53 +02:00
|
|
|
#endif /* __BOARDS_ARM_S32K1XX_UCANS32K146_SRC_UCANS32K146_H */
|