Skip to content

Commit

Permalink
Merge pull request MikroElektronika#47 from MikroElektronika/stefan.f…
Browse files Browse the repository at this point in the history
…ilipovic/21week2023

sync click boards to week 21 of 2023
  • Loading branch information
StefanFilipovic15 authored May 26, 2023
2 parents 345609a + 5e4dd34 commit ec17aa1
Show file tree
Hide file tree
Showing 475 changed files with 30,911 additions and 14,953 deletions.
44 changes: 44 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

**Updates by date of commit:**

+ **[20230526](#20230526)**
+ **[20230519](#20230519)**
+ **[20230512](#20230512)**
+ **[20230505](#20230505)**
Expand Down Expand Up @@ -49,6 +50,49 @@
---
---

## `20230526`

*Following click boards have been added:*

+ `Magneto 13`
+ `HW Monitor 2`
+ `Color 17`
+ `IrDA 4`

*Following click boards have been updated:*

+ `Angle 3`
+ `BLE 9`
+ `ECG GSR`
+ `EEPROM 2`
+ `EEPROM 3`
+ `EEPROM 5`
+ `EERAM 3`
+ `eFuse 2`
+ `eINK 2.00 inch display`
+ `eINK 1.54 inch display`
+ `eINK 2.13 inch display`
+ `eINK 2.90 inch display`
+ `Expand 7`
+ `Fingerprint 3`
+ `Flash 8`
+ `Force 2`
+ `GMR Angle`
+ `G2C 3G`
+ `LDC Touch`
+ `LIN`
+ `I2C Extend`
+ `Hall Current 14`
+ `Hall Current 15`
+ `Heart rate 2`
+ `MIC 3`
+ `USB to I2C 2`
+ `UART Mux`

**[BACK TO TOP](#changelog)**

---

## `20230519`

*Following click boards have been added:*
Expand Down
412 changes: 207 additions & 205 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion clicks/angle3/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Changelog

### Version 2.0.0.8
### Version 2.1.0.8
- Initial release
27 changes: 27 additions & 0 deletions clicks/angle3/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
cmake_minimum_required(VERSION 3.21)
if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC")
project(example_angle3 LANGUAGES MikroC)
else()
project(example_angle3 LANGUAGES C ASM)
endif()

if (NOT PROJECT_TYPE)
set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE)
endif()

add_executable(example_angle3
example/main.c

)


############################ example_angle3 GENERATED CODE START ###########################
find_package(MikroC.Core REQUIRED)
target_link_libraries(example_angle3 PUBLIC MikroC.Core)
find_package(MikroSDK.Board REQUIRED)
target_link_libraries(example_angle3 PUBLIC MikroSDK.Board)
find_package(MikroSDK.Log REQUIRED)
target_link_libraries(example_angle3 PUBLIC MikroSDK.Log)
add_subdirectory(lib_angle3)
target_link_libraries(example_angle3 PUBLIC Click.Angle3)
############################ example_angle3 GENERATED CODE END ###########################
91 changes: 52 additions & 39 deletions clicks/angle3/DETAILS.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,39 +37,48 @@ Package can be downloaded/installed directly form compilers IDE(recommended way)
#### Standard key functions :

- Config Object Initialization function.
> void angle3_cfg_setup ( angle3_cfg_t *cfg );
- Initialization function.
> ANGLE3_RETVAL angle3_init ( angle3_t *ctx, angle3_cfg_t *cfg );
- `angle3_cfg_setup` Config Object Initialization function.
```c
void angle3_cfg_setup ( angle3_cfg_t *cfg );
```
- `angle3_init` Initialization function.
```c
err_t angle3_init ( angle3_t *ctx, angle3_cfg_t *cfg );
```

#### Example key functions :

- Writes given data to given address.
> void angle3_write_data ( angle3_t* ctx, uint8_t opcode, uint8_t reg, uint16_t write_data );
- Reads data from given address.
> uint16_t angle3_read_data ( angle3_t* ctx, uint8_t opcode, uint8_t reg );
- `angle3_write_data` Writes given data to given address.
```c
void angle3_write_data ( angle3_t* ctx, uint8_t opcode, uint8_t reg, uint16_t write_data );
```
- Function reads the latest angle output data.
> uint16_t angle3_read_angle_data( angle3_t* ctx );
- `angle3_read_data` Reads data from given address.
```c
uint16_t angle3_read_data ( angle3_t* ctx, uint8_t opcode, uint8_t reg );
```

- `angle3_read_angle_data` Function reads the latest angle output data.
```c
uint16_t angle3_read_angle_data( angle3_t* ctx );
```
## Examples Description
> This example reads data from the sensor, calculates and logs the result.
> This application reads data from the angle sensor, calculates it to degrees and writes it to the terminal.
**The demo application is composed of two sections :**
### Application Init
> Driver initialization, sets sensor to normal mode and starts writting to log.
> Initialization driver enable's - SPI, set normal mode and start write log.
```c
void application_init ( void )
{
log_cfg_t log_cfg;
log_cfg_t log_cfg;
angle3_cfg_t angle3_cfg;
/**
Expand All @@ -86,49 +95,53 @@ void application_init ( void )
log_info( &logger, "---- Application Init ----" );
// Click initialization.

angle3_cfg_setup( &angle3_cfg );
ANGLE3_MAP_MIKROBUS( angle3_cfg, MIKROBUS_1 );
angle3_init( &angle3, &angle3_cfg );
angle3_default_cfg( &angle3 );

if ( ANGLE3_ERROR == angle3_init( &angle3, &angle3_cfg ) )
{
log_info( &logger, "---- Application Init Error ----" );
log_info( &logger, "---- Please, run program again... ----" );
for ( ; ; );
}
angle3_default_cfg ( &angle3 );
log_info( &logger, "---- Application Task ----\n" );
}
```

### Application Task

> Angle 3 Click communicates with registers via SPI, reads data from the angle
> sensor, calculates it to degrees and writes it to the terminal.
> Angle 3 Click communicates with registers via SPI, reads data from the angle sensor, calculates it to degrees and writes it to the terminal.
```c

void application_task ( void )
{
angle_value_old = 0;
static uint16_t angle_value_old = 0;

if ( angle3_read_error( &angle3 ) )
{
angle_value = angle3_read_angle_data( &angle3 );
if ( angle3_read_error( &angle3 ) )
{
uint16_t angle_value = angle3_read_angle_data( &angle3 );

if ( angle_value_old != angle_value )
{
angle_data_degrees = angle3_calculate_degrees( &angle3, angle_value );
if ( angle_value_old != angle_value )
{
float angle_data_degrees = angle3_calculate_degrees( &angle3, angle_value );

log_printf( &logger, "Angle : %d deg \r\n", angle_data_degrees );
log_printf( &logger, " Angle : %.1f deg\r\n", angle_data_degrees );

angle_value_old = angle_value;
angle_value_old = angle_value;

Delay_ms( 1000 );
}
}
else
{
log_printf( &logger, "Magnetic Field Too Weak\r\n" );
Delay_ms( 300 );
}
}
else
{
log_printf( &logger, " Magnetic Field Too Weak\r\n" );

Delay_ms( 1000 );
}
angle_value_old = 0;
Delay_ms( 1000 );
}
}

```
Expand Down
92 changes: 52 additions & 40 deletions clicks/angle3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,40 +38,48 @@ Package can be downloaded/installed directly form compilers IDE(recommended way)
#### Standard key functions :

- Config Object Initialization function.
> void angle3_cfg_setup ( angle3_cfg_t *cfg );
- Initialization function.
> ANGLE3_RETVAL angle3_init ( angle3_t *ctx, angle3_cfg_t *cfg );
- `angle3_cfg_setup` Config Object Initialization function.
```c
void angle3_cfg_setup ( angle3_cfg_t *cfg );
```
- `angle3_init` Initialization function.
```c
err_t angle3_init ( angle3_t *ctx, angle3_cfg_t *cfg );
```

#### Example key functions :

- Writes given data to given address.
> void angle3_write_data ( angle3_t* ctx, uint8_t opcode, uint8_t reg, uint16_t write_data );
- Reads data from given address.
> uint16_t angle3_read_data ( angle3_t* ctx, uint8_t opcode, uint8_t reg );
- `angle3_write_data` Writes given data to given address.
```c
void angle3_write_data ( angle3_t* ctx, uint8_t opcode, uint8_t reg, uint16_t write_data );
```
- Function reads the latest angle output data.
> uint16_t angle3_read_angle_data( angle3_t* ctx );
- `angle3_read_data` Reads data from given address.
```c
uint16_t angle3_read_data ( angle3_t* ctx, uint8_t opcode, uint8_t reg );
```

- `angle3_read_angle_data` Function reads the latest angle output data.
```c
uint16_t angle3_read_angle_data( angle3_t* ctx );
```
## Examples Description
> This example reads data from the sensor, calculates and logs the result.
> This application reads data from the angle sensor, calculates it to degrees and writes it to the terminal.
**The demo application is composed of two sections :**
### Application Init
> Driver initialization, sets sensor to normal mode and starts writting to log.
> Initialization driver enable's - SPI, set normal mode and start write log.
```c
void application_init ( void )
{
log_cfg_t log_cfg;
log_cfg_t log_cfg;
angle3_cfg_t angle3_cfg;
/**
Expand All @@ -88,49 +96,53 @@ void application_init ( void )
log_info( &logger, "---- Application Init ----" );
// Click initialization.

angle3_cfg_setup( &angle3_cfg );
ANGLE3_MAP_MIKROBUS( angle3_cfg, MIKROBUS_1 );
angle3_init( &angle3, &angle3_cfg );
angle3_default_cfg( &angle3 );

if ( ANGLE3_ERROR == angle3_init( &angle3, &angle3_cfg ) )
{
log_info( &logger, "---- Application Init Error ----" );
log_info( &logger, "---- Please, run program again... ----" );
for ( ; ; );
}
angle3_default_cfg ( &angle3 );
log_info( &logger, "---- Application Task ----\n" );
}
```

### Application Task

> Angle 3 Click communicates with registers via SPI, reads data from the angle
> sensor, calculates it to degrees and writes it to the terminal.
> Angle 3 Click communicates with registers via SPI, reads data from the angle sensor, calculates it to degrees and writes it to the terminal.
```c

void application_task ( void )
{
angle_value_old = 0;
static uint16_t angle_value_old = 0;

if ( angle3_read_error( &angle3 ) )
{
angle_value = angle3_read_angle_data( &angle3 );
if ( angle3_read_error( &angle3 ) )
{
uint16_t angle_value = angle3_read_angle_data( &angle3 );

if ( angle_value_old != angle_value )
{
angle_data_degrees = angle3_calculate_degrees( &angle3, angle_value );
if ( angle_value_old != angle_value )
{
float angle_data_degrees = angle3_calculate_degrees( &angle3, angle_value );

log_printf( &logger, "Angle : %d deg \r\n", angle_data_degrees );
log_printf( &logger, " Angle : %.1f deg\r\n", angle_data_degrees );

angle_value_old = angle_value;
angle_value_old = angle_value;

Delay_ms( 1000 );
}
}
else
{
log_printf( &logger, "Magnetic Field Too Weak\r\n" );
Delay_ms( 300 );
}
}
else
{
log_printf( &logger, " Magnetic Field Too Weak\r\n" );

Delay_ms( 1000 );
}
angle_value_old = 0;
Delay_ms( 1000 );
}
}

```
Expand Down
Loading

0 comments on commit ec17aa1

Please sign in to comment.