|
void | CS_pin_set (uint8_t port, uint8_t pin, uint8_t value) |
| ON/OFF control from the MCU to the IRPyro sensor. More...
|
|
static void | Emitter_configure_as_input (void) |
| Configuration when the EXTERNAL emitter is selected. More...
|
|
static void | Emitter_configure_as_output (void) |
| Configuration when the INTERNAL emitter is selected. More...
|
|
void | Emitter_control (uint8_t *EmitterStatus, uint8_t EmitterONTime, uint8_t EmitterOFFTime) |
| Changes Emitter status and applies timing parameters. More...
|
|
static void | Emitter_status_and_timer_set (uint8_t *EmitterStatus, uint8_t EmitterONTime) |
|
static void | Emitter_status_and_timer_update (uint8_t *EmitterStatus, uint8_t EmitterONTime, uint8_t EmitterOFFTime) |
|
static uint8_t | Emitter_status_evaluate (uint8_t EmitterStatus) |
|
static void | Emitter_toggle (uint8_t *EmitterStatus, uint8_t EmitterONTime, uint8_t EmitterOFFTime) |
|
static void | EXTernal_Callback_Disable (void) |
| Ends function callbacks. More...
|
|
static void | EXTernal_Callback_Enable (EXTernal_callback Callback) |
| Starts function callbacks. More...
|
|
void | EXTernal_Callback_Setup (EXTernal_callback Callback) |
| Configures function callbacks. More...
|
|
static void | EXTI4_Config (void) |
| Configure Sensor 1 INT line in interrupt mode. More...
|
|
void | EXTI4_IRQHandler (void) |
| This function handles external line 4 interrupt request. More...
|
|
static void | EXTI9_5_Config (void) |
| Configure Sensor 2,3, and 4 INT line in interrupt mode. More...
|
|
void | EXTI9_5_IRQHandler (void) |
| This function handles external lines 5 to 9 interrupt request. More...
|
|
uint8_t | EXTI_detected (uint8_t exti_line) |
| This function access the status of the interrupt lines for the wake up event. More...
|
|
static void | GPIO_structure_init (uint32_t GPIO_Pin_x, GPIOMode_TypeDef GPIO_Mode, GPIOOType_TypeDef Output_Type, GPIOSpeed_TypeDef Speed, GPIOPuPd_TypeDef PuPd, GPIO_TypeDef *GPIOx) |
| Populates and initializes GPIO structures. More...
|
|
static void | i2c_Init (I2C_Config_Type *External_Config) |
| Initializes the I2C Hardware (I2C1). More...
|
|
uint8_t | i2c_Read (uint8_t DeviceAddr, uint8_t Command, uint8_t *pBuffer, uint16_t len) |
| Reads data via I2C port. More...
|
|
uint8_t | i2c_Write (uint8_t DeviceAddr, uint8_t Command, uint8_t *pBuffer, uint8_t len) |
| Sends data via I2C port. More...
|
|
uint8_t | INT_pin_read (uint8_t port, uint8_t pin) |
| Reads the status of the pin assigned to the INT line of IRPyro. More...
|
|
void | LED_READY (uint8_t LED_ready) |
| Control for the READY led state. More...
|
|
static void | LED_RUN (uint8_t LED_run) |
| Controls RUN led state. More...
|
|
uint32_t | Micro_controller_delay_get (void) |
| Retrieves the tick counter. More...
|
|
void | Micro_controller_delay_ms (uint32_t time_ms) |
| Example of delay function. More...
|
|
void | Micro_controller_delay_set (uint32_t delay) |
| Sets the tick counter. More...
|
|
void | Micro_controller_delay_us (uint32_t time_us) |
| Example of delay function in micro seconds. Refer to section "12.8 Device Power Up and Reset" in the Reference Manual. More...
|
|
static void | Micro_controller_External_interrupt_init (void) |
| Initializes the USART 2 on the STM32F303K8 PORT A and pins 2,15 are used. Refer to STM document RM0316 section 29 and the stm32f30x_usart.c. More...
|
|
static void | Micro_controller_GPIO_init (void) |
| Example of board initialization to set up all the ports and peripherals. (Read_Me.txt) More...
|
|
static void | Micro_controller_I2C_init (void) |
| Calls I2C initialization. See Read_Me.txt. More...
|
|
static void | Micro_controller_LED_configure (void) |
| configures and enables status LED's on the backplane boards More...
|
|
uint32_t | Micro_controller_sample_period_timer_get (void) |
|
void | Micro_controller_sample_period_timer_set (uint32_t count_value) |
|
static void | Micro_controller_Systick_init (uint16_t frequency) |
| Example of board timer initialization to set a delay. More...
|
|
void | Micro_controller_template_init (void) |
| Groups all required initialization in one function. More...
|
|
static void | Micro_controller_TIM_init (void) |
| Configuration for hardware timer for emitter control. More...
|
|
uint32_t | Micro_controller_timeout_get (void) |
| Recovers the tick_down value to check is not expired. More...
|
|
void | Micro_controller_timeout_set (uint32_t timeout) |
| Sets the tick_down to monitor a time out. More...
|
|
static void | Micro_controller_UART_init (void) |
| Initializes the USART 2 on the STM32F303K8 PORT A and pins 2,15 are used. Refer to STM document RM0316 section 29 and the stm32f30x_usart.c. More...
|
|
void | power_set (uint8_t port, uint8_t pin) |
| Power sequence from the MCU to the IRPyro sensor. More...
|
|
void | SysTick_Handler (void) |
| Updates the both tick counters on a Systick interrupt every millisecond. More...
|
|
static uint32_t | SysTick_millis (void) |
| return the system clock as milliseconds More...
|
|
void | TIM3_IRQHandler (void) |
| Interrupt timer for running LED on backplane boards. More...
|
|
static void | TIM_Callback_Disable (void) |
| Ends function callbacks. More...
|
|
static void | TIM_Callback_Enable (EXTernal_callback Callback) |
| Starts function callbacks. More...
|
|
void | TIM_Callback_Setup (TIM_callback Callback) |
| Configures function callbacks. More...
|
|
uint8_t | UART_byte_get () |
| Interface to acces uart_byte. More...
|
|
static void | UART_display_write (char const *format,...) |
| Formats output and sends to USART as a string. More...
|
|
void | UART_PutChar (USART_TypeDef *USARTx, uint8_t ch) |
| Puts a char in the USART. More...
|
|
void | UART_PutNumber (USART_TypeDef *USARTx, uint32_t number) |
| Puts a number in the USART. More...
|
|
void | UART_PutString (USART_TypeDef *USARTx, uint8_t *str) |
| Puts a string in the USART. More...
|
|
void | UART_stream_binary_send (uint8_t *DataS) |
| Builds a binary data packet for the channels of the sensor, frame counter and saturation byte. More...
|
|
void | UART_stream_char_send (uint32_t *channel_value, uint8_t channel_saturation) |
| Plain text data for the active channels of the sensor including, frame counter and saturation byte. More...
|
|
void | USART2_IRQHandler () |
| Handles incomming char from the USART and stores it in global uart_byte. More...
|
|
static void | USART_Callback_Rx_Disable (void) |
| Ends function callbacks. More...
|
|
static void | USART_Callback_Rx_Enable (USART_callback Callback) |
|
void | USART_Callback_Rx_Setup (USART_callback Callback) |
| Configures function callbacks. More...
|
|
static void | USART_Callback_Tx_Disable (void) |
| Ends function callbacks. More...
|
|
static void | USART_Callback_Tx_Enable (USART_callback Callback) |
| Starts function callbacks. More...
|
|
void | USART_Callback_Tx_Setup (USART_callback Callback) |
| Configures function callbacks. More...
|
|
Micro controller specific code to access the IRPyro sensor.
- Author
- _KEMET, Ltd
- Date
- March 2018
- Version
- Release 1.0.6
- Copyright
- (c) 2018 _KEMET, Ltd
===============================================================================
##### How to use this template #####
===============================================================================
[..]
(#) The Micro_controller_template.c and Micro_controller_template.h contain
the minimal declarations and function implementation that are specific
to the hardware configuration in which an IRPyro sensor is connected.
(#) This template is organized in two layers:
(++) Private functions which are micro controller and board specific,
for initialization and configuration.
(+++) GPIO initialization
GPIO_structure_init(): Enables the specific port-pin combination
specific to ARM micro controller
(see ../Libraries/STM32F30x_StdPeriph_Driver/src/stm32f30x_gpio.c)
(+++) I2C initialization
Micro_controller_I2C_init(): High level load of the data structure
specific to I2C implementation on ARM micro controllers.
i2c_Init(): Detailed initialization of I2C specific to ARM micro controllers.
(+++) Timer configuration
(+++) External Interrupt configuration
(+++) USART configuration
Locate the pins dedicated to the USART in your micro controller
Change the values accordingly on Micro_controller_UART_Init()
Configure RealTerm or similar with this values:
Baud rate: 921600
Parity : None
Data Bits: 8
Stop Bits: 1
Hardware Flow Control: None
Capture streaming data.
(++) Public interface functions to the IRPyro API. The purpose is to provide
a layer to hide the specifics of the micro controller regarding:
(+++) Micro_controller_template functions
(-) Micro_controller_template_init(): Groups together the private
configuration functions.
(-) Micro_controller_delay_ms(): To provide a delay function,
required only at power-up of the IRPyro sensor
(+++) GPIO Control Functions
(-) INT_pin_read(): If this pin is active low FIFO data is ready.
(-) CS_pin_set() : Control of IRPyro power line.
(-) power_set() : Power up toggle sequence.
(+++) I2C Control Functions prototypes
(-) i2c_Write() : Sends commands to the IRPyro via I2C
(-) i2c_Read() : Retrieves status / data from the IRPyro via I2C
(+++) USART Access Functions prototypes
(-) UART_byte_get() : Recovers a byte from the USART
(-) UART_stream_send(): Sends collected data from the IRPyro
(#) The present example is tailored for the STM32F303 NUCLEO-32 micro controllers
*
- Attention
© COPYRIGHT 2018 _KEMET, Ltd
Copyright (c) 2018, _KEMET, Ltd
All rights reserved.
THIS SOFTWARE IS PROVIDED BY _KEMET, Ltd ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL _KEMET, Ltd BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition in file Micro_controller_template.c.