sipo implemented
This commit is contained in:
+4
-1
@@ -240,6 +240,8 @@ char * pinmask2str_up(uint32_t pins, char *buffer)
|
||||
return buffer;
|
||||
}
|
||||
|
||||
#pragma GCC push_options
|
||||
#pragma GCC optimize ("O2")
|
||||
/** spread a packed pinfield using a mask */
|
||||
uint32_t pinmask_spread_32(uint32_t packed, uint32_t mask)
|
||||
{
|
||||
@@ -247,7 +249,7 @@ uint32_t pinmask_spread_32(uint32_t packed, uint32_t mask)
|
||||
uint32_t poke = 1;
|
||||
if(packed == 0) return 0;
|
||||
|
||||
for (int i = 0; i<32; i++) {
|
||||
for (int i = 0; i < 32; i++) {
|
||||
if (mask & 1) {
|
||||
if (packed & poke) {
|
||||
result |= 1<<i;
|
||||
@@ -295,6 +297,7 @@ uint8_t pinmask_translate(uint32_t mask, uint8_t index)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#pragma GCC pop_options
|
||||
|
||||
/** Configure unit pins as analog (part of unit teardown) */
|
||||
void hw_deinit_unit_pins(Unit *unit)
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "units/test/unit_test.h"
|
||||
#include "units/usart/unit_usart.h"
|
||||
#include "units/spi/unit_spi.h"
|
||||
#include "units/sipo/unit_sipo.h"
|
||||
#include "hw_utils.h"
|
||||
|
||||
void plat_init_resources(void)
|
||||
@@ -86,6 +87,7 @@ void plat_init_resources(void)
|
||||
ureg_add_type(&UNIT_USART);
|
||||
ureg_add_type(&UNIT_1WIRE);
|
||||
ureg_add_type(&UNIT_ADC);
|
||||
ureg_add_type(&UNIT_SIPO);
|
||||
|
||||
// Free all present resources
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user