Rename the misspelled peripherials directory to peripherals.
This commit is contained in:
8
right/src/peripherals/merge_sensor.c
Normal file
8
right/src/peripherals/merge_sensor.c
Normal file
@@ -0,0 +1,8 @@
|
||||
#include "merge_sensor.h"
|
||||
#include "fsl_port.h"
|
||||
|
||||
void InitMergeSensor() {
|
||||
CLOCK_EnableClock(MERGE_SENSOR_CLOCK);
|
||||
PORT_SetPinConfig(MERGE_SENSOR_PORT, MERGE_SENSOR_PIN,
|
||||
&(port_pin_config_t){.pullSelect=kPORT_PullUp, .mux=kPORT_MuxAsGpio});
|
||||
}
|
||||
32
right/src/peripherals/merge_sensor.h
Normal file
32
right/src/peripherals/merge_sensor.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef __MERGE_SENSOR_H__
|
||||
#define __MERGE_SENSOR_H__
|
||||
|
||||
// Includes:
|
||||
|
||||
#include "fsl_gpio.h"
|
||||
|
||||
// Macros:
|
||||
|
||||
#if UHK_PCB_MAJOR_VERSION >= 7
|
||||
#define MERGE_SENSOR_GPIO GPIOB
|
||||
#define MERGE_SENSOR_PORT PORTB
|
||||
#define MERGE_SENSOR_CLOCK kCLOCK_PortB
|
||||
#define MERGE_SENSOR_PIN 3
|
||||
#define MERGE_SENSOR_IRQ PORTB_IRQn
|
||||
#define MERGE_SENSOR_IRQ_HANDLER PORTB_IRQHandler
|
||||
#else
|
||||
#define MERGE_SENSOR_GPIO GPIOB
|
||||
#define MERGE_SENSOR_PORT PORTB
|
||||
#define MERGE_SENSOR_CLOCK kCLOCK_PortB
|
||||
#define MERGE_SENSOR_PIN 2
|
||||
#define MERGE_SENSOR_IRQ PORTB_IRQn
|
||||
#define MERGE_SENSOR_IRQ_HANDLER PORTB_IRQHandler
|
||||
#endif
|
||||
|
||||
#define MERGE_SENSOR_IS_MERGED !GPIO_ReadPinInput(MERGE_SENSOR_GPIO, MERGE_SENSOR_PIN)
|
||||
|
||||
// Functions:
|
||||
|
||||
extern void InitMergeSensor();
|
||||
|
||||
#endif
|
||||
8
right/src/peripherals/reset_button.c
Normal file
8
right/src/peripherals/reset_button.c
Normal file
@@ -0,0 +1,8 @@
|
||||
#include "reset_button.h"
|
||||
#include "fsl_port.h"
|
||||
|
||||
void InitResetButton() {
|
||||
CLOCK_EnableClock(RESET_BUTTON_CLOCK);
|
||||
PORT_SetPinConfig(RESET_BUTTON_PORT, RESET_BUTTON_PIN,
|
||||
&(port_pin_config_t){.pullSelect=kPORT_PullUp, .mux=kPORT_MuxAsGpio});
|
||||
}
|
||||
23
right/src/peripherals/reset_button.h
Normal file
23
right/src/peripherals/reset_button.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef _RESET_BUTTON_H_
|
||||
#define _RESET_BUTTON_H_
|
||||
|
||||
// Includes:
|
||||
|
||||
#include "fsl_gpio.h"
|
||||
|
||||
// Macros:
|
||||
|
||||
#define RESET_BUTTON_GPIO GPIOB
|
||||
#define RESET_BUTTON_PORT PORTB
|
||||
#define RESET_BUTTON_CLOCK kCLOCK_PortB
|
||||
#define RESET_BUTTON_PIN 1
|
||||
#define RESET_BUTTON_IRQ PORTB_IRQn
|
||||
#define RESET_BUTTON_IRQ_HANDLER PORTB_IRQHandler
|
||||
|
||||
#define RESET_BUTTON_IS_PRESSED !GPIO_ReadPinInput(RESET_BUTTON_GPIO, RESET_BUTTON_PIN)
|
||||
|
||||
// Functions:
|
||||
|
||||
extern void InitResetButton();
|
||||
|
||||
#endif
|
||||
10
right/src/peripherals/test_led.c
Normal file
10
right/src/peripherals/test_led.c
Normal file
@@ -0,0 +1,10 @@
|
||||
#include "test_led.h"
|
||||
#include "fsl_port.h"
|
||||
|
||||
extern void InitTestLed()
|
||||
{
|
||||
CLOCK_EnableClock(TEST_LED_CLOCK);
|
||||
PORT_SetPinMux(TEST_LED_GPIO_PORT, TEST_LED_GPIO_PIN, kPORT_MuxAsGpio);
|
||||
GPIO_PinInit(TEST_LED_GPIO, TEST_LED_GPIO_PIN, &(gpio_pin_config_t){kGPIO_DigitalOutput, 1});
|
||||
TEST_LED_ON();
|
||||
}
|
||||
27
right/src/peripherals/test_led.h
Normal file
27
right/src/peripherals/test_led.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef __TEST_LED_H__
|
||||
#define __TEST_LED_H__
|
||||
|
||||
// Includes:
|
||||
|
||||
#include "fsl_gpio.h"
|
||||
|
||||
// Macros:
|
||||
|
||||
#define LOGIC_LED_ON 0U
|
||||
#define LOGIC_LED_OFF 1U
|
||||
|
||||
#define TEST_LED_GPIO GPIOD
|
||||
#define TEST_LED_GPIO_PORT PORTD
|
||||
#define TEST_LED_CLOCK kCLOCK_PortD
|
||||
#define TEST_LED_GPIO_PIN 7U
|
||||
|
||||
#define TEST_LED_ON() GPIO_SetPinsOutput(TEST_LED_GPIO, 1U << TEST_LED_GPIO_PIN)
|
||||
#define TEST_LED_OFF() GPIO_ClearPinsOutput(TEST_LED_GPIO, 1U << TEST_LED_GPIO_PIN)
|
||||
#define TEST_LED_SET(state) GPIO_WritePinOutput(TEST_LED_GPIO, TEST_LED_GPIO_PIN, (state))
|
||||
#define TEST_LED_TOGGLE() GPIO_TogglePinsOutput(TEST_LED_GPIO, 1U << TEST_LED_GPIO_PIN)
|
||||
|
||||
// Functions:
|
||||
|
||||
extern void InitTestLed();
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user